Check and make sure toolsItem is not a empty stack

Else we crash and crash can be caused by a number of things including Join Game transition packets, login delays, server lag.
This commit is contained in:
Babymillie committed 2020-01-21 22:35:02 +01:00
1 parent c2144495bd
commit f206cb9bed
1 file changed
+4 -2
@@ -160,8 +160,10 @@ public enum ToolsItem {
public static void remapItems() {
for (ToolsItem toolsItem : values()) {
ResourceLocation registryName = toolsItem.getItem().getRegistryName();
toolsItem.updateItem(ForgeRegistries.ITEMS.getValue(registryName));
if(!toolsItem.getItemStack().isEmpty()) {
ResourceLocation registryName = toolsItem.getItem().getRegistryName();
toolsItem.updateItem(ForgeRegistries.ITEMS.getValue(registryName));
}
}
}
}