Made base code for Logistical Sorter, this may end up being more complex than the transporters themselves.
|
@ -17,6 +17,7 @@ import mekanism.client.gui.GuiEnergyCube;
|
|||
import mekanism.client.gui.GuiEnrichmentChamber;
|
||||
import mekanism.client.gui.GuiFactory;
|
||||
import mekanism.client.gui.GuiGasTank;
|
||||
import mekanism.client.gui.GuiLogisticalSorter;
|
||||
import mekanism.client.gui.GuiMetallurgicInfuser;
|
||||
import mekanism.client.gui.GuiOsmiumCompressor;
|
||||
import mekanism.client.gui.GuiPasswordEnter;
|
||||
|
@ -77,6 +78,7 @@ import mekanism.common.tileentity.TileEntityEnergyCube;
|
|||
import mekanism.common.tileentity.TileEntityEnrichmentChamber;
|
||||
import mekanism.common.tileentity.TileEntityFactory;
|
||||
import mekanism.common.tileentity.TileEntityGasTank;
|
||||
import mekanism.common.tileentity.TileEntityLogisticalSorter;
|
||||
import mekanism.common.tileentity.TileEntityLogisticalTransporter;
|
||||
import mekanism.common.tileentity.TileEntityMechanicalPipe;
|
||||
import mekanism.common.tileentity.TileEntityMetallurgicInfuser;
|
||||
|
@ -348,6 +350,8 @@ public class ClientProxy extends CommonProxy
|
|||
}
|
||||
case 25:
|
||||
return new GuiRobitRepair(player.inventory, world, x);
|
||||
case 26:
|
||||
return new GuiLogisticalSorter(player.inventory, (TileEntityLogisticalSorter)tileEntity);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
@ -41,9 +41,9 @@ public class GuiGasTank extends GuiMekanism
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float par1, int mouseX, int mouseY)
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTick, int mouseX, int mouseY)
|
||||
{
|
||||
super.drawGuiContainerBackgroundLayer(par1, mouseX, mouseY);
|
||||
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
|
||||
|
||||
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.GUI, "GuiGasTank.png"));
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
|
53
common/mekanism/client/gui/GuiLogisticalSorter.java
Normal file
|
@ -0,0 +1,53 @@
|
|||
package mekanism.client.gui;
|
||||
|
||||
import mekanism.common.inventory.container.ContainerLogisticalSorter;
|
||||
import mekanism.common.tileentity.TileEntityLogisticalSorter;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiLogisticalSorter extends GuiMekanism
|
||||
{
|
||||
public TileEntityLogisticalSorter tileEntity;
|
||||
|
||||
public GuiLogisticalSorter(InventoryPlayer inventory, TileEntityLogisticalSorter tentity)
|
||||
{
|
||||
super(new ContainerLogisticalSorter(inventory, tentity));
|
||||
tileEntity = tentity;
|
||||
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiGasTank.png")));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||
{
|
||||
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
|
||||
int xAxis = (mouseX - (width - xSize) / 2);
|
||||
int yAxis = (mouseY - (height - ySize) / 2);
|
||||
|
||||
fontRenderer.drawString("Logistical Sorter", 43, 6, 0x404040);
|
||||
fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, 0x404040);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTick, int mouseX, int mouseY)
|
||||
{
|
||||
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
|
||||
|
||||
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.GUI, "GuiLogisticalSorter.png"));
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
int guiWidth = (width - xSize) / 2;
|
||||
int guiHeight = (height - ySize) / 2;
|
||||
drawTexturedModalRect(guiWidth, guiHeight, 0, 0, xSize, ySize);
|
||||
|
||||
int xAxis = mouseX - guiWidth;
|
||||
int yAxis = mouseY - guiHeight;
|
||||
}
|
||||
}
|
|
@ -9,6 +9,7 @@ import mekanism.common.inventory.container.ContainerElectricPump;
|
|||
import mekanism.common.inventory.container.ContainerEnergyCube;
|
||||
import mekanism.common.inventory.container.ContainerFactory;
|
||||
import mekanism.common.inventory.container.ContainerGasTank;
|
||||
import mekanism.common.inventory.container.ContainerLogisticalSorter;
|
||||
import mekanism.common.inventory.container.ContainerMetallurgicInfuser;
|
||||
import mekanism.common.inventory.container.ContainerRobitCrafting;
|
||||
import mekanism.common.inventory.container.ContainerRobitInventory;
|
||||
|
@ -32,6 +33,7 @@ import mekanism.common.tileentity.TileEntityEnergyCube;
|
|||
import mekanism.common.tileentity.TileEntityEnrichmentChamber;
|
||||
import mekanism.common.tileentity.TileEntityFactory;
|
||||
import mekanism.common.tileentity.TileEntityGasTank;
|
||||
import mekanism.common.tileentity.TileEntityLogisticalSorter;
|
||||
import mekanism.common.tileentity.TileEntityLogisticalTransporter;
|
||||
import mekanism.common.tileentity.TileEntityMechanicalPipe;
|
||||
import mekanism.common.tileentity.TileEntityMetallurgicInfuser;
|
||||
|
@ -280,6 +282,8 @@ public class CommonProxy
|
|||
}
|
||||
case 25:
|
||||
return new ContainerRobitRepair(player.inventory, world);
|
||||
case 26:
|
||||
return new ContainerLogisticalSorter(player.inventory, (TileEntityLogisticalSorter)tileEntity);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
@ -75,6 +75,7 @@ import mekanism.common.tileentity.TileEntityBoundingBlock;
|
|||
import mekanism.common.tileentity.TileEntityControlPanel;
|
||||
import mekanism.common.tileentity.TileEntityEnergyCube;
|
||||
import mekanism.common.tileentity.TileEntityGasTank;
|
||||
import mekanism.common.tileentity.TileEntityLogisticalSorter;
|
||||
import mekanism.common.tileentity.TileEntityTeleporter;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
|
@ -408,6 +409,9 @@ public class Mekanism
|
|||
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(WalkieTalkie), new Object[] {
|
||||
" O", "SCS", " S ", Character.valueOf('O'), "ingotOsmium", Character.valueOf('S'), "ingotSteel", Character.valueOf('C'), "circuitBasic"
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(MachineBlock, 1, 15), new Object[] {
|
||||
"IPI", "ICI", "III", Character.valueOf('I'), Item.ingotIron, Character.valueOf('P'), Block.pistonBase, Character.valueOf('C'), "circuitBasic"
|
||||
}));
|
||||
|
||||
//Factory Recipes
|
||||
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(MekanismUtils.getFactory(FactoryTier.BASIC, RecipeType.SMELTING), new Object[] {
|
||||
|
@ -1024,6 +1028,7 @@ public class Mekanism
|
|||
GameRegistry.registerTileEntity(TileEntityControlPanel.class, "ControlPanel");
|
||||
GameRegistry.registerTileEntity(TileEntityGasTank.class, "GasTank");
|
||||
GameRegistry.registerTileEntity(TileEntityTeleporter.class, "MekanismTeleporter");
|
||||
GameRegistry.registerTileEntity(TileEntityLogisticalSorter.class, "LogisticalSorter");
|
||||
|
||||
//Load tile entities that have special renderers.
|
||||
proxy.registerSpecialTileEntities();
|
||||
|
|
|
@ -34,6 +34,7 @@ import mekanism.common.tileentity.TileEntityEliteFactory;
|
|||
import mekanism.common.tileentity.TileEntityEnergizedSmelter;
|
||||
import mekanism.common.tileentity.TileEntityEnrichmentChamber;
|
||||
import mekanism.common.tileentity.TileEntityFactory;
|
||||
import mekanism.common.tileentity.TileEntityLogisticalSorter;
|
||||
import mekanism.common.tileentity.TileEntityMetallurgicInfuser;
|
||||
import mekanism.common.tileentity.TileEntityOsmiumCompressor;
|
||||
import mekanism.common.tileentity.TileEntityPurificationChamber;
|
||||
|
@ -80,6 +81,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
* 12: Electric Pump
|
||||
* 13: Electric Chest
|
||||
* 14: Chargepad
|
||||
* 15: Logistical Sorter
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
|
@ -136,6 +138,12 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds
|
|||
icons[10][1] = register.registerIcon("mekanism:EnergizedSmelterFrontOn");
|
||||
icons[10][2] = register.registerIcon("mekanism:SteelCasing");
|
||||
icons[11][0] = register.registerIcon("mekanism:Teleporter");
|
||||
icons[15][0] = register.registerIcon("mekanism:LogisticalSorterSideOn");
|
||||
icons[15][1] = register.registerIcon("mekanism:LogisticalSorterSideOff");
|
||||
icons[15][2] = register.registerIcon("mekanism:LogisticalSorterFrontOn");
|
||||
icons[15][3] = register.registerIcon("mekanism:LogisticalSorterFrontOff");
|
||||
icons[15][4] = register.registerIcon("mekanism:LogisticalSorterBackOn");
|
||||
icons[15][5] = register.registerIcon("mekanism:LogisticalSorterBackOff");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -174,22 +182,22 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds
|
|||
float iRandom = 0.52F;
|
||||
float jRandom = random.nextFloat() * 0.6F - 0.3F;
|
||||
|
||||
if (tileEntity.facing == 4)
|
||||
if(tileEntity.facing == 4)
|
||||
{
|
||||
world.spawnParticle("smoke", (double)(xRandom - iRandom), (double)yRandom, (double)(zRandom + jRandom), 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("reddust", (double)(xRandom - iRandom), (double)yRandom, (double)(zRandom + jRandom), 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
else if (tileEntity.facing == 5)
|
||||
else if(tileEntity.facing == 5)
|
||||
{
|
||||
world.spawnParticle("smoke", (double)(xRandom + iRandom), (double)yRandom, (double)(zRandom + jRandom), 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("reddust", (double)(xRandom + iRandom), (double)yRandom, (double)(zRandom + jRandom), 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
else if (tileEntity.facing == 2)
|
||||
else if(tileEntity.facing == 2)
|
||||
{
|
||||
world.spawnParticle("smoke", (double)(xRandom + jRandom), (double)yRandom, (double)(zRandom - iRandom), 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("reddust", (double)(xRandom + jRandom), (double)yRandom, (double)(zRandom - iRandom), 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
else if (tileEntity.facing == 3)
|
||||
else if(tileEntity.facing == 3)
|
||||
{
|
||||
world.spawnParticle("smoke", (double)(xRandom + jRandom), (double)yRandom, (double)(zRandom + iRandom), 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("reddust", (double)(xRandom + jRandom), (double)yRandom, (double)(zRandom + iRandom), 0.0D, 0.0D, 0.0D);
|
||||
|
@ -341,6 +349,20 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds
|
|||
{
|
||||
return icons[11][0];
|
||||
}
|
||||
else if(meta == 15)
|
||||
{
|
||||
if(side == 1)
|
||||
{
|
||||
return icons[15][3];
|
||||
}
|
||||
else if(side == 0)
|
||||
{
|
||||
return icons[15][5];
|
||||
}
|
||||
else {
|
||||
return icons[15][1];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -478,6 +500,20 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds
|
|||
{
|
||||
return icons[11][0];
|
||||
}
|
||||
else if(metadata == 15)
|
||||
{
|
||||
if(side == tileEntity.facing)
|
||||
{
|
||||
return MekanismUtils.isActive(world, x, y, z) ? icons[15][2] : icons[15][3];
|
||||
}
|
||||
else if(side == ForgeDirection.getOrientation(tileEntity.facing).getOpposite().ordinal())
|
||||
{
|
||||
return MekanismUtils.isActive(world, x, y, z) ? icons[15][4] : icons[15][5];
|
||||
}
|
||||
else {
|
||||
return MekanismUtils.isActive(world, x, y, z) ? icons[15][0] : icons[15][1];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -519,6 +555,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds
|
|||
list.add(new ItemStack(i, 1, 12));
|
||||
list.add(new ItemStack(i, 1, 13));
|
||||
list.add(new ItemStack(i, 1, 14));
|
||||
list.add(new ItemStack(i, 1, 15));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -808,7 +845,8 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds
|
|||
TELEPORTER(11, 13, 5000000, TileEntityTeleporter.class, false),
|
||||
ELECTRIC_PUMP(12, 17, 10000, TileEntityElectricPump.class, true),
|
||||
ELECTRIC_CHEST(13, -1, 12000, TileEntityElectricChest.class, true),
|
||||
CHARGEPAD(14, -1, 9000, TileEntityChargepad.class, true);
|
||||
CHARGEPAD(14, -1, 9000, TileEntityChargepad.class, true),
|
||||
LOGISTICAL_SORTER(15, 26, 12000, TileEntityLogisticalSorter.class, false);
|
||||
|
||||
public int meta;
|
||||
public int guiId;
|
||||
|
|
|
@ -0,0 +1,86 @@
|
|||
package mekanism.common.inventory.container;
|
||||
|
||||
import mekanism.api.gas.EnumGas;
|
||||
import mekanism.common.inventory.slot.SlotStorageTank;
|
||||
import mekanism.common.tileentity.TileEntityLogisticalSorter;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerLogisticalSorter extends Container
|
||||
{
|
||||
private TileEntityLogisticalSorter tileEntity;
|
||||
|
||||
public ContainerLogisticalSorter(InventoryPlayer inventory, TileEntityLogisticalSorter tentity)
|
||||
{
|
||||
tileEntity = tentity;
|
||||
addSlotToContainer(new SlotStorageTank(tentity, EnumGas.NONE, true, 0, 8, 8));
|
||||
addSlotToContainer(new SlotStorageTank(tentity, EnumGas.NONE, true, 1, 8, 40));
|
||||
|
||||
int slotX;
|
||||
|
||||
for(slotX = 0; slotX < 3; ++slotX)
|
||||
{
|
||||
for(int slotY = 0; slotY < 9; ++slotY)
|
||||
{
|
||||
addSlotToContainer(new Slot(inventory, slotY + slotX * 9 + 9, 8 + slotY * 18, 84 + slotX * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(slotX = 0; slotX < 9; ++slotX)
|
||||
{
|
||||
addSlotToContainer(new Slot(inventory, slotX, 8 + slotX * 18, 142));
|
||||
}
|
||||
|
||||
tileEntity.openChest();
|
||||
tileEntity.playersUsing.add(inventory.player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onContainerClosed(EntityPlayer entityplayer)
|
||||
{
|
||||
super.onContainerClosed(entityplayer);
|
||||
tileEntity.closeChest();
|
||||
tileEntity.playersUsing.remove(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int slotID)
|
||||
{
|
||||
ItemStack stack = null;
|
||||
Slot currentSlot = (Slot)inventorySlots.get(slotID);
|
||||
|
||||
if(currentSlot != null && currentSlot.getHasStack())
|
||||
{
|
||||
ItemStack slotStack = currentSlot.getStack();
|
||||
stack = slotStack.copy();
|
||||
|
||||
//TODO
|
||||
|
||||
if(slotStack.stackSize == 0)
|
||||
{
|
||||
currentSlot.putStack((ItemStack)null);
|
||||
}
|
||||
else {
|
||||
currentSlot.onSlotChanged();
|
||||
}
|
||||
|
||||
if(slotStack.stackSize == stack.stackSize)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
currentSlot.onPickupFromSlot(player, slotStack);
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
}
|
|
@ -63,6 +63,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
* 12: Electric Pump
|
||||
* 13: Electric Chest
|
||||
* 14: Chargepad
|
||||
* 15: Logistical Sorter
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
|
@ -136,6 +137,9 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, IItem
|
|||
case 14:
|
||||
name = "Chargepad";
|
||||
break;
|
||||
case 15:
|
||||
name = "LogisticalSorter";
|
||||
break;
|
||||
default:
|
||||
name = "Unknown";
|
||||
break;
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
package mekanism.common.tileentity;
|
||||
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class TileEntityLogisticalSorter extends TileEntityElectricBlock
|
||||
{
|
||||
public TileEntityLogisticalSorter()
|
||||
{
|
||||
super("LogisticalSorter", MachineType.LOGISTICAL_SORTER.baseEnergy);
|
||||
inventory = new ItemStack[1];
|
||||
}
|
||||
}
|
|
@ -413,7 +413,7 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds
|
|||
}
|
||||
}
|
||||
|
||||
if (tileEntity != null)
|
||||
if(tileEntity != null)
|
||||
{
|
||||
if(!entityplayer.isSneaking())
|
||||
{
|
||||
|
|
|
@ -58,6 +58,7 @@ tile.MachineBlock.Teleporter.name=Teleporter
|
|||
tile.MachineBlock.ElectricPump.name=Electric Pump
|
||||
tile.MachineBlock.ElectricChest.name=Electric Chest
|
||||
tile.MachineBlock.Chargepad.name=Chargepad
|
||||
tile.MachineBlock.LogisticalSorter.name=Logistical Sorter
|
||||
|
||||
//Ore Block
|
||||
tile.OreBlock.OsmiumOre.name=Osmium Ore
|
||||
|
|
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 4.2 KiB |
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"animation": {
|
||||
"frametime": 1
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 4.2 KiB |