package net.minecraft.world.inventory;

import javax.annotation.Nullable;
import net.minecraft.resources.ResourceLocation;
import com.mojang.datafixers.util.Pair;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.Container;

public class Slot {
    private final int slot;
    public final Container container;
    public int index;
    public final int x;
    public final int y;
    
    public Slot(final Container aje, final int integer2, final int integer3, final int integer4) {
        this.container = aje;
        this.slot = integer2;
        this.x = integer3;
        this.y = integer4;
    }
    
    public void onQuickCraft(final ItemStack ben1, final ItemStack ben2) {
        final int integer4 = ben2.getCount() - ben1.getCount();
        if (integer4 > 0) {
            this.onQuickCraft(ben2, integer4);
        }
    }
    
    protected void onQuickCraft(final ItemStack ben, final int integer) {
    }
    
    protected void onSwapCraft(final int integer) {
    }
    
    protected void checkTakeAchievements(final ItemStack ben) {
    }
    
    public ItemStack onTake(final Player ayj, final ItemStack ben) {
        this.setChanged();
        return ben;
    }
    
    public boolean mayPlace(final ItemStack ben) {
        return true;
    }
    
    public ItemStack getItem() {
        return this.container.getItem(this.slot);
    }
    
    public boolean hasItem() {
        return !this.getItem().isEmpty();
    }
    
    public void set(final ItemStack ben) {
        this.container.setItem(this.slot, ben);
        this.setChanged();
    }
    
    public void setChanged() {
        this.container.setChanged();
    }
    
    public int getMaxStackSize() {
        return this.container.getMaxStackSize();
    }
    
    public int getMaxStackSize(final ItemStack ben) {
        return this.getMaxStackSize();
    }
    
    @Nullable
    public Pair<ResourceLocation, ResourceLocation> getNoItemIcon() {
        return null;
    }
    
    public ItemStack remove(final int integer) {
        return this.container.removeItem(this.slot, integer);
    }
    
    public boolean mayPickup(final Player ayj) {
        return true;
    }
    
    public boolean isActive() {
        return true;
    }
}
