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.

Featured Replies

Posted

Hello,

 

I am trying to figure out the new rendering stuff for blocks and items. My objective is to create a ladder that allows you to go faster when powered by redstone. However, I get the following error:

[FML]: Model definition for location sonic_ladders:block_sonic_ladder#facing=north not found
[FML]: Model definition for location sonic_ladders:block_sonic_ladder#facing=south not found
[FML]: Model definition for location sonic_ladders:block_sonic_ladder#facing=east not found
[FML]: Model definition for location sonic_ladders:block_sonic_ladder#facing=inventory not found
[FML]: Model definition for location sonic_ladders:block_sonic_ladder#facing=west not found

 

I think it means it can't find the json files associated with the block, but I can't figure out what I have to do to fix it.

My mod id: sonic_ladders

 

src/resources/assets/sonic_ladders/blockstates/block_sonic_ladder.json

{
    "variants": {
        "facing=north": { "model": "sonic_ladders:block_sonic_ladder" },
        "facing=east":  { "model": "sonic_ladders:block_sonic_ladder", "y": 90 },
        "facing=south": { "model": "sonic_ladders:block_sonic_ladder", "y": 180 },
        "facing=west":  { "model": "sonic_ladders:block_sonic_ladder", "y": 270 }
    }
}

 

src/resources/assets/sonic_ladders/models/block/block_sonic_ladder.json

{
  "parent": "ladder",
  "ambientocclusion": false,
  "textures": {
    "all": "sonic_ladders:blocks/block_sonic_ladder"
  },
  "elements": [
    {   "from": [ 0, 0, 15.2 ],
      "to": [ 16, 16, 15.2 ],
      "shade": false,
      "faces": {
        "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#all" },
        "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#all" }
      }
    }
  ]
}

 

BlockSonicLadder.java

public class BlockSonicLadder extends BlockLadder
{
public BlockSonicLadder()
{
	super();

	setUnlocalizedName("block_sonic_ladder");
}
}

 

ModBlocks.java

public class ModBlocks
{
public static Block block_sonic_ladder;

public static void init()
{
	block_sonic_ladder = new BlockSonicLadder();
}

public static void register()
{
	GameRegistry.registerBlock(block_sonic_ladder, getUnlocalizedName(block_sonic_ladder));
}

public static void registerRenderers()
{
	registerRenderer(block_sonic_ladder);
}

public static void registerRenderer(Block block)
{
	Item item = Item.getItemFromBlock(block);
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.RESOURCE_LOCATION + getUnlocalizedName(item), "inventory")); // Reference.RESOURCE_LOCATION = modid + ":"
}

private static String getUnlocalizedName(Block block)
{
	return block.getUnlocalizedName().substring(5);
}

private static String getUnlocalizedName(Item item)
{
	return item.getUnlocalizedName().substring(5);
}
}

 

Then init() and register() are called in preinit and the registerRenderers() is called in the client proxy on init()

 

Thanks for any help in advance.

Are you using IntelliJ14?

 

If so you need to add a line to the end of your build.gradle file

sourceSets { main { output.resourcesDir = output.classesDir } }

or

idea { module { inheritOutputDirs = true } }

see here http://www.minecraftforge.net/forum/index.php/topic,21354.0.html

 

Otherwise, you could try putting a breakpoint into

ModelLoader.VanillaLoader.loadModel

to see why it couldn't find your file - the exception e will have more information.

 

           try
            {
                return loader.new VanillaModelWrapper(modelLocation, loader.loadModel(modelLocation));
            }
            catch(IOException e)
            {
                if(loader.isLoading) // breakpoint here
                {
                    // holding error until onPostBakeEvent
                }
                else FMLLog.log(Level.ERROR, e, "Exception loading model %s with vanilla loader, skipping", modelLocation);
                return loader.getMissingModel();
            }

 

-TGG

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...

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.