Updated MCP names, fixed entity movement
This commit is contained in:
parent
d739eb966e
commit
ab944b9b3f
|
@ -1,4 +1,4 @@
|
|||
minecraft_version=1.9
|
||||
forge_version=12.16.0.1807-1.9
|
||||
mod_version=4.0.0
|
||||
mappings_version=snapshot_nodoc_20160318
|
||||
mappings_version=snapshot_nodoc_20160324
|
|
@ -18,6 +18,7 @@ import net.minecraft.entity.IEntityLivingData;
|
|||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.entity.ai.EntityMoveHelper;
|
||||
import net.minecraft.entity.ai.EntityMoveHelper.Action;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -54,7 +55,7 @@ public class EntityButterfly extends EntityFlying implements IMob {
|
|||
protected void entityInit()
|
||||
{
|
||||
super.entityInit();
|
||||
this.dataWatcher.register(TYPE, Byte.valueOf((byte)0));
|
||||
this.dataManager.register(TYPE, Byte.valueOf((byte)0));
|
||||
}
|
||||
|
||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
||||
|
@ -92,12 +93,12 @@ public class EntityButterfly extends EntityFlying implements IMob {
|
|||
|
||||
public int getButterflyType()
|
||||
{
|
||||
return (int) this.dataWatcher.get(TYPE);
|
||||
return (int) this.dataManager.get(TYPE);
|
||||
}
|
||||
|
||||
public void setButterflyType(int butterflyTypeId)
|
||||
{
|
||||
this.dataWatcher.set(TYPE, Byte.valueOf((byte)butterflyTypeId));
|
||||
this.dataManager.set(TYPE, Byte.valueOf((byte)butterflyTypeId));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -225,7 +226,6 @@ public class EntityButterfly extends EntityFlying implements IMob {
|
|||
private int courseChangeCooldown = 0;
|
||||
private double closeEnough = 0.3D;
|
||||
private ButterflyMoveTargetPos targetPos = new ButterflyMoveTargetPos();
|
||||
private boolean update;
|
||||
|
||||
public ButterflyMoveHelper()
|
||||
{
|
||||
|
@ -243,7 +243,7 @@ public class EntityButterfly extends EntityFlying implements IMob {
|
|||
public void onUpdateMoveHelper()
|
||||
{
|
||||
// if we have arrived at the previous target, or we have no target to aim for, do nothing
|
||||
if (!this.update) {return;}
|
||||
if (this.action != Action.MOVE_TO) {return;}
|
||||
|
||||
if (this.courseChangeCooldown-- > 0) {
|
||||
// limit the rate at which we change course
|
||||
|
@ -267,10 +267,10 @@ public class EntityButterfly extends EntityFlying implements IMob {
|
|||
if (!this.targetPos.isPathClear(5.0D))
|
||||
{
|
||||
//System.out.println("Abandoning move target - way is blocked" );
|
||||
this.update = false;
|
||||
this.action = Action.WAIT;
|
||||
} else if (this.targetPos.dist < this.closeEnough) {
|
||||
//System.out.println("Arrived (close enough) dist:"+this.targetPos.dist);
|
||||
this.update = false;
|
||||
this.action = Action.WAIT;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -202,7 +202,6 @@ public class EntityPixie extends EntityFlying implements IMob {
|
|||
private int courseChangeCooldown = 0;
|
||||
private double closeEnough = 0.3D;
|
||||
private PixieMoveTargetPos targetPos = new PixieMoveTargetPos();
|
||||
private boolean update;
|
||||
|
||||
public PixieMoveHelper()
|
||||
{
|
||||
|
@ -220,7 +219,7 @@ public class EntityPixie extends EntityFlying implements IMob {
|
|||
public void onUpdateMoveHelper()
|
||||
{
|
||||
// if we have arrived at the previous target, or we have no target to aim for, do nothing
|
||||
if (!this.update) {return;}
|
||||
if (this.action != Action.MOVE_TO) {return;}
|
||||
|
||||
if (this.courseChangeCooldown-- > 0) {
|
||||
// limit the rate at which we change course
|
||||
|
@ -244,10 +243,10 @@ public class EntityPixie extends EntityFlying implements IMob {
|
|||
if (!this.targetPos.isPathClear(5.0D))
|
||||
{
|
||||
//System.out.println("Abandoning move target - way is blocked" );
|
||||
this.update = false;
|
||||
this.action = Action.WAIT;
|
||||
} else if (this.targetPos.dist < this.closeEnough) {
|
||||
//System.out.println("Arrived (close enough) dist:"+this.targetPos.dist);
|
||||
this.update = false;
|
||||
this.action = Action.WAIT;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ import net.minecraft.entity.SharedMonsterAttributes;
|
|||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer;
|
||||
import net.minecraft.entity.ai.EntityMoveHelper;
|
||||
import net.minecraft.entity.ai.EntityMoveHelper.Action;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
@ -151,7 +152,6 @@ public class EntityWasp extends EntityFlying implements IMob {
|
|||
private int courseChangeCooldown = 0;
|
||||
private double closeEnough = 0.3D;
|
||||
private WaspMoveTargetPos targetPos = new WaspMoveTargetPos();
|
||||
private boolean update;
|
||||
|
||||
public WaspMoveHelper()
|
||||
{
|
||||
|
@ -169,7 +169,7 @@ public class EntityWasp extends EntityFlying implements IMob {
|
|||
public void onUpdateMoveHelper()
|
||||
{
|
||||
// if we have arrived at the previous target, or we have no target to aim for, do nothing
|
||||
if (!this.update) {return;}
|
||||
if (this.action != Action.MOVE_TO) {return;}
|
||||
|
||||
if (this.courseChangeCooldown-- > 0) {
|
||||
// limit the rate at which we change course
|
||||
|
@ -201,10 +201,10 @@ public class EntityWasp extends EntityFlying implements IMob {
|
|||
if (!this.targetPos.isPathClear(5.0D))
|
||||
{
|
||||
//System.out.println("Abandoning move target - way is blocked" );
|
||||
this.update = false;
|
||||
this.action = Action.WAIT;
|
||||
} else if (this.targetPos.dist < this.closeEnough) {
|
||||
//System.out.println("Arrived (close enough) dist:"+this.targetPos.dist);
|
||||
this.update = false;
|
||||
this.action = Action.WAIT;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -58,17 +58,17 @@ public class EntityDart extends EntityArrow
|
|||
@Override
|
||||
protected void entityInit()
|
||||
{
|
||||
this.dataWatcher.register(TYPE, Byte.valueOf((byte)0));
|
||||
this.dataManager.register(TYPE, Byte.valueOf((byte)0));
|
||||
}
|
||||
|
||||
public void setDartType(ItemDart.DartType dartType)
|
||||
{
|
||||
dataWatcher.set(TYPE, (byte)dartType.ordinal());
|
||||
dataManager.set(TYPE, (byte)dartType.ordinal());
|
||||
}
|
||||
|
||||
public ItemDart.DartType getDartType()
|
||||
{
|
||||
return ItemDart.DartType.values()[dataWatcher.get(TYPE)];
|
||||
return ItemDart.DartType.values()[dataManager.get(TYPE)];
|
||||
}
|
||||
|
||||
// TODO: read/write to NBT?
|
||||
|
|
|
@ -70,7 +70,7 @@ public class ItemBOPSpawnEgg extends Item implements IColoredItem
|
|||
if (entity instanceof EntityLivingBase)
|
||||
{
|
||||
EntityLiving entityliving = (EntityLiving)entity;
|
||||
entity.setLocationAndAngles(x, y, z, MathHelper.wrapAngleTo180_float(worldIn.rand.nextFloat() * 360.0F), 0.0F);
|
||||
entity.setLocationAndAngles(x, y, z, MathHelper.wrapDegrees(worldIn.rand.nextFloat() * 360.0F), 0.0F);
|
||||
entityliving.rotationYawHead = entityliving.rotationYaw;
|
||||
entityliving.renderYawOffset = entityliving.rotationYaw;
|
||||
entityliving.onInitialSpawn(worldIn.getDifficultyForLocation(new BlockPos(entityliving)), (IEntityLivingData)null);
|
||||
|
|
|
@ -121,7 +121,7 @@ public class ItemJarFilled extends Item
|
|||
if (world.provider.isSurfaceWorld())
|
||||
{
|
||||
EntityPixie pixie = new EntityPixie(world);
|
||||
pixie.setLocationAndAngles(releasePoint.xCoord, releasePoint.yCoord, releasePoint.zCoord, MathHelper.wrapAngleTo180_float(world.rand.nextFloat() * 360.0F), 0.0F);
|
||||
pixie.setLocationAndAngles(releasePoint.xCoord, releasePoint.yCoord, releasePoint.zCoord, MathHelper.wrapDegrees(world.rand.nextFloat() * 360.0F), 0.0F);
|
||||
world.spawnEntityInWorld(pixie);
|
||||
pixie.playLivingSound();
|
||||
if (stack.hasDisplayName()) {pixie.setCustomNameTag(stack.getDisplayName());}
|
||||
|
|
Loading…
Reference in New Issue