mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-04 22:14:40 +01:00
Fixed issues with infinite items. Thanks for the help Rigby!
Dropped infinite items now become a stack of 1. Our reasoning behind this is that people who want an infinite item can usually give it to themselves or have someone else give it to them through a plugin (most plugins provide this functionality already).
This commit is contained in:
parent
0c56bfb62f
commit
be45f900e5
1 changed files with 5 additions and 0 deletions
|
@ -21,6 +21,11 @@ public class EntityItem extends Entity {
|
||||||
this.height = this.width / 2.0F;
|
this.height = this.width / 2.0F;
|
||||||
this.setPosition(d0, d1, d2);
|
this.setPosition(d0, d1, d2);
|
||||||
this.itemStack = itemstack;
|
this.itemStack = itemstack;
|
||||||
|
// CraftBukkit start - infinite item fix
|
||||||
|
if (this.itemStack.count <= -1) {
|
||||||
|
this.itemStack.count = 1;
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
this.yaw = (float) (Math.random() * 360.0D);
|
this.yaw = (float) (Math.random() * 360.0D);
|
||||||
this.motX = (double) ((float) (Math.random() * 0.20000000298023224D - 0.10000000149011612D));
|
this.motX = (double) ((float) (Math.random() * 0.20000000298023224D - 0.10000000149011612D));
|
||||||
this.motY = 0.20000000298023224D;
|
this.motY = 0.20000000298023224D;
|
||||||
|
|
Loading…
Reference in a new issue