Fully fixed elementals.

This commit is contained in:
WayofTime 2015-07-18 16:38:47 -04:00
parent 07973fb674
commit bf068d1487
5 changed files with 10 additions and 67 deletions

View file

@ -1,9 +1,7 @@
package WayofTime.alchemicalWizardry.common.entity.mob; package WayofTime.alchemicalWizardry.common.entity.mob;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import java.util.List;
import WayofTime.alchemicalWizardry.ModItems;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@ -21,8 +19,8 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.world.World; import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import java.util.List; import WayofTime.alchemicalWizardry.ModItems;
public class EntityElemental extends EntityDemon public class EntityElemental extends EntityDemon
{ {
@ -144,12 +142,6 @@ public class EntityElemental extends EntityDemon
return false; return false;
} }
@SideOnly(Side.CLIENT)
public boolean func_110182_bF()
{
return this.dataWatcher.getWatchableObjectByte(25) != 0;
}
protected void updateEntityActionState() protected void updateEntityActionState()
{ {
if (this.getHealth() <= this.getMaxHealth() / 2.0f && worldObj.rand.nextInt(200) == 0) if (this.getHealth() <= this.getMaxHealth() / 2.0f && worldObj.rand.nextInt(200) == 0)
@ -259,17 +251,6 @@ public class EntityElemental extends EntityDemon
--this.attackCounter; --this.attackCounter;
} }
} }
if (!this.worldObj.isRemote)
{
byte b0 = this.dataWatcher.getWatchableObjectByte(16);
byte b1 = (byte) (this.attackCounter > 10 ? 1 : 0);
if (b0 != b1)
{
this.dataWatcher.updateObject(16, Byte.valueOf(b1));
}
}
} }
/** /**
@ -317,7 +298,6 @@ public class EntityElemental extends EntityDemon
public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
{ {
super.readEntityFromNBT(par1NBTTagCompound); super.readEntityFromNBT(par1NBTTagCompound);
this.setAngry(par1NBTTagCompound.getBoolean("Angry"));
this.setCombatTask(); this.setCombatTask();
} }
@ -353,14 +333,6 @@ public class EntityElemental extends EntityDemon
public void setAttackTarget(EntityLivingBase par1EntityLivingBase) public void setAttackTarget(EntityLivingBase par1EntityLivingBase)
{ {
super.setAttackTarget(par1EntityLivingBase); super.setAttackTarget(par1EntityLivingBase);
if (par1EntityLivingBase == null)
{
this.setAngry(false);
} else if (!this.isTamed())
{
this.setAngry(true);
}
} }
/** /**
@ -376,7 +348,6 @@ public class EntityElemental extends EntityDemon
super.entityInit(); super.entityInit();
this.dataWatcher.addObject(18, this.getHealth()); this.dataWatcher.addObject(18, this.getHealth());
this.dataWatcher.addObject(19, 0); this.dataWatcher.addObject(19, 0);
this.dataWatcher.addObject(25, 0);
} }
/** /**
@ -505,30 +476,6 @@ public class EntityElemental extends EntityDemon
return false; return false;
} }
/**
* Determines whether this wolf is angry or not.
*/
public boolean isAngry()
{
return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0;
}
/**
* Sets whether this wolf is angry or not.
*/
public void setAngry(boolean par1)
{
byte b0 = this.dataWatcher.getWatchableObjectByte(16);
if (par1)
{
this.dataWatcher.updateObject(16, b0 | 2);
} else
{
this.dataWatcher.updateObject(16, b0 & -3);
}
}
/** /**
* Determines if an entity can be despawned, used on idle far away entities * Determines if an entity can be despawned, used on idle far away entities
*/ */

View file

@ -1,7 +1,6 @@
package WayofTime.alchemicalWizardry.common.entity.mob; package WayofTime.alchemicalWizardry.common.entity.mob;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IRangedAttackMob; import net.minecraft.entity.IRangedAttackMob;
import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.SharedMonsterAttributes;

View file

@ -8,7 +8,6 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction; import net.minecraft.item.EnumAction;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;

View file

@ -3,7 +3,6 @@ package WayofTime.alchemicalWizardry.common.renderer.model;
import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.world.World; import net.minecraft.world.World;
public class ModelElemental extends ModelBase public class ModelElemental extends ModelBase
@ -71,11 +70,10 @@ public class ModelElemental extends ModelBase
return; return;
} }
int ratio = 20; float ratio = 0.1f;
float rot = (entity.worldObj.getWorldTime() % ratio) / ratio; float rot = (entity.worldObj.getWorldTime() + f) * ratio;
Shape1.rotateAngleX = f / 5; Shape1.rotateAngleX = rot;
Shape2.rotateAngleZ = f / 5; Shape2.rotateAngleZ = rot;
Shape3.rotateAngleY = f / 5; Shape3.rotateAngleY = rot;
EntityBlaze d;
} }
} }