From 2a713d269e2ea163a3b32e24ce1d07c5e6abe664 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Tue, 11 May 2021 11:45:06 +0200 Subject: [PATCH] Delete list when empty --- .../LinkedBeaconTeleporterBlock.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporterBlock.java b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporterBlock.java index bdab86e..41aa58d 100644 --- a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporterBlock.java +++ b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporterBlock.java @@ -42,7 +42,13 @@ public class LinkedBeaconTeleporterBlock extends LinkedBeaconTeleporter { // Remove from list this.linkedBeaconTeleporters.remove(this); - // TODO: Remove from placedLBTsById when empty? + + if(this.linkedBeaconTeleporters.size() == 0){ + // List empty, delete from placedLBTsById + LinkedBeaconTeleporterManager.placedLBTsById.remove( + this.teleporterId + ); + } // Remove from loc LinkedBeaconTeleporterManager.placedLBTByLoc.remove(