Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

MONOBLOK

Members
  • Joined

  • Last visited

  1. Thank you very much. I think I understand the concept of client-server, rewrote the code and server running. However, sometimes I have warning when creating a new world: [WARNING] [Minecraft-Client] Memory connection overburdened; after processing 2500 packets, we still have 680 to go! What does it mean?
  2. I apologize, my native language is not English. I understand that my code in the above lines is crazy. I was in despair (Tutorials not help me) when I wrote these lines (renderBlockBellowID = RenderingRegistry.getNextAvailableRenderId()...) in proxy, I saw them in the same solution in the forums. What exactly do I have to register for the custom model block in the proxy?
  3. My mod does not work on the server. What's wrong with my code? Error: main class @Mod (modid = Info.ID, name = Info.NAME, version = Info.VERSION) @NetworkMod(clientSideRequired=true, serverSideRequired=false) public class BaseClassMod { @SidedProxy(clientSide = "mbk.mods.heavy_engine.proxi.ClientProxy", serverSide = "mbk.mods.heavy_engine.proxi.CommonProxy") public static CommonProxy proxy; public static Block blockGorn ; public static Block blockCrucible ; public static Block blockBellow; public static int BlockGornBlockID; public static int BlockCrucibleBlockID; public static int BlockBellowBlockID; public static int renderBlockGornID; public static int renderBlockCrucibleID; public static int renderBlockBellowID; static CreativeTabs tabMod = new TabMod(CreativeTabs.getNextID(),Info.NAME); @Instance(Info.ID) public BaseClassMod instance; // Mark this method for receiving an FMLEvent (in this case, it's the FMLPreInitializationEvent) @EventHandler public void preInit(FMLPreInitializationEvent event) { int beginBlockID=4020; Configuration config = new Configuration(event.getSuggestedConfigurationFile()); config.load(); BlockCrucibleBlockID = config.getBlock("BlockCrucible", beginBlockID++).getInt(); BlockGornBlockID = config.getBlock("BlockGorn", beginBlockID++).getInt(); BlockBellowBlockID = config.getBlock("BlockBellow", beginBlockID++).getInt(); config.save(); } @EventHandler public void init(FMLInitializationEvent event) { blockCrucible = new BlockCrucible(BlockCrucibleBlockID, true).setCreativeTab(BaseClassMod.tabMod).setHardness(0.0F).setUnlocalizedName("BlockCrucible"); blockGorn = new BlockGorn(BlockGornBlockID, true).setCreativeTab(BaseClassMod.tabMod).setHardness(0.0F).setUnlocalizedName("BlockGorn"); blockBellow = new BlockBellow(BlockBellowBlockID, true).setCreativeTab(BaseClassMod.tabMod).setHardness(0.0F).setUnlocalizedName("BlockBellow"); GameRegistry.registerBlock(blockCrucible,"BlockCrucible"); GameRegistry.registerBlock(blockGorn, "BlockGorn"); GameRegistry.registerBlock(blockBellow, "BlockBellow"); GameRegistry.registerTileEntity( mbk.mods.heavy_engine.blocks.TileEntity.TileEntityCrucible.class, "TileEntityBlockCrucible" ); GameRegistry.registerTileEntity( mbk.mods.heavy_engine.blocks.TileEntity.TileEntityGorn.class, "TileEntityBlockGorn" ); GameRegistry.registerTileEntity( mbk.mods.heavy_engine.blocks.TileEntity.TileEntityBellow.class, "TileEntityBlockBellow" ); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCrucible.class, new RendererCrucible()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityGorn.class, new RendererGorn()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBellow.class, new RendererBellow()); renderBlockCrucibleID = RenderingRegistry.getNextAvailableRenderId(); renderBlockGornID = RenderingRegistry.getNextAvailableRenderId(); renderBlockBellowID = RenderingRegistry.getNextAvailableRenderId(); RenderingRegistry.registerBlockHandler(renderBlockCrucibleID, new HandlerCrucible()); RenderingRegistry.registerBlockHandler(renderBlockGornID, new HandlerGorn()); RenderingRegistry.registerBlockHandler(renderBlockBellowID, new HandlerBellow()); proxy.registerRenderers(); } } ClientProxy: public class ClientProxy extends CommonProxy { @Override public void registerRenderers() { renderBlockBellowID = RenderingRegistry.getNextAvailableRenderId(); RenderingRegistry.registerBlockHandler(renderBlockBellowID, new HandlerBellow()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBellow.class, new RendererBellow()); renderBlockCrucibleID = RenderingRegistry.getNextAvailableRenderId(); RenderingRegistry.registerBlockHandler(renderBlockCrucibleID, new HandlerCrucible()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCrucible.class, new RendererCrucible()); renderBlockGornID = RenderingRegistry.getNextAvailableRenderId(); RenderingRegistry.registerBlockHandler(renderBlockGornID, new HandlerGorn()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityGorn.class, new RendererGorn()); } } CommonProxy: public class CommonProxy { public static int renderBlockBellowID; public static int renderBlockCrucibleID; public static int renderBlockGornID; public void registerRenderers() { // Nothing here as the server doesn't render graphics or entities! } } Renderer file: @SideOnly(Side.CLIENT) public class RendererBellow extends TileEntitySpecialRenderer { private ModelBellow model; private ResourceLocation TEXTURE; public RendererBellow() { model = new ModelBellow(); } public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) { this.renderTileEntity((TileEntityBellow)tileEntity, x, y, z, f); } public void renderTileEntity(TileEntityBellow tileEntity, double x, double y, double z, float f) { int metadata =0; if(tileEntity.worldObj != null){ metadata = tileEntity.getBlockMetadata(); } int rotationAngle = 0; if(metadata%4 == 0 ){ rotationAngle = 270; } if(metadata%4 == 1 ){ rotationAngle = 90; } if(metadata%4 == 2 ){ rotationAngle = 0; } if(metadata%4 == 3 ){ rotationAngle = 180; } GL11.glPushMatrix(); GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F); GL11.glPushMatrix(); GL11.glRotatef(180, 0.0F, 0.0F, 1.0F); GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F); this.TEXTURE = new ResourceLocation("heavy_engine", "textures/blocks/Bellow.png"); this.bindTexture(TEXTURE); //Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE); this.model.activ(tileEntity.getActiv()); this.model.render(); GL11.glPopMatrix(); GL11.glPopMatrix(); } }

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.