Added dust block and melting dusts into fluids
This commit is contained in:
parent
af4ce9b93c
commit
22f75bf48d
16 changed files with 516 additions and 369 deletions
|
@ -22,7 +22,7 @@ public class BlockFirebox extends BlockRI
|
|||
|
||||
public BlockFirebox()
|
||||
{
|
||||
super("firebox", Material.wood);
|
||||
super("firebox", Material.rock);
|
||||
this.setTickRandomly(true);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,12 +7,14 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import resonantinduction.core.ResonantInduction;
|
||||
import resonantinduction.core.resource.TileMaterial;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
import calclavia.lib.network.IPacketReceiver;
|
||||
import calclavia.lib.network.IPacketSender;
|
||||
|
@ -42,7 +44,12 @@ public class TileFirebox extends TileExternalInventory implements IPacketSender,
|
|||
* It takes 338260 J to boile water.
|
||||
*/
|
||||
private final long requiredBoilWaterEnergy = 338260;
|
||||
private long boilEnergy = 0;
|
||||
|
||||
/**
|
||||
* Requires about 6.6MJ of energy to melt iron.
|
||||
*/
|
||||
private final long requiredMeltIronEnergy = 4781700 + 1904000;
|
||||
private long heatEnergy = 0;
|
||||
|
||||
@Override
|
||||
public void updateEntity()
|
||||
|
@ -58,20 +65,52 @@ public class TileFirebox extends TileExternalInventory implements IPacketSender,
|
|||
worldObj.setBlock(xCoord, yCoord + 1, zCoord, Block.fire.blockID);
|
||||
}
|
||||
|
||||
if (blockID == Block.waterStill.blockID)
|
||||
{
|
||||
boilEnergy += POWER / 20;
|
||||
/**
|
||||
* Try to heat up and melt blocks above it.
|
||||
*/
|
||||
heatEnergy += POWER / 20;
|
||||
boolean usedHeat = false;
|
||||
|
||||
if (boilEnergy >= requiredBoilWaterEnergy)
|
||||
if (blockID == ResonantInduction.blockDust.blockID)
|
||||
{
|
||||
usedHeat = true;
|
||||
|
||||
if (heatEnergy >= requiredMeltIronEnergy)
|
||||
{
|
||||
TileEntity dustTile = worldObj.getBlockTileEntity(xCoord, yCoord + 1, zCoord);
|
||||
if (dustTile instanceof TileMaterial)
|
||||
{
|
||||
String name = ((TileMaterial) dustTile).name;
|
||||
worldObj.setBlock(xCoord, yCoord + 1, zCoord, ResonantInduction.blockFluidMaterial.blockID, 8, 3);
|
||||
TileEntity tile = worldObj.getBlockTileEntity(xCoord, yCoord + 1, zCoord);
|
||||
|
||||
if (tile instanceof TileMaterial)
|
||||
{
|
||||
((TileMaterial) tile).name = name;
|
||||
}
|
||||
|
||||
heatEnergy = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (blockID == Block.waterStill.blockID)
|
||||
{
|
||||
usedHeat = true;
|
||||
if (heatEnergy >= requiredBoilWaterEnergy)
|
||||
{
|
||||
if (FluidRegistry.getFluid("steam") != null)
|
||||
MinecraftForge.EVENT_BUS.post(new BoilEvent(worldObj, new Vector3(this).translate(0, 1, 0), new FluidStack(FluidRegistry.WATER, FluidContainerRegistry.BUCKET_VOLUME), new FluidStack(FluidRegistry.getFluid("steam"), FluidContainerRegistry.BUCKET_VOLUME), 2));
|
||||
|
||||
worldObj.setBlock(xCoord, yCoord + 1, zCoord, 0);
|
||||
boilEnergy = 0;
|
||||
heatEnergy = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (!usedHeat)
|
||||
{
|
||||
heatEnergy = 0;
|
||||
}
|
||||
|
||||
if (--burnTime == 0)
|
||||
{
|
||||
if (blockID == Block.fire.blockID)
|
||||
|
|
|
@ -13,9 +13,12 @@ import org.modstats.Modstats;
|
|||
import resonantinduction.core.handler.FluidEventHandler;
|
||||
import resonantinduction.core.handler.ToolModeLink;
|
||||
import resonantinduction.core.prefab.part.PacketMultiPart;
|
||||
import resonantinduction.core.resource.BlockDust;
|
||||
import resonantinduction.core.resource.ResourceGenerator;
|
||||
import resonantinduction.core.resource.TileMaterial;
|
||||
import resonantinduction.core.resource.fluid.BlockFluidMaterial;
|
||||
import resonantinduction.core.resource.fluid.BlockFluidMixture;
|
||||
import resonantinduction.core.resource.fluid.TileLiquidMixture;
|
||||
import resonantinduction.core.resource.fluid.TileFluidMixture;
|
||||
import resonantinduction.core.resource.item.ItemOreResource;
|
||||
import calclavia.components.tool.ToolMode;
|
||||
import calclavia.lib.content.ContentRegistry;
|
||||
|
@ -69,10 +72,13 @@ public class ResonantInduction
|
|||
public static ItemOreResource itemRubble;
|
||||
public static ItemOreResource itemDust;
|
||||
public static ItemOreResource itemRefinedDust;
|
||||
public static Block blockDust;
|
||||
public static Block blockFluidMixture;
|
||||
public static Block blockFluidMaterial;
|
||||
public static Block blockGas;
|
||||
|
||||
public static Fluid fluidMixture = null;
|
||||
public static Fluid fluidMixture;
|
||||
public static Fluid fluidMaterial;
|
||||
|
||||
public static final ContentRegistry contentRegistry = new ContentRegistry(Settings.CONFIGURATION, ID);
|
||||
|
||||
|
@ -92,7 +98,17 @@ public class ResonantInduction
|
|||
|
||||
fluidMixture = new Fluid("water");
|
||||
FluidRegistry.registerFluid(fluidMixture);
|
||||
blockFluidMixture = new BlockFluidMixture(Settings.CONFIGURATION.getBlock("FluidMixture", Settings.getNextBlockID()).getInt(), fluidMixture);
|
||||
blockFluidMixture = contentRegistry.createTile(BlockFluidMixture.class, TileFluidMixture.class);
|
||||
/**
|
||||
* Melting dusts
|
||||
*/
|
||||
blockDust = contentRegistry.createTile(BlockDust.class, TileMaterial.class);
|
||||
fluidMaterial = new Fluid("moltenMaterial");
|
||||
fluidMaterial.setDensity(7);
|
||||
fluidMaterial.setViscosity(10000);
|
||||
fluidMaterial.setTemperature(273 + 1538);
|
||||
FluidRegistry.registerFluid(fluidMaterial);
|
||||
blockFluidMaterial = contentRegistry.createTile(BlockFluidMaterial.class, TileMaterial.class);
|
||||
|
||||
// Items
|
||||
itemRubble = new ItemOreResource(Settings.getNextItemID(), "oreRubble");
|
||||
|
@ -103,9 +119,6 @@ public class ResonantInduction
|
|||
GameRegistry.registerItem(itemDust, itemDust.getUnlocalizedName());
|
||||
GameRegistry.registerItem(itemRefinedDust, itemRefinedDust.getUnlocalizedName());
|
||||
|
||||
GameRegistry.registerBlock(blockFluidMixture, blockFluidMixture.getUnlocalizedName());
|
||||
GameRegistry.registerTileEntity(TileLiquidMixture.class, blockFluidMixture.getUnlocalizedName());
|
||||
|
||||
Settings.save();
|
||||
proxy.preInit();
|
||||
}
|
||||
|
|
208
src/main/java/resonantinduction/core/resource/BlockDust.java
Normal file
208
src/main/java/resonantinduction/core/resource/BlockDust.java
Normal file
|
@ -0,0 +1,208 @@
|
|||
package resonantinduction.core.resource;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import resonantinduction.core.Reference;
|
||||
import resonantinduction.core.ResonantInduction;
|
||||
import resonantinduction.core.prefab.block.BlockRI;
|
||||
import resonantinduction.core.resource.item.ItemOreResource;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* The block form of the item dust.
|
||||
*
|
||||
* @author Calclavia
|
||||
*
|
||||
*/
|
||||
public class BlockDust extends BlockRI
|
||||
{
|
||||
public BlockDust()
|
||||
{
|
||||
super("dust", Material.iron);
|
||||
setCreativeTab(null);
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
|
||||
setBlockBoundsForSnowDepth(0);
|
||||
setTextureName(Reference.PREFIX + "material_sand");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase par5EntityLivingBase, ItemStack itemStack)
|
||||
{
|
||||
TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
|
||||
|
||||
if (tileEntity instanceof TileMaterial)
|
||||
{
|
||||
((TileMaterial) tileEntity).name = ((ItemOreResource) itemStack.getItem()).getMaterialFromStack(itemStack);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int colorMultiplier(IBlockAccess access, int x, int y, int z)
|
||||
{
|
||||
TileEntity tileEntity = access.getBlockTileEntity(x, y, z);
|
||||
|
||||
if (tileEntity instanceof TileMaterial)
|
||||
{
|
||||
if (((TileMaterial) tileEntity).name != null)
|
||||
{
|
||||
return ResourceGenerator.materialColors.get(((TileMaterial) tileEntity).name);
|
||||
}
|
||||
}
|
||||
|
||||
return 16777215;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1)
|
||||
{
|
||||
return new TileMaterial();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a bounding box from the pool of bounding boxes (this means this box can change after
|
||||
* the pool has been
|
||||
* cleared to be reused)
|
||||
*/
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
int l = par1World.getBlockMetadata(par2, par3, par4) & 7;
|
||||
float f = 0.125F;
|
||||
return AxisAlignedBB.getAABBPool().getAABB((double) par2 + this.minX, (double) par3 + this.minY, (double) par4 + this.minZ, (double) par2 + this.maxX, (double) ((float) par3 + (float) l * f), (double) par4 + this.maxZ);
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the
|
||||
* shared face of two
|
||||
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this
|
||||
* block.
|
||||
*/
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* If this block doesn't render as an ordinary block it will return False (examples: signs,
|
||||
* buttons, stairs, etc)
|
||||
*/
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the block's bounds for rendering it as an item
|
||||
*/
|
||||
public void setBlockBoundsForItemRender()
|
||||
{
|
||||
this.setBlockBoundsForSnowDepth(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the blocks bounds based on its current state. Args: world, x, y, z
|
||||
*/
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
||||
{
|
||||
this.setBlockBoundsForSnowDepth(par1IBlockAccess.getBlockMetadata(par2, par3, par4));
|
||||
}
|
||||
|
||||
/**
|
||||
* calls setBlockBounds based on the depth of the snow. Int is any values 0x0-0x7, usually this
|
||||
* blocks metadata.
|
||||
*/
|
||||
protected void setBlockBoundsForSnowDepth(int par1)
|
||||
{
|
||||
int j = par1 & 7;
|
||||
float f = (float) (2 * (1 + j)) / 16.0F;
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y,
|
||||
* z
|
||||
*/
|
||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed
|
||||
* (coordinates passed are
|
||||
* their own) Args: x, y, z, neighbor blockID
|
||||
*/
|
||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
this.canSnowStay(par1World, par2, par3, par4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if this snow block can stay at this location.
|
||||
*/
|
||||
private boolean canSnowStay(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
if (!this.canPlaceBlockAt(par1World, par2, par3, par4))
|
||||
{
|
||||
par1World.setBlockToAir(par2, par3, par4);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the player destroys a block with an item that can harvest it. (i, j, k) are the
|
||||
* coordinates of the
|
||||
* block and l is the block's subtype/damage.
|
||||
*/
|
||||
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
|
||||
{
|
||||
super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
|
||||
par1World.setBlockToAir(par3, par4, par5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the ID of the items to drop on destruction.
|
||||
*/
|
||||
public int idDropped(int par1, Random par2Random, int par3)
|
||||
{
|
||||
return ResonantInduction.itemRefinedDust.itemID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the quantity of items to drop on block destruction.
|
||||
*/
|
||||
public int quantityDropped(Random par1Random)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
/**
|
||||
* Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
|
||||
* coordinates. Args: blockAccess, x, y, z, side
|
||||
*/
|
||||
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
return par5 == 1 ? true : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(int meta, int fortune, Random random)
|
||||
{
|
||||
return (meta & 7) + 1;
|
||||
}
|
||||
}
|
|
@ -1,122 +0,0 @@
|
|||
package resonantinduction.core.resource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import resonantinduction.core.Reference;
|
||||
import resonantinduction.core.ResonantInduction;
|
||||
import resonantinduction.core.Settings;
|
||||
import calclavia.lib.ore.OreGenReplaceStone;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockOre extends Block
|
||||
{
|
||||
Icon[] icons = new Icon[EnumTierMaterial.values().length];
|
||||
|
||||
public BlockOre()
|
||||
{
|
||||
super(Settings.CONFIGURATION.getBlock("Ore", Settings.getNextBlockID()).getInt(), Material.rock);
|
||||
this.setCreativeTab(CreativeTabs.tabBlock);
|
||||
this.setUnlocalizedName(Reference.PREFIX + "Ore");
|
||||
this.setHardness(2.5f);
|
||||
this.setResistance(5.0f);
|
||||
|
||||
for (OreData data : OreData.values())
|
||||
{
|
||||
data.stack = new ItemStack(this.blockID, 1, data.ordinal());
|
||||
}
|
||||
this.loadOreNames();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int par1)
|
||||
{
|
||||
return par1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
||||
{
|
||||
for (OreData data : OreData.values())
|
||||
{
|
||||
par3List.add(data.stack);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
for (OreData data : OreData.values())
|
||||
{
|
||||
data.oreIcon = par1IconRegister.registerIcon(Reference.PREFIX + data.name + "Ore");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIcon(int side, int metadata)
|
||||
{
|
||||
if (metadata < OreData.values().length)
|
||||
{
|
||||
return OreData.values()[metadata].oreIcon;
|
||||
}
|
||||
return Block.stone.getIcon(side, metadata);
|
||||
}
|
||||
|
||||
public void loadOreNames()
|
||||
{
|
||||
for (OreData data : OreData.values())
|
||||
{
|
||||
OreDictionary.registerOre(data.oreName, data.stack);
|
||||
}
|
||||
}
|
||||
|
||||
public static enum OreData
|
||||
{
|
||||
TIN(EnumTierMaterial.TIN, "tin", "oreTin", 20, 8, 128),
|
||||
COPPER(EnumTierMaterial.COPPER, "copper", "copperOre", 20, 8, 128),
|
||||
SILVER(EnumTierMaterial.SILVER, "silver", "silverOre", 3, 8, 45),
|
||||
LEAD(EnumTierMaterial.LEAD, "lead", "leadOre", 1, 6, 30),
|
||||
Bauxite(EnumTierMaterial.ALUMINIUM, "bauxite", "bauxiteOre", 4, 6, 128);
|
||||
|
||||
public String name, oreName;
|
||||
public ItemStack stack;
|
||||
public EnumTierMaterial mat;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon oreIcon;
|
||||
|
||||
/* ORE GENERATOR OPTIONS */
|
||||
public boolean doWorldGen = true;
|
||||
public int ammount, branch, maxY;
|
||||
|
||||
private OreData(EnumTierMaterial mat, String name, String oreName, int ammount, int branch, int maxY)
|
||||
{
|
||||
this.name = name;
|
||||
this.oreName = oreName;
|
||||
this.mat = mat;
|
||||
|
||||
this.maxY = maxY;
|
||||
this.ammount = ammount;
|
||||
this.branch = branch;
|
||||
}
|
||||
|
||||
public OreGenReplaceStone getGeneratorSettings()
|
||||
{
|
||||
if (this.doWorldGen)
|
||||
{
|
||||
ItemStack stack = new ItemStack(ResonantInduction.blockOre, 1, this.ordinal());
|
||||
return (OreGenReplaceStone) new OreGenReplaceStone(this.name, this.name + "Ore", stack, this.maxY, this.ammount, this.branch).enable(Settings.CONFIGURATION);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
package resonantinduction.core.resource;
|
||||
|
||||
public enum EnumRecipePart
|
||||
{
|
||||
RUBBLE("Rubble"), DUST("Dust"), INGOTS("Ingot"), PLATES("Plate"), GEARS("Gears"), TUBE("Tube"),
|
||||
ROD("Rod"), SCRAPS("Scraps"), MOLTEN("Molten");
|
||||
|
||||
public String simpleName;
|
||||
|
||||
private EnumRecipePart(String name)
|
||||
{
|
||||
this.simpleName = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* This gets the part name based on the meta value of the ore dirv item. However can also be
|
||||
* used to get the part name if under X value
|
||||
*/
|
||||
public static String getPartName(int meta)
|
||||
{
|
||||
int partID = meta % EnumTierMaterial.itemCountPerMaterial;
|
||||
if (partID < EnumRecipePart.values().length)
|
||||
{
|
||||
return EnumRecipePart.values()[partID].simpleName;
|
||||
}
|
||||
return "Part[" + partID + "]";
|
||||
}
|
||||
|
||||
/** This gets the full name based on the metadata of the ore dirv item */
|
||||
public static String getFullName(int itemMetaData)
|
||||
{
|
||||
int matID = itemMetaData / EnumTierMaterial.itemCountPerMaterial;
|
||||
int partID = itemMetaData % EnumTierMaterial.itemCountPerMaterial;
|
||||
if (matID < EnumTierMaterial.values().length && partID < EnumRecipePart.values().length)
|
||||
{
|
||||
return EnumTierMaterial.values()[matID].simpleName + EnumRecipePart.values()[partID].simpleName;
|
||||
}
|
||||
return "OrePart[" + matID + "][" + partID + "]";
|
||||
}
|
||||
}
|
|
@ -1,143 +0,0 @@
|
|||
package resonantinduction.core.resource;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.EnumToolMaterial;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Class for storing materials, there icon names, sub items to be made from them or there sub ores
|
||||
*
|
||||
*
|
||||
* @author DarkGuardsman
|
||||
*/
|
||||
public enum EnumTierMaterial
|
||||
{
|
||||
WOOD("Wood", EnumToolMaterial.WOOD, EnumRecipePart.INGOTS, EnumRecipePart.PLATES, EnumRecipePart.RUBBLE, EnumRecipePart.ROD, EnumRecipePart.MOLTEN),
|
||||
STONE("Stone", EnumToolMaterial.STONE, EnumRecipePart.INGOTS, EnumRecipePart.SCRAPS, EnumRecipePart.MOLTEN),
|
||||
IRON("Iron", EnumToolMaterial.IRON, EnumRecipePart.INGOTS),
|
||||
OBBY("Obby", true, 7.0f, 500, 4, EnumRecipePart.INGOTS, EnumRecipePart.RUBBLE, EnumRecipePart.SCRAPS, EnumRecipePart.PLATES, EnumRecipePart.MOLTEN),
|
||||
GOLD("Gold", EnumToolMaterial.GOLD, EnumRecipePart.GEARS, EnumRecipePart.INGOTS),
|
||||
COAL("Coal", EnumToolMaterial.WOOD, EnumRecipePart.GEARS, EnumRecipePart.TUBE, EnumRecipePart.PLATES, EnumRecipePart.RUBBLE, EnumRecipePart.SCRAPS, EnumRecipePart.MOLTEN),
|
||||
|
||||
COPPER("Copper", true, 3.5f, 79, 1),
|
||||
TIN("Tin", true, 2.0f, 50, 1, EnumRecipePart.GEARS, EnumRecipePart.TUBE),
|
||||
LEAD("Lead", false, 0, 0, 1, EnumRecipePart.GEARS, EnumRecipePart.TUBE),
|
||||
ALUMINIUM("Aluminum", true, 5.0f, 100, 2, EnumRecipePart.GEARS, EnumRecipePart.TUBE),
|
||||
SILVER("Silver", true, 11.0f, 30, 0, EnumRecipePart.GEARS),
|
||||
STEEL("Steel", true, 7.0f, 4, 1000, EnumRecipePart.RUBBLE),
|
||||
BRONZE("Bronze", true, 6.5f, 3, 560, EnumRecipePart.RUBBLE);
|
||||
|
||||
/** Name of the material */
|
||||
public String simpleName;
|
||||
/** List of ore parts that to not be created for the material */
|
||||
public List<EnumRecipePart> unneedItems;
|
||||
|
||||
public boolean hasTools = false;
|
||||
|
||||
/** Limit by which each material is restricted by for creating orePart sub items */
|
||||
public static final int itemCountPerMaterial = 50;
|
||||
|
||||
/** Client side only var used by ore items to store icon per material set */
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon[] itemIcons;
|
||||
|
||||
public float materialEffectiveness = 2.0f;
|
||||
public int maxUses = 100;
|
||||
public float damageBoost = 0;
|
||||
|
||||
private EnumTierMaterial(String name, EnumToolMaterial material, EnumRecipePart... enumOreParts)
|
||||
{
|
||||
this(name, false, material.getEfficiencyOnProperMaterial(), material.getMaxUses(), material.getDamageVsEntity(), enumOreParts);
|
||||
}
|
||||
|
||||
private EnumTierMaterial(String name, boolean tool, float effectiveness, int toolUses, float damage, EnumRecipePart... enumOreParts)
|
||||
{
|
||||
this.simpleName = name;
|
||||
this.hasTools = tool;
|
||||
this.materialEffectiveness = effectiveness;
|
||||
this.maxUses = toolUses;
|
||||
this.damageBoost = damage;
|
||||
unneedItems = new ArrayList<EnumRecipePart>();
|
||||
for (int i = 0; enumOreParts != null && i < enumOreParts.length; i++)
|
||||
{
|
||||
unneedItems.add(enumOreParts[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new item stack using material and part given. Uses a preset length of 50 for parts
|
||||
* enum so to prevent any unwanted changes in loading of itemStacks metadata.
|
||||
*
|
||||
* @param mat - material
|
||||
* @param part - part
|
||||
* @return new ItemStack created from the two enums as long as everything goes right
|
||||
*/
|
||||
public static ItemStack getStack(Item item, EnumTierMaterial mat, EnumRecipePart part, int ammount)
|
||||
{
|
||||
ItemStack reStack = null;
|
||||
if (mat != null && part != null)
|
||||
{
|
||||
if (part == EnumRecipePart.INGOTS)
|
||||
{
|
||||
if (mat == EnumTierMaterial.IRON)
|
||||
{
|
||||
return new ItemStack(Item.ingotIron, 1);
|
||||
}
|
||||
else if (mat == EnumTierMaterial.GOLD)
|
||||
{
|
||||
return new ItemStack(Item.ingotGold, 1);
|
||||
}
|
||||
}
|
||||
int meta = mat.ordinal() * itemCountPerMaterial;
|
||||
meta += part.ordinal();
|
||||
return new ItemStack(item, ammount, meta);
|
||||
}
|
||||
return reStack;
|
||||
}
|
||||
|
||||
public ItemStack getStack(Item item, EnumRecipePart part)
|
||||
{
|
||||
return this.getStack(item, part, 1);
|
||||
}
|
||||
|
||||
public ItemStack getStack(Item item, EnumRecipePart part, int ammount)
|
||||
{
|
||||
return getStack(item, this, part, ammount);
|
||||
}
|
||||
|
||||
public static Icon getIcon(int metadata)
|
||||
{
|
||||
int mat = metadata / EnumTierMaterial.itemCountPerMaterial;
|
||||
if (mat < EnumTierMaterial.values().length)
|
||||
{
|
||||
return EnumTierMaterial.values()[metadata / EnumTierMaterial.itemCountPerMaterial].itemIcons[metadata % EnumTierMaterial.itemCountPerMaterial];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getOreName(EnumTierMaterial mat, EnumRecipePart part)
|
||||
{
|
||||
return mat.getOreName(part);
|
||||
}
|
||||
|
||||
public String getOreName(EnumRecipePart part)
|
||||
{
|
||||
return part.simpleName.toLowerCase() + this.simpleName;
|
||||
}
|
||||
|
||||
public boolean shouldCreateItem(EnumRecipePart part)
|
||||
{
|
||||
return this.unneedItems == null || !this.unneedItems.contains(part);
|
||||
}
|
||||
|
||||
public boolean shouldCreateTool()
|
||||
{
|
||||
return this.hasTools;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package resonantinduction.core.resource;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import calclavia.lib.prefab.tile.TileAdvanced;
|
||||
|
||||
/**
|
||||
* A tile that stores the material name.
|
||||
*
|
||||
* @author Calclavia
|
||||
*
|
||||
*/
|
||||
public class TileMaterial extends TileAdvanced
|
||||
{
|
||||
public String name;
|
||||
|
||||
@Override
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt)
|
||||
{
|
||||
super.readFromNBT(nbt);
|
||||
name = nbt.getString("name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt)
|
||||
{
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setString("name", name);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
package resonantinduction.core.resource.fluid;
|
||||
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.Configuration;
|
||||
import net.minecraftforge.fluids.BlockFluidFinite;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import resonantinduction.core.Reference;
|
||||
import resonantinduction.core.ResonantInduction;
|
||||
import resonantinduction.core.Settings;
|
||||
import resonantinduction.core.resource.ResourceGenerator;
|
||||
import resonantinduction.core.resource.TileMaterial;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Fluid class uses for molten materials.
|
||||
*
|
||||
* @author Calclavia
|
||||
*
|
||||
*/
|
||||
public class BlockFluidMaterial extends BlockFluidFinite implements ITileEntityProvider
|
||||
{
|
||||
public BlockFluidMaterial()
|
||||
{
|
||||
super(Settings.CONFIGURATION.get(Configuration.CATEGORY_BLOCK, "fluidMaterial", Settings.getNextBlockID()).getInt(), ResonantInduction.fluidMaterial, Material.lava);
|
||||
setTextureName("lava_flow");
|
||||
this.setUnlocalizedName(Reference.PREFIX + "fluidMaterial");
|
||||
}
|
||||
|
||||
public void setQuanta(World world, int x, int y, int z, int quanta)
|
||||
{
|
||||
if (quanta > 0)
|
||||
world.setBlockMetadataWithNotify(x, y, z, quanta, 3);
|
||||
else
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
|
||||
/* IFluidBlock */
|
||||
@Override
|
||||
public FluidStack drain(World world, int x, int y, int z, boolean doDrain)
|
||||
{
|
||||
TileMaterial tileFluid = (TileMaterial) world.getBlockTileEntity(x, y, z);
|
||||
FluidStack stack = new FluidStack(ResonantInduction.fluidMaterial, (int) (FluidContainerRegistry.BUCKET_VOLUME * this.getFilledPercentage(world, x, y, z)));
|
||||
return stack;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public int colorMultiplier(IBlockAccess access, int x, int y, int z)
|
||||
{
|
||||
TileEntity tileEntity = access.getBlockTileEntity(x, y, z);
|
||||
|
||||
if (tileEntity instanceof TileMaterial)
|
||||
{
|
||||
if (((TileMaterial) tileEntity).name != null)
|
||||
{
|
||||
return ResourceGenerator.materialColors.get(((TileMaterial) tileEntity).name);
|
||||
}
|
||||
}
|
||||
|
||||
return 16777215;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(World world, int x, int y, int z)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world)
|
||||
{
|
||||
return new TileMaterial();
|
||||
}
|
||||
}
|
|
@ -6,12 +6,15 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.Configuration;
|
||||
import net.minecraftforge.fluids.BlockFluidClassic;
|
||||
import net.minecraftforge.fluids.BlockFluidFinite;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import resonantinduction.core.Reference;
|
||||
import resonantinduction.core.ResonantInduction;
|
||||
import resonantinduction.core.Settings;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
|
@ -21,10 +24,11 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
*/
|
||||
public class BlockFluidMixture extends BlockFluidFinite implements ITileEntityProvider
|
||||
{
|
||||
public BlockFluidMixture(int id, Fluid fluid)
|
||||
public BlockFluidMixture()
|
||||
{
|
||||
super(id, fluid, Material.water);
|
||||
super(Settings.CONFIGURATION.get(Configuration.CATEGORY_BLOCK, "fluidMixture", Settings.getNextBlockID()).getInt(), ResonantInduction.fluidMixture, Material.water);
|
||||
setTextureName("water_flow");
|
||||
this.setUnlocalizedName(Reference.PREFIX + "fluidMixture");
|
||||
}
|
||||
|
||||
public void setQuanta(World world, int x, int y, int z, int quanta)
|
||||
|
@ -39,7 +43,7 @@ public class BlockFluidMixture extends BlockFluidFinite implements ITileEntityPr
|
|||
@Override
|
||||
public FluidStack drain(World world, int x, int y, int z, boolean doDrain)
|
||||
{
|
||||
TileLiquidMixture tileFluid = (TileLiquidMixture) world.getBlockTileEntity(x, y, z);
|
||||
TileFluidMixture tileFluid = (TileFluidMixture) world.getBlockTileEntity(x, y, z);
|
||||
FluidStack stack = new FluidStack(ResonantInduction.fluidMixture, (int) (FluidContainerRegistry.BUCKET_VOLUME * this.getFilledPercentage(world, x, y, z)));
|
||||
tileFluid.writeFluidToNBT(stack.tag != null ? stack.tag : new NBTTagCompound());
|
||||
return stack;
|
||||
|
@ -49,7 +53,7 @@ public class BlockFluidMixture extends BlockFluidFinite implements ITileEntityPr
|
|||
@Override
|
||||
public int colorMultiplier(IBlockAccess access, int x, int y, int z)
|
||||
{
|
||||
TileLiquidMixture tileFluid = (TileLiquidMixture) access.getBlockTileEntity(x, y, z);
|
||||
TileFluidMixture tileFluid = (TileFluidMixture) access.getBlockTileEntity(x, y, z);
|
||||
return tileFluid.getColor();
|
||||
}
|
||||
|
||||
|
@ -62,6 +66,6 @@ public class BlockFluidMixture extends BlockFluidFinite implements ITileEntityPr
|
|||
@Override
|
||||
public TileEntity createNewTileEntity(World world)
|
||||
{
|
||||
return new TileLiquidMixture();
|
||||
return new TileFluidMixture();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
* @author Calclavia
|
||||
*
|
||||
*/
|
||||
public class TileLiquidMixture extends TileAdvanced implements IPacketReceiver
|
||||
public class TileFluidMixture extends TileAdvanced implements IPacketReceiver
|
||||
{
|
||||
public final Set<ItemStack> items = new HashSet<ItemStack>();
|
||||
public final Set<FluidStack> fluids = new HashSet<FluidStack>();
|
|
@ -1,34 +0,0 @@
|
|||
package resonantinduction.core.resource.item;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import resonantinduction.core.Reference;
|
||||
import resonantinduction.core.resource.BlockOre.OreData;
|
||||
|
||||
public class ItemBlockOre extends ItemBlock
|
||||
{
|
||||
|
||||
public ItemBlockOre(int par1)
|
||||
{
|
||||
super(par1);
|
||||
this.setMaxDamage(0);
|
||||
this.setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int damage)
|
||||
{
|
||||
return damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack)
|
||||
{
|
||||
if (par1ItemStack != null && par1ItemStack.getItemDamage() < OreData.values().length)
|
||||
{
|
||||
return "tile." + Reference.PREFIX + OreData.values()[par1ItemStack.getItemDamage()].name + "Ore";
|
||||
}
|
||||
return super.getUnlocalizedName();
|
||||
}
|
||||
|
||||
}
|
|
@ -7,13 +7,16 @@ import net.minecraft.creativetab.CreativeTabs;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import resonantinduction.api.recipe.MachineRecipes;
|
||||
import resonantinduction.api.recipe.MachineRecipes.RecipeType;
|
||||
import resonantinduction.api.recipe.RecipeUtils.Resource;
|
||||
import resonantinduction.core.ResonantInduction;
|
||||
import resonantinduction.core.prefab.item.ItemRI;
|
||||
import resonantinduction.core.resource.ResourceGenerator;
|
||||
import resonantinduction.core.resource.TileMaterial;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
import calclavia.lib.utility.LanguageUtility;
|
||||
import calclavia.lib.utility.inventory.InventoryUtility;
|
||||
|
@ -29,6 +32,8 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
*/
|
||||
public class ItemOreResource extends ItemRI
|
||||
{
|
||||
private int blockID = ResonantInduction.blockDust.blockID;;
|
||||
|
||||
public ItemOreResource(int id, String name)
|
||||
{
|
||||
super(name, id);
|
||||
|
@ -60,6 +65,87 @@ public class ItemOreResource extends ItemRI
|
|||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
/**
|
||||
* Allow refined dust to be placed down.
|
||||
*/
|
||||
if (stack.getItem() == ResonantInduction.itemRefinedDust)
|
||||
{
|
||||
if (stack.stackSize == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (!player.canPlayerEdit(x, y, z, side, stack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
TileEntity tile = world.getBlockTileEntity(x, y, z);
|
||||
|
||||
if (world.getBlockId(x, y, z) == blockID && tile instanceof TileMaterial)
|
||||
{
|
||||
if (getMaterialFromStack(stack).equals(((TileMaterial) tile).name))
|
||||
{
|
||||
Block block = Block.blocksList[blockID];
|
||||
int j1 = world.getBlockMetadata(x, y, z);
|
||||
int k1 = j1 & 7;
|
||||
|
||||
if (k1 <= 6 && world.checkNoEntityCollision(block.getCollisionBoundingBoxFromPool(world, x, y, z)) && world.setBlockMetadataWithNotify(x, y, z, k1 + 1 | j1 & -8, 2))
|
||||
{
|
||||
world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), block.stepSound.getPlaceSound(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F);
|
||||
--stack.stackSize;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (side == 0)
|
||||
{
|
||||
--y;
|
||||
}
|
||||
|
||||
if (side == 1)
|
||||
{
|
||||
++y;
|
||||
}
|
||||
|
||||
if (side == 2)
|
||||
{
|
||||
--z;
|
||||
}
|
||||
|
||||
if (side == 3)
|
||||
{
|
||||
++z;
|
||||
}
|
||||
|
||||
if (side == 4)
|
||||
{
|
||||
--x;
|
||||
}
|
||||
|
||||
if (side == 5)
|
||||
{
|
||||
++x;
|
||||
}
|
||||
|
||||
if (world.canPlaceEntityOnSide(blockID, x, y, z, false, side, player, stack))
|
||||
{
|
||||
Block block = Block.blocksList[blockID];
|
||||
int j1 = this.getMetadata(stack.getItemDamage());
|
||||
int k1 = Block.blocksList[blockID].onBlockPlaced(world, x, y, z, side, hitX, hitY, hitZ, j1);
|
||||
|
||||
if (placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, k1))
|
||||
{
|
||||
world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), block.stepSound.getPlaceSound(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F);
|
||||
--stack.stackSize;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Manually wash dust into refined dust.
|
||||
*/
|
||||
|
@ -98,6 +184,22 @@ public class ItemOreResource extends ItemRI
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata)
|
||||
{
|
||||
if (!world.setBlock(x, y, z, this.blockID, metadata, 3))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (world.getBlockId(x, y, z) == this.blockID)
|
||||
{
|
||||
Block.blocksList[this.blockID].onBlockPlacedBy(world, x, y, z, player, stack);
|
||||
Block.blocksList[this.blockID].onPostBlockPlaced(world, x, y, z, metadata);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public ItemStack getStackFromMaterial(String name)
|
||||
{
|
||||
ItemStack itemStack = new ItemStack(this);
|
||||
|
|
|
@ -339,11 +339,14 @@ public class PartGear extends PartMechanical implements IMechanical, IMultiBlock
|
|||
@Override
|
||||
public void onMultiBlockChanged()
|
||||
{
|
||||
tile().notifyPartChange(this);
|
||||
|
||||
if (!world().isRemote)
|
||||
if (world() != null)
|
||||
{
|
||||
sendDescUpdate();
|
||||
tile().notifyPartChange(this);
|
||||
|
||||
if (!world().isRemote)
|
||||
{
|
||||
sendDescUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import resonantinduction.api.recipe.RecipeUtils.Resource;
|
|||
import resonantinduction.core.ResonantInduction;
|
||||
import resonantinduction.core.prefab.block.BlockRI;
|
||||
import resonantinduction.core.resource.fluid.BlockFluidMixture;
|
||||
import resonantinduction.core.resource.fluid.TileLiquidMixture;
|
||||
import resonantinduction.core.resource.fluid.TileFluidMixture;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
import calclavia.lib.utility.inventory.InventoryUtility;
|
||||
|
||||
|
@ -53,11 +53,11 @@ public class BlockFilter extends BlockRI implements ITileEntityProvider
|
|||
TileEntity tileAbove = checkAbove.getTileEntity(world);
|
||||
TileEntity tileBelow = checkBelow.getTileEntity(world);
|
||||
|
||||
if (tileAbove instanceof TileLiquidMixture && (tileBelow == null || tileBelow instanceof TileLiquidMixture))
|
||||
if (tileAbove instanceof TileFluidMixture && (tileBelow == null || tileBelow instanceof TileFluidMixture))
|
||||
{
|
||||
world.spawnParticle("dripWater", x + 0.5, y, z + 0.5, 0, 0, 0);
|
||||
|
||||
if (((TileLiquidMixture) tileAbove).items.size() > 0)
|
||||
if (((TileFluidMixture) tileAbove).items.size() > 0)
|
||||
{
|
||||
/**
|
||||
* Leak the fluid down.
|
||||
|
@ -71,7 +71,7 @@ public class BlockFilter extends BlockRI implements ITileEntityProvider
|
|||
if (amount <= 1)
|
||||
{
|
||||
System.out.println("filter dropped");
|
||||
for (ItemStack itemStack : ((TileLiquidMixture) tileAbove).items)
|
||||
for (ItemStack itemStack : ((TileFluidMixture) tileAbove).items)
|
||||
{
|
||||
for (Resource resoure : MachineRecipes.INSTANCE.getOutput(RecipeType.MIXER, itemStack))
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@ import resonantinduction.api.recipe.MachineRecipes;
|
|||
import resonantinduction.api.recipe.MachineRecipes.RecipeType;
|
||||
import resonantinduction.core.Reference;
|
||||
import resonantinduction.core.ResonantInduction;
|
||||
import resonantinduction.core.resource.fluid.TileLiquidMixture;
|
||||
import resonantinduction.core.resource.fluid.TileFluidMixture;
|
||||
import resonantinduction.mechanical.network.TileMechanical;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
|
||||
|
@ -158,10 +158,10 @@ public class TileMixer extends TileMechanical
|
|||
Vector3 mixPosition = new Vector3(entity.posX, yCoord, entity.posZ);
|
||||
TileEntity tileEntity = mixPosition.getTileEntity(worldObj);
|
||||
|
||||
if (tileEntity instanceof TileLiquidMixture)
|
||||
if (tileEntity instanceof TileFluidMixture)
|
||||
{
|
||||
ItemStack itemStack = entity.getEntityItem().copy();
|
||||
if (((TileLiquidMixture) tileEntity).mix(itemStack))
|
||||
if (((TileFluidMixture) tileEntity).mix(itemStack))
|
||||
{
|
||||
System.out.println("MIXED");
|
||||
worldObj.notifyBlocksOfNeighborChange(mixPosition.intX(), mixPosition.intY(), mixPosition.intZ(), mixPosition.getBlockID(worldObj));
|
||||
|
|
Loading…
Add table
Reference in a new issue