Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
f63d529b55
Commit
6a6eadb937
@ -81,7 +81,7 @@ public class TechHiderCommand extends SWCommand implements Listener {
|
|||||||
Set<String> hiddenBlockEntities = Collections.unmodifiableSet(new HashSet<>(config.getStringList("Techhider.HiddenBlockEntities")));
|
Set<String> hiddenBlockEntities = Collections.unmodifiableSet(new HashSet<>(config.getStringList("Techhider.HiddenBlockEntities")));
|
||||||
|
|
||||||
TechHider current = new TechHider((p, cX, cY) -> {
|
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);
|
return !hidden.get(rg).contains(p);
|
||||||
}, Material.valueOf(obfuscateWith.toUpperCase()), hiddenBlocks.stream().map(String::toUpperCase).map(Material::valueOf).collect(Collectors.toSet()), hiddenBlockEntities);
|
}, Material.valueOf(obfuscateWith.toUpperCase()), hiddenBlocks.stream().map(String::toUpperCase).map(Material::valueOf).collect(Collectors.toSet()), hiddenBlockEntities);
|
||||||
current.enable();
|
current.enable();
|
||||||
|
@ -148,7 +148,7 @@ public class XrayCommand extends SWCommand implements Listener {
|
|||||||
|
|
||||||
private TechHider createXray(Region rg, Set<Material> obfuscate) {
|
private TechHider createXray(Region rg, Set<Material> obfuscate) {
|
||||||
TechHider current = new TechHider((p, cX, cY) -> {
|
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);
|
return !hidden.get(rg).contains(p);
|
||||||
}, Material.STRUCTURE_VOID, obfuscate, new HashSet<>());
|
}, Material.STRUCTURE_VOID, obfuscate, new HashSet<>());
|
||||||
current.enable();
|
current.enable();
|
||||||
|
@ -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) ||
|
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);
|
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() {
|
public File gameModeConfig() {
|
||||||
File baseFile = new File(BauSystem.getInstance().getDataFolder().getParentFile(), "FightSystem");
|
File baseFile = new File(BauSystem.getInstance().getDataFolder().getParentFile(), "FightSystem");
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren