hotfixes
Signed-off-by: Yaruma3341 <yaruma3341@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
086076ab58
Commit
42ee422149
@ -191,6 +191,12 @@ public class FightSystem extends JavaPlugin {
|
|||||||
Bukkit.getScheduler().cancelTask(WinconditionTechKO.taskID);
|
Bukkit.getScheduler().cancelTask(WinconditionTechKO.taskID);
|
||||||
|
|
||||||
setAllPlayersGM(GameMode.SPECTATOR);
|
setAllPlayersGM(GameMode.SPECTATOR);
|
||||||
|
for(FightPlayer team1 : winFightTeam.getPlayers()) {
|
||||||
|
team1.getPlayer().getInventory().clear();
|
||||||
|
}
|
||||||
|
for(FightPlayer team2 : Fight.getOpposite(winFightTeam).getPlayers()) {
|
||||||
|
team2.getPlayer().getInventory().clear();
|
||||||
|
}
|
||||||
Bukkit.broadcastMessage(" ");
|
Bukkit.broadcastMessage(" ");
|
||||||
|
|
||||||
if(winFightTeam != null) {
|
if(winFightTeam != null) {
|
||||||
|
@ -155,6 +155,7 @@ public class FightTeam {
|
|||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(FightSystem.getPlugin(), new Runnable() {
|
Bukkit.getScheduler().scheduleSyncDelayedTask(FightSystem.getPlugin(), new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
Bukkit.broadcastMessage("ADD WATER");
|
||||||
WinconditionTechKO.addWater();
|
WinconditionTechKO.addWater();
|
||||||
}
|
}
|
||||||
}, 20*10L);
|
}, 20*10L);
|
||||||
|
@ -71,6 +71,7 @@ public class WaterRemover {
|
|||||||
for (Block block : blocksToRemove) {
|
for (Block block : blocksToRemove) {
|
||||||
block.setType(Material.AIR);
|
block.setType(Material.AIR);
|
||||||
}
|
}
|
||||||
|
WinconditionTechKO.removeWater();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,10 +19,37 @@ public class WinconditionTechKO {
|
|||||||
public static void addWater() {
|
public static void addWater() {
|
||||||
if(!Config.TechKO) return;
|
if(!Config.TechKO) return;
|
||||||
|
|
||||||
|
int redMinX = Config.TeamRedCornerX;
|
||||||
|
int redMinY = Config.TeamRedCornerY;
|
||||||
|
int redMinZ = Config.TeamRedCornerZ;
|
||||||
|
int redMaxX = (redMinX + Config.SchemsizeX);
|
||||||
|
int redMaxY = (redMinY+ Config.SchemsizeY);
|
||||||
|
int redMaxZ = (redMinZ + Config.SchemsizeZ);
|
||||||
|
|
||||||
|
int blueMinX = Config.TeamBlueCornerX;
|
||||||
|
int blueMinY = Config.TeamBlueCornerY;
|
||||||
|
int blueMinZ = Config.TeamBlueCornerZ;
|
||||||
|
int blueMaxX = (blueMinX + Config.SchemsizeX);
|
||||||
|
int blueMaxY = (blueMinY + Config.SchemsizeY);
|
||||||
|
int blueMaxZ = (blueMinZ + Config.SchemsizeZ);
|
||||||
|
|
||||||
|
Bukkit.broadcastMessage(" " + redMinX);
|
||||||
|
Bukkit.broadcastMessage(" " + redMinY);
|
||||||
|
Bukkit.broadcastMessage(" " + redMinZ);
|
||||||
|
Bukkit.broadcastMessage(" " + redMaxX);
|
||||||
|
Bukkit.broadcastMessage(" " + redMaxY);
|
||||||
|
Bukkit.broadcastMessage(" " + redMaxZ);
|
||||||
|
Bukkit.broadcastMessage(" " + blueMinX);
|
||||||
|
Bukkit.broadcastMessage(" " + blueMinY);
|
||||||
|
Bukkit.broadcastMessage(" " + blueMinZ);
|
||||||
|
Bukkit.broadcastMessage(" " + blueMaxX);
|
||||||
|
Bukkit.broadcastMessage(" " + blueMaxY);
|
||||||
|
Bukkit.broadcastMessage(" " + blueMaxZ);
|
||||||
|
|
||||||
//Team Red
|
//Team Red
|
||||||
for(int x = Config.TeamRedCornerX; x <= (x + Config.SchemsizeX); x++) {
|
for(int x = redMinX; x <= redMaxX; x++) {
|
||||||
for(int y = Config.TeamRedCornerY; y <= (y + Config.SchemsizeY); y++) {
|
for(int y = redMinY; y <= redMaxY; y++) {
|
||||||
for(int z = Config.TeamRedCornerZ; z <= (y + Config.SchemsizeZ); z++) {
|
for(int z = redMinZ; z <= redMaxZ; z++) {
|
||||||
Location location = new Location(Bukkit.getWorlds().get(0), x, y, z);
|
Location location = new Location(Bukkit.getWorlds().get(0), x, y, z);
|
||||||
if(location.getBlock().getType() == Material.WATER
|
if(location.getBlock().getType() == Material.WATER
|
||||||
|| location.getBlock().getType() == Material.STATIONARY_WATER)
|
|| location.getBlock().getType() == Material.STATIONARY_WATER)
|
||||||
@ -32,9 +59,9 @@ public class WinconditionTechKO {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Team Blue
|
//Team Blue
|
||||||
for(int x = Config.TeamBlueCornerX; x <= (x + Config.SchemsizeX); x++) {
|
for(int x = blueMinX; x <= blueMaxX; x++) {
|
||||||
for(int y = Config.TeamBlueCornerY; y <= (y + Config.SchemsizeY); y++) {
|
for(int y = blueMinY; y <= blueMaxY; y++) {
|
||||||
for(int z = Config.TeamBlueCornerZ; z <= (y + Config.SchemsizeZ); z++) {
|
for(int z = blueMinZ; z <= blueMaxZ; z++) {
|
||||||
Location location = new Location(Bukkit.getWorlds().get(0), x, y, z);
|
Location location = new Location(Bukkit.getWorlds().get(0), x, y, z);
|
||||||
if(location.getBlock().getType() == Material.WATER
|
if(location.getBlock().getType() == Material.WATER
|
||||||
|| location.getBlock().getType() == Material.STATIONARY_WATER)
|
|| location.getBlock().getType() == Material.STATIONARY_WATER)
|
||||||
@ -42,6 +69,39 @@ public class WinconditionTechKO {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Bukkit.broadcastMessage("Red: " + teamRedWater.size());
|
||||||
|
Bukkit.broadcastMessage("Blue: " + teamBlueWater.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void removeWater() {
|
||||||
|
|
||||||
|
//Team Red
|
||||||
|
Iterator itrRed = teamRedWater.iterator();
|
||||||
|
while (itrRed.hasNext()) {
|
||||||
|
Location location = (Location) itrRed.next();
|
||||||
|
if(location.getBlock().getType() != Material.WATER && location.getBlock().getType() != Material.STATIONARY_WATER) {
|
||||||
|
itrRed.remove();
|
||||||
|
Bukkit.broadcastMessage("red remove" + teamRedWater.size());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(teamRedWater.isEmpty()) {
|
||||||
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "6Das Team " + Config.TeamRedPrefix + Config.TeamRedName + " §6ist Tech K.O. !");
|
||||||
|
FightSystem.getPlugin().setSpectateState(Fight.getBlueTeam());
|
||||||
|
}
|
||||||
|
|
||||||
|
//Team Blue
|
||||||
|
Iterator itrBlue = teamRedWater.iterator();
|
||||||
|
while (itrRed.hasNext()) {
|
||||||
|
Location location = (Location) itrRed.next();
|
||||||
|
if(location.getBlock().getType() != Material.WATER && location.getBlock().getType() != Material.STATIONARY_WATER) {
|
||||||
|
itrRed.remove();
|
||||||
|
Bukkit.broadcastMessage("blue remove" + teamBlueWater.size());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(teamBlueWater.isEmpty()) {
|
||||||
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "6Das Team " + Config.TeamBluePrefix + Config.TeamBlueName + " §6ist Tech K.O. !");
|
||||||
|
FightSystem.getPlugin().setSpectateState(Fight.getRedTeam());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void startAutoChecker() {
|
public static void startAutoChecker() {
|
||||||
@ -49,30 +109,7 @@ public class WinconditionTechKO {
|
|||||||
taskID = Bukkit.getScheduler().scheduleAsyncRepeatingTask(FightSystem.getPlugin(), new Runnable() {
|
taskID = Bukkit.getScheduler().scheduleAsyncRepeatingTask(FightSystem.getPlugin(), new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
removeWater();
|
||||||
//Team Red
|
|
||||||
Iterator itrRed = teamRedWater.iterator();
|
|
||||||
while (itrRed.hasNext()) {
|
|
||||||
Location location = (Location) itrRed.next();
|
|
||||||
if(location.getBlock().getType() != Material.WATER && location.getBlock().getType() != Material.STATIONARY_WATER)
|
|
||||||
itrRed.remove();
|
|
||||||
}
|
|
||||||
if(teamRedWater.isEmpty()) {
|
|
||||||
Bukkit.broadcastMessage(FightSystem.PREFIX + "6Das Team " + Config.TeamRedPrefix + Config.TeamRedName + " §6ist Tech K.O. !");
|
|
||||||
FightSystem.getPlugin().setSpectateState(Fight.getBlueTeam());
|
|
||||||
}
|
|
||||||
|
|
||||||
//Team Blue
|
|
||||||
Iterator itrBlue = teamRedWater.iterator();
|
|
||||||
while (itrRed.hasNext()) {
|
|
||||||
Location location = (Location) itrRed.next();
|
|
||||||
if(location.getBlock().getType() != Material.WATER && location.getBlock().getType() != Material.STATIONARY_WATER)
|
|
||||||
itrRed.remove();
|
|
||||||
}
|
|
||||||
if(teamBlueWater.isEmpty()) {
|
|
||||||
Bukkit.broadcastMessage(FightSystem.PREFIX + "6Das Team " + Config.TeamBluePrefix + Config.TeamBlueName + " §6ist Tech K.O. !");
|
|
||||||
FightSystem.getPlugin().setSpectateState(Fight.getRedTeam());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}, 0, 20*20);
|
}, 0, 20*20);
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren