id is back to being final, added custom getId method

This commit is contained in:
jglrxavpok 2020-09-23 22:33:52 +02:00
parent 3073f2f52f
commit 7ad2cd89c2
1 changed files with 7 additions and 2 deletions

View File

@ -33,7 +33,7 @@ public class Biome {
.build())
.build();
private int id = idCounter.getAndIncrement();
private final int id = idCounter.getAndIncrement();
private final NamespaceID name;
@Builder.Default
@ -52,10 +52,15 @@ public class Biome {
@Builder.Default
private TemperatureModifier temperature_modifier = TemperatureModifier.NONE;
// allows mixins to remap ID if necessary
public int getId() {
return id;
}
public NBTCompound toNbt() {
NBTCompound nbt = new NBTCompound();
nbt.setString("name", name.toString());
nbt.setInt("id", id);
nbt.setInt("id", getId());
NBTCompound element = new NBTCompound();
element.setFloat("depth", depth);