Jump to content

Recommended Posts

Posted

Hi there!

 

I have this problem where my arrow entitys render as a purple arrow.

I have registered the arrow but it's not working.

 

Rendering class:

package extendedobsidian.atheera.com;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;

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

@SideOnly(Side.CLIENT)
public class RenderObsidianInfusedArrow extends Render {

    @SideOnly(Side.CLIENT)
    private Icon icon0;

    private static final ResourceLocation arrowTextures = new ResourceLocation(Core.modid.toLowerCase() + ":ObsidianInfusedArrowEntity");

    public void renderArrow(EntityObsidianInfusedArrow par1EntityArrow, double par2, double par4, double par6, float par8, float par9) {
        this.bindEntityTexture(par1EntityArrow);
        GL11.glPushMatrix();
        GL11.glTranslatef((float)par2, (float)par4, (float)par6);
        GL11.glRotatef(par1EntityArrow.prevRotationYaw + (par1EntityArrow.rotationYaw - par1EntityArrow.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(par1EntityArrow.prevRotationPitch + (par1EntityArrow.rotationPitch - par1EntityArrow.prevRotationPitch) * par9, 0.0F, 0.0F, 1.0F);
        Tessellator tessellator = Tessellator.instance;
        byte b0 = 0;
        float f2 = 0.0F;
        float f3 = 0.5F;
        float f4 = (float)(0 + b0 * 10) / 32.0F;
        float f5 = (float)(5 + b0 * 10) / 32.0F;
        float f6 = 0.0F;
        float f7 = 0.15625F;
        float f8 = (float)(5 + b0 * 10) / 32.0F;
        float f9 = (float)(10 + b0 * 10) / 32.0F;
        float f10 = 0.05625F;
        GL11.glEnable(GL12.GL_RESCALE_NORMAL);
        float f11 = (float)par1EntityArrow.arrowShake - par9;

        if (f11 > 0.0F) {
            float f12 = -MathHelper.sin(f11 * 3.0F) * f11;
            GL11.glRotatef(f12, 0.0F, 0.0F, 1.0F);
        }

        GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F);
        GL11.glScalef(f10, f10, f10);
        GL11.glTranslatef(-4.0F, 0.0F, 0.0F);
        GL11.glNormal3f(f10, 0.0F, 0.0F);
        tessellator.startDrawingQuads();
        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);
        tessellator.draw();
        GL11.glNormal3f(-f10, 0.0F, 0.0F);
        tessellator.startDrawingQuads();
        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);
        tessellator.draw();

        for (int i = 0; i < 4; ++i)
        {
            GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
            GL11.glNormal3f(0.0F, 0.0F, f10);
            tessellator.startDrawingQuads();
            tessellator.addVertexWithUV(-8.0D, -2.0D, 0.0D, (double)f2, (double)f4);
            tessellator.addVertexWithUV(8.0D, -2.0D, 0.0D, (double)f3, (double)f4);
            tessellator.addVertexWithUV(8.0D, 2.0D, 0.0D, (double)f3, (double)f5);
            tessellator.addVertexWithUV(-8.0D, 2.0D, 0.0D, (double)f2, (double)f5);
            tessellator.draw();
        }

        GL11.glDisable(GL12.GL_RESCALE_NORMAL);
        GL11.glPopMatrix();
    }
    
    protected ResourceLocation getArrowTextures(EntityObsidianInfusedArrow par1EntityArrow) {
        return arrowTextures;
    }
    @Override
    protected ResourceLocation getEntityTexture(Entity par1Entity) {
        return this.getArrowTextures((EntityObsidianInfusedArrow)par1Entity);
    }
    @Override
    public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
        this.renderArrow((EntityObsidianInfusedArrow)par1Entity, par2, par4, par6, par8, par9);
    }
    
    public String entitytexture = Core.modid.toLowerCase() + ":ObsidianInfusedArrowEntity";

    @SideOnly(Side.CLIENT)
    public void registerIcons(IconRegister par1IconRegister) {
    icon0 = par1IconRegister.registerIcon(entitytexture);
    }
}

 

Entity arrow:

package extendedobsidian.atheera.com;

import java.util.List;

