Jump to content

Recommended Posts

Posted

My Laser projectile that is not rendering in game. Need help please!

 

Entity

 

package stevekung.mods.moreplanets.planets.diona.entities.projectiles;

 

import java.util.List;

 

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.block.state.IBlockState;

import net.minecraft.enchantment.EnchantmentHelper;

import net.minecraft.entity.Entity;

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.nbt.NBTTagCompound;

import net.minecraft.network.play.server.S2BPacketChangeGameState;

import net.minecraft.potion.PotionEffect;

import net.minecraft.util.AxisAlignedBB;

import net.minecraft.util.BlockPos;

import net.minecraft.util.DamageSource;

import net.minecraft.util.EnumParticleTypes;

import net.minecraft.util.MathHelper;

import net.minecraft.util.MovingObjectPosition;

import net.minecraft.util.Vec3;

import net.minecraft.world.World;

import net.minecraftforge.fml.relauncher.Side;

import net.minecraftforge.fml.relauncher.SideOnly;

import stevekung.mods.moreplanets.common.util.DamageSourceMP;

import stevekung.mods.moreplanets.core.init.MPPotions;

import stevekung.mods.moreplanets.planets.diona.entities.EntityEvolvedEnderman;

 

public class EntityLaserMP extends Entity implements IProjectile

{

private int xTile = -1;

private int yTile = -1;

private int zTile = -1;

public Entity shootingEntity;

private int ticksInAir;

private float damage;

 

public EntityLaserMP(World world)

{

super(world);

this.renderDistanceWeight = 10.0D;

this.setSize(0.5F, 0.5F);

}

 

public EntityLaserMP(World world, double x, double y, double z)

{

super(world);

this.renderDistanceWeight = 10.0D;

this.setSize(0.5F, 0.5F);

this.setPosition(x, y, z);

}

 

public EntityLaserMP(World world, EntityLivingBase shooter, EntityLivingBase living, float par4, float par5)

{

super(world);

this.renderDistanceWeight = 10.0D;

this.shootingEntity = shooter;

this.posY = shooter.posY + shooter.getEyeHeight() - 0.10000000149011612D;

double d0 = living.posX - shooter.posX;

double d1 = living.getEntityBoundingBox().minY + living.height / 3.0F - this.posY;

double d2 = living.posZ - shooter.posZ;

double d3 = 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(shooter.posX + d4, this.posY, shooter.posZ + d5, f2, f3);

float f4 = (float)(d3 * 0.20000000298023224D);

this.setThrowableHeading(d0, d1 + f4, d2, par4, par5);

}

}

 

public EntityLaserMP(World world, EntityLivingBase shooter, float par3)

{

super(world);

this.renderDistanceWeight = 10.0D;

this.shootingEntity = shooter;

this.setSize(0.5F, 0.5F);

this.setLocationAndAngles(shooter.posX, shooter.posY + shooter.getEyeHeight(), shooter.posZ, shooter.rotationYaw, shooter.rotationPitch);

this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F;

this.posY -= 0.10000000149011612D;

this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F;

this.setPosition(this.posX, this.posY, this.posZ);

this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI);

this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI);

this.motionY = -MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI);

this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, par3 * 1.5F, 1.0F);

}

 

@Override

public void setThrowableHeading(double x, double y, double z, float velocity, float inaccuracy)

{

float f2 = MathHelper.sqrt_double(x * x + y * y + z * z);

x /= f2;

y /= f2;

z /= f2;

x += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * inaccuracy;

y += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * inaccuracy;

z += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * inaccuracy;

x *= velocity;

y *= velocity;

z *= velocity;

this.motionX = x;

this.motionY = y;

this.motionZ = z;

float f3 = MathHelper.sqrt_double(x * x + z * z);

this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(x, z) * 180.0D / Math.PI);

this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(y, f3) * 180.0D / Math.PI);

}

 

@Override

@SideOnly(Side.CLIENT)

public void func_180426_a(double x, double y, double z, float par4, float par5, int par6, boolean par7)

{

this.setPosition(x, y, z);

this.setRotation(par4, par5);

}

 

@Override

@SideOnly(Side.CLIENT)

public void setVelocity(double x, double y, double z)

{

this.motionX = x;

this.motionY = y;

this.motionZ = z;

 

if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)

{

float f = MathHelper.sqrt_double(x * x + z * z);

this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(x, z) * 180.0D / Math.PI);

this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(y, 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);

}

}

 

@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, f) * 180.0D / Math.PI);

}

 

BlockPos pos = new BlockPos(this.xTile, this.yTile, this.zTile);

IBlockState state = this.worldObj.getBlockState(pos);

Block block = state.getBlock();

 

if (block.getMaterial() != Material.air)

{

block.setBlockBoundsBasedOnState(this.worldObj, pos);

AxisAlignedBB axisalignedbb = block.getCollisionBoundingBox(this.worldObj, pos, state);

 

if (axisalignedbb != null && axisalignedbb.isVecInside(new Vec3(this.posX, this.posY, this.posZ)))

{

this.setDead();

}

}

 

++this.ticksInAir;

Vec3 vec31 = new Vec3(this.posX, this.posY, this.posZ);

Vec3 vec3 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);

MovingObjectPosition moving = this.worldObj.rayTraceBlocks(vec31, vec3, false, true, false);

vec31 = new Vec3(this.posX, this.posY, this.posZ);

vec3 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);

 

if (moving != null)

{

vec3 = new Vec3(moving.hitVec.xCoord, moving.hitVec.yCoord, moving.hitVec.zCoord);

}

 

Entity entity = null;

List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));

double d0 = 0.0D;

int i;

float f1;

 

for (i = 0; i < list.size(); ++i)

{

Entity entity1 = (Entity)list.get(i);

 

if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5))

{

f1 = 0.3F;

AxisAlignedBB axisalignedbb1 = entity1.getEntityBoundingBox().expand(f1, f1, f1);

MovingObjectPosition moving1 = axisalignedbb1.calculateIntercept(vec31, vec3);

 

if (moving1 != null)

{

double d1 = vec31.distanceTo(moving1.hitVec);

 

if (d1 < d0 || d0 == 0.0D)

{

entity = entity1;

d0 = d1;

}

}

}

}

 

if (entity != null)

{

moving = new MovingObjectPosition(entity);

}

 

if (moving != null && moving.entityHit != null && moving.entityHit instanceof EntityPlayer)

{

EntityPlayer entityplayer = (EntityPlayer)moving.entityHit;

 

if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(entityplayer))

{

moving = null;

}

}

 

float f2;

float f3;

 

if (moving != null)

