Limit hopper minecart placement

This commit is contained in:
RoboMWM 2016-01-29 21:54:15 -08:00
parent c2f2707a79
commit cd0a9a9696

View File

@ -1817,7 +1817,7 @@ class PlayerEventHandler implements Listener
//survival world minecart placement requires container trust, which is the permission required to remove the minecart later //survival world minecart placement requires container trust, which is the permission required to remove the minecart later
else if(clickedBlock != null && else if(clickedBlock != null &&
(materialInHand == Material.MINECART || materialInHand == Material.POWERED_MINECART || materialInHand == Material.STORAGE_MINECART || materialInHand == Material.EXPLOSIVE_MINECART) && (materialInHand == Material.MINECART || materialInHand == Material.POWERED_MINECART || materialInHand == Material.STORAGE_MINECART || materialInHand == Material.EXPLOSIVE_MINECART || materialInHand == Material.HOPPER_MINECART) &&
!GriefPrevention.instance.creativeRulesApply(clickedBlock.getLocation())) !GriefPrevention.instance.creativeRulesApply(clickedBlock.getLocation()))
{ {
if(playerData == null) playerData = this.dataStore.getPlayerData(player.getUniqueId()); if(playerData == null) playerData = this.dataStore.getPlayerData(player.getUniqueId());
@ -1836,7 +1836,7 @@ class PlayerEventHandler implements Listener
} }
//if it's a spawn egg, minecart, or boat, and this is a creative world, apply special rules //if it's a spawn egg, minecart, or boat, and this is a creative world, apply special rules
else if(clickedBlock != null && (materialInHand == Material.MINECART || materialInHand == Material.POWERED_MINECART || materialInHand == Material.STORAGE_MINECART || materialInHand == Material.BOAT || materialInHand == Material.ARMOR_STAND || materialInHand == Material.ITEM_FRAME || materialInHand == Material.MONSTER_EGG || materialInHand == Material.MONSTER_EGGS || materialInHand == Material.EXPLOSIVE_MINECART) && GriefPrevention.instance.creativeRulesApply(clickedBlock.getLocation())) else if(clickedBlock != null && (materialInHand == Material.MINECART || materialInHand == Material.POWERED_MINECART || materialInHand == Material.STORAGE_MINECART || materialInHand == Material.BOAT || materialInHand == Material.ARMOR_STAND || materialInHand == Material.ITEM_FRAME || materialInHand == Material.MONSTER_EGG || materialInHand == Material.MONSTER_EGGS || materialInHand == Material.EXPLOSIVE_MINECART || materialInHand == Material.HOPPER_MINECART) && GriefPrevention.instance.creativeRulesApply(clickedBlock.getLocation()))
{ {
//player needs build permission at this location //player needs build permission at this location
String noBuildReason = GriefPrevention.instance.allowBuild(player, clickedBlock.getLocation(), Material.MINECART); String noBuildReason = GriefPrevention.instance.allowBuild(player, clickedBlock.getLocation(), Material.MINECART);