forked from SteamWar/SteamWar
Add MicroWarGear21Region
Add MiniWarGear21Region Add WarGear21Region Add WarShip21Region
This commit is contained in:
+13
@@ -21,9 +21,11 @@ package de.steamwar.bausystem.features.region;
|
||||
|
||||
import de.steamwar.bausystem.BauSystem;
|
||||
import de.steamwar.bausystem.config.BauServer;
|
||||
import de.steamwar.bausystem.region.Point;
|
||||
import de.steamwar.bausystem.region.Region;
|
||||
import de.steamwar.bausystem.region.RegionUtils;
|
||||
import de.steamwar.bausystem.region.flags.Flag;
|
||||
import de.steamwar.bausystem.region.flags.TestblockMode;
|
||||
import de.steamwar.bausystem.region.utils.RegionExtensionType;
|
||||
import de.steamwar.bausystem.utils.PasteBuilder;
|
||||
import de.steamwar.command.PreviousArguments;
|
||||
@@ -173,6 +175,17 @@ public class TestblockCommand extends SWCommand {
|
||||
|
||||
private Region regionCheck(Player player) {
|
||||
Region region = Region.getRegion(player.getLocation());
|
||||
if (region.getFlags().has(Flag.TESTBLOCK).isWritable() && region.getFlags().get(Flag.TESTBLOCK).isWithDefault(TestblockMode.NO_VALUE)) {
|
||||
Point minPoint = region.getArea().getMinPoint(false);
|
||||
Point maxPoint = region.getArea().getMaxPoint(false);
|
||||
// TODO: Check if empty!
|
||||
int half = minPoint.getZ() + (maxPoint.getZ() - minPoint.getZ()) / 2;
|
||||
if (player.getLocation().getBlockZ() <= half) {
|
||||
region.getFlags().set(Flag.TESTBLOCK, TestblockMode.SOUTH);
|
||||
} else {
|
||||
region.getFlags().set(Flag.TESTBLOCK, TestblockMode.NORTH);
|
||||
}
|
||||
}
|
||||
if (region.getTestblockArea().isEmpty()) {
|
||||
BauSystem.MESSAGE.send("REGION_TB_NO_REGION", player);
|
||||
return null;
|
||||
|
||||
+2
-2
@@ -121,8 +121,8 @@ public class BauScoreboard implements Listener {
|
||||
Region region = Region.getRegion(player.getLocation());
|
||||
if (region.getType().isGlobal()) return "§eSteam§8War";
|
||||
String colorCode = "§e";
|
||||
if (region.getRegionData().has(Flag.COLOR).isReadable()) {
|
||||
colorCode = "§" + region.getRegionData().get(Flag.COLOR).orElse(ColorMode.PINK).getColorCode();
|
||||
if (region.getFlags().has(Flag.COLOR).isReadable()) {
|
||||
colorCode = "§" + region.getFlags().get(Flag.COLOR).getWithDefault().getColorCode();
|
||||
}
|
||||
return colorCode + "■ §eSteam§8War " + colorCode + "■"; // ■
|
||||
}
|
||||
|
||||
@@ -27,12 +27,19 @@ import lombok.RequiredArgsConstructor;
|
||||
public enum RegionType {
|
||||
|
||||
GLOBAL(true, false, true, ConnectionType.Global),
|
||||
/**
|
||||
* This should not be used by the DynamicRegionSystem
|
||||
*/
|
||||
NORMAL(false, true, false, ConnectionType.Closed),
|
||||
|
||||
SPAWN(false, false, true, ConnectionType.Closed),
|
||||
SPAWN_PATH(false, false, true, ConnectionType.Path),
|
||||
SPAWN_EXTENSION(false, false, false, ConnectionType.Closed),
|
||||
PATH(false, false, false, ConnectionType.Path),
|
||||
DRY(false, true, false, ConnectionType.Closed),
|
||||
DRY_SPECIAL(false, false, false, ConnectionType.Closed),
|
||||
WET(false, true, false, ConnectionType.Water),
|
||||
WET_SPECIAL(false, false, false, ConnectionType.Water),
|
||||
;
|
||||
|
||||
private final boolean global;
|
||||
|
||||
Reference in New Issue
Block a user