Jump to content

Recommended Posts

Posted

Likely not related, but You should be using

ModelLoader.setCustomModelResourceLocation

during the pre-initialization phase instead of using ItemModelMesher#register

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Actually, what Draco18s said, is related, you are accessing the Minecraft#getMinecraft(), from what is quite likely your CommonProxy, or directly from your main, as you are also registering your block there, which means that you are calling the Client-side only Minecraft#getMinecraft(), on the Server-side.

 

Move the render-registration to your client-proxy, and do please use the Forge provided way of registration, than the Vanilla ItemModelMesher#register.

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Posted

1. I made a new method in the Clientproxy to call this in the postinit:

ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(b), 0, new ModelResourceLocation(""+b.getRegistryName()));

but the texture doesnt apply(it is getting called tho!)

 

2.JEI says this in the log:

 

[Client thread/ERROR] [JEI]: Found a broken recipe: net.minecraft.item.crafting.ShapedRecipes@5860fa7e

Output ItemStacks: Found an itemStack with a null item. This is an error from another mod.

Output Fluids: []

Input ItemStacks: [[1xtile.stonebricksmooth@32767 minecraft:stonebrick]

, [1xtile.stonebricksmooth@32767 minecraft:stonebrick]

, [1xtile.stonebricksmooth@32767 minecraft:stonebrick]

, [1xtile.stonebricksmooth@32767 minecraft:stonebrick]

, [1xitem.hoeIron@0 minecraft:iron_hoe]

, [1xtile.stonebricksmooth@32767 minecraft:stonebrick]

, [1xtile.stonebricksmooth@32767 minecraft:stonebrick]

, [1xtile.stonebricksmooth@32767 minecraft:stonebrick]

, [1xtile.stonebricksmooth@32767 minecraft:stonebrick]

]

 

Posted

1. I made a new method in the Clientproxy to call this in the postinit:

ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(b), 0, new ModelResourceLocation(""+b.getRegistryName()));

but the texture doesnt apply(it is getting called tho!)

ModelLoader

methods must be called in preInit, not postInit.

 

Use the

toString

method instead of concatenating the registry name with an empty string.

 

2.JEI says this in the log:

 

[Client thread/ERROR] [JEI]: Found a broken recipe: net.minecraft.item.crafting.ShapedRecipes@5860fa7e

Output ItemStacks: Found an itemStack with a null item. This is an error from another mod.

Output Fluids: []

Input ItemStacks: [[1xtile.stonebricksmooth@32767 minecraft:stonebrick]

, [1xtile.stonebricksmooth@32767 minecraft:stonebrick]

, [1xtile.stonebricksmooth@32767 minecraft:stonebrick]

, [1xtile.stonebricksmooth@32767 minecraft:stonebrick]

, [1xitem.hoeIron@0 minecraft:iron_hoe]

, [1xtile.stonebricksmooth@32767 minecraft:stonebrick]

, [1xtile.stonebricksmooth@32767 minecraft:stonebrick]

, [1xtile.stonebricksmooth@32767 minecraft:stonebrick]

, [1xtile.stonebricksmooth@32767 minecraft:stonebrick]

]

 

You added a recipe that has an

ItemStack

with a

null

Item

as its output. This is probably because you added the recipe before you created and registered your items.

 

3. This isnt really related but how do I fix this:

A TileEntity type com.xerus.simpleautomation.blocks.TileEntityB has throw an exception trying to write state. It will not persist. Report this to the mod author

java.lang.RuntimeException: class com.xerus.simpleautomation.blocks.TileEntityB is missing a mapping! This is a bug!

You must register your

TileEntity

class with

GameRegistry.registerTileEntity

. Make sure you include your mod ID in the name you pass to this method.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

Here are the relevant Codeparts:

 

registration class:

	static Container testblock = new Container();

public static void loadBlocks(){
	reg(testblock,"testblock");

	GameRegistry.registerTileEntity(ContainerTE.class, main.MODID);
}

public static void loadRecipes(){
	GameRegistry.addShapedRecipe(new ItemStack(testblock), "aaa", "aba", "aaa", 'a', Blocks.STONEBRICK, 'b', Items.IRON_HOE);
}

public static void reg(Block b,String name){
	b.setRegistryName(name);
	b.setUnlocalizedName(name);
	ItemBlock itemblock= new ItemBlock(b);
	itemblock.setRegistryName(name);
	GameRegistry.register(b);
	GameRegistry.register(itemblock);
	b.setCreativeTab(main.tab);
	main.proxy.regModel(b);
}

 

main class:

    @Instance(MODID)
    public static main instance;
    
    @SidedProxy(serverSide="com.xerus.simpleautomation.proxys.Commonproxy",clientSide="com.xerus.simpleautomation.proxys.Clientproxy")
    public static Commonproxy proxy = new Commonproxy();
    
    public static CreativeTabs tab = new CreativeTabs("saTab") {
	@Override
	public Item getTabIconItem() {
		return Item.getItemFromBlock(registration.testblock);
	}
};
    
    @EventHandler
    public void preInit(FMLInitializationEvent event){
    	registration.loadBlocks();
    }
    
    @EventHandler
    public void init(FMLInitializationEvent event){
    	NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
    	registration.loadRecipes();
    }
    
    @EventHandler
    public void postInit(FMLInitializationEvent event){
    }

 

