Minor tweaks and changes to mixer
This commit is contained in:
parent
9c3700382f
commit
e7cc0f992a
9 changed files with 29 additions and 30 deletions
|
@ -74,7 +74,7 @@ public class ResonantInduction
|
|||
public static Block blockGas;
|
||||
public static Block blockDebug;
|
||||
|
||||
public static Fluid MIXTURE = null;
|
||||
public static Fluid fluidMixture = null;
|
||||
|
||||
public static final ContentRegistry contentRegistry = new ContentRegistry(Settings.CONFIGURATION, ID);
|
||||
|
||||
|
@ -91,9 +91,9 @@ public class ResonantInduction
|
|||
MinecraftForge.EVENT_BUS.register(new LinkEventHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new FluidEventHandler());
|
||||
|
||||
MIXTURE = new Fluid("mixture");
|
||||
FluidRegistry.registerFluid(MIXTURE);
|
||||
blockFluidMixture = new BlockFluidMixture(Settings.CONFIGURATION.getBlock("FluidMixture", Settings.getNextBlockID()).getInt(), MIXTURE);
|
||||
fluidMixture = new Fluid("water");
|
||||
FluidRegistry.registerFluid(fluidMixture);
|
||||
blockFluidMixture = new BlockFluidMixture(Settings.CONFIGURATION.getBlock("FluidMixture", Settings.getNextBlockID()).getInt(), fluidMixture);
|
||||
|
||||
// Items
|
||||
itemRubble = new ItemOreResource(Settings.getNextItemID(), "oreRubble");
|
||||
|
|
|
@ -37,6 +37,6 @@ public class FluidEventHandler
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void textureHook(TextureStitchEvent.Post event)
|
||||
{
|
||||
ResonantInduction.MIXTURE.setIcons(fluidIconMap.get(Reference.PREFIX + "mixture"));
|
||||
ResonantInduction.fluidMixture.setIcons(fluidIconMap.get(Reference.PREFIX + "mixture"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,7 +76,8 @@ public class ResourceGenerator
|
|||
|
||||
// Add rubble to crushing recipes
|
||||
// TODO: Change this to CRUSHING when the crusher is finished.
|
||||
MachineRecipes.INSTANCE.addRecipe(RecipeType.GRINDER, "ore" + name, "dust" + name, "dust" + name);
|
||||
MachineRecipes.INSTANCE.addRecipe(RecipeType.GRINDER, "ore" + name, "rubble" + name);
|
||||
MachineRecipes.INSTANCE.addRecipe(RecipeType.GRINDER, "rubble" + name, "dust" + name, "dust" + name);
|
||||
|
||||
// Add dust to mixer recipes, dummy item because mixer doesn't produce any items.
|
||||
MachineRecipes.INSTANCE.addRecipe(RecipeType.MIXER, "dust" + name, "dustRefined" + name);
|
||||
|
|
|
@ -1,34 +1,37 @@
|
|||
package resonantinduction.core.resource.fluid;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
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.fluids.BlockFluidFinite;
|
||||
import net.minecraftforge.fluids.BlockFluidClassic;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import resonantinduction.core.ResonantInduction;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* @author Calclavia
|
||||
*
|
||||
*/
|
||||
public class BlockFluidMixture extends BlockFluidFinite implements ITileEntityProvider
|
||||
public class BlockFluidMixture extends BlockFluidClassic implements ITileEntityProvider
|
||||
{
|
||||
public BlockFluidMixture(int id, Fluid fluid)
|
||||
{
|
||||
super(id, fluid, Material.water);
|
||||
this.setTextureName("water_flow");
|
||||
setTextureName("water_flow");
|
||||
}
|
||||
|
||||
public void setQuanta(World world, int x, int y, int z, int quanta)
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y, z, quanta - 1, 3);
|
||||
if (quanta > 0)
|
||||
world.setBlockMetadataWithNotify(x, y, z, 0, 3);
|
||||
else
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
|
||||
/* IFluidBlock */
|
||||
|
@ -36,7 +39,7 @@ public class BlockFluidMixture extends BlockFluidFinite implements ITileEntityPr
|
|||
public FluidStack drain(World world, int x, int y, int z, boolean doDrain)
|
||||
{
|
||||
TileLiquidMixture tileFluid = (TileLiquidMixture) world.getBlockTileEntity(x, y, z);
|
||||
FluidStack stack = new FluidStack(ResonantInduction.MIXTURE, (int) (FluidContainerRegistry.BUCKET_VOLUME * this.getFilledPercentage(world, 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;
|
||||
}
|
||||
|
|
|
@ -82,7 +82,8 @@ public class PartGear extends PartMechanical implements IMechanical, IMultiBlock
|
|||
@Override
|
||||
public boolean activate(EntityPlayer player, MovingObjectPosition hit, ItemStack item)
|
||||
{
|
||||
// System.out.println(getNetwork());
|
||||
if(!world().isRemote)
|
||||
System.out.println(getNetwork());
|
||||
if (BlockAdvanced.isUsableWrench(player, player.getCurrentEquippedItem(), x(), y(), z()))
|
||||
{
|
||||
if (player.isSneaking())
|
||||
|
|
|
@ -100,29 +100,20 @@ public abstract class PartMechanical extends JCuboidPart implements JNormalOcclu
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onAdded()
|
||||
public void onWorldJoin()
|
||||
{
|
||||
super.onAdded();
|
||||
refresh();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMoved()
|
||||
{
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkLoad()
|
||||
{
|
||||
super.onChunkLoad();
|
||||
refresh();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborChanged()
|
||||
{
|
||||
super.onNeighborChanged();
|
||||
refresh();
|
||||
}
|
||||
|
||||
|
|
|
@ -54,20 +54,21 @@ public class BlockFilter extends BlockRI implements ITileEntityProvider
|
|||
|
||||
if (tileAbove instanceof TileLiquidMixture && (tileBelow == null || tileBelow instanceof TileLiquidMixture))
|
||||
{
|
||||
if (((TileLiquidMixture) tileAbove).items.size() > 0)
|
||||
{
|
||||
world.spawnParticle("dripWater", x + 0.5, y, z + 0.5, 0, 0, 0);
|
||||
world.spawnParticle("dripWater", x + 0.5, y, z + 0.5, 0, 0, 0);
|
||||
|
||||
if (((TileLiquidMixture) tileAbove).items.size() > 0 && random.nextFloat() > 0.9f)
|
||||
{
|
||||
/**
|
||||
* Leak the fluid down.
|
||||
*/
|
||||
BlockFluidMixture fluidBlock = (BlockFluidMixture) ResonantInduction.blockFluidMixture;
|
||||
int amount = fluidBlock.getQuantaValue(world, x, y, z);
|
||||
|
||||
System.out.println(amount);
|
||||
|
||||
/**
|
||||
* All fluid is filtered out, spawn all the items.
|
||||
*/
|
||||
if (amount <= 1)
|
||||
//if (amount <= 1)
|
||||
{
|
||||
System.out.println("filter dropped");
|
||||
for (ItemStack itemStack : ((TileLiquidMixture) tileAbove).items)
|
||||
|
|
|
@ -66,7 +66,7 @@ public class TileMixer extends TileMechanical
|
|||
|
||||
if (checkVector.getBlockID(worldObj) == Block.waterStill.blockID)
|
||||
{
|
||||
checkVector.setBlock(worldObj, ResonantInduction.blockFluidMixture.blockID, 8, 4);
|
||||
checkVector.setBlock(worldObj, ResonantInduction.blockFluidMixture.blockID, 8, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,7 +77,9 @@ tile.resonantinduction\:fluidPipe.16.name=White Wood Trough
|
|||
|
||||
## Machines and Processing
|
||||
tile.resonantinduction\:mixer.name=Mixer
|
||||
tile.resonantinduction\:mixer.tooltip=The mixer mixes dusts with water to wash and refine the ore dust. Mixer prefers more angular velocity (spin) to process dusts.
|
||||
tile.resonantinduction\:grindingWheel.name=Grinder Wheel
|
||||
tile.resonantinduction\:grindingWheel.tooltip=The grinding wheel grinds ores into rubble and dust. Larger torque allows faster grinding.
|
||||
tile.resonantinduction\:filter.name=Filter
|
||||
|
||||
### Electrical Module
|
||||
|
|
Loading…
Add table
Reference in a new issue