so in the plugin im coding im trying to allow players to place a custom block then break it and move it again when they need to
it has lore and everything and is one of multiple blocks that im planning on using a grindstone material for
whenever i break the grindstone it works fine, the lore is there and everything, but i cant figure out why it not only drops the grindstone but also just magically drops a second one into my inventory
i have no other active plugins and this is all of the code in the event handler that is significant to this issue (the rest is other block material checks)
does anyone see why thats happening?
@EventHandler
public void onPlayerBreakBlock(BlockBreakEvent e) {
Block block = e.getBlock();
if (block.getType().equals(Material.GRINDSTONE)) {
e.setCancelled(true);
if (Drills.getIndex(block) > -1) {//checks if ive saved this grindstone block to my placed list
ItemStack drop = Drills.getItems().get(Drills.getIndex(block));//gets the item version of the broken block ive saved
Item item = block.getWorld().dropItem(block.getLocation(), drop);
}
Drills.removeBlock(block);//removes tracked block since its broken
block.setType(Material.AIR);
}
}