Fix client crashes when starting the game. Fixes
@@ -79,6 +79,8 @@ public final class ClientSetup {
registerBakedModelOverrides();
registerPatternRenderHandlers();
+ // MenuScreens isn't thread safe
+ e.enqueueWork(() -> {
MenuScreens.register(RSContainerMenus.FILTER, FilterScreen::new);
MenuScreens.register(RSContainerMenus.CONTROLLER, ControllerScreen::new);
MenuScreens.register(RSContainerMenus.DISK_DRIVE, DiskDriveScreen::new);
@@ -103,6 +105,7 @@ public final class ClientSetup {
MenuScreens.register(RSContainerMenus.CRAFTER_MANAGER, new CrafterManagerScreenFactory());
MenuScreens.register(RSContainerMenus.CRAFTING_MONITOR, CraftingMonitorScreen::new);
MenuScreens.register(RSContainerMenus.WIRELESS_CRAFTING_MONITOR, CraftingMonitorScreen::new);
+ });
ClientRegistry.registerKeyBinding(RSKeyBindings.FOCUS_SEARCH_BAR);
ClientRegistry.registerKeyBinding(RSKeyBindings.CLEAR_GRID_CRAFTING_MATRIX);
@@ -111,6 +114,8 @@ public final class ClientSetup {
ClientRegistry.registerKeyBinding(RSKeyBindings.OPEN_WIRELESS_CRAFTING_MONITOR);
ClientRegistry.registerKeyBinding(RSKeyBindings.OPEN_PORTABLE_GRID);
+ // RenderLayer isn't thread safe
+ e.enqueueWork(() -> {
RSBlocks.CONTROLLER.values().forEach(block -> ItemBlockRenderTypes.setRenderLayer(block.get(), RenderType.cutout()));
RSBlocks.CREATIVE_CONTROLLER.values().forEach(block -> ItemBlockRenderTypes.setRenderLayer(block.get(), RenderType.cutout()));
RSBlocks.CRAFTER.values().forEach(block -> ItemBlockRenderTypes.setRenderLayer(block.get(), RenderType.cutout()));
@@ -133,9 +138,12 @@ public final class ClientSetup {
ItemBlockRenderTypes.setRenderLayer(RSBlocks.EXTERNAL_STORAGE.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(RSBlocks.CONSTRUCTOR.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(RSBlocks.DESTRUCTOR.get(), RenderType.cutout());
+ });
BlockEntityRenderers.register(RSBlockEntities.STORAGE_MONITOR, ctx -> new StorageMonitorBlockEntityRenderer());
+ // ItemProperties isn't thread safe
+ e.enqueueWork(() -> {
Minecraft.getInstance().getItemColors().register(new PatternItemColor(), RSItems.PATTERN.get());
ItemProperties.register(RSItems.SECURITY_CARD.get(), new ResourceLocation("active"), new SecurityCardItemPropertyGetter());
@@ -151,6 +159,7 @@ public final class ClientSetup {
ItemProperties.register(RSItems.WIRELESS_FLUID_GRID.get(), CONNECTED, new NetworkItemPropertyGetter());
ItemProperties.register(RSItems.CREATIVE_WIRELESS_FLUID_GRID.get(), CONNECTED, new NetworkItemPropertyGetter());
+ });
}
private static void registerPatternRenderHandlers() {
