Fix mining drops in Bridges. Fixes PC-133
This change prevents players from using inadequate tools to mine ores, e.g., using a stone pickaxe or fists to mine diamond ore.
This commit is contained in:
parent
7f44281441
commit
419bf2a755
@ -1311,12 +1311,12 @@ public class Bridge extends TeamGame implements OreObsfucation
|
||||
return;
|
||||
|
||||
List<ItemStack> drops = new ArrayList<ItemStack>();
|
||||
|
||||
|
||||
for (Material mat : PLAYER_DROP_DELAY_MATERIALS)
|
||||
{
|
||||
if (event.getBlock().getType() == mat)
|
||||
{
|
||||
drops.addAll(event.getBlock().getDrops());
|
||||
drops.addAll(event.getBlock().getDrops(event.getPlayer().getItemInHand()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1327,12 +1327,6 @@ public class Bridge extends TeamGame implements OreObsfucation
|
||||
event.setCancelled(true);
|
||||
event.getBlock().setType(Material.AIR);
|
||||
|
||||
if (event.getBlock().getType() == Material.FURNACE || UtilItem.isOre(event.getBlock().getType())) // Can't be broken by fist
|
||||
{
|
||||
if (event.getPlayer().getItemInHand() == null || !CraftItemStack.asNMSCopy(event.getPlayer().getItemInHand()).b(CraftMagicNumbers.getBlock((CraftBlock) event.getBlock())))
|
||||
return;
|
||||
}
|
||||
|
||||
Location loc = event.getBlock().getLocation().clone().add(.5, .5, .5);
|
||||
|
||||
for (ItemStack item : drops)
|
||||
|
Loading…
Reference in New Issue
Block a user