From af8356c9efafaed4c23395e29303c433c91df675 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Tue, 3 May 2016 21:31:54 +0200 Subject: [PATCH] Fixed Fluid Placer not being able to place --- .../mod/tile/TileEntityFluidCollector.java | 11 ++++++++--- .../blockstates/blockSmileyCloud.json | 8 ++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java index b5223da8c..5c40f980c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java @@ -15,6 +15,7 @@ import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.block.Block; import net.minecraft.init.Blocks; +import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; @@ -83,11 +84,15 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements } else if(this.isPlacer && PosUtil.getBlock(coordsBlock, this.worldObj).isReplaceable(this.worldObj, coordsBlock)){ if(this.tank.getFluidAmount() >= FluidContainerRegistry.BUCKET_VOLUME){ - //TODO Fix this because apparently getting the item of the water block (for the ItemStack) returns null Block block = this.tank.getFluid().getFluid().getBlock(); if(block != null){ - WorldUtil.useItemAtSide(sideToManipulate, this.worldObj, this.pos, new ItemStack(block)); - this.tank.drain(FluidContainerRegistry.BUCKET_VOLUME, true); + BlockPos offsetPos = this.pos.offset(sideToManipulate); + Block blockPresent = PosUtil.getBlock(offsetPos, this.worldObj); + boolean replaceable = blockPresent.isReplaceable(this.worldObj, offsetPos); + if(replaceable){ + PosUtil.setBlock(offsetPos, this.worldObj, block, 0, 3); + this.tank.drain(FluidContainerRegistry.BUCKET_VOLUME, true); + } } } } diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockSmileyCloud.json b/src/main/resources/assets/actuallyadditions/blockstates/blockSmileyCloud.json index 614e008ba..1cdb3ecae 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockSmileyCloud.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockSmileyCloud.json @@ -8,10 +8,14 @@ "normal": [{}], "inventory": [{}], "meta": { - "0": { "y" : 0 }, + "0": { "y" : 0}, "1": { "y" : 180 }, "2": { "y" : 270 }, - "3": { "y" : 90 } + "3": { "y" : 90 }, + "4": { "y" : 0, "model": "actuallyadditions:blockSmileyCloudFluffy" }, + "5": { "y" : 180, "model": "actuallyadditions:blockSmileyCloudFluffy" }, + "6": { "y" : 270, "model": "actuallyadditions:blockSmileyCloudFluffy" }, + "7": { "y" : 90, "model": "actuallyadditions:blockSmileyCloudFluffy" } } } } \ No newline at end of file