Merge pull request #40 from RoboMWM/patch-7
Limit hopper minecart placement
This commit is contained in:
commit
9581103c1b
|
|
@ -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
|
||||
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()))
|
||||
{
|
||||
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
|
||||
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
|
||||
String noBuildReason = GriefPrevention.instance.allowBuild(player, clickedBlock.getLocation(), Material.MINECART);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user