Unified Parameter-Names for Slots
This commit is contained in:
@@ -29,13 +29,13 @@ public class SlotDisconnected extends AppEngSlot {
|
||||
|
||||
private final ClientDCInternalInv mySlot;
|
||||
|
||||
public SlotDisconnected(final ClientDCInternalInv me, final int which, final int x, final int y) {
|
||||
super(me.getInventory(), which, x, y);
|
||||
public SlotDisconnected(final ClientDCInternalInv me, final int invSlot, final int x, final int y) {
|
||||
super(me.getInventory(), invSlot, x, y);
|
||||
this.mySlot = me;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(final ItemStack par1ItemStack) {
|
||||
public boolean isItemValid(final ItemStack stack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class SlotDisconnected extends AppEngSlot {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTakeStack(final PlayerEntity par1PlayerEntity) {
|
||||
public boolean canTakeStack(final PlayerEntity player) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -105,8 +105,8 @@ public class QuartzKnifeContainer extends AEBaseContainer {
|
||||
}
|
||||
|
||||
private class QuartzKniveSlot extends OutputSlot {
|
||||
QuartzKniveSlot(IItemHandler a, int b, int c, int d, int i) {
|
||||
super(a, b, c, d, i);
|
||||
QuartzKniveSlot(IItemHandler inv, int invSlot, int x, int y, int iconIdx) {
|
||||
super(inv, invSlot, x, y, iconIdx);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -49,8 +49,8 @@ public class AppEngCraftingSlot extends AppEngSlot {
|
||||
private int amountCrafted;
|
||||
|
||||
public AppEngCraftingSlot(final PlayerEntity par1PlayerEntity, final IItemHandler par2IInventory,
|
||||
final IItemHandler par3IInventory, final int par4, final int par5, final int par6) {
|
||||
super(par3IInventory, par4, par5, par6);
|
||||
final IItemHandler inv, final int invSlot, final int x, final int y) {
|
||||
super(inv, invSlot, x, y);
|
||||
this.thePlayer = par1PlayerEntity;
|
||||
this.craftMatrix = par2IInventory;
|
||||
}
|
||||
@@ -60,7 +60,7 @@ public class AppEngCraftingSlot extends AppEngSlot {
|
||||
* armor slots.
|
||||
*/
|
||||
@Override
|
||||
public boolean isItemValid(final ItemStack par1ItemStack) {
|
||||
public boolean isItemValid(final ItemStack stack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,9 +33,9 @@ import appeng.container.AEBaseContainer;
|
||||
import appeng.util.helpers.ItemHandlerUtil;
|
||||
|
||||
public class AppEngSlot extends Slot {
|
||||
private static IInventory emptyInventory = new Inventory(0);
|
||||
private static final IInventory EMPTY_INVENTORY = new Inventory(0);
|
||||
private final IItemHandler itemHandler;
|
||||
private final int index;
|
||||
private final int invSlot;
|
||||
|
||||
private final int defX;
|
||||
private final int defY;
|
||||
@@ -46,10 +46,10 @@ public class AppEngSlot extends Slot {
|
||||
private CalculatedValidity isValid;
|
||||
private boolean isDisplay = false;
|
||||
|
||||
public AppEngSlot(final IItemHandler inv, final int idx, final int x, final int y) {
|
||||
super(emptyInventory, idx, x, y);
|
||||
public AppEngSlot(final IItemHandler inv, final int invSlot, final int x, final int y) {
|
||||
super(EMPTY_INVENTORY, invSlot, x, y);
|
||||
this.itemHandler = inv;
|
||||
this.index = idx;
|
||||
this.invSlot = invSlot;
|
||||
|
||||
this.defX = x;
|
||||
this.defY = y;
|
||||
@@ -71,13 +71,13 @@ public class AppEngSlot extends Slot {
|
||||
}
|
||||
|
||||
public void clearStack() {
|
||||
ItemHandlerUtil.setStackInSlot(this.itemHandler, this.index, ItemStack.EMPTY);
|
||||
ItemHandlerUtil.setStackInSlot(this.itemHandler, this.invSlot, ItemStack.EMPTY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(@Nonnull final ItemStack par1ItemStack) {
|
||||
public boolean isItemValid(@Nonnull final ItemStack stack) {
|
||||
if (this.isSlotEnabled()) {
|
||||
return this.itemHandler.isItemValid(this.index, par1ItemStack);
|
||||
return this.itemHandler.isItemValid(this.invSlot, stack);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -98,13 +98,13 @@ public class AppEngSlot extends Slot {
|
||||
return this.getDisplayStack();
|
||||
}
|
||||
|
||||
return this.itemHandler.getStackInSlot(this.index);
|
||||
return this.itemHandler.getStackInSlot(this.invSlot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putStack(final ItemStack stack) {
|
||||
if (this.isSlotEnabled()) {
|
||||
ItemHandlerUtil.setStackInSlot(this.itemHandler, this.index, stack);
|
||||
ItemHandlerUtil.setStackInSlot(this.itemHandler, this.invSlot, stack);
|
||||
this.onSlotChanged();
|
||||
}
|
||||
}
|
||||
@@ -128,7 +128,7 @@ public class AppEngSlot extends Slot {
|
||||
|
||||
@Override
|
||||
public int getSlotStackLimit() {
|
||||
return this.itemHandler.getSlotLimit(this.index);
|
||||
return this.itemHandler.getSlotLimit(this.invSlot);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -137,9 +137,9 @@ public class AppEngSlot extends Slot {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTakeStack(final PlayerEntity par1PlayerEntity) {
|
||||
public boolean canTakeStack(final PlayerEntity player) {
|
||||
if (this.isSlotEnabled()) {
|
||||
return !this.itemHandler.extractItem(this.index, 1, true).isEmpty();
|
||||
return !this.itemHandler.extractItem(this.invSlot, 1, true).isEmpty();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -147,7 +147,7 @@ public class AppEngSlot extends Slot {
|
||||
@Override
|
||||
@Nonnull
|
||||
public ItemStack decrStackSize(int amount) {
|
||||
return this.itemHandler.extractItem(this.index, amount, false);
|
||||
return this.itemHandler.extractItem(this.invSlot, amount, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -166,7 +166,7 @@ public class AppEngSlot extends Slot {
|
||||
}
|
||||
|
||||
public ItemStack getDisplayStack() {
|
||||
return this.itemHandler.getStackInSlot(this.index);
|
||||
return this.itemHandler.getStackInSlot(this.invSlot);
|
||||
}
|
||||
|
||||
public float getOpacityOfIcon() {
|
||||
|
||||
@@ -29,11 +29,11 @@ public class CraftingMatrixSlot extends AppEngSlot {
|
||||
private final AEBaseContainer c;
|
||||
private final IInventory wrappedInventory;
|
||||
|
||||
public CraftingMatrixSlot(final AEBaseContainer c, final IItemHandler par1iInventory, final int par2,
|
||||
final int par3, final int par4) {
|
||||
super(par1iInventory, par2, par3, par4);
|
||||
public CraftingMatrixSlot(final AEBaseContainer c, final IItemHandler inv, final int invSlot, final int x,
|
||||
final int y) {
|
||||
super(inv, invSlot, x, y);
|
||||
this.c = c;
|
||||
this.wrappedInventory = new WrapperInvItemHandler(par1iInventory);
|
||||
this.wrappedInventory = new WrapperInvItemHandler(inv);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -82,7 +82,7 @@ public class CraftingTermSlot extends AppEngCraftingSlot {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTakeStack(final PlayerEntity par1PlayerEntity) {
|
||||
public boolean canTakeStack(final PlayerEntity player) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,17 +24,17 @@ import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
public class DisabledSlot extends AppEngSlot {
|
||||
|
||||
public DisabledSlot(final IItemHandler par1iInventory, final int slotIndex, final int x, final int y) {
|
||||
super(par1iInventory, slotIndex, x, y);
|
||||
public DisabledSlot(final IItemHandler par1iInventory, final int invSlot, final int x, final int y) {
|
||||
super(par1iInventory, invSlot, x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(final ItemStack par1ItemStack) {
|
||||
public boolean isItemValid(final ItemStack stack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTakeStack(final PlayerEntity par1PlayerEntity) {
|
||||
public boolean canTakeStack(final PlayerEntity player) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@ import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
public class FakeBlacklistSlot extends FakeTypeOnlySlot {
|
||||
|
||||
public FakeBlacklistSlot(final IItemHandler inv, final int idx, final int x, final int y) {
|
||||
super(inv, idx, x, y);
|
||||
public FakeBlacklistSlot(final IItemHandler inv, final int invSlot, final int x, final int y) {
|
||||
super(inv, invSlot, x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -22,7 +22,7 @@ import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
public class FakeCraftingMatrixSlot extends FakeSlot {
|
||||
|
||||
public FakeCraftingMatrixSlot(final IItemHandler inv, final int idx, final int x, final int y) {
|
||||
super(inv, idx, x, y);
|
||||
public FakeCraftingMatrixSlot(final IItemHandler inv, final int invSlot, final int x, final int y) {
|
||||
super(inv, invSlot, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@ import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
public class FakeSlot extends AppEngSlot {
|
||||
|
||||
public FakeSlot(final IItemHandler inv, final int idx, final int x, final int y) {
|
||||
super(inv, idx, x, y);
|
||||
public FakeSlot(final IItemHandler inv, final int invSlot, final int x, final int y) {
|
||||
super(inv, invSlot, x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -39,7 +39,7 @@ public class FakeSlot extends AppEngSlot {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(final ItemStack par1ItemStack) {
|
||||
public boolean isItemValid(final ItemStack stack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class FakeSlot extends AppEngSlot {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTakeStack(final PlayerEntity par1PlayerEntity) {
|
||||
public boolean canTakeStack(final PlayerEntity player) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
public class FakeTypeOnlySlot extends FakeSlot {
|
||||
|
||||
public FakeTypeOnlySlot(final IItemHandler inv, final int idx, final int x, final int y) {
|
||||
super(inv, idx, x, y);
|
||||
public FakeTypeOnlySlot(final IItemHandler inv, final int invSlot, final int x, final int y) {
|
||||
super(inv, invSlot, x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -26,12 +26,12 @@ public class InaccessibleSlot extends AppEngSlot {
|
||||
|
||||
private ItemStack dspStack = ItemStack.EMPTY;
|
||||
|
||||
public InaccessibleSlot(final IItemHandler i, final int slotIdx, final int x, final int y) {
|
||||
super(i, slotIdx, x, y);
|
||||
public InaccessibleSlot(final IItemHandler i, final int invSlot, final int x, final int y) {
|
||||
super(i, invSlot, x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(final ItemStack i) {
|
||||
public boolean isItemValid(final ItemStack stack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class InaccessibleSlot extends AppEngSlot {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTakeStack(final PlayerEntity par1PlayerEntity) {
|
||||
public boolean canTakeStack(final PlayerEntity player) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,14 +27,14 @@ public class MolecularAssemblerPatternSlot extends AppEngSlot {
|
||||
|
||||
private final MolecularAssemblerContainer mac;
|
||||
|
||||
public MolecularAssemblerPatternSlot(final MolecularAssemblerContainer mac, final IItemHandler i, final int slotIdx,
|
||||
final int x, final int y) {
|
||||
super(i, slotIdx, x, y);
|
||||
public MolecularAssemblerPatternSlot(final MolecularAssemblerContainer mac, final IItemHandler inv,
|
||||
final int invSlot, final int x, final int y) {
|
||||
super(inv, invSlot, x, y);
|
||||
this.mac = mac;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(final ItemStack i) {
|
||||
return this.mac.isValidItemForSlot(this.getSlotIndex(), i);
|
||||
public boolean isItemValid(final ItemStack stack) {
|
||||
return this.mac.isValidItemForSlot(this.getSlotIndex(), stack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
public class NormalSlot extends AppEngSlot {
|
||||
|
||||
public NormalSlot(final IItemHandler inv, final int slot, final int xPos, final int yPos) {
|
||||
super(inv, slot, xPos, yPos);
|
||||
public NormalSlot(final IItemHandler inv, final int invSlot, final int xPos, final int yPos) {
|
||||
super(inv, invSlot, xPos, yPos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,9 +31,9 @@ public class OptionalFakeSlot extends FakeSlot implements IOptionalSlot {
|
||||
private final IOptionalSlotHost host;
|
||||
private boolean renderDisabled = true;
|
||||
|
||||
public OptionalFakeSlot(final IItemHandler inv, final IOptionalSlotHost containerBus, final int idx, final int x,
|
||||
final int y, final int offX, final int offY, final int groupNum) {
|
||||
super(inv, idx, x + offX * 18, y + offY * 18);
|
||||
public OptionalFakeSlot(final IItemHandler inv, final IOptionalSlotHost containerBus, final int invSlot,
|
||||
final int x, final int y, final int offX, final int offY, final int groupNum) {
|
||||
super(inv, invSlot, x + offX * 18, y + offY * 18);
|
||||
this.srcX = x;
|
||||
this.srcY = y;
|
||||
this.groupNum = groupNum;
|
||||
|
||||
@@ -25,9 +25,9 @@ public class OptionalNormalSlot extends AppEngSlot implements IOptionalSlot {
|
||||
private final int groupNum;
|
||||
private final IOptionalSlotHost host;
|
||||
|
||||
public OptionalNormalSlot(final IItemHandler inv, final IOptionalSlotHost containerBus, final int slot,
|
||||
public OptionalNormalSlot(final IItemHandler inv, final IOptionalSlotHost containerBus, final int invSlot,
|
||||
final int xPos, final int yPos, final int groupNum) {
|
||||
super(inv, slot, xPos, yPos);
|
||||
super(inv, invSlot, xPos, yPos);
|
||||
this.groupNum = groupNum;
|
||||
this.host = containerBus;
|
||||
}
|
||||
|
||||
@@ -26,9 +26,10 @@ public class OptionalRestrictedInputSlot extends RestrictedInputSlot {
|
||||
private final int groupNum;
|
||||
private final IOptionalSlotHost host;
|
||||
|
||||
public OptionalRestrictedInputSlot(final PlacableItemType valid, final IItemHandler i, final IOptionalSlotHost host,
|
||||
final int slotIndex, final int x, final int y, final int grpNum, final PlayerInventory invPlayer) {
|
||||
super(valid, i, slotIndex, x, y, invPlayer);
|
||||
public OptionalRestrictedInputSlot(final PlacableItemType valid, final IItemHandler inv,
|
||||
final IOptionalSlotHost host, final int invSlot, final int x, final int y, final int grpNum,
|
||||
final PlayerInventory invPlayer) {
|
||||
super(valid, inv, invSlot, x, y, invPlayer);
|
||||
this.groupNum = grpNum;
|
||||
this.host = host;
|
||||
}
|
||||
|
||||
@@ -23,9 +23,9 @@ import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
public class OptionalTypeOnlyFakeSlot extends OptionalFakeSlot {
|
||||
|
||||
public OptionalTypeOnlyFakeSlot(final IItemHandler inv, final IOptionalSlotHost containerBus, final int idx,
|
||||
public OptionalTypeOnlyFakeSlot(final IItemHandler inv, final IOptionalSlotHost containerBus, final int invSlot,
|
||||
final int x, final int y, final int offX, final int offY, final int groupNum) {
|
||||
super(inv, containerBus, idx, x, y, offX, offY, groupNum);
|
||||
super(inv, containerBus, invSlot, x, y, offX, offY, groupNum);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,13 +23,13 @@ import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
public class OutputSlot extends AppEngSlot {
|
||||
|
||||
public OutputSlot(final IItemHandler a, final int b, final int c, final int d, final int i) {
|
||||
super(a, b, c, d);
|
||||
this.setIIcon(i);
|
||||
public OutputSlot(final IItemHandler inv, final int invSlot, final int x, final int y, final int iconIndex) {
|
||||
super(inv, invSlot, x, y);
|
||||
this.setIIcon(iconIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(final ItemStack i) {
|
||||
public boolean isItemValid(final ItemStack stack) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,9 +22,9 @@ import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
public class PatternOutputsSlot extends OptionalFakeSlot {
|
||||
|
||||
public PatternOutputsSlot(final IItemHandler inv, final IOptionalSlotHost containerBus, final int idx, final int x,
|
||||
final int y, final int offX, final int offY, final int groupNum) {
|
||||
super(inv, containerBus, idx, x, y, offX, offY, groupNum);
|
||||
public PatternOutputsSlot(final IItemHandler inv, final IOptionalSlotHost containerBus, final int invSlot,
|
||||
final int x, final int y, final int offX, final int offY, final int groupNum) {
|
||||
super(inv, containerBus, invSlot, x, y, offX, offY, groupNum);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -22,8 +22,8 @@ import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
public class PlayerHotBarSlot extends AppEngSlot {
|
||||
|
||||
public PlayerHotBarSlot(final IItemHandler par1iInventory, final int par2, final int par3, final int par4) {
|
||||
super(par1iInventory, par2, par3, par4);
|
||||
public PlayerHotBarSlot(final IItemHandler inv, final int invSlot, final int x, final int y) {
|
||||
super(inv, invSlot, x, y);
|
||||
this.setPlayerSide(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@ import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
public class PlayerInvSlot extends AppEngSlot {
|
||||
|
||||
public PlayerInvSlot(final IItemHandler par1iInventory, final int idx, final int x, final int y) {
|
||||
super(par1iInventory, idx, x, y);
|
||||
public PlayerInvSlot(final IItemHandler par1iInventory, final int invSlot, final int x, final int y) {
|
||||
super(par1iInventory, invSlot, x, y);
|
||||
|
||||
this.setPlayerSide(true);
|
||||
}
|
||||
|
||||
@@ -70,9 +70,9 @@ public class RestrictedInputSlot extends AppEngSlot {
|
||||
private boolean allowEdit = true;
|
||||
private int stackLimit = -1;
|
||||
|
||||
public RestrictedInputSlot(final PlacableItemType valid, final IItemHandler i, final int slotIndex, final int x,
|
||||
public RestrictedInputSlot(final PlacableItemType valid, final IItemHandler inv, final int invSlot, final int x,
|
||||
final int y, final PlayerInventory p) {
|
||||
super(i, slotIndex, x, y);
|
||||
super(inv, invSlot, x, y);
|
||||
this.which = valid;
|
||||
this.setIIcon(valid.IIcon);
|
||||
this.p = p;
|
||||
@@ -99,20 +99,20 @@ public class RestrictedInputSlot extends AppEngSlot {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(final ItemStack i) {
|
||||
if (!this.getContainer().isValidForSlot(this, i)) {
|
||||
public boolean isItemValid(final ItemStack stack) {
|
||||
if (!this.getContainer().isValidForSlot(this, stack)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (i.isEmpty()) {
|
||||
if (stack.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (i.getItem() == Items.AIR) {
|
||||
if (stack.getItem() == Items.AIR) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!super.isItemValid(i)) {
|
||||
if (!super.isItemValid(stack)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ public class RestrictedInputSlot extends AppEngSlot {
|
||||
|
||||
switch (this.which) {
|
||||
case ENCODED_CRAFTING_PATTERN:
|
||||
final ICraftingPatternDetails de = crafting.decodePattern(i, this.p.player.world);
|
||||
final ICraftingPatternDetails de = crafting.decodePattern(stack, this.p.player.world);
|
||||
if (de != null) {
|
||||
return de.isCraftable();
|
||||
}
|
||||
@@ -135,19 +135,19 @@ public class RestrictedInputSlot extends AppEngSlot {
|
||||
case VALID_ENCODED_PATTERN_W_OUTPUT:
|
||||
case ENCODED_PATTERN_W_OUTPUT:
|
||||
case ENCODED_PATTERN:
|
||||
return crafting.isEncodedPattern(i);
|
||||
return crafting.isEncodedPattern(stack);
|
||||
case BLANK_PATTERN:
|
||||
return materials.blankPattern().isSameAs(i);
|
||||
return materials.blankPattern().isSameAs(stack);
|
||||
|
||||
case PATTERN:
|
||||
return materials.blankPattern().isSameAs(i) || crafting.isEncodedPattern(i);
|
||||
return materials.blankPattern().isSameAs(stack) || crafting.isEncodedPattern(stack);
|
||||
|
||||
case INSCRIBER_PLATE:
|
||||
if (materials.namePress().isSameAs(i)) {
|
||||
if (materials.namePress().isSameAs(stack)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return InscriberRecipes.isValidOptionalIngredient(p.player.world, i);
|
||||
return InscriberRecipes.isValidOptionalIngredient(p.player.world, stack);
|
||||
|
||||
case INSCRIBER_INPUT:
|
||||
return true;/*
|
||||
@@ -157,46 +157,48 @@ public class RestrictedInputSlot extends AppEngSlot {
|
||||
|
||||
case METAL_INGOTS:
|
||||
|
||||
return isMetalIngot(i);
|
||||
return isMetalIngot(stack);
|
||||
|
||||
case VIEW_CELL:
|
||||
return items.viewCell().isSameAs(i);
|
||||
return items.viewCell().isSameAs(stack);
|
||||
case ORE:
|
||||
return GrinderRecipes.isValidIngredient(p.player.world, i);
|
||||
return GrinderRecipes.isValidIngredient(p.player.world, stack);
|
||||
case FUEL:
|
||||
return ForgeHooks.getBurnTime(i) > 0;
|
||||
return ForgeHooks.getBurnTime(stack) > 0;
|
||||
case POWERED_TOOL:
|
||||
return Platform.isChargeable(i);
|
||||
return Platform.isChargeable(stack);
|
||||
case QE_SINGULARITY:
|
||||
return materials.qESingularity().isSameAs(i);
|
||||
return materials.qESingularity().isSameAs(stack);
|
||||
|
||||
case RANGE_BOOSTER:
|
||||
return materials.wirelessBooster().isSameAs(i);
|
||||
return materials.wirelessBooster().isSameAs(stack);
|
||||
|
||||
case SPATIAL_STORAGE_CELLS:
|
||||
return i.getItem() instanceof ISpatialStorageCell
|
||||
&& ((ISpatialStorageCell) i.getItem()).isSpatialStorage(i);
|
||||
return stack.getItem() instanceof ISpatialStorageCell
|
||||
&& ((ISpatialStorageCell) stack.getItem()).isSpatialStorage(stack);
|
||||
case STORAGE_CELLS:
|
||||
return Api.instance().registries().cell().isCellHandled(i);
|
||||
return Api.instance().registries().cell().isCellHandled(stack);
|
||||
case WORKBENCH_CELL:
|
||||
return i.getItem() instanceof ICellWorkbenchItem && ((ICellWorkbenchItem) i.getItem()).isEditable(i);
|
||||
return stack.getItem() instanceof ICellWorkbenchItem
|
||||
&& ((ICellWorkbenchItem) stack.getItem()).isEditable(stack);
|
||||
case STORAGE_COMPONENT:
|
||||
return i.getItem() instanceof IStorageComponent
|
||||
&& ((IStorageComponent) i.getItem()).isStorageComponent(i);
|
||||
return stack.getItem() instanceof IStorageComponent
|
||||
&& ((IStorageComponent) stack.getItem()).isStorageComponent(stack);
|
||||
case TRASH:
|
||||
if (Api.instance().registries().cell().isCellHandled(i)) {
|
||||
if (Api.instance().registries().cell().isCellHandled(stack)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !(i.getItem() instanceof IStorageComponent
|
||||
&& ((IStorageComponent) i.getItem()).isStorageComponent(i));
|
||||
return !(stack.getItem() instanceof IStorageComponent
|
||||
&& ((IStorageComponent) stack.getItem()).isStorageComponent(stack));
|
||||
case ENCODABLE_ITEM:
|
||||
return i.getItem() instanceof INetworkEncodable
|
||||
|| Api.instance().registries().wireless().isWirelessTerminal(i);
|
||||
return stack.getItem() instanceof INetworkEncodable
|
||||
|| Api.instance().registries().wireless().isWirelessTerminal(stack);
|
||||
case BIOMETRIC_CARD:
|
||||
return i.getItem() instanceof IBiometricCard;
|
||||
return stack.getItem() instanceof IBiometricCard;
|
||||
case UPGRADES:
|
||||
return i.getItem() instanceof IUpgradeModule && ((IUpgradeModule) i.getItem()).getType(i) != null;
|
||||
return stack.getItem() instanceof IUpgradeModule
|
||||
&& ((IUpgradeModule) stack.getItem()).getType(stack) != null;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -205,7 +207,7 @@ public class RestrictedInputSlot extends AppEngSlot {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTakeStack(final PlayerEntity par1PlayerEntity) {
|
||||
public boolean canTakeStack(final PlayerEntity player) {
|
||||
return this.isAllowEdit();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user