Jump to content

Invisible Arrows


opoz5

Recommended Posts

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.

Link to comment
Share on other sites

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);
    }
}

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

    • https://pastebin.com/VwpAW6PX My game crashes upon launch when trying to implement the Oculus mod to this mod compilation, above is the crash report, I do not know where to begin to attempt to fix this issue and require assistance.
    • https://youtube.com/shorts/gqLTSMymgUg?si=5QOeSvA4TTs-bL46
    • CubeHaven is a SMP server with unique features that can't be found on the majority of other servers! Java: MC.CUBEHAVEN.NET Bedrock: MC.CUBEHAVEN.NET:19132 3 different stores: - CubeHaven Store: Our store to purchase using real money. - Bitcoin Store: Store for Bitcoin. Bitcoin can be earned from playing the server. Giving options for players if they want to spend real money or grind to obtain exclusive packages. - Black Market: A hidden store for trading that operates outside our traditional stores, like custom enchantments, exclusive items and more. Some of our features include: Rank Up: Progress through different ranks to unlock new privileges and perks. 📈 Skills: RPG-style skill system that enhances your gaming experience! 🎮 Leaderboards: Compete and shine! Top players are rewarded weekly! 🏆 Random Teleporter: Travel instantly across different worlds with a click! 🌐 Custom World Generation: Beautifully generated world. 🌍 Dungeons: Explore challenging and rewarding dungeons filled with treasures and monsters. 🏰 Kits: Unlock ranks and gain access to various kits. 🛠️ Fishing Tournament: Compete in a friendly fishing tournament! 🎣 Chat Games: Enjoy games right within the chat! 🎲 Minions: Get some help from your loyal minions. 👥 Piñata Party: Enjoy a festive party with Piñatas! 🎉 Quests: Over 1000 quests that you can complete! 📜 Bounty Hunter: Set a bounty on a player's head. 💰 Tags: Displayed on nametags, in the tab list, and in chat. 🏷️ Coinflip: Bet with other players on coin toss outcomes, victory, or defeat! 🟢 Invisible & Glowing Frames: Hide your frames for a cleaner look or apply a glow to it for a beautiful look. 🔲✨[ Player Warp: Set your own warp points for other players to teleport to. 🌟 Display Shop: Create your own shop and sell to other players! 🛒 Item Skins: Customize your items with unique skins. 🎨 Pets: Your cute loyal companion to follow you wherever you go! 🐾 Cosmetics: Enhance the look of your character with beautiful cosmetics! 💄 XP-Bottle: Store your exp safely in a bottle for later use! 🍶 Chest & Inventory Sorting: Keep your items neatly sorted in your inventory or chest! 📦 Glowing: Stand out from other players with a colorful glow! ✨ Player Particles: Over 100 unique particle effects to show off. 🎇 Portable Inventories: Over virtual inventories with ease. 🧳 And a lot more! Become part of our growing community today! Discord: https://cubehaven.net/discord Java: MC.CUBEHAVEN.NET Bedrock: MC.CUBEHAVEN.NET:19132
    • # Problematic frame: # C [libopenal.so+0x9fb4d] It is always the same issue - this refers to the Linux OS - so your system may prevent Java from working   I am not familiar with Linux - check for similar/related issues  
  • Topics

×
×
  • Create New...

Important Information

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