Jump to content

Recommended Posts

Posted

I know this has probably been answered somewhere else, but I have done hours of research and cannot find a working solution. Here is the problem:

 

I made a custom bow, and a custom arrow, however the custom arrow is using the original arrow texture right now. But the problem is that when I shoot the arrow, I know it really shoots because it hurts mobs and I can pick it up, but it is invisible.

 

 

I messed around some. Now I have:

 

In my Entities in my main class file I have:

EntityRegistry.registerGlobalEntityID(EntityPebble.class, "Pebble", EntityRegistry.findGlobalUniqueEntityId());
EntityRegistry.registerModEntity(EntityPebble.class, "Pebble", 1, this, 128, 1, false);

 

 

In my rendering registry I put

RenderingRegistry.registerEntityRenderingHandler(EntityPebble.class, new RenderLiving(new ModelPebble(), 0F));

 

Which yields an

ebt.common.EntityPebble cannot be cast to net.minecraft.src.EntityLiving

error.

 

 

When I change

RenderingRegistry.registerEntityRenderingHandler(EntityPebble.class, new RenderLiving(new ModelPebble(), 0F));

 

to

RenderingRegistry.registerEntityRenderingHandler(EntityPebble.class, new ebt.client.render.RenderPebble());

 

I get a arrow like texture, but it says "missing".

 

To clarify I do NOT want a folded texture, I want a cube like texture, and that is what the ModelPebble file is set to be.

 

Thanks in advance, all help is appreciated.

Posted

I have it set to shoot a custom arrow and entity, but using the default arrow's texture. Could it be because two things are using the default texture? I don't exactly understand your question.

Posted

RenderPebble

 

package ebt.client.render;

import net.minecraft.src.Entity;
import net.minecraft.src.ModelBase;
import net.minecraft.src.Render;
import net.minecraft.src.Tessellator;

import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;

import ebt.common.EntityPebble;
import ebt.common.ModelPebble;



public class RenderPebble extends Render
{
protected ModelBase ModelPShot;

public RenderPebble()
    {
        this.shadowSize = 0.1F;
        this.ModelPShot = new ModelPebble();
    }



    public void renderPShot(EntityPebble var1, double var2, double var4, double var6, float var8, float var9)
    {
        if (var1.prevRotationYaw != 0.0F || var1.prevRotationPitch != 0.0F)
        {
        	//this.modelPShot.render(var1, 0F, 0F, 0F, 11, 2, 2);
            this.loadTexture("/ebt.client/resources/Pebble.png");
            GL11.glPushMatrix();
            GL11.glTranslatef((float)var2, (float)var4, (float)var6);
            GL11.glRotatef(var1.prevRotationYaw + (var1.rotationYaw - var1.prevRotationYaw) * var9 - 90.0F, 0.0F, 1.0F, 0.0F);
            GL11.glRotatef(var1.prevRotationPitch + (var1.rotationPitch - var1.prevRotationPitch) * var9, 0.0F, 0.0F, 1.0F);
            Tessellator var10 = Tessellator.instance;
            byte var11 = 0;
            float var12 = 0.0F;
            float var13 = 0.5F;
            float var14 = (float)(0 + var11 * 10) / 32.0F;
            float var15 = (float)(5 + var11 * 10) / 32.0F;
            float var16 = 0.0F;
            float var17 = 0.15625F;
            float var18 = (float)(5 + var11 * 10) / 32.0F;
            float var19 = (float)(10 + var11 * 10) / 32.0F;
            float var20 = 0.05625F;
            GL11.glEnable(GL12.GL_RESCALE_NORMAL);



            GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F);
            GL11.glScalef(var20, var20, var20);
            GL11.glTranslatef(-4.0F, 0.0F, 0.0F);
            GL11.glNormal3f(var20, 0.0F, 0.0F);
            var10.startDrawingQuads();
            var10.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)var16, (double)var18);
            var10.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)var17, (double)var18);
            var10.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)var17, (double)var19);
            var10.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)var16, (double)var19);
            var10.draw();
            GL11.glNormal3f(-var20, 0.0F, 0.0F);
            var10.startDrawingQuads();
            var10.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)var16, (double)var18);
            var10.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)var17, (double)var18);
            var10.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)var17, (double)var19);
            var10.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)var16, (double)var19);
            var10.draw();

            for (int var23 = 0; var23 < 4; ++var23)
            {
                GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
                GL11.glNormal3f(0.0F, 0.0F, var20);
                var10.startDrawingQuads();
                var10.addVertexWithUV(-8.0D, -2.0D, 0.0D, (double)var12, (double)var14);
                var10.addVertexWithUV(8.0D, -2.0D, 0.0D, (double)var13, (double)var14);
                var10.addVertexWithUV(8.0D, 2.0D, 0.0D, (double)var13, (double)var15);
                var10.addVertexWithUV(-8.0D, 2.0D, 0.0D, (double)var12, (double)var15);
                var10.draw();
            }

            GL11.glDisable(GL12.GL_RESCALE_NORMAL);
            GL11.glPopMatrix();
        }
    }
    
    public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9)
    {
        this.renderPShot((EntityPebble)var1, var2, var4, var6, var8, var9);
    }
}