import net.minecraft.block.Block;
import net.minecraft.enchantment.EnchantmentThorns;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IProjectile;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.packet.Packet70GameEvent;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class EntityObsidianInfusedArrow extends Entity implements IProjectile
{
    private int xTile = -1;
    private int yTile = -1;
    private int zTile = -1;
    private int inTile = 0;
    private int inData = 0;
    private boolean inGround = false;

    public int canBePickedUp = 0;

    public int arrowShake = 0;

    public Entity shootingEntity;
    private int ticksInGround;
    private int ticksInAir = 0;
    private double damage = 7.5D;

    private int knockbackStrength;
    
    public EntityObsidianInfusedArrow(World par1World) {
        super(par1World);
        this.renderDistanceWeight = 10.0D;
        this.setSize(0.5F, 0.5F);
    }

    public EntityObsidianInfusedArrow(World par1World, double par2, double par4, double par6) {
        super(par1World);
        this.renderDistanceWeight = 10.0D;
        this.setSize(0.5F, 0.5F);
        this.setPosition(par2, par4, par6);
        this.yOffset = 0.0F;
    }

    public EntityObsidianInfusedArrow(World par1World, EntityLivingBase par2EntityLiving, EntityLiving par3EntityLiving, float par4, float par5) {
        super(par1World);
        this.renderDistanceWeight = 10.0D;
        this.shootingEntity = par2EntityLiving;

        if (par2EntityLiving instanceof EntityPlayer) {
            this.canBePickedUp = 1;
        }

        this.posY = par2EntityLiving.posY + (double)par2EntityLiving.getEyeHeight() - 0.10000000149011612D;
        double d0 = par3EntityLiving.posX - par2EntityLiving.posX;
        double d1 = par3EntityLiving.boundingBox.minY + (double)(par3EntityLiving.height / 3.0F) - this.posY;
        double d2 = par3EntityLiving.posZ - par2EntityLiving.posZ;
        double d3 = (double)MathHelper.sqrt_double(d0 * d0 + d2 * d2);

        if (d3 >= 1.0E-7D) {
            float f2 = (float)(Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F;
            float f3 = (float)(-(Math.atan2(d1, d3) * 180.0D / Math.PI));
            double d4 = d0 / d3;
            double d5 = d2 / d3;
            this.setLocationAndAngles(par2EntityLiving.posX + d4, this.posY, par2EntityLiving.posZ + d5, f2, f3);
            this.yOffset = 0.0F;
            float f4 = (float)d3 * 0.2F;
            this.setThrowableHeading(d0, d1 + (double)f4, d2, par4, par5);
        }
    }

    public EntityObsidianInfusedArrow(World par1World, EntityLivingBase par2EntityLiving, float par3) {
        super(par1World);
        this.renderDistanceWeight = 10.0D;
        this.shootingEntity = par2EntityLiving;

        if (par2EntityLiving instanceof EntityPlayer) {
            this.canBePickedUp = 1;
        }

        this.setSize(0.5F, 0.5F);
        this.setLocationAndAngles(par2EntityLiving.posX, par2EntityLiving.posY + (double)par2EntityLiving.getEyeHeight(), par2EntityLiving.posZ, par2EntityLiving.rotationYaw, par2EntityLiving.rotationPitch);
        this.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F);
        this.posY -= 0.10000000149011612D;
        this.posZ -= (double)(MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F);
        this.setPosition(this.posX, this.posY, this.posZ);
        this.yOffset = 0.0F;
        this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI));
        this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI));
        this.motionY = (double)(-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI));
        this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, par3 * 1.5F, 1.0F);
    }
    @Override
    protected void entityInit() {
        this.dataWatcher.addObject(16, Byte.valueOf((byte)0));
    }
    @Override
    public void setThrowableHeading(double par1, double par3, double par5, float par7, float par8) {
        float f2 = MathHelper.sqrt_double(par1 * par1 + par3 * par3 + par5 * par5);
        par1 /= (double)f2;
        par3 /= (double)f2;
        par5 /= (double)f2;
        par1 += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)par8;
        par3 += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)par8;
        par5 += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)par8;
        par1 *= (double)par7;
        par3 *= (double)par7;
        par5 *= (double)par7;
        this.motionX = par1;
        this.motionY = par3;
        this.motionZ = par5;
        float f3 = MathHelper.sqrt_double(par1 * par1 + par5 * par5);
        this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI);
        this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)f3) * 180.0D / Math.PI);
        this.ticksInGround = 0;
    }
    @Override
    @SideOnly(Side.CLIENT)
    public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) {
        this.setPosition(par1, par3, par5);
        this.setRotation(par7, par8);
    }
    @Override
    @SideOnly(Side.CLIENT)
    public void setVelocity(double par1, double par3, double par5) {
        this.motionX = par1;
        this.motionY = par3;
        this.motionZ = par5;

        if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) {
            float f = MathHelper.sqrt_double(par1 * par1 + par5 * par5);
            this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI);
            this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)f) * 180.0D / Math.PI);
            this.prevRotationPitch = this.rotationPitch;
            this.prevRotationYaw = this.rotationYaw;
            this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
            this.ticksInGround = 0;
        }
    }
    @Override
    public void onUpdate()
    {
        super.onUpdate();

        if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) {
            float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
            this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
            this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f) * 180.0D / Math.PI);
        }

        int i = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile);

        if (i > 0) {
            Block.blocksList[i].setBlockBoundsBasedOnState(this.worldObj, this.xTile, this.yTile, this.zTile);
            AxisAlignedBB axisalignedbb = Block.blocksList[i].getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile);

            if (axisalignedbb != null && axisalignedbb.isVecInside(this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ))) {
                this.inGround = true;
            }
        }

        if (this.arrowShake > 0) {
            --this.arrowShake;
        }

        if (this.inGround) {
            int j = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile);
            int k = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile);

            if (j == this.inTile && k == this.inData) {
                ++this.ticksInGround;

                if (this.ticksInGround == 1200) {
                    this.setDead();
                }
            }else{
                this.inGround = false;
                this.motionX *= (double)(this.rand.nextFloat() * 0.2F);
                this.motionY *= (double)(this.rand.nextFloat() * 0.2F);
                this.motionZ *= (double)(this.rand.nextFloat() * 0.2F);
                this.ticksInGround = 0;
                this.ticksInAir = 0;
            }
        }else{
            ++this.ticksInAir;
            Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
            Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
            MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, false, true);
            vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
            vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);

            if (movingobjectposition != null) {
                vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
            }

            Entity entity = null;
            List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
            double d0 = 0.0D;
            int l;
            float f1;

            for (l = 0; l < list.size(); ++l) {
                Entity entity1 = (Entity)list.get(l);

                if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) {
                    f1 = 0.3F;
                    AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand((double)f1, (double)f1, (double)f1);
                    MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec3, vec31);

                    if (movingobjectposition1 != null) {
                        double d1 = vec3.distanceTo(movingobjectposition1.hitVec);

                        if (d1 < d0 || d0 == 0.0D) {
                            entity = entity1;
                            d0 = d1;
                        }
                    }
                }
            }

            if (entity != null) {
                movingobjectposition = new MovingObjectPosition(entity);
            }

            if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer) {
                EntityPlayer entityplayer = (EntityPlayer)movingobjectposition.entityHit;

                if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(entityplayer)) {
                    movingobjectposition = null;
                }
            }

            float f2;
            float f3;

            if (movingobjectposition != null) {
                if (movingobjectposition.entityHit != null) {
                    f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
                    int i1 = MathHelper.ceiling_double_int((double)f2 * this.damage);

                    if (this.getIsCritical()) {
                        i1 += this.rand.nextInt(i1 / 2 + 2);
                    }

                    DamageSource damagesource = null;

                    if (this.shootingEntity == null) {
                        damagesource = DamageSource.causeThrownDamage(this, this);
                    }
                    else {
                        damagesource = DamageSource.causeThrownDamage(this, this.shootingEntity);
                    }

                    if (this.isBurning() && !(movingobjectposition.entityHit instanceof EntityEnderman)) {
                        movingobjectposition.entityHit.setFire(5);
                    }

                    if (movingobjectposition.entityHit.attackEntityFrom(damagesource, i1)) {
                        if (movingobjectposition.entityHit instanceof EntityLiving) {
                            EntityLiving entityliving = (EntityLiving)movingobjectposition.entityHit;

                            if (!this.worldObj.isRemote) {
                                entityliving.setArrowCountInEntity(entityliving.getArrowCountInEntity() + 1);
                            }

                            if (this.knockbackStrength > 0) {
                                f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);

                                if (f3 > 0.0F) {
                                    movingobjectposition.entityHit.addVelocity(this.motionX * (double)this.knockbackStrength * 0.6000000238418579D / (double)f3, 0.1D, this.motionZ * (double)this.knockbackStrength * 0.6000000238418579D / (double)f3);
                                }
                            }

                            if (this.shootingEntity != null) {
                                EnchantmentThorns.func_92096_a(this.shootingEntity, entityliving, this.rand);
                            }

                            if (this.shootingEntity != null && movingobjectposition.entityHit != this.shootingEntity && movingobjectposition.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP) {
                                ((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(6, 0));
                            }
                        }

                        this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));

                        if (!(movingobjectposition.entityHit instanceof EntityEnderman)) {
                            this.setDead();
                        }
                    }else {
                        this.motionX *= -0.10000000149011612D;
                        this.motionY *= -0.10000000149011612D;
                        this.motionZ *= -0.10000000149011612D;
                        this.rotationYaw += 180.0F;
                        this.prevRotationYaw += 180.0F;
                        this.ticksInAir = 0;
                    }
                }else {
                    this.xTile = movingobjectposition.blockX;
                    this.yTile = movingobjectposition.blockY;
                    this.zTile = movingobjectposition.blockZ;
                    this.inTile = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile);
                    this.inData = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile);
                    this.motionX = (double)((float)(movingobjectposition.hitVec.xCoord - this.posX));
                    this.motionY = (double)((float)(movingobjectposition.hitVec.yCoord - this.posY));
                    this.motionZ = (double)((float)(movingobjectposition.hitVec.zCoord - this.posZ));
                    f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
                    this.posX -= this.motionX / (double)f2 * 0.05000000074505806D;
                    this.posY -= this.motionY / (double)f2 * 0.05000000074505806D;
                    this.posZ -= this.motionZ / (double)f2 * 0.05000000074505806D;
                    this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
                    this.inGround = true;
                    this.arrowShake = 7;
                    this.setIsCritical(false);

                    if (this.inTile != 0) {
                        Block.blocksList[this.inTile].onEntityCollidedWithBlock(this.worldObj, this.xTile, this.yTile, this.zTile, this);
                    }
                }
            }

            if (this.getIsCritical()) {
                for (l = 0; l < 4; ++l) {
                    this.worldObj.spawnParticle("crit", this.posX + this.motionX * (double)l / 4.0D, this.posY + this.motionY * (double)l / 4.0D, this.posZ + this.motionZ * (double)l / 4.0D, -this.motionX, -this.motionY + 0.2D, -this.motionZ);
                }
            }

            this.posX += this.motionX;
            this.posY += this.motionY;
            this.posZ += this.motionZ;
            f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
            this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);

            for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f2) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) {
                ;
            }

            while (this.rotationPitch - this.prevRotationPitch >= 180.0F) {
                this.prevRotationPitch += 360.0F;
            }

            while (this.rotationYaw - this.prevRotationYaw < -180.0F) {
                this.prevRotationYaw -= 360.0F;
            }

            while (this.rotationYaw - this.prevRotationYaw >= 180.0F) {
                this.prevRotationYaw += 360.0F;
            }

            this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
            this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
            float f4 = 0.99F;
            f1 = 0.05F;

            if (this.isInWater()) {
                for (int j1 = 0; j1 < 4; ++j1) {
                    f3 = 0.25F;
                    this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ);
                }

                f4 = 0.8F;
            }

            this.motionX *= (double)f4;
            this.motionY *= (double)f4;
            this.motionZ *= (double)f4;
            this.motionY -= (double)f1;
            this.setPosition(this.posX, this.posY, this.posZ);
            this.doBlockCollisions();
        }
    }
    @Override
    public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {
        par1NBTTagCompound.setShort("xTile", (short)this.xTile);
        par1NBTTagCompound.setShort("yTile", (short)this.yTile);
        par1NBTTagCompound.setShort("zTile", (short)this.zTile);
        par1NBTTagCompound.setByte("inTile", (byte)this.inTile);
        par1NBTTagCompound.setByte("inData", (byte)this.inData);
        par1NBTTagCompound.setByte("shake", (byte)this.arrowShake);
        par1NBTTagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0));
        par1NBTTagCompound.setByte("pickup", (byte)this.canBePickedUp);
        par1NBTTagCompound.setDouble("damage", this.damage);
    }
    @Override
    public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {
        this.xTile = par1NBTTagCompound.getShort("xTile");
        this.yTile = par1NBTTagCompound.getShort("yTile");
        this.zTile = par1NBTTagCompound.getShort("zTile");
        this.inTile = par1NBTTagCompound.getByte("inTile") & 255;
        this.inData = par1NBTTagCompound.getByte("inData") & 255;
        this.arrowShake = par1NBTTagCompound.getByte("shake") & 255;
        this.inGround = par1NBTTagCompound.getByte("inGround") == 1;

        if (par1NBTTagCompound.hasKey("damage")) {
            this.damage = par1NBTTagCompound.getDouble("damage");
        }

        if (par1NBTTagCompound.hasKey("pickup")) {
            this.canBePickedUp = par1NBTTagCompound.getByte("pickup");
        }
        else if (par1NBTTagCompound.hasKey("player")) {
            this.canBePickedUp = par1NBTTagCompound.getBoolean("player") ? 1 : 0;
        }
    }
    @Override
    public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) {
        if (!this.worldObj.isRemote && this.inGround && this.arrowShake <= 0) {
            boolean flag = this.canBePickedUp == 1 || this.canBePickedUp == 2 && par1EntityPlayer.capabilities.isCreativeMode;

            if (this.canBePickedUp == 1 && !par1EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Core.itemObsidianInfusedArrow, 1))) {
                flag = false;
            }

            if (flag) {
                this.playSound("random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
                par1EntityPlayer.onItemPickup(this, 1);
                this.setDead();
            }
        }
    }
    @Override
    protected boolean canTriggerWalking() {
        return false;
    }
    @Override
    @SideOnly(Side.CLIENT)
    public float getShadowSize() {
        return 0.0F;
    }

    public void setDamage(double par1) {
        this.damage = par1;
    }

    public double getDamage() {
        return this.damage;
    }

    public void setKnockbackStrength(int par1) {
        this.knockbackStrength = par1;
    }
    @Override
    public boolean canAttackWithItem() {
        return false;
    }

    public void setIsCritical(boolean par1) {
        byte b0 = this.dataWatcher.getWatchableObjectByte(16);

        if (par1) {
            this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 1)));
        }
        else {
            this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -2)));
        }
    }

    public boolean getIsCritical() {
        byte b0 = this.dataWatcher.getWatchableObjectByte(16);
        return (b0 & 1) != 0;
    }
}
[code]

