diff --git a/archaic/src/main/java/resonantinduction/archaic/filter/TileFilter.java b/archaic/src/main/java/resonantinduction/archaic/filter/TileFilter.java index 73abf21db..2bfcc2f72 100644 --- a/archaic/src/main/java/resonantinduction/archaic/filter/TileFilter.java +++ b/archaic/src/main/java/resonantinduction/archaic/filter/TileFilter.java @@ -53,7 +53,7 @@ public class TileFilter extends TileFilterable implements IFilterable */ for (RecipeResource resoure : MachineRecipes.INSTANCE.getOutput(RecipeType.MIXER, "dust" + LanguageUtility.capitalizeFirst(ResourceGenerator.mixtureToMaterial(fluidBlock.getFluid().getName())))) { - InventoryUtility.dropItemStack(worldObj, checkAbove.clone().add(0.5), resoure.getItemStack().copy()); + InventoryUtility.dropItemStack(worldObj, checkAbove.clone().add(0.5), resoure.getItemStack().copy(), 0, false); } // TODO: Check if this is correct? diff --git a/archaic/src/main/java/resonantinduction/archaic/fluid/tank/TankNetwork.java b/archaic/src/main/java/resonantinduction/archaic/fluid/tank/TankNetwork.java index e2db867c9..797117f39 100644 --- a/archaic/src/main/java/resonantinduction/archaic/fluid/tank/TankNetwork.java +++ b/archaic/src/main/java/resonantinduction/archaic/fluid/tank/TankNetwork.java @@ -41,7 +41,7 @@ public class TankNetwork extends FluidDistributionetwork @Override public int compare(Object a, Object b) { - if (networkTankFluid.getFluid().isGaseous()) + if (networkTankFluid != null && networkTankFluid.getFluid().isGaseous()) return 0; TileEntity wa = (TileEntity) a; diff --git a/mechanical/src/main/java/resonantinduction/mechanical/energy/turbine/TileWaterTurbine.java b/mechanical/src/main/java/resonantinduction/mechanical/energy/turbine/TileWaterTurbine.java index 81e6b6034..79d93e108 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/energy/turbine/TileWaterTurbine.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/energy/turbine/TileWaterTurbine.java @@ -75,7 +75,6 @@ public class TileWaterTurbine extends TileMechanicalTurbine if (blockID == Block.waterMoving.blockID || blockID == Block.waterStill.blockID) { - try { Method m = ReflectionHelper.findMethod(BlockFluid.class, null, new String[] { "getFlowVector", "func_72202_i" }, IBlockAccess.class, Integer.TYPE, Integer.TYPE, Integer.TYPE); diff --git a/mechanical/src/main/java/resonantinduction/mechanical/process/purifier/TileMixer.java b/mechanical/src/main/java/resonantinduction/mechanical/process/purifier/TileMixer.java index 30d7185ec..113bccfba 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/process/purifier/TileMixer.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/process/purifier/TileMixer.java @@ -7,6 +7,8 @@ import java.util.Set; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; import net.minecraftforge.common.ForgeDirection; @@ -19,12 +21,13 @@ import resonantinduction.core.resource.ResourceGenerator; import resonantinduction.core.resource.fluid.BlockFluidMixture; import resonantinduction.mechanical.energy.network.TileMechanical; import universalelectricity.api.vector.Vector3; +import calclavia.lib.utility.inventory.InventoryUtility; /** * @author Calclavia * */ -public class TileMixer extends TileMechanical +public class TileMixer extends TileMechanical implements IInventory { public static final long POWER = 500000; public static final int PROCESS_TIME = 5 * 20; @@ -167,7 +170,83 @@ public class TileMixer extends TileMechanical @Override public boolean inverseRotation(ForgeDirection dir, IMechanical with) + { + return dir == ForgeDirection.DOWN; + } + + @Override + public int getSizeInventory() + { + return 1; + } + + @Override + public ItemStack getStackInSlot(int i) + { + return null; + } + + @Override + public ItemStack decrStackSize(int i, int j) + { + return null; + } + + @Override + public ItemStack getStackInSlotOnClosing(int i) + { + return null; + } + + @Override + public void setInventorySlotContents(int i, ItemStack itemstack) + { + if (!worldObj.isRemote) + { + Vector3 spawnVector = new Vector3(this).translate(ForgeDirection.getOrientation(worldObj.rand.nextInt(4) + 2)).translate(0.5); + InventoryUtility.dropItemStack(worldObj, spawnVector, itemstack, 20, false); + } + } + + @Override + public String getInvName() + { + return null; + } + + @Override + public boolean isInvNameLocalized() { return false; } + + @Override + public int getInventoryStackLimit() + { + return 64; + } + + @Override + public boolean isUseableByPlayer(EntityPlayer entityplayer) + { + return false; + } + + @Override + public void openChest() + { + + } + + @Override + public void closeChest() + { + + } + + @Override + public boolean isItemValidForSlot(int i, ItemStack itemstack) + { + return MachineRecipes.INSTANCE.getOutput(RecipeType.MIXER, itemstack).length > 0; + } }