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