Skip to content

Commit 41600e6

Browse files
Finish cleanup hunks in entity
1 parent 85bf65a commit 41600e6

22 files changed

+229
-6714
lines changed

patches/minecraft/net/minecraft/entity/Entity.java.patch

Lines changed: 46 additions & 1573 deletions
Large diffs are not rendered by default.
Lines changed: 2 additions & 163 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,6 @@
11
--- before/net/minecraft/entity/EntityAgeable.java
22
+++ after/net/minecraft/entity/EntityAgeable.java
3-
@@ -15,7 +15,7 @@
4-
5-
public abstract class EntityAgeable extends EntityCreature
6-
{
7-
- private static final DataParameter<Boolean> BABY = EntityDataManager.createKey(EntityAgeable.class, DataSerializers.BOOLEAN);
8-
+ private static final DataParameter<Boolean> BABY = EntityDataManager.<Boolean>createKey(EntityAgeable.class, DataSerializers.BOOLEAN);
9-
protected int growingAge;
10-
protected int forcedAge;
11-
protected int forcedAgeTimer;
12-
@@ -30,7 +30,6 @@
13-
@Nullable
14-
public abstract EntityAgeable createChild(EntityAgeable ageable);
15-
16-
- @Override
17-
public boolean processInteract(EntityPlayer player, EnumHand hand)
18-
{
19-
ItemStack itemstack = player.getHeldItem(hand);
20-
@@ -39,7 +38,7 @@
3+
@@ -39,7 +39,7 @@
214
{
225
if (!this.world.isRemote)
236
{
@@ -26,7 +9,7 @@
269

2710
if (oclass != null && this.getClass() == oclass)
2811
{
29-
@@ -80,23 +79,22 @@
12+
@@ -80,7 +80,7 @@
3013
}
3114
else
3215
{
@@ -35,147 +18,3 @@
3518
return oclass != null && entityClass == oclass;
3619
}
3720
}
38-
39-
- @Override
40-
protected void entityInit()
41-
{
42-
super.entityInit();
43-
- this.dataManager.register(BABY, false);
44-
+ this.dataManager.register(BABY, Boolean.valueOf(false));
45-
}
46-
47-
public int getGrowingAge()
48-
{
49-
if (this.world.isRemote)
50-
{
51-
- return this.dataManager.get(BABY) ? -1 : 1;
52-
+ return ((Boolean)this.dataManager.get(BABY)).booleanValue() ? -1 : 1;
53-
}
54-
else
55-
{
56-
@@ -107,24 +105,25 @@
57-
public void ageUp(int growthSeconds, boolean updateForcedAge)
58-
{
59-
int i = this.getGrowingAge();
60-
- i += growthSeconds * 20;
61-
+ int j = i;
62-
+ i = i + growthSeconds * 20;
63-
64-
if (i > 0)
65-
{
66-
i = 0;
67-
68-
- if (i < 0)
69-
+ if (j < 0)
70-
{
71-
this.onGrowingAdult();
72-
}
73-
}
74-
75-
- int j = i - i;
76-
+ int k = i - j;
77-
this.setGrowingAge(i);
78-
79-
if (updateForcedAge)
80-
{
81-
- this.forcedAge += j;
82-
+ this.forcedAge += k;
83-
84-
if (this.forcedAgeTimer == 0)
85-
{
86-
@@ -145,12 +144,11 @@
87-
88-
public void setGrowingAge(int age)
89-
{
90-
- this.dataManager.set(BABY, age < 0);
91-
+ this.dataManager.set(BABY, Boolean.valueOf(age < 0));
92-
this.growingAge = age;
93-
this.setScaleForAge(this.isChild());
94-
}
95-
96-
- @Override
97-
public void writeEntityToNBT(NBTTagCompound compound)
98-
{
99-
super.writeEntityToNBT(compound);
100-
@@ -158,7 +156,6 @@
101-
compound.setInteger("ForcedAge", this.forcedAge);
102-
}
103-
104-
- @Override
105-
public void readEntityFromNBT(NBTTagCompound compound)
106-
{
107-
super.readEntityFromNBT(compound);
108-
@@ -166,7 +163,6 @@
109-
this.forcedAge = compound.getInteger("ForcedAge");
110-
}
111-
112-
- @Override
113-
public void notifyDataManagerChange(DataParameter<?> key)
114-
{
115-
if (BABY.equals(key))
116-
@@ -177,7 +173,6 @@
117-
super.notifyDataManagerChange(key);
118-
}
119-
120-
- @Override
121-
public void onLivingUpdate()
122-
{
123-
super.onLivingUpdate();
124-
@@ -188,19 +183,10 @@
125-
{
126-
if (this.forcedAgeTimer % 4 == 0)
127-
{
128-
- this.world
129-
- .spawnParticle(
130-
- EnumParticleTypes.VILLAGER_HAPPY,
131-
- this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width,
132-
- this.posY + 0.5 + (double)(this.rand.nextFloat() * this.height),
133-
- this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width,
134-
- 0.0,
135-
- 0.0,
136-
- 0.0
137-
- );
138-
+ this.world.spawnParticle(EnumParticleTypes.VILLAGER_HAPPY, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, 0.0D, 0.0D, 0.0D);
139-
}
140-
141-
- this.forcedAgeTimer--;
142-
+ --this.forcedAgeTimer;
143-
}
144-
}
145-
else
146-
@@ -209,7 +195,8 @@
147-
148-
if (i < 0)
149-
{
150-
- this.setGrowingAge(++i);
151-
+ ++i;
152-
+ this.setGrowingAge(i);
153-
154-
if (i == 0)
155-
{
156-
@@ -218,7 +205,8 @@
157-
}
158-
else if (i > 0)
159-
{
160-
- this.setGrowingAge(--i);
161-
+ --i;
162-
+ this.setGrowingAge(i);
163-
}
164-
}
165-
}
166-
@@ -227,7 +215,6 @@
167-
{
168-
}
169-
170-
- @Override
171-
public boolean isChild()
172-
{
173-
return this.getGrowingAge() < 0;
174-
@@ -238,7 +225,6 @@
175-
this.setScale(child ? 0.5F : 1.0F);
176-
}
177-
178-
- @Override
179-
protected final void setSize(float width, float height)
180-
{
181-
boolean flag = this.ageWidth > 0.0F;
Lines changed: 14 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,46 @@
11
--- before/net/minecraft/entity/EntityFlying.java
22
+++ after/net/minecraft/entity/EntityFlying.java
3-
@@ -12,34 +12,31 @@
4-
super(worldIn);
5-
}
6-
7-
- @Override
8-
public void fall(float distance, float damageMultiplier)
9-
{
10-
}
11-
12-
- @Override
13-
protected void updateFallState(double y, boolean onGroundIn, IBlockState state, BlockPos pos)
14-
{
15-
}
16-
17-
- @Override
18-
public void travel(float strafe, float vertical, float forward)
19-
{
20-
if (this.isInWater())
21-
{
22-
this.moveRelative(strafe, vertical, forward, 0.02F);
23-
this.move(MoverType.SELF, this.motionX, this.motionY, this.motionZ);
24-
- this.motionX *= 0.8F;
25-
- this.motionY *= 0.8F;
26-
- this.motionZ *= 0.8F;
27-
+ this.motionX *= 0.800000011920929D;
28-
+ this.motionY *= 0.800000011920929D;
29-
+ this.motionZ *= 0.800000011920929D;
30-
}
31-
else if (this.isInLava())
32-
{
33-
this.moveRelative(strafe, vertical, forward, 0.02F);
34-
this.move(MoverType.SELF, this.motionX, this.motionY, this.motionZ);
35-
- this.motionX *= 0.5;
36-
- this.motionY *= 0.5;
37-
- this.motionZ *= 0.5;
38-
+ this.motionX *= 0.5D;
39-
+ this.motionY *= 0.5D;
40-
+ this.motionZ *= 0.5D;
41-
}
42-
else
43-
{
44-
@@ -47,17 +44,9 @@
3+
@@ -47,17 +47,14 @@
454

465
if (this.onGround)
476
{
487
- f = this.world
498
- .getBlockState(
50-
- new BlockPos(
51-
- MathHelper.floor(this.posX),
52-
- MathHelper.floor(this.getEntityBoundingBox().minY) - 1,
53-
- MathHelper.floor(this.posZ)
9+
+ BlockPos underPos =
10+
new BlockPos(
11+
MathHelper.floor(this.posX),
12+
MathHelper.floor(this.getEntityBoundingBox().minY) - 1,
13+
MathHelper.floor(this.posZ)
5414
- )
5515
- )
5616
- .getBlock()
5717
- .slipperiness
5818
- * 0.91F;
59-
+ BlockPos underPos = new BlockPos(MathHelper.floor(this.posX), MathHelper.floor(this.getEntityBoundingBox().minY) - 1, MathHelper.floor(this.posZ));
19+
+ );
6020
+ IBlockState underState = this.world.getBlockState(underPos);
6121
+ f = underState.getBlock().getSlipperiness(underState, this.world, underPos, this) * 0.91F;
6222
}
6323

6424
float f1 = 0.16277136F / (f * f * f);
65-
@@ -66,17 +55,9 @@
25+
@@ -66,17 +63,14 @@
6626

6727
if (this.onGround)
6828
{
6929
- f = this.world
7030
- .getBlockState(
71-
- new BlockPos(
72-
- MathHelper.floor(this.posX),
73-
- MathHelper.floor(this.getEntityBoundingBox().minY) - 1,
74-
- MathHelper.floor(this.posZ)
31+
+ BlockPos underPos =
32+
new BlockPos(
33+
MathHelper.floor(this.posX),
34+
MathHelper.floor(this.getEntityBoundingBox().minY) - 1,
35+
MathHelper.floor(this.posZ)
7536
- )
7637
- )
7738
- .getBlock()
7839
- .slipperiness
7940
- * 0.91F;
80-
+ BlockPos underPos = new BlockPos(MathHelper.floor(this.posX), MathHelper.floor(this.getEntityBoundingBox().minY) - 1, MathHelper.floor(this.posZ));
41+
+ );
8142
+ IBlockState underState = this.world.getBlockState(underPos);
8243
+ f = underState.getBlock().getSlipperiness(underState, this.world, underPos, this) * 0.91F;
8344
}
8445

8546
this.move(MoverType.SELF, this.motionX, this.motionY, this.motionZ);
86-
@@ -95,11 +76,10 @@
87-
f2 = 1.0F;
88-
}
89-
90-
- this.limbSwingAmount = this.limbSwingAmount + (f2 - this.limbSwingAmount) * 0.4F;
91-
- this.limbSwing = this.limbSwing + this.limbSwingAmount;
92-
+ this.limbSwingAmount += (f2 - this.limbSwingAmount) * 0.4F;
93-
+ this.limbSwing += this.limbSwingAmount;
94-
}
95-
96-
- @Override
97-
public boolean isOnLadder()
98-
{
99-
return false;

0 commit comments

Comments
 (0)