Limit TNT minecart placement.
This commit is contained in:
@@ -1813,7 +1813,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.MINECART || materialInHand == Material.POWERED_MINECART || materialInHand == Material.STORAGE_MINECART || materialInHand == Material.EXPLOSIVE_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());
|
||||||
@@ -1832,7 +1832,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) && 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) && 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);
|
||||||
|
|||||||
Reference in New Issue
Block a user