Remove unused code

This commit is contained in:
Raoul Van den Berge
2016-06-16 13:32:15 +02:00
parent 410d1613d2
commit 9cb997133a
3 changed files with 6 additions and 27 deletions

View File

@@ -10,14 +10,9 @@ import refinedstorage.container.slot.SlotDisabled;
import refinedstorage.container.slot.SlotSpecimen; import refinedstorage.container.slot.SlotSpecimen;
import refinedstorage.container.slot.SlotSpecimenLegacy; import refinedstorage.container.slot.SlotSpecimenLegacy;
import java.util.ArrayList;
import java.util.List;
public abstract class ContainerBase extends Container { public abstract class ContainerBase extends Container {
private EntityPlayer player; private EntityPlayer player;
private List<Slot> playerInventorySlots = new ArrayList<Slot>();
public ContainerBase(EntityPlayer player) { public ContainerBase(EntityPlayer player) {
this.player = player; this.player = player;
} }
@@ -30,22 +25,14 @@ public abstract class ContainerBase extends Container {
int id = 0; int id = 0;
for (int i = 0; i < 9; i++) { for (int i = 0; i < 9; i++) {
Slot slot = new Slot(player.inventory, id, xInventory + i * 18, yInventory + 4 + (3 * 18)); addSlotToContainer(new Slot(player.inventory, id, xInventory + i * 18, yInventory + 4 + (3 * 18)));
playerInventorySlots.add(slot);
addSlotToContainer(slot);
id++; id++;
} }
for (int y = 0; y < 3; y++) { for (int y = 0; y < 3; y++) {
for (int x = 0; x < 9; x++) { for (int x = 0; x < 9; x++) {
Slot slot = new Slot(player.inventory, id, xInventory + x * 18, yInventory + y * 18); addSlotToContainer(new Slot(player.inventory, id, xInventory + x * 18, yInventory + y * 18));
playerInventorySlots.add(slot);
addSlotToContainer(slot);
id++; id++;
} }
@@ -123,8 +110,4 @@ public abstract class ContainerBase extends Container {
public boolean canInteractWith(EntityPlayer player) { public boolean canInteractWith(EntityPlayer player) {
return true; return true;
} }
public List<Slot> getPlayerInventorySlots() {
return playerInventorySlots;
}
} }

View File

@@ -38,7 +38,7 @@ public class ContainerGrid extends ContainerBase {
} }
} }
addSlotToContainer(craftingResultSlot = new SlotGridCraftingResult(this, player, ((TileGrid) grid).getMatrix(), ((TileGrid) grid).getResult(), (TileGrid) grid, 0, 133 + 4, 120 + 4)); addSlotToContainer(craftingResultSlot = new SlotGridCraftingResult(this, player, (TileGrid) grid, 0, 133 + 4, 120 + 4));
} else if (grid.getType() == EnumGridType.PATTERN) { } else if (grid.getType() == EnumGridType.PATTERN) {
int x = 8; int x = 8;
int y = 106; int y = 106;

View File

@@ -1,8 +1,6 @@
package refinedstorage.container.slot; package refinedstorage.container.slot;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.inventory.SlotCrafting; import net.minecraft.inventory.SlotCrafting;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.FMLCommonHandler;
@@ -11,20 +9,18 @@ import refinedstorage.tile.grid.TileGrid;
public class SlotGridCraftingResult extends SlotCrafting { public class SlotGridCraftingResult extends SlotCrafting {
private ContainerGrid container; private ContainerGrid container;
private IInventory matrix;
private TileGrid grid; private TileGrid grid;
public SlotGridCraftingResult(ContainerGrid container, EntityPlayer player, InventoryCrafting matrix, IInventory craftingResult, TileGrid grid, int id, int x, int y) { public SlotGridCraftingResult(ContainerGrid container, EntityPlayer player, TileGrid grid, int id, int x, int y) {
super(player, matrix, craftingResult, id, x, y); super(player, grid.getMatrix(), grid.getResult(), id, x, y);
this.container = container; this.container = container;
this.matrix = matrix;
this.grid = grid; this.grid = grid;
} }
@Override @Override
public void onPickupFromSlot(EntityPlayer player, ItemStack stack) { public void onPickupFromSlot(EntityPlayer player, ItemStack stack) {
FMLCommonHandler.instance().firePlayerCraftingEvent(player, stack, matrix); FMLCommonHandler.instance().firePlayerCraftingEvent(player, stack, grid.getMatrix());
onCrafting(stack); onCrafting(stack);