Fix rotateted schematics
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
a62d9ab48a
Commit
8dbcc3c2e2
@ -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){
|
||||||
|
@ -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){
|
||||||
|
@ -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;
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren