|
1 | 1 | --- before/net/minecraft/entity/EntityAgeable.java |
2 | 2 | +++ 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 @@ |
21 | 4 | { |
22 | 5 | if (!this.world.isRemote) |
23 | 6 | { |
|
26 | 9 |
|
27 | 10 | if (oclass != null && this.getClass() == oclass) |
28 | 11 | { |
29 | | -@@ -80,23 +79,22 @@ |
| 12 | +@@ -80,7 +80,7 @@ |
30 | 13 | } |
31 | 14 | else |
32 | 15 | { |
|
35 | 18 | return oclass != null && entityClass == oclass; |
36 | 19 | } |
37 | 20 | } |
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; |
0 commit comments