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:
aumgn
2012-03-17 16:35:29 +01:00
committed by zml2008
parent 0bd3b346fc
commit a8eeacccd4
14 changed files with 374 additions and 1 deletions

View File

@ -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));