mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-07-05 10:36:28 +02:00
Round distance to target block up instead of down
This makes for less confusing error messages if the block is just barely out of range.
This commit is contained in:
parent
dd6d250e2f
commit
767d6bf5a2
|
@ -133,7 +133,7 @@ public class BlockPhantom extends BlockContainerBase implements IHudDisplay{
|
|||
IPhantomTile phantom = (IPhantomTile)tile;
|
||||
minecraft.fontRendererObj.drawStringWithShadow(TextFormatting.GOLD+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".blockPhantomRange.desc")+": "+phantom.getRange(), resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2-40, StringUtil.DECIMAL_COLOR_WHITE);
|
||||
if(phantom.hasBoundPosition()){
|
||||
int distance = (int)new Vec3d(posHit.getBlockPos()).distanceTo(new Vec3d(phantom.getBoundPosition()));
|
||||
int distance = (int)Math.ceil(new Vec3d(posHit.getBlockPos()).distanceTo(new Vec3d(phantom.getBoundPosition())));
|
||||
IBlockState state = minecraft.theWorld.getBlockState(phantom.getBoundPosition());
|
||||
Block block = state.getBlock();
|
||||
Item item = Item.getItemFromBlock(block);
|
||||
|
|
Loading…
Reference in a new issue