Made display stand only display RF when sneaking

This commit is contained in:
Ellpeck 2016-07-02 18:39:47 +02:00
parent 75839465c6
commit 1e82741766
11 changed files with 55 additions and 4 deletions

View file

@ -79,12 +79,15 @@ public class HudEvent{
}
if(tileHit instanceof IEnergyDisplay){
IEnergyDisplay display = (IEnergyDisplay)tileHit;
if(!display.needsHoldShift() || player.isSneaking()){
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);
profiler.endSection();
}
}
}
profiler.endSection();
}

View file

@ -20,4 +20,7 @@ public interface IEnergyDisplay{
@SideOnly(Side.CLIENT)
int getMaxEnergy();
@SideOnly(Side.CLIENT)
boolean needsHoldShift();
}

View file

@ -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;

View file

@ -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;

View file

@ -173,4 +173,9 @@ public class TileEntityFireworkBox extends TileEntityBase implements IEnergyRece
public int getMaxEnergy(){
return this.storage.getMaxEnergyStored();
}
@Override
public boolean needsHoldShift(){
return false;
}
}

View file

@ -98,4 +98,9 @@ public class TileEntityFurnaceSolar extends TileEntityBase implements IEnergyPro
public int getMaxEnergy(){
return this.storage.getMaxEnergyStored();
}
@Override
public boolean needsHoldShift(){
return false;
}
}

View file

@ -109,4 +109,9 @@ public class TileEntityHeatCollector extends TileEntityBase implements IEnergyPr
public int getMaxEnergy(){
return this.storage.getMaxEnergyStored();
}
@Override
public boolean needsHoldShift(){
return false;
}
}

View file

@ -128,4 +128,9 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I
public int getMaxEnergy(){
return this.storage.getMaxEnergyStored();
}
@Override
public boolean needsHoldShift(){
return false;
}
}

View file

@ -133,4 +133,9 @@ public class TileEntityLeafGenerator extends TileEntityBase implements IEnergyPr
public int getMaxEnergy(){
return this.storage.getMaxEnergyStored();
}
@Override
public boolean needsHoldShift(){
return false;
}
}

View file

@ -244,4 +244,9 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IEnergyR
public int getMaxEnergy(){
return this.storage.getMaxEnergyStored();
}
@Override
public boolean needsHoldShift(){
return false;
}
}

View file

@ -216,4 +216,9 @@ public class TileEntityPlayerInterface extends TileEntityInventoryBase implement
public int getMaxEnergy(){
return this.storage.getMaxEnergyStored();
}
@Override
public boolean needsHoldShift(){
return false;
}
}