forked from SteamWar/SteamWar
Add MicroWarGear21Region
Add MiniWarGear21Region Add WarGear21Region Add WarShip21Region
This commit is contained in:
+7
-15
@@ -25,7 +25,7 @@ import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import de.steamwar.bausystem.region.*;
|
||||
import lombok.NonNull;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import java.util.UUID;
|
||||
@@ -33,14 +33,16 @@ import java.util.stream.Collectors;
|
||||
|
||||
public abstract class DynamicRegion implements Region {
|
||||
|
||||
protected final UUID id;
|
||||
@Getter
|
||||
protected final UUID ID;
|
||||
protected final int minX;
|
||||
protected final int minZ;
|
||||
|
||||
@Getter
|
||||
protected final RegionBackups backups;
|
||||
|
||||
protected DynamicRegion(int minX, int minZ) {
|
||||
this.id = UUID.randomUUID();
|
||||
this.ID = UUID.randomUUID();
|
||||
this.minX = minX;
|
||||
this.minZ = minZ;
|
||||
backups = RegionDataRepository.getBackups(this);
|
||||
@@ -49,7 +51,7 @@ public abstract class DynamicRegion implements Region {
|
||||
}
|
||||
|
||||
protected DynamicRegion(RegionConstructorData regionConstructorData) {
|
||||
this.id = regionConstructorData.uuid;
|
||||
this.ID = regionConstructorData.uuid;
|
||||
this.minX = regionConstructorData.minX;
|
||||
this.minZ = regionConstructorData.minZ;
|
||||
backups = RegionDataRepository.getBackups(this);
|
||||
@@ -59,17 +61,12 @@ public abstract class DynamicRegion implements Region {
|
||||
public RegionConstructorData getRegionConstructorData() {
|
||||
return new RegionConstructorData.RegionConstructorDataBuilder()
|
||||
.regionClass(this.getClass().getSimpleName())
|
||||
.uuid(id)
|
||||
.uuid(ID)
|
||||
.minX(minX)
|
||||
.minZ(minZ)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull UUID getID() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public abstract void update(DynamicRegion updateFrom);
|
||||
|
||||
public abstract void setFlags(FlagStorage flags);
|
||||
@@ -96,9 +93,4 @@ public abstract class DynamicRegion implements Region {
|
||||
DynamicRegionSystem.INSTANCE.getNeighbours(this).collect(Collectors.toList())
|
||||
.forEach(region -> region.update(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull RegionBackups getBackups() {
|
||||
return backups;
|
||||
}
|
||||
}
|
||||
|
||||
+8
@@ -28,6 +28,10 @@ import de.steamwar.bausystem.region.Point;
|
||||
import de.steamwar.bausystem.region.Region;
|
||||
import de.steamwar.bausystem.region.RegionBackups;
|
||||
import de.steamwar.bausystem.region.dynamic.normal.NormalFlagStorage;
|
||||
import de.steamwar.bausystem.region.dynamic.normal.work.MicroWarGear21Region;
|
||||
import de.steamwar.bausystem.region.dynamic.normal.work.MiniWarGear21Region;
|
||||
import de.steamwar.bausystem.region.dynamic.normal.work.WarGear21Region;
|
||||
import de.steamwar.bausystem.region.dynamic.normal.work.WarShip21Region;
|
||||
import de.steamwar.bausystem.region.dynamic.path.PathRegion;
|
||||
import de.steamwar.bausystem.region.dynamic.spawn.SpawnPathRegion;
|
||||
import de.steamwar.bausystem.region.dynamic.spawn.SpawnRegion;
|
||||
@@ -68,6 +72,10 @@ public class RegionDataRepository {
|
||||
regionCreators.put(SpawnRegion.class.getSimpleName(), SpawnRegion::new);
|
||||
regionCreators.put(SpawnPathRegion.class.getSimpleName(), SpawnPathRegion::new);
|
||||
regionCreators.put(PathRegion.class.getSimpleName(), PathRegion::new);
|
||||
regionCreators.put(WarGear21Region.class.getSimpleName(), WarGear21Region::new);
|
||||
regionCreators.put(MiniWarGear21Region.class.getSimpleName(), MiniWarGear21Region::new);
|
||||
regionCreators.put(WarShip21Region.class.getSimpleName(), WarShip21Region::new);
|
||||
regionCreators.put(MicroWarGear21Region.class.getSimpleName(), MicroWarGear21Region::new);
|
||||
}
|
||||
|
||||
static {
|
||||
|
||||
+7
-3
@@ -26,9 +26,9 @@ import org.bukkit.Location;
|
||||
@UtilityClass
|
||||
public class TileUtils {
|
||||
|
||||
private static final int tileSize = 19;
|
||||
private static final int minTile = -1023;
|
||||
private static final int maxTile = 1023;
|
||||
public static final int tileSize = 19;
|
||||
public static final int minTile = -1023;
|
||||
public static final int maxTile = 1023;
|
||||
|
||||
public Pair<Integer, Integer> fromLocation(Location location) {
|
||||
int x = (int) Math.floor((location.getBlockX() + 9) / (double) tileSize);
|
||||
@@ -41,4 +41,8 @@ public class TileUtils {
|
||||
public Pair<Integer, Integer> toMinLocation(Pair<Integer, Integer> tile) {
|
||||
return new Pair<>(tile.getKey() * tileSize - 9, tile.getValue() * tileSize - 9);
|
||||
}
|
||||
|
||||
public Location toMinLocation(int tileX, int tileZ) {
|
||||
return new Location(null, tileX * tileSize - 9, 0, tileZ * tileSize - 9);
|
||||
}
|
||||
}
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* This file is a part of the SteamWar software.
|
||||
*
|
||||
* Copyright (C) 2020 SteamWar.de-Serverteam
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.steamwar.bausystem.region.dynamic.normal;
|
||||
|
||||
public class DisplayRegion {
|
||||
}
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* This file is a part of the SteamWar software.
|
||||
*
|
||||
* Copyright (C) 2020 SteamWar.de-Serverteam
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.steamwar.bausystem.region.dynamic.normal;
|
||||
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import de.steamwar.bausystem.region.Point;
|
||||
import de.steamwar.bausystem.region.Region;
|
||||
import de.steamwar.bausystem.utils.PasteBuilder;
|
||||
import org.bukkit.Location;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
public abstract class NormalArea implements Region.Area {
|
||||
|
||||
public abstract NormalArea setResetFile(File resetFile);
|
||||
|
||||
public static final NormalArea EMPTY = new NormalArea() {
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Point getMinPoint(boolean extension) {
|
||||
return Point.ZERO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Point getMaxPoint(boolean extension) {
|
||||
return Point.ZERO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Point getCopyPoint() {
|
||||
return Point.ZERO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean inRegion(Location location, boolean extension) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Clipboard copy(boolean extension) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NormalArea setResetFile(File resetFile) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getResetFile() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset(PasteBuilder pasteBuilder, boolean extension) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachChunk(BiConsumer<Integer, Integer> executor) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isChunkOutside(int chunkX, int chunkZ) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* This file is a part of the SteamWar software.
|
||||
*
|
||||
* Copyright (C) 2020 SteamWar.de-Serverteam
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.steamwar.bausystem.region.dynamic.normal;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import de.steamwar.bausystem.region.Point;
|
||||
import de.steamwar.bausystem.region.Region;
|
||||
import de.steamwar.bausystem.utils.PasteBuilder;
|
||||
import lombok.NonNull;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.File;
|
||||
|
||||
public class WorkArea extends NormalArea {
|
||||
|
||||
private final int minX;
|
||||
private final int minY;
|
||||
private final int minZ;
|
||||
private final int widthX;
|
||||
private final int widthY;
|
||||
private final int widthZ;
|
||||
private File resetFile;
|
||||
private final Point minPoint;
|
||||
private final Point maxPoint;
|
||||
private final Point copyPoint;
|
||||
private final boolean rotate;
|
||||
private final Region region;
|
||||
|
||||
public WorkArea(int minX, int minY, int minZ, int widthX, int widthY, int widthZ, File resetFile, boolean rotate, Region region) {
|
||||
this.minX = minX;
|
||||
this.minY = minY;
|
||||
this.minZ = minZ;
|
||||
this.widthX = widthX;
|
||||
this.widthY = widthY;
|
||||
this.widthZ = widthZ;
|
||||
this.resetFile = resetFile;
|
||||
this.rotate = rotate;
|
||||
this.region = region;
|
||||
|
||||
minPoint = new Point(minX, minY, minZ);
|
||||
maxPoint = new Point(minX + widthX - 1, minY + widthY - 1, minZ + widthZ - 1);
|
||||
copyPoint = minPoint.add(widthX / 2, widthY, widthZ / 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull Point getMinPoint(boolean extension) {
|
||||
return minPoint;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull Point getMaxPoint(boolean extension) {
|
||||
return maxPoint;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull Point getCopyPoint() {
|
||||
return copyPoint;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NormalArea setResetFile(File resetFile) {
|
||||
this.resetFile = resetFile;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public File getResetFile() {
|
||||
return resetFile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset(PasteBuilder pasteBuilder, boolean extension) {
|
||||
EditSession editSession = pasteBuilder.minPoint(minPoint)
|
||||
.maxPoint(maxPoint)
|
||||
.rotate(rotate)
|
||||
.run();
|
||||
region.getHistory().remember(editSession);
|
||||
}
|
||||
}
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* This file is a part of the SteamWar software.
|
||||
*
|
||||
* Copyright (C) 2020 SteamWar.de-Serverteam
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.steamwar.bausystem.region.dynamic.normal;
|
||||
|
||||
import de.steamwar.bausystem.region.FlagOptional;
|
||||
import de.steamwar.bausystem.region.FlagStorage;
|
||||
import de.steamwar.bausystem.region.RegionHistory;
|
||||
import de.steamwar.bausystem.region.dynamic.DynamicRegion;
|
||||
import de.steamwar.bausystem.region.dynamic.RegionConstructorData;
|
||||
import de.steamwar.bausystem.region.dynamic.RegionDataRepository;
|
||||
import de.steamwar.bausystem.region.flags.Flag;
|
||||
import de.steamwar.bausystem.region.flags.TestblockMode;
|
||||
import lombok.Getter;
|
||||
import lombok.NonNull;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public abstract class WorkRegion extends DynamicRegion {
|
||||
|
||||
@Getter
|
||||
private FlagStorage flags = new NormalFlagStorage();
|
||||
|
||||
@Getter
|
||||
protected NormalArea area = NormalArea.EMPTY;
|
||||
protected NormalArea northArea = NormalArea.EMPTY;
|
||||
protected NormalArea southArea = NormalArea.EMPTY;
|
||||
|
||||
protected File frame;
|
||||
protected File testblock;
|
||||
|
||||
@Getter
|
||||
private final RegionHistory history = new RegionHistory.Impl(20);
|
||||
|
||||
protected WorkRegion(int minX, int minZ) {
|
||||
super(minX, minZ);
|
||||
RegionDataRepository.loadFlagStorage(this, flags);
|
||||
}
|
||||
|
||||
protected WorkRegion(RegionConstructorData regionConstructorData) {
|
||||
super(regionConstructorData);
|
||||
RegionDataRepository.loadFlagStorage(this, flags);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(DynamicRegion updateFrom) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFlags(FlagStorage flags) {
|
||||
this.flags = flags;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull Area getBuildArea() {
|
||||
FlagOptional<TestblockMode> testblock = flags.get(Flag.TESTBLOCK);
|
||||
if (testblock.isWithDefault(TestblockMode.NO_VALUE)) {
|
||||
return Area.EMPTY;
|
||||
}
|
||||
if (testblock.isWithDefault(TestblockMode.SOUTH)) {
|
||||
return northArea.setResetFile(this.frame);
|
||||
} else {
|
||||
return southArea.setResetFile(this.frame);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull Area getTestblockArea() {
|
||||
FlagOptional<TestblockMode> testblock = flags.get(Flag.TESTBLOCK);
|
||||
if (testblock.isWithDefault(TestblockMode.NO_VALUE)) {
|
||||
return Area.EMPTY;
|
||||
}
|
||||
if (testblock.isWithDefault(TestblockMode.SOUTH)) {
|
||||
return southArea.setResetFile(this.testblock);
|
||||
} else {
|
||||
return northArea.setResetFile(this.testblock);
|
||||
}
|
||||
}
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* This file is a part of the SteamWar software.
|
||||
*
|
||||
* Copyright (C) 2020 SteamWar.de-Serverteam
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.steamwar.bausystem.region.dynamic.normal.work;
|
||||
|
||||
import de.steamwar.bausystem.region.RegionConfig;
|
||||
import de.steamwar.bausystem.region.RegionType;
|
||||
import de.steamwar.bausystem.region.dynamic.RegionConstructorData;
|
||||
import de.steamwar.bausystem.region.dynamic.normal.WorkArea;
|
||||
import de.steamwar.bausystem.region.dynamic.normal.WorkRegion;
|
||||
import lombok.Getter;
|
||||
import lombok.NonNull;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class MicroWarGear21Region extends WorkRegion {
|
||||
|
||||
public static final int widthX = 57;
|
||||
public static final int widthZ = 114;
|
||||
|
||||
private static final File MODE_DIR = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "sections/regions/microwargear21/");
|
||||
private static final File REGION_FILE = new File(MODE_DIR, "Region.schem");
|
||||
private static final File FRAME_FILE = new File(MODE_DIR, "Frame.schem");
|
||||
private static final File TESTBLOCK_FILE = new File(MODE_DIR, "Testblock.schem");
|
||||
|
||||
@Getter
|
||||
private final RegionConfig gameModeConfig = new RegionConfig(null); // TODO: Implement
|
||||
|
||||
public MicroWarGear21Region(int minX, int minZ) {
|
||||
super(minX, minZ);
|
||||
area = new WorkArea(minX, 0, minZ, widthX, 255, widthZ, REGION_FILE, false, this);
|
||||
northArea = new WorkArea(minX + 25, 32, minZ + 25, 7, 7, 7, null, false, this);
|
||||
southArea = new WorkArea(minX + 25, 32, minZ + 82, 7, 7, 7, null, true, this);
|
||||
frame = FRAME_FILE;
|
||||
testblock = TESTBLOCK_FILE;
|
||||
}
|
||||
|
||||
public MicroWarGear21Region(RegionConstructorData regionConstructorData) {
|
||||
super(regionConstructorData);
|
||||
area = new WorkArea(minX, 0, minZ, widthX, 255, widthZ, REGION_FILE, false, this);
|
||||
northArea = new WorkArea(minX + 25, 32, minZ + 25, 7, 7, 7, null, false, this);
|
||||
southArea = new WorkArea(minX + 25, 32, minZ + 82, 7, 7, 7, null, true, this);
|
||||
frame = FRAME_FILE;
|
||||
testblock = TESTBLOCK_FILE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull RegionType getType() {
|
||||
return RegionType.DRY;
|
||||
}
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* This file is a part of the SteamWar software.
|
||||
*
|
||||
* Copyright (C) 2020 SteamWar.de-Serverteam
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.steamwar.bausystem.region.dynamic.normal.work;
|
||||
|
||||
import de.steamwar.bausystem.region.RegionConfig;
|
||||
import de.steamwar.bausystem.region.RegionType;
|
||||
import de.steamwar.bausystem.region.dynamic.RegionConstructorData;
|
||||
import de.steamwar.bausystem.region.dynamic.normal.WorkArea;
|
||||
import de.steamwar.bausystem.region.dynamic.normal.WorkRegion;
|
||||
import lombok.Getter;
|
||||
import lombok.NonNull;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class MiniWarGear21Region extends WorkRegion {
|
||||
|
||||
public static final int widthX = 95;
|
||||
public static final int widthZ = 152;
|
||||
|
||||
private static final File MODE_DIR = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "sections/regions/miniwargear21/");
|
||||
private static final File REGION_FILE = new File(MODE_DIR, "Region.schem");
|
||||
private static final File FRAME_FILE = new File(MODE_DIR, "Frame.schem");
|
||||
private static final File TESTBLOCK_FILE = new File(MODE_DIR, "Testblock.schem");
|
||||
|
||||
@Getter
|
||||
private final RegionConfig gameModeConfig = new RegionConfig(null); // TODO: Implement
|
||||
|
||||
public MiniWarGear21Region(int minX, int minZ) {
|
||||
super(minX, minZ);
|
||||
area = new WorkArea(minX, 0, minZ, widthX, 255, widthZ, REGION_FILE, false, this);
|
||||
northArea = new WorkArea(minX + 29, 32, minZ + 29, 37, 26, 22, null, false, this);
|
||||
southArea = new WorkArea(minX + 29, 32, minZ + 101, 37, 26, 22, null, true, this);
|
||||
frame = FRAME_FILE;
|
||||
testblock = TESTBLOCK_FILE;
|
||||
}
|
||||
|
||||
public MiniWarGear21Region(RegionConstructorData regionConstructorData) {
|
||||
super(regionConstructorData);
|
||||
area = new WorkArea(minX, 0, minZ, widthX, 255, widthZ, REGION_FILE, false, this);
|
||||
northArea = new WorkArea(minX + 29, 32, minZ + 29, 37, 26, 22, null, false, this);
|
||||
southArea = new WorkArea(minX + 29, 32, minZ + 101, 37, 26, 22, null, true, this);
|
||||
frame = FRAME_FILE;
|
||||
testblock = TESTBLOCK_FILE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull RegionType getType() {
|
||||
return RegionType.DRY;
|
||||
}
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* This file is a part of the SteamWar software.
|
||||
*
|
||||
* Copyright (C) 2020 SteamWar.de-Serverteam
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.steamwar.bausystem.region.dynamic.normal.work;
|
||||
|
||||
import de.steamwar.bausystem.region.RegionConfig;
|
||||
import de.steamwar.bausystem.region.RegionType;
|
||||
import de.steamwar.bausystem.region.dynamic.RegionConstructorData;
|
||||
import de.steamwar.bausystem.region.dynamic.normal.WorkArea;
|
||||
import de.steamwar.bausystem.region.dynamic.normal.WorkRegion;
|
||||
import lombok.Getter;
|
||||
import lombok.NonNull;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class WarGear21Region extends WorkRegion {
|
||||
|
||||
public static final int widthX = 133;
|
||||
public static final int widthZ = 228;
|
||||
|
||||
private static final File MODE_DIR = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "sections/regions/wargear21/");
|
||||
private static final File REGION_FILE = new File(MODE_DIR, "Region.schem");
|
||||
private static final File FRAME_FILE = new File(MODE_DIR, "Frame.schem");
|
||||
private static final File TESTBLOCK_FILE = new File(MODE_DIR, "Testblock.schem");
|
||||
|
||||
@Getter
|
||||
private final RegionConfig gameModeConfig = new RegionConfig(null); // TODO: Implement
|
||||
|
||||
public WarGear21Region(int minX, int minZ) {
|
||||
super(minX, minZ);
|
||||
area = new WorkArea(minX, 0, minZ, widthX, 255, widthZ, REGION_FILE, false, this);
|
||||
northArea = new WorkArea(minX + 33, 32, minZ + 42, 67, 41, 47, null, false, this);
|
||||
southArea = new WorkArea(minX + 33, 32, minZ + 139, 67, 41, 47, null, true, this);
|
||||
frame = FRAME_FILE;
|
||||
testblock = TESTBLOCK_FILE;
|
||||
}
|
||||
|
||||
public WarGear21Region(RegionConstructorData regionConstructorData) {
|
||||
super(regionConstructorData);
|
||||
area = new WorkArea(minX, 0, minZ, widthX, 255, widthZ, REGION_FILE, false, this);
|
||||
northArea = new WorkArea(minX + 33, 32, minZ + 42, 67, 41, 47, null, false, this);
|
||||
southArea = new WorkArea(minX + 33, 32, minZ + 139, 67, 41, 47, null, true, this);
|
||||
frame = FRAME_FILE;
|
||||
testblock = TESTBLOCK_FILE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull RegionType getType() {
|
||||
return RegionType.DRY;
|
||||
}
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* This file is a part of the SteamWar software.
|
||||
*
|
||||
* Copyright (C) 2020 SteamWar.de-Serverteam
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.steamwar.bausystem.region.dynamic.normal.work;
|
||||
|
||||
import de.steamwar.bausystem.region.RegionConfig;
|
||||
import de.steamwar.bausystem.region.RegionType;
|
||||
import de.steamwar.bausystem.region.dynamic.RegionConstructorData;
|
||||
import de.steamwar.bausystem.region.dynamic.normal.WorkArea;
|
||||
import de.steamwar.bausystem.region.dynamic.normal.WorkRegion;
|
||||
import lombok.Getter;
|
||||
import lombok.NonNull;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class WarShip21Region extends WorkRegion {
|
||||
|
||||
public static final int widthX = 285;
|
||||
public static final int widthZ = 228;
|
||||
|
||||
private static final File MODE_DIR = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "sections/regions/warship21/");
|
||||
private static final File REGION_FILE = new File(MODE_DIR, "Region.schem");
|
||||
private static final File FRAME_FILE = new File(MODE_DIR, "Frame.schem");
|
||||
private static final File TESTBLOCK_FILE = new File(MODE_DIR, "Testblock.schem");
|
||||
|
||||
@Getter
|
||||
private final RegionConfig gameModeConfig = new RegionConfig(null); // TODO: Implement
|
||||
|
||||
public WarShip21Region(int minX, int minZ) {
|
||||
super(minX, minZ);
|
||||
area = new WorkArea(minX, 0, minZ, widthX, 255, widthZ, REGION_FILE, false, this);
|
||||
// northArea = new WorkArea(minX + 33, 32, minZ + 42, 67, 41, 47, null, false, this);
|
||||
// southArea = new WorkArea(minX + 33, 32, minZ + 139, 67, 41, 47, null, true, this);
|
||||
frame = FRAME_FILE;
|
||||
testblock = TESTBLOCK_FILE;
|
||||
}
|
||||
|
||||
public WarShip21Region(RegionConstructorData regionConstructorData) {
|
||||
super(regionConstructorData);
|
||||
area = new WorkArea(minX, 0, minZ, widthX, 255, widthZ, REGION_FILE, false, this);
|
||||
// northArea = new WorkArea(minX + 33, 32, minZ + 42, 67, 41, 47, null, false, this);
|
||||
// southArea = new WorkArea(minX + 33, 32, minZ + 139, 67, 41, 47, null, true, this);
|
||||
frame = FRAME_FILE;
|
||||
testblock = TESTBLOCK_FILE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull RegionType getType() {
|
||||
return RegionType.WET;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -40,7 +40,7 @@ import java.util.function.Function;
|
||||
|
||||
public class PathAreaTile implements Region.Area {
|
||||
|
||||
private static final File PATH_DIR = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "sections/path_actual");
|
||||
private static final File PATH_DIR = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "sections/path");
|
||||
private static final File PATH_CENTER = new File(PATH_DIR, "PathCenter.schem");
|
||||
|
||||
@RequiredArgsConstructor
|
||||
|
||||
-1
@@ -28,7 +28,6 @@ import de.steamwar.bausystem.region.dynamic.NonNormalFlagStorage;
|
||||
import de.steamwar.bausystem.region.dynamic.RegionConstructorData;
|
||||
import de.steamwar.bausystem.region.dynamic.RegionDataRepository;
|
||||
import de.steamwar.bausystem.region.dynamic.spawn.SpawnAreaTile;
|
||||
import de.steamwar.bausystem.region.dynamic.spawn.SpawnResetter;
|
||||
import lombok.NonNull;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user