Clientproxy:

	@Override
public void regModel(Object o){
	if(o instanceof Item){
		Item i=(Item)o;
		ModelLoader.setCustomModelResourceLocation(i, 0, new ModelResourceLocation(i.getRegistryName().toString()));
	} else if(o instanceof Block){
		Block b=(Block)o;
		ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(b), 0, new ModelResourceLocation(b.getRegistryName().toString()));
	} else {
		throw new IllegalArgumentException("Only Item and Block accepted");
	}
}

 

 

1. The Model still doesnt show (I now tested it with replacing the Modelloader line with Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(b), 0, new ModelResourceLocation(b.getRegistryName().toString())); and this does work)

 

2. As you can see in the code if I am not totally dumb the Item is registered before the recipe

Posted

Your

preInit

,

init

and

postInit

methods all handle

FMLInitializationEvent

, so they're all called in init.

 

I would recommend moving your model registration to a dedicated client-only class rather than registering models as you register items/blocks.

 

Instead of reinventing method overloading with a series of

instanceof

checks, just use an actual overloaded method.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

DUDE THIS MISTAKE... :-X

Thanks!

Now it works!

 

Just wanted to ask: can't you call only the clientproxy if this is only clientside stuff? the current thing i've been told is that i have to make empty methods in the commonproxy and then override them

 

And my tile Entity drops black-purple particles why doesnt it automatically generate some from the block texture?

Posted

Just wanted to ask: can't you call only the clientproxy if this is only clientside stuff? the current thing i've been told is that i have to make empty methods in the commonproxy and then override them

What you have now will work because you've used the proxy system properly, but it's not very flexible because it assumes that every

Item

uses the default model.

 

And my tile Entity drops black-purple particles why doesnt it automatically generate some from the block texture?

Block breaking particle textures are specified by the

"particle"

texture of the block model. Are you using a regular baked model specified by a blockstates file or are you using a

TileEntitySpecialRenderer

?

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • 3 weeks later...

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hello! I have been having a problem with Forgematica, Embeddium, Oculus, and create. I wanted to download litematica so I could see which blocks are in my creative mode build, so that I could collect them all in survival. However, litematica is a fabric mod. I found a port called forgematica, which I added (along with it's dependency) to my mods folder. I loaded into a new world, and built a structure. Then, I added a part from the create mod, and the game crashed instantly, with exit code -1. Thanks for any help! Crash Report and mods list: https://pastebin.com/rtzh6LAi
    • To say that losing 40,000 BTC was a devastating blow would be an understatement. It was an emotional and financial crisis that left me feeling hopeless and utterly lost. For weeks, I was trapped in a whirlwind of regret, second-guessing every decision that led me to that point. The fear that I would never be able to recover such a significant sum of cryptocurrency consumed me, and with each passing day, my despair deepened. I had all but given up on ever regaining my wealth. Then I happened to stumble onto Tech Cyber Force Recovery. In the beginning, I was hesitant. It looked too good to be true: could someone get back so much of their lost Bitcoin? After trying several different approaches and programs without success, I was hesitant to put my trust in another recovery agency. However, I changed my mind after reading Tech Cyber Force Recovery's stellar reviews and reputation. Reaching out to their team was a risk I made. They were courteous and professional from the first time I got in touch with them. I felt like I wasn't just another case to be solved by the staff at Tech Cyber Force Recovery; they truly cared about getting me my lost Bitcoin back. They listened carefully to my circumstances and guided me through each stage, giving me succinct and understandable explanations as I went. Their passion gave me new hope, and their openness instantly made me feel better. As the recovery process began, I still had my doubts, but I knew I had placed my trust in the right hands. The Tech Cyber Force Recovery team kept me informed and updated on their progress, ensuring I never felt in the dark. Despite the complexity of my case, they worked tirelessly, and their expertise became evident at every turn. The level of professionalism and attention to detail they demonstrated throughout the process was beyond impressive. And then, after what felt like an eternity of anticipation, the moment I had been waiting for arrived. I received the news that my 40,000 BTC had been successfully recovered. It was hard to believe at first—it felt like a dream. The weight that had been dragging me down for so long was suddenly lifted, and I could breathe again. The financial loss I had feared would define my future was no longer a reality. I can’t fully express the emotions I felt during that moment. It was a mix of relief, joy, and an overwhelming sense of gratitude. I had gone from a place of utter despair to a complete resurgence of wealth, both emotionally and financially. The Tech Cyber Force Recovery team didn’t just restore my Bitcoin—they restored my faith in the possibility of recovery and gave me back something far more valuable: peace of mind. I will urge anyone in this same predicament to.  
    • Have you found a modder for this vehicle project? Because it will be really hard and I want to know that hero who can create all this
    • and what?????????
  • Topics

  • Who's Online (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

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