Jump to content

Recommended Posts

Posted

First off thank you for deciding to take a look at my problem :)

 

I am currently trying to make a 3D rendered item.

It is just a simple one by one cube because I am just testing out the whole render thing before jumping into more complicated models.

After having managed to get the proxy registry right for it I am experiencing an error which is pretty embarrassing.

Every time I switch to the slot where my item is located I am getting a Texture not found type of error though I already tried every path combination possible.

In game the inventory slot icon is currently just a simple placeholder but the item is simply not showing up when held in hand.  :-\

I know that this problem may sound a little nooby but I have the strange feeling that this has nothing to do with the path error.

 

Well if you're still with me here's my code:

 

Main mod class:

package trunkS.mod;

import trunkS.mod.common.CommonProxyTrunkS;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemPotion;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.src.BaseMod;
import net.minecraft.src.ModLoader;
import net.minecraft.world.World;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.Player;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

import cpw.mods.fml.common.Mod;

@Mod(modid = "TrunkSMod", name = "TrunkS Mod", version = "Dev v1")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class mod_Particles extends BaseMod
{
        //Creative Tabs
        public static CreativeTabs tabParticles = new CreativeTabParticles(CreativeTabs.getNextID(), "tabParticles");
       
        //Items
        public static Item particleWood = new ItemParticle(5001, "GhastSoul1").setCreativeTab(mod_Particles.tabParticles).setFull3D();
       
        //Proxys
        @SidedProxy(clientSide = "trunkS.mod.client.ClientProxyTrunkS", serverSide = "Tutorial.common.CommonProxyTrunkS")
        public static CommonProxyTrunkS proxy;
       
        @Init
        public void load()
        {
                //Loading Screen
                System.out.println("Loading TrunkS Particles Mod...");
                System.out.println("TrunkS Particles Mod loaded!");
               
                //Proxys
                proxy.registerRenderThings();
               
                GameRegistry.registerItem(particleWood, "woodParticle");
               
                //Name Registry
                LanguageRegistry.addName(particleWood, "Wood Particle");
               
        }
       
        public String getVersion()
        {
                return "Dev v1";
        }
       
}

 

Common Proxy:

package trunkS.mod.common;

public class CommonProxyTrunkS {

        public void registerRender(){
               
        }
}

 

Client Proxy:

package trunkS.mod.client;

import net.minecraftforge.client.MinecraftForgeClient;
import trunkS.mod.ItemRenderWoodParticle;
import trunkS.mod.mod_Particles;
import trunkS.mod.common.CommonProxyTrunkS;

public class ClientProxyTrunkS extends CommonProxyTrunkS {

        @Override
        public void registerRender(){
               
                MinecraftForgeClient.registerItemRenderer(mod_Particles.particleWood.itemID, new ItemRenderWoodParticle());
               
        }
       
}

 

ItemParticle Class:

package trunkS.mod;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.Item;
import net.minecraft.util.Icon;

public class ItemParticle extends Item
{
        private String iconPath;
       
        @SideOnly(Side.CLIENT)
        private Icon icon;
       
        public ItemParticle(int par1, String par2Str)
        {
                super(par1);
               
                this.iconPath = par2Str;
        }
       
        @SideOnly(Side.CLIENT)
        public void registerIcons(IconRegister par1IconRegister)
        {
                this.icon = par1IconRegister.registerIcon("modParticles/" + this.iconPath);
        }
       
        @SideOnly(Side.CLIENT)
        public Icon getIconFromDamage(int par1)
        {
                return this.icon;
        }
}

 

The Model Class:

package trunkS.mod;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.Item;
import net.minecraft.util.Icon;

public class ItemParticle extends Item
{
        private String iconPath;
       
        @SideOnly(Side.CLIENT)
        private Icon icon;
       
        public ItemParticle(int par1, String par2Str)
        {
                super(par1);
               
                this.iconPath = par2Str;
        }
       
        @SideOnly(Side.CLIENT)
        public void registerIcons(IconRegister par1IconRegister)
        {
                this.icon = par1IconRegister.registerIcon("modParticles/" + this.iconPath);
        }
       
        @SideOnly(Side.CLIENT)
        public Icon getIconFromDamage(int par1)
        {
                return this.icon;
        }
}

 

