Jump to content

[1.8.9] Rebuild of 1.8 mod causes mod blocks to do all kinds of crazy.


The_Wabbit

Recommended Posts

Any pointers deeply appreciated; I have no clue and am truly stumped.

 

Background: I just started migrating 1.8 mods to 1.8.9 (build 11.15.1.1722). Did a rebuild and fixed compiler issues. NO other changes. Opened an existing 1.8 world for a smoke test. Here are the issues I'm getting (I see no one else referring to these kinds of errors so I'm assuming it's something with my mods):

  • Some blocks (simple blocks, no entities, renderers, etc.) are just GONE (no errors, warnings, etc.) The blocks just aren't where they were in the 1.8 version.
  • Lots of errors from Forge looking for blockstates files for ITEMS (it's like the game as substituted items names(?) for existing blocks). Of course there are no blockstates for these things as they're not blocks. Again no big errors or warnings except for these.
  • Some blocks have been swapped for other blocks, sometimes a vanilla block (eg ice blocks shown in pics below) is where a custom mod block was before!

I see this behavior with development IDE saves (Eclipse) as well as standalone games. Old saves and brand new 1.8 saves (just created in 1.8 and re-opened in 1.8.9).

 

Example (snip) FileNotFoundException for items being looked up with blockstates:

java.lang.Exception: Could not load model definition for variant vanillafoodpantry:breads#inventory
at net.minecraftforge.client.model.ModelLoader.func_177586_a(ModelLoader.java:215) ~[ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader.loadItems(ModelLoader.java:252) ~[ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader.func_177570_a(ModelLoader.java:116) ~[ModelLoader.class:?]
at net.minecraft.client.resources.model.ModelManager.func_110549_a(ModelManager.java:28) [bou.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.func_110542_a(SimpleReloadableResourceManager.java:120) [bnn.class:?]
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:478) [ave.class:?]
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:329) [ave.class:?]
at net.minecraft.client.main.Main.main(SourceFile:124) [Main.class:?]
[sNIP...]
Caused by: java.lang.RuntimeException: Encountered an exception when loading model definition of model vanillafoodpantry:blockstates/breads.json
at net.minecraft.client.resources.model.ModelBakery.func_177586_a(ModelBakery.java:165) ~[bot.class:?]
at net.minecraftforge.client.model.ModelLoader.func_177586_a(ModelLoader.java:211) ~[ModelLoader.class:?]
... 21 more
Caused by: java.io.FileNotFoundException: vanillafoodpantry:blockstates/breads.json
at net.minecraft.client.resources.FallbackResourceManager.func_135056_b(FallbackResourceManager.java:93) ~[bnb.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.func_135056_b(SimpleReloadableResourceManager.java:78) ~[bnn.class:?]
at net.minecraft.client.resources.model.ModelBakery.func_177586_a(ModelBakery.java:143) ~[bot.class:?]
at net.minecraftforge.client.model.ModelLoader.func_177586_a(ModelLoader.java:211) ~[ModelLoader.class:?]
... 21 more

 

Example pics of weirdness

Yeah...those ice blocks shouldn't be there...

width=641 height=421http://jwaresoftware.org/files/mcmods/bugs/1.8.9/Vanilla_Blocks_Switched_For_Mod_Blocks.png[/img]

All kinds of confusion in this one...

width=392 height=450http://jwaresoftware.org/files/mcmods/bugs/1.8.9/MyFav_CustomHoppers_Switched_For_OtherMod_Blocks.png[/img]

Link to comment
Share on other sites

It would help to have some code to look at. I can however answer the thing about blockstates, even though they're items, if a model file fails to be found, it searches for a blockstate model it could possibly use. Simply making an item model for "breads" will clear up the block state error.

Link to comment
Share on other sites

To expand -- it's complaining about various items blockstates but all those item models are present (there isn't a single black-n-purple box shown and all items look correct once the game comes up). The usual model file missing errors aren't the ones generated. This seems to be the only symptom of some bigger issue...Are blockstate files required for items now? Or is there a format change or something I've missed?

 

What code would you like to see? There isn't a specific thing that seems to be a problem which is the problem. Forge seems quite silent but there is this weird issue. The library does not complain about missing blocks or bad tile entities or anything. Just loads of model files not found and all of those are present. Everything looks OK on creative tabs and new blocks when placed are also OK. It's just existing blocks in old saves (build 1.8 11.14.3.1450) that are being screwed up.

 

I will post after turning on all of Forge's debugging outside of IDE environment.

Link to comment
Share on other sites

I posted an almost identical thread back in the fall. What I discovered was that nobody else ever even tried to migrate an existing world with modded blocks in it.

 

You may upgrade your mods and create a new world. You might even get away with upgrading mods, installing them only on clients, and then logging into an existing 1.8 world server. However, a modded world created in one MC version of Forge and subsequently opened in another will always be vulnerable to gross memory-structure errors (such as block shuffling). I gave up.

 

The good news: I discovered that if I reverted to a Minecraft 1.8 version of Forge, I could reopen my world, and the riot of random blocks seemed to have gone back to normal (I didn't notice any permanent corruption).

 

Sorry I couldn't offer a migration solution, but maybe I saved you some wasted effort in a lost cause.

 

My recommendations are:

 

1) To continue playing your existing 1.8 world, upgrade Forge to the latest build for pure 1.8 and park it there permanently.

 

2) To upgrade mods, jump up to 1.9.4 and then create a new world. Don't bother creating a new world for an intermediate release.

 

BTW, If you know your Linux, you can setup multiple server worlds, each running a different build of Forge out of a different subdirectory. They can run simultaneously; just give each its own port number and remember to forward all those ports to the host machine.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Link to comment
Share on other sites

Just a follow-up (for anyone looking for this in future). I created a very simple 1.8 test-mod that defines a simple item and a simple multi-variant item. Saved a world with the items in frames. Rebuilt said mod for 1.8.9 and loaded 1.8 world. Also broken, but at least there is some code to go with the issue now.

 

All code, asset files, and some screenshots located here: http://jwaresoftware.org/files/mcmods/bugs/1.8.9/TestMod_MC1.8_to_MC1.8.9/.

 

Main code body (as above link may disappear someday):

/** -------- TestMod.java (ClientOnly) -------- **/
/** COMMENTED LINES ARE THE 1.8 LINES replaced **/
package testmod;

//import  net.minecraft.client.Minecraft;
//import  net.minecraft.client.renderer.ItemModelMesher;
//import  net.minecraft.client.resources.model.ModelBakery;
import  net.minecraft.client.resources.model.ModelResourceLocation;
import  net.minecraftforge.client.model.ModelLoader;
import  net.minecraftforge.fml.common.Mod;
import  net.minecraftforge.fml.common.Mod.EventHandler;
import  net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import  net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import  net.minecraftforge.fml.common.registry.GameRegistry;

@Mod(modid = "testmod", name = "Test Mod", version="1.8")
public class TestMod
{
    @Mod.Instance(value="testmod")
    public static TestMod instance;

    public static ItemSimple itemSimple;
    public static ItemVariant itemVariant;

    @EventHandler
    public void preInit(FMLPreInitializationEvent event) // seed: -8913466909937400889
    {
        itemSimple = (ItemSimple)(new ItemSimple().setUnlocalizedName("tm_simple_item"));
        GameRegistry.registerItem(itemSimple,"tm_simple_item");

        itemVariant = (ItemVariant)(new ItemVariant().setUnlocalizedName("tm_variant_item"));
        GameRegistry.registerItem(itemVariant,"tm_variant_item");
    }

    @EventHandler
    public void postInit(FMLPostInitializationEvent event)
    {
        ModelResourceLocation model;
        //ItemModelMesher mesher = Minecraft.getMinecraft().getRenderItem().getItemModelMesher();

        model = new ModelResourceLocation("testmod:tm_simple_item","inventory");
        //mesher.register(itemSimple,0,model);
        ModelLoader.setCustomModelResourceLocation(itemSimple,0,model);

        //String[] itemids = new String[]{"testmod:tm_variant_item_0","testmod:tm_variant_item_1"};
        //ModelBakery.addVariantName(itemVariant, itemids);

        model = new ModelResourceLocation("testmod:tm_variant_item_0","inventory");
        //mesher.register(itemVariant,0,model);
        ModelLoader.setCustomModelResourceLocation(itemVariant,0,model);

        model = new ModelResourceLocation("testmod:tm_variant_item_1","inventory");
        //mesher.register(itemVariant,1,model);
        ModelLoader.setCustomModelResourceLocation(itemVariant,1,model);
    }
}

/** --------- ItemSimple.java ---------- **/
package testmod;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;

public class ItemSimple extends Item
{
    public ItemSimple()
    {
        setCreativeTab(CreativeTabs.tabDecorations);
    }
}


/** ----------- ItemVariant.java --------- **/
package testmod;

import  java.util.List;

import  net.minecraft.creativetab.CreativeTabs;
import  net.minecraft.item.Item;
import  net.minecraft.item.ItemStack;
import  net.minecraftforge.fml.relauncher.Side;
import  net.minecraftforge.fml.relauncher.SideOnly;

public class ItemVariant extends Item
{
    public ItemVariant()
    {
        setMaxDamage(0);
        setHasSubtypes(true);
        setCreativeTab(CreativeTabs.tabDecorations);
    }

    public int getMetadata(int damage)
    {
        return damage;
    }

    @SideOnly(Side.CLIENT)
    public void getSubItems(Item item, CreativeTabs tab, List subItems)
    {
        ItemStack stack;
        stack = new ItemStack(item,1,0);
        subItems.add(stack);
        stack = new ItemStack(item,1,1);
        subItems.add(stack);
    }

    public String getUnlocalizedName(ItemStack stack)
    {
      int metadata = stack.getMetadata();
      return super.getUnlocalizedName() + "_"+ metadata;
    }
}

 

Pictures of issues even for this simple mod

(1.8 -- Baseline [yellow=simple, green/blue=variant])

width=623 height=413http://jwaresoftware.org/files/mcmods/bugs/1.8.9/TestMod_MC1.8_to_MC1.8.9/screenshots/MC1.8%20-%20The%20Items.png[/img]

 

(1.8.9 -- Same thing; not so good)  :-[

width=640 height=433http://jwaresoftware.org/files/mcmods/bugs/1.8.9/TestMod_MC1.8_to_MC1.8.9/screenshots/MC1.8.9%20-%20The%20Items.png[/img]

 

I didn't bother adding a Simple Block as there seemed no point based on previous commenter's advice.

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

Announcements



×
×
  • Create New...

Important Information

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