From 60c0863c76f0e109ca088c07de134ebaff0d3ce5 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Wed, 1 Nov 2023 01:59:14 +0100 Subject: [PATCH] feat: network card --- CHANGELOG.md | 1 + .../common/AbstractModInitializer.java | 2 + .../platform/common/content/ContentIds.java | 1 + .../common/content/CreativeModeTabItems.java | 1 + .../platform/common/content/Items.java | 10 ++ .../common/networking/NetworkCardItem.java | 117 ++++++++++++++++++ .../NetworkCardItemPropertyFunction.java | 24 ++++ .../assets/refinedstorage2/lang/en_us.json | 5 + .../models/item/network_card.json | 17 +++ .../models/item/network_card/active.json | 6 + .../models/item/network_card/inactive.json | 6 + .../textures/item/network_card/active.png | Bin 0 -> 998 bytes .../textures/item/network_card/inactive.png | Bin 0 -> 4852 bytes .../refinedstorage2/recipes/network_card.json | 22 ++++ .../fabric/ClientModInitializerImpl.java | 6 + .../platform/forge/ClientModInitializer.java | 6 + 16 files changed, 224 insertions(+) create mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardItem.java create mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardItemPropertyFunction.java create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/network_card.json create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/network_card/active.json create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/network_card/inactive.json create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/network_card/active.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/network_card/inactive.png create mode 100644 refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/network_card.json diff --git a/CHANGELOG.md b/CHANGELOG.md index e41581516..b0f459f59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Configuration Card. It copies device configurations and can transfer upgrades. - Network Receiver +- Network Card ## [2.0.0-milestone.3.1] - 2023-10-30 diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractModInitializer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractModInitializer.java index 8fefa1e76..0d26b3a58 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractModInitializer.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractModInitializer.java @@ -50,6 +50,7 @@ import com.refinedmods.refinedstorage2.platform.common.importer.ImporterContainerMenu; import com.refinedmods.refinedstorage2.platform.common.misc.ProcessorItem; import com.refinedmods.refinedstorage2.platform.common.misc.WrenchItem; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkCardItem; import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType; import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType; import com.refinedmods.refinedstorage2.platform.common.storage.StorageTypes; @@ -330,6 +331,7 @@ private void registerSimpleItems(final RegistryCallback callback) { ContentIds.CONFIGURATION_CARD, ConfigurationCardItem::new )); + Items.INSTANCE.setNetworkCard(callback.register(ContentIds.NETWORK_CARD, NetworkCardItem::new)); } private void registerProcessor(final RegistryCallback callback, final ProcessorItem.Type type) { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentIds.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentIds.java index 22f82f038..291f8bf78 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentIds.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentIds.java @@ -50,6 +50,7 @@ public final class ContentIds { public static final ResourceLocation STORAGE_MONITOR = createIdentifier("storage_monitor"); public static final ResourceLocation CONFIGURATION_CARD = createIdentifier("configuration_card"); public static final ResourceLocation NETWORK_RECEIVER = createIdentifier("network_receiver"); + public static final ResourceLocation NETWORK_CARD = createIdentifier("network_card"); private ContentIds() { } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/CreativeModeTabItems.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/CreativeModeTabItems.java index cde4fde76..52ca3656b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/CreativeModeTabItems.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/CreativeModeTabItems.java @@ -97,5 +97,6 @@ private static void appendItems(final Consumer consumer) { consumer.accept(Items.INSTANCE.getWirelessGrid().createAtEnergyCapacity()); itemConsumer.accept(Items.INSTANCE.getCreativeWirelessGrid()); itemConsumer.accept(Items.INSTANCE.getConfigurationCard()); + itemConsumer.accept(Items.INSTANCE.getNetworkCard()); } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Items.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Items.java index 608cd7e32..13fca80df 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Items.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Items.java @@ -81,6 +81,8 @@ public final class Items { private Supplier creativeWirelessGrid; @Nullable private Supplier configurationCard; + @Nullable + private Supplier networkCard; private Items() { } @@ -372,4 +374,12 @@ public void addNetworkReceiver(final Supplier supplier) { public List> getNetworkReceivers() { return Collections.unmodifiableList(allNetworkReceivers); } + + public Item getNetworkCard() { + return Objects.requireNonNull(networkCard).get(); + } + + public void setNetworkCard(final Supplier supplier) { + this.networkCard = supplier; + } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardItem.java new file mode 100644 index 000000000..ae97516bd --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardItem.java @@ -0,0 +1,117 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import com.refinedmods.refinedstorage2.platform.api.support.HelpTooltipComponent; + +import java.util.List; +import java.util.Optional; +import javax.annotation.Nullable; + +import net.minecraft.ChatFormatting; +import net.minecraft.core.BlockPos; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.InteractionResultHolder; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.tooltip.TooltipComponent; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.item.context.UseOnContext; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.state.BlockState; + +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; + +// TODO: better active texture. +public class NetworkCardItem extends Item { + private static final MutableComponent UNBOUND_HELP = createTranslation("item", "network_card.unbound_help"); + private static final MutableComponent BOUND_HELP = createTranslation("item", "network_card.bound_help"); + + private static final MutableComponent UNBOUND = createTranslation("item", "network_card.unbound") + .withStyle(ChatFormatting.RED); + + private static final String TAG_POS = "pos"; + private static final String TAG_DIMENSION = "dim"; + + public NetworkCardItem() { + super(new Item.Properties().stacksTo(1)); + } + + @Override + public InteractionResult useOn(final UseOnContext ctx) { + if (ctx.getLevel().isClientSide() || ctx.getPlayer() == null) { + return InteractionResult.CONSUME; + } + final BlockPos pos = ctx.getClickedPos(); + final BlockState blockState = ctx.getLevel().getBlockState(pos); + if (!(blockState.getBlock() instanceof NetworkReceiverBlock)) { + return InteractionResult.CONSUME; + } + final CompoundTag tag = new CompoundTag(); + tag.putLong(TAG_POS, pos.asLong()); + tag.putString(TAG_DIMENSION, ctx.getLevel().dimension().location().toString()); + ctx.getItemInHand().setTag(tag); + ctx.getPlayer().sendSystemMessage(createTranslation( + "item", + "network_card.bound", + pos.getX(), + pos.getY(), + pos.getZ() + )); + return InteractionResult.SUCCESS; + } + + @Override + public InteractionResultHolder use(final Level level, final Player player, final InteractionHand hand) { + if (player.isCrouching()) { + if (!level.isClientSide()) { + player.sendSystemMessage(createTranslation("item", "network_card.unbound")); + } + return new InteractionResultHolder<>(InteractionResult.CONSUME, new ItemStack(this)); + } + return super.use(level, player, hand); + } + + @Override + public void appendHoverText(final ItemStack stack, + @Nullable final Level level, + final List lines, + final TooltipFlag flag) { + super.appendHoverText(stack, level, lines, flag); + if (!isActive(stack)) { + lines.add(UNBOUND); + return; + } + final BlockPos pos = getPosition(stack); + if (pos == null) { + return; + } + lines.add(createTranslation( + "item", + "network_card.bound", + pos.getX(), + pos.getY(), + pos.getZ() + ).withStyle(ChatFormatting.GRAY)); + } + + @Nullable + public BlockPos getPosition(final ItemStack stack) { + if (stack.getTag() == null) { + return null; + } + return BlockPos.of(stack.getTag().getLong(TAG_POS)); + } + + @Override + public Optional getTooltipImage(final ItemStack stack) { + return Optional.of(new HelpTooltipComponent(isActive(stack) ? BOUND_HELP : UNBOUND_HELP)); + } + + public boolean isActive(final ItemStack stack) { + return stack.getTag() != null && stack.getTag().contains(TAG_POS) && stack.getTag().contains(TAG_DIMENSION); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardItemPropertyFunction.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardItemPropertyFunction.java new file mode 100644 index 000000000..f807af445 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardItemPropertyFunction.java @@ -0,0 +1,24 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import javax.annotation.Nullable; + +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.client.renderer.item.ClampedItemPropertyFunction; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.ItemStack; + +public class NetworkCardItemPropertyFunction implements ClampedItemPropertyFunction { + public static final ResourceLocation NAME = new ResourceLocation("active"); + + @Override + public float unclampedCall(final ItemStack itemStack, + @Nullable final ClientLevel clientLevel, + @Nullable final LivingEntity livingEntity, + final int i) { + if (itemStack.getItem() instanceof NetworkCardItem cardItem) { + return cardItem.isActive(itemStack) ? 1 : 0; + } + return 0; + } +} diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json index f5a4215a3..b90e3d6b4 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json @@ -204,6 +204,11 @@ "item.refinedstorage2.configuration_card.applied_configuration": "Applied configuration.", "item.refinedstorage2.configuration_card.empty_help": "Use on a storage network device while crouching to copy its configuration and upgrades to the card.", "item.refinedstorage2.configuration_card.configured_help": "Use on the destination storage network device while crouching to transfer the configuration and upgrades. Use while crouching to clear.", + "item.refinedstorage2.network_card": "Network Card", + "item.refinedstorage2.network_card.unbound_help": "Use while crouching on a Network Receiver.", + "item.refinedstorage2.network_card.unbound": "Unbound.", + "item.refinedstorage2.network_card.bound_help": "Insert into a Network Transmitter. Use while crouching to clear binding.", + "item.refinedstorage2.network_card.bound": "Bound to %d, %d, %d.", "misc.refinedstorage2.stored": "Stored: %s", "misc.refinedstorage2.stored_with_capacity": "Stored: %s / %s (%d%%)", "misc.refinedstorage2.total": "%d total", diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/network_card.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/network_card.json new file mode 100644 index 000000000..9138e7731 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/network_card.json @@ -0,0 +1,17 @@ +{ + "parent": "item/generated", + "overrides": [ + { + "predicate": { + "active": 0 + }, + "model": "refinedstorage2:item/network_card/inactive" + }, + { + "predicate": { + "active": 1 + }, + "model": "refinedstorage2:item/network_card/active" + } + ] +} diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/network_card/active.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/network_card/active.json new file mode 100644 index 000000000..b13105f56 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/network_card/active.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "refinedstorage2:item/network_card/active" + } +} diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/network_card/inactive.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/network_card/inactive.json new file mode 100644 index 000000000..0468d834e --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/network_card/inactive.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "refinedstorage2:item/network_card/inactive" + } +} diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/network_card/active.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/network_card/active.png new file mode 100644 index 0000000000000000000000000000000000000000..02edcd3621d12375c8c8466bc74d90075f0d4dd1 GIT binary patch literal 998 zcmVEX>4Tx04R}tkvmAkP!xv$ri!nMgB^-EWT;LSL`5963Pq?8YK2xEOm6yuCJjl7 zi=*ILaPYBMb#QUk)xlK|1Ro%-E>4OrQsTKup+$@bF8AZV=l{9)TtKLonPzp21DbA| zsYG1NWLL$mSM(u(9z-C>%rfRADGA^Dx~E>MyBN>%@B6d*)ttqEfJi*c4AUmwAfDc| z4bJ<-VOEq?;&b9LlP*a7$aTfzH_io@1)do;)2VslFtJ!@W2KE*(bR~ih@+~eQ@)V# zSmnIMSu0mr^Pc>Lp`5<5%ynABNMI35kRU=q6(y8mBSyPUiiH%N$9?=mu3sXTLaq`R zITlcX2HEw4|H1FsTKUNdFDVoUI$s>;V+82h1sXNS`95}>#t9I72Cnp$zfuQgK1r{& zwCE8qunk;Xw=`uBxZD9EPljyDt`wvtk8{ps& z7%foty3f12+voOgPjh}h=Sp&K*d6B#00006VoOIv0RI600RN!9r;`8x010qNS#tmY z3ljhU3ljkVnw%H_000McNliru=L-P|96BdcXpR5?0pm$TK~y-)wUbY1l5rTvKd(zH z=}@p>UOg8n2oX{tN`j#B9z}z83astY5Twfj=MP~JILNmSf=mc8c@^y@oecvofkx3q z2qy+s{z*!H9ip}63JUhzo(I04=g*f1jx$tMm8z=B{}y*T9og-67a-ASR7N5Z31B!% z914YGDwRUlbw;BRi9~{*ka#>UT`m{X>GbcNg%EP})mRE4WV6|n&1O@oswy>2lYYNn z{!!d+x1|t5UVA^5^v06mFG#IcTUcl5pg5UKQZAQyxv|cP4-g*1(h3YMmzX|#g4Jrp z?RGO53^qHR&iz9-Fq_SoOeVZuFOKarug}8ib70wn3kDe8Sf|lw(C_y#8jbrC>;n`< zAr^}x*Tdm(FwXzzoX_V827}b=b#z@<768M+ zfajlQJS~+lJlrLl&0;hfvDs{Bnug2eqE@R>tyYzTE*wrax8=Q!yX?Jv!@CCp%ls<< zKA(?5p+KclQGU06p>Xw9RPyN~%d;t4TU)eREp%O{SS%|4{14%9SOx+Cd8{A%9mAO3 UTWG%yqyPW_07*qoM6N<$f*}9C;s5{u literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/network_card/inactive.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/network_card/inactive.png new file mode 100644 index 0000000000000000000000000000000000000000..1f23b8d5aa351a0d8f118fbb38cdc9144daf7ff3 GIT binary patch literal 4852 zcmeHLdsGu=79U&?h|)zwPHKG&5no3qnMo$EDFJ~56C@aU3COCGWCEjknFk5@!WX51 zx+u1;igaBc_&P{yU5lt_DO)YBFLYJ(sEe!kD8(*XtLU;{0s?l~v-OVe@{-eRiKGKITTD7yPreY9xp$6KopJ5>S6;+LgLjtl z$o|v?lUJYL`|*2)>!!btmX2ZiZ`JOt`2C4V{>C3J#Xb4-X?$staehPnsqaJe2UYx+ ztqp~*)?*iLFJ@jwgK|PYh-x>@+VkhRwN>`bbuV{#Eoi?Q`P|joI^^cCd+c<-Nq>sS zFCM2Dxq9f=RoT+vqM|`5qBB(`%NG;lj(J_Yn)YhnqA8saf+$jqV2ac%#S}yvzr(F z?efW#K<}||B|E{zPHe7LY?BrHvY*|lZRxCjmN{+r#!WhV@ozR8x9pK-p3%;(ubllP zG=Gc~K6QqBFKn{^trtfs=I*Uwp8IE8$H5nu%j)y<<>3uO8z`-zTsmnMZUkNV_YIax9A15gHApD-tF6g zOhonLk#jXQ*IRxx&9p9yY>5N4^e`X_g5FWmpuEzQ@r1@?V3S&tnqoT*W>9w!6dvg` zlbVH;4OUZGv{AxptEpwdv{u5J%~zsIa}1SD%kwN$QeHx`CU2oetYt+;Fv6V#05DKC z5_TH&Ml0czuspZ~`0f^SSg=RMwot-KQ>x$?lZAqDHqJ&7nUl`pvLYC8xJ9cY5~Z=- z5MU)?W!r3Kg2Qn*9Bc=VZL(x>FtJ$7LAe|*7XccGHP>h(oruvo&JEFpA*HMu3vIU1 zCL`>|B-JLnO~PV@yxyB;iGRPz`O^y-#9$VKuf74q$Z8s?Vds^VF3wS zOKXW}8H$NxrDA@JjEiA1L3FG@AQthWMA6YwAz1V=R~W4}(x{mfk=SzL_%ELtCUJvte|||m>A0D;hr6LDhLn^Ad_?#HvsU+ z0joreg(7VxOR~wNm$2L}!EVc*Z6)YIEomdAq>TcgD3?cI7=dER7)o$)0_RRa!LpCO zNlWW;|ChGAT1IzYEjp!YpJI_{RhLIP9jK6R|r-zhthid1Xx{L znrzaTMS+piU81k$bU&p)sdXZh#QBI&&Ep}s03{JMpc4`B)LOn!#24YZpP^e#I-7&E zP*GWcN5B$=RY~=rb$X! zXb^C$#bof%VYPuKC$#cu~&^18UTQTrf z$^+FkK-XI_@K(wL)%Aa)i_!axNEyMeGzWMB%sii=1y7HI)ib6`p-%VvkH;!XfyCb| zPq#wQkm2r+7qq#I3532jg;M6*GQ`WD$xgqU`waX=a9SaaN)|O7Dy=OVNd^|&l4J%y zTBttUc{0NlR#gT2F~)kY%4Y1#Z}lM+F7Hbze$uJUAuM^7%DTTf$Ct4_I`d>)aL^$2 zh-y}(^mhrHlG)CiK0#j|7#ZO#&)r1kf3Tz&Qx{)YUU%?XaY#}9hhdxI6T`<$ghVw% z*2Zq%aIR(BBO-O*h>H*KcY33niXUkVyZ!KtiAcX^`u{W-Q{T@5R zA3tC6hxiGFQWkUQ;57Ee+qq*V4qAJsByMNbt+vnx?zeZjIW?n4z2oa0HEsKa{7J6e zsrwv5rZ#+4-G+UBZ7MYF6DpYDqdz<+xJc$aHg`kZ_@7=a+ka)@oD-v6S*FG(8M7Wg zFQ~iRULg+)GFN9ZKZ*^M4Lg((us&?t_z2o{<6%8}Wmi|;2w{uW= zOQ?&5D_4an(4lwyBH|$E#umquhj)FBFMqYt)Rq$7bPIx3o`fGhC7N0Vj>U^7j-5F- z%)fS7^Nl9B^z{7jF)>%{_!i~&pSFdD6wMNi+U0xfY9#*GX9YLfO7cLSA%!eKS{Xfm G<-Y+1$?tLi literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/network_card.json b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/network_card.json new file mode 100644 index 000000000..05980b01d --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/network_card.json @@ -0,0 +1,22 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "EEE", + "PAP", + "EEE" + ], + "key": { + "E": { + "item": "refinedstorage2:quartz_enriched_iron" + }, + "P": { + "item": "minecraft:paper" + }, + "A": { + "item": "refinedstorage2:advanced_processor" + } + }, + "result": { + "item": "refinedstorage2:network_card" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java index 4de332cb2..74e4a06b7 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java @@ -12,6 +12,7 @@ import com.refinedmods.refinedstorage2.platform.common.content.Items; import com.refinedmods.refinedstorage2.platform.common.content.KeyMappings; import com.refinedmods.refinedstorage2.platform.common.controller.ControllerModelPredicateProvider; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkCardItemPropertyFunction; import com.refinedmods.refinedstorage2.platform.common.storagemonitor.StorageMonitorBlockEntityRenderer; import com.refinedmods.refinedstorage2.platform.common.support.networkbounditem.NetworkBoundItemItemPropertyFunction; import com.refinedmods.refinedstorage2.platform.common.support.tooltip.CompositeClientTooltipComponent; @@ -367,5 +368,10 @@ private void registerItemProperties() { ConfigurationCardItemPropertyFunction.NAME, new ConfigurationCardItemPropertyFunction() ); + ItemProperties.register( + Items.INSTANCE.getNetworkCard(), + NetworkCardItemPropertyFunction.NAME, + new NetworkCardItemPropertyFunction() + ); } } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ClientModInitializer.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ClientModInitializer.java index 942544f68..32ce072c9 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ClientModInitializer.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ClientModInitializer.java @@ -10,6 +10,7 @@ import com.refinedmods.refinedstorage2.platform.common.content.Items; import com.refinedmods.refinedstorage2.platform.common.content.KeyMappings; import com.refinedmods.refinedstorage2.platform.common.controller.ControllerModelPredicateProvider; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkCardItemPropertyFunction; import com.refinedmods.refinedstorage2.platform.common.storagemonitor.StorageMonitorBlockEntityRenderer; import com.refinedmods.refinedstorage2.platform.common.support.networkbounditem.NetworkBoundItemItemPropertyFunction; import com.refinedmods.refinedstorage2.platform.common.support.tooltip.CompositeClientTooltipComponent; @@ -222,5 +223,10 @@ private static void registerItemProperties() { ConfigurationCardItemPropertyFunction.NAME, new ConfigurationCardItemPropertyFunction() ); + ItemProperties.register( + Items.INSTANCE.getNetworkCard(), + NetworkCardItemPropertyFunction.NAME, + new NetworkCardItemPropertyFunction() + ); } }