The Renderer Class:

package trunkS.mod;

import org.lwjgl.opengl.GL11;

import cpw.mods.fml.client.FMLClientHandler;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainerCreative;
import net.minecraft.client.gui.inventory.GuiInventory;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;

public class ItemRenderWoodParticle implements IItemRenderer
{      
        protected ModelParticleMod particleModel;
       
        public ItemRenderWoodParticle()
        {
               
                particleModel = new ModelParticleMod();
               
        }
       

        @Override
        public boolean handleRenderType(ItemStack item, ItemRenderType type)
        {
                switch(type)
                {
                        case EQUIPPED: return true;
                        case ENTITY: return true;
                        default: return false;
                }

        }

        @Override
        public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item,
                        ItemRendererHelper helper)
        {

                return false;
        }

        @Override
        public void renderItem(ItemRenderType type, ItemStack item, Object... data)
        {

                switch(type)
                {
                case ENTITY:
                {
                        GL11.glPushMatrix();
                       
                        //This is were it should get its texture from
                        Minecraft.getMinecraft().renderEngine.bindTexture("/textures/items/modParticles/woodParticle");
                       
                        float scale = 6F;
                        GL11.glScalef(scale, scale, scale);
                       
                        particleModel.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
                       
                         FMLClientHandler.instance().getClient().renderEngine.resetBoundTexture();
                       
                        GL11.glPopMatrix();
                       
                }
                        case EQUIPPED:
                        {
                                GL11.glPushMatrix();

                                Minecraft.getMinecraft().renderEngine.bindTexture("/textures/items/modParticles/woodParticle");
                               
                                particleModel.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
                               
                                GL11.glPopMatrix();
                        }
                        default:
                                break;
                }
               
        }

}

 

And the error log:

2013-05-22 20:53:59 [information] [sTDERR] java.io.FileNotFoundException: /textures/items/modParticles/woodParticle
2013-05-22 20:53:59 [information] [sTDERR]      at net.minecraft.client.texturepacks.TexturePackDefault.func_98139_b(TexturePackDefault.java:42)
2013-05-22 20:53:59 [information] [sTDERR]      at net.minecraft.client.texturepacks.TexturePackImplementation.func_98137_a(TexturePackImplementation.java:149)
2013-05-22 20:53:59 [information] [sTDERR]      at net.minecraft.client.texturepacks.TexturePackImplementation.getResourceAsStream(TexturePackImplementation.java:169)
2013-05-22 20:53:59 [information] [sTDERR]      at net.minecraft.client.renderer.RenderEngine.getTexture(RenderEngine.java:208)
2013-05-22 20:53:59 [information] [sTDERR]      at net.minecraft.client.renderer.RenderEngine.bindTexture(RenderEngine.java:148)
2013-05-22 20:53:59 [information] [sTDERR]      at trunkS.mod.ItemRenderWoodParticle.renderItem(ItemRenderWoodParticle.java:74)
2013-05-22 20:53:59 [information] [sTDERR]      at net.minecraftforge.client.ForgeHooksClient.renderEquippedItem(ForgeHooksClient.java:208)
2013-05-22 20:53:59 [information] [sTDERR]      at net.minecraft.client.renderer.ItemRenderer.renderItem(ItemRenderer.java:89)
2013-05-22 20:53:59 [information] [sTDERR]      at net.minecraft.client.renderer.ItemRenderer.renderItemInFirstPerson(ItemRenderer.java:505)
2013-05-22 20:53:59 [information] [sTDERR]      at net.minecraft.client.renderer.EntityRenderer.renderHand(EntityRenderer.java:697)
2013-05-22 20:53:59 [information] [sTDERR]      at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1273)
2013-05-22 20:53:59 [information] [sTDERR]      at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:991)
2013-05-22 20:53:59 [information] [sTDERR]      at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:871)
2013-05-22 20:53:59 [information] [sTDERR]      at net.minecraft.client.Minecraft.run(Minecraft.java:760)
2013-05-22 20:53:59 [information] [sTDERR]      at java.lang.Thread.run(Unknown Source)

 

I guess this is it.

If you have any idea what the problem is, I'd be very thankful for helping me. ;)

And no my name is not inspired by DBZ ^^

Posted

shouldn't it be:

Minecraft.getMinecraft().renderEngine.bindTexture("/textures/items/modParticles/woodParticle.png");

?

mnn.getNativeLang() != English

If I helped you please click on the "thank you" button.

Posted

it DOES need the .png in the end, given your texture file should be a .png !

 

also, where did you put your texture file ? given of how you code it, your texture should be in

 

forge\mcp\src\minecraft\textures\items\modParticles

 

given from that > does the item render when you go out of first person mode ?

for first person view rendering, use

 

case  EQUIPPED_FIRST_PERSON:

Posted

Okey I've added a .png and the path now looks like this:

"/trunkS/mod/textures/items/woodParticle.png"

I created the textures/items folders and placed the texturemap in it realising that there was no textures/items folder

directly in the src/minecraft one ;D

Now I don't get errors any more but the items is still not showing up, wether in First- (I've added the EQUIPPED_FIRST_PERSON case) or Third-Person mode.

And no my name is not inspired by DBZ ^^

Posted

you dont have to unbind your texture.

and try adding these :

 

                GL11.glPushMatrix();
	Minecraft.getMinecraft().renderEngine.bindTexture(name);
	GL11.glScalef(3f, 3f,3f);
	GL11.glRotatef(0, 0.0f, 0.0f, 1.0f);
	GL11.glRotatef(0, 0.0f, 1.0f, 0.0f);
	GL11.glRotatef(-180, 1.0f, 0.0f, 0.0f);
	GL11.glTranslatef(0f,0f,0F);
                theItem.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
                GL11.glPopMatrix();

Posted

No...still the same problem.

I also forgot to cast IItemRenderer to the ItemRenderWoodParticle class in the ClientProxy but that didn't change anything.

And no my name is not inspired by DBZ ^^

Posted

No the if I change the path to /mods it gives me a file not found error again.

And yes I'm using eclipse.

And no my name is not inspired by DBZ ^^

  • 2 weeks later...
Posted

I really don't know what's wrong. I still think there's something about the render registry...but I'm not sure.

Oh boy, hopefully there'll be a solution for this somewhere in the near future.

And no my name is not inspired by DBZ ^^

Posted

The complete path is:

mcp/src/minecraft/trunkS/mod/textures/items/woodParticle.png

(Starting from the actual forge folder)

And no my name is not inspired by DBZ ^^

Posted

I don't think the problem is your path anymore. I'm not sure how much I can help without seeing your model class. When you pasted your model class you actually just pasted your ItemParticle class again.

What catches my eye in your renderer class is

particleModel.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);

You have lots of zeros in there and without seeing what the method does in your model class I'm not sure if those zeros aren't making your model come up as a single point instead of a cube.

 

Assuming you did that right, go into your renderer class and go to one of your switch cases where you actually render your item. Add in some sort of print statement (if you can figure out where it prints: I haven't yet and it bugs me to no end) or add a set of statements that will result in an error: I make a small array and intentionally get an out of bounds error. If your statement prints/your game crashes when you have the item in the case you trapped, then you do know that it is being used, just not correctly. If it doesn't trigger, then you know that it isn't being used which would explain it not showing up.

 

Let us know if all of your rendering code is being run and send us your model class.

Read my thoughts on my summer mod work and tell me what you think!

http://www.minecraftforge.net/forum/index.php/topic,8396.0.html

 

I absolutely love her when she smiles

Posted
  On 6/6/2013 at 7:49 PM, redria7 said:

I don't think the problem is your path anymore. I'm not sure how much I can help without seeing your model class. When you pasted your model class you actually just pasted your ItemParticle class again.

What catches my eye in your renderer class is

particleModel.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);

You have lots of zeros in there and without seeing what the method does in your model class I'm not sure if those zeros aren't making your model come up as a single point instead of a cube.

 

