Merge branch 'master-MC1.10' into master-MC1.11

# Conflicts:
#	src/main/scala/li/cil/oc/util/FluidUtils.scala
This commit is contained in:
payonel 2018-09-21 18:52:56 -07:00
commit 3b6e16f7ef
2 changed files with 3 additions and 1 deletions

View File

@ -453,7 +453,6 @@ class Player(val agent: internal.Agent) extends FakePlayer(agent.world.asInstanc
val te = world.getTileEntity(pos)
val canHarvest = block.canHarvestBlock(world, pos, this)
block.onBlockHarvested(world, pos, state, this)
if (block.removedByPlayer(state, world, pos, this, block.canHarvestBlock(world, pos, this))) {
block.onBlockDestroyedByPlayer(world, pos, state)
if (canHarvest) {

View File

@ -57,6 +57,9 @@ object FluidUtils {
*/
def transferBetweenFluidHandlers(source: IFluidHandler, sink: IFluidHandler, limit: Int = Fluid.BUCKET_VOLUME): Int = {
val drained = source.drain(limit, false)
if (drained == null) {
return 0
}
val filled = sink.fill(drained, false)
sink.fill(source.drain(filled, true), true)
}