mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-23 03:49:22 +01:00
Made display stand only display RF when sneaking
This commit is contained in:
parent
75839465c6
commit
1e82741766
11 changed files with 55 additions and 4 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,4 +20,7 @@ public interface IEnergyDisplay{
|
|||
|
||||
@SideOnly(Side.CLIENT)
|
||||
int getMaxEnergy();
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
boolean needsHoldShift();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -173,4 +173,9 @@ public class TileEntityFireworkBox extends TileEntityBase implements IEnergyRece
|
|||
public int getMaxEnergy(){
|
||||
return this.storage.getMaxEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean needsHoldShift(){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,4 +98,9 @@ public class TileEntityFurnaceSolar extends TileEntityBase implements IEnergyPro
|
|||
public int getMaxEnergy(){
|
||||
return this.storage.getMaxEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean needsHoldShift(){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,4 +109,9 @@ public class TileEntityHeatCollector extends TileEntityBase implements IEnergyPr
|
|||
public int getMaxEnergy(){
|
||||
return this.storage.getMaxEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean needsHoldShift(){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -128,4 +128,9 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I
|
|||
public int getMaxEnergy(){
|
||||
return this.storage.getMaxEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean needsHoldShift(){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -133,4 +133,9 @@ public class TileEntityLeafGenerator extends TileEntityBase implements IEnergyPr
|
|||
public int getMaxEnergy(){
|
||||
return this.storage.getMaxEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean needsHoldShift(){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -244,4 +244,9 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IEnergyR
|
|||
public int getMaxEnergy(){
|
||||
return this.storage.getMaxEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean needsHoldShift(){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -216,4 +216,9 @@ public class TileEntityPlayerInterface extends TileEntityInventoryBase implement
|
|||
public int getMaxEnergy(){
|
||||
return this.storage.getMaxEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean needsHoldShift(){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue