Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 12:30:06 +01:00
Only filter data from block items, not all of them. Fixes BUKKIT-5047
Dieser Commit ist enthalten in:
Ursprung
f5fad449bd
Commit
fbe062caf5
@ -6,6 +6,8 @@ import java.util.Random;
|
|||||||
import net.minecraft.util.com.google.common.collect.HashMultimap;
|
import net.minecraft.util.com.google.common.collect.HashMultimap;
|
||||||
import net.minecraft.util.com.google.common.collect.Multimap;
|
import net.minecraft.util.com.google.common.collect.Multimap;
|
||||||
|
|
||||||
|
import org.bukkit.craftbukkit.util.CraftMagicNumbers; // CraftBukkit
|
||||||
|
|
||||||
public final class ItemStack {
|
public final class ItemStack {
|
||||||
|
|
||||||
public static final DecimalFormat a = new DecimalFormat("#.###");
|
public static final DecimalFormat a = new DecimalFormat("#.###");
|
||||||
@ -155,13 +157,12 @@ public final class ItemStack {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(this.usesData() || this.getItem().usesDurability())) { // || this.id > 255)) {
|
// Is this a block?
|
||||||
i = 0;
|
if (CraftMagicNumbers.getBlock(CraftMagicNumbers.getId(this.getItem())) != Blocks.AIR) {
|
||||||
}
|
// If vanilla doesn't use data on it don't allow any
|
||||||
|
if (!(this.usesData() || this.getItem().usesDurability())) {
|
||||||
// Filter wool to avoid confusing the client
|
i = 0;
|
||||||
if (this.getItem() == Item.getItemOf(Blocks.WOOL)) {
|
}
|
||||||
i = Math.min(15, i);
|
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren