mappings
This commit is contained in:
1 parent
fd3c8290cf
commit
4dd3cc7fd6
6 files changed
+10
-10
No files matched your search
@@ -23,7 +23,7 @@ public class InventoryHelper
|
||||
public static boolean cleanUpShulkerBoxTag(ItemStack stack)
|
||||
{
|
||||
boolean changed = false;
|
||||
NbtCompound tag = stack.getTag();
|
||||
NbtCompound tag = stack.getNbt();
|
||||
|
||||
if (tag == null || !tag.contains("BlockEntityTag", TAG_COMPOUND))
|
||||
return false;
|
||||
@@ -42,7 +42,7 @@ public class InventoryHelper
|
||||
}
|
||||
if (tag.isEmpty())
|
||||
{
|
||||
stack.setTag(null);
|
||||
stack.setNbt(null);
|
||||
changed = true;
|
||||
}
|
||||
return changed;
|
||||
@@ -50,7 +50,7 @@ public class InventoryHelper
|
||||
|
||||
public static boolean shulkerBoxHasItems(ItemStack stack)
|
||||
{
|
||||
NbtCompound tag = stack.getTag();
|
||||
NbtCompound tag = stack.getNbt();
|
||||
|
||||
if (tag == null || !tag.contains("BlockEntityTag", TAG_COMPOUND))
|
||||
return false;
|
||||
|
||||
@@ -96,7 +96,7 @@ public abstract class ItemEntityMixin extends Entity implements ItemEntityInterf
|
||||
if (selfStack.getItem() == otherStack.getItem()
|
||||
&& !InventoryHelper.shulkerBoxHasItems(selfStack)
|
||||
&& !InventoryHelper.shulkerBoxHasItems(otherStack)
|
||||
&& selfStack.hasTag() == otherStack.hasTag()
|
||||
&& selfStack.hasNbt() == otherStack.hasNbt()
|
||||
&& selfStack.getCount() + otherStack.getCount() <= SHULKERBOX_MAX_STACK_AMOUNT)
|
||||
{
|
||||
int amount = Math.min(otherStack.getCount(), SHULKERBOX_MAX_STACK_AMOUNT - selfStack.getCount());
|
||||
|
||||
@@ -32,7 +32,7 @@ public abstract class PlayerInventory_scarpetEventMixin
|
||||
if (count != stack.getCount()) // res returns false for larger item adding to a almost full ineventory
|
||||
{
|
||||
ItemStack diffStack = new ItemStack(item, count - stack.getCount());
|
||||
diffStack.setTag(stack.getTag());
|
||||
diffStack.setNbt(stack.getNbt());
|
||||
PLAYER_PICKS_UP_ITEM.onItemAction((ServerPlayerEntity) player, null, diffStack);
|
||||
}
|
||||
return res;
|
||||
|
||||
@@ -857,7 +857,7 @@ public class WorldAccess {
|
||||
|
||||
ItemStack tool = new ItemStack(item, 1);
|
||||
if (tag != null)
|
||||
tool.setTag(tag);
|
||||
tool.setNbt(tag);
|
||||
if (playerBreak && state.getHardness(world, where) < 0.0) return Value.FALSE;
|
||||
boolean removed = world.removeBlock(where, false);
|
||||
if (!removed) return Value.FALSE;
|
||||
@@ -902,7 +902,7 @@ public class WorldAccess {
|
||||
return Value.TRUE;
|
||||
if (toolBroke)
|
||||
return Value.NULL;
|
||||
NbtElement outtag = tool.getTag();
|
||||
NbtElement outtag = tool.getNbt();
|
||||
if (outtag == null)
|
||||
return Value.TRUE;
|
||||
return new NBTSerializableValue(() -> outtag);
|
||||
|
||||
@@ -96,10 +96,10 @@ public class NBTSerializableValue extends Value implements ContainerValueInterfa
|
||||
|
||||
public static Value fromStack(ItemStack stack)
|
||||
{
|
||||
if (stack.hasTag())
|
||||
if (stack.hasNbt())
|
||||
{
|
||||
NBTSerializableValue value = new NBTSerializableValue();
|
||||
value.nbtSupplier = stack::getTag;
|
||||
value.nbtSupplier = stack::getNbt;
|
||||
return value;
|
||||
}
|
||||
return Value.NULL;
|
||||
|
||||
Reference in new issue
Block a user