Remove profiler

This commit is contained in:
lax1dude 2024-12-13 19:58:47 -08:00
parent a6958812bb
commit 7a4ed50381
32 changed files with 23 additions and 1159 deletions

View file

@ -30,7 +30,6 @@ import net.minecraft.src.IUpdatePlayerListBox;
import net.minecraft.src.MinecraftException;
import net.minecraft.src.Packet;
import net.minecraft.src.Packet4UpdateTime;
import net.minecraft.src.Profiler;
import net.minecraft.src.ServerCommandManager;
import net.minecraft.src.ServerConfigurationManager;
import net.minecraft.src.StringTranslate;
@ -49,7 +48,6 @@ public abstract class MinecraftServer implements ICommandSender, Runnable {
/** List of names of players who are online. */
protected final List playersOnline = new ArrayList();
protected final ICommandManager commandManager;
public final Profiler theProfiler = new Profiler();
/** The server world instances. */
public WorldServer[] worldServers;
@ -123,7 +121,6 @@ public abstract class MinecraftServer implements ICommandSender, Runnable {
*/
protected long timeOfLastWarning;
protected String userMessage;
protected boolean startProfiling;
protected boolean field_104057_T = false;
public MinecraftServer(String folder) {
@ -193,10 +190,9 @@ public abstract class MinecraftServer implements ICommandSender, Runnable {
}
if (var10 == 0) {
this.worldServers[var10] = new WorldServer(this, var7, par1Str, var11, var8, this.theProfiler, this.getLogAgent());
this.worldServers[var10] = new WorldServer(this, var7, par1Str, var11, var8, this.getLogAgent());
} else {
this.worldServers[var10] = new WorldServerMulti(this, var7, par1Str, var11, var8, this.worldServers[0],
this.theProfiler, this.getLogAgent());
this.worldServers[var10] = new WorldServerMulti(this, var7, par1Str, var11, var8, this.worldServers[0], this.getLogAgent());
}
this.worldServers[var10].addWorldAccess(new WorldManager(this, this.worldServers[var10]));
@ -423,23 +419,13 @@ public abstract class MinecraftServer implements ICommandSender, Runnable {
AxisAlignedBB.getAABBPool().cleanPool();
++this.tickCounter;
if (this.startProfiling) {
this.startProfiling = false;
this.theProfiler.profilingEnabled = true;
this.theProfiler.clearProfiling();
}
this.theProfiler.startSection("root");
this.updateTimeLightAndEntities();
if (this.tickCounter % 900 == 0) {
this.theProfiler.startSection("save");
this.serverConfigManager.saveAllPlayerData();
this.saveAllWorlds(true);
this.theProfiler.endSection();
}
this.theProfiler.startSection("tallying");
this.tickTimeArray[this.tickCounter % 100] = System.nanoTime() - var1;
this.sentPacketCountArray[this.tickCounter % 100] = Packet.sentID - this.lastSentPacketID;
this.lastSentPacketID = Packet.sentID;
@ -449,8 +435,6 @@ public abstract class MinecraftServer implements ICommandSender, Runnable {
this.lastReceivedID = Packet.receivedID;
this.receivedPacketSizeArray[this.tickCounter % 100] = Packet.receivedSize - this.lastReceivedSize;
this.lastReceivedSize = Packet.receivedSize;
this.theProfiler.endSection();
this.theProfiler.endSection();
}
public List<String> getTPSAndChunkBuffer(int tpsCounter) {
@ -492,7 +476,6 @@ public abstract class MinecraftServer implements ICommandSender, Runnable {
}
public void updateTimeLightAndEntities() {
this.theProfiler.startSection("levels");
int var1;
for (var1 = 0; var1 < this.worldServers.length; ++var1) {
@ -500,45 +483,29 @@ public abstract class MinecraftServer implements ICommandSender, Runnable {
if (var1 == 0 || this.getAllowNether()) {
WorldServer var4 = this.worldServers[var1];
this.theProfiler.startSection(var4.getWorldInfo().getWorldName());
this.theProfiler.startSection("pools");
var4.getWorldVec3Pool().clear();
this.theProfiler.endSection();
if (this.tickCounter % 20 == 0) {
this.theProfiler.startSection("timeSync");
this.serverConfigManager.sendPacketToAllPlayersInDimension(
new Packet4UpdateTime(var4.getTotalWorldTime(), var4.getWorldTime()),
var4.provider.dimensionId);
this.theProfiler.endSection();
}
this.theProfiler.startSection("tick");
var4.tick();
var4.updateEntities();
this.theProfiler.endSection();
this.theProfiler.startSection("tracker");
var4.getEntityTracker().updateTrackedEntities();
this.theProfiler.endSection();
this.theProfiler.endSection();
}
this.timeOfLastDimensionTick[var1][this.tickCounter % 100] = System.nanoTime() - var2;
}
this.theProfiler.endStartSection("connection");
this.getNetworkThread().handleNetworkListenThread();
this.theProfiler.endStartSection("players");
this.serverConfigManager.onTick();
this.theProfiler.endStartSection("tickables");
for (var1 = 0; var1 < this.playersOnline.size(); ++var1) {
((IUpdatePlayerListBox) this.playersOnline.get(var1)).update();
}
this.theProfiler.endSection();
}
public boolean getAllowNether() {
@ -975,10 +942,6 @@ public abstract class MinecraftServer implements ICommandSender, Runnable {
return this.tickCounter;
}
public void enableProfiling() {
this.startProfiling = true;
}
/**
* Return the position for this command sender.
*/

View file

@ -260,8 +260,6 @@ public class Chunk {
* Runs delayed skylight updates.
*/
private boolean updateSkylight_do() {
this.worldObj.theProfiler.startSection("recheckGaps");
if (this.worldObj.doChunksNearChunkExist(this.xPosition * 16 + 8, 0, this.zPosition * 16 + 8, 16)) {
for (int var1 = 0; var1 < 16; ++var1) {
for (int var2 = 0; var2 < 16; ++var2) {
@ -299,8 +297,6 @@ public class Chunk {
this.isGapLightingUpdated = false;
}
this.worldObj.theProfiler.endSection();
return !this.isGapLightingUpdated;
}

View file

@ -1,148 +0,0 @@
package net.minecraft.src;
import java.util.List;
import net.lax1dude.eaglercraft.sp.SysUtil;
import net.minecraft.server.MinecraftServer;
public class CommandDebug extends CommandBase {
/** Time the debugging started in milliseconds. */
private long startTime = 0L;
/** The number of ticks when debugging started. */
private int startTicks = 0;
public String getCommandName() {
return "debug";
}
/**
* Return the required permission level for this command.
*/
public int getRequiredPermissionLevel() {
return 3;
}
public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) {
if (par2ArrayOfStr.length == 1) {
if (par2ArrayOfStr[0].equals("start")) {
notifyAdmins(par1ICommandSender, "commands.debug.start", new Object[0]);
MinecraftServer.getServer().enableProfiling();
this.startTime = SysUtil.steadyTimeMillis();
this.startTicks = MinecraftServer.getServer().getTickCounter();
return;
}
if (par2ArrayOfStr[0].equals("stop")) {
if (!MinecraftServer.getServer().theProfiler.profilingEnabled) {
throw new CommandException("commands.debug.notStarted", new Object[0]);
}
long var3 = SysUtil.steadyTimeMillis();
int var5 = MinecraftServer.getServer().getTickCounter();
long var6 = var3 - this.startTime;
int var8 = var5 - this.startTicks;
this.saveProfilerResults(var6, var8);
MinecraftServer.getServer().theProfiler.profilingEnabled = false;
notifyAdmins(par1ICommandSender, "commands.debug.stop",
new Object[] { Float.valueOf(var6 / 1000.0F), Integer.valueOf(var8) });
return;
}
}
throw new WrongUsageException("commands.debug.usage", new Object[0]);
}
private void saveProfilerResults(long par1, int par3) {
// no
// File var4 = new File(MinecraftServer.getServer().getFile("debug"),
// "profile-results-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + ".txt");
// var4.getParentFile().mkdirs();
//
// try {
// FileWriter var5 = new FileWriter(var4);
// var5.write(this.getProfilerResults(par1, par3));
// var5.close();
// } catch (Throwable var6) {
// MinecraftServer.getServer().getLogAgent().logSevereException("Could not save profiler results to " + var4,
// var6);
// }
}
private String getProfilerResults(long par1, int par3) {
StringBuilder var4 = new StringBuilder();
var4.append("---- Minecraft Profiler Results ----\n");
var4.append("// ");
var4.append(getWittyComment());
var4.append("\n\n");
var4.append("Time span: ").append(par1).append(" ms\n");
var4.append("Tick span: ").append(par3).append(" ticks\n");
var4.append("// This is approximately ")
.append(String.format("%s", new Object[] { Float.valueOf((float) par3 / ((float) par1 / 1000.0F)) }))
.append(" ticks per second. It should be ").append(20).append(" ticks per second\n\n");
var4.append("--- BEGIN PROFILE DUMP ---\n\n");
this.getProfileDump(0, "root", var4);
var4.append("--- END PROFILE DUMP ---\n\n");
return var4.toString();
}
private void getProfileDump(int par1, String par2Str, StringBuilder par3StringBuilder) {
List var4 = MinecraftServer.getServer().theProfiler.getProfilingData(par2Str);
if (var4 != null && var4.size() >= 3) {
for (int var5 = 1; var5 < var4.size(); ++var5) {
ProfilerResult var6 = (ProfilerResult) var4.get(var5);
par3StringBuilder.append(String.format("[%d] ", new Object[] { Integer.valueOf(par1) }));
for (int var7 = 0; var7 < par1; ++var7) {
par3StringBuilder.append(" ");
}
par3StringBuilder.append(var6.field_76331_c);
par3StringBuilder.append(" - ");
par3StringBuilder.append(String.format("%s", new Object[] { Double.valueOf(var6.field_76332_a) }));
par3StringBuilder.append("%/");
par3StringBuilder.append(String.format("%s", new Object[] { Double.valueOf(var6.field_76330_b) }));
par3StringBuilder.append("%\n");
if (!var6.field_76331_c.equals("unspecified")) {
try {
this.getProfileDump(par1 + 1, par2Str + "." + var6.field_76331_c, par3StringBuilder);
} catch (Exception var8) {
par3StringBuilder.append("[[ EXCEPTION " + var8 + " ]]");
}
}
}
}
}
/**
* Returns a random "witty" comment.
*/
private static String getWittyComment() {
String[] var0 = new String[] { "Shiny numbers!", "Am I not running fast enough? :(",
"I\'m working as hard as I can!", "Will I ever be good enough for you? :(", "Speedy. Zoooooom!",
"Hello world", "40% better than a crash report.", "Now with extra numbers", "Now with less numbers",
"Now with the same numbers", "You should add flames to things, it makes them go faster!",
"Do you feel the need for... optimization?", "*cracks redstone whip*",
"Maybe if you treated it better then it\'ll have more motivation to work faster! Poor server." };
try {
return var0[(int) (System.nanoTime() % (long) var0.length)];
} catch (Throwable var2) {
return "Witty comment unavailable :(";
}
}
/**
* Adds the strings available in this command to the given list of tab
* completion options.
*/
public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) {
return par2ArrayOfStr.length == 1
? getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] { "start", "stop" })
: null;
}
}

View file

@ -327,8 +327,6 @@ public abstract class Entity {
* Gets called every tick from main Entity class
*/
public void onEntityUpdate() {
this.worldObj.theProfiler.startSection("entityBaseTick");
if (this.ridingEntity != null && this.ridingEntity.isDead) {
this.ridingEntity = null;
}
@ -342,7 +340,6 @@ public abstract class Entity {
int var2;
if (!this.worldObj.isRemote && this.worldObj instanceof WorldServer) {
this.worldObj.theProfiler.startSection("portal");
MinecraftServer var1 = ((WorldServer) this.worldObj).getMinecraftServer();
var2 = this.getMaxInPortalTime();
@ -377,8 +374,6 @@ public abstract class Entity {
if (this.timeUntilPortal > 0) {
--this.timeUntilPortal;
}
this.worldObj.theProfiler.endSection();
}
if (this.isSprinting() && !this.isInWater()) {
@ -432,7 +427,6 @@ public abstract class Entity {
}
this.firstUpdate = false;
this.worldObj.theProfiler.endSection();
}
/**
@ -500,7 +494,6 @@ public abstract class Entity {
this.posY = this.boundingBox.minY + (double) this.yOffset - (double) this.ySize;
this.posZ = (this.boundingBox.minZ + this.boundingBox.maxZ) / 2.0D;
} else {
this.worldObj.theProfiler.startSection("move");
this.ySize *= 0.4F;
double var7 = this.posX;
double var9 = this.posY;
@ -688,8 +681,6 @@ public abstract class Entity {
}
}
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.startSection("rest");
this.posX = (this.boundingBox.minX + this.boundingBox.maxX) / 2.0D;
this.posY = this.boundingBox.minY + (double) this.yOffset - (double) this.ySize;
this.posZ = (this.boundingBox.minZ + this.boundingBox.maxZ) / 2.0D;
@ -780,8 +771,6 @@ public abstract class Entity {
this.playSound("random.fizz", 0.7F, 1.6F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F);
this.fire = -this.fireResistance;
}
this.worldObj.theProfiler.endSection();
}
}
@ -1899,7 +1888,6 @@ public abstract class Entity {
public void travelToTheEnd(int par1) {
if (!this.worldObj.isRemote && !this.isDead) {
this.worldObj.theProfiler.startSection("changeDimension");
MinecraftServer var2 = MinecraftServer.getServer();
int var3 = this.dimension;
WorldServer var4 = var2.worldServerForDimension(var3);
@ -1907,9 +1895,7 @@ public abstract class Entity {
this.dimension = par1;
this.worldObj.removeEntity(this);
this.isDead = false;
this.worldObj.theProfiler.startSection("reposition");
var2.getConfigurationManager().transferEntityToWorld(this, var3, var4, var5);
this.worldObj.theProfiler.endStartSection("reloading");
Entity var6 = EntityList.createEntityByName(EntityList.getEntityString(this), var5);
if (var6 != null) {
@ -1918,10 +1904,8 @@ public abstract class Entity {
}
this.isDead = true;
this.worldObj.theProfiler.endSection();
var4.resetUpdateEntityTick();
var5.resetUpdateEntityTick();
this.worldObj.theProfiler.endSection();
}
}

View file

@ -11,15 +11,9 @@ public class EntityAITasks {
/** A list of EntityAITaskEntrys that are currently being executed. */
private List executingTaskEntries = new ArrayList();
/** Instance of Profiler. */
private final Profiler theProfiler;
private int field_75778_d = 0;
private int field_75779_e = 3;
public EntityAITasks(Profiler par1Profiler) {
this.theProfiler = par1Profiler;
}
public void addTask(int par1, EntityAIBase par2EntityAIBase) {
this.taskEntries.add(new EntityAITaskEntry(this, par1, par2EntityAIBase));
}
@ -84,36 +78,26 @@ public class EntityAITasks {
}
}
this.theProfiler.startSection("goalStart");
var2 = var1.iterator();
while (var2.hasNext()) {
var3 = (EntityAITaskEntry) var2.next();
this.theProfiler.startSection(var3.action.getClass().getSimpleName());
var3.action.startExecuting();
this.theProfiler.endSection();
}
this.theProfiler.endSection();
this.theProfiler.startSection("goalTick");
var2 = this.executingTaskEntries.iterator();
while (var2.hasNext()) {
var3 = (EntityAITaskEntry) var2.next();
var3.action.updateTask();
}
this.theProfiler.endSection();
}
/**
* Determine if a specific AI Task should continue being executed.
*/
private boolean canContinue(EntityAITaskEntry par1EntityAITaskEntry) {
this.theProfiler.startSection("canContinue");
boolean var2 = par1EntityAITaskEntry.action.continueExecuting();
this.theProfiler.endSection();
return var2;
return par1EntityAITaskEntry.action.continueExecuting();
}
/**
@ -122,7 +106,6 @@ public class EntityAITasks {
* priority tasks can be interrupted.
*/
private boolean canUse(EntityAITaskEntry par1EntityAITaskEntry) {
this.theProfiler.startSection("canUse");
Iterator var2 = this.taskEntries.iterator();
while (var2.hasNext()) {
@ -132,17 +115,14 @@ public class EntityAITasks {
if (par1EntityAITaskEntry.priority >= var3.priority) {
if (this.executingTaskEntries.contains(var3)
&& !this.areTasksCompatible(par1EntityAITaskEntry, var3)) {
this.theProfiler.endSection();
return false;
}
} else if (this.executingTaskEntries.contains(var3) && !var3.action.isContinuous()) {
this.theProfiler.endSection();
return false;
}
}
}
this.theProfiler.endSection();
return true;
}

View file

@ -27,8 +27,6 @@ public abstract class EntityCreature extends EntityLiving {
}
protected void updateEntityActionState() {
this.worldObj.theProfiler.startSection("ai");
if (this.fleeingTick > 0) {
--this.fleeingTick;
}
@ -53,8 +51,6 @@ public abstract class EntityCreature extends EntityLiving {
this.entityToAttack = null;
}
this.worldObj.theProfiler.endSection();
if (!this.hasAttacked && this.entityToAttack != null
&& (this.pathToEntity == null || this.rand.nextInt(20) == 0)) {
this.pathToEntity = this.worldObj.getPathEntityToEntity(this, this.entityToAttack, var1, true, false, false,
@ -70,7 +66,6 @@ public abstract class EntityCreature extends EntityLiving {
this.rotationPitch = 0.0F;
if (this.pathToEntity != null && this.rand.nextInt(100) != 0) {
this.worldObj.theProfiler.startSection("followpath");
Vec3 var5 = this.pathToEntity.getPosition(this);
double var6 = (double) (this.width * 2.0F);
@ -131,8 +126,6 @@ public abstract class EntityCreature extends EntityLiving {
if (this.rand.nextFloat() < 0.8F && (var3 || var4)) {
this.isJumping = true;
}
this.worldObj.theProfiler.endSection();
} else {
super.updateEntityActionState();
this.pathToEntity = null;
@ -143,7 +136,6 @@ public abstract class EntityCreature extends EntityLiving {
* Time remaining during which the Animal is sped up and flees.
*/
protected void updateWanderPath() {
this.worldObj.theProfiler.startSection("stroll");
boolean var1 = false;
int var2 = -1;
int var3 = -1;
@ -169,8 +161,6 @@ public abstract class EntityCreature extends EntityLiving {
this.pathToEntity = this.worldObj.getEntityPathToXYZ(this, var2, var3, var4, 10.0F, true, false, false,
true);
}
this.worldObj.theProfiler.endSection();
}
/**

View file

@ -227,10 +227,8 @@ public abstract class EntityLiving extends Entity {
public EntityLiving(World par1World) {
super(par1World);
this.preventEntitySpawning = true;
this.tasks = new EntityAITasks(
par1World != null && par1World.theProfiler != null ? par1World.theProfiler : null);
this.targetTasks = new EntityAITasks(
par1World != null && par1World.theProfiler != null ? par1World.theProfiler : null);
this.tasks = new EntityAITasks();
this.targetTasks = new EntityAITasks();
this.lookHelper = new EntityLookHelper(this);
this.moveHelper = new EntityMoveHelper(this);
this.jumpHelper = new EntityJumpHelper(this);
@ -486,7 +484,6 @@ public abstract class EntityLiving extends Entity {
public void onEntityUpdate() {
this.prevSwingProgress = this.swingProgress;
super.onEntityUpdate();
this.worldObj.theProfiler.startSection("mobBaseTick");
if (this.isEntityAlive() && this.rand.nextInt(1000) < this.livingSoundTime++) {
this.livingSoundTime = -this.getTalkInterval();
@ -570,7 +567,6 @@ public abstract class EntityLiving extends Entity {
this.prevRotationYawHead = this.rotationYawHead;
this.prevRotationYaw = this.rotationYaw;
this.prevRotationPitch = this.rotationPitch;
this.worldObj.theProfiler.endSection();
}
/**
@ -731,7 +727,6 @@ public abstract class EntityLiving extends Entity {
}
this.field_70766_av += (var8 - this.field_70766_av) * 0.3F;
this.worldObj.theProfiler.startSection("headTurn");
if (this.isAIEnabled()) {
this.bodyHelper.func_75664_a();
@ -760,9 +755,6 @@ public abstract class EntityLiving extends Entity {
}
}
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.startSection("rangeChecks");
while (this.rotationYaw - this.prevRotationYaw < -180.0F) {
this.prevRotationYaw -= 360.0F;
}
@ -795,7 +787,6 @@ public abstract class EntityLiving extends Entity {
this.prevRotationYawHead += 360.0F;
}
this.worldObj.theProfiler.endSection();
this.field_70764_aw += var7;
}
@ -1482,8 +1473,6 @@ public abstract class EntityLiving extends Entity {
this.motionZ = 0.0D;
}
this.worldObj.theProfiler.startSection("ai");
if (this.isMovementBlocked()) {
this.isJumping = false;
this.moveStrafing = 0.0F;
@ -1491,20 +1480,13 @@ public abstract class EntityLiving extends Entity {
this.randomYawVelocity = 0.0F;
} else if (this.isClientWorld()) {
if (this.isAIEnabled()) {
this.worldObj.theProfiler.startSection("newAi");
this.updateAITasks();
this.worldObj.theProfiler.endSection();
} else {
this.worldObj.theProfiler.startSection("oldAi");
this.updateEntityActionState();
this.worldObj.theProfiler.endSection();
this.rotationYawHead = this.rotationYaw;
}
}
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.startSection("jump");
if (this.isJumping) {
if (!this.isInWater() && !this.handleLavaMovement()) {
if (this.onGround && this.jumpTicks == 0) {
@ -1518,8 +1500,6 @@ public abstract class EntityLiving extends Entity {
this.jumpTicks = 0;
}
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.startSection("travel");
this.moveStrafing *= 0.98F;
this.moveForward *= 0.98F;
this.randomYawVelocity *= 0.9F;
@ -1527,16 +1507,11 @@ public abstract class EntityLiving extends Entity {
this.landMovementFactor *= this.getSpeedModifier();
this.moveEntityWithHeading(this.moveStrafing, this.moveForward);
this.landMovementFactor = var11;
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.startSection("push");
if (!this.worldObj.isRemote) {
this.func_85033_bc();
}
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.startSection("looting");
if (!this.worldObj.isRemote && this.canPickUpLoot() && !this.dead
&& this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) {
List var2 = this.worldObj.getEntitiesWithinAABB(EntityItem.class,
@ -1604,8 +1579,6 @@ public abstract class EntityLiving extends Entity {
}
}
}
this.worldObj.theProfiler.endSection();
}
protected void func_85033_bc() {
@ -1706,33 +1679,15 @@ public abstract class EntityLiving extends Entity {
protected void updateAITasks() {
++this.entityAge;
this.worldObj.theProfiler.startSection("checkDespawn");
this.despawnEntity();
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.startSection("sensing");
this.senses.clearSensingCache();
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.startSection("targetSelector");
this.targetTasks.onUpdateTasks();
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.startSection("goalSelector");
this.tasks.onUpdateTasks();
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.startSection("navigation");
this.navigator.onUpdateNavigation();
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.startSection("mob tick");
this.updateAITick();
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.startSection("controls");
this.worldObj.theProfiler.startSection("move");
this.moveHelper.onUpdateMoveHelper();
this.worldObj.theProfiler.endStartSection("look");
this.lookHelper.onUpdateLook();
this.worldObj.theProfiler.endStartSection("jump");
this.jumpHelper.doJump();
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.endSection();
}
/**

View file

@ -208,7 +208,6 @@ public abstract class EntityMinecart extends Entity {
int var2;
if (!this.worldObj.isRemote && this.worldObj instanceof WorldServer) {
this.worldObj.theProfiler.startSection("portal");
MinecraftServer var1 = ((WorldServer) this.worldObj).getMinecraftServer();
var2 = this.getMaxInPortalTime();
@ -243,8 +242,6 @@ public abstract class EntityMinecart extends Entity {
if (this.timeUntilPortal > 0) {
--this.timeUntilPortal;
}
this.worldObj.theProfiler.endSection();
}
if (this.worldObj.isRemote) {

View file

@ -34,9 +34,7 @@ public class EntitySenses {
} else if (this.unseenEntities.contains(par1Entity)) {
return false;
} else {
this.entityObj.worldObj.theProfiler.startSection("canSee");
boolean var2 = this.entityObj.canEntityBeSeen(par1Entity);
this.entityObj.worldObj.theProfiler.endSection();
if (var2) {
this.seenEntities.add(par1Entity);

View file

@ -78,9 +78,7 @@ public class NetServerHandler extends NetHandler {
public void handlePackets() {
this.field_72584_h = false;
++this.currentTicks;
this.mcServer.theProfiler.startSection("packetflow");
this.netManager.processReadPackets();
this.mcServer.theProfiler.endStartSection("keepAlive");
if ((long) this.currentTicks - this.ticksOfLastKeepAlive > 20L) {
this.ticksOfLastKeepAlive = (long) this.currentTicks;
@ -96,9 +94,6 @@ public class NetServerHandler extends NetHandler {
if (this.creativeItemCreationSpamThresholdTally > 0) {
--this.creativeItemCreationSpamThresholdTally;
}
this.mcServer.theProfiler.endStartSection("playerTick");
this.mcServer.theProfiler.endSection();
}
public boolean shouldBeRemoved() {

View file

@ -1,162 +0,0 @@
package net.minecraft.src;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
public class Profiler {
/** List of parent sections */
private final List sectionList = new ArrayList();
/** List of timestamps (System.nanoTime) */
private final List timestampList = new ArrayList();
/** Flag profiling enabled */
public boolean profilingEnabled = false;
/** Current profiling section */
private String profilingSection = "";
/** Profiling map */
private final Map profilingMap = new HashMap();
/**
* Clear profiling.
*/
public void clearProfiling() {
this.profilingMap.clear();
this.profilingSection = "";
this.sectionList.clear();
}
/**
* Start section
*/
public void startSection(String par1Str) {
if (this.profilingEnabled) {
if (this.profilingSection.length() > 0) {
this.profilingSection = this.profilingSection + ".";
}
this.profilingSection = this.profilingSection + par1Str;
this.sectionList.add(this.profilingSection);
this.timestampList.add(Long.valueOf(System.nanoTime()));
}
}
/**
* End section
*/
public void endSection() {
if (this.profilingEnabled) {
long var1 = System.nanoTime();
long var3 = ((Long) this.timestampList.remove(this.timestampList.size() - 1)).longValue();
this.sectionList.remove(this.sectionList.size() - 1);
long var5 = var1 - var3;
if (this.profilingMap.containsKey(this.profilingSection)) {
this.profilingMap.put(this.profilingSection,
Long.valueOf(((Long) this.profilingMap.get(this.profilingSection)).longValue() + var5));
} else {
this.profilingMap.put(this.profilingSection, Long.valueOf(var5));
}
if (var5 > 100000000L) { // -2
System.out.println("Something\'s taking too long! \'" + this.profilingSection + "\' took aprox "
+ (double) var5 / 1000000.0D + " ms");
}
this.profilingSection = !this.sectionList.isEmpty()
? (String) this.sectionList.get(this.sectionList.size() - 1)
: "";
}
}
/**
* Get profiling data
*/
public List getProfilingData(String par1Str) {
if (!this.profilingEnabled) {
return null;
} else {
long var3 = this.profilingMap.containsKey("root") ? ((Long) this.profilingMap.get("root")).longValue() : 0L;
long var5 = this.profilingMap.containsKey(par1Str) ? ((Long) this.profilingMap.get(par1Str)).longValue()
: -1L;
ArrayList var7 = new ArrayList();
if (par1Str.length() > 0) {
par1Str = par1Str + ".";
}
long var8 = 0L;
Iterator var10 = this.profilingMap.keySet().iterator();
while (var10.hasNext()) {
String var11 = (String) var10.next();
if (var11.length() > par1Str.length() && var11.startsWith(par1Str)
&& var11.indexOf(".", par1Str.length() + 1) < 0) {
var8 += ((Long) this.profilingMap.get(var11)).longValue();
}
}
float var20 = (float) var8;
if (var8 < var5) {
var8 = var5;
}
if (var3 < var8) {
var3 = var8;
}
Iterator var21 = this.profilingMap.keySet().iterator();
String var12;
while (var21.hasNext()) {
var12 = (String) var21.next();
if (var12.length() > par1Str.length() && var12.startsWith(par1Str)
&& var12.indexOf(".", par1Str.length() + 1) < 0) {
long var13 = ((Long) this.profilingMap.get(var12)).longValue();
double var15 = (double) var13 * 100.0D / (double) var8;
double var17 = (double) var13 * 100.0D / (double) var3;
String var19 = var12.substring(par1Str.length());
var7.add(new ProfilerResult(var19, var15, var17));
}
}
var21 = this.profilingMap.keySet().iterator();
while (var21.hasNext()) {
var12 = (String) var21.next();
this.profilingMap.put(var12,
Long.valueOf(((Long) this.profilingMap.get(var12)).longValue() * 999L / 1000L));
}
if ((float) var8 > var20) {
var7.add(new ProfilerResult("unspecified", (double) ((float) var8 - var20) * 100.0D / (double) var8,
(double) ((float) var8 - var20) * 100.0D / (double) var3));
}
Collections.sort(var7);
var7.add(0, new ProfilerResult(par1Str, 100.0D, (double) var8 * 100.0D / (double) var3));
return var7;
}
}
/**
* End current section and start a new section
*/
public void endStartSection(String par1Str) {
this.endSection();
this.startSection(par1Str);
}
public String getNameOfLastSection() {
return this.sectionList.size() == 0 ? "[UNKNOWN]" : (String) this.sectionList.get(this.sectionList.size() - 1);
}
}

View file

@ -1,23 +0,0 @@
package net.minecraft.src;
public final class ProfilerResult implements Comparable {
public double field_76332_a;
public double field_76330_b;
public String field_76331_c;
public ProfilerResult(String par1Str, double par2, double par4) {
this.field_76331_c = par1Str;
this.field_76332_a = par2;
this.field_76330_b = par4;
}
public int func_76328_a(ProfilerResult par1ProfilerResult) {
return par1ProfilerResult.field_76332_a < this.field_76332_a ? -1
: (par1ProfilerResult.field_76332_a > this.field_76332_a ? 1
: par1ProfilerResult.field_76331_c.compareTo(this.field_76331_c));
}
public int compareTo(Object par1Obj) {
return this.func_76328_a((ProfilerResult) par1Obj);
}
}

View file

@ -22,7 +22,6 @@ public class ServerCommandManager extends CommandHandler implements IAdminComman
this.registerCommand(new CommandServerEmote());
this.registerCommand(new CommandShowSeed());
this.registerCommand(new CommandHelp());
this.registerCommand(new CommandDebug());
this.registerCommand(new CommandServerMessage());
this.registerCommand(new CommandServerSay());
this.registerCommand(new CommandSetSpawnpoint());

View file

@ -433,7 +433,6 @@ public class ServerConfigurationManager {
double var13 = par1Entity.posY;
double var15 = par1Entity.posZ;
float var17 = par1Entity.rotationYaw;
par3WorldServer.theProfiler.startSection("moving");
if (par1Entity.dimension == -1) {
var5 /= var9;
@ -472,10 +471,7 @@ public class ServerConfigurationManager {
}
}
par3WorldServer.theProfiler.endSection();
if (par2 != 1) {
par3WorldServer.theProfiler.startSection("placing");
var5 = (double) MathHelper.clamp_int((int) var5, -29999872, 29999872);
var7 = (double) MathHelper.clamp_int((int) var7, -29999872, 29999872);
@ -486,8 +482,6 @@ public class ServerConfigurationManager {
par4WorldServer.updateEntityWithOptionalForce(par1Entity, false);
par4WorldServer.getDefaultTeleporter().placeInPortal(par1Entity, var11, var13, var15, var17);
}
par3WorldServer.theProfiler.endSection();
}
par1Entity.setWorld(par4WorldServer);

View file

@ -89,7 +89,6 @@ public abstract class World implements IBlockAccess {
public MapStorage mapStorage;
public final VillageCollection villageCollectionObj;
protected final VillageSiege villageSiegeObj = new VillageSiege(this);
public final Profiler theProfiler;
/** The world-local pool of vectors */
private final Vec3Pool vecPool = new Vec3Pool(300, 2000);
@ -146,12 +145,11 @@ public abstract class World implements IBlockAccess {
}
public World(ISaveHandler par1ISaveHandler, String par2Str, WorldSettings par3WorldSettings,
WorldProvider par4WorldProvider, Profiler par5Profiler, ILogAgent par6ILogAgent) {
WorldProvider par4WorldProvider, ILogAgent par6ILogAgent) {
this.ambientTickCountdown = this.rand.nextInt(12000);
this.lightUpdateBlockList = new int[32768];
this.isRemote = false;
this.saveHandler = par1ISaveHandler;
this.theProfiler = par5Profiler;
this.mapStorage = new MapStorage(par1ISaveHandler);
this.worldLogAgent = par6ILogAgent;
this.worldInfo = par1ISaveHandler.loadWorldInfo();
@ -340,9 +338,7 @@ public abstract class World implements IBlockAccess {
}
boolean var9 = var7.setBlockIDWithMetadata(par1 & 15, par2, par3 & 15, par4, par5);
this.theProfiler.startSection("checkLight");
this.updateAllLightTypes(par1, par2, par3);
this.theProfiler.endSection();
if (var9) {
if ((par6 & 2) != 0 && (!this.isRemote || (par6 & 4) == 0)) {
@ -1299,8 +1295,6 @@ public abstract class World implements IBlockAccess {
* Updates (and cleans up) entities and tile entities
*/
public void updateEntities() {
this.theProfiler.startSection("entities");
this.theProfiler.startSection("global");
int var1;
Entity var2;
@ -1315,7 +1309,6 @@ public abstract class World implements IBlockAccess {
}
}
this.theProfiler.endStartSection("remove");
this.loadedEntityList.removeAll(this.unloadedEntityList);
int var3;
int var13;
@ -1335,7 +1328,6 @@ public abstract class World implements IBlockAccess {
}
this.unloadedEntityList.clear();
this.theProfiler.endStartSection("regular");
for (var1 = 0; var1 < this.loadedEntityList.size(); ++var1) {
var2 = (Entity) this.loadedEntityList.get(var1);
@ -1349,15 +1341,10 @@ public abstract class World implements IBlockAccess {
var2.ridingEntity = null;
}
this.theProfiler.startSection("tick");
if (!var2.isDead) {
this.updateEntity(var2);
}
this.theProfiler.endSection();
this.theProfiler.startSection("remove");
if (var2.isDead) {
var3 = var2.chunkCoordX;
var13 = var2.chunkCoordZ;
@ -1369,11 +1356,8 @@ public abstract class World implements IBlockAccess {
this.loadedEntityList.remove(var1--);
this.releaseEntitySkin(var2);
}
this.theProfiler.endSection();
}
this.theProfiler.endStartSection("tileEntities");
this.scanningTileEntities = true;
Iterator var14 = this.loadedTileEntityList.iterator();
@ -1404,8 +1388,6 @@ public abstract class World implements IBlockAccess {
this.entityRemoval.clear();
}
this.theProfiler.endStartSection("pendingTileEntities");
if (!this.addedTileEntityList.isEmpty()) {
for (int var10 = 0; var10 < this.addedTileEntityList.size(); ++var10) {
TileEntity var12 = (TileEntity) this.addedTileEntityList.get(var10);
@ -1429,9 +1411,6 @@ public abstract class World implements IBlockAccess {
this.addedTileEntityList.clear();
}
this.theProfiler.endSection();
this.theProfiler.endSection();
}
public void addTileEntity(Collection par1Collection) {
@ -1475,8 +1454,6 @@ public abstract class World implements IBlockAccess {
}
}
this.theProfiler.startSection("chunkCheck");
if (Double.isNaN(par1Entity.posX) || Double.isInfinite(par1Entity.posX)) {
par1Entity.posX = par1Entity.lastTickPosX;
}
@ -1517,8 +1494,6 @@ public abstract class World implements IBlockAccess {
}
}
this.theProfiler.endSection();
if (par2 && par1Entity.addedToChunk && par1Entity.riddenByEntity != null) {
if (!par1Entity.riddenByEntity.isDead && par1Entity.riddenByEntity.ridingEntity == par1Entity) {
this.updateEntity(par1Entity.riddenByEntity);
@ -2166,7 +2141,6 @@ public abstract class World implements IBlockAccess {
protected void setActivePlayerChunksAndCheckLight() {
this.activeChunkSet.clear();
this.theProfiler.startSection("buildList");
int var1;
EntityPlayerMP var2;
int var3;
@ -2189,14 +2163,10 @@ public abstract class World implements IBlockAccess {
}
}
this.theProfiler.endSection();
if (this.ambientTickCountdown > 0) {
--this.ambientTickCountdown;
}
this.theProfiler.startSection("playerCheckLight");
if (!this.playerEntities.isEmpty()) {
var1 = this.rand.nextInt(this.playerEntities.size());
var2 = (EntityPlayerMP) this.playerEntities.get(var1);
@ -2205,13 +2175,9 @@ public abstract class World implements IBlockAccess {
int var8 = MathHelper.floor_double(var2.posZ) + this.rand.nextInt(11) - 5;
this.updateAllLightTypes(var3, var4, var8);
}
this.theProfiler.endSection();
}
protected void moodSoundAndLightCheck(int par1, int par2, Chunk par3Chunk) {
this.theProfiler.endStartSection("moodSound");
if (this.ambientTickCountdown == 0 && !this.isRemote) {
this.updateLCG = this.updateLCG * 3 + 1013904223;
int var4 = this.updateLCG >> 2;
@ -2236,7 +2202,6 @@ public abstract class World implements IBlockAccess {
}
}
this.theProfiler.endStartSection("checkLight");
par3Chunk.enqueueRelightChecks();
}
@ -2389,7 +2354,6 @@ public abstract class World implements IBlockAccess {
if (this.doChunksNearChunkExist(par2, par3, par4, 17)) {
int var5 = 0;
int var6 = 0;
this.theProfiler.startSection("getBrightness");
int var7 = this.getSavedLightValue(par1EnumSkyBlock, par2, par3, par4);
int var8 = this.computeLightValue(par2, par3, par4, par1EnumSkyBlock);
int var9;
@ -2444,9 +2408,6 @@ public abstract class World implements IBlockAccess {
var5 = 0;
}
this.theProfiler.endSection();
this.theProfiler.startSection("checkedPosition < toCheckCount");
while (var5 < var6) {
var9 = this.lightUpdateBlockList[var5++];
var10 = (var9 & 63) - 32 + par2;
@ -2498,8 +2459,6 @@ public abstract class World implements IBlockAccess {
}
}
}
this.theProfiler.endSection();
}
}
@ -2675,7 +2634,6 @@ public abstract class World implements IBlockAccess {
public PathEntity getPathEntityToEntity(Entity par1Entity, Entity par2Entity, float par3, boolean par4,
boolean par5, boolean par6, boolean par7) {
this.theProfiler.startSection("pathfind");
int var8 = MathHelper.floor_double(par1Entity.posX);
int var9 = MathHelper.floor_double(par1Entity.posY + 1.0D);
int var10 = MathHelper.floor_double(par1Entity.posZ);
@ -2689,13 +2647,11 @@ public abstract class World implements IBlockAccess {
ChunkCache var18 = new ChunkCache(this, var12, var13, var14, var15, var16, var17, 0);
PathEntity var19 = (new PathFinder(var18, par4, par5, par6, par7)).createEntityPathTo(par1Entity, par2Entity,
par3);
this.theProfiler.endSection();
return var19;
}
public PathEntity getEntityPathToXYZ(Entity par1Entity, int par2, int par3, int par4, float par5, boolean par6,
boolean par7, boolean par8, boolean par9) {
this.theProfiler.startSection("pathfind");
int var10 = MathHelper.floor_double(par1Entity.posX);
int var11 = MathHelper.floor_double(par1Entity.posY);
int var12 = MathHelper.floor_double(par1Entity.posZ);
@ -2709,7 +2665,6 @@ public abstract class World implements IBlockAccess {
ChunkCache var20 = new ChunkCache(this, var14, var15, var16, var17, var18, var19, 0);
PathEntity var21 = (new PathFinder(var20, par6, par7, par8, par9)).createEntityPathTo(par1Entity, par2, par3,
par4, par5);
this.theProfiler.endSection();
return var21;
}

View file

@ -71,9 +71,8 @@ public class WorldServer extends World {
private IntHashMap entityIdMap;
public WorldServer(MinecraftServer par1MinecraftServer, ISaveHandler par2ISaveHandler, String par3Str, int par4,
WorldSettings par5WorldSettings, Profiler par6Profiler, ILogAgent par7ILogAgent) {
super(par2ISaveHandler, par3Str, par5WorldSettings, WorldProvider.getProviderForDimension(par4), par6Profiler,
par7ILogAgent);
WorldSettings par5WorldSettings, ILogAgent par7ILogAgent) {
super(par2ISaveHandler, par3Str, par5WorldSettings, WorldProvider.getProviderForDimension(par4), par7ILogAgent);
this.mcServer = par1MinecraftServer;
this.theEntityTracker = new EntityTracker(this);
this.thePlayerManager = new PlayerManager(this,
@ -130,14 +129,11 @@ public class WorldServer extends World {
}
}
this.theProfiler.startSection("mobSpawner");
if (this.getGameRules().getGameRuleBooleanValue("doMobSpawning")) {
SpawnerAnimals.findChunksForSpawning(this, this.spawnHostileMobs, this.spawnPeacefulMobs,
this.worldInfo.getWorldTotalTime() % 400L == 0L);
}
this.theProfiler.endStartSection("chunkSource");
this.chunkProvider.unloadQueuedChunks();
int var4 = this.calculateSkylightSubtracted(1.0F);
@ -147,18 +143,12 @@ public class WorldServer extends World {
this.worldInfo.incrementTotalWorldTime(this.worldInfo.getWorldTotalTime() + 1L);
this.worldInfo.setWorldTime(this.worldInfo.getWorldTime() + 1L);
this.theProfiler.endStartSection("tickPending");
this.tickUpdates(false);
this.theProfiler.endStartSection("tickTiles");
this.tickBlocksAndAmbiance();
this.theProfiler.endStartSection("chunkMap");
this.thePlayerManager.updatePlayerInstances();
this.theProfiler.endStartSection("village");
this.villageCollectionObj.tick();
this.villageSiegeObj.tick();
this.theProfiler.endStartSection("portalForcer");
this.field_85177_Q.removeStalePortalLocations(this.getTotalWorldTime());
this.theProfiler.endSection();
this.sendAndApplyBlockEvents();
_r += this.theChunkProviderServer.statR();
@ -280,14 +270,11 @@ public class WorldServer extends World {
ChunkCoordIntPair var4 = (ChunkCoordIntPair) var3.next();
int var5 = var4.chunkXPos * 16;
int var6 = var4.chunkZPos * 16;
this.theProfiler.startSection("getChunk");
Chunk var7 = this.getChunkFromChunkCoords(var4.chunkXPos, var4.chunkZPos);
this.moodSoundAndLightCheck(var5, var6, var7);
this.theProfiler.endStartSection("tickChunk");
if(var7.updateSkylight()) {
++_lu;
}
this.theProfiler.endStartSection("thunder");
int var8;
int var9;
int var10;
@ -305,7 +292,6 @@ public class WorldServer extends World {
}
}
this.theProfiler.endStartSection("iceandsnow");
int var13;
if (this.rand.nextInt(16) == 0) {
@ -336,7 +322,6 @@ public class WorldServer extends World {
}
}
this.theProfiler.endStartSection("tickTiles");
ExtendedBlockStorage[] var19 = var7.getBlockStorageArray();
var9 = var19.length;
@ -362,8 +347,6 @@ public class WorldServer extends World {
}
}
}
this.theProfiler.endSection();
}
}
@ -471,7 +454,6 @@ public class WorldServer extends World {
var2 = 1000;
}
this.theProfiler.startSection("cleaning");
NextTickListEntry var4;
for (int var3 = 0; var3 < var2; ++var3) {
@ -486,8 +468,6 @@ public class WorldServer extends World {
this.field_94579_S.add(var4);
}
this.theProfiler.endSection();
this.theProfiler.startSection("ticking");
Iterator var14 = this.field_94579_S.iterator();
while (var14.hasNext()) {
@ -508,7 +488,6 @@ public class WorldServer extends World {
}
}
this.theProfiler.endSection();
this.field_94579_S.clear();
return !this.pendingTickListEntries.isEmpty();
}

View file

@ -4,9 +4,8 @@ import net.minecraft.server.MinecraftServer;
public class WorldServerMulti extends WorldServer {
public WorldServerMulti(MinecraftServer par1MinecraftServer, ISaveHandler par2ISaveHandler, String par3Str,
int par4, WorldSettings par5WorldSettings, WorldServer par6WorldServer, Profiler par7Profiler,
ILogAgent par8ILogAgent) {
super(par1MinecraftServer, par2ISaveHandler, par3Str, par4, par5WorldSettings, par7Profiler, par8ILogAgent);
int par4, WorldSettings par5WorldSettings, WorldServer par6WorldServer, ILogAgent par8ILogAgent) {
super(par1MinecraftServer, par2ISaveHandler, par3Str, par4, par5WorldSettings, par8ILogAgent);
this.mapStorage = par6WorldServer.mapStorage;
this.worldScoreboard = par6WorldServer.getScoreboard();
this.worldInfo = new DerivedWorldInfo(par6WorldServer.getWorldInfo());

View file

@ -1,9 +1,7 @@
package net.minecraft.client;
import java.nio.charset.StandardCharsets;
import java.text.DecimalFormat;
import java.util.HashSet;
import java.util.List;
import net.lax1dude.eaglercraft.DefaultSkinRenderer;
import net.lax1dude.eaglercraft.EaglerAdapter;
@ -67,8 +65,6 @@ import net.minecraft.src.NetClientHandler;
import net.minecraft.src.OpenGlHelper;
import net.minecraft.src.Packet3Chat;
import net.minecraft.src.PlayerControllerMP;
import net.minecraft.src.Profiler;
import net.minecraft.src.ProfilerResult;
import net.minecraft.src.RenderBlocks;
import net.minecraft.src.RenderEngine;
import net.minecraft.src.RenderGlobal;
@ -201,9 +197,6 @@ public class Minecraft implements Runnable {
private boolean isDemo;
private INetworkManager myNetworkManager;
private boolean integratedServerIsRunning;
/** The profiler instance */
public final Profiler mcProfiler = new Profiler();
private long field_83002_am = -1L;
public int chunkUpdates = 0;
@ -667,8 +660,6 @@ public class Minecraft implements Runnable {
this.theWorld.getWorldVec3Pool().clear();
}
this.mcProfiler.startSection("root");
if (EaglerAdapter.shouldShutdown()) {
this.shutdown();
}
@ -682,7 +673,6 @@ public class Minecraft implements Runnable {
}
long var6 = System.nanoTime();
this.mcProfiler.startSection("tick");
for (int var3 = 0; var3 < this.timer.elapsedTicks; ++var3) {
this.runTick();
@ -690,20 +680,15 @@ public class Minecraft implements Runnable {
IntegratedServer.processICP();
this.mcProfiler.endStartSection("preRenderErrors");
long var7 = System.nanoTime() - var6;
this.checkGLError("Pre render");
RenderBlocks.fancyGrass = this.gameSettings.fancyGraphics;
this.mcProfiler.endStartSection("sound");
this.sndManager.setListener(this.thePlayer, this.timer.renderPartialTicks);
if (!this.isGamePaused) {
this.sndManager.func_92071_g();
}
this.mcProfiler.endSection();
this.mcProfiler.startSection("render");
this.mcProfiler.startSection("display");
EaglerAdapter.glEnable(EaglerAdapter.GL_TEXTURE_2D);
if (!EaglerAdapter.isKeyDown(65)) {
@ -713,38 +698,22 @@ public class Minecraft implements Runnable {
if (this.thePlayer != null && this.thePlayer.isEntityInsideOpaqueBlock()) {
this.gameSettings.thirdPersonView = 0;
}
this.mcProfiler.endSection();
EaglerAdapter.glClearStack();
if (!this.skipRenderWorld) {
this.mcProfiler.endStartSection("gameRenderer");
this.entityRenderer.updateCameraAndRender(this.timer.renderPartialTicks);
this.mcProfiler.endSection();
}
EaglerAdapter.glFlush();
this.mcProfiler.endSection();
//if (!EaglerAdapter.isFocused() && this.fullscreen) {
// this.toggleFullscreen();
//}
if (this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart) {
if (!this.mcProfiler.profilingEnabled) {
this.mcProfiler.clearProfiling();
}
this.mcProfiler.profilingEnabled = true;
this.displayDebugInfo(var7);
} else {
this.mcProfiler.profilingEnabled = false;
this.prevFrameTime = System.nanoTime();
}
this.prevFrameTime = System.nanoTime();
this.guiAchievement.updateAchievementWindow();
this.mcProfiler.startSection("root");
if (!this.fullscreen && (EaglerAdapter.getCanvasWidth() != this.displayWidth || EaglerAdapter.getCanvasHeight() != this.displayHeight)) {
this.displayWidth = EaglerAdapter.getCanvasWidth();
@ -783,150 +752,12 @@ public class Minecraft implements Runnable {
}
EaglerAdapter.doJavascriptCoroutines();
this.mcProfiler.endSection();
this.mcProfiler.endSection();
}
private int func_90020_K() {
return this.currentScreen != null && this.currentScreen instanceof GuiMainMenu ? 2 : this.gameSettings.limitFramerate;
}
/**
* Update debugProfilerName in response to number keys in debug screen
*/
private void updateDebugProfilerName(int par1) {
List var2 = this.mcProfiler.getProfilingData(this.debugProfilerName);
if (var2 != null && !var2.isEmpty()) {
ProfilerResult var3 = (ProfilerResult) var2.remove(0);
if (par1 == 0) {
if (var3.field_76331_c.length() > 0) {
int var4 = this.debugProfilerName.lastIndexOf(".");
if (var4 >= 0) {
this.debugProfilerName = this.debugProfilerName.substring(0, var4);
}
}
} else {
--par1;
if (par1 < var2.size() && !((ProfilerResult) var2.get(par1)).field_76331_c.equals("unspecified")) {
if (this.debugProfilerName.length() > 0) {
this.debugProfilerName = this.debugProfilerName + ".";
}
this.debugProfilerName = this.debugProfilerName + ((ProfilerResult) var2.get(par1)).field_76331_c;
}
}
}
}
private void displayDebugInfo(long par1) {
if (this.mcProfiler.profilingEnabled) {
List var3 = this.mcProfiler.getProfilingData(this.debugProfilerName);
ProfilerResult var4 = (ProfilerResult) var3.remove(0);
EaglerAdapter.glClear(EaglerAdapter.GL_DEPTH_BUFFER_BIT);
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_PROJECTION);
EaglerAdapter.glEnable(EaglerAdapter.GL_COLOR_MATERIAL);
EaglerAdapter.glLoadIdentity();
EaglerAdapter.glOrtho(0.0F, this.displayWidth, this.displayHeight, 0.0F, 1000.0F, 3000.0F);
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_MODELVIEW);
EaglerAdapter.glLoadIdentity();
EaglerAdapter.glTranslatef(0.0F, 0.0F, -2000.0F);
EaglerAdapter.glLineWidth(1.0F);
EaglerAdapter.glDisable(EaglerAdapter.GL_TEXTURE_2D);
EaglerAdapter.glEnable(EaglerAdapter.GL_DEPTH_TEST);
EaglerAdapter.glColor4f(1f, 1f, 1f, 1f);
Tessellator var5 = Tessellator.instance;
short var6 = 160;
int var7 = this.displayWidth - var6 - 10;
int var8 = this.displayHeight - var6 * 2;
EaglerAdapter.glEnable(EaglerAdapter.GL_BLEND);
var5.startDrawingQuads();
var5.setColorRGBA_I(0, 200);
var5.addVertex((double) ((float) var7 - (float) var6 * 1.1F), (double) ((float) var8 - (float) var6 * 0.6F - 16.0F), 0.0D);
var5.addVertex((double) ((float) var7 - (float) var6 * 1.1F), (double) (var8 + var6 * 2), 0.0D);
var5.addVertex((double) ((float) var7 + (float) var6 * 1.1F), (double) (var8 + var6 * 2), 0.0D);
var5.addVertex((double) ((float) var7 + (float) var6 * 1.1F), (double) ((float) var8 - (float) var6 * 0.6F - 16.0F), 0.0D);
var5.draw();
EaglerAdapter.glDisable(EaglerAdapter.GL_BLEND);
double var9 = 0.0D;
int var13;
EaglerAdapter.glDepthMask(true);
for (int var11 = 0; var11 < var3.size(); ++var11) {
ProfilerResult var12 = (ProfilerResult) var3.get(var11);
var13 = MathHelper.floor_double(var12.field_76332_a / 4.0D) + 1;
var5.startDrawing(EaglerAdapter.GL_TRIANGLE_FAN);
var5.setColorOpaque_I(var12.func_76329_a());
var5.addVertex((double) var7, (double) var8, 0.0D);
int var14;
float var15;
float var16;
float var17;
for (var14 = var13; var14 >= 0; --var14) {
var15 = (float) ((var9 + var12.field_76332_a * (double) var14 / (double) var13) * Math.PI * 2.0D / 100.0D);
var16 = MathHelper.sin(var15) * (float) var6;
var17 = MathHelper.cos(var15) * (float) var6 * 0.5F;
var5.addVertex((double) ((float) var7 + var16), (double) ((float) var8 - var17), 0.0D);
}
var5.draw();
var5.startDrawing(EaglerAdapter.GL_TRIANGLE_STRIP);
var5.setColorOpaque_I((var12.func_76329_a() & 16711422) >> 1);
for (var14 = var13; var14 >= 0; --var14) {
var15 = (float) ((var9 + var12.field_76332_a * (double) var14 / (double) var13) * Math.PI * 2.0D / 100.0D);
var16 = MathHelper.sin(var15) * (float) var6;
var17 = MathHelper.cos(var15) * (float) var6 * 0.5F;
var5.addVertex((double) ((float) var7 + var16), (double) ((float) var8 - var17), 0.0D);
var5.addVertex((double) ((float) var7 + var16), (double) ((float) var8 - var17 + 10.0F), 0.0D);
}
var5.draw();
var9 += var12.field_76332_a;
}
DecimalFormat var18 = new DecimalFormat("##0.00");
EaglerAdapter.glEnable(EaglerAdapter.GL_TEXTURE_2D);
String var19 = "";
if (!var4.field_76331_c.equals("unspecified")) {
var19 = var19 + "[0] ";
}
if (var4.field_76331_c.length() == 0) {
var19 = var19 + "ROOT ";
} else {
var19 = var19 + var4.field_76331_c + " ";
}
var13 = 16777215;
this.fontRenderer.drawStringWithShadow(var19, var7 - var6, var8 - var6 / 2 - 16, var13);
this.fontRenderer.drawStringWithShadow(var19 = var18.format(var4.field_76330_b) + "%", var7 + var6 - this.fontRenderer.getStringWidth(var19), var8 - var6 / 2 - 16, var13);
for (int var21 = 0; var21 < var3.size(); ++var21) {
ProfilerResult var20 = (ProfilerResult) var3.get(var21);
String var22 = "";
if (var20.field_76331_c.equals("unspecified")) {
var22 = var22 + "[?] ";
} else {
var22 = var22 + "[" + (var21 + 1) + "] ";
}
var22 = var22 + var20.field_76331_c;
this.fontRenderer.drawStringWithShadow(var22, var7 - var6, var8 + var6 / 2 + var21 * 8 + 20, var20.func_76329_a());
this.fontRenderer.drawStringWithShadow(var22 = var18.format(var20.field_76332_a) + "%", var7 + var6 - 50 - this.fontRenderer.getStringWidth(var22), var8 + var6 / 2 + var21 * 8 + 20, var20.func_76329_a());
this.fontRenderer.drawStringWithShadow(var22 = var18.format(var20.field_76330_b) + "%", var7 + var6 - this.fontRenderer.getStringWidth(var22), var8 + var6 / 2 + var21 * 8 + 20, var20.func_76329_a());
}
}
}
/**
* Called when the window is closing. Sets 'running' to false which allows the
* game loop to exit cleanly.
@ -1113,9 +944,6 @@ public class Minecraft implements Runnable {
--this.rightClickDelayTimer;
}
this.mcProfiler.startSection("stats");
this.mcProfiler.endStartSection("gui");
this.isGamePaused = this.isSingleplayer() && this.theWorld != null && this.thePlayer != null && this.currentScreen != null
&& this.currentScreen.doesGuiPauseGame() && !IntegratedServerLAN.isHostingLAN();
@ -1135,15 +963,11 @@ public class Minecraft implements Runnable {
this.ingameGUI.updateTick();
}
this.mcProfiler.endStartSection("pick");
this.entityRenderer.getMouseOver(1.0F);
this.mcProfiler.endStartSection("gameMode");
if (!this.isGamePaused && this.theWorld != null) {
this.playerController.updateController();
}
this.mcProfiler.endStartSection("textures");
if (!this.isGamePaused) {
this.renderEngine.updateDynamicTextures();
@ -1198,7 +1022,6 @@ public class Minecraft implements Runnable {
}
if (this.currentScreen == null || this.currentScreen.allowUserInput) {
this.mcProfiler.endStartSection("mouse");
while (EaglerAdapter.mouseNext()) {
KeyBinding.setKeyBindState(EaglerAdapter.mouseGetEventButton() - 100, EaglerAdapter.mouseGetEventButtonState());
@ -1242,7 +1065,6 @@ public class Minecraft implements Runnable {
--this.leftClickCounter;
}
this.mcProfiler.endStartSection("keyboard");
boolean var8;
while (EaglerAdapter.keysNext()) {
@ -1345,18 +1167,6 @@ public class Minecraft implements Runnable {
}
}
}
if (this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart && !this.gameSettings.keyBindFunction.pressed) {
if (EaglerAdapter.getEventKey() == 11) {
this.updateDebugProfilerName(0);
}
for (int var9 = 0; var9 < 9; ++var9) {
if (EaglerAdapter.getEventKey() == 2 + var9) {
this.updateDebugProfilerName(var9 + 1);
}
}
}
}
}
}
@ -1446,20 +1256,14 @@ public class Minecraft implements Runnable {
}
}
this.mcProfiler.endStartSection("gameRenderer");
if (!this.isGamePaused) {
this.entityRenderer.updateRenderer();
}
this.mcProfiler.endStartSection("levelRenderer");
if (!this.isGamePaused) {
this.renderGlobal.updateClouds();
}
this.mcProfiler.endStartSection("level");
if (!this.isGamePaused) {
if (this.theWorld.lastLightningBolt > 0) {
--this.theWorld.lastLightningBolt;
@ -1474,19 +1278,14 @@ public class Minecraft implements Runnable {
this.theWorld.tick();
}
this.mcProfiler.endStartSection("animateTick");
if (!this.isGamePaused && this.theWorld != null) {
this.theWorld.doVoidFogParticles(MathHelper.floor_double(this.thePlayer.posX), MathHelper.floor_double(this.thePlayer.posY), MathHelper.floor_double(this.thePlayer.posZ));
}
this.mcProfiler.endStartSection("particles");
if (!this.isGamePaused) {
this.effectRenderer.updateEffects();
}
} else if (this.myNetworkManager != null) {
this.mcProfiler.endStartSection("pendingConnection");
this.myNetworkManager.processReadPackets();
} else {
this.entityRenderer.startup = 0;
@ -1518,7 +1317,6 @@ public class Minecraft implements Runnable {
reconnectAddress = null;
}
this.mcProfiler.endSection();
this.systemTime = getSystemTime();
}

View file

@ -292,7 +292,6 @@ public class Chunk {
* Runs delayed skylight updates.
*/
private void updateSkylight_do() {
this.worldObj.theProfiler.startSection("recheckGaps");
if (this.worldObj.doChunksNearChunkExist(this.xPosition * 16 + 8, 0, this.zPosition * 16 + 8, 16)) {
for (int var1 = 0; var1 < 16; ++var1) {
@ -330,8 +329,6 @@ public class Chunk {
this.isGapLightingUpdated = false;
}
this.worldObj.theProfiler.endSection();
}
/**

View file

@ -366,8 +366,6 @@ public abstract class Entity {
* Gets called every tick from main Entity class
*/
public void onEntityUpdate() {
this.worldObj.theProfiler.startSection("entityBaseTick");
if (this.ridingEntity != null && this.ridingEntity.isDead) {
this.ridingEntity = null;
}
@ -406,7 +404,6 @@ public abstract class Entity {
}
this.firstUpdate = false;
this.worldObj.theProfiler.endSection();
}
/**
@ -474,7 +471,6 @@ public abstract class Entity {
this.posY = this.boundingBox.minY + (double) this.yOffset - (double) this.ySize;
this.posZ = (this.boundingBox.minZ + this.boundingBox.maxZ) / 2.0D;
} else {
this.worldObj.theProfiler.startSection("move");
this.ySize *= 0.4F;
double var7 = this.posX;
double var9 = this.posY;
@ -656,8 +652,6 @@ public abstract class Entity {
}
}
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.startSection("rest");
this.posX = (this.boundingBox.minX + this.boundingBox.maxX) / 2.0D;
this.posY = this.boundingBox.minY + (double) this.yOffset - (double) this.ySize;
this.posZ = (this.boundingBox.minZ + this.boundingBox.maxZ) / 2.0D;
@ -743,8 +737,6 @@ public abstract class Entity {
this.playSound("random.fizz", 0.7F, 1.6F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F);
this.fire = -this.fireResistance;
}
this.worldObj.theProfiler.endSection();
}
}

View file

@ -25,8 +25,6 @@ public abstract class EntityCreature extends EntityLiving {
}
protected void updateEntityActionState() {
this.worldObj.theProfiler.startSection("ai");
if (this.fleeingTick > 0) {
--this.fleeingTick;
}
@ -50,8 +48,6 @@ public abstract class EntityCreature extends EntityLiving {
this.entityToAttack = null;
}
this.worldObj.theProfiler.endSection();
if (!this.hasAttacked && this.entityToAttack != null && (this.pathToEntity == null || this.rand.nextInt(20) == 0)) {
this.pathToEntity = this.worldObj.getPathEntityToEntity(this, this.entityToAttack, var1, true, false, false, true);
} else if (!this.hasAttacked && (this.pathToEntity == null && this.rand.nextInt(180) == 0 || this.rand.nextInt(120) == 0 || this.fleeingTick > 0) && this.entityAge < 100) {
@ -64,7 +60,6 @@ public abstract class EntityCreature extends EntityLiving {
this.rotationPitch = 0.0F;
if (this.pathToEntity != null && this.rand.nextInt(100) != 0) {
this.worldObj.theProfiler.startSection("followpath");
Vec3 var5 = this.pathToEntity.getPosition(this);
double var6 = (double) (this.width * 2.0F);
@ -125,8 +120,6 @@ public abstract class EntityCreature extends EntityLiving {
if (this.rand.nextFloat() < 0.8F && (var3 || var4)) {
this.isJumping = true;
}
this.worldObj.theProfiler.endSection();
} else {
super.updateEntityActionState();
this.pathToEntity = null;
@ -137,7 +130,6 @@ public abstract class EntityCreature extends EntityLiving {
* Time remaining during which the Animal is sped up and flees.
*/
protected void updateWanderPath() {
this.worldObj.theProfiler.startSection("stroll");
boolean var1 = false;
int var2 = -1;
int var3 = -1;
@ -162,8 +154,6 @@ public abstract class EntityCreature extends EntityLiving {
if (var1) {
this.pathToEntity = this.worldObj.getEntityPathToXYZ(this, var2, var3, var4, 10.0F, true, false, false, true);
}
this.worldObj.theProfiler.endSection();
}
/**

View file

@ -478,7 +478,6 @@ public abstract class EntityLiving extends Entity {
public void onEntityUpdate() {
this.prevSwingProgress = this.swingProgress;
super.onEntityUpdate();
this.worldObj.theProfiler.startSection("mobBaseTick");
if (this.isEntityAlive() && this.rand.nextInt(1000) < this.livingSoundTime++) {
this.livingSoundTime = -this.getTalkInterval();
@ -558,7 +557,6 @@ public abstract class EntityLiving extends Entity {
this.prevRotationYawHead = this.rotationYawHead;
this.prevRotationYaw = this.rotationYaw;
this.prevRotationPitch = this.rotationPitch;
this.worldObj.theProfiler.endSection();
}
/**
@ -686,7 +684,6 @@ public abstract class EntityLiving extends Entity {
}
this.field_70766_av += (var8 - this.field_70766_av) * 0.3F;
this.worldObj.theProfiler.startSection("headTurn");
if (this.isAIEnabled()) {
this.bodyHelper.func_75664_a();
@ -715,9 +712,6 @@ public abstract class EntityLiving extends Entity {
}
}
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.startSection("rangeChecks");
while (this.rotationYaw - this.prevRotationYaw < -180.0F) {
this.prevRotationYaw -= 360.0F;
}
@ -750,7 +744,6 @@ public abstract class EntityLiving extends Entity {
this.prevRotationYawHead += 360.0F;
}
this.worldObj.theProfiler.endSection();
this.field_70764_aw += var7;
}
@ -1324,8 +1317,6 @@ public abstract class EntityLiving extends Entity {
this.motionZ = 0.0D;
}
this.worldObj.theProfiler.startSection("ai");
if (this.isMovementBlocked()) {
this.isJumping = false;
this.moveStrafing = 0.0F;
@ -1333,20 +1324,13 @@ public abstract class EntityLiving extends Entity {
this.randomYawVelocity = 0.0F;
} else if (this.isClientWorld()) {
if (this.isAIEnabled()) {
this.worldObj.theProfiler.startSection("newAi");
this.updateAITasks();
this.worldObj.theProfiler.endSection();
} else {
this.worldObj.theProfiler.startSection("oldAi");
this.updateEntityActionState();
this.worldObj.theProfiler.endSection();
this.rotationYawHead = this.rotationYaw;
}
}
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.startSection("jump");
if (this.isJumping) {
if (!this.isInWater() && !this.handleLavaMovement()) {
if (this.onGround && this.jumpTicks == 0) {
@ -1360,8 +1344,6 @@ public abstract class EntityLiving extends Entity {
this.jumpTicks = 0;
}
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.startSection("travel");
this.moveStrafing *= 0.98F;
this.moveForward *= 0.98F;
this.randomYawVelocity *= 0.9F;
@ -1369,11 +1351,6 @@ public abstract class EntityLiving extends Entity {
this.landMovementFactor *= this.getSpeedModifier();
this.moveEntityWithHeading(this.moveStrafing, this.moveForward);
this.landMovementFactor = var11;
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.startSection("push");
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.startSection("looting");
this.worldObj.theProfiler.endSection();
}
protected void func_85033_bc() {
@ -1473,30 +1450,12 @@ public abstract class EntityLiving extends Entity {
protected void updateAITasks() {
++this.entityAge;
this.worldObj.theProfiler.startSection("checkDespawn");
this.despawnEntity();
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.startSection("sensing");
this.senses.clearSensingCache();
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.startSection("targetSelector");
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.startSection("goalSelector");
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.startSection("mob tick");
this.updateAITick();
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.startSection("controls");
this.worldObj.theProfiler.startSection("move");
this.moveHelper.onUpdateMoveHelper();
this.worldObj.theProfiler.endStartSection("look");
this.lookHelper.onUpdateLook();
this.worldObj.theProfiler.endStartSection("jump");
this.jumpHelper.doJump();
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.endSection();
}
/**

View file

@ -857,13 +857,10 @@ public class EntityRenderer {
* the world and GUI
*/
public void updateCameraAndRender(float par1) {
this.mc.mcProfiler.startSection("lightTex");
if (this.lightmapUpdateNeeded) {
this.updateLightmap(par1);
}
this.mc.mcProfiler.endSection();
boolean var2 = EaglerAdapter.isFocused();
if (!var2 && this.mc.gameSettings.pauseOnLostFocus) {
@ -872,8 +869,6 @@ public class EntityRenderer {
this.prevFrameTime = Minecraft.getSystemTime();
}
this.mc.mcProfiler.startSection("mouse");
if (this.mc.inGameHasFocus && var2) {
this.mc.mouseHelper.mouseXYChange();
float var3 = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F;
@ -900,8 +895,6 @@ public class EntityRenderer {
}
}
this.mc.mcProfiler.endSection();
if (!this.mc.skipRenderWorld) {
anaglyphEnable = this.mc.gameSettings.anaglyph;
ScaledResolution var13 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight);
@ -912,8 +905,6 @@ public class EntityRenderer {
int var18 = performanceToFps(this.mc.gameSettings.limitFramerate);
if (this.mc.theWorld != null) {
this.mc.mcProfiler.startSection("level");
if (this.mc.gameSettings.limitFramerate == 0) {
this.renderWorld(par1, 0L);
} else {
@ -930,7 +921,6 @@ public class EntityRenderer {
}
this.renderEndNanoTime = System.nanoTime();
this.mc.mcProfiler.endStartSection("gui");
if (!this.mc.gameSettings.hideGUI || this.mc.currentScreen != null) {
EaglerAdapter.glAlphaFunc(EaglerAdapter.GL_GREATER, 0.1F);
@ -973,7 +963,6 @@ public class EntityRenderer {
EaglerAdapter.glDisable(EaglerAdapter.GL_BLEND);
EaglerAdapter.glDisable(EaglerAdapter.EAG_SWAP_RB);
}
this.mc.mcProfiler.endSection();
} else {
EaglerAdapter.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight);
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_PROJECTION);
@ -1002,8 +991,6 @@ public class EntityRenderer {
public static final TextureLocation terrain = new TextureLocation("/terrain.png");
public void renderWorld(float par1, long par2) {
this.mc.mcProfiler.startSection("lightTex");
if (this.lightmapUpdateNeeded) {
this.updateLightmap(par1);
}
@ -1015,7 +1002,6 @@ public class EntityRenderer {
this.mc.renderViewEntity = this.mc.thePlayer;
}
this.mc.mcProfiler.endStartSection("pick");
this.getMouseOver(par1);
EntityLiving var4 = this.mc.renderViewEntity;
RenderGlobal var5 = this.mc.renderGlobal;
@ -1023,7 +1009,6 @@ public class EntityRenderer {
double var7 = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double) par1;
double var9 = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double) par1;
double var11 = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double) par1;
this.mc.mcProfiler.endStartSection("center");
EffectPipelineFXAA.displayWidth = this.mc.displayWidth;
EffectPipelineFXAA.displayHeight = this.mc.displayHeight;
@ -1043,21 +1028,17 @@ public class EntityRenderer {
}
EaglerAdapter.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight);
this.mc.mcProfiler.endStartSection("clear");
EaglerAdapter.glClear(EaglerAdapter.GL_COLOR_BUFFER_BIT | EaglerAdapter.GL_DEPTH_BUFFER_BIT);
this.updateFogColor(par1);
EaglerAdapter.glEnable(EaglerAdapter.GL_CULL_FACE);
this.mc.mcProfiler.endStartSection("camera");
this.setupCameraTransform(par1, var13);
ActiveRenderInfo.updateRenderInfo(this.mc.thePlayer, this.mc.gameSettings.thirdPersonView == 2);
this.mc.mcProfiler.endStartSection("frustrum");
ClippingHelperImpl.getInstance();
EaglerAdapter.glEnable(EaglerAdapter.GL_FOG);
if (this.mc.gameSettings.renderDistance < 2) {
this.setupFog(-1, par1);
this.mc.mcProfiler.endStartSection("sky");
var5.renderSky(par1);
}
@ -1067,14 +1048,11 @@ public class EntityRenderer {
EaglerAdapter.glShadeModel(EaglerAdapter.GL_SMOOTH);
}
this.mc.mcProfiler.endStartSection("culling");
Frustrum var14 = new Frustrum();
var14.setPosition(var7, var9, var11);
this.mc.renderGlobal.clipRenderersByFrustum(var14, par1);
if (var13 == 0) {
this.mc.mcProfiler.endStartSection("updatechunks");
while (!this.mc.renderGlobal.updateRenderers(var4, false) && par2 != 0L) {
long var15 = par2 - System.nanoTime();
@ -1088,7 +1066,6 @@ public class EntityRenderer {
this.renderCloudsCheck(var5, par1);
}
this.mc.mcProfiler.endStartSection("prepareterrain");
EaglerAdapter.glEnable(EaglerAdapter.GL_FOG);
this.setupFog(0, par1);
EaglerAdapter.glDisable(EaglerAdapter.GL_BLEND);
@ -1102,28 +1079,23 @@ public class EntityRenderer {
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MIN_FILTER, EaglerAdapter.GL_NEAREST_MIPMAP_LINEAR);
}
EaglerAdapter.glAlphaFunc(EaglerAdapter.GL_GREATER, 0.6f);
this.mc.mcProfiler.endStartSection("terrain");
var5.sortAndRender(var4, 0, (double) par1);
EaglerAdapter.glShadeModel(EaglerAdapter.GL_FLAT);
EntityPlayer var17;
if (this.debugViewDirection == 0) {
RenderHelper.enableStandardItemLighting();
this.mc.mcProfiler.endStartSection("entities");
var5.renderEntities(var4.getPosition(par1), var14, par1);
this.enableLightmap((double) par1);
this.mc.mcProfiler.endStartSection("litParticles");
var6.renderLitParticles(var4, par1);
RenderHelper.disableStandardItemLighting();
this.setupFog(0, par1);
this.mc.mcProfiler.endStartSection("particles");
var6.renderParticles(var4, par1);
this.disableLightmap((double) par1);
if (this.mc.objectMouseOver != null && var4.isInsideOfMaterial(Material.water) && var4 instanceof EntityPlayer && !this.mc.gameSettings.hideGUI) {
var17 = (EntityPlayer) var4;
EaglerAdapter.glDisable(EaglerAdapter.GL_ALPHA_TEST);
this.mc.mcProfiler.endStartSection("outline");
var5.drawBlockBreaking(var17, this.mc.objectMouseOver, 0, var17.inventory.getCurrentItem(), par1);
var5.drawSelectionBox(var17, this.mc.objectMouseOver, 0, var17.inventory.getCurrentItem(), par1);
EaglerAdapter.glEnable(EaglerAdapter.GL_ALPHA_TEST);
@ -1141,8 +1113,6 @@ public class EntityRenderer {
terrain.bindTexture();
//if (this.mc.gameSettings.fancyGraphics) {
this.mc.mcProfiler.endStartSection("water");
EaglerAdapter.glColorMask(false, false, false, false);
int var18 = var5.sortAndRender(var4, 1, (double) par1);
@ -1179,18 +1149,15 @@ public class EntityRenderer {
if (this.cameraZoom == 1.0D && var4 instanceof EntityPlayer && !this.mc.gameSettings.hideGUI && this.mc.objectMouseOver != null && !var4.isInsideOfMaterial(Material.water)) {
var17 = (EntityPlayer) var4;
EaglerAdapter.glDisable(EaglerAdapter.GL_ALPHA_TEST);
this.mc.mcProfiler.endStartSection("outline");
var5.drawBlockBreaking(var17, this.mc.objectMouseOver, 0, var17.inventory.getCurrentItem(), par1);
var5.drawSelectionBox(var17, this.mc.objectMouseOver, 0, var17.inventory.getCurrentItem(), par1);
EaglerAdapter.glEnable(EaglerAdapter.GL_ALPHA_TEST);
}
this.mc.mcProfiler.endStartSection("destroyProgress");
EaglerAdapter.glEnable(EaglerAdapter.GL_BLEND);
EaglerAdapter.glBlendFunc(EaglerAdapter.GL_SRC_ALPHA, EaglerAdapter.GL_ONE);
var5.drawBlockDamageTexture(Tessellator.instance, (EntityPlayer) var4, par1);
EaglerAdapter.glDisable(EaglerAdapter.GL_BLEND);
this.mc.mcProfiler.endStartSection("weather");
EaglerAdapter.glDisable(EaglerAdapter.GL_FOG);
if (var4.posY >= 128.0D) {
@ -1198,8 +1165,6 @@ public class EntityRenderer {
}
this.renderRainSnow(par1);
this.mc.mcProfiler.endStartSection("hand");
//EaglerAdapter.glClear(EaglerAdapter.GL_DEPTH_BUFFER_BIT);
@ -1213,10 +1178,8 @@ public class EntityRenderer {
}
}
this.mc.mcProfiler.endStartSection("postprocess");
EaglerAdapter.glColorMask(true, true, true, false);
EffectPipelineFXAA.endPipelineRender();
this.mc.mcProfiler.endSection();
}
/**
@ -1224,7 +1187,6 @@ public class EntityRenderer {
*/
private void renderCloudsCheck(RenderGlobal par1RenderGlobal, float par2) {
if (this.mc.gameSettings.shouldRenderClouds()) {
this.mc.mcProfiler.endStartSection("clouds");
EaglerAdapter.glPushMatrix();
this.setupFog(0, par2);
EaglerAdapter.glEnable(EaglerAdapter.GL_FOG);

View file

@ -34,9 +34,7 @@ public class EntitySenses {
} else if (this.unseenEntities.contains(par1Entity)) {
return false;
} else {
this.entityObj.worldObj.theProfiler.startSection("canSee");
boolean var2 = this.entityObj.canEntityBeSeen(par1Entity);
this.entityObj.worldObj.theProfiler.endSection();
if (var2) {
this.seenEntities.add(par1Entity);

View file

@ -112,15 +112,12 @@ public class GuiIngame extends Gui {
FoodStats var15 = this.mc.thePlayer.getFoodStats();
var16 = var15.getFoodLevel();
var17 = var15.getPrevFoodLevel();
this.mc.mcProfiler.startSection("bossHealth");
this.renderBossHealth();
this.mc.mcProfiler.endSection();
int var19;
if (this.mc.playerController.shouldDrawHUD()) {
var18 = var6 / 2 - 91;
var19 = var6 / 2 + 91;
this.mc.mcProfiler.startSection("expBar");
var20 = this.mc.thePlayer.xpBarCap();
if (var20 > 0) {
@ -143,7 +140,6 @@ public class GuiIngame extends Gui {
var24 = this.updateCounter % 25;
}
this.mc.mcProfiler.endStartSection("healthArmor");
int var25;
int var28;
int var29;
@ -217,8 +213,6 @@ public class GuiIngame extends Gui {
}
}
this.mc.mcProfiler.endStartSection("food");
for (var25 = 0; var25 < 10; ++var25) {
var26 = var47;
var52 = 16;
@ -259,8 +253,6 @@ public class GuiIngame extends Gui {
}
}
this.mc.mcProfiler.endStartSection("air");
if (this.mc.thePlayer.isInsideOfMaterial(Material.water)) {
var25 = this.mc.thePlayer.getAir();
var26 = MathHelper.ceiling_double_int((double) (var25 - 2) * 10.0D / 300.0D);
@ -274,12 +266,9 @@ public class GuiIngame extends Gui {
}
}
}
this.mc.mcProfiler.endSection();
}
EaglerAdapter.glDisable(EaglerAdapter.GL_BLEND);
this.mc.mcProfiler.startSection("actionBar");
EaglerAdapter.glEnable(EaglerAdapter.GL_RESCALE_NORMAL);
RenderHelper.enableGUIStandardItemLighting2();
@ -291,13 +280,11 @@ public class GuiIngame extends Gui {
RenderHelper.disableStandardItemLighting();
EaglerAdapter.glDisable(EaglerAdapter.GL_RESCALE_NORMAL);
this.mc.mcProfiler.endSection();
}
float var33;
if (this.mc.thePlayer.getSleepTimer() > 0) {
this.mc.mcProfiler.startSection("sleep");
EaglerAdapter.glDisable(EaglerAdapter.GL_DEPTH_TEST);
EaglerAdapter.glDisable(EaglerAdapter.GL_ALPHA_TEST);
int var32 = this.mc.thePlayer.getSleepTimer();
@ -311,14 +298,12 @@ public class GuiIngame extends Gui {
drawRect(0, 0, var6, var7, var12);
EaglerAdapter.glEnable(EaglerAdapter.GL_ALPHA_TEST);
EaglerAdapter.glEnable(EaglerAdapter.GL_DEPTH_TEST);
this.mc.mcProfiler.endSection();
}
int var36;
int var40;
if (this.mc.playerController.func_78763_f() && this.mc.thePlayer.experienceLevel > 0) {
this.mc.mcProfiler.startSection("expLevel");
var11 = false;
var12 = var11 ? 16777215 : 8453920;
String var34 = "" + this.mc.thePlayer.experienceLevel;
@ -329,14 +314,11 @@ public class GuiIngame extends Gui {
var8.drawString(var34, var36, var40 + 1, 0);
var8.drawString(var34, var36, var40 - 1, 0);
var8.drawString(var34, var36, var40, var12);
this.mc.mcProfiler.endSection();
}
String var35;
if (this.mc.gameSettings.heldItemTooltips) {
this.mc.mcProfiler.startSection("toolHighlight");
if (this.remainingHighlightTicks > 0 && this.highlightingItemStack != null) {
var35 = this.highlightingItemStack.getDisplayName();
var12 = (var6 - var8.getStringWidth(var35)) / 2;
@ -361,12 +343,9 @@ public class GuiIngame extends Gui {
EaglerAdapter.glPopMatrix();
}
}
this.mc.mcProfiler.endSection();
}
if (this.mc.isDemo()) {
this.mc.mcProfiler.startSection("demo");
var35 = "";
if (this.mc.theWorld.getTotalWorldTime() >= 120500L) {
@ -377,13 +356,11 @@ public class GuiIngame extends Gui {
var12 = var8.getStringWidth(var35);
var8.drawStringWithShadow(var35, var6 - var12 - 10, 5, 16777215);
this.mc.mcProfiler.endSection();
}
this.mc.debug = "" + Minecraft.debugFPS + " fps, " + Minecraft.debugChunkUpdates + " chunk updates";
if (this.mc.gameSettings.showDebugInfo) {
this.mc.mcProfiler.startSection("debug");
EaglerAdapter.glPushMatrix();
var8.drawStringWithShadow("minecraft 1.5.2 (" + this.mc.debug + ")", 2, 2, 16777215);
var8.drawStringWithShadow(this.mc.debugInfoRenders(), 2, 12, 16777215);
@ -450,7 +427,6 @@ public class GuiIngame extends Gui {
var45 = "/glsl/occl.glsl";
this.drawString(var8, var45, var6 - var8.getStringWidth(var45) - 2, offset + 120, 14737632);
EaglerAdapter.glPopMatrix();
this.mc.mcProfiler.endSection();
}else {
EaglerAdapter.glPushMatrix();
EaglerAdapter.glScalef(0.75f, 0.75f, 0.75f);
@ -482,7 +458,6 @@ public class GuiIngame extends Gui {
}
if (this.recordPlayingUpFor > 0) {
this.mc.mcProfiler.startSection("overlayMessage");
var33 = (float) this.recordPlayingUpFor - par1;
var12 = (int) (var33 * 256.0F / 20.0F);
@ -507,8 +482,6 @@ public class GuiIngame extends Gui {
EaglerAdapter.glDisable(EaglerAdapter.GL_BLEND);
EaglerAdapter.glPopMatrix();
}
this.mc.mcProfiler.endSection();
}
ScoreObjective var42 = this.mc.theWorld.getScoreboard().func_96539_a(1);
@ -522,14 +495,11 @@ public class GuiIngame extends Gui {
EaglerAdapter.glDisable(EaglerAdapter.GL_ALPHA_TEST);
EaglerAdapter.glPushMatrix();
EaglerAdapter.glTranslatef(0.0F, (float) (var7 - 48), 0.0F);
this.mc.mcProfiler.startSection("chat");
this.persistantChatGUI.drawChat(this.updateCounter);
this.mc.mcProfiler.endSection();
EaglerAdapter.glPopMatrix();
var42 = this.mc.theWorld.getScoreboard().func_96539_a(0);
if (this.mc.gameSettings.keyBindPlayerList.pressed && (!this.mc.isIntegratedServerRunning() || this.mc.thePlayer.sendQueue.playerInfoList.size() > 1 || var42 != null)) {
this.mc.mcProfiler.startSection("playerList");
NetClientHandler var38 = this.mc.thePlayer.sendQueue;
List var43 = var38.playerInfoList;
var36 = var38.currentServerMaxPlayers;

View file

@ -155,8 +155,9 @@ public class NetClientHandler extends NetHandler {
public void handleLogin(Packet1Login par1Packet1Login) {
this.mc.playerController = new PlayerControllerMP(this.mc, this);
this.worldClient = new WorldClient(this, new WorldSettings(0L, par1Packet1Login.gameType, false, par1Packet1Login.hardcoreMode, par1Packet1Login.terrainType), par1Packet1Login.dimension, par1Packet1Login.difficultySetting,
this.mc.mcProfiler);
this.worldClient = new WorldClient(this, new WorldSettings(0L, par1Packet1Login.gameType, false,
par1Packet1Login.hardcoreMode, par1Packet1Login.terrainType), par1Packet1Login.dimension,
par1Packet1Login.difficultySetting);
this.worldClient.isRemote = true;
this.mc.loadWorld(this.worldClient);
this.mc.thePlayer.dimension = par1Packet1Login.dimension;
@ -720,8 +721,10 @@ public class NetClientHandler extends NetHandler {
if (par1Packet9Respawn.respawnDimension != this.mc.thePlayer.dimension) {
this.doneLoadingTerrain = false;
Scoreboard var2 = this.worldClient.getScoreboard();
this.worldClient = new WorldClient(this, new WorldSettings(0L, par1Packet9Respawn.gameType, false, this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled(), par1Packet9Respawn.terrainType), par1Packet9Respawn.respawnDimension,
par1Packet9Respawn.difficulty, this.mc.mcProfiler);
this.worldClient = new WorldClient(this,
new WorldSettings(0L, par1Packet9Respawn.gameType, false,
this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled(), par1Packet9Respawn.terrainType),
par1Packet9Respawn.respawnDimension, par1Packet9Respawn.difficulty);
this.worldClient.func_96443_a(var2);
this.worldClient.isRemote = true;
this.mc.loadWorld(this.worldClient);

View file

@ -1,153 +0,0 @@
package net.minecraft.src;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
public class Profiler {
/** List of parent sections */
private final List sectionList = new ArrayList();
/** List of timestamps (System.nanoTime) */
private final List timestampList = new ArrayList();
/** Flag profiling enabled */
public boolean profilingEnabled = false;
/** Current profiling section */
private String profilingSection = "";
/** Profiling map */
private final Map profilingMap = new HashMap();
/**
* Clear profiling.
*/
public void clearProfiling() {
this.profilingMap.clear();
this.profilingSection = "";
this.sectionList.clear();
}
/**
* Start section
*/
public void startSection(String par1Str) {
if (this.profilingEnabled) {
if (this.profilingSection.length() > 0) {
this.profilingSection = this.profilingSection + ".";
}
this.profilingSection = this.profilingSection + par1Str;
this.sectionList.add(this.profilingSection);
this.timestampList.add(Long.valueOf(System.nanoTime()));
}
}
/**
* End section
*/
public void endSection() {
if (this.profilingEnabled) {
long var1 = System.nanoTime();
long var3 = ((Long) this.timestampList.remove(this.timestampList.size() - 1)).longValue();
this.sectionList.remove(this.sectionList.size() - 1);
long var5 = var1 - var3;
if (this.profilingMap.containsKey(this.profilingSection)) {
this.profilingMap.put(this.profilingSection, Long.valueOf(((Long) this.profilingMap.get(this.profilingSection)).longValue() + var5));
} else {
this.profilingMap.put(this.profilingSection, Long.valueOf(var5));
}
if (var5 > 100000000L) {
System.out.println("Something\'s taking too long! \'" + this.profilingSection + "\' took aprox " + (double) var5 / 1000000.0D + " ms");
}
this.profilingSection = !this.sectionList.isEmpty() ? (String) this.sectionList.get(this.sectionList.size() - 1) : "";
}
}
/**
* Get profiling data
*/
public List getProfilingData(String par1Str) {
if (!this.profilingEnabled) {
return null;
} else {
long var3 = this.profilingMap.containsKey("root") ? ((Long) this.profilingMap.get("root")).longValue() : 0L;
long var5 = this.profilingMap.containsKey(par1Str) ? ((Long) this.profilingMap.get(par1Str)).longValue() : -1L;
ArrayList var7 = new ArrayList();
if (par1Str.length() > 0) {
par1Str = par1Str + ".";
}
long var8 = 0L;
Iterator var10 = this.profilingMap.keySet().iterator();
while (var10.hasNext()) {
String var11 = (String) var10.next();
if (var11.length() > par1Str.length() && var11.startsWith(par1Str) && var11.indexOf(".", par1Str.length() + 1) < 0) {
var8 += ((Long) this.profilingMap.get(var11)).longValue();
}
}
float var20 = (float) var8;
if (var8 < var5) {
var8 = var5;
}
if (var3 < var8) {
var3 = var8;
}
Iterator var21 = this.profilingMap.keySet().iterator();
String var12;
while (var21.hasNext()) {
var12 = (String) var21.next();
if (var12.length() > par1Str.length() && var12.startsWith(par1Str) && var12.indexOf(".", par1Str.length() + 1) < 0) {
long var13 = ((Long) this.profilingMap.get(var12)).longValue();
double var15 = (double) var13 * 100.0D / (double) var8;
double var17 = (double) var13 * 100.0D / (double) var3;
String var19 = var12.substring(par1Str.length());
var7.add(new ProfilerResult(var19, var15, var17));
}
}
var21 = this.profilingMap.keySet().iterator();
while (var21.hasNext()) {
var12 = (String) var21.next();
this.profilingMap.put(var12, Long.valueOf(((Long) this.profilingMap.get(var12)).longValue() * 999L / 1000L));
}
if ((float) var8 > var20) {
var7.add(new ProfilerResult("unspecified", (double) ((float) var8 - var20) * 100.0D / (double) var8, (double) ((float) var8 - var20) * 100.0D / (double) var3));
}
Collections.sort(var7);
var7.add(0, new ProfilerResult(par1Str, 100.0D, (double) var8 * 100.0D / (double) var3));
return var7;
}
}
/**
* End current section and start a new section
*/
public void endStartSection(String par1Str) {
this.endSection();
this.startSection(par1Str);
}
public String getNameOfLastSection() {
return this.sectionList.size() == 0 ? "[UNKNOWN]" : (String) this.sectionList.get(this.sectionList.size() - 1);
}
}

View file

@ -1,25 +0,0 @@
package net.minecraft.src;
public final class ProfilerResult implements Comparable {
public double field_76332_a;
public double field_76330_b;
public String field_76331_c;
public ProfilerResult(String par1Str, double par2, double par4) {
this.field_76331_c = par1Str;
this.field_76332_a = par2;
this.field_76330_b = par4;
}
public int func_76328_a(ProfilerResult par1ProfilerResult) {
return par1ProfilerResult.field_76332_a < this.field_76332_a ? -1 : (par1ProfilerResult.field_76332_a > this.field_76332_a ? 1 : par1ProfilerResult.field_76331_c.compareTo(this.field_76331_c));
}
public int func_76329_a() {
return (this.field_76331_c.hashCode() & 11184810) + 4473924;
}
public int compareTo(Object par1Obj) {
return this.func_76328_a((ProfilerResult) par1Obj);
}
}

View file

@ -351,7 +351,6 @@ public class RenderGlobal implements IWorldAccess {
if (this.renderEntitiesStartupCounter > 0) {
--this.renderEntitiesStartupCounter;
} else {
this.theWorld.theProfiler.startSection("prepare");
TileEntityRenderer.instance.cacheActiveRenderInfo(this.theWorld, this.renderEngine, this.mc.fontRenderer, this.mc.renderViewEntity, par3);
RenderManager.instance.cacheActiveRenderInfo(this.theWorld, this.renderEngine, this.mc.fontRenderer, this.mc.renderViewEntity, this.mc.pointedEntityLiving, this.mc.gameSettings, par3);
this.countEntitiesTotal = 0;
@ -365,7 +364,6 @@ public class RenderGlobal implements IWorldAccess {
TileEntityRenderer.staticPlayerY = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double) par3;
TileEntityRenderer.staticPlayerZ = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double) par3;
this.mc.entityRenderer.enableLightmap((double) par3);
this.theWorld.theProfiler.endStartSection("global");
List var5 = this.theWorld.getLoadedEntityList();
this.countEntitiesTotal = var5.size();
int var6;
@ -380,8 +378,6 @@ public class RenderGlobal implements IWorldAccess {
}
}
this.theWorld.theProfiler.endStartSection("entities");
for (var6 = 0; var6 < var5.size(); ++var6) {
var7 = (Entity) var5.get(var6);
@ -393,7 +389,6 @@ public class RenderGlobal implements IWorldAccess {
}
}
this.theWorld.theProfiler.endStartSection("tileentities");
RenderHelper.enableStandardItemLighting();
for (var6 = 0; var6 < this.tileEntities.size(); ++var6) {
@ -401,7 +396,6 @@ public class RenderGlobal implements IWorldAccess {
}
this.mc.entityRenderer.disableLightmap((double) par3);
this.theWorld.theProfiler.endSection();
}
}
@ -509,8 +503,6 @@ public class RenderGlobal implements IWorldAccess {
* renderPass, partialTickTime
*/
public int sortAndRender(EntityLiving par1EntityLiving, int par2, double par3) {
this.theWorld.theProfiler.startSection("sortchunks");
for (int var5 = 0; var5 < 10; ++var5) {
this.worldRenderersCheckIndex = (this.worldRenderersCheckIndex + 1) % this.worldRenderers.length;
WorldRenderer var6 = this.worldRenderers[this.worldRenderersCheckIndex];
@ -564,7 +556,6 @@ public class RenderGlobal implements IWorldAccess {
long ct = EaglerAdapter.steadyTimeMillis();
if(par2 == 0) {
this.theWorld.theProfiler.endStartSection("getoccl");
for (int i = 0; i < this.sortedWorldRenderers.length; ++i) {
WorldRenderer c = this.sortedWorldRenderers[i];
int ccx = c.chunkX - fx;
@ -583,7 +574,6 @@ public class RenderGlobal implements IWorldAccess {
}
}
this.theWorld.theProfiler.endStartSection("render");
var34 = var17 + this.renderSortedRenderers(0, this.sortedWorldRenderers.length, par2, par3);
var7 -= par1EntityLiving.getEyeHeight();
@ -612,7 +602,6 @@ public class RenderGlobal implements IWorldAccess {
inFrustumCount = 0;
lastOcclusionQuery = ct;
this.theWorld.theProfiler.endStartSection("occl");
EaglerAdapter.glEnable(EaglerAdapter.GL_CULL_FACE);
EaglerAdapter.glDisable(EaglerAdapter.GL_BLEND);
EaglerAdapter.glColorMask(false, false, false, false);
@ -649,7 +638,6 @@ public class RenderGlobal implements IWorldAccess {
EaglerAdapter.glEnable(EaglerAdapter.GL_CULL_FACE);
}
this.theWorld.theProfiler.endSection();
return var34;
}
@ -1218,7 +1206,6 @@ public class RenderGlobal implements IWorldAccess {
ArrayList var6 = null;
int var7 = this.worldRenderersToUpdate.size();
int var8 = 0;
this.theWorld.theProfiler.startSection("nearChunksSearch");
int var9;
WorldRenderer var10;
int var11;
@ -1243,9 +1230,6 @@ public class RenderGlobal implements IWorldAccess {
this.worldRenderersToUpdate = laterUpdateList;
this.theWorld.theProfiler.endSection();
this.theWorld.theProfiler.startSection("sortAndUpdate");
int updates = 0;
int dropped = 0;
if (var6 != null) {
@ -1270,8 +1254,6 @@ public class RenderGlobal implements IWorldAccess {
}
}
this.theWorld.theProfiler.endSection();
return true;
}

View file

@ -11,8 +11,6 @@ import java.util.Set;
import net.lax1dude.eaglercraft.EaglercraftRandom;
import net.minecraft.client.Minecraft;
public abstract class World implements IBlockAccess {
/**
* boolean; if true updates scheduled by scheduleBlockUpdate happen immediately
@ -85,7 +83,6 @@ public abstract class World implements IBlockAccess {
/** Boolean that is set to true when trying to find a spawn point */
public boolean findingSpawnPoint;
public MapStorage mapStorage;
public final Profiler theProfiler;
/** The world-local pool of vectors */
private final Vec3Pool vecPool = new Vec3Pool(300, 2000);
@ -131,11 +128,10 @@ public abstract class World implements IBlockAccess {
return BiomeGenBase.ocean;
}
public World(String par2Str, WorldProvider par3WorldProvider, WorldSettings par4WorldSettings, Profiler par5Profiler) {
public World(String par2Str, WorldProvider par3WorldProvider, WorldSettings par4WorldSettings) {
this.ambientTickCountdown = this.rand.nextInt(12000);
this.lightUpdateBlockList = new int[32768];
this.isRemote = false;
this.theProfiler = par5Profiler;
this.worldInfo = new WorldInfo(par4WorldSettings, par2Str);
this.provider = par3WorldProvider;
this.mapStorage = new MapStorage();
@ -146,11 +142,10 @@ public abstract class World implements IBlockAccess {
this.calculateInitialWeather();
}
public World(String par2Str, WorldSettings par3WorldSettings, WorldProvider par4WorldProvider, Profiler par5Profiler) {
public World(String par2Str, WorldSettings par3WorldSettings, WorldProvider par4WorldProvider) {
this.ambientTickCountdown = this.rand.nextInt(12000);
this.lightUpdateBlockList = new int[32768];
this.isRemote = false;
this.theProfiler = par5Profiler;
this.mapStorage = new MapStorage();
this.worldInfo = null;
@ -339,9 +334,7 @@ public abstract class World implements IBlockAccess {
}
boolean var9 = var7.setBlockIDWithMetadata(par1 & 15, par2, par3 & 15, par4, par5);
this.theProfiler.startSection("checkLight");
this.updateAllLightTypes(par1, par2, par3);
this.theProfiler.endSection();
if (var9) {
if ((par6 & 2) != 0 && (par6 & 4) == 0) {
@ -1497,8 +1490,6 @@ public abstract class World implements IBlockAccess {
* Updates (and cleans up) entities and tile entities
*/
public void updateEntities() {
this.theProfiler.startSection("entities");
this.theProfiler.startSection("global");
int var1;
Entity var2;
@ -1513,7 +1504,6 @@ public abstract class World implements IBlockAccess {
}
}
this.theProfiler.endStartSection("remove");
this.loadedEntityList.removeAll(this.unloadedEntityList);
int var3;
int var13;
@ -1533,7 +1523,6 @@ public abstract class World implements IBlockAccess {
}
this.unloadedEntityList.clear();
this.theProfiler.endStartSection("regular");
for (var1 = 0; var1 < this.loadedEntityList.size(); ++var1) {
var2 = (Entity) this.loadedEntityList.get(var1);
@ -1547,15 +1536,10 @@ public abstract class World implements IBlockAccess {
var2.ridingEntity = null;
}
this.theProfiler.startSection("tick");
if (!var2.isDead) {
this.updateEntity(var2);
}
this.theProfiler.endSection();
this.theProfiler.startSection("remove");
if (var2.isDead) {
var3 = var2.chunkCoordX;
var13 = var2.chunkCoordZ;
@ -1567,11 +1551,8 @@ public abstract class World implements IBlockAccess {
this.loadedEntityList.remove(var1--);
this.releaseEntitySkin(var2);
}
this.theProfiler.endSection();
}
this.theProfiler.endStartSection("tileEntities");
this.scanningTileEntities = true;
Iterator var14 = this.loadedTileEntityList.iterator();
@ -1602,8 +1583,6 @@ public abstract class World implements IBlockAccess {
this.entityRemoval.clear();
}
this.theProfiler.endStartSection("pendingTileEntities");
if (!this.addedTileEntityList.isEmpty()) {
for (int var10 = 0; var10 < this.addedTileEntityList.size(); ++var10) {
TileEntity var12 = (TileEntity) this.addedTileEntityList.get(var10);
@ -1627,9 +1606,6 @@ public abstract class World implements IBlockAccess {
this.addedTileEntityList.clear();
}
this.theProfiler.endSection();
this.theProfiler.endSection();
}
public void addTileEntity(Collection par1Collection) {
@ -1673,8 +1649,6 @@ public abstract class World implements IBlockAccess {
}
}
this.theProfiler.startSection("chunkCheck");
if (Double.isNaN(par1Entity.posX) || Double.isInfinite(par1Entity.posX)) {
par1Entity.posX = par1Entity.lastTickPosX;
}
@ -1712,8 +1686,6 @@ public abstract class World implements IBlockAccess {
}
}
this.theProfiler.endSection();
if (par2 && par1Entity.addedToChunk && par1Entity.riddenByEntity != null) {
if (!par1Entity.riddenByEntity.isDead && par1Entity.riddenByEntity.ridingEntity == par1Entity) {
this.updateEntity(par1Entity.riddenByEntity);
@ -2361,7 +2333,6 @@ public abstract class World implements IBlockAccess {
protected void setActivePlayerChunksAndCheckLight() {
this.activeChunkSet.clear();
this.theProfiler.startSection("buildList");
int var1;
EntityPlayer var2;
int var3;
@ -2380,14 +2351,10 @@ public abstract class World implements IBlockAccess {
}
}
this.theProfiler.endSection();
if (this.ambientTickCountdown > 0) {
--this.ambientTickCountdown;
}
this.theProfiler.startSection("playerCheckLight");
if (!this.playerEntities.isEmpty()) {
var1 = this.rand.nextInt(this.playerEntities.size());
var2 = (EntityPlayer) this.playerEntities.get(var1);
@ -2396,13 +2363,9 @@ public abstract class World implements IBlockAccess {
int var8 = MathHelper.floor_double(var2.posZ) + this.rand.nextInt(11) - 5;
this.updateAllLightTypes(var3, var4, var8);
}
this.theProfiler.endSection();
}
protected void moodSoundAndLightCheck(int par1, int par2, Chunk par3Chunk) {
this.theProfiler.endStartSection("moodSound");
Minecraft mc = Minecraft.getMinecraft();
if (this.ambientTickCountdown == 0 && mc.entityRenderer.startup > 0) {
this.updateLCG = this.updateLCG * 3 + 1013904223;
@ -2432,7 +2395,6 @@ public abstract class World implements IBlockAccess {
}
}
this.theProfiler.endStartSection("checkLight");
par3Chunk.enqueueRelightChecks();
}
@ -2583,7 +2545,6 @@ public abstract class World implements IBlockAccess {
if (this.doChunksNearChunkExist(par2, par3, par4, 17)) {
int var5 = 0;
int var6 = 0;
this.theProfiler.startSection("getBrightness");
int var7 = this.getSavedLightValue(par1EnumSkyBlock, par2, par3, par4);
int var8 = this.computeLightValue(par2, par3, par4, par1EnumSkyBlock);
int var9;
@ -2637,9 +2598,6 @@ public abstract class World implements IBlockAccess {
var5 = 0;
}
this.theProfiler.endSection();
this.theProfiler.startSection("checkedPosition < toCheckCount");
while (var5 < var6) {
var9 = this.lightUpdateBlockList[var5++];
var10 = (var9 & 63) - 32 + par2;
@ -2685,8 +2643,6 @@ public abstract class World implements IBlockAccess {
}
}
}
this.theProfiler.endSection();
}
}
@ -2860,7 +2816,6 @@ public abstract class World implements IBlockAccess {
}
public PathEntity getPathEntityToEntity(Entity par1Entity, Entity par2Entity, float par3, boolean par4, boolean par5, boolean par6, boolean par7) {
this.theProfiler.startSection("pathfind");
int var8 = MathHelper.floor_double(par1Entity.posX);
int var9 = MathHelper.floor_double(par1Entity.posY + 1.0D);
int var10 = MathHelper.floor_double(par1Entity.posZ);
@ -2873,12 +2828,10 @@ public abstract class World implements IBlockAccess {
int var17 = var10 + var11;
ChunkCache var18 = new ChunkCache(this, var12, var13, var14, var15, var16, var17, 0);
PathEntity var19 = (new PathFinder(var18, par4, par5, par6, par7)).createEntityPathTo(par1Entity, par2Entity, par3);
this.theProfiler.endSection();
return var19;
}
public PathEntity getEntityPathToXYZ(Entity par1Entity, int par2, int par3, int par4, float par5, boolean par6, boolean par7, boolean par8, boolean par9) {
this.theProfiler.startSection("pathfind");
int var10 = MathHelper.floor_double(par1Entity.posX);
int var11 = MathHelper.floor_double(par1Entity.posY);
int var12 = MathHelper.floor_double(par1Entity.posZ);
@ -2891,7 +2844,6 @@ public abstract class World implements IBlockAccess {
int var19 = var12 + var13;
ChunkCache var20 = new ChunkCache(this, var14, var15, var16, var17, var18, var19, 0);
PathEntity var21 = (new PathFinder(var20, par6, par7, par8, par9)).createEntityPathTo(par1Entity, par2, par3, par4, par5);
this.theProfiler.endSection();
return var21;
}

View file

@ -33,8 +33,8 @@ public class WorldClient extends World {
private final Set previousActiveChunkSet = new HashSet();
public int ghostEntityId = Integer.MAX_VALUE;
public WorldClient(NetClientHandler par1NetClientHandler, WorldSettings par2WorldSettings, int par3, int par4, Profiler par5Profiler) {
super("MpServer", WorldProvider.getProviderForDimension(par3), par2WorldSettings, par5Profiler);
public WorldClient(NetClientHandler par1NetClientHandler, WorldSettings par2WorldSettings, int par3, int par4) {
super("MpServer", WorldProvider.getProviderForDimension(par3), par2WorldSettings);
this.sendQueue = par1NetClientHandler;
this.difficultySetting = par4;
this.setSpawnLocation(8, 64, 8);
@ -48,7 +48,6 @@ public class WorldClient extends World {
super.tick();
this.func_82738_a(this.getTotalWorldTime() + 1L);
this.setWorldTime(this.getWorldTime() + 1L);
this.theProfiler.startSection("reEntryProcessing");
for (int var1 = 0; var1 < 10 && !this.entitySpawnQueue.isEmpty(); ++var1) {
Entity var2 = (Entity) this.entitySpawnQueue.iterator().next();
@ -59,13 +58,9 @@ public class WorldClient extends World {
}
}
this.theProfiler.endStartSection("connection");
this.sendQueue.processReadPackets();
this.theProfiler.endStartSection("chunkCache");
this.clientChunkProvider.unloadQueuedChunks();
this.theProfiler.endStartSection("tiles");
this.tickBlocksAndAmbiance();
this.theProfiler.endSection();
}
/**
@ -106,10 +101,8 @@ public class WorldClient extends World {
if (!this.previousActiveChunkSet.contains(var3)) {
int var4 = var3.chunkXPos * 16;
int var5 = var3.chunkZPos * 16;
this.theProfiler.startSection("getChunk");
Chunk var6 = this.getChunkFromChunkCoords(var3.chunkXPos, var3.chunkZPos);
this.moodSoundAndLightCheck(var4, var5, var6);
this.theProfiler.endSection();
this.previousActiveChunkSet.add(var3);
++var1;

View file

@ -6,7 +6,6 @@ import java.util.List;
import net.lax1dude.eaglercraft.EaglerAdapter;
import net.lax1dude.eaglercraft.adapter.Tessellator;
import net.minecraft.client.Minecraft;
public class WorldRenderer {
/** Reference to the World object. */
@ -149,7 +148,6 @@ public class WorldRenderer {
this.tileEntityRenderers.clear();
byte var8 = 1;
ChunkCache var9 = new ChunkCache(this.worldObj, var1 - var8, var2 - var8, var3 - var8, var4 + var8, var5 + var8, var6 + var8, var8);
Profiler p = Minecraft.getMinecraft().mcProfiler;
if (!var9.extendedLevelsInChunkCache()) {
EaglerAdapter.hintAnisotropicFix(true);
++chunksUpdated;
@ -157,7 +155,6 @@ public class WorldRenderer {
this.bytesDrawn = 0;
for (int var11 = 0; var11 < 2; ++var11) {
p.startSection("rebuild");
boolean var12 = false;
boolean var13 = false;
boolean var14 = false;
@ -206,7 +203,6 @@ public class WorldRenderer {
}
if (var14) {
p.endStartSection("upload");
this.bytesDrawn += tessellator.draw();
//EaglerAdapter.glPopMatrix();
EaglerAdapter.glEndList();
@ -214,7 +210,6 @@ public class WorldRenderer {
} else {
var13 = false;
}
p.endSection();
if (var13) {
this.skipRenderPass[var11] = false;