From e91aed81b37a81a73dd89a48f53931948b896cc1 Mon Sep 17 00:00:00 2001 From: BlackyPaw Date: Thu, 18 Jun 2015 14:20:01 +0200 Subject: [PATCH] SPIGOT-986: Default back to skull ID 0 (SKELETON) whenever an invalid ID is encountered instead of throwing an AssertionError --- src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java index ed454f15c2..77f5dcc67f 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java @@ -38,6 +38,7 @@ public class CraftSkull extends CraftBlockState implements Skull { static SkullType getSkullType(int id) { switch (id) { + default: case 0: return SkullType.SKELETON; case 1: @@ -48,13 +49,12 @@ public class CraftSkull extends CraftBlockState implements Skull { return SkullType.PLAYER; case 4: return SkullType.CREEPER; - default: - throw new AssertionError(id); } } static int getSkullType(SkullType type) { switch(type) { + default: case SKELETON: return 0; case WITHER: @@ -65,8 +65,6 @@ public class CraftSkull extends CraftBlockState implements Skull { return 3; case CREEPER: return 4; - default: - throw new AssertionError(type); } }