mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 08:48:34 +01:00
Removed Profiler usage
This commit is contained in:
parent
2a5e2787bb
commit
3f660f7c01
10 changed files with 11 additions and 28 deletions
|
@ -114,7 +114,7 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, Profiler profiler, ScaledResolution resolution){
|
||||
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution){
|
||||
TileEntity tile = minecraft.theWorld.getTileEntity(posHit.getBlockPos());
|
||||
if(tile instanceof TileEntityAtomicReconstructor){
|
||||
ItemStack slot = ((TileEntityAtomicReconstructor)tile).getStackInSlot(0);
|
||||
|
|
|
@ -133,7 +133,7 @@ public class BlockBookletStand extends BlockContainerBase implements IHudDisplay
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, Profiler profiler, ScaledResolution resolution){
|
||||
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution){
|
||||
TileEntity tile = minecraft.theWorld.getTileEntity(posHit.getBlockPos());
|
||||
if(tile instanceof TileEntityBookletStand){
|
||||
EntrySet set = ((TileEntityBookletStand)tile).assignedEntry;
|
||||
|
|
|
@ -157,7 +157,7 @@ public class BlockCompost extends BlockContainerBase implements IHudDisplay{
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, Profiler profiler, ScaledResolution resolution){
|
||||
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution){
|
||||
TileEntity tile = minecraft.theWorld.getTileEntity(posHit.getBlockPos());
|
||||
if(tile instanceof TileEntityCompost){
|
||||
ItemStack slot = ((TileEntityCompost)tile).getStackInSlot(0);
|
||||
|
|
|
@ -51,7 +51,7 @@ public class BlockLavaFactoryController extends BlockContainerBase implements IH
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, Profiler profiler, ScaledResolution resolution){
|
||||
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution){
|
||||
TileEntityLavaFactoryController factory = (TileEntityLavaFactoryController)minecraft.theWorld.getTileEntity(posHit.getBlockPos());
|
||||
if(factory != null){
|
||||
int state = factory.isMultiblock();
|
||||
|
|
|
@ -79,7 +79,7 @@ public class BlockMiner extends BlockContainerBase implements IHudDisplay{
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, Profiler profiler, ScaledResolution resolution){
|
||||
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution){
|
||||
TileEntity tile = minecraft.theWorld.getTileEntity(posHit.getBlockPos());
|
||||
if(tile instanceof TileEntityMiner){
|
||||
String info = ((TileEntityMiner)tile).layerAt <= 0 ? "Done Mining!" : "Mining at Y = "+((TileEntityMiner)tile).layerAt+".";
|
||||
|
|
|
@ -127,7 +127,7 @@ public class BlockPhantom extends BlockContainerBase implements IHudDisplay{
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, Profiler profiler, ScaledResolution resolution){
|
||||
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution){
|
||||
TileEntity tile = minecraft.theWorld.getTileEntity(posHit.getBlockPos());
|
||||
if(tile != null){
|
||||
if(tile instanceof IPhantomTile){
|
||||
|
|
|
@ -74,7 +74,7 @@ public class BlockPlayerInterface extends BlockContainerBase implements IHudDisp
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, Profiler profiler, ScaledResolution resolution){
|
||||
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution){
|
||||
TileEntity tile = minecraft.theWorld.getTileEntity(posHit.getBlockPos());
|
||||
if(tile != null){
|
||||
if(tile instanceof TileEntityPlayerInterface){
|
||||
|
|
|
@ -22,6 +22,6 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
|||
public interface IHudDisplay{
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, Profiler profiler, ScaledResolution resolution);
|
||||
void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution);
|
||||
|
||||
}
|
||||
|
|
|
@ -129,19 +129,14 @@ public class ClientEvents{
|
|||
public void onGameOverlay(RenderGameOverlayEvent.Post event){
|
||||
if(event.getType() == RenderGameOverlayEvent.ElementType.ALL && Minecraft.getMinecraft().currentScreen == null){
|
||||
Minecraft minecraft = Minecraft.getMinecraft();
|
||||
Profiler profiler = minecraft.mcProfiler;
|
||||
EntityPlayer player = minecraft.thePlayer;
|
||||
RayTraceResult posHit = minecraft.objectMouseOver;
|
||||
FontRenderer font = minecraft.fontRendererObj;
|
||||
ItemStack stack = player.getHeldItemMainhand();
|
||||
|
||||
profiler.startSection(ModUtil.MOD_ID+"Hud");
|
||||
|
||||
if(stack != null){
|
||||
if(stack.getItem() instanceof IHudDisplay){
|
||||
profiler.startSection("ItemHudDisplay");
|
||||
((IHudDisplay)stack.getItem()).displayHud(minecraft, player, stack, posHit, profiler, event.getResolution());
|
||||
profiler.endSection();
|
||||
((IHudDisplay)stack.getItem()).displayHud(minecraft, player, stack, posHit, event.getResolution());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -150,16 +145,12 @@ public class ClientEvents{
|
|||
TileEntity tileHit = minecraft.theWorld.getTileEntity(posHit.getBlockPos());
|
||||
|
||||
if(blockHit instanceof IHudDisplay){
|
||||
profiler.startSection("BlockHudDisplay");
|
||||
((IHudDisplay)blockHit).displayHud(minecraft, player, stack, posHit, profiler, event.getResolution());
|
||||
profiler.endSection();
|
||||
((IHudDisplay)blockHit).displayHud(minecraft, player, stack, posHit, event.getResolution());
|
||||
}
|
||||
|
||||
if(tileHit instanceof TileEntityBase){
|
||||
TileEntityBase base = (TileEntityBase)tileHit;
|
||||
if(base.isRedstoneToggle()){
|
||||
profiler.startSection("RedstoneToggleHudDisplay");
|
||||
|
||||
String strg = "Redstone Mode: "+TextFormatting.DARK_RED+(base.isPulseMode ? "Pulse" : "Deactivation")+TextFormatting.RESET;
|
||||
font.drawStringWithShadow(strg, event.getResolution().getScaledWidth()/2+5, event.getResolution().getScaledHeight()/2+5, StringUtil.DECIMAL_COLOR_WHITE);
|
||||
|
||||
|
@ -167,16 +158,12 @@ public class ClientEvents{
|
|||
String expl = TextFormatting.GREEN+"Right-Click to toggle!";
|
||||
font.drawStringWithShadow(expl, event.getResolution().getScaledWidth()/2+5, event.getResolution().getScaledHeight()/2+15, StringUtil.DECIMAL_COLOR_WHITE);
|
||||
}
|
||||
|
||||
profiler.endSection();
|
||||
}
|
||||
}
|
||||
|
||||
if(tileHit instanceof IEnergyDisplay){
|
||||
IEnergyDisplay display = (IEnergyDisplay)tileHit;
|
||||
if(!display.needsHoldShift() || player.isSneaking()){
|
||||
profiler.startSection("EnergyDisplay");
|
||||
|
||||
if(energyDisplay == null){
|
||||
energyDisplay = new EnergyDisplay(0, 0, null);
|
||||
}
|
||||
|
@ -186,13 +173,9 @@ public class ClientEvents{
|
|||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
energyDisplay.draw();
|
||||
GlStateManager.popMatrix();
|
||||
|
||||
profiler.endSection();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
profiler.endSection();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ public class ItemBooklet extends ItemBase implements IHudDisplay{
|
|||
}
|
||||
|
||||
@Override
|
||||
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, Profiler profiler, ScaledResolution resolution){
|
||||
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution){
|
||||
if(posHit != null && posHit.getBlockPos() != null){
|
||||
IBlockState state = minecraft.theWorld.getBlockState(posHit.getBlockPos());
|
||||
Block block = state.getBlock();
|
||||
|
|
Loading…
Reference in a new issue