diff --git a/src/main/java/net/glowstone/entity/passive/GlowRabbit.java b/src/main/java/net/glowstone/entity/passive/GlowRabbit.java index 135fdd5797..3a9f2bf8b2 100644 --- a/src/main/java/net/glowstone/entity/passive/GlowRabbit.java +++ b/src/main/java/net/glowstone/entity/passive/GlowRabbit.java @@ -15,17 +15,17 @@ public class GlowRabbit extends GlowAnimal implements Rabbit { - private static final ImmutableBiMap rabbitTypeIntegerMap = ImmutableBiMap.builder() - .put(Rabbit.RabbitType.BROWN, 0) - .put(Rabbit.RabbitType.WHITE, 1) - .put(Rabbit.RabbitType.BLACK, 2) - .put(Rabbit.RabbitType.BLACK_AND_WHITE, 3) - .put(Rabbit.RabbitType.GOLD, 4) - .put(Rabbit.RabbitType.SALT_PEPPER, 5) - .put(Rabbit.RabbitType.KILLER, 99) + private static final ImmutableBiMap rabbitTypeIntegerMap = ImmutableBiMap.builder() + .put(Rabbit.Type.BROWN, 0) + .put(Rabbit.Type.WHITE, 1) + .put(Rabbit.Type.BLACK, 2) + .put(Rabbit.Type.BLACK_AND_WHITE, 3) + .put(Rabbit.Type.GOLD, 4) + .put(Rabbit.Type.SALT_AND_PEPPER, 5) + .put(Type.THE_KILLER_BUNNY, 99) .build(); - private RabbitType rabbitType = RabbitType.BROWN; + private Rabbit.Type rabbitType = Rabbit.Type.BROWN; public GlowRabbit(Location location) { super(location, EntityType.RABBIT); @@ -33,12 +33,12 @@ public GlowRabbit(Location location) { } @Override - public RabbitType getRabbitType() { + public Rabbit.Type getRabbitType() { return rabbitType; } @Override - public void setRabbitType(RabbitType type) { + public void setRabbitType(Rabbit.Type type) { Validate.notNull(type, "Cannot set a null rabbit type!"); this.rabbitType = type; } diff --git a/src/main/java/net/glowstone/io/entity/RabbitStore.java b/src/main/java/net/glowstone/io/entity/RabbitStore.java index e89dbb3396..73086b52c5 100644 --- a/src/main/java/net/glowstone/io/entity/RabbitStore.java +++ b/src/main/java/net/glowstone/io/entity/RabbitStore.java @@ -10,23 +10,23 @@ class RabbitStore extends AgeableStore { - private final Map rabbitTypeMap = ImmutableMap.builder() - .put(0, Rabbit.RabbitType.BROWN) - .put(1, Rabbit.RabbitType.WHITE) - .put(2, Rabbit.RabbitType.BLACK) - .put(3, Rabbit.RabbitType.BLACK_AND_WHITE) - .put(4, Rabbit.RabbitType.GOLD) - .put(5, Rabbit.RabbitType.SALT_PEPPER) - .put(99, Rabbit.RabbitType.KILLER) + private final Map rabbitTypeMap = ImmutableMap.builder() + .put(0, Rabbit.Type.BROWN) + .put(1, Rabbit.Type.WHITE) + .put(2, Rabbit.Type.BLACK) + .put(3, Rabbit.Type.BLACK_AND_WHITE) + .put(4, Rabbit.Type.GOLD) + .put(5, Rabbit.Type.SALT_AND_PEPPER) + .put(99, Rabbit.Type.THE_KILLER_BUNNY) .build(); - private final Map rabbitTypeIntegerMap = ImmutableMap.builder() - .put(Rabbit.RabbitType.BROWN, 0) - .put(Rabbit.RabbitType.WHITE, 1) - .put(Rabbit.RabbitType.BLACK, 2) - .put(Rabbit.RabbitType.BLACK_AND_WHITE, 3) - .put(Rabbit.RabbitType.GOLD, 4) - .put(Rabbit.RabbitType.SALT_PEPPER, 5) - .put(Rabbit.RabbitType.KILLER, 99) + private final Map rabbitTypeIntegerMap = ImmutableMap.builder() + .put(Rabbit.Type.BROWN, 0) + .put(Rabbit.Type.WHITE, 1) + .put(Rabbit.Type.BLACK, 2) + .put(Rabbit.Type.BLACK_AND_WHITE, 3) + .put(Rabbit.Type.GOLD, 4) + .put(Rabbit.Type.SALT_AND_PEPPER, 5) + .put(Rabbit.Type.THE_KILLER_BUNNY, 99) .build(); public RabbitStore() { @@ -41,12 +41,12 @@ public GlowRabbit createEntity(Location location, CompoundTag compound) { @Override public void load(GlowRabbit entity, CompoundTag compound) { super.load(entity, compound); - Rabbit.RabbitType rabbitType; + Rabbit.Type rabbitType; int rabbitId = compound.getInt("RabbitType"); if (rabbitTypeMap.containsKey(rabbitId)) { rabbitType = rabbitTypeMap.get(rabbitId); } else { - rabbitType = Rabbit.RabbitType.BROWN; + rabbitType = Rabbit.Type.BROWN; } entity.setRabbitType(rabbitType); // TODO "MoreCarrotTicks" -> int @@ -55,9 +55,9 @@ public void load(GlowRabbit entity, CompoundTag compound) { @Override public void save(GlowRabbit entity, CompoundTag tag) { super.save(entity, tag); - Rabbit.RabbitType rabbitType = entity.getRabbitType(); + Rabbit.Type rabbitType = entity.getRabbitType(); if (rabbitType == null) { - rabbitType = Rabbit.RabbitType.BROWN; + rabbitType = Rabbit.Type.BROWN; } tag.putInt("RabbitType", rabbitTypeIntegerMap.get(rabbitType)); }