Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
5fab7e5404
Commit
ce3384c7e9
@ -22,7 +22,6 @@ package de.steamwar.fightsystem.utils;
|
|||||||
import de.steamwar.fightsystem.Config;
|
import de.steamwar.fightsystem.Config;
|
||||||
import de.steamwar.fightsystem.FightSystem;
|
import de.steamwar.fightsystem.FightSystem;
|
||||||
import de.steamwar.fightsystem.fight.FightTeam;
|
import de.steamwar.fightsystem.fight.FightTeam;
|
||||||
import de.steamwar.techhider.BlockIds;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
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());
|
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) {
|
public void updateBlockVisibility(Block b, Material changedType) {
|
||||||
IntVector root = new IntVector(b.getX(), b.getY(), b.getZ());
|
IntVector root = new IntVector(b.getX(), b.getY(), b.getZ());
|
||||||
if (root.notInRegion(region))
|
if (root.notInRegion(region))
|
||||||
@ -168,20 +166,19 @@ public class Hull {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (IntVector block : uncovered)
|
if(uncovered.isEmpty())
|
||||||
printDebug(block.x, block.y, block.z);
|
return;
|
||||||
|
|
||||||
//TODO uncover entities
|
Set<IntVector> uncoveredSet = new HashSet<>(uncovered);
|
||||||
|
Iterator<Entity> 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 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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void forEachBorder(BiConsumer<IntVector, IntVector> f) {
|
private void forEachBorder(BiConsumer<IntVector, IntVector> f) {
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren