diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/HudEvent.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/HudEvent.java index e448e7747..699eaabff 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/HudEvent.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/HudEvent.java @@ -79,10 +79,13 @@ public class HudEvent{ } if(tileHit instanceof IEnergyDisplay){ - profiler.startSection("EnergyDisplay"); - String strg = ((IEnergyDisplay)tileHit).getEnergy()+"/"+((IEnergyDisplay)tileHit).getMaxEnergy()+" RF"; - font.drawStringWithShadow(TextFormatting.GOLD+strg, event.getResolution().getScaledWidth()/2+5, event.getResolution().getScaledHeight()/2-10, StringUtil.DECIMAL_COLOR_WHITE); - profiler.endSection(); + IEnergyDisplay display = (IEnergyDisplay)tileHit; + if(!display.needsHoldShift() || player.isSneaking()){ + profiler.startSection("EnergyDisplay"); + String strg = display.getEnergy()+"/"+display.getMaxEnergy()+" RF"; + font.drawStringWithShadow(TextFormatting.GOLD+strg, event.getResolution().getScaledWidth()/2+5, event.getResolution().getScaledHeight()/2-10, StringUtil.DECIMAL_COLOR_WHITE); + profiler.endSection(); + } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/IEnergyDisplay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/IEnergyDisplay.java index fb6ba9aa9..4c3c22201 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/IEnergyDisplay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/IEnergyDisplay.java @@ -20,4 +20,7 @@ public interface IEnergyDisplay{ @SideOnly(Side.CLIENT) int getMaxEnergy(); + + @SideOnly(Side.CLIENT) + boolean needsHoldShift(); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java index 7e8a8c353..abbefd460 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java @@ -207,6 +207,11 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple return this.storage.getMaxEnergyStored(); } + @Override + public boolean needsHoldShift(){ + return false; + } + @Override public boolean isRedstoneToggle(){ return true; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDisplayStand.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDisplayStand.java index d1769dce5..b183faa55 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDisplayStand.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDisplayStand.java @@ -113,6 +113,11 @@ public class TileEntityDisplayStand extends TileEntityInventoryBase implements I return this.storage.getMaxEnergyStored(); } + @Override + public boolean needsHoldShift(){ + return true; + } + @Override public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate){ return from != EnumFacing.UP ? this.storage.receiveEnergy(maxReceive, simulate) : 0; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFireworkBox.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFireworkBox.java index 7d9792b6f..99debbc3d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFireworkBox.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFireworkBox.java @@ -173,4 +173,9 @@ public class TileEntityFireworkBox extends TileEntityBase implements IEnergyRece public int getMaxEnergy(){ return this.storage.getMaxEnergyStored(); } + + @Override + public boolean needsHoldShift(){ + return false; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceSolar.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceSolar.java index 9410bdd33..0ee78698c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceSolar.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceSolar.java @@ -98,4 +98,9 @@ public class TileEntityFurnaceSolar extends TileEntityBase implements IEnergyPro public int getMaxEnergy(){ return this.storage.getMaxEnergyStored(); } + + @Override + public boolean needsHoldShift(){ + return false; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityHeatCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityHeatCollector.java index 14200ac28..1b38efafa 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityHeatCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityHeatCollector.java @@ -109,4 +109,9 @@ public class TileEntityHeatCollector extends TileEntityBase implements IEnergyPr public int getMaxEnergy(){ return this.storage.getMaxEnergyStored(); } + + @Override + public boolean needsHoldShift(){ + return false; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLavaFactoryController.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLavaFactoryController.java index 8b36fa650..0914c578d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLavaFactoryController.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLavaFactoryController.java @@ -128,4 +128,9 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I public int getMaxEnergy(){ return this.storage.getMaxEnergyStored(); } + + @Override + public boolean needsHoldShift(){ + return false; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java index 7ba2f2805..5daa65ced 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java @@ -133,4 +133,9 @@ public class TileEntityLeafGenerator extends TileEntityBase implements IEnergyPr public int getMaxEnergy(){ return this.storage.getMaxEnergyStored(); } + + @Override + public boolean needsHoldShift(){ + return false; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java index c42390524..10372450c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java @@ -244,4 +244,9 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IEnergyR public int getMaxEnergy(){ return this.storage.getMaxEnergyStored(); } + + @Override + public boolean needsHoldShift(){ + return false; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java index 524cd1af6..879ad4f84 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java @@ -216,4 +216,9 @@ public class TileEntityPlayerInterface extends TileEntityInventoryBase implement public int getMaxEnergy(){ return this.storage.getMaxEnergyStored(); } + + @Override + public boolean needsHoldShift(){ + return false; + } }