Bow class:
[code]
package extendedobsidian.atheera.com;

import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.EnumAction;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
import net.minecraftforge.event.entity.player.ArrowNockEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class ObsidianInfusedBow extends Item {

    public static final String[] bowPullIconNameArray = new String[] {"ObsidianInfusedBow_pulling_0", "ObsidianInfusedBow_pulling_1", "ObsidianInfusedBow_pulling_2"};
    @SideOnly(Side.CLIENT)
    private Icon[] iconArray;

    @SideOnly(Side.CLIENT)
    private Icon icon0;
    private Icon icon1;
    private Icon icon2;
    
    public ObsidianInfusedBow(int par1) {
        super(par1);
        this.maxStackSize = 1;
        this.setMaxDamage(8192);
    }
    @Override
    public boolean hasEffect(ItemStack itemstack) {
    	return true;
    }
    @Override
    public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) {
        int j = this.getMaxItemUseDuration(par1ItemStack) - par4;

        ArrowLooseEvent event = new ArrowLooseEvent(par3EntityPlayer, par1ItemStack, j);
        MinecraftForge.EVENT_BUS.post(event);
        if (event.isCanceled()) {
            return;
        }
        j = event.charge;

        boolean flag = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0;

        if (flag || par3EntityPlayer.inventory.hasItem(Core.itemObsidianInfusedArrow.itemID)) {
            float f = (float)j / 20.0F;
            f = (f * f + f * 2.0F) / 3.0F;

            if ((double)f < 0.1D) {
                return;
            }

            if (f > 1.0F) {
                f = 1.0F;
            }

            EntityObsidianInfusedArrow entityarrow = new EntityObsidianInfusedArrow(par2World, par3EntityPlayer, f * 2.0F);

            if (f == 1.0F) {
                entityarrow.setIsCritical(true);
            }

            int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, par1ItemStack);

            if (k > 0) {
                entityarrow.setDamage(entityarrow.getDamage() + (double)k * 0.5D + 0.5D);
            }

            int l = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, par1ItemStack);

            if (l > 0) {
                entityarrow.setKnockbackStrength(l);
            }

            if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, par1ItemStack) > 0) {
                entityarrow.setFire(100);
            }

            par1ItemStack.damageItem(1, par3EntityPlayer);
            par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F);

            if (flag) {
                entityarrow.canBePickedUp = 2;
            }else{
                par3EntityPlayer.inventory.consumeInventoryItem(Core.itemObsidianInfusedArrow.itemID);
            }

            if (!par2World.isRemote) {
                par2World.spawnEntityInWorld(entityarrow);
            }
        }
    }
    @Override
    public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
    {
        return par1ItemStack;
    }
    @Override
    public int getMaxItemUseDuration(ItemStack par1ItemStack) {
        return 36000;
    }
    @Override
    public EnumAction getItemUseAction(ItemStack par1ItemStack) {
        return EnumAction.bow;
    }
    @Override
    public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
        ArrowNockEvent event = new ArrowNockEvent(par3EntityPlayer, par1ItemStack);
        MinecraftForge.EVENT_BUS.post(event);
        if (event.isCanceled()) {
            return event.result;
        }

        if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Core.itemObsidianInfusedArrow.itemID)) {
            par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));
        }

        return par1ItemStack;
    }
    @Override
    public int getItemEnchantability() {
        return 30;
    }
    
    public String STANDBY = Core.modid.toLowerCase() + ":ObsidianInfusedBow_standby";
    public String TEXTURE0 = Core.modid.toLowerCase() + ":ObsidianInfusedBow_pulling_0";
    public String TEXTURE1 = Core.modid.toLowerCase() + ":ObsidianInfusedBow_pulling_1";
    public String TEXTURE2 = Core.modid.toLowerCase() + ":ObsidianInfusedBow_pulling_2";
    
    @Override
    @SideOnly(Side.CLIENT)
    public void registerIcons(IconRegister par1IconRegister) {
    itemIcon = par1IconRegister.registerIcon(STANDBY);
    icon0 = par1IconRegister.registerIcon(TEXTURE0);
    icon1 = par1IconRegister.registerIcon(TEXTURE1);
    icon2 = par1IconRegister.registerIcon(TEXTURE2);
    }
    
    @Override
    @SideOnly(Side.CLIENT)
    public Icon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
    if(player.getItemInUse() == null) return this.itemIcon;
    int Pulling = stack.getMaxItemUseDuration() - useRemaining;
    
    if (Pulling >= 18) {
    return icon2;
    }else if (Pulling > 13) {
    return icon1;
    }else if (Pulling > 0) {
    return icon0;
    }	
    return itemIcon;
    }
} 

Posted
  On 5/7/2014 at 9:21 AM, larsgerrits said:

You need to bind the texture between the GL11.glPushMatrix(); and GL11.glPopMatrix() method.

Does not matter where you bind the texture (as long as it's before the texture drawing)

 

1. Why do you have an Icon in your render file? It does not belong there.

2. Can we see how you registered your Arrow entity (and the render)?

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

  Quote

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted
  On 5/7/2014 at 9:28 AM, SanAndreasP said:

  Quote

You need to bind the texture between the GL11.glPushMatrix(); and GL11.glPopMatrix() method.

Does not matter where you bind the texture (as long as it's before the texture drawing)

 

1. Why do you have an Icon in your render file? It does not belong there.

2. Can we see how you registered your Arrow entity (and the render)?

 

Client Proxy:

package extendedobsidian.atheera.com;

import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.registry.GameRegistry;

public class ClientProxy extends CommonProxy{

@Override
public void registerRenderThings() {

	GameRegistry.registerTileEntity(TileEntityFusionFurnace.class, "tileentityfusionfurnace");
	RenderingRegistry.registerEntityRenderingHandler(EntityObsidianInfusedArrow.class, new RenderObsidianInfusedArrow());

}

public int addArmor(String armor) {
	return RenderingRegistry.addNewArmourRendererPrefix(armor);
}

}

 

I forgot this also:

Main class

 

EntityRegistry.registerModEntity(EntityObsidianInfusedArrow.class, "ObsidianInfusedArrow", 2, Core.instance, 128, 1, true);

LanguageRegistry.instance().addStringLocalization("entity.ObsidianInfusedArrow.name", "Obsidian Infused Arrow");

 

EntityRegistry.registerGlobalEntityID(EntityObsidianInfusedArrow.class, "ObsidianInfusedArrow", EntityRegistry.findGlobalUniqueEntityId());

Posted

The only thing left is now the class where you register the entity itself.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

  Quote

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted
  On 5/7/2014 at 10:52 AM, SanAndreasP said:

The only thing left is now the class where you register the entity itself.

 

Isn't that done in the bow class?

 

package extendedobsidian.atheera.com;

import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.EnumAction;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
import net.minecraftforge.event.entity.player.ArrowNockEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class ObsidianInfusedBow extends Item {

    public static final String[] bowPullIconNameArray = new String[] {"ObsidianInfusedBow_pulling_0", "ObsidianInfusedBow_pulling_1", "ObsidianInfusedBow_pulling_2"};
    @SideOnly(Side.CLIENT)
    private Icon[] iconArray;

    @SideOnly(Side.CLIENT)
    private Icon icon0;
    private Icon icon1;
    private Icon icon2;
    
    public ObsidianInfusedBow(int par1) {
        super(par1);
        this.maxStackSize = 1;
        this.setMaxDamage(8192);
    }
    @Override
    public boolean hasEffect(ItemStack itemstack) {
    	return true;
    }
    @Override
    public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) {
        int j = this.getMaxItemUseDuration(par1ItemStack) - par4;

        ArrowLooseEvent event = new ArrowLooseEvent(par3EntityPlayer, par1ItemStack, j);
        MinecraftForge.EVENT_BUS.post(event);
        if (event.isCanceled()) {
            return;
        }
        j = event.charge;

        boolean flag = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0;

        if (flag || par3EntityPlayer.inventory.hasItem(Core.itemObsidianInfusedArrow.itemID)) {
            float f = (float)j / 20.0F;
            f = (f * f + f * 2.0F) / 3.0F;

            if ((double)f < 0.1D) {
                return;
            }

            if (f > 1.0F) {
                f = 1.0F;
            }

            EntityObsidianInfusedArrow entityarrow = new EntityObsidianInfusedArrow(par2World, par3EntityPlayer, f * 2.0F);

            if (f == 1.0F) {
                entityarrow.setIsCritical(true);
            }

            int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, par1ItemStack);

            if (k > 0) {
                entityarrow.setDamage(entityarrow.getDamage() + (double)k * 0.5D + 0.5D);
            }

            int l = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, par1ItemStack);

            if (l > 0) {
                entityarrow.setKnockbackStrength(l);
            }

            if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, par1ItemStack) > 0) {
                entityarrow.setFire(100);
            }

            par1ItemStack.damageItem(1, par3EntityPlayer);
            par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F);

            if (flag) {
                entityarrow.canBePickedUp = 2;
            }else{
                par3EntityPlayer.inventory.consumeInventoryItem(Core.itemObsidianInfusedArrow.itemID);
            }

            if (!par2World.isRemote) {
                par2World.spawnEntityInWorld(entityarrow);
            }
        }
    }
    @Override
    public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
    {
        return par1ItemStack;
    }
    @Override
    public int getMaxItemUseDuration(ItemStack par1ItemStack) {
        return 36000;
    }
    @Override
    public EnumAction getItemUseAction(ItemStack par1ItemStack) {
        return EnumAction.bow;
    }
    @Override
    public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
        ArrowNockEvent event = new ArrowNockEvent(par3EntityPlayer, par1ItemStack);
        MinecraftForge.EVENT_BUS.post(event);
        if (event.isCanceled()) {
            return event.result;
        }

        if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Core.itemObsidianInfusedArrow.itemID)) {
            par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));
        }

        return par1ItemStack;
    }
    @Override
    public int getItemEnchantability() {
        return 30;
    }
    
    public String STANDBY = Core.modid.toLowerCase() + ":ObsidianInfusedBow_standby";
    public String TEXTURE0 = Core.modid.toLowerCase() + ":ObsidianInfusedBow_pulling_0";
    public String TEXTURE1 = Core.modid.toLowerCase() + ":ObsidianInfusedBow_pulling_1";
    public String TEXTURE2 = Core.modid.toLowerCase() + ":ObsidianInfusedBow_pulling_2";
    
    @Override
    @SideOnly(Side.CLIENT)
    public void registerIcons(IconRegister par1IconRegister) {
    itemIcon = par1IconRegister.registerIcon(STANDBY);
    icon0 = par1IconRegister.registerIcon(TEXTURE0);
    icon1 = par1IconRegister.registerIcon(TEXTURE1);
    icon2 = par1IconRegister.registerIcon(TEXTURE2);
    }
    
    @Override
    @SideOnly(Side.CLIENT)
    public Icon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
    if(player.getItemInUse() == null) return this.itemIcon;
    int Pulling = stack.getMaxItemUseDuration() - useRemaining;
    
    if (Pulling >= 18) {
    return icon2;
    }else if (Pulling > 13) {
    return icon1;
    }else if (Pulling > 0) {
    return icon0;
    }	
    return itemIcon;
    }
} 

