forked from SteamWar/SteamWar
Update Region System of BauSystem
This commit is contained in:
@@ -21,9 +21,7 @@ package de.steamwar.bausystem.features.team;
|
||||
|
||||
import de.steamwar.bausystem.BauSystem;
|
||||
import de.steamwar.bausystem.features.team.boundary.BoundaryViewer;
|
||||
import de.steamwar.bausystem.region.Prototype;
|
||||
import de.steamwar.bausystem.region.Region;
|
||||
import de.steamwar.bausystem.region.utils.RegionType;
|
||||
import de.steamwar.command.PreviousArguments;
|
||||
import de.steamwar.command.SWCommand;
|
||||
import de.steamwar.command.TypeMapper;
|
||||
@@ -69,14 +67,14 @@ public class SkinCommand extends SWCommand {
|
||||
return;
|
||||
}
|
||||
Region region = Region.getRegion(p.getLocation());
|
||||
if (region.isGlobal()) {
|
||||
if (region.getType().isGlobal()) {
|
||||
BauSystem.MESSAGE.send("SKIN_NO_REGION", p);
|
||||
return;
|
||||
}
|
||||
|
||||
String name = String.join(" ", names);
|
||||
File arenaFile = new File("sections19/" + name + "/" + typeKuerzel + "Arena.schem");
|
||||
File testblockFile = region.hasType(RegionType.TESTBLOCK) ? new File("sections19/" + name + "/" + typeKuerzel + "Testblock.schem") : null;
|
||||
File testblockFile = region.getTestblockArea().isPresent() ? new File("sections19/" + name + "/" + typeKuerzel + "Testblock.schem") : null;
|
||||
|
||||
arenaFile.getParentFile().mkdirs();
|
||||
if (testblockFile != null) {
|
||||
|
||||
+3
-6
@@ -48,21 +48,18 @@ public class BoundaryViewer implements Listener {
|
||||
}
|
||||
viewers.forEach(player -> {
|
||||
Region region = Region.getRegion(player.getLocation());
|
||||
if (region.isGlobal()) return;
|
||||
if (region.getType().isGlobal()) return;
|
||||
showRegion(region, player);
|
||||
if (region.getLinkedRegion() != null) {
|
||||
showRegion(region.getLinkedRegion(), player);
|
||||
}
|
||||
});
|
||||
}, 20, 20);
|
||||
}
|
||||
|
||||
private void showRegion(Region region, Player player) {
|
||||
drawCuboid(player, TrickyParticleWrapper.impl.getVillagerHappy(), region.getMinPoint(), region.getMaxPoint());
|
||||
if (region.hasType(RegionType.TESTBLOCK)) {
|
||||
if (region.getTestblockArea().isPresent()) {
|
||||
drawCuboid(player, Particle.END_ROD, region.getMinPointTestblockExtension(), region.getMaxPointTestblockExtension());
|
||||
}
|
||||
if (region.hasType(RegionType.BUILD)) {
|
||||
if (region.getBuildArea().isPresent()) {
|
||||
drawCuboid(player, Particle.END_ROD, region.getMinPointBuildExtension(), region.getMaxPointBuildExtension());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user