Posted

I added this line of code in my clientproxy:

RenderingRegistry.instance().registerEntityRenderingHandler(EntityPebble.class, new RenderPebble());

 

This line of code in my main mod file:

EntityRegistry.registerModEntity(EntityPebble.class, "Pebble", 1, this, 250, 5, false);

 

Now the end of my main mod file looks like this:

//Entities//
EntityRegistry.registerGlobalEntityID(EntityPebble.class, "Pebble", EntityRegistry.findGlobalUniqueEntityId());
EntityRegistry.registerModEntity(EntityPebble.class, "Pebble", 1, this, 250, 5, false);		
    
//Rendering Registry//
RenderingRegistry.registerEntityRenderingHandler(EntityPebble.class, new ebt.client.render.RenderPebble());

 

I notice it isn't calling to my ModelPebble file, where is it supposed to do this?

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

    • So, i'm hosting (or attempting to host) a port-forwarded modded server for 1.12.2. There's quite a few mods in this pack, but they all run and have no compatibility issues (besides something causing the game to crash if you go fullscreen, a problem ive given up trying to identify or fix). It can run on 6gb of ram or less, and works fine in singleplayer. All of my friends that want to join have the exact same mod/config/game setup as I do (I personally helped them set everything up). Just to be safe, we've all allocated 12 gigabytes of RAM to the installation, and I've also allocated 12GB to the server itself. I am able to join with no issue and it runs fine. However, when they try to join, it gets stuck in the 'logging in' screen before their game becomes unresponsive. When they close it, it gives them the exit code 805306369, which usually means not enough RAM, but this cant be the case. On my screen, in the server, it shows them joining, and then disconnecting, so I dont think its a port-forwarding issue. They can all run it just fine in singleplayer as well. The annoying bit about this particular issue is that it generates no crash log. Does anyone have any suggestions? Thanks! also yes, I read the FAQ.
    • Please read the FAQ (link is orange banner at top of page), and post logs as described there, to an external site such as https://mclo.gs  
    • Hi! I've got a modpack with about 56 mods that has, up until now, been running pretty well. Starting today, any world i try to open causes minecraft to crash. It isn't the game itself- the main menu opens up fine.  I tried changing the ram allocated with both the minecraft launcher, and the forge launcher. No success with either. I tried deleting the JEI folder and letting it remake itself. No success. I tried turning off multiple mods. No success. I tried turning off JEI incase that was the issue. No dice. If you need to know specifically which mods I have installed, let me know, and I'll send them all to you. I've included the very first crash log. Please let me know if there's anything I can do! https://pastebin.com/Zfv6gWN7 -- Crash log on Pastebin (if this doesnt work, let me know)
    • I had this issue on ftb-stoneblock-3-1.11.5 (most recent version right now, installed through CurseForge), but my friend didn't get it when installing the same pack in the same way. I tried reinstalling the modpack several times, didn't help. I later finally solved it by updating REI Plugin Compatibilities (REIPC) in my StoneBlock client from version 8.0.69 to 8.0.89 (the most recent one as of now).
    • Delete the personality-client.toml file in your config folder and add this mod: https://www.curseforge.com/minecraft/mc-mods/night-config-fixes  
  • Topics

×
×
  • Create New...

Important Information

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