Initial 1.11.2 update

This commit is contained in:
Electroblob
2018-02-07 21:15:50 +00:00
parent 67f6be0671
commit 3df5597dcc
368 changed files with 17234 additions and 15082 deletions
@@ -17,61 +17,61 @@ import net.minecraft.util.text.ITextComponent;
import net.minecraft.world.World;
public class EntityDecoy extends EntitySummonedCreature {
public EntityDecoy(World world){
super(world);
}
public EntityDecoy(World world, double x, double y, double z, EntityLivingBase caster, int lifetime) {
public EntityDecoy(World world, double x, double y, double z, EntityLivingBase caster, int lifetime){
super(world, x, y, z, caster, lifetime);
this.setAlwaysRenderNameTag(caster instanceof EntityPlayer);
this.setAlwaysRenderNameTag(caster instanceof EntityPlayer);
}
@Override
protected void initEntityAI() {
protected void initEntityAI(){
// Decoys just wander around aimlessly, watching anything living.
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIWander(this, 1.0D));
this.tasks.addTask(2, new EntityAIWatchClosest(this, EntityLivingBase.class, 6.0F));
this.tasks.addTask(3, new EntityAILookIdle(this));
this.tasks.addTask(1, new EntityAIWander(this, 1.0D));
this.tasks.addTask(2, new EntityAIWatchClosest(this, EntityLivingBase.class, 6.0F));
this.tasks.addTask(3, new EntityAILookIdle(this));
}
@Override
public void onDespawn(){
super.onDespawn();
for(int i=0; i<20; i++){
Wizardry.proxy.spawnParticle(WizardryParticleType.DUST, worldObj, this.posX + (this.rand.nextDouble()-0.5)*this.width,
this.getEntityBoundingBox().minY + this.rand.nextDouble()*this.height, this.posZ + (this.rand.nextDouble()-0.5)*this.width,
0, 0, 0, 40, 0.2f, 1.0f, 0.8f);
for(int i = 0; i < 20; i++){
Wizardry.proxy.spawnParticle(WizardryParticleType.DUST, world,
this.posX + (this.rand.nextDouble() - 0.5) * this.width,
this.getEntityBoundingBox().minY + this.rand.nextDouble() * this.height,
this.posZ + (this.rand.nextDouble() - 0.5) * this.width, 0, 0, 0, 40, 0.2f, 1.0f, 0.8f);
}
}
@Override
public boolean isEntityInvulnerable(DamageSource source){
return true;
}
@Override
public boolean isSneaking(){
return false;
}
@Override
public void onUpdate() {
public void onUpdate(){
super.onUpdate();
if(this.getCaster() == null || this.getCaster().isDead){
this.setDead();
this.onDespawn();
}
}
@Override
protected void applyEntityAttributes()
{
protected void applyEntityAttributes(){
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
}
@Override
public ITextComponent getDisplayName(){
if(getCaster() instanceof EntityPlayer){
@@ -87,7 +87,7 @@ public class EntityDecoy extends EntitySummonedCreature {
}
@Override
public boolean hasRangedAttack() {
public boolean hasRangedAttack(){
return false;
}
@@ -101,7 +101,8 @@ public class EntityDecoy extends EntitySummonedCreature {
public void readSpawnData(ByteBuf data){
super.readSpawnData(data);
if(!data.isReadable()) return;
this.setCasterReference(new WeakReference<EntityLivingBase>((EntityLivingBase)this.worldObj.getEntityByID(data.readInt())));
this.setCasterReference(
new WeakReference<EntityLivingBase>((EntityLivingBase)this.world.getEntityByID(data.readInt())));
}
}