From b0a9c03f91288caa89f2806a5fb1e0c299d955a0 Mon Sep 17 00:00:00 2001 From: Jacky1356400 Date: Mon, 31 Jul 2017 16:50:03 +0800 Subject: [PATCH] This should be it - Added a few things that I missed on the last commit --- .../exchangers/handler/ExchangerHandler.java | 9 ++++++++- src/main/resources/assets/exchangers/lang/en_US.lang | 5 +++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/me/jacky1356400/exchangers/handler/ExchangerHandler.java b/src/main/java/me/jacky1356400/exchangers/handler/ExchangerHandler.java index 373437f..0fd63a8 100644 --- a/src/main/java/me/jacky1356400/exchangers/handler/ExchangerHandler.java +++ b/src/main/java/me/jacky1356400/exchangers/handler/ExchangerHandler.java @@ -80,7 +80,8 @@ public void addInformation(ItemStack stack, EntityPlayer player, List to int meta = compound.getInteger("meta"); tooltip.add(StringHelper.localize("tooltip.selectedblock") + " " + getBlockName(block, meta)); - tooltip.add(StringHelper.localize("tooltip.selectedmode") + " " + modeSwitchList[compound.getInteger("mode")]); + tooltip.add(StringHelper.localize("tooltip.currentrange") + " " + modeSwitchList[compound.getInteger("mode")]); + tooltip.add(StringHelper.localize("tooltip.maxrange") + " " + modeSwitchList[getMaxRange()]); } if (StringHelper.isShiftKeyDown()) { tooltip.remove(StringHelper.getShiftText()); @@ -161,6 +162,12 @@ private void placeBlock(ItemStack stack, EntityPlayer player, World world, Block return; } } + if (isPowered() && stack.getTagCompound().getInteger("Energy") < getPerBlockUse()) { + if (!isCreative()) { + msgPlayer(player, StringHelper.localize("error.nopower")); + return; + } + } Set coordinates = findSuitableBlocks(stack, world, side, pos, oldblock, oldmeta); boolean notEnough = false; for (BlockPos coordinate : coordinates) { diff --git a/src/main/resources/assets/exchangers/lang/en_US.lang b/src/main/resources/assets/exchangers/lang/en_US.lang index 6752ed9..79e80e7 100644 --- a/src/main/resources/assets/exchangers/lang/en_US.lang +++ b/src/main/resources/assets/exchangers/lang/en_US.lang @@ -20,10 +20,11 @@ exchangers.tooltip.shift2=Right click on a block to exchange. exchangers.tooltip.shift3=Use the mode key to switch modes. exchangers.tooltip.tuberousExchanger.warning=§c§oClever! But not exchangeable. exchangers.tooltip.selectedblock=§2Selected Block: -exchangers.tooltip.selectedmode=§2Selected Mode: +exchangers.tooltip.currentrange=§2Current Range: +exchangers.tooltip.maxrange=§2Maximum Range: exchangers.tooltip.noselectedblock=§4No Selected Block -#Messages +#Error Messages exchangers.error.invalidblock=§cError: Invalid block! exchangers.error.outofblock=§cError: Out of block! exchangers.error.nopower=§cError: Out of power!