Fix schem height
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
f6df9eecee
Commit
01e1dd8a06
@ -123,9 +123,9 @@ public class FightTeam_14 {
|
|||||||
return block.getType() == Material.MOVING_PISTON;
|
return block.getType() == Material.MOVING_PISTON;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void saveSchem(Schematic schem, Region region) {
|
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(), region.getMinY(), 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()));
|
||||||
BlockArrayClipboard clipboard = new BlockArrayClipboard(cuboidRegion);
|
BlockArrayClipboard clipboard = new BlockArrayClipboard(cuboidRegion);
|
||||||
EditSession editSession = WorldEdit.getInstance().getEditSessionFactory().getEditSession(w, -1);
|
EditSession editSession = WorldEdit.getInstance().getEditSessionFactory().getEditSession(w, -1);
|
||||||
|
@ -125,9 +125,9 @@ 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) {
|
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(), region.getMinY(), 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()));
|
||||||
BlockArrayClipboard clipboard = new BlockArrayClipboard(cuboidRegion);
|
BlockArrayClipboard clipboard = new BlockArrayClipboard(cuboidRegion);
|
||||||
EditSession editSession = WorldEdit.getInstance().getEditSessionFactory().getEditSession(w, -1);
|
EditSession editSession = WorldEdit.getInstance().getEditSessionFactory().getEditSession(w, -1);
|
||||||
|
@ -48,6 +48,7 @@ public class PrepareSchem implements Listener {
|
|||||||
super.disable();
|
super.disable();
|
||||||
Region region = Fight.getBlueTeam().getExtendRegion();
|
Region region = Fight.getBlueTeam().getExtendRegion();
|
||||||
World world = Bukkit.getWorlds().get(0);
|
World world = Bukkit.getWorlds().get(0);
|
||||||
|
int minY = Fight.getBlueTeam().getSchemRegion().getMinY();
|
||||||
|
|
||||||
Schematic schem;
|
Schematic schem;
|
||||||
try{
|
try{
|
||||||
@ -72,8 +73,8 @@ public class PrepareSchem implements Listener {
|
|||||||
|
|
||||||
try{
|
try{
|
||||||
VersionedRunnable.call(
|
VersionedRunnable.call(
|
||||||
new VersionedRunnable(() -> FightTeam_8.saveSchem(schem, region), 8),
|
new VersionedRunnable(() -> FightTeam_8.saveSchem(schem, region, minY), 8),
|
||||||
new VersionedRunnable(() -> FightTeam_14.saveSchem(schem, region), 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;
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren