Jump to content

Recommended Posts

Posted

Hello all

 

Before 1.6.2 i had my custom Wand to shoot Frost Shards (custom item) like arrows (and i still had the bow event implemented) but now i have updated my mod to 1.6.2 and i noticed that it didn't work anymore so i changed a couple of things and i removed the bow event aswell (as i didn't want to use that) so now i got it so that it can shoot whenever you click and all you see are the critical particles flying at the direction you aimed. They also do damage when they hit mobs and such, but i can't figure out why they are invisible. It must be something with the renderer i thought, but i can't find it yet :(

 

So i figured maybe theres someone that can point me to what i forgot or did wrong here so that my entity is no longer invisible.

 

I will provide the following src classes : EntityFrostShard, RenderFrostShard, FrostWand and a part of the renderRegister.

starting off with the EntityFrostShard:

 

  Reveal hidden contents

 

 

next is RenderFrostShard

 

  Reveal hidden contents

 

 

then the FrostWand

 

  Reveal hidden contents

 

 

last but not least the registers

EntityRegistry.registerGlobalEntityID(EntityFrostShard.class, "Frost Shard", EntityRegistry.findGlobalUniqueEntityId());
LanguageRegistry.instance().addStringLocalization("entity.soulforest.Frost Shard.name", "Frost 
Shard");

RenderingRegistry.registerEntityRenderingHandler(EntityFrostShard.class, new RenderFrostShard());

 

I appreciate your help, thanks!

Posted

the render code seems fine (of course i have no idea what it renders :P)

 

depending on how you register that (which should be in your client proxy) there is nothing wrong syntax/code wise with it

 

try shrinking you render code. ive noticed that you simply copied the code from another renderer, what happens when you do that is if it doesnt work you have no idea wtf is happening, try to draw like 1 quad, then 2, 3, 4, 5 etc til you have the model you want :)

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted
  Quote
entity spawn like a white box

thats what i could visualize from the code

 

  Quote
registers in the commonproxy

server side shouldnt know about this, commonproxy is for both side thats why i think it should be in client proxy only

 

  Quote
How do i make it so that that box is rendered as the item with that texture i want.

well you're not binding the texture anywhere in your render code so that would make sens theres no texture attached (or the wrong texture)

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

yeah fo sho

 

example:

 

  Reveal hidden contents

 

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

It apperently still gives me the white box thing, i have put a public ResourceLocation in my CommonProxy and added in the line you highlighted. Also i noticed that theres a ResourceLocation Function in the RenderFrostShard.class

    protected ResourceLocation func_110779_a(EntityFrostShard par1EntityArrow)
    {
        return field_110780_a;
    }

    @Override
    protected ResourceLocation func_110775_a(Entity par1Entity)
    {
        return this.func_110779_a((EntityFrostShard)par1Entity);
    }

i first had that field_110780_a to be the resourcelocation as minecraft did the same thing for an arrow

Posted

yeah ive never use the field but technicly it shouldnt make a difference

 

btw it doesnt HAVE to be in your common proxy, it could (should) be in the render class if its the only class that needs it

 

 

sooo couple of things

 

first maybe for some reason texture are disabled

do this before everything

 

GL11.glEnable(GL11.GL_TEXTURE_2D);

 

next make sure your image loaded correctly (you will see it in the logs if it screws up)

 

after that you will notice that vanilla code is resizing the images:

tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)f6, (double)f8);

        tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)f7, (double)f8);

        tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)f7, (double)f9);

        tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)f6, (double)f9);

(note the difference between vanilla code and mine)

 

basicly if your image is really huge there would be a problem

 

after that i have a few ideas but well start with that

 

 

 

ps: ive looked at your mod and its pretty legit !

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

Okay i tried adding that glEnable thing, but that didn't do much (i know that my file is loaded correctly as it doesn't give errors and i have it in the same folder as the other entities and i believe they are all rendered the exact same way, atleast according to minecraft xD)

 

And about the image size, its an item texture so :P

 

Then i am not sure what differences between your code there and this:

        tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)f6, (double)f8);
        tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)f7, (double)f8);
        tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)f7, (double)f9);
        tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)f6, (double)f9);

 

And thanks that you like my mod, i have put quite some time in it (which i enjoy doing, like right now xD). I try to add lots of custom stuff, put together in a nice package of cool things.

Posted

hmm, then honestly I'm not sure, can you try something more basic:

 

 

GL11.glPushMatrix();
GL11.glTranslated(par2, par4, par6);
Minecraft.getMinecraft().renderEngine.func_110577_a(ForgeRevCommonProxy.wing);
Tessellator t = Tessellator.instance;
t.startDrawingQuads();
t.addVertexWithUV(0, 0, 0, 0, 0);
t.addVertexWithUV(0, 1, 0, 0, 1);
t.addVertexWithUV(1, 1, 0, 1, 1);
t.addVertexWithUV(1, 0, 0, 1, 0);

