Skip to content

Commit

Permalink
Fixed duplicate item spawning when using /give command with DE tools.
Browse files Browse the repository at this point in the history
  • Loading branch information
brandon3055 committed Jan 8, 2025
1 parent 185cfa1 commit 1d0fa98
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public boolean canBeHurtBy(DamageSource source) {

@Override
public boolean onEntityItemUpdate(ItemStack stack, ItemEntity entity) {
if (entity.getAge() >= 0) {
if (entity.getAge() >= 0 && entity.pickupDelay != 32767) {
entity.setExtendedLifetime();
}
return super.onEntityItemUpdate(stack, entity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public boolean canBeHurtBy(DamageSource source) {

@Override
public boolean onEntityItemUpdate(ItemStack stack, ItemEntity entity) {
if (entity.getAge() >= 0) {
if (entity.getAge() >= 0 && entity.pickupDelay != 32767) {
entity.setExtendedLifetime();
}
return super.onEntityItemUpdate(stack, entity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public boolean canBeHurtBy(DamageSource source) {

@Override
public boolean onEntityItemUpdate(ItemStack stack, ItemEntity entity) {
if (entity.getAge() >= 0) {
if (entity.getAge() >= 0 && entity.pickupDelay != 32767) {
entity.setExtendedLifetime();
}
return super.onEntityItemUpdate(stack, entity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public boolean canBeHurtBy(DamageSource source) {

@Override
public boolean onEntityItemUpdate(ItemStack stack, ItemEntity entity) {
if (entity.getAge() >= 0) {
if (entity.getAge() >= 0 && entity.pickupDelay != 32767) {
entity.setExtendedLifetime();
}
return super.onEntityItemUpdate(stack, entity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public boolean canBeHurtBy(DamageSource source) {

@Override
public boolean onEntityItemUpdate(ItemStack stack, ItemEntity entity) {
if (entity.getAge() >= 0) {
if (entity.getAge() >= 0 && entity.pickupDelay != 32767) {
entity.setExtendedLifetime();
}
return super.onEntityItemUpdate(stack, entity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public boolean canBeHurtBy(DamageSource source) {

@Override
public boolean onEntityItemUpdate(ItemStack stack, ItemEntity entity) {
if (entity.getAge() >= 0) {
if (entity.getAge() >= 0 && entity.pickupDelay != 32767) {
entity.setExtendedLifetime();
}
return super.onEntityItemUpdate(stack, entity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public boolean canBeHurtBy(DamageSource source) {

@Override
public boolean onEntityItemUpdate(ItemStack stack, ItemEntity entity) {
if (entity.getAge() >= 0) {
if (entity.getAge() >= 0 && entity.pickupDelay != 32767) {
entity.setExtendedLifetime();
}
return super.onEntityItemUpdate(stack, entity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public boolean canBeHurtBy(DamageSource source) {

@Override
public boolean onEntityItemUpdate(ItemStack stack, ItemEntity entity) {
if (entity.getAge() >= 0) {
if (entity.getAge() >= 0 && entity.pickupDelay != 32767) {
entity.setExtendedLifetime();
}
return super.onEntityItemUpdate(stack, entity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void inventoryTick(ItemStack stack, Level world, Entity entity, int itemS

@Override
public boolean onEntityItemUpdate(ItemStack stack, ItemEntity entity) {
if (entity.getAge() >= 0) {
if (entity.getAge() >= 0 && entity.pickupDelay != 32767) {
entity.setExtendedLifetime();
}
if (entity.level() instanceof ServerLevel && TimeKeeper.getServerTick() % 20 == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public boolean canBeHurtBy(DamageSource source) {

@Override
public boolean onEntityItemUpdate(ItemStack stack, ItemEntity entity) {
if (entity.getAge() >= 0) {
if (entity.getAge() >= 0 && entity.pickupDelay != 32767) {
entity.setExtendedLifetime();
}
return super.onEntityItemUpdate(stack, entity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public boolean canBeHurtBy(DamageSource source) {

@Override
public boolean onEntityItemUpdate(ItemStack stack, ItemEntity entity) {
if (entity.getAge() >= 0) {
if (entity.getAge() >= 0 && entity.pickupDelay != 32767) {
entity.setExtendedLifetime();
}
return super.onEntityItemUpdate(stack, entity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public boolean canBeHurtBy(DamageSource source) {

@Override
public boolean onEntityItemUpdate(ItemStack stack, ItemEntity entity) {
if (entity.getAge() >= 0) {
if (entity.getAge() >= 0 && entity.pickupDelay != 32767) {
entity.setExtendedLifetime();
}
return super.onEntityItemUpdate(stack, entity);
Expand Down

0 comments on commit 1d0fa98

Please sign in to comment.