mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 02:07:37 +01:00
parent
06bac38719
commit
a429b2ad16
@ -41,13 +41,30 @@ public class CraftItem extends CraftEntity implements Item {
|
|||||||
item.pickupDelay = Math.min(delay, Short.MAX_VALUE);
|
item.pickupDelay = Math.min(delay, Short.MAX_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setUnlimitedLifetime(boolean unlimited) {
|
||||||
|
if (unlimited) {
|
||||||
|
// See EntityItem#INFINITE_LIFETIME
|
||||||
|
item.age = Short.MIN_VALUE;
|
||||||
|
} else {
|
||||||
|
item.age = getTicksLived();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isUnlimitedLifetime() {
|
||||||
|
return item.age == Short.MIN_VALUE;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setTicksLived(int value) {
|
public void setTicksLived(int value) {
|
||||||
super.setTicksLived(value);
|
super.setTicksLived(value);
|
||||||
|
|
||||||
// Second field for EntityItem
|
// Second field for EntityItem (don't set if lifetime is unlimited)
|
||||||
|
if (!isUnlimitedLifetime()) {
|
||||||
item.age = value;
|
item.age = value;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setOwner(UUID uuid) {
|
public void setOwner(UUID uuid) {
|
||||||
|
Loading…
Reference in New Issue
Block a user