Skip to content

Commit

Permalink
Server-Side Config Gating for Backpack
Browse files Browse the repository at this point in the history
  • Loading branch information
hammy275 committed Apr 29, 2022
1 parent d8374ac commit 112d4b6
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.blf02.immersivemc.common.network.packet;

import net.blf02.immersivemc.common.config.ActiveConfig;
import net.blf02.immersivemc.server.swap.Swap;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.network.PacketBuffer;
Expand All @@ -26,6 +27,7 @@ public static InventorySwapPacket decode(PacketBuffer buffer) {

public static void handle(InventorySwapPacket message, Supplier<NetworkEvent.Context> ctx) {
ctx.get().enqueueWork(() -> {
if (!ActiveConfig.useBackpack) return;
ServerPlayerEntity player = ctx.get().getSender();
if (player != null) {
Swap.handleInventorySwap(player, message.slot, Hand.MAIN_HAND);
Expand Down

0 comments on commit 112d4b6

Please sign in to comment.