Fixed broken if-statements

master
Ruakij 4 years ago
parent 2f64eb5ed0
commit bf18c82d6d

@ -31,6 +31,15 @@ public class LinkedBeaconTeleporterBlock extends LinkedBeaconTeleporter {
e.setDropItems(false); e.setDropItems(false);
e.setExpToDrop(0); e.setExpToDrop(0);
// Notify Player when link was destroyed
if(this.linkedBeaconTeleporters.size()-1 < 2){
e.getPlayer().sendMessage("§cConnection 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) §cdestroyed");
}
// Remove from list // Remove from list
this.linkedBeaconTeleporters.remove(this); this.linkedBeaconTeleporters.remove(this);
// TODO: Remove from placedLBTsById when empty? // TODO: Remove from placedLBTsById when empty?
@ -50,15 +59,6 @@ public class LinkedBeaconTeleporterBlock extends LinkedBeaconTeleporter {
lbtItem.item() lbtItem.item()
); );
// Notify Player when link was destroyed
if(this.linkedBeaconTeleporters.size() < 2){
e.getPlayer().sendMessage("§cConnection 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) §cdestroyed");
}
return lbtItem; return lbtItem;
} }

@ -70,7 +70,7 @@ public class LinkedBeaconTeleporterItem extends LinkedBeaconTeleporter {
); );
// Notify Player when no other teleporter was found (yet?) // Notify Player when no other teleporter was found (yet?)
if(this.linkedBeaconTeleporters.size() == 2){ if(this.linkedBeaconTeleporters.size() == 1){
e.getPlayer().sendMessage("§6No other Teleporter found with with id §7"+ this.teleporterId); e.getPlayer().sendMessage("§6No other Teleporter found with with id §7"+ this.teleporterId);
} }
// Notify Player when we have a full link // Notify Player when we have a full link

Loading…
Cancel
Save