Finished off Oredictionificator
This commit is contained in:
parent
1580d968ec
commit
d1990c232d
11 changed files with 141 additions and 11 deletions
|
@ -335,7 +335,7 @@ public class ClientProxy extends CommonProxy
|
|||
GameRegistry.registerTileEntity(TileEntityInductionPort.class, "InductionPort");
|
||||
GameRegistry.registerTileEntity(TileEntityInductionCell.class, "InductionCell");
|
||||
GameRegistry.registerTileEntity(TileEntityInductionProvider.class, "InductionProvider");
|
||||
ClientRegistry.registerTileEntity(TileEntityOredictionificator.class, "Oredictionificator", new RenderOredictionificator());
|
||||
GameRegistry.registerTileEntity(TileEntityOredictionificator.class, "Oredictionificator");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -54,7 +54,7 @@ public class GuiOredictionificator extends GuiMekanism
|
|||
@Override
|
||||
public double getProgress()
|
||||
{
|
||||
return 1;//tileEntity.isActive ? 1 : 0;
|
||||
return tileEntity.didProcess ? 1 : 0;
|
||||
}
|
||||
}, ProgressBar.LARGE_RIGHT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiOredictionificator.png"), 62, 118));
|
||||
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiOredictionificator.png"), 25, 114));
|
||||
|
|
|
@ -80,7 +80,7 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
|
|||
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "ElectricPump.png"));
|
||||
electricPump.render(0.0560F);
|
||||
}
|
||||
else if(type == MachineType.METALLURGIC_INFUSER || type == MachineType.OREDICTIONIFICATOR/*TODO*/)
|
||||
else if(type == MachineType.METALLURGIC_INFUSER)
|
||||
{
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(270F, 0.0F, -1.0F, 0.0F);
|
||||
|
|
|
@ -148,6 +148,8 @@ import dan200.computercraft.api.peripheral.IPeripheralProvider;
|
|||
* 2:0: Entangled Block
|
||||
* 2:1: Solar Neutron Activator
|
||||
* 2:2: Ambient Accumulator
|
||||
* 2:3: Oredictionificator
|
||||
*
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
|
@ -214,6 +216,10 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer
|
|||
case MACHINE_BLOCK_3:
|
||||
icons[0][0] = register.registerIcon("mekanism:AmbientAccumulator");
|
||||
icons[2][0] = register.registerIcon("mekanism:SteelCasing");
|
||||
icons[3][0] = register.registerIcon("mekanism:OredictionificatorBack");
|
||||
icons[3][1] = register.registerIcon("mekanism:OredictionificatorFront");
|
||||
icons[3][2] = register.registerIcon("mekanism:OredictionificatorPort");
|
||||
icons[3][3] = register.registerIcon("mekanism:OredictionificatorSide");
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -382,8 +388,8 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer
|
|||
if(side == 3)
|
||||
{
|
||||
return icons[meta][0];
|
||||
} else
|
||||
{
|
||||
}
|
||||
else {
|
||||
return icons[meta][2];
|
||||
}
|
||||
case 5:
|
||||
|
@ -392,11 +398,12 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer
|
|||
if(side == 3)
|
||||
{
|
||||
return icons[meta][0];
|
||||
} else if(side == 0 || side == 1)
|
||||
}
|
||||
else if(side == 0 || side == 1)
|
||||
{
|
||||
return icons[meta][2];
|
||||
} else
|
||||
{
|
||||
}
|
||||
else {
|
||||
return icons[meta][1];
|
||||
}
|
||||
default:
|
||||
|
@ -410,8 +417,8 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer
|
|||
if(side == 3)
|
||||
{
|
||||
return icons[meta][0];
|
||||
} else
|
||||
{
|
||||
}
|
||||
else {
|
||||
return icons[meta][2];
|
||||
}
|
||||
default:
|
||||
|
@ -422,6 +429,22 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer
|
|||
{
|
||||
default:
|
||||
return icons[meta][0];
|
||||
case 3:
|
||||
if(side == 3)
|
||||
{
|
||||
return icons[3][1];
|
||||
}
|
||||
else if(side == 4 || side == 5)
|
||||
{
|
||||
return icons[3][2];
|
||||
}
|
||||
else if(side == 2)
|
||||
{
|
||||
return icons[3][0];
|
||||
}
|
||||
else {
|
||||
return icons[3][3];
|
||||
}
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
|
@ -488,6 +511,22 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer
|
|||
case MACHINE_BLOCK_3:
|
||||
switch(meta)
|
||||
{
|
||||
case 3:
|
||||
if(side == tileEntity.facing)
|
||||
{
|
||||
return icons[3][1];
|
||||
}
|
||||
else if(side == MekanismUtils.getLeft(tileEntity.facing).ordinal() || side == MekanismUtils.getRight(tileEntity.facing).ordinal())
|
||||
{
|
||||
return icons[3][2];
|
||||
}
|
||||
else if(side == ForgeDirection.OPPOSITES[tileEntity.facing])
|
||||
{
|
||||
return icons[3][0];
|
||||
}
|
||||
else {
|
||||
return icons[3][3];
|
||||
}
|
||||
default:
|
||||
return icons[meta][0];
|
||||
}
|
||||
|
@ -1122,7 +1161,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer
|
|||
ENTANGLED_BLOCK(MachineBlock.MACHINE_BLOCK_3, 0, "EntangledBlock", 46, TileEntityEntangledBlock.class, true, false, false),
|
||||
SOLAR_NEUTRON_ACTIVATOR(MachineBlock.MACHINE_BLOCK_3, 1, "SolarNeutronActivator", 47, TileEntitySolarNeutronActivator.class, false, true, false),
|
||||
AMBIENT_ACCUMULATOR(MachineBlock.MACHINE_BLOCK_3, 2, "AmbientAccumulator", 48, TileEntityAmbientAccumulator.class, true, false, false),
|
||||
OREDICTIONIFICATOR(MachineBlock.MACHINE_BLOCK_3, 3, "Oredictionificator", 52, TileEntityOredictionificator.class, false, true, false);
|
||||
OREDICTIONIFICATOR(MachineBlock.MACHINE_BLOCK_3, 3, "Oredictionificator", 52, TileEntityOredictionificator.class, false, false, false);
|
||||
|
||||
public MachineBlock typeBlock;
|
||||
public int meta;
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
package mekanism.common.inventory.container;
|
||||
|
||||
import mekanism.common.inventory.slot.SlotOutput;
|
||||
import mekanism.common.recipe.RecipeHandler;
|
||||
import mekanism.common.recipe.inputs.ItemStackInput;
|
||||
import mekanism.common.tile.TileEntityOredictionificator;
|
||||
import mekanism.common.util.ChargeUtils;
|
||||
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 ContainerOredictionificator extends Container
|
||||
{
|
||||
|
@ -50,4 +54,80 @@ public class ContainerOredictionificator extends Container
|
|||
{
|
||||
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();
|
||||
|
||||
if(slotID == 1)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 2, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if(tileEntity.getResult(slotStack) != null)
|
||||
{
|
||||
if(slotID != 0 && slotID != 1)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 0, 1, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 2, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(slotID >= 2 && slotID <= 28)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 29, inventorySlots.size(), false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if(slotID > 28)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 2, 28, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 2, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(slotStack.stackSize == 0)
|
||||
{
|
||||
currentSlot.putStack((ItemStack)null);
|
||||
}
|
||||
else {
|
||||
currentSlot.onSlotChanged();
|
||||
}
|
||||
|
||||
if(slotStack.stackSize == stack.stackSize)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
currentSlot.onPickupFromSlot(player, slotStack);
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -104,6 +104,7 @@ import ic2.api.item.ISpecialElectricItem;
|
|||
* 2:0: Entangled Block
|
||||
* 2:1: Solar Neutron Activator
|
||||
* 2:2: Ambient Accumulator
|
||||
* 2:3: Oredictionificator
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -36,6 +36,8 @@ public class TileEntityOredictionificator extends TileEntityContainerBlock imple
|
|||
|
||||
public RedstoneControl controlType = RedstoneControl.DISABLED;
|
||||
|
||||
public boolean didProcess;
|
||||
|
||||
public TileEntityOredictionificator()
|
||||
{
|
||||
super(MachineType.OREDICTIONIFICATOR.name);
|
||||
|
@ -57,6 +59,8 @@ public class TileEntityOredictionificator extends TileEntityContainerBlock imple
|
|||
}
|
||||
}
|
||||
|
||||
didProcess = false;
|
||||
|
||||
if(inventory[0] != null && getValidName(inventory[0]) != null)
|
||||
{
|
||||
ItemStack result = getResult(inventory[0]);
|
||||
|
@ -73,6 +77,7 @@ public class TileEntityOredictionificator extends TileEntityContainerBlock imple
|
|||
}
|
||||
|
||||
inventory[1] = result;
|
||||
didProcess = true;
|
||||
}
|
||||
else if(inventory[0].isItemEqual(result) && inventory[0].stackSize < inventory[0].getMaxStackSize())
|
||||
{
|
||||
|
@ -84,6 +89,7 @@ public class TileEntityOredictionificator extends TileEntityContainerBlock imple
|
|||
}
|
||||
|
||||
inventory[1].stackSize++;
|
||||
didProcess = true;
|
||||
}
|
||||
|
||||
markDirty();
|
||||
|
@ -188,6 +194,7 @@ public class TileEntityOredictionificator extends TileEntityContainerBlock imple
|
|||
if(type == 0)
|
||||
{
|
||||
controlType = RedstoneControl.values()[dataStream.readInt()];
|
||||
didProcess = dataStream.readBoolean();
|
||||
|
||||
filters.clear();
|
||||
|
||||
|
@ -201,6 +208,7 @@ public class TileEntityOredictionificator extends TileEntityContainerBlock imple
|
|||
else if(type == 1)
|
||||
{
|
||||
controlType = RedstoneControl.values()[dataStream.readInt()];
|
||||
didProcess = dataStream.readBoolean();
|
||||
}
|
||||
else if(type == 2)
|
||||
{
|
||||
|
@ -223,6 +231,7 @@ public class TileEntityOredictionificator extends TileEntityContainerBlock imple
|
|||
data.add(0);
|
||||
|
||||
data.add(controlType.ordinal());
|
||||
data.add(didProcess);
|
||||
|
||||
data.add(filters.size());
|
||||
|
||||
|
@ -241,6 +250,7 @@ public class TileEntityOredictionificator extends TileEntityContainerBlock imple
|
|||
data.add(1);
|
||||
|
||||
data.add(controlType.ordinal());
|
||||
data.add(didProcess);
|
||||
|
||||
return data;
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
Loading…
Reference in a new issue