Implemented breaking of LinkedBeaconTeleporterBlock and dropping LinkedBeaconTeleporterItem
parent
3f73d15a5a
commit
d9c95a5e53
@ -1,11 +1,24 @@
|
||||
package eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter.listener;
|
||||
|
||||
import eu.ruekov.ruakij.LinkedBeaconTeleporters.Main;
|
||||
import eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter.LinkedBeaconTeleporterBlock;
|
||||
import eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter.LinkedBeaconTeleporterItem;
|
||||
import eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter.LinkedBeaconTeleporterManager;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
|
||||
public class OnBlockBreak {
|
||||
|
||||
public static void onBlockBreakEvent(BlockBreakEvent e, LinkedBeaconTeleporterBlock lbtBlock){
|
||||
LinkedBeaconTeleporterItem lbtItem = Main.lbtManager.breakLbtBlock(lbtBlock);
|
||||
|
||||
// Dont drop anything
|
||||
e.setDropItems(false);
|
||||
e.setExpToDrop(0);
|
||||
|
||||
// Drop custom-item
|
||||
lbtBlock.block().getLocation().getWorld().dropItemNaturally(
|
||||
lbtBlock.block().getLocation(),
|
||||
lbtItem.item()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue