From ce3384c7e95e7a3d65520944f23135a57d57fa74 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sun, 17 Dec 2023 18:23:54 +0100 Subject: [PATCH] Bugfixes, remove debug info Signed-off-by: Lixfel --- .../de/steamwar/fightsystem/utils/Hull.java | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/utils/Hull.java b/FightSystem_Core/src/de/steamwar/fightsystem/utils/Hull.java index 904c0cd..c9f4d72 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/utils/Hull.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/utils/Hull.java @@ -22,7 +22,6 @@ package de.steamwar.fightsystem.utils; import de.steamwar.fightsystem.Config; import de.steamwar.fightsystem.FightSystem; import de.steamwar.fightsystem.fight.FightTeam; -import de.steamwar.techhider.BlockIds; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; @@ -144,10 +143,9 @@ public class Hull { } }); FightSystem.getPlugin().getLogger().log(Level.INFO, () -> "[HullHider] initialisation finished: " + (System.currentTimeMillis() - start) + " ms, visible blocks: " + visibility.cardinality()); - - region.forEach(this::printDebug); } + @SuppressWarnings("deprecation") public void updateBlockVisibility(Block b, Material changedType) { IntVector root = new IntVector(b.getX(), b.getY(), b.getZ()); if (root.notInRegion(region)) @@ -168,20 +166,19 @@ public class Hull { } } - for (IntVector block : uncovered) - printDebug(block.x, block.y, block.z); + if(uncovered.isEmpty()) + return; - //TODO uncover entities - } - - private final int air = BlockIds.impl.materialToId(Material.AIR); - private final int stone = BlockIds.impl.materialToId(Material.STONE); - private final int red = BlockIds.impl.materialToId(Material.RED_CONCRETE); - - private void printDebug(int x, int y, int z) { - int id = new IntVector(x, y, z).toId(region); - - BlockIdWrapper.impl.setBlock(Config.world, x, y + Config.BlueExtendRegion.getSizeY(), z, visibility.get(id) ? (occluding.get(id) ? red : air) : stone); + Set uncoveredSet = new HashSet<>(uncovered); + Iterator it = entities.iterator(); + while(it.hasNext()) { + Entity entity = it.next(); + if(uncoveredSet.contains(new IntVector(entity.getLocation()))) { //TODO more precise + it.remove(); + for(Player player : players) + player.showEntity(FightSystem.getPlugin(), entity); //TODO 1.15- + } + } } private void forEachBorder(BiConsumer f) {