SteamWar/FightSystem
Archiviert
13
1

Merge pull request 'Fix rotation issues' (#259) from fix_rotate into master

Reviewed-on: #259
Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Lixfel 2021-04-14 20:27:50 +02:00
Commit b516e169e8
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;
}
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));
BlockVector3 min = BlockVector3.at(region.getMinX(), minY, region.getMinZ());
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.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, boolean rotate) {
public static void saveSchem(Schematic schem, Region region, int minY) {
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,9 +133,6 @@ 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

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

Datei anzeigen

@ -46,9 +46,9 @@ public class PrepareSchem implements Listener {
@Override
public void disable() {
super.disable();
Region region = Fight.getBlueTeam().getExtendRegion();
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;
try{
@ -73,8 +73,8 @@ public class PrepareSchem implements Listener {
try{
VersionedRunnable.call(
new VersionedRunnable(() -> FightTeam_8.saveSchem(schem, region, minY, Config.BlueRotate), 8),
new VersionedRunnable(() -> FightTeam_14.saveSchem(schem, region, minY, Config.BlueRotate), 14));
new VersionedRunnable(() -> FightTeam_8.saveSchem(schem, region, minY), 8),
new VersionedRunnable(() -> FightTeam_14.saveSchem(schem, region, minY), 14));
}catch(IllegalStateException e){
FightSystem.shutdown(FightSystem.PREFIX + "§cDie Schematic konnte nicht gespeichert werden, Einsenden wird abgebrochen.");
return;
@ -92,8 +92,12 @@ public class PrepareSchem implements Listener {
FightTeam team = Fight.getPlayerTeam(player);
if (team == null) {
if(Config.BlueRotate){
Fight.getRedTeam().addMember(player);
}else{
Fight.getBlueTeam().addMember(player);
}
}
if(FightState.getFightState() == FightState.PRE_LEADER_SETUP) {
FightSystem.setPreSchemState();