fix constructor extracting 2B from network upon placing fixes #2523 (#2549)

* fix constructor extracting 2B from network upon placing fixes #2523

* turns out it does check for air now
This commit is contained in:
Darkere
2020-06-07 12:16:10 +02:00
committed by GitHub
parent 9007e408a8
commit d4994193b0

View File

@@ -102,9 +102,8 @@ public class ConstructorNetworkNode extends NetworkNode implements IComparable,
if (upgrades.hasUpgrade(UpgradeItem.Type.CRAFTING)) {
network.getCraftingManager().request(this, stack, FluidAttributes.BUCKET_VOLUME);
}
} else if (world.isAirBlock(front) && FluidUtil.tryPlaceFluid(WorldUtils.getFakePlayer((ServerWorld) world, getOwner()), world, Hand.MAIN_HAND, front, new NetworkFluidHandler(StackUtils.copy(stack, FluidAttributes.BUCKET_VOLUME)), stack)) {
// We manually have to check world.isAirBlock in the else if statement because tryPlaceFluid ignores this.
network.extractFluid(stack, FluidAttributes.BUCKET_VOLUME, Action.PERFORM);
} else {
FluidUtil.tryPlaceFluid(WorldUtils.getFakePlayer((ServerWorld) world, getOwner()), world, Hand.MAIN_HAND, front, new NetworkFluidHandler(StackUtils.copy(stack, FluidAttributes.BUCKET_VOLUME)), stack);
}
}