Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[Solved] Blocks Disappearing Upon Reloading World

Recommended Posts

Hi, I previously worked with Forge but am only recently looking into it again.


I seem to have run into a bit of an issue, and I honestly have no idea what is wrong. I can add a new block, test run it, create a world, find the block in the creative menu and place said block. However, after saving/quiting the world and then loading it again, the block is MIA from the creative menu, gone from your inventory, and has disappeared from world itself, leaving only lighting errors where the blocks previously were. I'm using Forge build 1024 for MC 1.7.2.


It also prints out this lovely stacktrace in Eclipse:

java.lang.RuntimeException: Mod IDs are missing
at cpw.mods.fml.common.Loader.fireMissingMappingEvent(Loader.java:865)
at cpw.mods.fml.common.registry.GameData.injectWorldIDMap(GameData.java:272)
at cpw.mods.fml.common.FMLContainer.readData(FMLContainer.java:191)
at cpw.mods.fml.common.FMLCommonHandler.handleWorldDataLoad(FMLCommonHandler.java:382)
at net.minecraft.world.storage.SaveHandler.loadWorldInfo(SaveHandler.java:148)
at net.minecraft.world.World.<init>(World.java:293)
at net.minecraft.world.WorldServer.<init>(WorldServer.java:111)
at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:65)
at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:98)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:488)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:787)


There are only 2 classes currently in existence: SimpleIndustry:

package simpleIndustry;

import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;

@Mod(modid = SimpleIndustry.MODID, version = SimpleIndustry.VERSION)
public class SimpleIndustry
    public static final String MODID = "SimpleIndustry";
    public static final String VERSION = "1.0";
private static final Block TestBlock = new TestBlock();

    public void load(FMLInitializationEvent event)
    	GameRegistry.registerBlock(TestBlock, MODID + ":" + TestBlock.getUnlocalizedName().substring(5));


And TestBlock:

package simpleIndustry;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import simpleIndustry.SimpleIndustry;

public class TestBlock extends Block {

   public TestBlock() {
      this.setBlockTextureName(SimpleIndustry.MODID + ":tile.TestTexture");
      this.setHarvestLevel("pickaxe", 3);



I've spent the last couple hours googling, reading/watching tutorials, and searching the forums for a reason as to why this happens, but I haven't found anything that solves the issue. Any assistance would be very much appreciated. I feel I'm being an idiot and it's probably something really simple, but I just can't figure out what.




Edit: Problem is solved. Needed to use FMLPreInitializationEvent in the main class, instead of FMLInitializationEvent.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • trying to override onItemRightClick so i look in the list of overridable functions in Item class and it doesnt exist?
    • hm... when I had a similar issue the discord pointed me towards using baked models. but multiparts does seem way simpler, and with datagen I could even do it proceduraly
    • You don't need a custom baked model for this. Look at the composter model for an example.
    • whenever you find a solution by yourself, you can leave the original question, but add a comment mentioning that you fixed it, and how. so that if anyone comes accross the same problem, they can find your solution and try it without needing to make a new topic. also, I don't see how intellij syncing with github has anything to do with forge
    • you need to create a new class which implements IBakedModel, overwrite getQuads (the one which takes an IModelData) an make it return the quads for your model, the IModelData shouls contain the info on the list and you set the info on the IModelData by overwriting getModelData in your tile entity. you need to sync the data from, the Server tile entity, to the client, which you can do by overwriting getUpdatePacket (Server sends updated data to the client), and onDataPacket  (Client handles an update packet received). then, whenever that data changes you can call World#notifyUpdate, and whenever the client receives an update (so in the end of onDataPacket) you call requestModelUpdate().   for the BakedModel, what I do is: I pass in an existing IBakedModel (that works as a base that I can add quads to) to the constructor, and store it in a field. then I can call IBakedModel#getQuads on the base model, which gives a list of BakedQuads, and add any new quads to it. and you can create your quads by using FaceBakey#bakeQuad, it takes the start and end positions of the quad (in block space, so 0 -> 16), an instance of a BlockPartFace, the sprite you want to use, which you can get from an AtlasTexture, the Direction of that quad, a transform (I just use SimpleModelTransform.IDENTITY), a rotation, which you can just pass null, a boolean that tells wether that face should be shaded or not, and then a throwaway ResourceLocation. and you can decide on all those properties, and on what faces to add, given the IModelData   EDIT: oh, and to register it you can do so through the modelRegistry in the ModelBakeEvent (this event is client-side only (I think)) if you need some examples, I used this repo to learn how to use BakedModels: https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe04_block_dynamic_block_models
  • Topics

  • Who's Online (See full list)

  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.