|
|
|
@ -43,6 +43,14 @@ public class LinkedBeaconTeleporterItem extends LinkedBeaconTeleporter {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public LinkedBeaconTeleporterBlock place(BlockPlaceEvent e){
|
|
|
|
|
// Deny placing when 2 LinkedBeaconTeleporter's are already placed
|
|
|
|
|
if(this.linkedBeaconTeleporters.size() == 2){
|
|
|
|
|
e.getPlayer().sendMessage("§cMaximum-Amount §7(2) §cof §6LinkedBeaconTeleporters §cwith id §7"+ this.teleporterId +" §care already placed");
|
|
|
|
|
|
|
|
|
|
e.setCancelled(true);
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Block block = e.getBlock();
|
|
|
|
|
Location loc = block.getLocation();
|
|
|
|
|
|
|
|
|
@ -61,6 +69,19 @@ public class LinkedBeaconTeleporterItem extends LinkedBeaconTeleporter {
|
|
|
|
|
lbtBlock
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// Notify Player when no other teleporter was found (yet?)
|
|
|
|
|
if(this.linkedBeaconTeleporters.size() == 2){
|
|
|
|
|
e.getPlayer().sendMessage("§6No other Teleporter found with with id §7"+ this.teleporterId);
|
|
|
|
|
}
|
|
|
|
|
// Notify Player when we have a full link
|
|
|
|
|
else if(this.linkedBeaconTeleporters.size() == 2){
|
|
|
|
|
e.getPlayer().sendMessage("§aConnected to Teleporter with id §7"+ this.teleporterId +" §e("+
|
|
|
|
|
(int)((LinkedBeaconTeleporterBlock)this.linkedBeaconTeleporters.get(0)).block.getLocation().distance(
|
|
|
|
|
((LinkedBeaconTeleporterBlock)this.linkedBeaconTeleporters.get(1)).block().getLocation()
|
|
|
|
|
)
|
|
|
|
|
+" Blocks away)");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return lbtBlock;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|