{

if (moving.entityHit != null)

{

DamageSource damagesource;

int type = this.getLaserType();

 

if (this.shootingEntity == null)

{

damagesource = DamageSourceMP.causeLaserDamage(this, this);

}

else

{

damagesource = DamageSourceMP.causeLaserDamage(this, this.shootingEntity);

}

 

if (type == 0)

{

this.damage = 6.0F;

}

if (type == 1)

{

this.damage = 10.0F;

}

if (type == 2)

{

this.damage = 7.5F;

 

if (moving.entityHit instanceof EntityLivingBase)

{

if (!this.worldObj.isRemote)

{

((EntityLivingBase)moving.entityHit).addPotionEffect(new PotionEffect(MPPotions.electro_magnetic_pulse.id, 480));

}

}

}

if (type == 3)

{

this.damage = 9.5F;

 

if (moving.entityHit instanceof EntityLivingBase)

{

if (!this.worldObj.isRemote)

{

((EntityLivingBase)moving.entityHit).addPotionEffect(new PotionEffect(MPPotions.chemical.id, 256));

}

}

}

if (moving.entityHit.attackEntityFrom(damagesource, this.damage))

{

if (moving.entityHit instanceof EntityLivingBase)

{

EntityLivingBase entitylivingbase = (EntityLivingBase)moving.entityHit;

 

if (!this.worldObj.isRemote)

{

entitylivingbase.setArrowCountInEntity(entitylivingbase.getArrowCountInEntity() + 1);

}

if (this.shootingEntity instanceof EntityLivingBase)

{

EnchantmentHelper.func_151384_a(entitylivingbase, this.shootingEntity);

EnchantmentHelper.func_151385_b((EntityLivingBase)this.shootingEntity, entitylivingbase);

}

if (this.shootingEntity != null && moving.entityHit != this.shootingEntity && moving.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP)

{

((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(6, 0.0F));

}

}

if (!(moving.entityHit instanceof EntityEnderman) || !(moving.entityHit instanceof EntityEvolvedEnderman))

{

this.setDead();

}

}

else

{

this.motionX *= -0.10000000149011612D;

this.motionY += 0D;

this.motionZ *= -0.10000000149011612D;

this.rotationYaw += 180.0F;

this.prevRotationYaw += 180.0F;

this.ticksInAir = 0;

}

}

else

{

this.motionX = (float)(moving.hitVec.xCoord - this.posX);

this.motionY = (float)(moving.hitVec.yCoord - this.posY);

this.motionZ = (float)(moving.hitVec.zCoord - this.posZ);

f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);

f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);

this.posX -= this.motionX / f3 * 0.05000000074505806D;

this.posY += this.motionY / f2 * 0D;

this.posZ -= this.motionZ / f3 * 0.05000000074505806D;

this.setDead();

}

}

 

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, 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;

f3 = 0.99F;

f1 = 0.05F;

 

if (this.isInWater())

{

for (int j1 = 0; j1 < 4; ++j1)

{

f3 = 0.25F;

this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, this.posX - this.motionX * f3, this.posY - this.motionY * f3, this.posZ - this.motionZ * f3, this.motionX, this.motionY, this.motionZ);

this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.fizz", 0.7F, 0.9F);

}

if (this.worldObj.rand.nextInt(200) == 0)

{

this.setDead();

}

}

 

this.motionX *= f3;

this.motionY += 0.0F;

this.motionZ *= f3;

this.setPosition(this.posX, this.posY, this.posZ);

this.doBlockCollisions();

}

 

@Override

public void writeEntityToNBT(NBTTagCompound nbt)

{

nbt.setShort("xTile", (short)this.xTile);

nbt.setShort("yTile", (short)this.yTile);

nbt.setShort("zTile", (short)this.zTile);

nbt.setInteger("LaserType", this.getLaserType());

}

 

@Override

public void readEntityFromNBT(NBTTagCompound nbt)

{

this.xTile = nbt.getShort("xTile");

this.yTile = nbt.getShort("yTile");

this.zTile = nbt.getShort("zTile");

this.setLaserType(nbt.getInteger("LaserType"));

}

 

@Override

protected boolean canTriggerWalking()

{

return false;

}

 

@Override

public boolean canAttackWithItem()

{

return false;

}

 

@Override

protected void entityInit()

{

this.dataWatcher.addObject(16, Byte.valueOf((byte)0));

this.dataWatcher.addObject(18, Byte.valueOf((byte)0));

}

 

public int getLaserType()

{

return this.dataWatcher.getWatchableObjectByte(18);

}

 

public void setLaserType(int type)

{

this.dataWatcher.updateObject(18, Byte.valueOf((byte)type));

}

}

 

 

Render

 

package stevekung.mods.moreplanets.planets.diona.client.render.entities.projectiles;

 

import net.minecraft.client.model.ModelBase;

import net.minecraft.client.renderer.GlStateManager;

import net.minecraft.client.renderer.entity.Render;

import net.minecraft.client.renderer.entity.RenderManager;

import net.minecraft.entity.Entity;

import net.minecraft.util.ResourceLocation;

