haven't done one of these in a while
*continuing with merge in previous commit
This commit is contained in:
Jesse Boyd
2019-04-03 17:00:59 +11:00
parent 4cd8d08134
commit 8aef06b29e
4 changed files with 23 additions and 10 deletions

View File

@ -27,11 +27,16 @@ import com.sk89q.worldedit.registry.NamespacedRegistry;
public class BiomeType {
public static final NamespacedRegistry<BiomeType> REGISTRY = new NamespacedRegistry<>("biome type");
private final int internalId;
private final String id;
private String id;
public BiomeType(String id) {
protected BiomeType(String id, int internalId) {
this.id = id;
this.internalId = internalId;
}
public int getInternalId() {
return internalId;
}
/**
@ -50,7 +55,7 @@ public class BiomeType {
@Override
public int hashCode() {
return this.id.hashCode();
return this.internalId;
}
@Override

View File

@ -103,8 +103,11 @@ public class BiomeTypes {
private BiomeTypes() {
}
private static int index = 0;
private static BiomeType register(final String id) {
return register(new BiomeType(id));
// TODO implement registry
return register(new BiomeType(id, index++));
}
public static BiomeType register(final BiomeType biome) {