diff --git a/src/me/yaruma/fightsystem/fight/FightTeam.java b/src/me/yaruma/fightsystem/fight/FightTeam.java index c85f55e..6edda79 100644 --- a/src/me/yaruma/fightsystem/fight/FightTeam.java +++ b/src/me/yaruma/fightsystem/fight/FightTeam.java @@ -194,6 +194,16 @@ public class FightTeam { }else{ v = paste.subtract(dimensions.getX()/2 - dimensions.getX()%2, 0, dimensions.getZ()/2 - dimensions.getZ()%2).subtract(offset); } + if(Config.AlignWater){ + Vector it = schem.getClipboard().getMinimumPoint(); + int depth = 0; + while(!schem.getClipboard().getBlock(it).isAir()){ + depth++; + it = it.setY(it.getY()+1); + } + System.out.println(name + " " + Config.WaterDepth + " " + depth + " " + schem.getClipboard().getBlock(new Vector(0, 0, 0))); + v = v.add(0, Config.WaterDepth - depth, 0); + } schem.paste(w, v, false, true, aT).flushQueue(); Bukkit.getScheduler().runTaskLater(FightSystem.getPlugin(), () ->{ teleportToSpawn(); diff --git a/src/me/yaruma/fightsystem/utils/Config.java b/src/me/yaruma/fightsystem/utils/Config.java index c2f8ec6..2d184fe 100644 --- a/src/me/yaruma/fightsystem/utils/Config.java +++ b/src/me/yaruma/fightsystem/utils/Config.java @@ -33,6 +33,8 @@ public class Config { public static int underArenaBorder; public static int BorderFromSchematic; public static int upperArenaBorder; + public static boolean AlignWater; + public static int WaterDepth; public static boolean OnlyPublicSchematics; public static String SchematicDirectory; @@ -116,6 +118,8 @@ public class Config { Schem2BorderZ = worldconfig.getInt("Arena.Schem2Border.z"); underArenaBorder = worldconfig.getInt("Arena.underArenaBorder"); BorderFromSchematic = worldconfig.getInt("Arena.BorderFromSchematic"); + AlignWater = worldconfig.getBoolean("Arena.AlignWater"); + WaterDepth = worldconfig.getInt("Arena.WaterDepth"); OnlyPublicSchematics = config.getBoolean("Schematic.OnlyPublicSchematics"); SchematicDirectory = config.getString("Schematic.Directory");