Assuming you did that right, go into your renderer class and go to one of your switch cases where you actually render your item. Add in some sort of print statement (if you can figure out where it prints: I haven't yet and it bugs me to no end) or add a set of statements that will result in an error: I make a small array and intentionally get an out of bounds error. If your statement prints/your game crashes when you have the item in the case you trapped, then you do know that it is being used, just not correctly. If it doesn't trigger, then you know that it isn't being used which would explain it not showing up.

 

Let us know if all of your rendering code is being run and send us your model class.

Those 0s are supposed to be there; they're normally used for data relating to mobs that he doesn't need. What he's missing is the entity registry line in his mod file: EntityRegistry.registerModEntity(...);

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

Posted

I guess I just solved the problem!?

Well, actually it solved itself.

There's some background info you need to know first: I changed the model (and texture) to a bigger one some time ago to see if it was the model class which was causing problems.

So when I changed it back while I was trying out some of the suggestions given here it just worked (And it's spaming: "I guess I just rendered!" to my console).

Because of the model beeing a bit tiny, I scaled it a little. But when I did so the model went up in the air relatively high.

Maybe this effect was even bigger the bigger my model was and maybe I just couldn't see anything because  the model was floating way above my head ^^.

Anyway thank you all for helping me out, you were really helpful.

Solved!

And no my name is not inspired by DBZ ^^

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

    • Without Network protocol fix mod, I get kicked with a Network Protocol error when on LAN. Also, both of these issues are caused by a Null Pointer Exception/Screen cannot be null in a "Client Bound Player Combat Kill Packet".
    • You need a new "items" folder at  resources/assets/yourmodid/ there you add for every item model a .json file with the exact item/block name and fill it like this if it's an item: { "model": { "type": "minecraft:model", "model": "yourmodid:item/youritem" } } and so if its a block: { "model": { "type": "minecraft:model", "model": "yourmodid:block/youritem" } } There is also a generator for it you can do namy crazy things with it which replaces the previous hard coded Item Properties implementaion method (Bow pulling animation for example). https://misode.github.io/assets/item/
    • Hello! I'm playing a modpack (custom made) with some friends, and we have the server running on BisectHosting. We encountered a bug with an entity from The Box Of Horrors mod, that would crash the game whenever someone nearby it would log in. We tried to fix it by: 1) Editing the player.dat files to change the location of the affected players (something I had done successfully previously) 2) Updating the version of the mod we had (0.0.8.2) to the latest alpha version (0.0.8.3 However, after doing both of those, none of us are able to join the server, and we get the following errors: Server side: https://pastebin.com/J5sc3VQN Client side: Internal Server Error (that's basically all I've gotten) Please help! I've tried restoring the player data to how it was before I made the changes (Bisect allows you to restore deleted files) and deleting all of my player data files and I still get the same error. Deleting Box Of Horrors causes the error: Failed to load datapacks, cannot continue with server load.
    • Hey there! I'm trying to create a simple mod for Forge 1.21.1 that adds a few custom banner patterns that don't require any banner pattern items. To be completely honest, this is my first time modding for Minecraft, so after setting up the project in Intellij, I copied the parts of the source code from this mod on CurseForge that dealt with adding and registering banner patterns, including the lang and banner_pattern .json files. From what I understand, to add a banner pattern that doesn't require a banner pattern item, I only needed to create the registries for each pattern like in here and then register it in the main java class like here on Line 54. Additionally, in the lang/en_us.json file, add in the names for each respective banner color, and in the data/minecraft/tags/banner_pattern/no_items_required.json file, add each banner pattern that does not require a banner pattern item to make a banner. The project is able to compile when loading in Forge which makes me assume that the file structure I have is correct, but on loading a Minecraft world, this error appears in console and the loom is subsequently blank. [Worker-Main-1/ERROR] [minecraft/TagLoader]: Couldn't load tag minecraft:no_item_required as it is missing following references: *lists every added entry in no_item_required.json* The message clearly states something went wrong regarding when trying to load in the registries from the mod, but I have no clue what could be wrong with the code I have. Attached below are screenshots of what I currently have. Java Main Class Banner Registry Class File Structure Error in Console upon loading a Minecraft world What the loom shows without minecraft:no_item_required    The original mod I copied still functions completely, so if anyone can figure out why the registries for the mod I'm making isn't working, that would be greatly appreciated!    
    • Please someone help me to know how can I fix this generation error in the trees! I already uninstalled and reinstalled several mods in my modpack and can't figure out what is causing it.    
  • Topics

×
×
  • Create New...

Important Information

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