mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-29 18:28:34 +01:00
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.
This commit is contained in:
parent
9aed16c52a
commit
f9d226cfc9
1 changed files with 16 additions and 0 deletions
|
@ -40,6 +40,7 @@ import net.minecraft.util.EnumHand;
|
||||||
import net.minecraft.util.Mirror;
|
import net.minecraft.util.Mirror;
|
||||||
import net.minecraft.util.Rotation;
|
import net.minecraft.util.Rotation;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.MathHelper;
|
||||||
import net.minecraft.util.math.RayTraceResult;
|
import net.minecraft.util.math.RayTraceResult;
|
||||||
import net.minecraft.util.text.TextFormatting;
|
import net.minecraft.util.text.TextFormatting;
|
||||||
import net.minecraft.world.World;
|
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));
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue