mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-02 13:07:06 +01:00
Filter negative values for all items.
This commit is contained in:
parent
6d88d545e9
commit
515830cda9
1 changed files with 2 additions and 4 deletions
|
@ -151,14 +151,12 @@ public final class ItemStack {
|
||||||
public void setData(int i) {
|
public void setData(int i) {
|
||||||
// CraftBukkit start - filter out data for items that shouldn't have it
|
// CraftBukkit start - filter out data for items that shouldn't have it
|
||||||
if (!this.usesData()) {
|
if (!this.usesData()) {
|
||||||
this.damage = 0;
|
i = 0;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filter wool to avoid confusing the client
|
// Filter wool to avoid confusing the client
|
||||||
if (this.id == Block.WOOL.id) {
|
if (this.id == Block.WOOL.id) {
|
||||||
this.damage = Math.min(15, i);
|
i = Math.min(15, i);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue