mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-05 12:36:40 +00:00
Add biome support
Add a BiomeTypes interface Add methods in ServerInterface to retrieve the implemented BiomeTypes Add a getBiome method to LocalWorld and subclasses Add /biomeinfo & /biomelist commands Add a BiomeTypeMask Closes #181
This commit is contained in:
@ -185,6 +185,7 @@ public class WorldEdit {
|
||||
|
||||
commands.setInjector(new SimpleInjector(this));
|
||||
|
||||
server.onCommandRegistration(commands.registerAndReturn(BiomeCommands.class), commands);
|
||||
server.onCommandRegistration(commands.registerAndReturn(ChunkCommands.class), commands);
|
||||
server.onCommandRegistration(commands.registerAndReturn(ClipboardCommands.class), commands);
|
||||
server.onCommandRegistration(commands.registerAndReturn(GeneralCommands.class), commands);
|
||||
@ -589,7 +590,7 @@ public class WorldEdit {
|
||||
}
|
||||
}
|
||||
|
||||
private Mask getBlockMaskComponent(LocalPlayer player, LocalSession session, List<Mask> masks, String component) throws IncompleteRegionException, UnknownItemException, DisallowedItemException {
|
||||
private Mask getBlockMaskComponent(LocalPlayer player, LocalSession session, List<Mask> masks, String component) throws WorldEditException {
|
||||
final char firstChar = component.charAt(0);
|
||||
switch (firstChar) {
|
||||
case '#':
|
||||
@ -631,6 +632,15 @@ public class WorldEdit {
|
||||
|
||||
return new UnderOverlayMask(ids, over);
|
||||
|
||||
case '$':
|
||||
Set<BiomeType> biomes = new HashSet<BiomeType>();
|
||||
String[] biomesList = component.substring(1).split(",");
|
||||
for (String biomeName : biomesList) {
|
||||
BiomeType biome = server.getBiomes().get(biomeName);
|
||||
biomes.add(biome);
|
||||
}
|
||||
return new BiomeTypeMask(biomes);
|
||||
|
||||
case '!':
|
||||
if (component.length() > 1) {
|
||||
return new InvertedBlockTypeMask(getBlockIDs(player, component.substring(1), true));
|
||||
|
Reference in New Issue
Block a user