use of com.simibubi.create.content.logistics.RedstoneLinkNetworkHandler.Frequency in project Create by Creators-of-Create.
the class LinkedControllerBindPacket method handleItem.
@Override
protected void handleItem(ServerPlayer player, ItemStack heldItem) {
if (player.isSpectator())
return;
ItemStackHandler frequencyItems = LinkedControllerItem.getFrequencyItems(heldItem);
LinkBehaviour linkBehaviour = TileEntityBehaviour.get(player.level, linkLocation, LinkBehaviour.TYPE);
if (linkBehaviour == null)
return;
Pair<Frequency, Frequency> pair = linkBehaviour.getNetworkKey();
frequencyItems.setStackInSlot(button * 2, pair.getKey().getStack().copy());
frequencyItems.setStackInSlot(button * 2 + 1, pair.getValue().getStack().copy());
heldItem.getTag().put("Items", frequencyItems.serializeNBT());
}
Aggregations