Fix MWGDisplayRegion, WG45DisplayRegion, WS175DisplayRegion, WS175PlotRegion

Fix AreaBlock.create
This commit is contained in:
2026-03-21 20:31:01 +01:00
parent c0c92dc8b4
commit 9683bb9e93
5 changed files with 11 additions and 10 deletions
@@ -58,7 +58,7 @@ public class AreaBlock implements Region.Area {
int tempSizeZ = switch (copyLocation) { int tempSizeZ = switch (copyLocation) {
case CENTER -> size.getZ() * 2 + distance; case CENTER -> size.getZ() * 2 + distance;
case SIDE -> size.getZ() + distance - 1; case SIDE -> size.getZ() + distance;
}; };
// Calculate Offset Region to North // Calculate Offset Region to North
@@ -81,7 +81,10 @@ public class AreaBlock implements Region.Area {
// Calculate Offset North to South // Calculate Offset North to South
minOffsetZ += distance; minOffsetZ += distance;
if (copyLocation == CopyLocation.CENTER) minOffsetZ += size.getZ(); switch (copyLocation) {
case CENTER -> minOffsetZ += size.getZ();
case SIDE -> minOffsetZ -= 1;
}
// Calculate South Points // Calculate South Points
Point southMinPoint = regionMinPoint.add(minOffsetX, yOffset, minOffsetZ); Point southMinPoint = regionMinPoint.add(minOffsetX, yOffset, minOffsetZ);
@@ -44,7 +44,7 @@ import java.util.UUID;
public class MWGDisplayRegion extends DynamicRegion { public class MWGDisplayRegion extends DynamicRegion {
protected static final int TILE_X = 3; protected static final int TILE_X = 3;
protected static final int TILE_Z = 2; protected static final int TILE_Z = 3;
private static final File DIRECTORY = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "sections/miniwargear/display"); private static final File DIRECTORY = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "sections/miniwargear/display");
private static final VariantSelector SELECTOR = VariantSelector.Get(DIRECTORY); private static final VariantSelector SELECTOR = VariantSelector.Get(DIRECTORY);
@@ -44,7 +44,7 @@ import java.util.UUID;
public class WG45DisplayRegion extends DynamicRegion { public class WG45DisplayRegion extends DynamicRegion {
protected static final int TILE_X = 5; protected static final int TILE_X = 5;
protected static final int TILE_Z = 4; protected static final int TILE_Z = 5;
private static final File DIRECTORY = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "sections/wargear_45/display"); private static final File DIRECTORY = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "sections/wargear_45/display");
private static final VariantSelector SELECTOR = VariantSelector.Get(DIRECTORY); private static final VariantSelector SELECTOR = VariantSelector.Get(DIRECTORY);
@@ -43,8 +43,7 @@ import java.util.UUID;
) )
public class WS175DisplayRegion extends DynamicRegion { public class WS175DisplayRegion extends DynamicRegion {
// TODO: X +/- 1 protected static final int TILE_X = 11;
protected static final int TILE_X = 10;
protected static final int TILE_Z = 3; protected static final int TILE_Z = 3;
private static final File DIRECTORY = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "sections/warship_175/display"); private static final File DIRECTORY = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "sections/warship_175/display");
@@ -44,9 +44,8 @@ import java.util.UUID;
) )
public class WS175PlotRegion extends DynamicRegion { public class WS175PlotRegion extends DynamicRegion {
// TODO: X +/- 1 protected static final int TILE_X = 11;
protected static final int TILE_X = 10; protected static final int TILE_Z = 10;
protected static final int TILE_Z = 9;
private static final File DIRECTORY = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "sections/warship_175/plot"); private static final File DIRECTORY = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "sections/warship_175/plot");
private static final VariantSelector REGION = VariantSelector.Get(new File(DIRECTORY, "region")); private static final VariantSelector REGION = VariantSelector.Get(new File(DIRECTORY, "region"));
@@ -64,7 +63,7 @@ public class WS175PlotRegion extends DynamicRegion {
Tile tile = Tile.fromXZ(minX, minZ).orElseThrow(); Tile tile = Tile.fromXZ(minX, minZ).orElseThrow();
area = new AreaTile(tile, TILE_X, TILE_Z, this, REGION); area = new AreaTile(tile, TILE_X, TILE_Z, this, REGION);
Pair<AreaBlock, AreaBlock> pair = AreaBlock.create(this, 36, new Point(175, 58, 39), new Point(0, 0, 0), new Point(0, 0, 0), AreaBlock.CopyLocation.SIDE, 132); Pair<AreaBlock, AreaBlock> pair = AreaBlock.create(this, 36, new Point(175, 58, 39), new Point(12, 0, 8), new Point(12, 0, 8), AreaBlock.CopyLocation.SIDE, 132);
northArea = pair.getKey(); northArea = pair.getKey();
southArea = pair.getValue(); southArea = pair.getValue();