@@ -71,6 +71,7 @@ public ItemStack getBowItem() {
71
71
return this .dataTracker .get (BOW_ITEM_STACK );
72
72
}
73
73
74
+ @ Override
74
75
protected void initDataTracker () {
75
76
super .initDataTracker ();
76
77
this .dataTracker .startTracking (THROWING_STACK , ItemStack .EMPTY );
@@ -90,6 +91,7 @@ public void setSpeedDamage(boolean speedDamage) {
90
91
this .dataTracker .set (SPEED_DAMAGE , speedDamage );
91
92
}
92
93
94
+ @ Override
93
95
public void tick () {
94
96
if (this .inGroundTime > 4 ) {
95
97
this .dealtDamage = true ;
@@ -142,11 +144,13 @@ public boolean isEnchanted() {
142
144
return this .dataTracker .get (ENCHANTED );
143
145
}
144
146
147
+ @ Override
145
148
@ Nullable
146
149
protected EntityHitResult getEntityCollision (Vec3d currentPosition , Vec3d nextPosition ) {
147
150
return this .dealtDamage ? null : super .getEntityCollision (currentPosition , nextPosition );
148
151
}
149
152
153
+ @ Override
150
154
protected void onEntityHit (EntityHitResult entityHitResult ) {
151
155
Entity entity = entityHitResult .getEntity ();
152
156
float damage = getProjectileDamage ();
@@ -204,6 +208,7 @@ public boolean hasChanneling() {
204
208
return EnchantmentHelper .hasChanneling (this .thrownStack );
205
209
}
206
210
211
+ @ Override
207
212
protected boolean tryPickup (PlayerEntity player ) {
208
213
int slotId = this .dataTracker .get (PREFERRED_SLOT );
209
214
boolean earlyPickup = switch (this .pickupType ) {
@@ -237,17 +242,20 @@ public void setDamageToDeal(boolean hasDamage) {
237
242
this .dealtDamage = !hasDamage ;
238
243
}
239
244
245
+ @ Override
240
246
protected SoundEvent getHitSound () {
241
247
return SoundEvents .ITEM_TRIDENT_HIT_GROUND ;
242
248
}
243
249
250
+ @ Override
244
251
public void onPlayerCollision (PlayerEntity player ) {
245
252
if (this .isOwner (player ) || this .getOwner () == null ) {
246
253
super .onPlayerCollision (player );
247
254
}
248
255
249
256
}
250
257
258
+ @ Override
251
259
public void readCustomDataFromNbt (NbtCompound nbt ) {
252
260
super .readCustomDataFromNbt (nbt );
253
261
if (nbt .contains ("ThrownItem" , 10 )) {
@@ -263,13 +271,15 @@ public void readCustomDataFromNbt(NbtCompound nbt) {
263
271
this .dataTracker .set (LOYALTY , (byte ) EnchantmentHelper .getLoyalty (this .thrownStack ));
264
272
}
265
273
274
+ @ Override
266
275
public void writeCustomDataToNbt (NbtCompound nbt ) {
267
276
super .writeCustomDataToNbt (nbt );
268
277
nbt .put ("ThrownItem" , this .thrownStack .writeNbt (new NbtCompound ()));
269
278
nbt .put ("BowItem" , this .getBowItem ().writeNbt (new NbtCompound ()));
270
279
nbt .putBoolean ("DealtDamage" , this .dealtDamage );
271
280
}
272
281
282
+ @ Override
273
283
public void age () {
274
284
int i = this .dataTracker .get (LOYALTY );
275
285
if (this .pickupType != PickupPermission .ALLOWED || i <= 0 ) {
@@ -278,10 +288,12 @@ public void age() {
278
288
279
289
}
280
290
291
+ @ Override
281
292
protected float getDragInWater () {
282
293
return waterDrag ;
283
294
}
284
295
296
+ @ Override
285
297
public boolean shouldRender (double cameraX , double cameraY , double cameraZ ) {
286
298
return true ;
287
299
}
0 commit comments