mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-01 20:46:41 +00:00
Properly patch Game Master Blocks (#245)
* Break cancelled blocks on interact * Cancel master blocks * Add Scissors maven repository * Remove Scissors repo (it is already included in the AMG repo) * Remove unused import & add TODO for the 1.19 port
This commit is contained in:
@ -69,24 +69,22 @@ public class InteractBlocker extends FreedomService
|
||||
private void handleRightClick(PlayerInteractEvent event)
|
||||
{
|
||||
final Player player = event.getPlayer();
|
||||
final Block clickedBlock = event.getClickedBlock();
|
||||
|
||||
if (event.getClickedBlock() != null)
|
||||
if (clickedBlock == null)
|
||||
{
|
||||
if (event.getClickedBlock().getType().equals(Material.STRUCTURE_BLOCK) || event.getClickedBlock().getType().equals(Material.JIGSAW) || event.getClickedBlock().getType().equals(Material.RESPAWN_ANCHOR))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
event.getPlayer().closeInventory();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (clickedBlock.getType() == Material.RESPAWN_ANCHOR && !ConfigEntry.ALLOW_RESPAWN_ANCHORS.getBoolean())
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Groups.SPAWN_EGGS.contains(event.getMaterial()))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
Block clickedBlock = event.getClickedBlock();
|
||||
if (clickedBlock == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
EntityType eggType = null;
|
||||
try
|
||||
{
|
||||
|
Reference in New Issue
Block a user