3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 12:30:06 +01:00

Fix off by one in CraftRabbit. Fixes SPIGOT-392

Dieser Commit ist enthalten in:
md_5 2015-01-10 14:15:34 +11:00
Ursprung 4470462a54
Commit 7658819130

Datei anzeigen

@ -31,7 +31,7 @@ public class CraftRabbit extends CraftAnimals implements Rabbit {
@Override @Override
public Type getRabbitType() { public Type getRabbitType() {
int type = getHandle().cl(); int type = getHandle().cl(); // PAIL: Rename
return CraftMagicMapping.fromMagic(type); return CraftMagicMapping.fromMagic(type);
} }
@ -72,7 +72,7 @@ public class CraftRabbit extends CraftAnimals implements Rabbit {
} }
public static Type fromMagic(int magic) { public static Type fromMagic(int magic) {
if (magic > 0 && magic < reverse.length) { if (magic >= 0 && magic < reverse.length) {
return reverse[magic]; return reverse[magic];
} else if (magic == 99) { } else if (magic == 99) {
return Type.THE_KILLER_BUNNY; return Type.THE_KILLER_BUNNY;