Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-19 04:50:06 +01:00
SPIGOT-986: Default back to skull ID 0 (SKELETON) whenever an invalid ID is encountered instead of throwing an AssertionError
Dieser Commit ist enthalten in:
Ursprung
d432434fd8
Commit
e91aed81b3
@ -38,6 +38,7 @@ public class CraftSkull extends CraftBlockState implements Skull {
|
|||||||
|
|
||||||
static SkullType getSkullType(int id) {
|
static SkullType getSkullType(int id) {
|
||||||
switch (id) {
|
switch (id) {
|
||||||
|
default:
|
||||||
case 0:
|
case 0:
|
||||||
return SkullType.SKELETON;
|
return SkullType.SKELETON;
|
||||||
case 1:
|
case 1:
|
||||||
@ -48,13 +49,12 @@ public class CraftSkull extends CraftBlockState implements Skull {
|
|||||||
return SkullType.PLAYER;
|
return SkullType.PLAYER;
|
||||||
case 4:
|
case 4:
|
||||||
return SkullType.CREEPER;
|
return SkullType.CREEPER;
|
||||||
default:
|
|
||||||
throw new AssertionError(id);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int getSkullType(SkullType type) {
|
static int getSkullType(SkullType type) {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
|
default:
|
||||||
case SKELETON:
|
case SKELETON:
|
||||||
return 0;
|
return 0;
|
||||||
case WITHER:
|
case WITHER:
|
||||||
@ -65,8 +65,6 @@ public class CraftSkull extends CraftBlockState implements Skull {
|
|||||||
return 3;
|
return 3;
|
||||||
case CREEPER:
|
case CREEPER:
|
||||||
return 4;
|
return 4;
|
||||||
default:
|
|
||||||
throw new AssertionError(type);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren