forked from SteamWar/SteamWar
Fix some more build errors
This commit is contained in:
@@ -940,7 +940,6 @@ SELECT_HELP=§8/§eselect §8[§7RegionsTyp§8] §8- §7Select a region type
|
|||||||
SELECT_EXTENSION_HELP=§8/§eselect §8[§7RegionsTyp§8] §8[§7Extension§8] §8- §7Select a region type with or without extension
|
SELECT_EXTENSION_HELP=§8/§eselect §8[§7RegionsTyp§8] §8[§7Extension§8] §8- §7Select a region type with or without extension
|
||||||
SELECT_GLOBAL_REGION=§cThe global region cannot be selected
|
SELECT_GLOBAL_REGION=§cThe global region cannot be selected
|
||||||
SELECT_NO_TYPE=§cThis region has no {0}
|
SELECT_NO_TYPE=§cThis region has no {0}
|
||||||
SELECT_NO_EXTENSION=§cThis region has no extension
|
|
||||||
SELECT_MESSAGE=§7WorldEdit selection set to {0}, {1}, {2} and {3}, {4}, {5}
|
SELECT_MESSAGE=§7WorldEdit selection set to {0}, {1}, {2} and {3}, {4}, {5}
|
||||||
SKULL_HELP=§8/§eskull §8[§eplayer§8] §8-§7 Receive a player head
|
SKULL_HELP=§8/§eskull §8[§eplayer§8] §8-§7 Receive a player head
|
||||||
SKULL_INVALID=§cInvalid player name
|
SKULL_INVALID=§cInvalid player name
|
||||||
|
|||||||
@@ -878,7 +878,6 @@ SELECT_HELP=§8/§eselect §8[§7RegionsTyp§8] §8- §7Wähle einen RegionsTyp
|
|||||||
SELECT_EXTENSION_HELP=§8/§eselect §8[§7RegionsTyp§8] §8[§7Extension§8] §8- §7Wähle einen RegionsTyp aus mit oder ohne Extension
|
SELECT_EXTENSION_HELP=§8/§eselect §8[§7RegionsTyp§8] §8[§7Extension§8] §8- §7Wähle einen RegionsTyp aus mit oder ohne Extension
|
||||||
SELECT_GLOBAL_REGION=§cDie globale Region kannst du nicht auswählen
|
SELECT_GLOBAL_REGION=§cDie globale Region kannst du nicht auswählen
|
||||||
SELECT_NO_TYPE=§cDiese Region hat keinen {0}
|
SELECT_NO_TYPE=§cDiese Region hat keinen {0}
|
||||||
SELECT_NO_EXTENSION=§cDiese Region hat keine Ausfahrmaße
|
|
||||||
SELECT_MESSAGE=§7WorldEdit auswahl auf {0}, {1}, {2} und {3}, {4}, {5} gesetzt
|
SELECT_MESSAGE=§7WorldEdit auswahl auf {0}, {1}, {2} und {3}, {4}, {5} gesetzt
|
||||||
SKULL_HELP=§8/§eskull §8[§eSpieler§8] §8-§7 Gibt einen SpielerKopf
|
SKULL_HELP=§8/§eskull §8[§eSpieler§8] §8-§7 Gibt einen SpielerKopf
|
||||||
SKULL_INVALID=§cUngültiger Spieler
|
SKULL_INVALID=§cUngültiger Spieler
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import de.steamwar.bausystem.BauSystem;
|
|||||||
import de.steamwar.bausystem.region.Region;
|
import de.steamwar.bausystem.region.Region;
|
||||||
import de.steamwar.bausystem.region.RegionUtils;
|
import de.steamwar.bausystem.region.RegionUtils;
|
||||||
import de.steamwar.bausystem.region.flags.Flag;
|
import de.steamwar.bausystem.region.flags.Flag;
|
||||||
import de.steamwar.bausystem.region.flags.flagvalues.TNTMode;
|
import de.steamwar.bausystem.region.flags.TNTMode;
|
||||||
import de.steamwar.bausystem.region.utils.RegionType;
|
import de.steamwar.bausystem.region.utils.RegionType;
|
||||||
import de.steamwar.command.PreviousArguments;
|
import de.steamwar.command.PreviousArguments;
|
||||||
import de.steamwar.command.SWCommand;
|
import de.steamwar.command.SWCommand;
|
||||||
|
|||||||
+2
-2
@@ -23,8 +23,8 @@ import de.steamwar.bausystem.BauSystem;
|
|||||||
import de.steamwar.bausystem.config.BauServer;
|
import de.steamwar.bausystem.config.BauServer;
|
||||||
import de.steamwar.bausystem.region.Region;
|
import de.steamwar.bausystem.region.Region;
|
||||||
import de.steamwar.bausystem.region.RegionUtils;
|
import de.steamwar.bausystem.region.RegionUtils;
|
||||||
|
import de.steamwar.bausystem.region.flags.ColorMode;
|
||||||
import de.steamwar.bausystem.region.flags.Flag;
|
import de.steamwar.bausystem.region.flags.Flag;
|
||||||
import de.steamwar.bausystem.region.flags.flagvalues.ColorMode;
|
|
||||||
import de.steamwar.bausystem.region.utils.RegionExtensionType;
|
import de.steamwar.bausystem.region.utils.RegionExtensionType;
|
||||||
import de.steamwar.bausystem.region.utils.RegionType;
|
import de.steamwar.bausystem.region.utils.RegionType;
|
||||||
import de.steamwar.bausystem.utils.PasteBuilder;
|
import de.steamwar.bausystem.utils.PasteBuilder;
|
||||||
@@ -101,7 +101,7 @@ public class TestblockCommand extends SWCommand {
|
|||||||
.onlyColors(onlyColors)
|
.onlyColors(onlyColors)
|
||||||
.removeTNT(removeTNT)
|
.removeTNT(removeTNT)
|
||||||
.removeWater(removeWater)
|
.removeWater(removeWater)
|
||||||
.color(region.getPlain(Flag.COLOR, ColorMode.class).getColor());
|
.color(region.getFlag(Flag.COLOR).orElse(ColorMode.YELLOW).getColor());
|
||||||
region.reset(pasteBuilder, RegionType.TESTBLOCK, regionExtensionType);
|
region.reset(pasteBuilder, RegionType.TESTBLOCK, regionExtensionType);
|
||||||
RegionUtils.message(region, "REGION_TB_DONE");
|
RegionUtils.message(region, "REGION_TB_DONE");
|
||||||
} catch (SecurityException e) {
|
} catch (SecurityException e) {
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import de.steamwar.bausystem.BauSystem;
|
|||||||
import de.steamwar.bausystem.SWUtils;
|
import de.steamwar.bausystem.SWUtils;
|
||||||
import de.steamwar.bausystem.region.Region;
|
import de.steamwar.bausystem.region.Region;
|
||||||
import de.steamwar.bausystem.region.RegionUtils;
|
import de.steamwar.bausystem.region.RegionUtils;
|
||||||
import de.steamwar.bausystem.region.utils.RegionSelectionType;
|
|
||||||
import de.steamwar.command.SWCommand;
|
import de.steamwar.command.SWCommand;
|
||||||
import de.steamwar.linkage.Linked;
|
import de.steamwar.linkage.Linked;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package de.steamwar.bausystem.region.utils;
|
package de.steamwar.bausystem.features.util;
|
||||||
|
|
||||||
public enum RegionSelectionType {
|
public enum RegionSelectionType {
|
||||||
LOCAL,
|
LOCAL,
|
||||||
@@ -21,19 +21,15 @@ public class SelectCommand extends SWCommand {
|
|||||||
public void baurahmenCommand(@Validator Player p, RegionType regionType, @OptionalValue("NORMAL") RegionExtensionType regionExtensionType) {
|
public void baurahmenCommand(@Validator Player p, RegionType regionType, @OptionalValue("NORMAL") RegionExtensionType regionExtensionType) {
|
||||||
Region region = Region.getRegion(p.getLocation());
|
Region region = Region.getRegion(p.getLocation());
|
||||||
|
|
||||||
if (region.isGlobal()) {
|
if (region.getType().isGlobal()) {
|
||||||
BauSystem.MESSAGE.send("SELECT_GLOBAL_REGION", p);
|
BauSystem.MESSAGE.send("SELECT_GLOBAL_REGION", p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!region.hasType(regionType)) {
|
if (!regionType.getHasType().test(region)) {
|
||||||
BauSystem.MESSAGE.send("SELECT_NO_TYPE", p, BauSystem.MESSAGE.parse(regionType.getChatValue(), p));
|
BauSystem.MESSAGE.send("SELECT_NO_TYPE", p, BauSystem.MESSAGE.parse(regionType.getChatValue(), p));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (regionExtensionType == RegionExtensionType.EXTENSION && !region.hasExtensionType(regionType)) {
|
|
||||||
BauSystem.MESSAGE.send("SELECT_NO_EXTENSION", p);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
setSelection(regionType, regionExtensionType, region, p);
|
setSelection(regionType, regionExtensionType, region, p);
|
||||||
}
|
}
|
||||||
@@ -44,8 +40,8 @@ public class SelectCommand extends SWCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setSelection(RegionType regionType, RegionExtensionType regionExtensionType, Region region, Player p) {
|
private void setSelection(RegionType regionType, RegionExtensionType regionExtensionType, Region region, Player p) {
|
||||||
Point minPoint = region.getMinPoint(regionType, regionExtensionType);
|
Point minPoint = regionType.getToMinPoint().apply(region, regionExtensionType.isExtension());
|
||||||
Point maxPoint = region.getMaxPoint(regionType, regionExtensionType);
|
Point maxPoint = regionType.getToMaxPoint().apply(region, regionExtensionType.isExtension());
|
||||||
|
|
||||||
FlatteningWrapper.impl.setSelection(p, minPoint, maxPoint);
|
FlatteningWrapper.impl.setSelection(p, minPoint, maxPoint);
|
||||||
BauSystem.MESSAGE.send("SELECT_MESSAGE", p, minPoint.getX(), minPoint.getY(), minPoint.getZ(), maxPoint.getX(), maxPoint.getY(), maxPoint.getZ());
|
BauSystem.MESSAGE.send("SELECT_MESSAGE", p, minPoint.getX(), minPoint.getY(), minPoint.getZ(), maxPoint.getX(), maxPoint.getY(), maxPoint.getZ());
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ import de.steamwar.bausystem.BauSystem;
|
|||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
import de.steamwar.bausystem.features.util.KillAllCommand;
|
import de.steamwar.bausystem.features.util.KillAllCommand;
|
||||||
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
||||||
import de.steamwar.bausystem.region.utils.RegionSelectionType;
|
import de.steamwar.bausystem.features.util.RegionSelectionType;
|
||||||
import de.steamwar.inventory.SWItem;
|
import de.steamwar.inventory.SWItem;
|
||||||
import de.steamwar.linkage.Linked;
|
import de.steamwar.linkage.Linked;
|
||||||
import de.steamwar.linkage.LinkedInstance;
|
import de.steamwar.linkage.LinkedInstance;
|
||||||
|
|||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
package de.steamwar.bausystem.region.utils;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum RegionExtensionType {
|
||||||
|
NORMAL(false),
|
||||||
|
EXTENSION(true),
|
||||||
|
;
|
||||||
|
|
||||||
|
private final boolean extension;
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package de.steamwar.bausystem.region.utils;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.region.Point;
|
||||||
|
import de.steamwar.bausystem.region.Region;
|
||||||
|
import de.steamwar.bausystem.shared.EnumDisplay;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.function.BiFunction;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum RegionType implements EnumDisplay {
|
||||||
|
NORMAL("REGION_TYPE_NORMAL",
|
||||||
|
region -> true,
|
||||||
|
region -> null,
|
||||||
|
(region, extension) -> region.getMinPoint(),
|
||||||
|
(region, extension) -> region.getMaxPoint()),
|
||||||
|
BUILD("REGION_TYPE_BUILD",
|
||||||
|
region -> region.getBuildArea().isPresent(),
|
||||||
|
Region::getBuildArea,
|
||||||
|
(region, extension) -> region.getBuildArea().getMinPoint(extension),
|
||||||
|
(region, extension) -> region.getBuildArea().getMaxPoint(extension)),
|
||||||
|
TESTBLOCK("REGION_TYPE_ONLY_TB",
|
||||||
|
region -> region.getTestblockArea().isPresent(),
|
||||||
|
Region::getTestblockArea,
|
||||||
|
(region, extension) -> region.getTestblockArea().getMinPoint(extension),
|
||||||
|
(region, extension) -> region.getTestblockArea().getMaxPoint(extension)),
|
||||||
|
;
|
||||||
|
|
||||||
|
private String chatValue;
|
||||||
|
|
||||||
|
private Predicate<Region> hasType;
|
||||||
|
private Function<Region, Region.Inner> toInner;
|
||||||
|
private BiFunction<Region, Boolean, Point> toMinPoint;
|
||||||
|
private BiFunction<Region, Boolean, Point> toMaxPoint;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user