t.addVertexWithUV(0, 0, 0, 0, 0);
t.addVertexWithUV(1, 0, 0, 1, 0);
t.addVertexWithUV(1, 1, 0, 1, 1);
t.addVertexWithUV(0, 1, 0, 0, 1);
t.draw();
GL11.glPopMatrix();

 

try this and throw your shard diagonally (because it wont rotate so at certain angle you will be 90 degree compared to it and wont see shit)

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

That basically makes it not work :P, with my code i can see it fly and it leaves the crit particles behind as i wanted. All that doesn't work is the texture... It is so odd

 

 

Off topic : could you take a look here : http://www.minecraftforge.net/forum/index.php/topic,11491.0.html

I got this weird issue with a portal.... it works like it should, but the only thing it won't do is when you travel back to the normal world you spawn somewhere underground.

Posted
  Quote
That basically makes it not work

nothign shows up ? somethign shows up ?

 

because what you want right now is to have somethign that shows up with a texture, then you can work from there

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

yeah my old code might not necessarelly work because i typed it all inside the forums :\

 

 

heres one that literally uses only the tess , hope it can help

 

@Override

public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)

    {

// EntityMeteor fb = (EntityMeteor)par1Entity;

double xzSize = par1Entity.boundingBox.maxX -par1Entity.boundingBox.minX;

double ySize = par1Entity.boundingBox.maxY-par1Entity.boundingBox.minY;

        GL11.glPushMatrix();

        Tessellator tessellator = Tessellator.instance;

        Minecraft.getMinecraft().renderEngine.func_110577_a(ForgeRevCommonProxy.blankTexture);

        tessellator.startDrawingQuads();

        tessellator.addVertexWithUV(par2-xzSize/2, par4, par6-xzSize/2, 0, 0);

        tessellator.addVertexWithUV(par2-xzSize/2, par4+ySize, par6-xzSize/2, 0, 1);

        tessellator.addVertexWithUV(par2+xzSize/2, par4+ySize, par6-xzSize/2, 1, 1);

        tessellator.addVertexWithUV(par2+xzSize/2, par4, par6-xzSize/2, 1, 0);

       

        tessellator.addVertexWithUV(par2-xzSize/2, par4, par6-xzSize/2, 0, 0);

        tessellator.addVertexWithUV(par2+xzSize/2, par4, par6-xzSize/2, 1, 0);

        tessellator.addVertexWithUV(par2+xzSize/2, par4+ySize, par6-xzSize/2, 1, 1);

        tessellator.addVertexWithUV(par2-xzSize/2, par4+ySize, par6-xzSize/2, 0, 1);

       

        tessellator.addVertexWithUV(par2-xzSize/2, par4, par6-xzSize/2, 0, 0);

        tessellator.addVertexWithUV(par2-xzSize/2, par4, par6+xzSize/2, 0, 1);

        tessellator.addVertexWithUV(par2+xzSize/2, par4, par6+xzSize/2, 1, 1);

        tessellator.addVertexWithUV(par2+xzSize/2, par4, par6-xzSize/2, 1, 0);

       

        tessellator.addVertexWithUV(par2-xzSize/2, par4, par6-xzSize/2, 0, 0);

        tessellator.addVertexWithUV(par2+xzSize/2, par4, par6-xzSize/2, 1, 0);

        tessellator.addVertexWithUV(par2+xzSize/2, par4, par6+xzSize/2, 1, 1);

        tessellator.addVertexWithUV(par2-xzSize/2, par4, par6+xzSize/2, 0, 1);

       

        tessellator.addVertexWithUV(par2-xzSize/2, par4, par6-xzSize/2, 0, 0);

        tessellator.addVertexWithUV(par2-xzSize/2, par4, par6+xzSize/2, 0, 1);

        tessellator.addVertexWithUV(par2-xzSize/2, par4+ySize, par6+xzSize/2, 1, 1);

        tessellator.addVertexWithUV(par2-xzSize/2, par4+ySize, par6-xzSize/2, 1, 0);

       

        tessellator.addVertexWithUV(par2-xzSize/2, par4, par6-xzSize/2, 0, 0);

        tessellator.addVertexWithUV(par2-xzSize/2, par4+ySize, par6-xzSize/2, 1, 0);

        tessellator.addVertexWithUV(par2-xzSize/2, par4+ySize, par6+xzSize/2, 1, 1);

        tessellator.addVertexWithUV(par2-xzSize/2, par4, par6+xzSize/2, 0, 1);

        tessellator.draw();

        GL11.glPopMatrix();

    }

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

If you have those

public static final ResourceLocation wing = new ResourceLocation(TheMod.modid, "FR/GUI/wing.png");
...
Minecraft.getMinecraft().renderEngine.func_110577_a(ForgeRevCommonProxy.wing);

Your texture should be at:

mcp/src/minecraft/assets/'modid'/fr/gui/wing.png

 

Posted

they are, i have some entities (spells) that extends Entity directly and i have zero problem, its super weird

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

is your mod open source, its one of those case id like to just import and check for myself

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

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.