Fixed #254 - Some mixer issues

This commit is contained in:
Calclavia 2014-02-21 22:48:55 +08:00
parent 8352961a94
commit 8a4509feac
4 changed files with 15 additions and 18 deletions

View file

@ -68,20 +68,14 @@ public class BlockFilter extends BlockTile
InventoryUtility.dropItemStack(world, checkAbove.clone().add(0.5), resoure.getItemStack().copy());
}
int remaining = amount - 1;
//TODO: Check if this is correct?
int remaining = amount - 2;
/**
* Remove liquid from top.
*/
if (remaining > 0)
{
fluidBlock.setQuanta(world, checkAbove.intX(), checkAbove.intY(), checkAbove.intZ(), remaining);
world.scheduleBlockUpdate(x, y, z, blockID, 20);
}
else
{
checkAbove.setBlock(world, 0);
}
fluidBlock.setQuanta(world, checkAbove.intX(), checkAbove.intY(), checkAbove.intZ(), remaining);
world.scheduleBlockUpdate(x, y, z, blockID, 20);
/**
* Add liquid to bottom.

View file

@ -38,10 +38,10 @@ public class RenderMixer extends TileEntitySpecialRenderer implements ISimpleIte
glPushMatrix();
glTranslatef((float) x + 0.5F, (float) y + 0.5f, (float) z + 0.5F);
RenderUtility.bind(TEXTURE);
MODEL.renderOnly("centerTop", "centerBase", "centerPoll");
MODEL.renderOnly("centerTop", "centerBase");
glPushMatrix();
glRotatef((float) Math.toDegrees(tile.angle), 0, 1, 0);
MODEL.renderAllExcept("centerTop", "centerBase", "centerPoll");
MODEL.renderAllExcept("centerTop", "centerBase");
glPopMatrix();
glPopMatrix();
}

View file

@ -151,7 +151,7 @@ public class TileMixer extends TileMechanical
return true;
}
}
else if (worldObj.isAirBlock(mixPosition.intX(), mixPosition.intY(), mixPosition.intZ()))
else if (worldObj.isAirBlock(mixPosition.intX(), mixPosition.intY(), mixPosition.intZ()) || block.blockID == Block.waterStill.blockID || block.blockID == Block.waterMoving.blockID)
{
mixPosition.setBlock(worldObj, ResonantInduction.blockFluidMixtures.get(entity.getEntityItem().getItemDamage()).blockID);
}

View file

@ -31,7 +31,7 @@ public class BlockFluidMixture extends BlockFluidFinite
public void setQuanta(World world, int x, int y, int z, int quanta)
{
if (quanta > 0)
if (quanta > 0 && quanta <= quantaPerBlock)
world.setBlockMetadataWithNotify(x, y, z, quanta, 3);
else
world.setBlockToAir(x, y, z);
@ -58,9 +58,12 @@ public class BlockFluidMixture extends BlockFluidFinite
{
if (MachineRecipes.INSTANCE.getOutput(RecipeType.MIXER, stack).length > 0 && getQuantaValue(world, x, y, z) < quantaPerBlock)
{
world.setBlockMetadataWithNotify(x, y, z, getQuantaValue(world, x, y, z) + 1, 3);
world.markBlockForUpdate(x, y, z);
return true;
if (getQuantaValue(world, x, y, z) < quantaPerBlock)
{
world.setBlockMetadataWithNotify(x, y, z, getQuantaValue(world, x, y, z) + 1, 3);
world.markBlockForUpdate(x, y, z);
return true;
}
}
return false;