|
|
|
@ -1,8 +1,10 @@
|
|
|
|
|
package eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter;
|
|
|
|
|
|
|
|
|
|
import eu.ruekov.ruakij.LinkedBeaconTeleporters.Main;
|
|
|
|
|
import org.bukkit.GameMode;
|
|
|
|
|
import org.bukkit.Location;
|
|
|
|
|
import org.bukkit.block.Block;
|
|
|
|
|
import org.bukkit.event.block.BlockBreakEvent;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
@ -21,6 +23,26 @@ public class LinkedBeaconTeleporterBlock extends LinkedBeaconTeleporter {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public LinkedBeaconTeleporterItem break_(BlockBreakEvent e){
|
|
|
|
|
// Dont drop anything
|
|
|
|
|
e.setDropItems(false);
|
|
|
|
|
e.setExpToDrop(0);
|
|
|
|
|
|
|
|
|
|
LinkedBeaconTeleporterItem lbtItem = Main.lbtManager.breakLbtBlock(this);
|
|
|
|
|
|
|
|
|
|
Location loc = this.block().getLocation();
|
|
|
|
|
|
|
|
|
|
// Drop custom-item
|
|
|
|
|
if(e.getPlayer().getGameMode() != GameMode.CREATIVE)
|
|
|
|
|
loc.getWorld().dropItemNaturally(
|
|
|
|
|
loc.add(0.5, 0, 0.5),
|
|
|
|
|
lbtItem.item()
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return lbtItem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Conversion methods
|
|
|
|
|
public static LinkedBeaconTeleporterBlock getFromLocation(Location loc){
|
|
|
|
|
return Main.lbtManager.getLbtBlockFromLocation(loc);
|
|
|
|
|