Fixes an issue where players would be able to interact with blocks on
other people's islands in Speed Builders
This commit is contained in:
Sam 2016-06-16 12:25:21 +01:00
parent 1d3e12dfb6
commit ce23a94f3f

View File

@ -1695,6 +1695,33 @@ public class SpeedBuilders extends SoloGame
UtilAction.velocity(event.getPlayer(), new Vector(0, 1, 0)); UtilAction.velocity(event.getPlayer(), new Vector(0, 1, 0));
} }
@EventHandler
public void fixDoorToggling(PlayerInteractEvent event)
{
if (!IsLive())
return;
if (_state != SpeedBuildersState.BUILDING)
return;
if (!_buildRecreations.containsKey(event.getPlayer()))
return;
if (_perfectBuild.containsKey(event.getPlayer()))
{
event.setCancelled(true);
return;
}
Block block = event.getClickedBlock();
if (!_buildRecreations.get(event.getPlayer()).inBuildArea(block))
{
event.setCancelled(true);
UtilPlayer.message(event.getPlayer(), F.main("Build", "You cannot modify other player\'s builds"));
}
}
@Override @Override
public void EndCheck() public void EndCheck()
{ {