SteamWar/FightSystem
Archiviert
13
1

Fix rotateted schematics #253

Manuell gemergt
Lixfel hat 1 Commits von fix_rotation nach master 2021-04-09 16:07:28 +02:00 zusammengeführt
3 geänderte Dateien mit 10 neuen und 4 gelöschten Zeilen
Nur Änderungen aus Commit 8dbcc3c2e2 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -123,7 +123,7 @@ public class FightTeam_14 {
return block.getType() == Material.MOVING_PISTON; return block.getType() == Material.MOVING_PISTON;
} }
public static void saveSchem(Schematic schem, Region region, int minY) { public static void saveSchem(Schematic schem, Region region, int minY, boolean rotate) {
World w = new BukkitWorld(Bukkit.getWorlds().get(0)); World w = new BukkitWorld(Bukkit.getWorlds().get(0));
BlockVector3 min = BlockVector3.at(region.getMinX(), minY, region.getMinZ()); BlockVector3 min = BlockVector3.at(region.getMinX(), minY, region.getMinZ());
CuboidRegion cuboidRegion = new CuboidRegion(w, min, BlockVector3.at(region.getMaxX(), region.getMaxY(), region.getMaxZ())); CuboidRegion cuboidRegion = new CuboidRegion(w, min, BlockVector3.at(region.getMaxX(), region.getMaxY(), region.getMaxZ()));
@ -132,6 +132,9 @@ public class FightTeam_14 {
ForwardExtentCopy forwardExtentCopy = new ForwardExtentCopy(editSession, cuboidRegion, clipboard, min); ForwardExtentCopy forwardExtentCopy = new ForwardExtentCopy(editSession, cuboidRegion, clipboard, min);
forwardExtentCopy.setCopyingEntities(false); forwardExtentCopy.setCopyingEntities(false);
if(rotate){
forwardExtentCopy.setTransform(new AffineTransform().rotateY(180));
}
try{ try{
Operations.complete(forwardExtentCopy); Operations.complete(forwardExtentCopy);
}catch(WorldEditException e){ }catch(WorldEditException e){

Datei anzeigen

@ -125,7 +125,7 @@ public class FightTeam_8 {
return block.getType() == Material.PISTON_MOVING_PIECE; return block.getType() == Material.PISTON_MOVING_PIECE;
} }
public static void saveSchem(Schematic schem, Region region, int minY) { public static void saveSchem(Schematic schem, Region region, int minY, boolean rotate) {
World w = new BukkitWorld(Bukkit.getWorlds().get(0)); World w = new BukkitWorld(Bukkit.getWorlds().get(0));
Vector min = new Vector(region.getMinX(), minY, region.getMinZ()); Vector min = new Vector(region.getMinX(), minY, region.getMinZ());
CuboidRegion cuboidRegion = new CuboidRegion(w, min, new Vector(region.getMaxX(), region.getMaxY(), region.getMaxZ())); CuboidRegion cuboidRegion = new CuboidRegion(w, min, new Vector(region.getMaxX(), region.getMaxY(), region.getMaxZ()));
@ -133,6 +133,9 @@ public class FightTeam_8 {
EditSession editSession = WorldEdit.getInstance().getEditSessionFactory().getEditSession(w, -1); EditSession editSession = WorldEdit.getInstance().getEditSessionFactory().getEditSession(w, -1);
ForwardExtentCopy forwardExtentCopy = new ForwardExtentCopy(editSession, cuboidRegion, clipboard, min); ForwardExtentCopy forwardExtentCopy = new ForwardExtentCopy(editSession, cuboidRegion, clipboard, min);
if(rotate){
forwardExtentCopy.setTransform(new AffineTransform().rotateY(180));
}
try{ try{
Operations.complete(forwardExtentCopy); Operations.complete(forwardExtentCopy);
}catch(WorldEditException e){ }catch(WorldEditException e){

Datei anzeigen

@ -73,8 +73,8 @@ public class PrepareSchem implements Listener {
try{ try{
VersionedRunnable.call( VersionedRunnable.call(
new VersionedRunnable(() -> FightTeam_8.saveSchem(schem, region, minY), 8), new VersionedRunnable(() -> FightTeam_8.saveSchem(schem, region, minY, Config.BlueRotate), 8),
new VersionedRunnable(() -> FightTeam_14.saveSchem(schem, region, minY), 14)); new VersionedRunnable(() -> FightTeam_14.saveSchem(schem, region, minY, Config.BlueRotate), 14));
}catch(IllegalStateException e){ }catch(IllegalStateException e){
FightSystem.shutdown(FightSystem.PREFIX + "§cDie Schematic konnte nicht gespeichert werden, Einsenden wird abgebrochen."); FightSystem.shutdown(FightSystem.PREFIX + "§cDie Schematic konnte nicht gespeichert werden, Einsenden wird abgebrochen.");
return; return;