SteamWar/BauSystem2.0
Archiviert
12
0

Closes: #121
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2022-08-28 17:15:39 +02:00
Ursprung f63d529b55
Commit 6a6eadb937
3 geänderte Dateien mit 13 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -81,7 +81,7 @@ public class TechHiderCommand extends SWCommand implements Listener {
Set<String> hiddenBlockEntities = Collections.unmodifiableSet(new HashSet<>(config.getStringList("Techhider.HiddenBlockEntities")));
TechHider current = new TechHider((p, cX, cY) -> {
if (rg.chunkOutside(cX, cY)) return true;
if (rg.buildChunkOutside(cX, cY)) return true;
return !hidden.get(rg).contains(p);
}, Material.valueOf(obfuscateWith.toUpperCase()), hiddenBlocks.stream().map(String::toUpperCase).map(Material::valueOf).collect(Collectors.toSet()), hiddenBlockEntities);
current.enable();

Datei anzeigen

@ -148,7 +148,7 @@ public class XrayCommand extends SWCommand implements Listener {
private TechHider createXray(Region rg, Set<Material> obfuscate) {
TechHider current = new TechHider((p, cX, cY) -> {
if (rg.chunkOutside(cX, cY)) return true;
if (rg.buildChunkOutside(cX, cY)) return true;
return !hidden.get(rg).contains(p);
}, Material.STRUCTURE_VOID, obfuscate, new HashSet<>());
current.enable();

Datei anzeigen

@ -576,10 +576,18 @@ public class Region {
}
}
public boolean chunkOutside(int chunkX, int chunkY) {
public boolean buildChunkOutside(int chunkX, int chunkY) {
if (!hasType(RegionType.BUILD)) {
return Math.floor(minPoint.getX() / 16.0) > chunkX || chunkX >= Math.ceil(maxPoint.getX() / 16.0) ||
Math.floor(minPoint.getZ() / 16.0) > chunkY || chunkY >= Math.ceil(maxPoint.getZ() / 16.0);
}
if (!hasExtensionType(RegionType.BUILD)) {
return Math.floor(minPointBuild.getX() / 16.0) > chunkX || chunkX >= Math.ceil(maxPointBuild.getX() / 16.0) ||
Math.floor(minPointBuild.getZ() / 16.0) > chunkY || chunkY >= Math.ceil(maxPointBuild.getZ() / 16.0);
}
return Math.floor(minPointBuildExtension.getX() / 16.0) > chunkX || chunkX >= Math.ceil(maxPointBuildExtension.getX() / 16.0) ||
Math.floor(minPointBuildExtension.getZ() / 16.0) > chunkY || chunkY >= Math.ceil(maxPointBuildExtension.getZ() / 16.0);
}
public File gameModeConfig() {
File baseFile = new File(BauSystem.getInstance().getDataFolder().getParentFile(), "FightSystem");