Posted

No, within the bow class, you only instantiate it.

You need to register the entity class like any other entity.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

  Quote

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted
  On 5/7/2014 at 11:04 AM, SanAndreasP said:

No, within the bow class, you only instantiate it.

You need to register the entity class like any other entity.

 

I have this in the init of my main class

 

EntityRegistry.registerModEntity(EntityObsidianInfusedArrow.class, "ObsidianInfusedArrow", 2, Core.instance, 128, 1, true);

LanguageRegistry.instance().addStringLocalization("entity.ObsidianInfusedArrow.name", "Obsidian Infused Arrow");

 

EntityRegistry.registerGlobalEntityID(EntityObsidianInfusedArrow.class, "ObsidianInfusedArrow", EntityRegistry.findGlobalUniqueEntityId());

 

Shouldn't that do it?

Posted

the registerGlobalEntityId is not needed, you can omit that.

Can you do a System.Out.Println("renderme"); in your doRender method and see if it gets called?

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

  Quote

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted
  On 5/7/2014 at 11:28 AM, SanAndreasP said:

the registerGlobalEntityId is not needed, you can omit that.

Can you do a System.Out.Println("renderme"); in your doRender method and see if it gets called?

 

Yeah, it gets rendered alright:

2014-05-07 13:31:13 [iNFO] [sTDOUT] renderme

2014-05-07 13:31:13 [iNFO] [sTDOUT] renderme

2014-05-07 13:31:13 [iNFO] [sTDOUT] renderme

2014-05-07 13:31:13 [iNFO] [sTDOUT] renderme

2014-05-07 13:31:13 [iNFO] [sTDOUT] renderme

2014-05-07 13:31:13 [iNFO] [sTDOUT] renderme

2014-05-07 13:31:13 [iNFO] [sTDOUT] renderme

2014-05-07 13:31:13 [iNFO] [sTDOUT] renderme

2014-05-07 13:31:13 [iNFO] [sTDOUT] renderme

Posted

I might see the problem, you're getting an arrow with a missing texture icon, because of this:

new ResourceLocation(Core.modid.toLowerCase() + ":ObsidianInfusedArrowEntity")

 

You can't use the ResourceLocation the same way as you would register icons (since they not only handle textures, but also sounds etc.)

To use it properly, you have to specify a path to the file (with extension), so like:

new ResourceLocation("baseFolder:textures/entity/myArrow.png")

where baseFolder is the folder in the assets folder (here your mod id) and textures/entity/myArrow.png the path to the texture file:

assets/baseFolder/textures/entity/myArrow.png

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

  Quote

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted
  On 5/7/2014 at 11:39 AM, SanAndreasP said:

I might see the problem, you're getting an arrow with a missing texture icon, because of this:

new ResourceLocation(Core.modid.toLowerCase() + ":ObsidianInfusedArrowEntity")

 

You can't use the ResourceLocation the same way as you would register icons (since they not only handle textures, but also sounds etc.)

To use it properly, you have to specify a path to the file (with extension), so like:

new ResourceLocation("baseFolder:textures/entity/myArrow.png")

where baseFolder is the folder in the assets folder (here your mod id) and textures/entity/myArrow.png the path to the texture file:

assets/baseFolder/textures/entity/myArrow.png

 

OMG! I love you so much! THANK YOU!!

Well, the texture is rendering correctly, although... The arrow gets stuck in mid-air.

 

2woj7d0.png

Posted
  On 5/7/2014 at 11:45 AM, Atheera said:

OMG! I love you so much! THANK YOU!!

Well, the texture is rendering correctly, although... The arrow gets stuck in mid-air.

 

does it get stuck after it hits something or during flight?

Another question is what does your EntityArrow do different from the vanilla one? I see a lot of copied code. Can't you just extend the vanilla one and make your changes?

Here's an example from my arrow entity: https://github.com/SanAndreasP/EnderStuffPlus/blob/master/java/de/sanandrew/mods/enderstuffplus/entity/EntityAvisArrow.java

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

  Quote

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted
  On 5/7/2014 at 11:56 AM, SanAndreasP said:

  Quote

OMG! I love you so much! THANK YOU!!

Well, the texture is rendering correctly, although... The arrow gets stuck in mid-air.

 

does it get stuck after it hits something or during flight?

Another question is what does your EntityArrow do different from the vanilla one? I see a lot of copied code. Can't you just extend the vanilla one and make your changes?

Here's an example from my arrow entity: https://github.com/SanAndreasP/EnderStuffPlus/blob/master/java/de/sanandrew/mods/enderstuffplus/entity/EntityAvisArrow.java

 

I am uploading a video now, but when it has hit something, it goes back a bit.

I want it to act exactly like the vanilla arrow but do more damage.

Posted
  On 5/7/2014 at 1:33 PM, Atheera said:

  Quote

  Quote

OMG! I love you so much! THANK YOU!!

Well, the texture is rendering correctly, although... The arrow gets stuck in mid-air.

 

does it get stuck after it hits something or during flight?

Another question is what does your EntityArrow do different from the vanilla one? I see a lot of copied code. Can't you just extend the vanilla one and make your changes?

Here's an example from my arrow entity: https://github.com/SanAndreasP/EnderStuffPlus/blob/master/java/de/sanandrew/mods/enderstuffplus/entity/EntityAvisArrow.java

 

I am uploading a video now, but when it has hit something, it goes back a bit.

I want it to act exactly like the vanilla arrow but do more damage.

 

 

Arrows behaving themselves weird

Posted

If you just want more damage then you can definitely just extend the vanilla arrow entity in fact if you wernt doing custom rendering you wouldn't have to make your own arrow at all (you can modify the damage coursed by a vanilla arrow when you spawn it)

Just dont forget to remove the fields:

public int canBePickedUp;

public int arrowShake;

and

public Entity shootingEntity;

Or you will get the common "Arrow hits shooter" problem

It is also a good idea to replace super.onUpdate() in the onUpdate method with

super.onEntityUpdate(); otherwise both the onUpdate from the vanilla arrow and you custom onUpdate method will run and you probably dont want this.

I am the author of Draconic Evolution

Posted
  On 5/7/2014 at 4:00 PM, brandon3055 said:

If you just want more damage then you can definitely just extend the vanilla arrow entity in fact if you wernt doing custom rendering you wouldn't have to make your own arrow at all (you can modify the damage coursed by a vanilla arrow when you spawn it)

Just dont forget to remove the fields:

public int canBePickedUp;

public int arrowShake;

and

public Entity shootingEntity;

Or you will get the common "Arrow hits shooter" problem

It is also a good idea to replace super.onUpdate() in the onUpdate method with

super.onEntityUpdate(); otherwise both the onUpdate from the vanilla arrow and you custom onUpdate method will run and you probably dont want this.

 

I have gotten the texture right and the arrow behaving as I want them to, but the damage is wrong, and I don't know how to fix it.

 

Entity Arrow Class:

package extendedobsidian.atheera.com;

import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;

public class EntityObsidianInfusedArrow extends EntityArrow {

    public EntityObsidianInfusedArrow(World world) {
        super(world);
    }

    public EntityObsidianInfusedArrow(World world, double x, double y, double z) {
        super(world, x, y, z);
    }

    public EntityObsidianInfusedArrow(World world, EntityLivingBase shooter, EntityLivingBase target, float motionMulti, float precision) {
        super(world, shooter, target, motionMulti, precision);
    }

    public EntityObsidianInfusedArrow(World world, EntityLivingBase shooter, float motionMulti) {
        super(world, shooter, motionMulti);
    }

