Changed upgrade slots to SlotUpgrade

This commit is contained in:
gigabit101 2016-02-25 14:21:31 +00:00
parent 3274894625
commit fb12bfab9e
9 changed files with 61 additions and 32 deletions

View file

@ -0,0 +1,21 @@
package techreborn.api;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import techreborn.api.upgrade.IMachineUpgrade;
public class SlotUpgrade extends Slot{
public SlotUpgrade(IInventory inventoryIn, int index, int xPosition, int yPosition) {
super(inventoryIn, index, xPosition, yPosition);
}
@Override
public boolean isItemValid(ItemStack stack) {
if(stack.getItem() instanceof IMachineUpgrade){
return true;
}
else return false;
}
}

View file

@ -3,6 +3,7 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import reborncore.client.gui.SlotOutput;
import techreborn.api.SlotUpgrade;
import techreborn.tiles.TileAlloySmelter;
public class ContainerAlloySmelter extends ContainerCrafting {
@ -32,10 +33,10 @@ public class ContainerAlloySmelter extends ContainerCrafting {
// battery
this.addSlotToContainer(new Slot(tileAlloysmelter.inventory, 3, 56, 53));
// upgrades
this.addSlotToContainer(new Slot(tileAlloysmelter.inventory, 4, 152, 8));
this.addSlotToContainer(new Slot(tileAlloysmelter.inventory, 5, 152, 26));
this.addSlotToContainer(new Slot(tileAlloysmelter.inventory, 6, 152, 44));
this.addSlotToContainer(new Slot(tileAlloysmelter.inventory, 7, 152, 62));
this.addSlotToContainer(new SlotUpgrade(tileAlloysmelter.inventory, 4, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tileAlloysmelter.inventory, 5, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tileAlloysmelter.inventory, 6, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tileAlloysmelter.inventory, 7, 152, 62));
int i;

View file

@ -3,6 +3,7 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import reborncore.client.gui.SlotOutput;
import techreborn.api.SlotUpgrade;
import techreborn.tiles.TileAssemblingMachine;
public class ContainerAssemblingMachine extends ContainerCrafting {
@ -32,10 +33,10 @@ public class ContainerAssemblingMachine extends ContainerCrafting {
// power
this.addSlotToContainer(new Slot(tileAssemblingMachine.inventory, 3, 56, 53));
// upgrades
this.addSlotToContainer(new Slot(tileAssemblingMachine.inventory, 4, 152, 8));
this.addSlotToContainer(new Slot(tileAssemblingMachine.inventory, 5, 152, 26));
this.addSlotToContainer(new Slot(tileAssemblingMachine.inventory, 6, 152, 44));
this.addSlotToContainer(new Slot(tileAssemblingMachine.inventory, 7, 152, 62));
this.addSlotToContainer(new SlotUpgrade(tileAssemblingMachine.inventory, 4, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tileAssemblingMachine.inventory, 5, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tileAssemblingMachine.inventory, 6, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tileAssemblingMachine.inventory, 7, 152, 62));
int i;

View file

@ -3,6 +3,7 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import reborncore.client.gui.SlotOutput;
import techreborn.api.SlotUpgrade;
import techreborn.tiles.TileCentrifuge;
public class ContainerCentrifuge extends ContainerCrafting {
@ -34,10 +35,10 @@ public class ContainerCentrifuge extends ContainerCrafting {
// battery
this.addSlotToContainer(new Slot(tileCentrifuge.inventory, 6, 8, 51));
// upgrades
this.addSlotToContainer(new Slot(tileCentrifuge.inventory, 7, 152, 8));
this.addSlotToContainer(new Slot(tileCentrifuge.inventory, 8, 152, 26));
this.addSlotToContainer(new Slot(tileCentrifuge.inventory, 9, 152, 44));
this.addSlotToContainer(new Slot(tileCentrifuge.inventory, 10, 152, 62));
this.addSlotToContainer(new SlotUpgrade(tileCentrifuge.inventory, 7, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tileCentrifuge.inventory, 8, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tileCentrifuge.inventory, 9, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tileCentrifuge.inventory, 10, 152, 62));
int i;

View file

@ -3,6 +3,7 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import reborncore.client.gui.SlotOutput;
import techreborn.api.SlotUpgrade;
import techreborn.tiles.TileChemicalReactor;
public class ContainerChemicalReactor extends ContainerCrafting {
@ -32,10 +33,10 @@ public class ContainerChemicalReactor extends ContainerCrafting {
// battery
this.addSlotToContainer(new Slot(tilechemicalReactor.inventory, 3, 8, 51));
// upgrades
this.addSlotToContainer(new Slot(tilechemicalReactor.inventory, 4, 152, 8));
this.addSlotToContainer(new Slot(tilechemicalReactor.inventory, 5, 152, 26));
this.addSlotToContainer(new Slot(tilechemicalReactor.inventory, 6, 152, 44));
this.addSlotToContainer(new Slot(tilechemicalReactor.inventory, 7, 152, 62));
this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 4, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 5, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 6, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 7, 152, 62));
int i;

View file

@ -5,6 +5,7 @@ import net.minecraft.inventory.Slot;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.SlotOutput;
import techreborn.api.SlotUpgrade;
import techreborn.tiles.teir1.TileCompressor;
public class ContainerCompressor extends ContainerCrafting {
@ -26,10 +27,10 @@ public class ContainerCompressor extends ContainerCrafting {
// upgrades
this.addSlotToContainer(new Slot(tileGrinder.inventory, 2, 152, 8));
this.addSlotToContainer(new Slot(tileGrinder.inventory, 3, 152, 26));
this.addSlotToContainer(new Slot(tileGrinder.inventory, 4, 152, 44));
this.addSlotToContainer(new Slot(tileGrinder.inventory, 5, 152, 62));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62));
int i;

View file

@ -6,6 +6,7 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.api.SlotUpgrade;
import techreborn.tiles.teir1.TileElectricFurnace;
public class ContainerElectricFurnace extends RebornContainer {
@ -27,10 +28,10 @@ public class ContainerElectricFurnace extends RebornContainer {
// upgrades
this.addSlotToContainer(new Slot(tileGrinder.inventory, 2, 152, 8));
this.addSlotToContainer(new Slot(tileGrinder.inventory, 3, 152, 26));
this.addSlotToContainer(new Slot(tileGrinder.inventory, 4, 152, 44));
this.addSlotToContainer(new Slot(tileGrinder.inventory, 5, 152, 62));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62));
int i;

View file

@ -5,6 +5,7 @@ import net.minecraft.inventory.Slot;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.SlotOutput;
import techreborn.api.SlotUpgrade;
import techreborn.tiles.teir1.TileExtractor;
public class ContainerExtractor extends ContainerCrafting {
@ -26,10 +27,10 @@ public class ContainerExtractor extends ContainerCrafting {
// upgrades
this.addSlotToContainer(new Slot(tileGrinder.inventory, 2, 152, 8));
this.addSlotToContainer(new Slot(tileGrinder.inventory, 3, 152, 26));
this.addSlotToContainer(new Slot(tileGrinder.inventory, 4, 152, 44));
this.addSlotToContainer(new Slot(tileGrinder.inventory, 5, 152, 62));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62));
int i;

View file

@ -5,6 +5,7 @@ import net.minecraft.inventory.Slot;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.SlotOutput;
import techreborn.api.SlotUpgrade;
import techreborn.tiles.teir1.TileGrinder;
public class ContainerGrinder extends ContainerCrafting {
@ -26,10 +27,10 @@ public class ContainerGrinder extends ContainerCrafting {
// upgrades
this.addSlotToContainer(new Slot(tileGrinder.inventory, 2, 152, 8));
this.addSlotToContainer(new Slot(tileGrinder.inventory, 3, 152, 26));
this.addSlotToContainer(new Slot(tileGrinder.inventory, 4, 152, 44));
this.addSlotToContainer(new Slot(tileGrinder.inventory, 5, 152, 62));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62));
int i;