11package dev .tonimatas .mekanismcurios .networking ;
22
33import dev .tonimatas .mekanismcurios .MekanismCurios ;
4- import mekanism .api .security .IItemSecurityUtils ;
5- import mekanism .common .item .ItemPortableQIODashboard ;
6- import mekanism .common .lib .security .ItemSecurityUtils ;
7- import net .minecraft .nbt .CompoundTag ;
84import net .minecraft .network .FriendlyByteBuf ;
95import net .minecraft .network .codec .StreamCodec ;
106import net .minecraft .network .protocol .common .custom .CustomPacketPayload ;
117import net .minecraft .resources .ResourceLocation ;
12- import net .minecraft .server .level .ServerPlayer ;
13- import net .minecraft .world .InteractionHand ;
14- import net .minecraft .world .InteractionResultHolder ;
158import net .minecraft .world .entity .player .Player ;
169import net .minecraft .world .item .ItemStack ;
1710import net .minecraft .world .level .Level ;
1811import net .neoforged .neoforge .network .handling .IPayloadContext ;
1912import org .jetbrains .annotations .NotNull ;
20- import top .theillusivec4 .curios .api .CuriosApi ;
21- import top .theillusivec4 .curios .api .type .capability .ICuriosItemHandler ;
22- import top .theillusivec4 .curios .api .type .inventory .ICurioStacksHandler ;
23-
24- import java .util .Map ;
25- import java .util .Optional ;
2613
2714public record OpenPortableQIOPacket () implements CustomPacketPayload {
2815 public static final CustomPacketPayload .Type <OpenPortableQIOPacket > TYPE =
@@ -35,27 +22,14 @@ public record OpenPortableQIOPacket() implements CustomPacketPayload {
3522 return TYPE ;
3623 }
3724
38- @ SuppressWarnings ("DataFlowIssue" )
25+ @ SuppressWarnings ({ "DataFlowIssue" , "unused" } )
3926 public static void handle (final OpenPortableQIOPacket packet , final IPayloadContext context ) {
4027 context .enqueueWork (() -> {
4128 Player player = context .player ();
4229 Level level = player .level ();
4330 ItemStack stack = MekanismCurios .getQIO (player );
4431
45- if (stack .getItem () instanceof ItemPortableQIODashboard itemPortableQIODashboard ) {
46-
47- }
48-
4932 stack .use (level , player , null );
50- // Mekanism start - Modified code of ItemSecurityUtils#claimOrOpenGui
51- //if (!stack.isEmpty() && stack.getItem() instanceof ItemPortableQIODashboard portableQIO) {
52- // if (!ItemSecurityUtils.get().tryClaimItem(level, player, stack)) {
53- // if (IItemSecurityUtils.INSTANCE.canAccessOrDisplayError(player, stack) && stack.getCount() == 1 && !level.isClientSide) {
54- // portableQIO.getContainerType().tryOpenGui((ServerPlayer) player, null, stack);
55- // }
56- // }
57- //}
58- // Mekanism stop
5933 });
6034 }
6135}
0 commit comments