SteamWar/FightSystem
Archiviert
13
1

Merge pull request 'Fix rotateted schematics' (#253) from fix_rotation into master

Reviewed-on: #253
Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Lixfel 2021-04-09 16:07:27 +02:00
Commit aa8c279f9e
3 geänderte Dateien mit 10 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -123,7 +123,7 @@ public class FightTeam_14 {
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));
BlockVector3 min = BlockVector3.at(region.getMinX(), minY, region.getMinZ());
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.setCopyingEntities(false);
if(rotate){
forwardExtentCopy.setTransform(new AffineTransform().rotateY(180));
}
try{
Operations.complete(forwardExtentCopy);
}catch(WorldEditException e){

Datei anzeigen

@ -125,7 +125,7 @@ public class FightTeam_8 {
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));
Vector min = new Vector(region.getMinX(), minY, region.getMinZ());
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);
ForwardExtentCopy forwardExtentCopy = new ForwardExtentCopy(editSession, cuboidRegion, clipboard, min);
if(rotate){
forwardExtentCopy.setTransform(new AffineTransform().rotateY(180));
}
try{
Operations.complete(forwardExtentCopy);
}catch(WorldEditException e){

Datei anzeigen

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