12
1

Replace blocks without blockupdates #136

Zusammengeführt
Lixfel hat 1 Commits von blockupdatelessReplace nach master 2020-04-28 09:31:29 +02:00 zusammengeführt
2 geänderte Dateien mit 9 neuen und 1 gelöschten Zeilen
Nur Änderungen aus Commit 0f9480f69e werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -67,6 +67,7 @@ public class Config {
public static final boolean TeamBlueRotate;
public static final boolean ReplaceObsidian;
public static final boolean ReplaceBedrock;
public static final boolean ReplaceWithBlockupdates;
//team parameter
public static final String TeamRedName;
@ -156,6 +157,7 @@ public class Config {
boolean rotate = config.getBoolean("Schematic.Rotate");
ReplaceObsidian = config.getBoolean("Schematic.ReplaceObsidian");
ReplaceBedrock = config.getBoolean("Schematic.ReplaceBedrock");
ReplaceWithBlockupdates = config.getBoolean("Schematic.ReplaceWithBlockupdates");
TeamRedPrefix = config.getString("Output.TeamRedPrefix");
TeamBluePrefix = config.getString("Output.TeamBluePrefix");

Datei anzeigen

@ -384,16 +384,22 @@ public class FightTeam implements IFightTeam{
Location minPoint = new Location(world, cornerX, cornerY, cornerZ);
Location maxPoint = new Location(world, (cornerX + Config.SchemsizeX), (cornerY + Config.SchemsizeY), (cornerZ + Config.SchemsizeZ));
FreezeWorld freezer = null;
if(!Config.ReplaceWithBlockupdates)
freezer = new FreezeWorld();
for(int x = minPoint.getBlockX(); x <= maxPoint.getBlockX(); x++) {
for(int z = minPoint.getBlockZ(); z <= maxPoint.getBlockZ(); z++) {
for(int y = minPoint.getBlockY(); y <= maxPoint.getBlockY(); y++) {
Block block = world.getBlockAt(x, y, z);
if(block.getType() == target)
block.setType(replacement);
}
}
}
if(!Config.ReplaceWithBlockupdates)
HandlerList.unregisterAll(freezer);
}
private void setTeamColor(Team team, ChatColor color){