mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-10-31 21:47:10 +00:00
Merge pull request #272 from AtlasMediaGroup/fix-interact-blocking
Remove guard clause causing unintended side effects in interact blocker
This commit is contained in:
commit
a332ecfbea
@ -71,12 +71,7 @@ public class InteractBlocker extends FreedomService
|
|||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
final Block clickedBlock = event.getClickedBlock();
|
final Block clickedBlock = event.getClickedBlock();
|
||||||
|
|
||||||
if (clickedBlock == null)
|
if (clickedBlock != null && clickedBlock.getType() == Material.RESPAWN_ANCHOR && !ConfigEntry.ALLOW_RESPAWN_ANCHORS.getBoolean())
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (clickedBlock.getType() == Material.RESPAWN_ANCHOR && !ConfigEntry.ALLOW_RESPAWN_ANCHORS.getBoolean())
|
|
||||||
{
|
{
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
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);
|
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