mirror of
https://github.com/Ellpeck/PrettyPipes.git
synced 2024-11-22 11:53:29 +01:00
parent
bcfd9e7bf9
commit
bee6f7ef0b
2 changed files with 3 additions and 3 deletions
|
@ -2,7 +2,6 @@ package de.ellpeck.prettypipes.misc;
|
||||||
|
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
|
||||||
|
|
||||||
import java.util.function.BiFunction;
|
import java.util.function.BiFunction;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
@ -10,7 +9,7 @@ import java.util.function.Supplier;
|
||||||
public class ItemEquality {
|
public class ItemEquality {
|
||||||
|
|
||||||
public static final ItemEquality DAMAGE = new ItemEquality((stack, filter) -> stack.getDamageValue() == filter.getDamageValue(), false, Type.DAMAGE);
|
public static final ItemEquality DAMAGE = new ItemEquality((stack, filter) -> stack.getDamageValue() == filter.getDamageValue(), false, Type.DAMAGE);
|
||||||
public static final ItemEquality NBT = new ItemEquality(ItemStack::isSameItemSameTags, false, Type.NBT);
|
public static final ItemEquality NBT = new ItemEquality(ItemStack::tagMatches, false, Type.NBT);
|
||||||
public static final ItemEquality MOD = new ItemEquality((stack, filter) -> stack.getItem().getCreatorModId(stack).equals(filter.getItem().getCreatorModId(filter)), true, Type.MOD);
|
public static final ItemEquality MOD = new ItemEquality((stack, filter) -> stack.getItem().getCreatorModId(stack).equals(filter.getItem().getCreatorModId(filter)), true, Type.MOD);
|
||||||
|
|
||||||
public final Type type;
|
public final Type type;
|
||||||
|
|
|
@ -36,7 +36,8 @@ public class PacketRequest {
|
||||||
|
|
||||||
public static void toBytes(PacketRequest packet, FriendlyByteBuf buf) {
|
public static void toBytes(PacketRequest packet, FriendlyByteBuf buf) {
|
||||||
buf.writeBlockPos(packet.pos);
|
buf.writeBlockPos(packet.pos);
|
||||||
buf.writeItem(packet.stack);
|
// if we limit the tag here, non-shared data will be omitted, making the requested item not match the stored one
|
||||||
|
buf.writeItemStack(packet.stack, false);
|
||||||
buf.writeVarInt(packet.amount);
|
buf.writeVarInt(packet.amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue