mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 23:28:35 +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,12 +79,15 @@ public class HudEvent{
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tileHit instanceof IEnergyDisplay){
|
if(tileHit instanceof IEnergyDisplay){
|
||||||
|
IEnergyDisplay display = (IEnergyDisplay)tileHit;
|
||||||
|
if(!display.needsHoldShift() || player.isSneaking()){
|
||||||
profiler.startSection("EnergyDisplay");
|
profiler.startSection("EnergyDisplay");
|
||||||
String strg = ((IEnergyDisplay)tileHit).getEnergy()+"/"+((IEnergyDisplay)tileHit).getMaxEnergy()+" RF";
|
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);
|
font.drawStringWithShadow(TextFormatting.GOLD+strg, event.getResolution().getScaledWidth()/2+5, event.getResolution().getScaledHeight()/2-10, StringUtil.DECIMAL_COLOR_WHITE);
|
||||||
profiler.endSection();
|
profiler.endSection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
profiler.endSection();
|
profiler.endSection();
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,4 +20,7 @@ public interface IEnergyDisplay{
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
int getMaxEnergy();
|
int getMaxEnergy();
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
boolean needsHoldShift();
|
||||||
}
|
}
|
||||||
|
|
|
@ -207,6 +207,11 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple
|
||||||
return this.storage.getMaxEnergyStored();
|
return this.storage.getMaxEnergyStored();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean needsHoldShift(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isRedstoneToggle(){
|
public boolean isRedstoneToggle(){
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -113,6 +113,11 @@ public class TileEntityDisplayStand extends TileEntityInventoryBase implements I
|
||||||
return this.storage.getMaxEnergyStored();
|
return this.storage.getMaxEnergyStored();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean needsHoldShift(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate){
|
public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate){
|
||||||
return from != EnumFacing.UP ? this.storage.receiveEnergy(maxReceive, simulate) : 0;
|
return from != EnumFacing.UP ? this.storage.receiveEnergy(maxReceive, simulate) : 0;
|
||||||
|
|
|
@ -173,4 +173,9 @@ public class TileEntityFireworkBox extends TileEntityBase implements IEnergyRece
|
||||||
public int getMaxEnergy(){
|
public int getMaxEnergy(){
|
||||||
return this.storage.getMaxEnergyStored();
|
return this.storage.getMaxEnergyStored();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean needsHoldShift(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,4 +98,9 @@ public class TileEntityFurnaceSolar extends TileEntityBase implements IEnergyPro
|
||||||
public int getMaxEnergy(){
|
public int getMaxEnergy(){
|
||||||
return this.storage.getMaxEnergyStored();
|
return this.storage.getMaxEnergyStored();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean needsHoldShift(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,4 +109,9 @@ public class TileEntityHeatCollector extends TileEntityBase implements IEnergyPr
|
||||||
public int getMaxEnergy(){
|
public int getMaxEnergy(){
|
||||||
return this.storage.getMaxEnergyStored();
|
return this.storage.getMaxEnergyStored();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean needsHoldShift(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,4 +128,9 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I
|
||||||
public int getMaxEnergy(){
|
public int getMaxEnergy(){
|
||||||
return this.storage.getMaxEnergyStored();
|
return this.storage.getMaxEnergyStored();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean needsHoldShift(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -133,4 +133,9 @@ public class TileEntityLeafGenerator extends TileEntityBase implements IEnergyPr
|
||||||
public int getMaxEnergy(){
|
public int getMaxEnergy(){
|
||||||
return this.storage.getMaxEnergyStored();
|
return this.storage.getMaxEnergyStored();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean needsHoldShift(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -244,4 +244,9 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IEnergyR
|
||||||
public int getMaxEnergy(){
|
public int getMaxEnergy(){
|
||||||
return this.storage.getMaxEnergyStored();
|
return this.storage.getMaxEnergyStored();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean needsHoldShift(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -216,4 +216,9 @@ public class TileEntityPlayerInterface extends TileEntityInventoryBase implement
|
||||||
public int getMaxEnergy(){
|
public int getMaxEnergy(){
|
||||||
return this.storage.getMaxEnergyStored();
|
return this.storage.getMaxEnergyStored();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean needsHoldShift(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue