mirror of
https://git.zelz.net/catfoolyou/Project164.git
synced 2025-12-14 08:57:42 +00:00
Add mp-server
This commit is contained in:
@@ -550,7 +550,7 @@ public abstract class MinecraftServer implements ICommandSender, Runnable, IPlay
|
||||
if (this.startProfiling)
|
||||
{
|
||||
this.startProfiling = false;
|
||||
this.theProfiler.profilingEnabled = true;
|
||||
this.theProfiler.profilingEnabled = false;
|
||||
this.theProfiler.clearProfiling();
|
||||
}
|
||||
|
||||
|
||||
@@ -727,195 +727,6 @@ public class Minecraft
|
||||
return this.currentScreen != null && this.currentScreen instanceof GuiMainMenu ? 2 : this.gameSettings.limitFramerate;
|
||||
}
|
||||
|
||||
public void freeMemory()
|
||||
{
|
||||
try
|
||||
{
|
||||
memoryReserve = new byte[0];
|
||||
this.renderGlobal.deleteAllDisplayLists();
|
||||
}
|
||||
catch (Throwable var4)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
System.gc();
|
||||
AxisAlignedBB.getAABBPool().clearPool();
|
||||
this.theWorld.getWorldVec3Pool().clearAndFreeCache();
|
||||
}
|
||||
catch (Throwable var3)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
System.gc();
|
||||
this.loadWorld((WorldClient)null);
|
||||
}
|
||||
catch (Throwable var2)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
System.gc();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
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;
|
||||
|
||||
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(6);
|
||||
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(5);
|
||||
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.
|
||||
*/
|
||||
|
||||
@@ -39,17 +39,7 @@ public class Profiler
|
||||
*/
|
||||
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()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,29 +47,7 @@ public class Profiler
|
||||
*/
|
||||
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) : "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -87,80 +55,7 @@ public class Profiler
|
||||
*/
|
||||
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;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -168,12 +63,5 @@ public class Profiler
|
||||
*/
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3538,7 +3538,7 @@ public class RenderBlocks
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility function to draw crossed swuares
|
||||
* Utility function to draw crossed squares
|
||||
*/
|
||||
public void drawCrossedSquares(Block par1Block, int par2, double par3, double par5, double par7, float par9)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user