import net.minecraftforge.fml.relauncher.Side;

import net.minecraftforge.fml.relauncher.SideOnly;

import stevekung.mods.moreplanets.planets.diona.client.model.ModelLaser;

import stevekung.mods.moreplanets.planets.diona.entities.projectiles.EntityLaserMP;

 

@SideOnly(Side.CLIENT)

public class RenderLaser extends Render

{

protected ModelBase model = new ModelLaser();

 

public RenderLaser(RenderManager render)

{

super(render);

}

 

public void doRender(EntityLaserMP entity, double x, double y, double z, float par5, float partialTicks)

{

GlStateManager.pushMatrix();

GlStateManager.translate((float)x, (float)y, (float)z);

GlStateManager.rotate(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks - 90.0F, 0.0F, 1.0F, 0.0F);

GlStateManager.rotate(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks, 0.0F, 0.0F, 1.0F);

float f4 = 0.75F;

GlStateManager.scale(f4, f4, f4);

GlStateManager.scale(1.0F / f4, 1.0F / f4, 1.0F / f4);

this.bindEntityTexture(entity);

GlStateManager.scale(-1.0F, -1.0F, 1.0F);

this.model.render(entity, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);

GlStateManager.popMatrix();

super.doRender(entity, x, y, z, par5, partialTicks);

}

 

@Override

protected ResourceLocation getEntityTexture(Entity entity)

{

return this.getEntityTexture((EntityLaserMP)entity);

}

 

protected ResourceLocation getEntityTexture(EntityLaserMP entity)

{

if (entity.getLaserType() == 0)

{

return new ResourceLocation("diona:textures/model/laser/laser.png");

}

else if (entity.getLaserType() == 1)

{

return new ResourceLocation("diona:textures/model/laser/hyper.png");

}

else if (entity.getLaserType() == 2)

{

return new ResourceLocation("diona:textures/model/laser/emp.png");

}

else if (entity.getLaserType() == 3)

{

return new ResourceLocation("diona:textures/model/laser/uranium.png");

}

return null;

}

 

@Override

public void doRender(Entity entity, double x, double y, double z, float par5, float partialTicks)

{

this.doRender((EntityLaserMP)entity, x, y, z, par5, partialTicks);

}

}

 

Posted

 

package stevekung.mods.moreplanets.client.render;

 

import net.minecraft.client.Minecraft;

import net.minecraft.client.renderer.entity.RenderManager;

import net.minecraft.item.ItemStack;

import net.minecraftforge.fml.client.registry.RenderingRegistry;

import stevekung.mods.moreplanets.client.render.entities.RenderFlagMP;

import stevekung.mods.moreplanets.client.render.entities.RenderSnowballMP;

import stevekung.mods.moreplanets.common.entities.EntityFlagMP;

import stevekung.mods.moreplanets.planets.diona.client.render.entities.RenderDionaMinionCreeper;

import stevekung.mods.moreplanets.planets.diona.client.render.entities.RenderEvolvedEnderman;

import stevekung.mods.moreplanets.planets.diona.client.render.entities.RenderFronisiumTNT;

import stevekung.mods.moreplanets.planets.diona.client.render.entities.RenderSpaceWolf;

import stevekung.mods.moreplanets.planets.diona.client.render.entities.projectiles.RenderLaser;

import stevekung.mods.moreplanets.planets.diona.client.render.entities.projectiles.RenderProjectileFronisiumTNT;

import stevekung.mods.moreplanets.planets.diona.entities.EntityDionaMinionCreeper;

import stevekung.mods.moreplanets.planets.diona.entities.EntityEvolvedEnderman;

import stevekung.mods.moreplanets.planets.diona.entities.EntityFronisiumTNT;

import stevekung.mods.moreplanets.planets.diona.entities.EntitySpaceWolf;

import stevekung.mods.moreplanets.planets.diona.entities.projectiles.EntityLaserMP;

import stevekung.mods.moreplanets.planets.diona.entities.projectiles.EntityProjectileFronisiumTNT;

import stevekung.mods.moreplanets.planets.fronos.client.render.entities.RenderBearry;

import stevekung.mods.moreplanets.planets.fronos.client.render.entities.RenderBerry;

import stevekung.mods.moreplanets.planets.fronos.client.render.entities.RenderCreamCat;

import stevekung.mods.moreplanets.planets.fronos.client.render.entities.RenderCreamGolem;

import stevekung.mods.moreplanets.planets.fronos.client.render.entities.RenderCreamSlime;

import stevekung.mods.moreplanets.planets.fronos.client.render.entities.RenderFronosVillager;

import stevekung.mods.moreplanets.planets.fronos.client.render.entities.RenderGrappy;

import stevekung.mods.moreplanets.planets.fronos.client.render.entities.RenderJellySlime;

import stevekung.mods.moreplanets.planets.fronos.client.render.entities.RenderKiwi;

import stevekung.mods.moreplanets.planets.fronos.client.render.entities.RenderLemonDuck;

import stevekung.mods.moreplanets.planets.fronos.client.render.entities.RenderMarshmallow;

import stevekung.mods.moreplanets.planets.fronos.client.render.entities.RenderMelon;

import stevekung.mods.moreplanets.planets.fronos.client.render.entities.RenderPoisonArrow;

import stevekung.mods.moreplanets.planets.fronos.client.render.entities.RenderStarfish;

import stevekung.mods.moreplanets.planets.fronos.client.render.entities.RenderStrawberryChicken;

import stevekung.mods.moreplanets.planets.fronos.client.render.entities.RenderTomato;

import stevekung.mods.moreplanets.planets.fronos.entities.EntityBearry;

import stevekung.mods.moreplanets.planets.fronos.entities.EntityBerry;

import stevekung.mods.moreplanets.planets.fronos.entities.EntityCreamCat;

import stevekung.mods.moreplanets.planets.fronos.entities.EntityCreamGolem;

import stevekung.mods.moreplanets.planets.fronos.entities.EntityCreamSlime;

import stevekung.mods.moreplanets.planets.fronos.entities.EntityFronosVillager;

import stevekung.mods.moreplanets.planets.fronos.entities.EntityGrappy;

import stevekung.mods.moreplanets.planets.fronos.entities.EntityJellySlime;

import stevekung.mods.moreplanets.planets.fronos.entities.EntityKiwi;

import stevekung.mods.moreplanets.planets.fronos.entities.EntityLemonDuck;

import stevekung.mods.moreplanets.planets.fronos.entities.EntityMarshmallow;

import stevekung.mods.moreplanets.planets.fronos.entities.EntityMelon;

import stevekung.mods.moreplanets.planets.fronos.entities.EntityStarfish;

import stevekung.mods.moreplanets.planets.fronos.entities.EntityStrawberryChicken;

import stevekung.mods.moreplanets.planets.fronos.entities.EntityTomato;

import stevekung.mods.moreplanets.planets.fronos.entities.projectiles.EntityChocolateCreamBall;

import stevekung.mods.moreplanets.planets.fronos.entities.projectiles.EntityLemonCreamBall;

import stevekung.mods.moreplanets.planets.fronos.entities.projectiles.EntityOrangeCreamBall;

import stevekung.mods.moreplanets.planets.fronos.entities.projectiles.EntityPoisonArrow;

import stevekung.mods.moreplanets.planets.fronos.entities.projectiles.EntityStrawberryCreamBall;

import stevekung.mods.moreplanets.planets.fronos.entities.projectiles.EntityTeaCreamBall;

import stevekung.mods.moreplanets.planets.fronos.entities.projectiles.EntityVanillaCreamBall;

import stevekung.mods.moreplanets.planets.fronos.items.FronosItems;

import stevekung.mods.moreplanets.planets.kapteynb.client.render.entities.RenderUraniumBomb;

import stevekung.mods.moreplanets.planets.kapteynb.entities.EntityUraniumBomb;

import stevekung.mods.moreplanets.planets.nibiru.client.render.entities.RenderGiantWorm;

import stevekung.mods.moreplanets.planets.nibiru.client.render.entities.RenderInfectedZombie;

import stevekung.mods.moreplanets.planets.nibiru.entities.EntityGiantWorm;

import stevekung.mods.moreplanets.planets.nibiru.entities.EntityInfectedZombie;

import stevekung.mods.moreplanets.planets.polongnius.client.render.entities.RenderCheeseCow;

import stevekung.mods.moreplanets.planets.polongnius.client.render.entities.RenderCheeseSlime;

import stevekung.mods.moreplanets.planets.polongnius.client.render.entities.RenderCheeseSpore;

import stevekung.mods.moreplanets.planets.polongnius.entities.EntityCheeseCow;

import stevekung.mods.moreplanets.planets.polongnius.entities.EntityCheeseSlime;

import stevekung.mods.moreplanets.planets.polongnius.entities.projectiles.EntityCheeseSpore;

import stevekung.mods.moreplanets.planets.siriusb.client.render.entities.RenderSiriusBlaze;

import stevekung.mods.moreplanets.planets.siriusb.client.render.entities.RenderSiriusCreeper;

import stevekung.mods.moreplanets.planets.siriusb.client.render.entities.RenderSiriusMagmaCube;

import stevekung.mods.moreplanets.planets.siriusb.client.render.entities.projectiles.RenderSiriusSmallFireball;

import stevekung.mods.moreplanets.planets.siriusb.entities.EntitySiriusBlaze;

import stevekung.mods.moreplanets.planets.siriusb.entities.EntitySiriusCreeper;

import stevekung.mods.moreplanets.planets.siriusb.entities.EntitySiriusMagmaCube;

import stevekung.mods.moreplanets.planets.siriusb.entities.projectiles.EntitySiriusSmallFireball;

 

public class EntityRendererMP

{

//private static IModelPart tier3RocketModel = AdvancedModelLoader.loadModel(new ResourceLocation("galacticraftasteroids:models/tier3rocket.obj"));

 

public static void init()

{

EntityRendererMP.registerEntityRenderers();

EntityRendererMP.registerNonEntityRenderers();

}

 

private static void registerEntityRenderers()

{

RenderManager render = Minecraft.getMinecraft().getRenderManager();

 

// RenderingRegistry.registerEntityRenderingHandler(EntityDustSludgeling.class, new RenderDustSludgeling(render));

RenderingRegistry.registerEntityRenderingHandler(EntitySpaceWolf.class, new RenderSpaceWolf(render));

RenderingRegistry.registerEntityRenderingHandler(EntityEvolvedEnderman.class, new RenderEvolvedEnderman(render));

// RenderingRegistry.registerEntityRenderingHandler(EntityDionaCreeperBoss.class, new RenderDionaCreeperBoss());

RenderingRegistry.registerEntityRenderingHandler(EntityDionaMinionCreeper.class, new RenderDionaMinionCreeper(render));

 

RenderingRegistry.registerEntityRenderingHandler(EntityCheeseCow.class, new RenderCheeseCow(render));

RenderingRegistry.registerEntityRenderingHandler(EntityCheeseSlime.class, new RenderCheeseSlime(render));

// RenderingRegistry.registerEntityRenderingHandler(EntityCheeseCubeEyeBoss.class, new RenderCheeseCubeBoss(render));

 

// RenderingRegistry.registerEntityRenderingHandler(EntityInfectedWorm.class, new RenderInfectedWorm(render));

RenderingRegistry.registerEntityRenderingHandler(EntityGiantWorm.class, new RenderGiantWorm(render));

RenderingRegistry.registerEntityRenderingHandler(EntityInfectedZombie.class, new RenderInfectedZombie(render));

// RenderingRegistry.registerEntityRenderingHandler(EntityInfectedEvolvedSpiderBoss.class, new RenderInfectedEvolvedSpiderBoss(render));

 

//RenderingRegistry.registerEntityRenderingHandler(EntityKoentusianVillager.class, new RenderKoentusianVillager());

// RenderingRegistry.registerEntityRenderingHandler(EntityKoentusSludgeling.class, new RenderKoentusSludgeling(render));

 

RenderingRegistry.registerEntityRenderingHandler(EntityBearry.class, new RenderBearry(render));

RenderingRegistry.registerEntityRenderingHandler(EntityBerry.class, new RenderBerry(render));

RenderingRegistry.registerEntityRenderingHandler(EntityMarshmallow.class, new RenderMarshmallow(render));

RenderingRegistry.registerEntityRenderingHandler(EntityKiwi.class, new RenderKiwi(render));

RenderingRegistry.registerEntityRenderingHandler(EntityJellySlime.class, new RenderJellySlime(render));

RenderingRegistry.registerEntityRenderingHandler(EntityCreamSlime.class, new RenderCreamSlime(render));

RenderingRegistry.registerEntityRenderingHandler(EntityLemonDuck.class, new RenderLemonDuck(render));

RenderingRegistry.registerEntityRenderingHandler(EntityStarfish.class, new RenderStarfish(render));

RenderingRegistry.registerEntityRenderingHandler(EntityMelon.class, new RenderMelon(render));

RenderingRegistry.registerEntityRenderingHandler(EntityTomato.class, new RenderTomato(render));

RenderingRegistry.registerEntityRenderingHandler(EntityGrappy.class, new RenderGrappy(render));

RenderingRegistry.registerEntityRenderingHandler(EntityCreamCat.class, new RenderCreamCat(render));

RenderingRegistry.registerEntityRenderingHandler(EntityCreamGolem.class, new RenderCreamGolem(render));

RenderingRegistry.registerEntityRenderingHandler(EntityStrawberryChicken.class, new RenderStrawberryChicken(render));

RenderingRegistry.registerEntityRenderingHandler(EntityFronosVillager.class, new RenderFronosVillager(render));

 

// RenderingRegistry.registerEntityRenderingHandler(EntityFrozenSludgeling.class, new RenderFrozenSludgeling(render));

 

RenderingRegistry.registerEntityRenderingHandler(EntitySiriusCreeper.class, new RenderSiriusCreeper(render));

RenderingRegistry.registerEntityRenderingHandler(EntitySiriusBlaze.class, new RenderSiriusBlaze(render));

RenderingRegistry.registerEntityRenderingHandler(EntitySiriusMagmaCube.class, new RenderSiriusMagmaCube(render));

// RenderingRegistry.registerEntityRenderingHandler(EntityEvolvedSiriusBlazeBoss.class, new RenderEvolvedSiriusBlazeBoss(render));

}

 

private static void registerNonEntityRenderers()

{

RenderManager render = Minecraft.getMinecraft().getRenderManager();

 

RenderingRegistry.registerEntityRenderingHandler(EntityFlagMP.class, new RenderFlagMP(render));

// RenderingRegistry.registerEntityRenderingHandler(EntityTier4Rocket.class, new RenderTier1Rocket(new ModelRocketMP(), "diona", "tier4_rocket"));

// RenderingRegistry.registerEntityRenderingHandler(EntityTier4RocketNoFlag.class, new RenderTier1Rocket(new ModelRocketNoFlagMP(), "diona", "tier4_rocket"));

RenderingRegistry.registerEntityRenderingHandler(EntityProjectileFronisiumTNT.class, new RenderProjectileFronisiumTNT(render));

RenderingRegistry.registerEntityRenderingHandler(EntityFronisiumTNT.class, new RenderFronisiumTNT(render));

RenderingRegistry.registerEntityRenderingHandler(EntityLaserMP.class, new RenderLaser(render));

 

// RenderingRegistry.registerEntityRenderingHandler(EntityTier5Rocket.class, new RenderTier1Rocket(new ModelRocketMP(), "polongnius", "tier5_rocket"));

// RenderingRegistry.registerEntityRenderingHandler(EntityTier5RocketNoFlag.class, new RenderTier1Rocket(new ModelRocketNoFlagMP(), "polongnius", "tier5_rocket"));

RenderingRegistry.registerEntityRenderingHandler(EntityCheeseSpore.class, new RenderCheeseSpore(render));

// RenderingRegistry.registerEntityRenderingHandler(EntityPolongniusMeteorChunk.class, new RenderPolongniusMeteorChunk(render));

// RenderingRegistry.registerEntityRenderingHandler(EntityPolongniusMeteor.class, new RenderPolongniusMeteor(render));

 

// RenderingRegistry.registerEntityRenderingHandler(EntityTier6Rocket.class, new RenderTier1Rocket(new ModelRocketMP(), "nibiru", "tier6_rocket"));

// RenderingRegistry.registerEntityRenderingHandler(EntityTier6RocketNoFlag.class, new RenderTier1Rocket(new ModelRocketNoFlagMP(), "nibiru", "tier6_rocket"));

 

// RenderingRegistry.registerEntityRenderingHandler(EntityKoentusMeteorChunk.class, new RenderKoentusMeteorChunk());

// RenderingRegistry.registerEntityRenderingHandler(EntityKoentusMeteor.class, new RenderKoentusMeteor(render));

 

RenderingRegistry.registerEntityRenderingHandler(EntityVanillaCreamBall.class, new RenderSnowballMP(render, new ItemStack(FronosItems.cream_ball, 1, 0)));

RenderingRegistry.registerEntityRenderingHandler(EntityChocolateCreamBall.class, new RenderSnowballMP(render, new ItemStack(FronosItems.cream_ball, 1, 1)));

RenderingRegistry.registerEntityRenderingHandler(EntityStrawberryCreamBall.class, new RenderSnowballMP(render, new ItemStack(FronosItems.cream_ball, 1, 2)));

RenderingRegistry.registerEntityRenderingHandler(EntityOrangeCreamBall.class, new RenderSnowballMP(render, new ItemStack(FronosItems.cream_ball, 1, 3)));

RenderingRegistry.registerEntityRenderingHandler(EntityTeaCreamBall.class, new RenderSnowballMP(render, new ItemStack(FronosItems.cream_ball, 1, 4)));

RenderingRegistry.registerEntityRenderingHandler(EntityLemonCreamBall.class, new RenderSnowballMP(render, new ItemStack(FronosItems.cream_ball, 1, 5)));

RenderingRegistry.registerEntityRenderingHandler(EntityPoisonArrow.class, new RenderPoisonArrow(render));

//RenderingRegistry.registerEntityRenderingHandler(EntityTier7Rocket.class, new RenderTier7Rocket(EntityRendererMP.tier3RocketModel, "fronos", "tier7_rocket"));

 

RenderingRegistry.registerEntityRenderingHandler(EntityUraniumBomb.class, new RenderUraniumBomb(render));

//RenderingRegistry.registerEntityRenderingHandler(EntityTier8Rocket.class, new RenderTier8Rocket(EntityRendererMP.tier3RocketModel, "kapteynb", "tier8_rocket"));

 

RenderingRegistry.registerEntityRenderingHandler(EntitySiriusSmallFireball.class, new RenderSiriusSmallFireball(render));

 

}

}

 

Posted

1. Has the method 'doRender' been called?

2. GlStateManager.scale(-1.0F, -1.0F, 1.0F); will invert the model and would result in not rendering the inverted faces.

  Why did you scaled it -1.0?

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Posted

You should not copy-paste the code unless you know what the code does and what you are doing..

So what shape do you want?

And check if doRender code has been called. If it is not getting called, then it is regardless of the model code.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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