diff --git a/FightSystem/FightSystem_18/src/de/steamwar/fightsystem/utils/BlockIdWrapper18.java b/FightSystem/FightSystem_18/src/de/steamwar/fightsystem/utils/BlockIdWrapper18.java index d1ad4197..c229353a 100644 --- a/FightSystem/FightSystem_18/src/de/steamwar/fightsystem/utils/BlockIdWrapper18.java +++ b/FightSystem/FightSystem_18/src/de/steamwar/fightsystem/utils/BlockIdWrapper18.java @@ -23,10 +23,7 @@ import com.comphenix.tinyprotocol.Reflection; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; -import java.util.Collections; -import java.util.Map; -import java.util.Set; -import java.util.UUID; +import java.util.*; public class BlockIdWrapper18 extends BlockIdWrapper14 { @@ -39,7 +36,7 @@ public class BlockIdWrapper18 extends BlockIdWrapper14 { @Override public void untrackEntity(Player player, Entity entity) { - hiddenEntities.get(player).put(entity.getUniqueId(), Collections.emptySet()); + hiddenEntities.get(player).put(entity.getUniqueId(), new HashSet<>(1)); super.untrackEntity(player, entity); } } diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/Hull.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/Hull.java index 5b145c1d..2c55509d 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/Hull.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/Hull.java @@ -51,7 +51,6 @@ public class Hull { private final BitSet occluding; private final BitSet visibility; - private final BitSet primaryVisible; private final Int2IntOpenHashMap visibilityDirections = new Int2IntOpenHashMap(); // Contains the visible directions of each occluding visible block private final Set uncoveredSurface = new HashSet<>(); @@ -65,7 +64,6 @@ public class Hull { this.primaryDirection = new IntVector(0, 0, team.isBlue() == (Config.BlueToRedZ > 0) ? -1 : 1); this.occluding = new BitSet(region.volume()); this.visibility = new BitSet(region.volume()); - this.primaryVisible = new BitSet(region.volume()); branchDirections = IntStream.range(0, 27) .mapToObj(v -> new IntVector(v%3 -1, (v/3)%3 -1, v/9 -1)) @@ -139,7 +137,6 @@ public class Hull { visibility.clear(); occluding.clear(); visibilityDirections.clear(); - primaryVisible.clear(); long start = System.currentTimeMillis(); region.forEach((x, y, z) -> { @@ -253,14 +250,11 @@ public class Hull { visibilityDirections.compute(id, (pos, v) -> (v == null ? 0 : v) | directionId(direction)); return; } - if(primaryVisible.get(id)) - return; updateBlocks(uncovered, block.add(direction), direction); if(!direction.equals(primaryDirection)) return; - primaryVisible.set(id); for(IntVector branchDirection : branchDirections) updateBlocks(uncovered, block.add(branchDirection), branchDirection); }