forked from SteamWar/SteamWar
Fix Warp WorldSpawn
This commit is contained in:
+6
-1
@@ -27,6 +27,7 @@ import de.steamwar.bausystem.region.dynamic.global.GlobalRegion;
|
||||
import de.steamwar.bausystem.region.dynamic.path.PathRegion;
|
||||
import de.steamwar.bausystem.region.dynamic.spawn.SpawnPathRegion;
|
||||
import de.steamwar.bausystem.region.dynamic.spawn.SpawnRegion;
|
||||
import de.steamwar.bausystem.region.dynamic.spawn.SpawnResetter;
|
||||
import lombok.NonNull;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
@@ -77,7 +78,11 @@ public class DynamicRegionSystem implements RegionSystem {
|
||||
|
||||
@Override
|
||||
public @NonNull Location getWorldSpawn() {
|
||||
return new Location(Bukkit.getWorlds().get(0), 0, 0, 0);
|
||||
if (SpawnResetter.isBigSpawn()) {
|
||||
return SpawnResetter.BIG_WORLD_SPAWN;
|
||||
} else {
|
||||
return SpawnResetter.SMALL_WORLD_SPAWN;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
@@ -20,8 +20,10 @@
|
||||
package de.steamwar.bausystem.region.dynamic.normal;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import de.steamwar.bausystem.region.FlagStorage;
|
||||
import de.steamwar.bausystem.region.Point;
|
||||
import de.steamwar.bausystem.region.Region;
|
||||
import de.steamwar.bausystem.region.flags.Flag;
|
||||
import de.steamwar.bausystem.utils.PasteBuilder;
|
||||
import lombok.NonNull;
|
||||
import lombok.Setter;
|
||||
@@ -92,6 +94,7 @@ public class WorkArea extends NormalArea {
|
||||
EditSession editSession = pasteBuilder.minPoint(minPoint)
|
||||
.maxPoint(maxPoint)
|
||||
.rotate(rotate)
|
||||
.color(region.getFlags().get(Flag.COLOR).getWithDefault())
|
||||
.run();
|
||||
region.getHistory().remember(editSession);
|
||||
}
|
||||
|
||||
+4
@@ -38,6 +38,9 @@ public class SpawnResetter {
|
||||
private static final File SECTIONS_DIR = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "sections");
|
||||
private static final File RESET_FILE = new File(SECTIONS_DIR, "spawn/SpawnBig.schem");
|
||||
|
||||
public static final Location BIG_WORLD_SPAWN = new Location(Bukkit.getWorlds().get(0), 0.5, 26, 0.5);
|
||||
public static final Location SMALL_WORLD_SPAWN = new Location(Bukkit.getWorlds().get(0), 0.5, 32, 0.5);
|
||||
|
||||
private static final Location LOCATION = new Location(null, 0, 0, 0);
|
||||
|
||||
public boolean isBigSpawn() {
|
||||
@@ -81,6 +84,7 @@ public class SpawnResetter {
|
||||
private void internalReset(Region region, boolean message) {
|
||||
Region.Area area = region.getArea();
|
||||
Point minPoint = area.getMinPoint(false);
|
||||
System.out.println(area.getClass() + " " + area.getResetFile());
|
||||
Clipboard clipboard = FlatteningWrapper.impl.loadSchematic(area.getResetFile());
|
||||
BlockVector3 offset = clipboard.getRegion().getMinimumPoint().subtract(clipboard.getOrigin());
|
||||
BlockVector3 to = minPoint.toBlockVector3().subtract(offset);
|
||||
|
||||
Reference in New Issue
Block a user