Jump to content

Custom Dragon[Solved]


SilasOtoko

Recommended Posts

I'm working on what is basically a copy of the EnderDragon, except I will give it a new texture and have it spit out fire at the player, but I can't seem to get the dragon Model to render in the game. It exists in the game, and attacks the animals in the area, but it is invisible. I've successfully created other custom mobs that work fine, but I'm assuming the Dragon takes more work since it has so many parts to it. Any help in what is required to render a multi-part mob? Here is the Entity and Render code for the dragon, and don't judge on it, I haven't cleaned it up yet until I can get it to show up and then I can customize it more as well.

 

Entity

import java.util.Iterator;
import java.util.List;

import net.minecraft.block.Block;
import net.minecraft.block.BlockEndPortal;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.IEntityMultiPart;
import net.minecraft.entity.boss.EntityDragonPart;
import net.minecraft.entity.boss.IBossDisplayData;
import net.minecraft.entity.item.EntityEnderCrystal;
import net.minecraft.entity.item.EntityXPOrb;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class EntityFireDragon extends EntityLiving implements IEntityMultiPart
{
    public double targetX;
    public double targetY;
    public double targetZ;

    /**
     * Ring buffer array for the last 64 Y-positions and yaw rotations. Used to calculate offsets for the animations.
     */
    public double[][] ringBuffer = new double[64][3];

    /**
     * Index into the ring buffer. Incremented once per tick and restarts at 0 once it reaches the end of the buffer.
     */
    public int ringBufferIndex = -1;

    /** An array containing all body parts of this dragon */
    public EntityDragonPart[] dragonPartArray;

    /** The head bounding box of a dragon */
    public EntityDragonPart dragonPartHead;

    /** The body bounding box of a dragon */
    public EntityDragonPart dragonPartBody;
    public EntityDragonPart dragonPartTail1;
    public EntityDragonPart dragonPartTail2;
    public EntityDragonPart dragonPartTail3;
    public EntityDragonPart dragonPartWing1;
    public EntityDragonPart dragonPartWing2;

    /** Animation time at previous tick. */
    public float prevAnimTime = 0.0F;

    /**
     * Animation time, used to control the speed of the animation cycles (wings flapping, jaw opening, etc.)
     */
    public float animTime = 0.0F;

    /** Force selecting a new flight target at next tick if set to true. */
    public boolean forceNewTarget = false;

    /**
     * Activated if the dragon is flying though obsidian, white stone or bedrock. Slows movement and animation speed.
     */
    public boolean slowed = false;
    private Entity target;
    public int deathTicks = 0;

    public EntityFireDragon(World par1World)
    {
        super(par1World);
        this.dragonPartArray = new EntityDragonPart[] {this.dragonPartHead = new EntityDragonPart(this, "head", 6.0F, 6.0F), this.dragonPartBody = new EntityDragonPart(this, "body", 8.0F, 8.0F), this.dragonPartTail1 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), this.dragonPartTail2 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), this.dragonPartTail3 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), this.dragonPartWing1 = new EntityDragonPart(this, "wing", 4.0F, 4.0F), this.dragonPartWing2 = new EntityDragonPart(this, "wing", 4.0F, 4.0F)};
        this.setEntityHealth(this.getMaxHealth());
        this.texture = "/mob/enderdragon/ender.png";
        this.setSize(16.0F, 8.0F);
        this.noClip = true;
        this.isImmuneToFire = true;
        this.targetY = 100.0D;
        this.ignoreFrustumCheck = true;
    }

    public int getMaxHealth()
    {
        return 100;
    }

    protected void entityInit()
    {
        super.entityInit();
        this.dataWatcher.addObject(16, new Integer(this.getMaxHealth()));
    }

    /**
     * Returns a double[3] array with movement offsets, used to calculate trailing tail/neck positions. [0] = yaw
     * offset, [1] = y offset, [2] = unused, always 0. Parameters: buffer index offset, partial ticks.
     */
    public double[] getMovementOffsets(int par1, float par2)
    {
        if (this.health <= 0)
        {
            par2 = 0.0F;
        }

        par2 = 1.0F - par2;
        int j = this.ringBufferIndex - par1 * 1 & 63;
        int k = this.ringBufferIndex - par1 * 1 - 1 & 63;
        double[] adouble = new double[3];
        double d0 = this.ringBuffer[j][0];
        double d1 = MathHelper.wrapAngleTo180_double(this.ringBuffer[k][0] - d0);
        adouble[0] = d0 + d1 * (double)par2;
        d0 = this.ringBuffer[j][1];
        d1 = this.ringBuffer[k][1] - d0;
        adouble[1] = d0 + d1 * (double)par2;
        adouble[2] = this.ringBuffer[j][2] + (this.ringBuffer[k][2] - this.ringBuffer[j][2]) * (double)par2;
        return adouble;
    }

    /**
     * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons
     * use this to react to sunlight and start to burn.
     */
    public void onLivingUpdate()
    {
        float f;
        float f1;

        if (!this.worldObj.isRemote)
        {
            this.dataWatcher.updateObject(16, Integer.valueOf(this.health));
        }
        else
        {
            f = MathHelper.cos(this.animTime * (float)Math.PI * 2.0F);
            f1 = MathHelper.cos(this.prevAnimTime * (float)Math.PI * 2.0F);

            if (f1 <= -0.3F && f >= -0.3F)
            {
                this.worldObj.playSound(this.posX, this.posY, this.posZ, "mob.enderdragon.wings", 5.0F, 0.8F + this.rand.nextFloat() * 0.3F, false);
            }
        }

        this.prevAnimTime = this.animTime;
        float f2;

        if (this.health <= 0)
        {
            f = (this.rand.nextFloat() - 0.5F) * 8.0F;
            f1 = (this.rand.nextFloat() - 0.5F) * 4.0F;
            f2 = (this.rand.nextFloat() - 0.5F) * 8.0F;
            this.worldObj.spawnParticle("largeexplode", this.posX + (double)f, this.posY + 2.0D + (double)f1, this.posZ + (double)f2, 0.0D, 0.0D, 0.0D);
        }
        else
        {
            
            f = 0.2F / (MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ) * 10.0F + 1.0F);
            f *= (float)Math.pow(2.0D, this.motionY);

            if (this.slowed)
            {
                this.animTime += f * 0.5F;
            }
            else
            {
                this.animTime += f;
            }

            this.rotationYaw = MathHelper.wrapAngleTo180_float(this.rotationYaw);

            if (this.ringBufferIndex < 0)
            {
                for (int i = 0; i < this.ringBuffer.length; ++i)
                {
                    this.ringBuffer[i][0] = (double)this.rotationYaw;
                    this.ringBuffer[i][1] = this.posY;
                }
            }

            if (++this.ringBufferIndex == this.ringBuffer.length)
            {
                this.ringBufferIndex = 0;
            }

            this.ringBuffer[this.ringBufferIndex][0] = (double)this.rotationYaw;
            this.ringBuffer[this.ringBufferIndex][1] = this.posY;
            double d0;
            double d1;
            double d2;
            double d3;
            float f3;

            if (this.worldObj.isRemote)
            {
                if (this.newPosRotationIncrements > 0)
                {
                    d3 = this.posX + (this.newPosX - this.posX) / (double)this.newPosRotationIncrements;
                    d0 = this.posY + (this.newPosY - this.posY) / (double)this.newPosRotationIncrements;
                    d1 = this.posZ + (this.newPosZ - this.posZ) / (double)this.newPosRotationIncrements;
                    d2 = MathHelper.wrapAngleTo180_double(this.newRotationYaw - (double)this.rotationYaw);
                    this.rotationYaw = (float)((double)this.rotationYaw + d2 / (double)this.newPosRotationIncrements);
                    this.rotationPitch = (float)((double)this.rotationPitch + (this.newRotationPitch - (double)this.rotationPitch) / (double)this.newPosRotationIncrements);
                    --this.newPosRotationIncrements;
                    this.setPosition(d3, d0, d1);
                    this.setRotation(this.rotationYaw, this.rotationPitch);
                }
            }
            else
            {
                d3 = this.targetX - this.posX;
                d0 = this.targetY - this.posY;
                d1 = this.targetZ - this.posZ;
                d2 = d3 * d3 + d0 * d0 + d1 * d1;

                if (this.target != null)
                {
                    this.targetX = this.target.posX;
                    this.targetZ = this.target.posZ;
                    double d4 = this.targetX - this.posX;
                    double d5 = this.targetZ - this.posZ;
                    double d6 = Math.sqrt(d4 * d4 + d5 * d5);
                    double d7 = 0.4000000059604645D + d6 / 80.0D - 1.0D;

                    if (d7 > 10.0D)
                    {
                        d7 = 10.0D;
                    }

                    this.targetY = this.target.boundingBox.minY + d7;
                }
                else
                {
                    this.targetX += this.rand.nextGaussian() * 2.0D;
                    this.targetZ += this.rand.nextGaussian() * 2.0D;
                }

                if (this.forceNewTarget || d2 < 100.0D || d2 > 22500.0D || this.isCollidedHorizontally || this.isCollidedVertically)
                {
                    this.setNewTarget();
                }

                d0 /= (double)MathHelper.sqrt_double(d3 * d3 + d1 * d1);
                f3 = 0.6F;

                if (d0 < (double)(-f3))
                {
                    d0 = (double)(-f3);
                }

                if (d0 > (double)f3)
                {
                    d0 = (double)f3;
                }

                this.motionY += d0 * 0.10000000149011612D;
                this.rotationYaw = MathHelper.wrapAngleTo180_float(this.rotationYaw);
                double d8 = 180.0D - Math.atan2(d3, d1) * 180.0D / Math.PI;
                double d9 = MathHelper.wrapAngleTo180_double(d8 - (double)this.rotationYaw);

                if (d9 > 50.0D)
                {
                    d9 = 50.0D;
                }

                if (d9 < -50.0D)
                {
                    d9 = -50.0D;
                }

                Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.targetX - this.posX, this.targetY - this.posY, this.targetZ - this.posZ).normalize();
                Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool((double)MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F), this.motionY, (double)(-MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F))).normalize();
                float f4 = (float)(vec31.dotProduct(vec3) + 0.5D) / 1.5F;

                if (f4 < 0.0F)
                {
                    f4 = 0.0F;
                }

                this.randomYawVelocity *= 0.8F;
                float f5 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ) * 1.0F + 1.0F;
                double d10 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ) * 1.0D + 1.0D;

                if (d10 > 40.0D)
                {
                    d10 = 40.0D;
                }

                this.randomYawVelocity = (float)((double)this.randomYawVelocity + d9 * (0.699999988079071D / d10 / (double)f5));
                this.rotationYaw += this.randomYawVelocity * 0.1F;
                float f6 = (float)(2.0D / (d10 + 1.0D));
                float f7 = 0.06F;
                this.moveFlying(0.0F, -1.0F, f7 * (f4 * f6 + (1.0F - f6)));

                if (this.slowed)
                {
                    this.moveEntity(this.motionX * 0.800000011920929D, this.motionY * 0.800000011920929D, this.motionZ * 0.800000011920929D);
                }
                else
                {
                    this.moveEntity(this.motionX, this.motionY, this.motionZ);
                }

                Vec3 vec32 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.motionX, this.motionY, this.motionZ).normalize();
                float f8 = (float)(vec32.dotProduct(vec31) + 1.0D) / 2.0F;
                f8 = 0.8F + 0.15F * f8;
                this.motionX *= (double)f8;
                this.motionZ *= (double)f8;
                this.motionY *= 0.9100000262260437D;
            }

            this.renderYawOffset = this.rotationYaw;
            this.dragonPartHead.width = this.dragonPartHead.height = 3.0F;
            this.dragonPartTail1.width = this.dragonPartTail1.height = 2.0F;
            this.dragonPartTail2.width = this.dragonPartTail2.height = 2.0F;
            this.dragonPartTail3.width = this.dragonPartTail3.height = 2.0F;
            this.dragonPartBody.height = 3.0F;
            this.dragonPartBody.width = 5.0F;
            this.dragonPartWing1.height = 2.0F;
            this.dragonPartWing1.width = 4.0F;
            this.dragonPartWing2.height = 3.0F;
            this.dragonPartWing2.width = 4.0F;
            f1 = (float)(this.getMovementOffsets(5, 1.0F)[1] - this.getMovementOffsets(10, 1.0F)[1]) * 10.0F / 180.0F * (float)Math.PI;
            f2 = MathHelper.cos(f1);
            float f9 = -MathHelper.sin(f1);
            float f10 = this.rotationYaw * (float)Math.PI / 180.0F;
            float f11 = MathHelper.sin(f10);
            float f12 = MathHelper.cos(f10);
            this.dragonPartBody.onUpdate();
            this.dragonPartBody.setLocationAndAngles(this.posX + (double)(f11 * 0.5F), this.posY, this.posZ - (double)(f12 * 0.5F), 0.0F, 0.0F);
            this.dragonPartWing1.onUpdate();
            this.dragonPartWing1.setLocationAndAngles(this.posX + (double)(f12 * 4.5F), this.posY + 2.0D, this.posZ + (double)(f11 * 4.5F), 0.0F, 0.0F);
            this.dragonPartWing2.onUpdate();
            this.dragonPartWing2.setLocationAndAngles(this.posX - (double)(f12 * 4.5F), this.posY + 2.0D, this.posZ - (double)(f11 * 4.5F), 0.0F, 0.0F);

            if (!this.worldObj.isRemote && this.hurtTime == 0)
            {
                this.collideWithEntities(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartWing1.boundingBox.expand(4.0D, 2.0D, 4.0D).offset(0.0D, -2.0D, 0.0D)));
                this.collideWithEntities(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartWing2.boundingBox.expand(4.0D, 2.0D, 4.0D).offset(0.0D, -2.0D, 0.0D)));
                this.attackEntitiesInList(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartHead.boundingBox.expand(1.0D, 1.0D, 1.0D)));
            }

            double[] adouble = this.getMovementOffsets(5, 1.0F);
            double[] adouble1 = this.getMovementOffsets(0, 1.0F);
            f3 = MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F - this.randomYawVelocity * 0.01F);
            float f13 = MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F - this.randomYawVelocity * 0.01F);
            this.dragonPartHead.onUpdate();
            this.dragonPartHead.setLocationAndAngles(this.posX + (double)(f3 * 5.5F * f2), this.posY + (adouble1[1] - adouble[1]) * 1.0D + (double)(f9 * 5.5F), this.posZ - (double)(f13 * 5.5F * f2), 0.0F, 0.0F);

            for (int j = 0; j < 3; ++j)
            {
                EntityDragonPart entitydragonpart = null;

                if (j == 0)
                {
                    entitydragonpart = this.dragonPartTail1;
                }

                if (j == 1)
                {
                    entitydragonpart = this.dragonPartTail2;
                }

                if (j == 2)
                {
                    entitydragonpart = this.dragonPartTail3;
                }

                double[] adouble2 = this.getMovementOffsets(12 + j * 2, 1.0F);
                float f14 = this.rotationYaw * (float)Math.PI / 180.0F + this.simplifyAngle(adouble2[0] - adouble[0]) * (float)Math.PI / 180.0F * 1.0F;
                float f15 = MathHelper.sin(f14);
                float f16 = MathHelper.cos(f14);
                float f17 = 1.5F;
                float f18 = (float)(j + 1) * 2.0F;
                entitydragonpart.onUpdate();
                entitydragonpart.setLocationAndAngles(this.posX - (double)((f11 * f17 + f15 * f18) * f2), this.posY + (adouble2[1] - adouble[1]) * 1.0D - (double)((f18 + f17) * f9) + 1.5D, this.posZ + (double)((f12 * f17 + f16 * f18) * f2), 0.0F, 0.0F);
            }

        }
    }


    /**
     * Pushes all entities inside the list away from the enderdragon.
     */
    private void collideWithEntities(List par1List)
    {
        double d0 = (this.dragonPartBody.boundingBox.minX + this.dragonPartBody.boundingBox.maxX) / 2.0D;
        double d1 = (this.dragonPartBody.boundingBox.minZ + this.dragonPartBody.boundingBox.maxZ) / 2.0D;
        Iterator iterator = par1List.iterator();

        while (iterator.hasNext())
        {
            Entity entity = (Entity)iterator.next();

            if (entity instanceof EntityLiving)
            {
                double d2 = entity.posX - d0;
                double d3 = entity.posZ - d1;
                double d4 = d2 * d2 + d3 * d3;
                entity.addVelocity(d2 / d4 * 4.0D, 0.20000000298023224D, d3 / d4 * 4.0D);
            }
        }
    }

    /**
     * Attacks all entities inside this list, dealing 5 hearts of damage.
     */
    private void attackEntitiesInList(List par1List)
    {
        for (int i = 0; i < par1List.size(); ++i)
        {
            Entity entity = (Entity)par1List.get(i);

            if (entity instanceof EntityLiving)
            {
                entity.attackEntityFrom(DamageSource.causeMobDamage(this), 10);
            }
        }
    }

    /**
     * Sets a new target for the flight AI. It can be a random coordinate or a nearby player.
     */
    private void setNewTarget()
    {
        this.forceNewTarget = false;

        if (this.rand.nextInt(2) == 0 && !this.worldObj.playerEntities.isEmpty())
        {
            this.target = (Entity)this.worldObj.playerEntities.get(this.rand.nextInt(this.worldObj.playerEntities.size()));
        }
        else
        {
            boolean flag = false;

            do
            {
                this.targetX = 0.0D;
                this.targetY = (double)(70.0F + this.rand.nextFloat() * 50.0F);
                this.targetZ = 0.0D;
                this.targetX += (double)(this.rand.nextFloat() * 120.0F - 60.0F);
                this.targetZ += (double)(this.rand.nextFloat() * 120.0F - 60.0F);
                double d0 = this.posX - this.targetX;
                double d1 = this.posY - this.targetY;
                double d2 = this.posZ - this.targetZ;
                flag = d0 * d0 + d1 * d1 + d2 * d2 > 100.0D;
            }
            while (!flag);

            this.target = null;
        }
    }

    /**
     * Simplifies the value of a number by adding/subtracting 180 to the point that the number is between -180 and 180.
     */
    private float simplifyAngle(double par1)
    {
        return (float)MathHelper.wrapAngleTo180_double(par1);
    }

    public boolean attackEntityFromPart(EntityDragonPart par1EntityDragonPart, DamageSource par2DamageSource, int par3)
    {
        if (par1EntityDragonPart != this.dragonPartHead)
        {
            par3 = par3 / 4 + 1;
        }

        float f = this.rotationYaw * (float)Math.PI / 180.0F;
        float f1 = MathHelper.sin(f);
        float f2 = MathHelper.cos(f);
        this.targetX = this.posX + (double)(f1 * 5.0F) + (double)((this.rand.nextFloat() - 0.5F) * 2.0F);
        this.targetY = this.posY + (double)(this.rand.nextFloat() * 3.0F) + 1.0D;
        this.targetZ = this.posZ - (double)(f2 * 5.0F) + (double)((this.rand.nextFloat() - 0.5F) * 2.0F);
        this.target = null;

        if (par2DamageSource.getEntity() instanceof EntityPlayer || par2DamageSource.isExplosion())
        {
            this.func_82195_e(par2DamageSource, par3);
        }

        return true;
    }

    /**
     * Called when the entity is attacked.
     */
    public boolean attackEntityFrom(DamageSource par1DamageSource, int par2)
    {
        return false;
    }

    protected boolean func_82195_e(DamageSource par1DamageSource, int par2)
    {
        return super.attackEntityFrom(par1DamageSource, par2);
    }

    /**
     * handles entity death timer, experience orb and particle creation
     */
    protected void onDeathUpdate()
    {
        ++this.deathTicks;

        if (this.deathTicks >= 180 && this.deathTicks <= 200)
        {
            float f = (this.rand.nextFloat() - 0.5F) * 8.0F;
            float f1 = (this.rand.nextFloat() - 0.5F) * 4.0F;
            float f2 = (this.rand.nextFloat() - 0.5F) * 8.0F;
            this.worldObj.spawnParticle("hugeexplosion", this.posX + (double)f, this.posY + 2.0D + (double)f1, this.posZ + (double)f2, 0.0D, 0.0D, 0.0D);
        }

        int i;
        int j;

        if (!this.worldObj.isRemote)
        {
            if (this.deathTicks > 150 && this.deathTicks % 5 == 0)
            {
                i = 1000;

                while (i > 0)
                {
                    j = EntityXPOrb.getXPSplit(i);
                    i -= j;
                    this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, j));
                }
            }

            if (this.deathTicks == 1)
            {
                this.worldObj.func_82739_e(1018, (int)this.posX, (int)this.posY, (int)this.posZ, 0);
            }
        }

        this.moveEntity(0.0D, 0.10000000149011612D, 0.0D);
        this.renderYawOffset = this.rotationYaw += 20.0F;

        if (this.deathTicks == 100 && !this.worldObj.isRemote)
        {
            i = 100;

            while (i > 0)
            {
                j = EntityXPOrb.getXPSplit(i);
                i -= j;
                this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, j));
            }

           this.setDead();
        }
    }

   
    /**
     * Makes the entity despawn if requirements are reached
     */
    protected void despawnEntity() {}

    /**
     * Return the Entity parts making up this Entity (currently only for dragons)
     */
    public Entity[] getParts()
    {
        return this.dragonPartArray;
    }

    /**
     * Returns true if other Entities should be prevented from moving through this Entity.
     */
    public boolean canBeCollidedWith()
    {
        return true;
    }

    @SideOnly(Side.CLIENT)

    /**
     * Returns the health points of the dragon.
     */
    public int getBossHealth()
    {
        return this.dataWatcher.getWatchableObjectInt(16);
    }

    public World func_82194_d()
    {
        return this.worldObj;
    }

    /**
     * Returns the sound this mob makes while it's alive.
     */
    protected String getLivingSound()
    {
        return "mob.enderdragon.growl";
    }

    /**
     * Returns the sound this mob makes when it is hurt.
     */
    protected String getHurtSound()
    {
        return "mob.enderdragon.hit";
    }

    /**
     * Returns the volume for the sounds this mob makes.
     */
    protected float getSoundVolume()
    {
        return 3.0F;
    }
}

 