    @Override
    public void onCollideWithPlayer(EntityPlayer player) {
        if( !this.worldObj.isRemote ) {
            NBTTagCompound origNBT = new NBTTagCompound();
            this.writeEntityToNBT(origNBT);

            if( origNBT.getByte("inGround") == 1 && this.arrowShake <= 0 && ((this.canBePickedUp == 1 && player.inventory.addItemStackToInventory(new ItemStack(Core.itemObsidianInfusedArrow, 1))) || player.capabilities.isCreativeMode)) {
                this.worldObj.playSoundAtEntity(this, "random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
                
                player.onItemPickup(this, 1);
                this.setDead();
            }
        }
    }

    @Override
    public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {
        par1NBTTagCompound.setDouble("damage", this.damage);
    }

    @Override
    public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {

        if (par1NBTTagCompound.hasKey("damage")) {
            this.damage = par1NBTTagCompound.getDouble("damage");
        }
    }
    
    private double damage = 6.0D;
    
    @Override
    public void setDamage(double par1) {
        this.damage = par1;
    }
    @Override
    public double getDamage() {
        return this.damage;
    }
}

Posted

You don't reference the

damage

field you've declared.

Actually you don't even need to.

 

I recommend just to override setDamage and call the super method with the given parameter multiplied by the value, meaning it has x times more damage than a vanilla arrow would've.

 

Also remove the getDamage method and the damage field

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

  Quote

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted
  On 5/8/2014 at 12:56 PM, SanAndreasP said:

You don't reference the

damage

field you've declared.

Actually you don't even need to.

 

I recommend just to override setDamage and call the super method with the given parameter multiplied by the value, meaning it has x times more damage than a vanilla arrow would've.

 

Also remove the getDamage method and the damage field

 

I have tried everything but nothing works. There doesn't seem to be any tutorials online to fix it either.

 

Entity Arrow Class:

package extendedobsidian.atheera.com;

import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;

public class EntityObsidianInfusedArrow extends EntityArrow {

    public EntityObsidianInfusedArrow(World world) {
        super(world);
        this.setDamage(6.0D);
    }

    public EntityObsidianInfusedArrow(World world, double x, double y, double z) {
        super(world, x, y, z);
    }

    public EntityObsidianInfusedArrow(World world, EntityLivingBase shooter, EntityLivingBase target, float motionMulti, float precision) {
        super(world, shooter, target, motionMulti, precision);
    }

    public EntityObsidianInfusedArrow(World world, EntityLivingBase shooter, float motionMulti) {
        super(world, shooter, motionMulti);
    }

    @Override
    public void onCollideWithPlayer(EntityPlayer player) {
        if( !this.worldObj.isRemote ) {
            NBTTagCompound origNBT = new NBTTagCompound();
            this.writeEntityToNBT(origNBT);

            if( origNBT.getByte("inGround") == 1 && this.arrowShake <= 0 && ((this.canBePickedUp == 1 && player.inventory.addItemStackToInventory(new ItemStack(Core.itemObsidianInfusedArrow, 1))) || player.capabilities.isCreativeMode)) {
                this.worldObj.playSoundAtEntity(this, "random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
                
                player.onItemPickup(this, 1);
                this.setDead();
            }
        }
    }
    
    public double damage = 2.0D;
    
    @Override
    public void setDamage(double damage) {
    	super.setDamage(damage);
    	
    	this.damage = damage * 3.0D;
    	damage = damage * 3.0D;
    }
}

Posted

Again, remove the damage field in your class! It's not referenced anywhere and unlike methods, fields cannot be "overridden"!

Also do your calculations before the super method call, and only on the local variable. Also a tip, you can also do

damage *= 3.0D

, which basically says "re-assign the variable with itself multiplied by 3.0D". You can also use this on any numerical type with any mathematical or bitwise operator.

But what you can also do is to do the calculation within the parameter assignment like

method(variable * [value])

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

  Quote

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted
  On 5/9/2014 at 6:18 AM, SanAndreasP said:

Again, remove the damage field in your class! It's not referenced anywhere and unlike methods, fields cannot be "overridden"!

Also do your calculations before the super method call, and only on the local variable. Also a tip, you can also do

damage *= 3.0D

, which basically says "re-assign the variable with itself multiplied by 3.0D". You can also use this on any numerical type with any mathematical or bitwise operator.

But what you can also do is to do the calculation within the parameter assignment like

method(variable * [value])

 

Hey man, I got it working with damage and everything.

I hope you don't mind me using your class.

 

Arrow class:

package extendedobsidian.atheera.com.entity;

import extendedobsidian.atheera.com.Core;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;

public class EntityObsidianInfusedArrow extends EntityArrow {

    public EntityObsidianInfusedArrow(World world) {
        super(world);
    }

    public EntityObsidianInfusedArrow(World world, double x, double y, double z) {
        super(world, x, y, z);
    }

    public EntityObsidianInfusedArrow(World world, EntityLivingBase shooter, EntityLivingBase target, float motionMulti, float precision) {
        super(world, shooter, target, motionMulti, precision);
    }

    public EntityObsidianInfusedArrow(World world, EntityLivingBase shooter, float motionMulti) {
        super(world, shooter, motionMulti);
        this.setDamage(6.0D);
    }

    @Override
    public void onCollideWithPlayer(EntityPlayer player) {
        if( !this.worldObj.isRemote ) {
            NBTTagCompound origNBT = new NBTTagCompound();
            this.writeEntityToNBT(origNBT);

            if( origNBT.getByte("inGround") == 1 && this.arrowShake <= 0 && ((this.canBePickedUp == 1 && player.inventory.addItemStackToInventory(new ItemStack(Core.itemObsidianInfusedArrow, 1))) || player.capabilities.isCreativeMode)) {
                this.worldObj.playSoundAtEntity(this, "random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
                
                player.onItemPickup(this, 1);
                this.setDead();
            }
        }
    }
}

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

