Bugfixes for bonemeal and minecarts.

This commit is contained in:
Wizjany 2013-01-27 22:43:29 -05:00
parent f2d7135fc5
commit 886b279da6

View File

@ -723,7 +723,16 @@ private void handleBlockRightClick(PlayerInteractEvent event) {
if (item.getTypeId() == ItemID.INK_SACK
&& item.getData() != null) {
if (item.getData().getData() == 15 // bonemeal
&& type == BlockID.GRASS) {
&& (type == BlockID.GRASS
|| type == BlockID.SAPLING
|| type == BlockID.CROPS
|| type == BlockID.BROWN_MUSHROOM
|| type == BlockID.RED_MUSHROOM
|| type == BlockID.PUMPKIN_STEM
|| type == BlockID.MELON_STEM
|| type == BlockID.POTATOES
|| type == BlockID.CARROTS
|| type == BlockID.COCOA_PLANT)) {
if (!plugin.getGlobalRegionManager().hasBypass(player, world)
&& !set.canBuild(localPlayer)) {
event.setCancelled(true);
@ -841,7 +850,10 @@ private void handleBlockRightClick(PlayerInteractEvent event) {
}
}
if (BlockType.isRailBlock(type) && item.getTypeId() == ItemID.MINECART) {
if (BlockType.isRailBlock(type)
&& (item.getTypeId() == ItemID.MINECART
|| item.getTypeId() == ItemID.POWERED_MINECART
|| item.getTypeId() == ItemID.STORAGE_MINECART)) {
if (!plugin.getGlobalRegionManager().hasBypass(player, world)
&& !set.canBuild(localPlayer)
&& !set.allows(DefaultFlag.PLACE_VEHICLE, localPlayer)) {