Render

@SideOnly(Side.CLIENT)
public class RenderFireDragon extends RenderLiving
{
    /**
     * Reloads the dragon model if not equal to 4. Presumably a leftover debugging field.
     */
    private static int updateModelState = 0;

    /** An instance of the dragon model in RenderDragon */
    protected ModelFireDragon model;

    public RenderFireDragon(ModelFireDragon par1model, float f)
    {
        super(par1model, f);
        model = (ModelFireDragon)mainModel;
        this.setRenderPassModel(this.mainModel);
    }

    /**
     * Used to rotate the dragon as a whole in RenderDragon. It's called in the rotateCorpse method.
     */
    protected void rotateDragonBody(EntityFireDragon par1EntityDragon, float par2, float par3, float par4)
    {
        float f3 = (float)par1EntityDragon.getMovementOffsets(7, par4)[0];
        float f4 = (float)(par1EntityDragon.getMovementOffsets(5, par4)[1] - par1EntityDragon.getMovementOffsets(10, par4)[1]);
        GL11.glRotatef(-f3, 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(f4 * 10.0F, 1.0F, 0.0F, 0.0F);
        GL11.glTranslatef(0.0F, 0.0F, 1.0F);

        if (par1EntityDragon.deathTime > 0)
        {
            float f5 = ((float)par1EntityDragon.deathTime + par4 - 1.0F) / 20.0F * 1.6F;
            f5 = MathHelper.sqrt_float(f5);

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

            GL11.glRotatef(f5 * this.getDeathMaxRotation(par1EntityDragon), 0.0F, 0.0F, 1.0F);
        }
    }

    /**
     * Renders the dragon model. Called by renderModel.
     */
    protected void renderFireDragonModel(EntityFireDragon par1EntityDragon, float par2, float par3, float par4, float par5, float par6, float par7)
    {
            float f6 = (float)par1EntityDragon.deathTicks / 100.0F;
            GL11.glDepthFunc(GL11.GL_LEQUAL);
            GL11.glEnable(GL11.GL_ALPHA_TEST);
            GL11.glAlphaFunc(GL11.GL_GREATER, f6);
            this.loadTexture("/mob/enderdragon/shuffle.png");
            this.mainModel.render(par1EntityDragon, par2, par3, par4, par5, par6, par7);
            GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
            GL11.glDepthFunc(GL11.GL_EQUAL);
        

        this.loadTexture(par1EntityDragon.getTexture());
        this.mainModel.render(par1EntityDragon, par2, par3, par4, par5, par6, par7);

        if (par1EntityDragon.hurtTime > 0)
        {
            GL11.glDepthFunc(GL11.GL_EQUAL);
            GL11.glDisable(GL11.GL_TEXTURE_2D);
            GL11.glEnable(GL11.GL_BLEND);
            GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
            GL11.glColor4f(1.0F, 0.0F, 0.0F, 0.5F);
            this.mainModel.render(par1EntityDragon, par2, par3, par4, par5, par6, par7);
            GL11.glEnable(GL11.GL_TEXTURE_2D);
            GL11.glDisable(GL11.GL_BLEND);
            GL11.glDepthFunc(GL11.GL_LEQUAL);
        }
    }

    /**
     * Renders the dragon, along with its dying animation
     */
    public void renderFireDragon(EntityFireDragon par1EntityDragon, double par2, double par4, double par6, float par8, float par9)
    {

        if (updateModelState != 4)
        {
            this.mainModel = new ModelFireDragon(0.0F);
            updateModelState = 4;
        }

        super.doRenderLiving(par1EntityDragon, par2, par4, par6, par8, par9);

        
    }

    /**
     * Renders the animation for when an enderdragon dies
     */
    protected void renderDragonDying(EntityFireDragon par1EntityDragon, float par2)
    {
        super.renderEquippedItems(par1EntityDragon, par2);
        Tessellator tessellator = Tessellator.instance;

        if (par1EntityDragon.deathTicks > 0)
        {
            RenderHelper.disableStandardItemLighting();
            float f1 = ((float)par1EntityDragon.deathTicks + par2) / 200.0F;
            float f2 = 0.0F;

            if (f1 > 0.8F)
            {
                f2 = (f1 - 0.8F) / 0.2F;
            }

            Random random = new Random(432L);
            GL11.glDisable(GL11.GL_TEXTURE_2D);
            GL11.glShadeModel(GL11.GL_SMOOTH);
            GL11.glEnable(GL11.GL_BLEND);
            GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
            GL11.glDisable(GL11.GL_ALPHA_TEST);
            GL11.glEnable(GL11.GL_CULL_FACE);
            GL11.glDepthMask(false);
            GL11.glPushMatrix();
            GL11.glTranslatef(0.0F, -1.0F, -2.0F);

            for (int i = 0; (float)i < (f1 + f1 * f1) / 2.0F * 60.0F; ++i)
            {
                GL11.glRotatef(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
                GL11.glRotatef(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
                GL11.glRotatef(random.nextFloat() * 360.0F, 0.0F, 0.0F, 1.0F);
                GL11.glRotatef(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
                GL11.glRotatef(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
                GL11.glRotatef(random.nextFloat() * 360.0F + f1 * 90.0F, 0.0F, 0.0F, 1.0F);
                tessellator.startDrawing(6);
                float f3 = random.nextFloat() * 20.0F + 5.0F + f2 * 10.0F;
                float f4 = random.nextFloat() * 2.0F + 1.0F + f2 * 2.0F;
                tessellator.setColorRGBA_I(16777215, (int)(255.0F * (1.0F - f2)));
                tessellator.addVertex(0.0D, 0.0D, 0.0D);
                tessellator.setColorRGBA_I(16711935, 0);
                tessellator.addVertex(-0.866D * (double)f4, (double)f3, (double)(-0.5F * f4));
                tessellator.addVertex(0.866D * (double)f4, (double)f3, (double)(-0.5F * f4));
                tessellator.addVertex(0.0D, (double)f3, (double)(1.0F * f4));
                tessellator.addVertex(-0.866D * (double)f4, (double)f3, (double)(-0.5F * f4));
                tessellator.draw();
            }

            GL11.glPopMatrix();
            GL11.glDepthMask(true);
            GL11.glDisable(GL11.GL_CULL_FACE);
            GL11.glDisable(GL11.GL_BLEND);
            GL11.glShadeModel(GL11.GL_FLAT);
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            GL11.glEnable(GL11.GL_TEXTURE_2D);
            GL11.glEnable(GL11.GL_ALPHA_TEST);
            RenderHelper.enableStandardItemLighting();
        }
    }

    /**
     * Renders the overlay for glowing eyes and the mouth. Called by shouldRenderPass.
     */
    protected int renderGlow(EntityFireDragon par1EntityDragon, int par2, float par3)
    {
        if (par2 == 1)
        {
            GL11.glDepthFunc(GL11.GL_LEQUAL);
        }

        if (par2 != 0)
        {
            return -1;
        }
        else
        {
            this.loadTexture("/mob/enderdragon/ender_eyes.png");
            float f1 = 1.0F;
            GL11.glEnable(GL11.GL_BLEND);
            GL11.glDisable(GL11.GL_ALPHA_TEST);
            GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
            GL11.glDisable(GL11.GL_LIGHTING);
            GL11.glDepthFunc(GL11.GL_EQUAL);
            char c0 = 61680;
            int j = c0 % 65536;
            int k = c0 / 65536;
            OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            GL11.glEnable(GL11.GL_LIGHTING);
            GL11.glColor4f(1.0F, 1.0F, 1.0F, f1);
            return 1;
        }
    }

    /**
     * Queries whether should render the specified pass or not.
     */
    protected int shouldRenderPass(EntityLiving par1EntityLiving, int par2, float par3)
    {
        return this.renderGlow((EntityFireDragon)par1EntityLiving, par2, par3);
    }

    protected void renderEquippedItems(EntityLiving par1EntityLiving, float par2)
    {
        this.renderDragonDying((EntityFireDragon)par1EntityLiving, par2);
    }

    protected void rotateCorpse(EntityLiving par1EntityLiving, float par2, float par3, float par4)
    {
        this.rotateDragonBody((EntityFireDragon)par1EntityLiving, par2, par3, par4);
    }

    /**
     * Renders the model in RenderLiving
     */
    @Override
    protected void renderModel(EntityLiving par1EntityLiving, float par2, float par3, float par4, float par5, float par6, float par7)
    {
        this.renderFireDragonModel((EntityFireDragon)par1EntityLiving, par2, par3, par4, par5, par6, par7);
    }

    public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9)
    {
        this.renderFireDragon((EntityFireDragon)par1EntityLiving, par2, par4, par6, par8, par9);
    }

    /**
     * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
     * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
     * (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
     * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
     */
    @Override
    public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
    {
        this.renderFireDragon((EntityFireDragon)par1Entity, par2, par4, par6, par8, par9);
    }
}

 

Link to comment
Share on other sites

RenderingRegistry.registerEntityRenderingHandler(Class<? extends Entity> entityClass, Render renderer)

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Do you also have EntityRegistry.registerModEntity(...) somewhere?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Entirely possible :P

I figure that the dragon is handled similarly to other mobs that duplicating it would follow similar logic, but I guess not.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Hi

 

Looking at the vanilla code I reckon you only need to register RenderDragon.  The only purpose of registering the renderer is so that it can retrieve an appropriate RenderXXXX to call .doRender on, and the RenderDragon calls the rendering for all the bits.

 

Have you tried putting a breakpoint in RenderManager.renderEntityWithPosYaw() and stepping through to see whether it gets to your render code or not?

 

-TGG

Link to comment
Share on other sites

Anyone have any more insight on this? It seems the only thing that doesn't work is actually rendering the model itself. I've duplicated the mob just like I would any other mob, and registered it the same, so what am I missing?

 

Here is the client proxy in case anyone wants to see the actual RenderRegister.

 

Client Proxy

RenderingRegistry.registerEntityRenderingHandler(EntityFireDragon.class, new RenderFireDragon(new ModelFireDragon(0.0F), 0.3F));

 

 

Link to comment
Share on other sites

(slaps forehead) It didn't even cross my mind that I could extend the classes. Now with extending EntityDragon, I will only have to define the methods that I want to change right? I'm not quite sure how to extend from a class where everything is already defined.

And yeah I'm using Eclipse.

Link to comment
Share on other sites

Hi

 

Yes you only need to override the EntityDragon methods that you want to change.

 

If your new class extends the old class, you can override any method in the old class, even if it's already "defined" in the old class (unless it's been declared as private or "final", but very few of the minecraft methods are).

 

The vanilla code does this a lot, for Entitys, Blocks, all sorts of classes.  For example Block.renderAsNormalBlock - overridden in BlockBed extends Block.

 

-TGG

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

    • I had the same issue. The only thing I could do is to remove parchment mappings entirely from config files and replace config files from the MDK: 1. replace build.gradle from MDK 2. restore official mapping in build.properties 3. replace src\main\resources\META-INF\mods.toml from MDK sample.
    • ---- Minecraft Crash Report ---- I sent a error report i just cant understand it, the game as been running fine intill today i loaded it https://pastebin.com/gWVFh4Fe   WARNING: coremods are present:   ForgelinPlugin (Forgelin-1.8.3.jar)   PatchingFixRtmCorePlugin (fixRtm-2.0.28.jar)   IELoadingPlugin (ImmersiveEngineering-core-0.12-98.jar)   FixRtmCorePlugin (fixRtm-2.0.28.jar)   JarInJarLoaderCoreMod (fixRtm-2.0.28.jar)   BetterFoliageLoader (BetterFoliage-MC1.12-2.3.2.jar)   SecurityCraftLoadingPlugin ([1.12.2] SecurityCraft v1.9.9.jar)   OpenModsCorePlugin (OpenModsLib-1.12.2-0.12.2.jar)   MalisisCorePlugin (MalisisCore-1.12.2.jar)   ObfuscatePlugin (obfuscate-0.4.2-1.12.2.jar)   CTMCorePlugin (CTM-MC1.12.2-1.0.2.31.jar)   HookingFixRtmCorePlugin (fixRtm-2.0.28.jar) Contact their authors BEFORE contacting forge // Hey, that tickles! Hehehe! Time: 4/19/24 4:05 PM Description: Updating screen events java.lang.RuntimeException: Failed to check session lock, aborting     at net.minecraft.world.storage.SaveHandler.func_75766_h(SaveHandler.java:76)     at net.minecraft.world.storage.SaveHandler.<init>(SaveHandler.java:54)     at net.minecraft.world.chunk.storage.AnvilSaveHandler.<init>(AnvilSaveHandler.java:18)     at net.minecraft.world.chunk.storage.AnvilSaveConverter.func_75804_a(SourceFile:84)     at net.minecraft.client.Minecraft.func_71371_a(Minecraft.java:2346)     at net.minecraftforge.fml.client.FMLClientHandler.tryLoadExistingWorld(FMLClientHandler.java:734)     at net.minecraft.client.gui.GuiListWorldSelectionEntry.func_186777_e(GuiListWorldSelectionEntry.java:249)     at net.minecraft.client.gui.GuiListWorldSelectionEntry.func_186774_a(GuiListWorldSelectionEntry.java:199)     at net.minecraft.client.gui.GuiListWorldSelectionEntry.func_148278_a(GuiListWorldSelectionEntry.java:163)     at net.minecraft.client.gui.GuiListExtended.func_148179_a(SourceFile:41)     at net.minecraft.client.gui.GuiWorldSelection.func_73864_a(SourceFile:117)     at net.minecraft.client.gui.GuiScreen.func_146274_d(GuiScreen.java:533)     at net.minecraft.client.gui.GuiWorldSelection.func_146274_d(SourceFile:49)     at net.minecraft.client.gui.GuiScreen.func_146269_k(GuiScreen.java:501)     at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1759)     at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1098)     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:398)     at net.minecraft.client.main.Main.main(SourceFile:123)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:497)     at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)     at net.minecraft.launchwrapper.Launch.main(Launch.java:28) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Client thread Stacktrace:     at net.minecraft.world.storage.SaveHandler.func_75766_h(SaveHandler.java:76)     at net.minecraft.world.storage.SaveHandler.<init>(SaveHandler.java:54)     at net.minecraft.world.chunk.storage.AnvilSaveHandler.<init>(AnvilSaveHandler.java:18)     at net.minecraft.world.chunk.storage.AnvilSaveConverter.func_75804_a(SourceFile:84)     at net.minecraft.client.Minecraft.func_71371_a(Minecraft.java:2346)     at net.minecraftforge.fml.client.FMLClientHandler.tryLoadExistingWorld(FMLClientHandler.java:734)     at net.minecraft.client.gui.GuiListWorldSelectionEntry.func_186777_e(GuiListWorldSelectionEntry.java:249)     at net.minecraft.client.gui.GuiListWorldSelectionEntry.func_186774_a(GuiListWorldSelectionEntry.java:199)     at net.minecraft.client.gui.GuiListWorldSelectionEntry.func_148278_a(GuiListWorldSelectionEntry.java:163)     at net.minecraft.client.gui.GuiListExtended.func_148179_a(SourceFile:41)     at net.minecraft.client.gui.GuiWorldSelection.func_73864_a(SourceFile:117)     at net.minecraft.client.gui.GuiScreen.func_146274_d(GuiScreen.java:533)     at net.minecraft.client.gui.GuiWorldSelection.func_146274_d(SourceFile:49)     at net.minecraft.client.gui.GuiScreen.func_146269_k(GuiScreen.java:501) -- Affected screen -- Details:     Screen name: net.minecraft.client.gui.GuiWorldSelection Stacktrace:     at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1759)     at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1098)     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:398)     at net.minecraft.client.main.Main.main(SourceFile:123)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:497)     at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)     at net.minecraft.launchwrapper.Launch.main(Launch.java:28) -- System Details -- Details:     Minecraft Version: 1.12.2     Operating System: Windows 10 (amd64) version 10.0     Java Version: 1.8.0_51, Oracle Corporation     Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation     Memory: 5013709368 bytes (4781 MB) / 11274289152 bytes (10752 MB) up to 12884901888 bytes (12288 MB)     JVM Flags: 8 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx12G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M     IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0     FML: MCP 9.42 Powered by Forge 14.23.5.2859 Optifine OptiFine_1.12.2_HD_U_G5 99 mods loaded, 99 mods active     States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored     | State  | ID                          | Version               | Source                                            | Signature                                |     |:------ |:--------------------------- |:--------------------- |:------------------------------------------------- |:---------------------------------------- |     | LCHIJA | minecraft                   | 1.12.2                | minecraft.jar                                     | None                                     |     | LCHIJA | mcp                         | 9.42                  | minecraft.jar                                     | None                                     |     | LCHIJA | FML                         | 8.0.99.99             | forge-1.12.2-14.23.5.2859.jar                     | e3c3d50c7c986df74c645c0ac54639741c90a557 |     | LCHIJA | forge                       | 14.23.5.2859          | forge-1.12.2-14.23.5.2859.jar                     | e3c3d50c7c986df74c645c0ac54639741c90a557 |     | LCHIJA | openmodscore                | 0.12.2                | minecraft.jar                                     | None                                     |     | LCHIJA | obfuscate                   | 0.4.2                 | minecraft.jar                                     | None                                     |     | LCHIJA | securitycraft               | v1.9.9                | [1.12.2] SecurityCraft v1.9.9.jar                 | None                                     |     | LCHIJA | mts                         | 22.14.2               | Immersive Vehicles-1.12.2-22.14.2.jar             | None                                     |     | LCHIJA | mtsaircooled                | 1.0.1                 | Air-Cooled Pack [MTS] 1.10.2-14.0.0-1.0.1.jar     | None                                     |     | LCHIJA | codechickenlib              | 3.2.3.358             | CodeChickenLib-1.12.2-3.2.3.358-universal.jar     | f1850c39b2516232a2108a7bd84d1cb5df93b261 |     | LCHIJA | ancientwarfare              | 1.12.2-2.7.0.1038     | ancientwarfare-1.12.2-2.7.0.1038.jar              | None                                     |     | LCHIJA | redstoneflux                | 2.1.1                 | RedstoneFlux-1.12-2.1.1.1-universal.jar           | None                                     |     | LCHIJA | ancientwarfareautomation    | 1.12.2-2.7.0.1038     | ancientwarfare-1.12.2-2.7.0.1038.jar              | None                                     |     | LCHIJA | ancientwarfarenpc           | 1.12.2-2.7.0.1038     | ancientwarfare-1.12.2-2.7.0.1038.jar              | None                                     |     | LCHIJA | ancientwarfarestructure     | 1.12.2-2.7.0.1038     | ancientwarfare-1.12.2-2.7.0.1038.jar              | None                                     |     | LCHIJA | ancientwarfarevehicle       | 1.12.2-2.7.0.1038     | ancientwarfare-1.12.2-2.7.0.1038.jar              | None                                     |     | LCHIJA | craftstudioapi              | 1.0.0                 | CraftStudio-1.0.0.93-mc1.12-alpha.jar             | None                                     |     | LCHIJA | animania                    | 2.0.3.28              | animania-1.12.2-base-2.0.3.28.jar                 | None                                     |     | LCHIJA | architecturecraft           | @VERSION@             | architecturecraft-1.12-3.108.jar                  | None                                     |     | LCHIJA | betteranimationscollection2 | 1.0.2                 | BetterAnimationsCollection2-v1.0.2-1.12.2.jar     | 12d137bcc36051a1c2c8ea7211cfc1da1c6e9dea |     | LCHIJA | forgelin                    | 1.8.3                 | Forgelin-1.8.3.jar                                | None                                     |     | LCHIJA | betterfoliage               | 2.3.1                 | BetterFoliage-MC1.12-2.3.2.jar                    | None                                     |     | LCHIJA | bibliocraft                 | 2.4.6                 | BiblioCraft[v2.4.6][MC1.12.2].jar                 | None                                     |     | LCHIJA | biomestaff                  | 1.0.0                 | BiomeStaff-1.12.2-1.0.0.jar                       | None                                     |     | LCHIJA | blockcraftery               | 1.12.2-1.3.1          | blockcraftery-1.12.2-1.3.1.jar                    | None                                     |     | LCHIJA | bookshelf                   | 2.3.590               | Bookshelf-1.12.2-2.3.590.jar                      | d476d1b22b218a10d845928d1665d45fce301b27 |     | LCHIJA | bookworm                    | 1.12.2-2.5.2.1        | Bookworm-Library-Mod-1.12.2.jar                   | None                                     |     | LCHIJA | brandonscore                | 2.4.20                | BrandonsCore-1.12.2-2.4.20.162-universal.jar      | None                                     |     | LCHIJA | bspkrscore                  | 8.0.0                 | BspkrsCore-1.12.2.jar                             | None                                     |     | LCHIJA | carpentersblocks            | 3.4.0-poc.6           | Carpenters-Blocks-v3.4.0-poc.6-MC-1.12.2.jar      | None                                     |     | LCHIJA | ctm                         | MC1.12.2-1.0.2.31     | CTM-MC1.12.2-1.0.2.31.jar                         | None                                     |     | LCHIJA | jei                         | 4.16.1.1012           | jei_1.12.2-4.16.1.1012.jar                        | None                                     |     | LCHIJA | chisel                      | MC1.12.2-1.0.2.45     | Chisel-Mod-1.12.2.jar                             | None                                     |     | LCHIJA | chiselsandbits              | 14.33                 | chiselsandbits-14.33.jar                          | None                                     |     | LCHIJA | customspawner               | 3.11.4                | CustomMobSpawner-3.11.5.jar                       | None                                     |     | LCHIJA | customsignposts             | 1.0                   | customsignposts-1.12.2-1.0.1.jar                  | None                                     |     | LCHIJA | ptrmodellib                 | 1.0.5                 | PTRLib-1.0.5.jar                                  | None                                     |     | LCHIJA | props                       | 2.6.3.7               | Decocraft-2.6.3.7_1.12.2.jar                      | None                                     |     | LCHIJA | mocreatures                 | 12.0.5                | DrZharks MoCreatures Mod-12.0.5.jar               | None                                     |     | LCHIJA | engineersdecor              | 1.1.5                 | engineersdecor-1.12.2-1.1.5.jar                   | ed58ed655893ced6280650866985abcae2bf7559 |     | LCHIJA | exoticbirds                 | 1.0                   | Exotic Birds 1.12.2-3.2.0.jar                     | None                                     |     | LCHIJA | unuparts                    | 6.5.0                 | UNU Parts Pack [MTS] 1.12.2-22.13.0-6.5.0.jar     | None                                     |     | LCHIJA | unuverse                    | 2.0.0                 | ExpandedUNUversePack[MTS]1.12.2-19.15.5-2.0.0.jar | None                                     |     | LCHIJA | fairylights                 | 2.1.10                | fairylights-2.2.0-1.12.2.jar                      | None                                     |     | LCHIJA | fcl                         | 1.12.82               | FCL-1.12.82c.jar                                  | None                                     |     | LCHIJA | net/fexcraft/lib/frl        | 1.2                   | FCL-1.12.82c.jar                                  | None                                     |     | LCHIJA | net/fexcraft/lib/tmt        | 1.15                  | FCL-1.12.82c.jar                                  | None                                     |     | LCHIJA | famm                        | 3.4.0                 | Fexs-Alphabet-and-More-Mod-Forge-1.12.2.jar       | None                                     |     | LCHIJA | forgemultipartcbe           | 2.6.2.83              | ForgeMultipart-1.12.2-2.6.2.83-universal.jar      | f1850c39b2516232a2108a7bd84d1cb5df93b261 |     | LCHIJA | microblockcbe               | 2.6.2.83              | ForgeMultipart-1.12.2-2.6.2.83-universal.jar      | None                                     |     | LCHIJA | minecraftmultipartcbe       | 2.6.2.83              | ForgeMultipart-1.12.2-2.6.2.83-universal.jar      | None                                     |     | LCHIJA | funkylocomotion             | 1.0                   | funky-locomotion-1.12.2-1.1.2.jar                 | None                                     |     | LCHIJA | furenikusroads              | 1.2.5                 | Furenikus_Roads-1.2.5.jar                         | None                                     |     | LCHIJA | cfm                         | 6.3.0                 | furniture-6.3.2-1.12.2.jar                        | None                                     |     | LCHIJA | waila                       | 1.8.22                | Hwyla-1.8.22-B37_1.12.jar                         | None                                     |     | LCHIJA | trackapi                    | 1.2                   | TrackAPI-1.2.jar                                  | None                                     |     | LCHIJA | universalmodcore            | 1.2.1                 | UniversalModCore-1.12.2-forge-1.2.1.jar           | None                                     |     | LCHIJA | immersiverailroading        | 1.10.0                | ImmersiveRailroading-1.12.2-forge-1.10.0.jar      | None                                     |     | LCHIJA | journeymap                  | 1.12.2-5.7.1p2        | journeymap-1.12.2-5.7.1p2.jar                     | None                                     |     | LCHIJA | zawa                        | 1.12.2-2.1.3          | zawa-1.12.2-2.1.3.jar                             | 3ee471ded1bba54aa82f4f5ca5ca82dd67b8ef42 |     | LCHIJA | lilcritters                 | 1.12.2-1.1.0.0        | Lil-Critters-Mod-Forge-1.12.2.jar                 | None                                     |     | LCHIJA | malisiscore                 | 1.12.2-6.5.1-SNAPSHOT | MalisisCore-1.12.2.jar                            | None                                     |     | LCHIJA | malisisdoors                | 1.12.2-7.3.0          | MalisisDoors-Mod-1.12.2.jar                       | None                                     |     | LCHIJA | mcwbridges                  | 1.0.6                 | mcw-bridges-1.0.6b-mc1.12.2.jar                   | None                                     |     | LCHIJA | mcwfences                   | 1.0.0                 | mcw-fences-1.0.0-mc1.12.2.jar                     | None                                     |     | LCHIJA | mcwroofs                    | 1.0.2                 | mcw-roofs-1.0.2-mc1.12.2.jar                      | None                                     |     | LCHIJA | moon-core                   | 7.0                   | Moons-Core-Forge-1.12.2.jar                       | None                                     |     | LCHIJA | mrtjpcore                   | 2.1.4.43              | MrTJPCore-1.12.2-2.1.4.43-universal.jar           | None                                     |     | LCHIJA | railcraft                   | 12.0.0                | railcraft-12.0.0.jar                              | a0c255ac501b2749537d5824bb0f0588bf0320fa |     | LCHIJA | mtr                         | 3.0.0                 | MTR-1.12.2-alpha-test-0.0.1.jar                   | None                                     |     | LCHIJA | kadwinjpvehicles            | 2.0.0                 | MTS_Kadwin_JP_Vehicles_Pack_4.1.jar               | None                                     |     | LCHIJA | ngtlib                      | 2.4.21                | NGTLib2.4.21-38_forge-1.12.2-14.23.2.2611.jar     | None                                     |     | LCHIJA | projectintelligence         | 1.0.9                 | ProjectIntelligence-1.12.2-1.0.9.28-universal.jar | None                                     |     | LCHIJA | nei                         | 2.4.3                 | NotEnoughItems-1.12.2-2.4.3.245-universal.jar     | f1850c39b2516232a2108a7bd84d1cb5df93b261 |     | LCHIJA | oe                          | 1.0.7                 | OceanicExpanse-1.0.7.jar                          | None                                     |     | LCHIJA | openmods                    | 0.12.2                | OpenModsLib-1.12.2-0.12.2.jar                     | d2a9a8e8440196e26a268d1f3ddc01b2e9c572a5 |     | LCHIJA | openblocks                  | 1.8.1                 | OpenBlocks-1.12.2-1.8.1.jar                       | d2a9a8e8440196e26a268d1f3ddc01b2e9c572a5 |     | LCHIJA | placeableitems              | 3.3                   | placeableitems-3.3.jar                            | None                                     |     | LCHIJA | projectred-core             | 4.9.4.120             | ProjectRed-1.12.2-4.9.4.120-Base.jar              | None                                     |     | LCHIJA | projectred-integration      | 4.9.4.120             | ProjectRed-1.12.2-4.9.4.120-integration.jar       | None                                     |     | LCHIJA | projectred-transmission     | 4.9.4.120             | ProjectRed-1.12.2-4.9.4.120-integration.jar       | None                                     |     | LCHIJA | projectred-illumination     | 4.9.4.120             | ProjectRed-1.12.2-4.9.4.120-lighting.jar          | None                                     |     | LCHIJA | projectred-expansion        | 4.9.4.120             | ProjectRed-1.12.2-4.9.4.120-mechanical.jar        | None                                     |     | LCHIJA | projectred-relocation       | 4.9.4.120             | ProjectRed-1.12.2-4.9.4.120-mechanical.jar        | None                                     |     | LCHIJA | projectred-transportation   | 4.9.4.120             | ProjectRed-1.12.2-4.9.4.120-mechanical.jar        | None                                     |     | LCHIJA | rtm                         | 2.4.24                | RTM2.4.24-43_forge-1.12.2-14.23.2.2611.jar        | None                                     |     | LCHIJA | trafficcontrol              | 1.1.1                 | trafficcontrol-1.1.1.jar                          | None                                     |     | LCHIJA | travelersbackpack           | 1.0.35                | TravelersBackpack-1.12.2-1.0.35.jar               | None                                     |     | LCHIJA | iv_tpp                      | 2.22.0                | Trin Parts Pack-1.12.2-2.23.1.jar                 | None                                     |     | LCHIJA | unucivil                    | 6.3.0                 | UNU Civilian Pack [MTS] 1.12.2-22.13.0-6.3.0.jar  | None                                     |     | LCHIJA | vehicle                     | 0.44.1                | vehicle-mod-0.44.1-1.12.2.jar                     | None                                     |     | LCHIJA | wawla                       | 2.6.275               | Wawla-1.12.2-2.6.275.jar                          | d476d1b22b218a10d845928d1665d45fce301b27 |     | LCHIJA | worldedit                   | 6.1.10                | worldedit-forge-mc1.12.2-6.1.10-dist.jar          | None                                     |     | LCHIJA | worldstatecheckpoints       | 1.12.2.1.2.1          | WorldStateCheckpoints-client-1.12.2.1.2.1.jar     | None                                     |     | LCHIJA | wrcbe                       | 2.3.2                 | WR-CBE-1.12.2-2.3.2.33-universal.jar              | f1850c39b2516232a2108a7bd84d1cb5df93b261 |     | LCHIJA | zoocraftdiscoveries         | 1.0                   | Zoocraft+Discoveries+1.12.2-1.3.0.jar             | None                                     |     | LCHIJA | immersiveengineering        | 0.12-98               | ImmersiveEngineering-0.12-98.jar                  | None                                     |     | LCHIJA | fix-rtm                     | 2.0.28                | fixRtm-2.0.28.jar                                 | None                                     |     | LCHIJA | mysticallib                 | 1.12.2-1.13.0         | mysticallib-1.12.2-1.13.0.jar                     | None                                     |     Loaded coremods (and transformers): ForgelinPlugin (Forgelin-1.8.3.jar)   PatchingFixRtmCorePlugin (fixRtm-2.0.28.jar)   com.anatawa12.fixRtm.asm.patching.PatchApplier IELoadingPlugin (ImmersiveEngineering-core-0.12-98.jar)   blusunrize.immersiveengineering.common.asm.IEClassTransformer FixRtmCorePlugin (fixRtm-2.0.28.jar)   JarInJarLoaderCoreMod (fixRtm-2.0.28.jar)   com.anatawa12.fixRtm.jarInJar.JarInJarPatcher BetterFoliageLoader (BetterFoliage-MC1.12-2.3.2.jar)   mods.betterfoliage.loader.BetterFoliageTransformer SecurityCraftLoadingPlugin ([1.12.2] SecurityCraft v1.9.9.jar)   OpenModsCorePlugin (OpenModsLib-1.12.2-0.12.2.jar)   openmods.core.OpenModsClassTransformer MalisisCorePlugin (MalisisCore-1.12.2.jar)   ObfuscatePlugin (obfuscate-0.4.2-1.12.2.jar)   com.mrcrayfish.obfuscate.asm.ObfuscateTransformer CTMCorePlugin (CTM-MC1.12.2-1.0.2.31.jar)   team.chisel.ctm.client.asm.CTMTransformer HookingFixRtmCorePlugin (fixRtm-2.0.28.jar)   com.anatawa12.fixRtm.asm.hooking.HookingTransformer     GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 551.86' Renderer: 'NVIDIA GeForce RTX 3070/PCIe/SSE2'     OpenModsLib class transformers: [llama_null_fix:FINISHED],[horse_base_null_fix:FINISHED],[pre_world_render_hook:FINISHED],[player_render_hook:FINISHED],[horse_null_fix:FINISHED]     RTM Model Status: Initialized 1048 models, Using 0 models     I = Initialized, C = Constructed, SMP = SMP includeds     | model pack                                      | all | I | C   | SMP |     |:----------------------------------------------- |:--- |:- |:--- |:--- |     | mods\ModelPack_Nak_5_Structure_240313.zip       | 458 | 0 | 458 | 0   |     | mods\RTM2.4.24-43_forge-1.12.2-14.23.2.2611.jar | 281 | 0 | 281 | 0   |     | mods\rtm_Saracalias Pack v0.2.01.zip            | 309 | 0 | 309 | 0   |     Launched Version: 1.12.2-forge-14.23.5.2859     LWJGL: 2.9.4     OpenGL: NVIDIA GeForce RTX 3070/PCIe/SSE2 GL version 4.6.0 NVIDIA 551.86, NVIDIA Corporation     GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Shaders are available because OpenGL 2.1 is supported. VBOs are available because OpenGL 1.5 is supported.     Using VBOs: Yes     Is Modded: Definitely; Client brand changed to 'fml,forge'     Type: Client (map_client.txt)     Resource Packs: NickMiner69V2.zip, MPT-4.zip, feldbahnpackv1-3.zip, G_P_Narrow_Gauge_Texel_Pack_V1.0.3.zip     Current Language: English (US)     Profiler Position: N/A (disabled)     CPU: 8x Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz     OptiFine Version: OptiFine_1.12.2_HD_U_G5     OptiFine Build: 20210124-142939     Render Distance Chunks: 12     Mipmaps: 4     Anisotropic Filtering: 1     Antialiasing: 0     Multitexture: false     Shaders: null     OpenGlVersion: 4.6.0 NVIDIA 551.86     OpenGlRenderer: NVIDIA GeForce RTX 3070/PCIe/SSE2     OpenGlVendor: NVIDIA Corporation     CpuCount: 8
    • i notice a change if i add the min and max ram in the line like this for example:    # Xmx and Xms set the maximum and minimum RAM usage, respectively. # They can take any number, followed by an M or a G. # M means Megabyte, G means Gigabyte. # For example, to set the maximum to 3GB: -Xmx3G # To set the minimum to 2.5GB: -Xms2500M # A good default for a modded server is 4GB. # Uncomment the next line to set it. -Xmx10240M -Xms8192M    i need to make more experiments but for now this apparently works.
    • This honestly might just work for you @SubscribeEvent public static void onScreenRender(ScreenEvent.Render.Post event) { final var player = Minecraft.getInstance().player; final var options = Minecraft.getInstance().options; if(!hasMyEffect(player)) return; // TODO: You provide hasMyEffect float f = Mth.lerp(event.getPartialTick(), player.oSpinningEffectIntensity, player.spinningEffectIntensity); float f1 = ((Double)options.screenEffectScale().get()).floatValue(); if(f <= 0F || f1 >= 1F) return; float p_282656_ = f * (1.0F - f1); final var p_282460_ = event.getGuiGraphics(); int i = p_282460_.guiWidth(); int j = p_282460_.guiHeight(); p_282460_.pose().pushPose(); float f5 = Mth.lerp(p_282656_, 2.0F, 1.0F); p_282460_.pose().translate((float)i / 2.0F, (float)j / 2.0F, 0.0F); p_282460_.pose().scale(f5, f5, f5); p_282460_.pose().translate((float)(-i) / 2.0F, (float)(-j) / 2.0F, 0.0F); float f4 = 0.2F * p_282656_; float f2 = 0.4F * p_282656_; float f3 = 0.2F * p_282656_; RenderSystem.disableDepthTest(); RenderSystem.depthMask(false); RenderSystem.enableBlend(); RenderSystem.blendFuncSeparate(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE); p_282460_.setColor(f4, f2, f3, 1.0F); p_282460_.blit(new ResourceLocation("textures/misc/nausea.png"), 0, 0, -90, 0.0F, 0.0F, i, j, i, j); p_282460_.setColor(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.defaultBlendFunc(); RenderSystem.disableBlend(); RenderSystem.depthMask(true); RenderSystem.enableDepthTest(); p_282460_.pose().popPose(); }   Note: Most of this is directly copied from GameRenderer as you pointed out you found. The only thing you'll have to likely do is update the `oSpinningEffectIntensity` + `spinningEffectIntensity` variables on the player when your effect is applied. Which values should be there? Not 100% sure, might be a game of guess and check, but `handleNetherPortalClient` in LocalPlayer has some hard coded you might be able to start with.
    • I have been having a problem with minecraft forge. Any version. Everytime I try to launch it it always comes back with error code 1. I have tried launching from curseforge, from the minecraft launcher. I have also tried resetting my computer to see if that would help. It works on my other computer but that one is too old to run it properly. I have tried with and without mods aswell. Fabric works, optifine works, and MultiMC works aswell but i want to use forge. If you can help with this issue please DM on discord my # is Haole_Dawg#6676
  • Topics

×
×
  • Create New...

Important Information

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