Cast, Convert & more

This commit is contained in:
skippyall
2026-03-16 23:01:58 +01:00
parent 9b61dba4c7
commit 7acd083e79
59 changed files with 1207 additions and 178 deletions
@@ -10,6 +10,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.item.tooltip.TooltipType;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import org.jetbrains.annotations.Nullable;
import xyz.nucleoid.packettweaker.PacketContext;
@@ -40,4 +42,10 @@ public class ClipboardItem extends Item implements PolymerItem {
stack.set(MinionComponentTypes.REFERENCE, new InstructionClipboard(minion.getUuid(), instructionName, minion.getGameProfile().getName()));
return stack;
}
public static ItemStack createBlockPosReference(World world, BlockPos pos) {
ItemStack stack = new ItemStack(MinionItems.REFERENCE_ITEM);
stack.set(MinionComponentTypes.REFERENCE, new BlockPosClipboard(world.getRegistryKey(), pos));
return stack;
}
}