Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
auxves committed Jan 7, 2021
1 parent cbbc2de commit 034c03c
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,18 @@
import net.minecraft.screen.ScreenHandler;
import net.minecraft.screen.slot.Slot;
import net.minecraft.screen.slot.SlotActionType;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import java.util.List;

@Mixin(ScreenHandler.class)
class ScreenHandlerMixin {
@Shadow @Final public List<Slot> slots;

@Inject(method = "method_30010", at = @At("HEAD"), cancellable = true)
private void onRemoveStack(int slotIndex, int clickType, SlotActionType actionType, PlayerEntity player, CallbackInfoReturnable<ItemStack> cir) {
if (slotIndex < 0) return;

Slot slot = slots.get(slotIndex);
Slot slot = player.currentScreenHandler.slots.get(slotIndex);
if (slot == null) return;

ServerNetworking.INSTANCE.onQuickMove(slot, actionType, player);
Expand Down

0 comments on commit 034c03c

Please sign in to comment.