Temporarily disabled mixer for upcoming rewrite

This commit is contained in:
Calclavia 2014-01-31 22:43:10 +08:00
parent 0562b19dc8
commit d0b0a34a31
6 changed files with 18 additions and 100 deletions

View file

@ -11,7 +11,6 @@ import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import org.modstats.ModstatInfo;
import org.modstats.Modstats;
@ -22,9 +21,6 @@ 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.TileFluidMixture;
import resonantinduction.core.resource.item.ItemOreResource;
import calclavia.components.tool.ToolMode;
import calclavia.lib.content.ContentRegistry;
@ -81,12 +77,11 @@ public class ResonantInduction
public static ItemOreResource itemDust;
public static ItemOreResource itemRefinedDust;
public static Block blockDust;
public static Block blockFluidMixture;
public static List<Block> blockFluidMaterial = new ArrayList<Block>();
public static Block blockGas;
public static Fluid fluidMixture;
public static List<Fluid> fluidMaterial = new ArrayList<Fluid>();
public static List<Fluid> fluidDustMixtures = new ArrayList<Fluid>();
public static List<Fluid> fluidMaterials = new ArrayList<Fluid>();
public static final ContentRegistry contentRegistry = new ContentRegistry(Settings.CONFIGURATION, ID);
@ -105,10 +100,6 @@ public class ResonantInduction
MinecraftForge.EVENT_BUS.register(ResourceGenerator.INSTANCE);
MinecraftForge.EVENT_BUS.register(new FluidEventHandler());
fluidMixture = new Fluid("water");
FluidRegistry.registerFluid(fluidMixture);
blockFluidMixture = contentRegistry.createTile(BlockFluidMixture.class, TileFluidMixture.class);
/**
* Melting dusts
*/
@ -166,7 +157,7 @@ public class ResonantInduction
@SideOnly(Side.CLIENT)
public void postTextureHook(TextureStitchEvent.Post event)
{
for (Fluid fluid : fluidMaterial)
for (Fluid fluid : fluidMaterials)
fluid.setIcons(loadedIconMap.get(Reference.PREFIX + "molten_flow"));
}
}

View file

@ -37,6 +37,6 @@ public class FluidEventHandler
@SideOnly(Side.CLIENT)
public void textureHook(TextureStitchEvent.Post event)
{
ResonantInduction.fluidMixture.setIcons(fluidIconMap.get(Reference.PREFIX + "mixture"));
//ResonantInduction.fluidMixture.setIcons(fluidIconMap.get(Reference.PREFIX + "mixture"));
}
}

View file

@ -1,71 +0,0 @@
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.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;
/**
* @author Calclavia
*
*/
public class BlockFluidMixture extends BlockFluidFinite implements ITileEntityProvider
{
public BlockFluidMixture()
{
super(Settings.CONFIGURATION.get(Configuration.CATEGORY_BLOCK, "fluidMixture", Settings.getNextBlockID()).getInt(), ResonantInduction.fluidMixture, Material.water);
setTextureName(Reference.PREFIX + "mixture_flow");
this.setUnlocalizedName(Reference.PREFIX + "fluidMixture");
}
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)
{
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;
}
@SideOnly(Side.CLIENT)
@Override
public int colorMultiplier(IBlockAccess access, int x, int y, int z)
{
TileFluidMixture tileFluid = (TileFluidMixture) access.getBlockTileEntity(x, y, z);
return tileFluid.getColor();
}
@Override
public boolean canDrain(World world, int x, int y, int z)
{
return true;
}
@Override
public TileEntity createNewTileEntity(World world)
{
return new TileFluidMixture();
}
}

View file

@ -79,6 +79,6 @@ public class RenderGenerator extends TileEntitySpecialRenderer implements ICusto
@Override
public void renderDynamic(TileEntity tile, Block block, int metadata, int modelID, RenderBlocks renderer)
{
doRender(tile, metadata, 0, 0, 0, 0);
doRender(tile, 2, 0, 0, 0, 0);
}
}

View file

@ -2,21 +2,13 @@ package resonantinduction.mechanical.process;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
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.block.BlockRI;
import resonantinduction.core.resource.fluid.BlockFluidMixture;
import resonantinduction.core.resource.fluid.TileFluidMixture;
import universalelectricity.api.vector.Vector3;
import calclavia.lib.utility.inventory.InventoryUtility;
/**
* Used for filtering liquid mixtures
@ -62,12 +54,13 @@ public class BlockFilter extends BlockRI implements ITileEntityProvider
/**
* Leak the fluid down.
*/
/*
BlockFluidMixture fluidBlock = (BlockFluidMixture) ResonantInduction.blockFluidMixture;
int amount = fluidBlock.getQuantaValue(world, x, y, z);
/**
* All fluid is filtered out, spawn all the items.
*/
*
if (amount <= 1)
{
System.out.println("filter dropped");
@ -84,7 +77,7 @@ public class BlockFilter extends BlockRI implements ITileEntityProvider
/**
* Remove liquid from top.
*/
*
if (remaining > 0)
{
fluidBlock.setQuanta(world, checkAbove.intX(), checkAbove.intY(), checkAbove.intZ(), remaining);
@ -97,7 +90,7 @@ public class BlockFilter extends BlockRI implements ITileEntityProvider
/**
* Add liquid to bottom.
*/
*
if (checkBelow.getBlockID(world) == ResonantInduction.blockFluidMixture.blockID)
{
fluidBlock.setQuanta(world, checkBelow.intX(), checkBelow.intY(), checkBelow.intZ(), fluidBlock.getQuantaValue(world, checkBelow.intX(), checkBelow.intY(), checkBelow.intZ()) + 1);
@ -105,7 +98,7 @@ public class BlockFilter extends BlockRI implements ITileEntityProvider
else
{
checkBelow.setBlock(world, Block.waterStill.blockID, 3);
}
}*/
}
}
}

View file

@ -4,7 +4,6 @@ import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
@ -16,6 +15,7 @@ import resonantinduction.api.recipe.MachineRecipes.RecipeType;
import resonantinduction.core.Reference;
import resonantinduction.core.ResonantInduction;
import resonantinduction.core.resource.fluid.TileFluidMixture;
import resonantinduction.mechanical.fluid.tank.TileTank;
import resonantinduction.mechanical.network.TileMechanical;
import universalelectricity.api.vector.Vector3;
@ -57,19 +57,24 @@ public class TileMixer extends TileMechanical
/**
* Transform all water blocks into mixture blocks
*/
boolean foundTanks = true;
for (int x = -1; x < 1; x++)
{
for (int z = -1; z < 1; z++)
{
Vector3 checkVector = new Vector3(this).translate(x, 0, z);
if (checkVector.getBlockID(worldObj) == Block.waterStill.blockID || checkVector.getBlockID(worldObj) == Block.waterMoving.blockID)
if (!(checkVector.getTileEntity(worldObj) instanceof TileTank))
{
checkVector.setBlock(worldObj, ResonantInduction.blockFluidMixture.blockID, 8, 3);
foundTanks = false;
}
}
}
if (!foundTanks)
return;
// Search for an item to "process"
AxisAlignedBB aabb = AxisAlignedBB.getAABBPool().getAABB(this.xCoord - 1, this.yCoord, this.zCoord - 1, this.xCoord + 2, this.yCoord + 1, this.zCoord + 2);
List<Entity> entities = this.worldObj.getEntitiesWithinAABB(Entity.class, aabb);