This commit is contained in:
gnembon committed 2020-11-06 00:06:53 -04:00
1 parent 79dc85274d
commit 2cdea92da7
55 files changed
+453 -287

No files matched your search

@@ -7,6 +7,7 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.util.collection.DefaultedList;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
@@ -19,20 +20,21 @@ import java.util.List;
@Mixin(ScreenHandler.class)
public abstract class ContainerMixin
{
@Shadow @Final public List<Slot> slots;
@Shadow public abstract ItemStack onSlotClick(int int_1, int int_2, SlotActionType slotActionType_1, PlayerEntity playerEntity_1);
@Shadow public abstract void sendContentUpdates();
@Inject( method = "onSlotClick", at = @At(value = "HEAD"), cancellable = true)
@Shadow @Final public DefaultedList<Slot> slots;
@Inject( method = "method_30010", at = @At(value = "HEAD"), cancellable = true) // on slot click
private void onThrowClick( int slotId, int clickData, SlotActionType actionType, PlayerEntity playerEntity, CallbackInfoReturnable<ItemStack> cir)
{
if (actionType == SlotActionType.THROW && CarpetSettings.ctrlQCraftingFix && playerEntity.inventory.getCursorStack().isEmpty() && slotId >= 0)
if (actionType == SlotActionType.THROW && CarpetSettings.ctrlQCraftingFix && playerEntity.method_31548().getCursorStack().isEmpty() && slotId >= 0)
{
ItemStack itemStack_1 = ItemStack.EMPTY;
Slot slot_4 = slots.get(slotId);
if (slot_4 != null && slot_4.hasStack() && slot_4.canTakeItems(playerEntity))
if (/*slot_4 != null && */slot_4.hasStack() && slot_4.canTakeItems(playerEntity))
{
if(slotId == 0 && clickData == 1)
{