mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-26 17:05:01 +00:00
Remove guard clause causing unintended side effects
This commit is contained in:
parent
9f8dafb075
commit
88f53c05b9
@ -71,12 +71,7 @@ public class InteractBlocker extends FreedomService
|
||||
final Player player = event.getPlayer();
|
||||
final Block clickedBlock = event.getClickedBlock();
|
||||
|
||||
if (clickedBlock == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (clickedBlock.getType() == Material.RESPAWN_ANCHOR && !ConfigEntry.ALLOW_RESPAWN_ANCHORS.getBoolean())
|
||||
if (clickedBlock != null && clickedBlock.getType() == Material.RESPAWN_ANCHOR && !ConfigEntry.ALLOW_RESPAWN_ANCHORS.getBoolean())
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
@ -102,7 +97,7 @@ public class InteractBlocker extends FreedomService
|
||||
{
|
||||
//
|
||||
}
|
||||
if (eggType != null)
|
||||
if (eggType != null && clickedBlock != null)
|
||||
{
|
||||
clickedBlock.getWorld().spawnEntity(clickedBlock.getLocation().add(event.getBlockFace().getDirection()).add(0.5, 0.5, 0.5), eggType);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user