use of mods.railcraft.common.blocks.IRailcraftBlock in project Railcraft by Railcraft.
the class ClientProxy method initializeClient.
@Override
public void initializeClient() {
ModelLoaderRegistry.registerLoader(OutfittedTrackModel.Loader.INSTANCE);
ModelLoaderRegistry.registerLoader(OutfittedTrackItemModel.Loader.INSTANCE);
ModelLoaderRegistry.registerLoader(ActuatorModel.Loader.INSTANCE);
MinecraftForge.EVENT_BUS.register(RCSoundHandler.INSTANCE);
MinecraftForge.EVENT_BUS.register(JSONModelRenderer.INSTANCE);
MinecraftForge.EVENT_BUS.register(FluidModelRenderer.INSTANCE);
MinecraftForge.EVENT_BUS.register(GoggleAuraWorldRenderer.INSTANCE);
MinecraftForge.EVENT_BUS.register(new Object() {
@SubscribeEvent
public void textureStitch(TextureStitchEvent.Pre event) {
// CartContentRendererRedstoneFlux.instance().setRedstoneIcon(event.getMap().registerSprite(new ResourceLocation("railcraft:entities/carts/cart_redstone_flux")));
// CartContentRendererRedstoneFlux.instance().setFrameIcon(event.getMap().registerSprite(new ResourceLocation("railcraft:entities/carts/cart_redstone_flux_frame")));
ParticleSpark.sprite = event.getMap().registerSprite(new ResourceLocation("railcraft:particle/spark"));
ParticlePumpkin.sprite = event.getMap().registerSprite(new ResourceLocation("railcraft:particle/pumpkin"));
for (RailcraftBlocks blockContainer : RailcraftBlocks.VALUES) {
Block block = blockContainer.block();
if (block instanceof IRailcraftBlock) {
IRailcraftBlock railcraftBlock = (IRailcraftBlock) block;
railcraftBlock.registerTextures(event.getMap());
}
}
}
});
// Set<IRailcraftObjectContainer<IRailcraftItemSimple>> items = new HashSet<>();
// items.addAll(Arrays.asList(RailcraftItems.VALUES));
// items.addAll(Arrays.asList(RailcraftCarts.VALUES));
// for (IRailcraftObjectContainer<IRailcraftItemSimple> itemContainer : items) {
// itemContainer.getObject().ifPresent(IRailcraftItemSimple::initializeClient);
// }
RailcraftObjects.processItems(IRailcraftItemSimple::initializeClient);
// for (RailcraftBlocks blockContainer : RailcraftBlocks.VALUES) {
// ItemBlock item = blockContainer.item();
// blockContainer.getObject().ifPresent(block -> {
// block.initializeClient();
// if (item != null) {
// ((IRailcraftObject) item).initializeClient();
// IVariantEnum[] variants = block.getVariants();
// if (variants != null) {
// for (IVariantEnum variant : variants) {
// ItemStack stack = blockContainer.getStack(variant);
// if (stack != null)
// block.registerItemModel(stack, variant);
// }
// } else {
// ItemStack stack = blockContainer.getStack();
// if (stack != null)
// block.registerItemModel(stack, null);
// }
// }
// });
// }
RailcraftObjects.processBlocks((block, item) -> {
block.initializeClient();
if (item != null)
item.initializeClient();
}, (block, variant) -> {
ItemStack stack = block.getStack(variant);
if (stack != null)
block.registerItemModel(stack, variant);
});
JSONModelRenderer.INSTANCE.registerModel(CartContentRendererRedstoneFlux.CORE_MODEL);
JSONModelRenderer.INSTANCE.registerModel(CartContentRendererRedstoneFlux.FRAME_MODEL);
JSONModelRenderer.INSTANCE.registerModel(TESRManipulatorFluid.PIPE_MODEL);
RenderingRegistry.registerEntityRenderingHandler(EntityTunnelBore.class, RenderTunnelBore::new);
RenderingRegistry.registerEntityRenderingHandler(EntityMinecart.class, RenderCart::new);
}
Aggregations