added block-replacer as option
Dieser Commit ist enthalten in:
Ursprung
691f3d8cfa
Commit
882336d910
@ -63,6 +63,8 @@ public class Config {
|
|||||||
public static final de.steamwar.sql.SchematicType SchematicType;
|
public static final de.steamwar.sql.SchematicType SchematicType;
|
||||||
public static final boolean TeamRedRotate;
|
public static final boolean TeamRedRotate;
|
||||||
public static final boolean TeamBlueRotate;
|
public static final boolean TeamBlueRotate;
|
||||||
|
public static final boolean ReplaceObsidian;
|
||||||
|
public static final boolean ReplaceBedrock;
|
||||||
|
|
||||||
//team parameter
|
//team parameter
|
||||||
public static final String TeamRedName;
|
public static final String TeamRedName;
|
||||||
@ -143,6 +145,8 @@ public class Config {
|
|||||||
SchematicDirectory = config.getString("Schematic.Directory");
|
SchematicDirectory = config.getString("Schematic.Directory");
|
||||||
SchematicType = de.steamwar.sql.SchematicType.fromDB(config.getString("Schematic.SchematicType"));
|
SchematicType = de.steamwar.sql.SchematicType.fromDB(config.getString("Schematic.SchematicType"));
|
||||||
boolean rotate = config.getBoolean("Schematic.Rotate");
|
boolean rotate = config.getBoolean("Schematic.Rotate");
|
||||||
|
ReplaceObsidian = config.getBoolean("Schematic.ReplaceObsidian");
|
||||||
|
ReplaceBedrock = config.getBoolean("Schematic.ReplaceBedrock");
|
||||||
|
|
||||||
TeamRedPrefix = config.getString("Output.TeamRedPrefix");
|
TeamRedPrefix = config.getString("Output.TeamRedPrefix");
|
||||||
TeamBluePrefix = config.getString("Output.TeamBluePrefix");
|
TeamBluePrefix = config.getString("Output.TeamBluePrefix");
|
||||||
|
@ -26,6 +26,8 @@ Schematic:
|
|||||||
Directory: /home/netuser/schematics/
|
Directory: /home/netuser/schematics/
|
||||||
SchematicType: airship
|
SchematicType: airship
|
||||||
Rotate: boolean
|
Rotate: boolean
|
||||||
|
ReplaceObsidian: boolean
|
||||||
|
ReplaceBedrock: boolean
|
||||||
Output:
|
Output:
|
||||||
TeamRedName: Team1
|
TeamRedName: Team1
|
||||||
TeamRedPrefix: §c
|
TeamRedPrefix: §c
|
||||||
|
@ -107,6 +107,8 @@ public class FightSystem extends JavaPlugin {
|
|||||||
|
|
||||||
new PreRunningCountdown();
|
new PreRunningCountdown();
|
||||||
|
|
||||||
|
Fight.getRedTeam().replaceSync();
|
||||||
|
|
||||||
new WinconditionAllDead();
|
new WinconditionAllDead();
|
||||||
new WinconditionCaptainDead();
|
new WinconditionCaptainDead();
|
||||||
new WinconditionWaterTechKO();
|
new WinconditionWaterTechKO();
|
||||||
|
@ -14,6 +14,7 @@ import de.steamwar.sql.Schematic;
|
|||||||
import de.steamwar.sql.SteamwarUser;
|
import de.steamwar.sql.SteamwarUser;
|
||||||
import javafx.util.Pair;
|
import javafx.util.Pair;
|
||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.enchantments.Enchantment;
|
import org.bukkit.enchantments.Enchantment;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
@ -299,6 +300,26 @@ public class FightTeam implements IFightTeam{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void replaceSync() {
|
||||||
|
World world = Bukkit.getWorlds().get(0);
|
||||||
|
Location minPoint = new Location(world, cornerX, cornerY, cornerZ);
|
||||||
|
Location maxPoint = new Location(world, (cornerX + Config.SchemsizeX), (cornerY + Config.SchemsizeY), (cornerZ + Config.SchemsizeZ));
|
||||||
|
|
||||||
|
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(Config.ReplaceObsidian && block.getType() == Material.OBSIDIAN)
|
||||||
|
block.setType(Material.TNT);
|
||||||
|
else if(Config.ReplaceBedrock && block.getType() == Material.BEDROCK)
|
||||||
|
block.setType(Material.SLIME_BLOCK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Set<Player> getInvited() {
|
public Set<Player> getInvited() {
|
||||||
return invited;
|
return invited;
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren