SteamWar/FightSystem
Archiviert
13
1

Fix rotation issues #259

Manuell gemergt
Lixfel hat 1 Commits von fix_rotate nach master 2021-04-14 20:27:51 +02:00 zusammengeführt
4 geänderte Dateien mit 17 neuen und 14 gelöschten Zeilen

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, boolean rotate) { public static void saveSchem(Schematic schem, Region region, int minY) {
Lixfel markierte diese Unterhaltung als gelöst
Review

Würde hiermit nicht jetzt bei jeder Arena, wo Blau und Rot gewechselt sind, nicht richtig funktionieren?

Würde hiermit nicht jetzt bei jeder Arena, wo Blau und Rot gewechselt sind, nicht richtig funktionieren?
Review

Nein, da immer die ungedrehte Seite verwendet wird.

Nein, da immer die ungedrehte Seite verwendet wird.
Review

ok

ok
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,9 +132,7 @@ 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, boolean rotate) { public static void saveSchem(Schematic schem, Region region, int minY) {
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,9 +133,6 @@ 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

@ -142,7 +142,11 @@ public class FightSystem extends JavaPlugin {
}else if(Config.mode == ArenaMode.CHECK){ }else if(Config.mode == ArenaMode.CHECK){
Fight.getBlueTeam().setSchem(Schematic.getSchemFromDB(Config.CheckSchemID)); Fight.getBlueTeam().setSchem(Schematic.getSchemFromDB(Config.CheckSchemID));
}else if(Config.mode == ArenaMode.PREPARE) { }else if(Config.mode == ArenaMode.PREPARE) {
Fight.getBlueTeam().setSchem(Schematic.getSchemFromDB(Config.PrepareSchemID)); if(Config.BlueRotate){
Fight.getRedTeam().setSchem(Schematic.getSchemFromDB(Config.PrepareSchemID));
}else{
Fight.getBlueTeam().setSchem(Schematic.getSchemFromDB(Config.PrepareSchemID));
}
} }
} }

Datei anzeigen

@ -46,9 +46,9 @@ public class PrepareSchem implements Listener {
@Override @Override
public void disable() { public void disable() {
super.disable(); super.disable();
Region region = Fight.getBlueTeam().getExtendRegion();
World world = Bukkit.getWorlds().get(0); World world = Bukkit.getWorlds().get(0);
int minY = Fight.getBlueTeam().getSchemRegion().getMinY(); Region region = Config.BlueRotate ? Fight.getRedTeam().getExtendRegion() : Fight.getBlueTeam().getExtendRegion();
int minY = Config.BlueRotate ? Fight.getRedTeam().getSchemRegion().getMinY() : Fight.getBlueTeam().getSchemRegion().getMinY();
Schematic schem; Schematic schem;
try{ try{
@ -73,8 +73,8 @@ public class PrepareSchem implements Listener {
try{ try{
VersionedRunnable.call( VersionedRunnable.call(
new VersionedRunnable(() -> FightTeam_8.saveSchem(schem, region, minY, Config.BlueRotate), 8), new VersionedRunnable(() -> FightTeam_8.saveSchem(schem, region, minY), 8),
new VersionedRunnable(() -> FightTeam_14.saveSchem(schem, region, minY, Config.BlueRotate), 14)); new VersionedRunnable(() -> FightTeam_14.saveSchem(schem, region, minY), 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;
@ -92,7 +92,11 @@ public class PrepareSchem implements Listener {
FightTeam team = Fight.getPlayerTeam(player); FightTeam team = Fight.getPlayerTeam(player);
if (team == null) { if (team == null) {
Fight.getBlueTeam().addMember(player); if(Config.BlueRotate){
Fight.getRedTeam().addMember(player);
}else{
Fight.getBlueTeam().addMember(player);
}
} }
if(FightState.getFightState() == FightState.PRE_LEADER_SETUP) { if(FightState.getFightState() == FightState.PRE_LEADER_SETUP) {