    • Install Java 17 https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html
    • I'm trying to install the forge app and when ever I press the forge-1.21.7-57.0.2-installer.jar it shows Select a app to open this .jar   and I can't download it ðŸ˜’  
    • Add crash-reports with sites like https://mclo.gs/ Remove the mod dashloader
    • java.lang.ExceptionInInitializerError     at knot//net.minecraft.class_3304.handler$znk000$dashloader$reloadDash(class_3304.java:1055)     at knot//net.minecraft.class_3304.method_18232(class_3304.java:47)     at knot//net.minecraft.class_310.<init>(class_310.java:652)     at knot//net.minecraft.client.main.Main.main(Main.java:211)     at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:480)     at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)     at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) Caused by: dev.quantumfusion.hyphen.thr.HyphenException:  Cause: net.minecraft.class_804.<init>(org.joml.Vector3f,org.joml.Vector3f,org.joml.Vector3f,org.joml.Vector3f)Suggestion: Check if the constructor holds all of the fields. Object Stacktrace:     in class_804_<@DataNullablenull>     at field thirdPersonLeftHand in DashModelTransformation_<@DataNullablenull>     at field transformation in DashBasicBakedModel Stacktrace:     at knot//dev.quantumfusion.hyphen.codegen.def.ClassDef.scan(ClassDef.java:80)     at knot//dev.quantumfusion.hyphen.SerializerHandler.acquireDef(SerializerHandler.java:114)     at knot//dev.quantumfusion.hyphen.codegen.def.ClassDef.scan(ClassDef.java:39)     at knot//dev.quantumfusion.hyphen.SerializerHandler.acquireDef(SerializerHandler.java:114)     at knot//dev.quantumfusion.hyphen.codegen.def.ClassDef.scan(ClassDef.java:39)     at knot//dev.quantumfusion.hyphen.SerializerHandler.scan(SerializerHandler.java:164)     at knot//dev.quantumfusion.hyphen.SerializerHandler.build(SerializerHandler.java:171)     at knot//dev.quantumfusion.hyphen.SerializerFactory.build(SerializerFactory.java:181)     at knot//dev.notalpha.dashloader.io.Serializer.<init>(Serializer.java:31)     at knot//dev.notalpha.dashloader.io.RegistrySerializer.<init>(RegistrySerializer.java:46)     at knot//dev.notalpha.dashloader.CacheImpl.<init>(CacheImpl.java:52)     at knot//dev.notalpha.dashloader.CacheFactoryImpl.build(CacheFactoryImpl.java:74)     at knot//dev.notalpha.dashloader.client.DashLoaderClient.<clinit>(DashLoaderClient.java:44)     ... 7 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Render thread Stacktrace:     at knot//net.minecraft.class_3304.handler$znk000$dashloader$reloadDash(class_3304.java:1055)     at knot//net.minecraft.class_3304.method_18232(class_3304.java:47)     at knot//net.minecraft.class_310.<init>(class_310.java:652) -- Initialization -- Details:     Modules:          ADVAPI32.dll:Advanced Windows 32 Base API:10.0.26100.3624 (WinBuild.160101.0800):Microsoft Corporation         COMCTL32.dll:User Experience Controls Library:6.10 (WinBuild.160101.0800):Microsoft Corporation         CRYPT32.dll:Crypto API32:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         CRYPTBASE.dll:Base cryptographic API DLL:10.0.26100.4652 (WinBuild.160101.0800):Microsoft Corporation         CRYPTSP.dll:Cryptographic Service Provider API:10.0.26100.4652 (WinBuild.160101.0800):Microsoft Corporation         CoreMessaging.dll:Microsoft CoreMessaging Dll:10.0.26100.4202 (WinBuild.160101.0800):Microsoft Corporation         DBGHELP.DLL:Windows Image Helper:10.0.26100.4202 (WinBuild.160101.0800):Microsoft Corporation         DEVOBJ.dll:Device Information Set DLL:10.0.26100.1150 (WinBuild.160101.0800):Microsoft Corporation         DNSAPI.dll:DNS Client API DLL:10.0.26100.1591 (WinBuild.160101.0800):Microsoft Corporation         GDI32.dll:GDI Client DLL:10.0.26100.4484 (WinBuild.160101.0800):Microsoft Corporation         GLU32.dll:OpenGL Utility Library DLL:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         HID.DLL:Hid User Library:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         IMM32.DLL:Multi-User Windows IMM32 API Client DLL:10.0.26100.4484 (WinBuild.160101.0800):Microsoft Corporation         IPHLPAPI.DLL:IP Helper API:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         IntelControlLib.dll:Intel Graphics Control Lib Runtime:1.0.200:         KERNEL32.DLL:Windows NT BASE API Client DLL:10.0.26100.4484 (WinBuild.160101.0800):Microsoft Corporation         KERNELBASE.dll:Windows NT BASE API Client DLL:10.0.26100.4484 (WinBuild.160101.0800):Microsoft Corporation         MMDevApi.dll:MMDevice API:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         MSASN1.dll:ASN.1 Runtime APIs:10.0.26100.4652 (WinBuild.160101.0800):Microsoft Corporation         MSCTF.dll:MSCTF Server DLL:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         MessageBus.dll:NVIDIA Message Bus::NVIDIA Corporation         Microsoft.Internal.WarpPal.dll         MpOav.dll:IOfficeAntiVirus Module:4.18.25050.5 (bcf51ab773be21957c5713cae9cb3adf2fd75bf5):Microsoft Corporation         NSI.dll:NSI User-mode interface DLL:10.0.26100.4652 (WinBuild.160101.0800):Microsoft Corporation         NTASN1.dll:Microsoft ASN.1 API:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         NvCamera64.dll:Camera control and photo capture:7.1.0.0:NVIDIA Corporation         NvMessageBus.dll:NVIDIA Message Bus::NVIDIA Corporation         OLEAUT32.dll:OLEAUT32.DLL:10.0.26100.4484 (WinBuild.160101.0800):Microsoft Corporation         OWExplorer.dll:Overlay:2.2.276.1:Overwolf LTD         Ole32.dll:Microsoft OLE for Windows:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         OpenAL.dll:Main implementation library:1.21.1:         POWRPROF.dll:Power Profile Helper DLL:10.0.26100.4202 (WinBuild.160101.0800):Microsoft Corporation         PSAPI.DLL:Process Status Helper:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         Pdh.dll:Windows Performance Data Helper DLL:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         RPCRT4.dll:Remote Procedure Call Runtime:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         SETUPAPI.dll:Windows Setup API:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         SHCORE.dll:SHCORE:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         SHELL32.dll:Windows Shell Common Dll:10.0.26100.4202 (WinBuild.160101.0800):Microsoft Corporation         UMPDC.dll:User Mode Power Dependency Coordinator:10.0.26100.1301 (WinBuild.160101.0800):Microsoft Corporation         USER32.dll:Multi-User Windows USER API Client DLL:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         USERENV.dll:Userenv:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         VCRUNTIME140.dll:Microsoft® C Runtime Library:14.38.33135.0:Microsoft Corporation         VERSION.dll:Version Checking and File Installation Libraries:10.0.26100.1150 (WinBuild.160101.0800):Microsoft Corporation         WINHTTP.dll:Windows HTTP Services:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         WINMM.dll:MCI API DLL:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         WINSTA.dll:Winstation Library:10.0.26100.4484 (WinBuild.160101.0800):Microsoft Corporation         WINTRUST.dll:Microsoft Trust Verification APIs:10.0.26100.4652 (WinBuild.160101.0800):Microsoft Corporation         WS2_32.dll:Windows Socket 2.0 32-Bit DLL:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         WTSAPI32.dll:Windows Remote Desktop Session Host Server SDK APIs:10.0.26100.4484 (WinBuild.160101.0800):Microsoft Corporation         WindowsCodecs.dll:Microsoft Windows Codecs Library:10.0.26100.4652 (WinBuild.160101.0800):Microsoft Corporation         XINPUT9_1_0.dll:XNA Common Controller:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         amsi.dll:Anti-Malware Scan Interface:10.0.26100.1150 (WinBuild.160101.0800):Microsoft Corporation         apphelp.dll:Application Compatibility Client Library:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         bcrypt.dll:Windows Cryptographic Primitives Library:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         bcryptPrimitives.dll:Windows Cryptographic Primitives Library:10.0.26100.4652 (WinBuild.160101.0800):Microsoft Corporation         cfgmgr32.dll:Configuration Manager DLL:10.0.26100.4202 (WinBuild.160101.0800):Microsoft Corporation         clbcatq.dll:COM+ Configuration Catalog:2001.12.10941.16384 (WinBuild.160101.0800):Microsoft Corporation         combase.dll:Microsoft COM for Windows:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         cryptnet.dll:Crypto Network Related API:10.0.26100.3624 (WinBuild.160101.0800):Microsoft Corporation         d3d11.dll:Direct3D 11 Runtime:10.0.26100.4484 (WinBuild.160101.0800):Microsoft Corporation         d3dcompiler_47_64.dll:Direct3D HLSL Compiler for Redistribution:6.3.9600.16384 (winblue_rtm.130821-1623):Microsoft Corporation         dbgcore.DLL:Windows Core Debugging Helpers:10.0.26100.4484 (WinBuild.160101.0800):Microsoft Corporation         dcomp.dll:Microsoft DirectComposition Library:10.0.26100.4484 (WinBuild.160101.0800):Microsoft Corporation         dhcpcsvc.DLL:DHCP Client Service:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         dhcpcsvc6.DLL:DHCPv6 Client:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         dinput8.dll:Microsoft DirectInput:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         directxdatabasehelper.dll:DirectXDatabaseHelper:10.0.26100.4484 (WinBuild.160101.0800):Microsoft Corporation         drvstore.dll:Driver Store API:10.0.26100.4484 (WinBuild.160101.0800):Microsoft Corporation         dwmapi.dll:Microsoft Desktop Window Manager API:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         dxcore.dll:DXCore:10.0.26100.4484 (WinBuild.160101.0800):Microsoft Corporation         dxgi.dll:DirectX Graphics Infrastructure:10.0.26100.4652 (WinBuild.160101.0800):Microsoft Corporation         extnet.dll:OpenJDK Platform binary:17.0.15.0:Microsoft         fastprox.dll:WMI Custom Marshaller:10.0.26100.3624 (WinBuild.160101.0800):Microsoft Corporation         fwpuclnt.dll:FWP/IPsec User-Mode API:10.0.26100.3915 (WinBuild.160101.0800):Microsoft Corporation         gdi32full.dll:GDI Client DLL:10.0.26100.4652 (WinBuild.160101.0800):Microsoft Corporation         glfw.dll:GLFW 3.4.0 DLL:3.4.0:GLFW         gpapi.dll:Group Policy Client API:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         icm32.dll:Microsoft Color Management Module (CMM):10.0.26100.2314 (WinBuild.160101.0800):Microsoft Corporation         igc1464.dll:Intel Graphics Shader Compiler for Intel(R) Graphics Accelerator:31.0.101.5592:Intel Corporation         igc64.dll:Intel Graphics Shader Compiler for Intel(R) Graphics Accelerator:31.0.101.5592:Intel Corporation         igd10iumd64.dll:User Mode Driver for Intel(R) Graphics Technology:31.0.101.5592:Intel Corporation         igd10um64xe.DLL:User Mode Driver for Intel(R) Graphics Technology:31.0.101.5592:Intel Corporation         igdgmm64.dll:User Mode Driver for Intel(R) Graphics Technology:31.0.101.5592:Intel Corporation         imagehlp.dll:Windows NT Image Helper:10.0.26100.4202 (WinBuild.160101.0800):Microsoft Corporation         inputhost.dll:InputHost:10.0.26100.4484 (WinBuild.160101.0800):Microsoft Corporation         java.dll:OpenJDK Platform binary:17.0.15.0:Microsoft         javaw.exe:OpenJDK Platform binary:17.0.15.0:Microsoft         jemalloc.dll         jimage.dll:OpenJDK Platform binary:17.0.15.0:Microsoft         jli.dll:OpenJDK Platform binary:17.0.15.0:Microsoft         jna16049269642719639181.dll:JNA native library:6.1.4:Java(TM) Native Access (JNA)         jsvml.dll:OpenJDK Platform binary:17.0.15.0:Microsoft         jvm.dll:OpenJDK 64-Bit server VM:17.0.15.0:Microsoft         kernel.appcore.dll:AppModel API Host:10.0.26100.4202 (WinBuild.160101.0800):Microsoft Corporation         lwjgl.dll         lwjgl_opengl.dll         lwjgl_stb.dll         management.dll:OpenJDK Platform binary:17.0.15.0:Microsoft         management_ext.dll:OpenJDK Platform binary:17.0.15.0:Microsoft         mdnsNSP.dll:Bonjour Namespace Provider:3,1,0,1:Apple Inc.         mscms.dll:Microsoft Color Matching System DLL:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         msvcp140.dll:Microsoft® C Runtime Library:14.38.33135.0:Microsoft Corporation         msvcp_win.dll:Microsoft® C Runtime Library:10.0.26100.4652 (WinBuild.160101.0800):Microsoft Corporation         msvcrt.dll:Windows NT CRT DLL:7.0.26100.4652 (WinBuild.160101.0800):Microsoft Corporation         mswsock.dll:Microsoft Windows Sockets 2.0 Service Provider:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         napinsp.dll:E-mail Naming Shim Provider:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         ncrypt.dll:Windows NCrypt Router:10.0.26100.1591 (WinBuild.160101.0800):Microsoft Corporation         net.dll:OpenJDK Platform binary:17.0.15.0:Microsoft         nio.dll:OpenJDK Platform binary:17.0.15.0:Microsoft         nlansp_c.dll:NLA Namespace Service Provider DLL:10.0.26100.4484 (WinBuild.160101.0800):Microsoft Corporation         ntdll.dll:NT Layer DLL:10.0.26100.4484 (WinBuild.160101.0800):Microsoft Corporation         ntmarta.dll:Windows NT MARTA provider:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         nvapi64.dll:NVIDIA NVAPI Library, Version 566.14 :32.0.15.6614:NVIDIA Corporation         nvgpucomp64.dll:NVIDIA GPU Compiler Driver, Version 566.14 :32.0.15.6614:NVIDIA Corporation         nvldumdx.dll:NVIDIA Driver Loader, Version 566.14 :32.0.15.6614:NVIDIA Corporation         nvoglv64.dll:NVIDIA Compatible OpenGL ICD:32.0.15.6614:NVIDIA Corporation         nvppex.dll:NVIDIA Driver, Version 566.14 :32.0.15.6614:NVIDIA Corporation         nvspcap64.dll:NVIDIA Game Proxy 8FileVersion  1:11.0.4.159  8Produc:NVIDIA Corporation  L$FileDescriptio         nvwgf2umx.dll:NVIDIA D3D10 Driver, Version 566.14 :32.0.15.6614:NVIDIA Corporation         opengl32.dll:OpenGL Client DLL:10.0.26100.4484 (WinBuild.160101.0800):Microsoft Corporation         opus4j.dll         perfos.dll:Windows System Performance Objects DLL:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         pfclient.dll:SysMain Client:10.0.26100.4202 (WinBuild.160101.0800):Microsoft Corporation         profapi.dll:User Profile Basic API:10.0.26100.4484 (WinBuild.160101.0800):Microsoft Corporation         rasadhlp.dll:Remote Access AutoDial Helper:10.0.26100.1150 (WinBuild.160101.0800):Microsoft Corporation         rsaenh.dll:Microsoft Enhanced Cryptographic Provider:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         sapi.dll:Speech API:5.3.29131.00 (WinBuild.160101.0800):Microsoft Corporation         sechost.dll:Host for SCM/SDDL/LSA Lookup APIs:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         shlwapi.dll:Shell Light-weight Utility Library:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         sunmscapi.dll:OpenJDK Platform binary:17.0.15.0:Microsoft         symamsi.dll:Symantec AMSI provider:15.7.14.32:Broadcom         textinputframework.dll:"TextInputFramework.DYNLINK":10.0.26100.4484 (WinBuild.160101.0800):Microsoft Corporation         ucrtbase.dll:Microsoft® C Runtime Library:10.0.26100.4652 (WinBuild.160101.0800):Microsoft Corporation         uxtheme.dll:Microsoft UxTheme Library:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         vcruntime140_1.dll:Microsoft® C Runtime Library:14.38.33135.0:Microsoft Corporation         verify.dll:OpenJDK Platform binary:17.0.15.0:Microsoft         wbemcomn.dll:WMI:10.0.26100.1150 (WinBuild.160101.0800):Microsoft Corporation         wbemprox.dll:WMI:10.0.26100.4202 (WinBuild.160101.0800):Microsoft Corporation         wbemsvc.dll:WMI:10.0.26100.4202 (WinBuild.160101.0800):Microsoft Corporation         win32u.dll:Win32u:10.0.26100.4652 (WinBuild.160101.0800):Microsoft Corporation         windows.staterepositorycore.dll:Windows StateRepository API Core:10.0.26100.4652 (WinBuild.160101.0800):Microsoft Corporation         windows.storage.dll:Microsoft WinRT Storage API:10.0.26100.1457 (WinBuild.160101.0800):Microsoft Corporation         winrnr.dll:LDAP RnR Provider DLL:10.0.26100.1882 (WinBuild.160101.0800):Microsoft Corporation         wintypes.dll:Windows Base Types DLL:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         wldp.dll:Windows Lockdown Policy:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         wshbth.dll:Windows Sockets Helper DLL:10.0.26100.4061 (WinBuild.160101.0800):Microsoft Corporation         wshunix.dll:AF_UNIX Winsock2 Helper DLL:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         xinput1_4.dll:Microsoft Common Controller API:10.0.26100.1 (WinBuild.160101.0800):Microsoft Corporation         zip.dll:OpenJDK Platform binary:17.0.15.0:Microsoft Stacktrace:     at knot//net.minecraft.client.main.Main.main(Main.java:211)     at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:480)     at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)     at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) -- System Details -- Details:     Minecraft Version: 1.20.1     Minecraft Version ID: 1.20.1     Operating System: Windows 11 (amd64) version 10.0     Java Version: 17.0.15, Microsoft     Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Microsoft     Memory: 459466240 bytes (438 MiB) / 1612709888 bytes (1538 MiB) up to 4294967296 bytes (4096 MiB)     CPUs: 12     Processor Vendor: GenuineIntel     Processor Name: 13th Gen Intel(R) Core(TM) i5-13420H     Identifier: Intel64 Family 6 Model 186 Stepping 2     Microarchitecture: unknown     Frequency (GHz): 2.61     Number of physical packages: 1     Number of physical CPUs: 8     Number of logical CPUs: 12     Graphics card #0 name: Intel(R) UHD Graphics     Graphics card #0 vendor: Intel Corporation (0x8086)     Graphics card #0 VRAM (MB): 2048.00     Graphics card #0 deviceId: 0xa7a8     Graphics card #0 versionInfo: DriverVersion=31.0.101.5592     Graphics card #1 name: NVIDIA GeForce RTX 4050 Laptop GPU     Graphics card #1 vendor: NVIDIA (0x10de)     Graphics card #1 VRAM (MB): 4095.00     Graphics card #1 deviceId: 0x28a1     Graphics card #1 versionInfo: DriverVersion=32.0.15.6614     Memory slot #0 capacity (MB): 8192.00     Memory slot #0 clockSpeed (GHz): 3.20     Memory slot #0 type: DDR4     Memory slot #1 capacity (MB): 8192.00     Memory slot #1 clockSpeed (GHz): 3.20     Memory slot #1 type: DDR4     Virtual memory max (MB): 28382.02     Virtual memory used (MB): 27525.00     Swap memory total (MB): 12294.35     Swap memory used (MB): 1504.46     JVM Flags: 4 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -Xmx4096m -Xms256m     Fabric Mods:          appleskin: AppleSkin 2.5.1+mc1.20         architectury: Architectury 9.2.14         bettervillage: Better village 3.3.1         citresewn: CIT Resewn 1.2.2+1.20.1             citresewn-defaults: CIT Resewn: Defaults 1.2.2+1.20.1         cloth-config: Cloth Config v11 11.1.136             cloth-basic-math: cloth-basic-math 0.6.1         continuity: Continuity 3.0.0+1.20.1         create: Create 0.5.1-j-build.1631+mc1.20.1             com_google_code_findbugs_jsr305: jsr305 3.0.2             flywheel: Flywheel 0.6.11-4             forgeconfigapiport: Forge Config API Port 8.0.0             milk: Milk Lib 1.2.60                 dripstone_fluid_lib: Dripstone Fluid Lib 3.0.2             porting_lib_accessors: Porting Lib Accessors 2.3.8+1.20.1             porting_lib_base: Porting Lib Base 2.3.8+1.20.1                 porting_lib_attributes: Porting Lib Attributes 2.3.8+1.20.1                 porting_lib_common: Porting Lib Common 2.3.8+1.20.1                 porting_lib_gui_utils: Porting Lib Gui Utils 2.3.8+1.20.1                 porting_lib_utility: Porting Lib Utility 2.3.8+1.20.1             porting_lib_brewing: Porting Lib Brewing 2.3.8+1.20.1             porting_lib_client_events: Porting Lib Client Events 2.3.8+1.20.1                 porting_lib_core: Porting Lib Core 2.3.8+1.20.1             porting_lib_entity: Porting Lib Entity 2.3.8+1.20.1                 porting_lib_mixin_extensions: Porting Lib Mixin Extensions 2.3.8+1.20.1             porting_lib_extensions: Porting Lib Extensions 2.3.8+1.20.1             porting_lib_models: Porting Lib Models 2.3.8+1.20.1                 porting_lib_fluids: Porting Lib Fluids 2.3.8+1.20.1                 porting_lib_model_loader: Porting Lib Model Loader 2.3.8+1.20.1             porting_lib_networking: Porting Lib Networking 2.3.8+1.20.1             porting_lib_obj_loader: Porting Lib Obj Loader 2.3.8+1.20.1             porting_lib_tags: Porting Lib Tags 3.0             porting_lib_tool_actions: Porting Lib Tool Actions 2.3.8+1.20.1             porting_lib_transfer: Porting Lib Transfer 2.3.8+1.20.1             reach-entity-attributes: Reach Entity Attributes 2.4.0             registrate-fabric: Registrate for Fabric 1.3.79-MC1.20.1                 porting_lib_data: Porting Lib Data 2.1.1090+1.20                     porting_lib_gametest: Porting Lib GameTest 2.1.1090+1.20                 porting_lib_model_generators: Porting Lib Model Generators 2.1.1090+1.20                     porting_lib_model_materials: Porting Lib Model Materials 2.1.1090+1.20         createdeco: Create Deco 2.0.2-1.20.1-fabric         cupboard: cupboard 1.20.1-2.7         dashloader: DashLoader 5.0.0-beta.2+1.20.0             com_github_luben_zstd-jni: zstd-jni 1.5.2-2             dev_notalpha_taski: Taski 2.1.0             dev_quantumfusion_hyphen: Hyphen 0.4.0-rc.3         ecologics: Ecologics 2.2.2         entityculling: EntityCulling 1.8.1             transition: TRansition 1.0.3             trender: TRender 1.0.5         fabric-api: Fabric API 0.92.6+1.20.1             fabric-api-base: Fabric API Base 0.4.32+1802ada577             fabric-api-lookup-api-v1: Fabric API Lookup API (v1) 1.6.37+1802ada577             fabric-biome-api-v1: Fabric Biome API (v1) 13.0.14+1802ada577             fabric-block-api-v1: Fabric Block API (v1) 1.0.12+1802ada577             fabric-block-view-api-v2: Fabric BlockView API (v2) 1.0.3+924f046a77             fabric-blockrenderlayer-v1: Fabric BlockRenderLayer Registration (v1) 1.1.42+1802ada577             fabric-client-tags-api-v1: Fabric Client Tags 1.1.3+1802ada577             fabric-command-api-v1: Fabric Command API (v1) 1.2.35+f71b366f77             fabric-command-api-v2: Fabric Command API (v2) 2.2.14+1802ada577             fabric-commands-v0: Fabric Commands (v0) 0.2.52+df3654b377             fabric-containers-v0: Fabric Containers (v0) 0.1.67+df3654b377             fabric-content-registries-v0: Fabric Content Registries (v0) 4.0.13+1802ada577             fabric-convention-tags-v1: Fabric Convention Tags 1.5.6+1802ada577             fabric-crash-report-info-v1: Fabric Crash Report Info (v1) 0.2.20+1802ada577             fabric-data-attachment-api-v1: Fabric Data Attachment API (v1) 1.0.2+de0fd6d177             fabric-data-generation-api-v1: Fabric Data Generation API (v1) 12.3.7+1802ada577             fabric-dimensions-v1: Fabric Dimensions API (v1) 2.1.55+1802ada577             fabric-entity-events-v1: Fabric Entity Events (v1) 1.6.1+1c78457f77             fabric-events-interaction-v0: Fabric Events Interaction (v0) 0.6.5+13a40c6677             fabric-events-lifecycle-v0: Fabric Events Lifecycle (v0) 0.2.64+df3654b377             fabric-game-rule-api-v1: Fabric Game Rule API (v1) 1.0.41+1802ada577             fabric-item-api-v1: Fabric Item API (v1) 2.1.29+1802ada577             fabric-item-group-api-v1: Fabric Item Group API (v1) 4.0.14+1802ada577             fabric-key-binding-api-v1: Fabric Key Binding API (v1) 1.0.38+1802ada577             fabric-keybindings-v0: Fabric Key Bindings (v0) 0.2.36+df3654b377             fabric-lifecycle-events-v1: Fabric Lifecycle Events (v1) 2.2.23+1802ada577             fabric-loot-api-v2: Fabric Loot API (v2) 1.2.3+1802ada577             fabric-loot-tables-v1: Fabric Loot Tables (v1) 1.1.47+9e7660c677             fabric-message-api-v1: Fabric Message API (v1) 5.1.10+1802ada577             fabric-mining-level-api-v1: Fabric Mining Level API (v1) 2.1.52+1802ada577             fabric-model-loading-api-v1: Fabric Model Loading API (v1) 1.0.4+1802ada577             fabric-models-v0: Fabric Models (v0) 0.4.3+9386d8a777             fabric-networking-api-v1: Fabric Networking API (v1) 1.3.14+a158aa0477             fabric-networking-v0: Fabric Networking (v0) 0.3.54+df3654b377             fabric-object-builder-api-v1: Fabric Object Builder API (v1) 11.1.5+e35120df77             fabric-particles-v1: Fabric Particles (v1) 1.1.3+1802ada577             fabric-recipe-api-v1: Fabric Recipe API (v1) 1.0.24+1802ada577             fabric-registry-sync-v0: Fabric Registry Sync (v0) 2.3.6+1802ada577             fabric-renderer-api-v1: Fabric Renderer API (v1) 3.2.2+1802ada577             fabric-renderer-indigo: Fabric Renderer - Indigo 1.5.3+85287f9f77             fabric-renderer-registries-v1: Fabric Renderer Registries (v1) 3.2.47+df3654b377             fabric-rendering-data-attachment-v1: Fabric Rendering Data Attachment (v1) 0.3.39+92a0d36777             fabric-rendering-fluids-v1: Fabric Rendering Fluids (v1) 3.0.29+1802ada577             fabric-rendering-v0: Fabric Rendering (v0) 1.1.50+df3654b377             fabric-rendering-v1: Fabric Rendering (v1) 3.0.9+1802ada577             fabric-resource-conditions-api-v1: Fabric Resource Conditions API (v1) 2.3.9+1802ada577             fabric-resource-loader-v0: Fabric Resource Loader (v0) 0.11.12+fb82e9d777             fabric-screen-api-v1: Fabric Screen API (v1) 2.0.9+1802ada577             fabric-screen-handler-api-v1: Fabric Screen Handler API (v1) 1.3.33+1802ada577             fabric-sound-api-v1: Fabric Sound API (v1) 1.0.14+1802ada577             fabric-transfer-api-v1: Fabric Transfer API (v1) 3.3.6+8dd72ea377             fabric-transitive-access-wideners-v1: Fabric Transitive Access Wideners (v1) 4.3.2+1802ada577         fabricloader: Fabric Loader 0.16.14             mixinextras: MixinExtras 0.4.1         farmersdelight: Farmer's Delight 1.20.1-2.4.0+refabricated             mm: Manningham Mills 2.3             porting_lib_config: Porting Lib Config 2.3.8+1.20.1             porting_lib_lazy_registration: Porting Lib Lazy Register 2.3.8+1.20.1             porting_lib_loot: Porting Lib Loot 2.3.8+1.20.1             porting_lib_recipe_book_categories: Porting Lib Recipe Book Categories 2.3.8+1.20.1         farsight: Farsight Mod 1.20.1-4.3             org_jctools_jctools-core: jctools-core 4.0.1         handcrafted: Handcrafted 3.0.6         immediatelyfast: ImmediatelyFast 1.5.1+1.20.4             net_lenni0451_reflect: Reflect 1.3.4         indium: Indium 1.0.36+mc1.20.1         iris: Iris 1.7.6+mc1.20.1             io_github_douira_glsl-transformer: glsl-transformer 2.0.1             org_anarres_jcpp: jcpp 1.4.14             org_antlr_antlr4-runtime: antlr4-runtime 4.13.1         java: OpenJDK 64-Bit Server VM 17         lambdynlights: LambDynamicLights 4.1.3+1.20.1             lambdynlights_api: LambDynamicLights (API) 4.1.3+1.20.1                 yumi-commons-collections: Yumi Commons: Collections 1.0.0-alpha.12                 yumi-commons-core: Yumi Commons: Core 1.0.0-alpha.12                 yumi-commons-event: Yumi Commons: Event 1.0.0-alpha.12             pride: Pride Lib 1.2.0+1.19.4             spruceui: SpruceUI 6.2.1+1.20         libraryferret: Library ferret 4.0.0         litematica: Litematica 0.15.4         lithium: Lithium 0.11.3         malilib: MaLiLib 0.16.3         minecraft: Minecraft 1.20.1         modmenu: Mod Menu 7.2.2         moonlight: Moonlight 1.20-2.14.13         no_fog: No Fog 1.3.6+1.16.5-1.21         railways: Create: Steam 'n' Rails 1.6.9+fabric-mc1.20.1         regions_unexplored: Regions Unexplored 0.5.6+1.20.1         resourcefullib: Resourceful Lib 2.1.29             com_teamresourceful_bytecodecs: bytecodecs 1.0.2             com_teamresourceful_yabn: yabn 1.0.3         sodium: Sodium 0.5.13+mc1.20.1         sound_physics_remastered: Sound Physics Remastered 1.20.1-1.4.12         starlight: Starlight 1.1.2+fabric.dbc156f         supplementaries: Supplementaries 1.20-3.1.36             mixinsquared: MixinSquared 0.1.1         terrablender: TerraBlender 3.0.1.10             com_electronwill_night-config_core: core 3.6.7             com_electronwill_night-config_toml: toml 3.6.7         twigs: Twigs 3.1.0         voicechat: Simple Voice Chat 1.20.1-2.5.34     Loaded Shaderpack: (off)     Flywheel Backend: Uninitialized     Launched Version: fabric-loader-0.16.14-1.20.1     Backend library: LWJGL version 3.3.1 SNAPSHOT     Backend API: NVIDIA GeForce RTX 4050 Laptop GPU/PCIe/SSE2 GL version 3.2.0 NVIDIA 566.14, NVIDIA Corporation     Window size: <not initialized>     GL Caps: Using framebuffer using OpenGL 3.2     GL debug messages:      Using VBOs: Yes     Is Modded: Definitely; Client brand changed to 'fabric'     Type: Client (map_client.txt)     CPU: 12x 13th Gen Intel(R) Core(TM) i5-13420H
    • mclo only shows 25000 lines - add the rest with another link
  • Topics

×
×
  • Create New...

Important Information

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