Fix setType in DisguiseRabbit causing critical errors on 1.8

This commit is contained in:
Sam 2018-04-01 00:35:21 +01:00 committed by Alexander Meech
parent b1b31f1135
commit 0154c4d1c4
2 changed files with 8 additions and 2 deletions

View File

@ -26,7 +26,7 @@ public class DisguiseRabbit extends DisguiseAnimal
_type = type;
int id = type.ordinal();
DataWatcher.watch(18, id, EntityRabbit.META_TYPE, id);
DataWatcher.watch(18, (byte) id, EntityRabbit.META_TYPE, id);
}
public Type getType()

View File

@ -109,7 +109,13 @@ public class MorphBunny extends MorphAbilityGadget
if (disguise != null)
{
Rabbit.Type newType = Rabbit.Type.values()[(disguise.getType().ordinal() + 1) % Rabbit.Type.values().length - 1];
Rabbit.Type newType = Rabbit.Type.values()[(disguise.getType().ordinal() + 1) % Rabbit.Type.values().length];
if (newType == Rabbit.Type.THE_KILLER_BUNNY)
{
newType = Rabbit.Type.BROWN;
}
disguise.setType(newType);
Manager.getDisguiseManager().updateDisguise(disguise);