|
|
@ -89,12 +89,15 @@ public class OnBlockBreak implements Listener {
|
|
|
|
|
|
|
|
|
|
|
|
// Set drop
|
|
|
|
// Set drop
|
|
|
|
if(success){
|
|
|
|
if(success){
|
|
|
|
|
|
|
|
ConfigurationSection dropConfig = Main.config.getConfigurationSection("break.drop");
|
|
|
|
|
|
|
|
|
|
|
|
ItemStack item = new ItemStack(Material.MOB_SPAWNER);
|
|
|
|
ItemStack item = new ItemStack(Material.MOB_SPAWNER);
|
|
|
|
|
|
|
|
|
|
|
|
CreatureSpawner cs = (CreatureSpawner)e.getBlock().getState();
|
|
|
|
CreatureSpawner cs = (CreatureSpawner)e.getBlock().getState();
|
|
|
|
|
|
|
|
|
|
|
|
BlockStateMeta bsm = (BlockStateMeta)item.getItemMeta();
|
|
|
|
BlockStateMeta bsm = (BlockStateMeta)item.getItemMeta();
|
|
|
|
bsm.setBlockState(cs);
|
|
|
|
bsm.setBlockState(cs);
|
|
|
|
|
|
|
|
bsm.setDisplayName(dropConfig.getString("item.name").replace("{mob-type}", cs.getSpawnedType().name()));
|
|
|
|
item.setItemMeta(bsm);
|
|
|
|
item.setItemMeta(bsm);
|
|
|
|
|
|
|
|
|
|
|
|
loc.getWorld().dropItem(loc, item);
|
|
|
|
loc.getWorld().dropItem(loc, item);
|
|
|
|