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:
Commit
b516e169e8
@ -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) {
|
||||||
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){
|
||||||
|
@ -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){
|
||||||
|
@ -142,9 +142,13 @@ 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) {
|
||||||
|
if(Config.BlueRotate){
|
||||||
|
Fight.getRedTeam().setSchem(Schematic.getSchemFromDB(Config.PrepareSchemID));
|
||||||
|
}else{
|
||||||
Fight.getBlueTeam().setSchem(Schematic.getSchemFromDB(Config.PrepareSchemID));
|
Fight.getBlueTeam().setSchem(Schematic.getSchemFromDB(Config.PrepareSchemID));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
|
@ -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,8 +92,12 @@ public class PrepareSchem implements Listener {
|
|||||||
FightTeam team = Fight.getPlayerTeam(player);
|
FightTeam team = Fight.getPlayerTeam(player);
|
||||||
|
|
||||||
if (team == null) {
|
if (team == null) {
|
||||||
|
if(Config.BlueRotate){
|
||||||
|
Fight.getRedTeam().addMember(player);
|
||||||
|
}else{
|
||||||
Fight.getBlueTeam().addMember(player);
|
Fight.getBlueTeam().addMember(player);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(FightState.getFightState() == FightState.PRE_LEADER_SETUP) {
|
if(FightState.getFightState() == FightState.PRE_LEADER_SETUP) {
|
||||||
FightSystem.setPreSchemState();
|
FightSystem.setPreSchemState();
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren