diff --git a/common/src/common/dimension/Dimension.java b/common/src/common/dimension/Dimension.java index 315dc8f..9eee678 100755 --- a/common/src/common/dimension/Dimension.java +++ b/common/src/common/dimension/Dimension.java @@ -2,14 +2,11 @@ package common.dimension; import java.util.List; import java.util.Map; -import java.util.Set; - import common.biome.Biome; import common.biome.IBiome; import common.block.foliage.LeavesType; import common.collect.Lists; import common.collect.Maps; -import common.collect.Sets; import common.init.BlockRegistry; import common.init.Blocks; import common.init.MetalType; @@ -19,6 +16,8 @@ import common.nbt.NBTTagList; import common.nbt.NBTTagString; import common.util.ExtMath; import common.util.Vec3; +import common.world.CloudType; +import common.world.SkyboxType; import common.world.State; import common.world.Weather; @@ -196,19 +195,8 @@ public abstract class Dimension extends Nameable implements Comparable SAFE_CHARS = Sets.newHashSet(); - -// private static final FeatureOres[] DEFAULT_ORES; -// -// static { -// List ores = Lists.newArrayList(); -// OreRegistry.populateDefault(ores); -// DEFAULT_ORES = new FeatureOres[ores.size()]; -// for(int z = 0; z < DEFAULT_ORES.length; z++) { -// DEFAULT_ORES[z] = ores.get(z).createGenerator(); -// } -// } private final int id; private final String name; @@ -223,8 +211,8 @@ public abstract class Dimension extends Nameable implements Comparable 32) - return fallback; - for(int z = 0; z < name.length(); z++) { - if(!SAFE_CHARS.contains(name.charAt(z))) { - return fallback; - } - } - return name; - } - public Dimension(int id, String name) { this.id = id; this.name = name; @@ -599,7 +569,7 @@ public abstract class Dimension extends Nameable implements Comparable LOOKUP = Maps.newHashMap(); + + private final String name; + private final String texture; + + private CloudType(String name, String texture) { + this.name = name; + this.texture = texture; + } + + public String toString() { + return this.name; + } + + public String getTexture() { + return this.texture; + } + + public static CloudType getByName(String name) { + CloudType type = LOOKUP.get(name.toLowerCase()); + return type == null ? NORMAL : type; + } + + static { + for(CloudType type : values()) { + LOOKUP.put(type.name, type); + } + } +} \ No newline at end of file diff --git a/common/src/common/world/SkyboxType.java b/common/src/common/world/SkyboxType.java new file mode 100644 index 0000000..950989f --- /dev/null +++ b/common/src/common/world/SkyboxType.java @@ -0,0 +1,37 @@ +package common.world; + +import java.util.Map; + +import common.collect.Maps; + +public enum SkyboxType { + ; + + private static final Map LOOKUP = Maps.newHashMap(); + + private final String name; + private final String texture; + + private SkyboxType(String name, String texture) { + this.name = name; + this.texture = texture; + } + + public String toString() { + return this.name; + } + + public String getTexture() { + return this.texture; + } + + public static SkyboxType getByName(String name) { + return LOOKUP.get(name.toLowerCase()); + } + + static { + for(SkyboxType type : values()) { + LOOKUP.put(type.name, type); + } + } +} \ No newline at end of file