Fixed model setting and client synchronisation

This commit is contained in:
Goodbird committed 2024-01-21 23:38:06 +03:00
1 parent 34cc0fecdf
commit ed3028561b
2 files changed
+11 -2

No files matched your search

@@ -36,7 +36,15 @@ public class BlockScriptedWrapper extends ScriptBlock implements IBlockScripted{
tile.setItemModel(null, null);
else{
Block block = Block.getBlockFromName(name);
tile.setItemModel(new ItemStack(Item.getItemFromBlock(block)), block);
if(block!=null) {
tile.setItemModel(new ItemStack(Item.getItemFromBlock(block)), block);
}else{
if(Item.itemRegistry.containsKey(name)) {
tile.setItemModel(new ItemStack((Item) Item.itemRegistry.getObject(name)), null);
}else{
tile.setItemModel(null, null);
}
}
}
}