From f9d226cfc955bed9df905ce033eee888381a3f3a Mon Sep 17 00:00:00 2001 From: Shadows_of_Fire Date: Tue, 8 Aug 2017 14:28:30 -0400 Subject: [PATCH] Closes #881 Now, this doesn't really work, because putting power in the reconstructor doesn't cause a block update. But it exists, and it'll try its hardest. But i'm not making the power input cause a block update. --- .../mod/blocks/BlockAtomicReconstructor.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java index c4e7660a4..e02579879 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java @@ -40,6 +40,7 @@ import net.minecraft.util.EnumHand; import net.minecraft.util.Mirror; import net.minecraft.util.Rotation; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; @@ -208,4 +209,19 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud tooltip.add(StringUtil.localize(base+"1."+this.toPick1)+" "+StringUtil.localize(base+"2."+this.toPick2)); } } + + @Override + public boolean hasComparatorInputOverride(IBlockState state){ + return true; + } + + @Override + public int getComparatorInputOverride(IBlockState blockState, World world, BlockPos pos){ + TileEntity t = world.getTileEntity(pos); + int i = 0; + if (t instanceof TileEntityAtomicReconstructor) { + i = ((TileEntityAtomicReconstructor) t).getEnergy(); + } + return MathHelper.clamp(i / 20000, 0, 15); + } } \ No newline at end of file