Fixed #254 - Some mixer issues
This commit is contained in:
parent
8352961a94
commit
8a4509feac
4 changed files with 15 additions and 18 deletions
|
@ -68,20 +68,14 @@ public class BlockFilter extends BlockTile
|
||||||
InventoryUtility.dropItemStack(world, checkAbove.clone().add(0.5), resoure.getItemStack().copy());
|
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.
|
* Remove liquid from top.
|
||||||
*/
|
*/
|
||||||
if (remaining > 0)
|
fluidBlock.setQuanta(world, checkAbove.intX(), checkAbove.intY(), checkAbove.intZ(), remaining);
|
||||||
{
|
world.scheduleBlockUpdate(x, y, z, blockID, 20);
|
||||||
fluidBlock.setQuanta(world, checkAbove.intX(), checkAbove.intY(), checkAbove.intZ(), remaining);
|
|
||||||
world.scheduleBlockUpdate(x, y, z, blockID, 20);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
checkAbove.setBlock(world, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add liquid to bottom.
|
* Add liquid to bottom.
|
||||||
|
|
|
@ -38,10 +38,10 @@ public class RenderMixer extends TileEntitySpecialRenderer implements ISimpleIte
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glTranslatef((float) x + 0.5F, (float) y + 0.5f, (float) z + 0.5F);
|
glTranslatef((float) x + 0.5F, (float) y + 0.5f, (float) z + 0.5F);
|
||||||
RenderUtility.bind(TEXTURE);
|
RenderUtility.bind(TEXTURE);
|
||||||
MODEL.renderOnly("centerTop", "centerBase", "centerPoll");
|
MODEL.renderOnly("centerTop", "centerBase");
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glRotatef((float) Math.toDegrees(tile.angle), 0, 1, 0);
|
glRotatef((float) Math.toDegrees(tile.angle), 0, 1, 0);
|
||||||
MODEL.renderAllExcept("centerTop", "centerBase", "centerPoll");
|
MODEL.renderAllExcept("centerTop", "centerBase");
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,7 +151,7 @@ public class TileMixer extends TileMechanical
|
||||||
return true;
|
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);
|
mixPosition.setBlock(worldObj, ResonantInduction.blockFluidMixtures.get(entity.getEntityItem().getItemDamage()).blockID);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class BlockFluidMixture extends BlockFluidFinite
|
||||||
|
|
||||||
public void setQuanta(World world, int x, int y, int z, int quanta)
|
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);
|
world.setBlockMetadataWithNotify(x, y, z, quanta, 3);
|
||||||
else
|
else
|
||||||
world.setBlockToAir(x, y, z);
|
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)
|
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);
|
if (getQuantaValue(world, x, y, z) < quantaPerBlock)
|
||||||
world.markBlockForUpdate(x, y, z);
|
{
|
||||||
return true;
|
world.setBlockMetadataWithNotify(x, y, z, getQuantaValue(world, x, y, z) + 1, 3);
|
||||||
|
world.markBlockForUpdate(x, y, z);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue