Misc shit

This commit is contained in:
catfoolyou 2025-02-04 12:18:20 -05:00
parent 5bb9a396f1
commit d90a17eb7a
37 changed files with 240 additions and 2389 deletions

Binary file not shown.

Binary file not shown.

View File

@ -42,9 +42,9 @@ public class DefaultSkinRenderer {
new TextureLocation("/skins/17.dev_steve.png"),
new TextureLocation("/skins/18.dev_alex.png"),
new TextureLocation("/skins/19.herobrine.png"),
new TextureLocation("/mob/enderman.png"),
new TextureLocation("/mob/skeleton.png"),
new TextureLocation("/mob/fire.png"),
new TextureLocation("/textures/entity/enderman/enderman.png"),
new TextureLocation("/textures/entity/skeleton/skeleton.png"),
new TextureLocation("/textures/entity/blaze.png"),
new TextureLocation("/skins/20.barney.png"),
new TextureLocation("/skins/21.slime.png"),
new TextureLocation("/skins/22.noob.png"),
@ -55,7 +55,7 @@ public class DefaultSkinRenderer {
new TextureLocation("/skins/27.pig.png"),
new TextureLocation("/skins/28.squid.png"),
new TextureLocation("/skins/29.mooshroom.png"),
new TextureLocation("/mob/villager/villager.png"),
new TextureLocation("/textures/entity/villager/villager.png"),
null, null, null, null, null
};
@ -83,15 +83,6 @@ public class DefaultSkinRenderer {
new TextureLocation("/skins/c20.db.png")
};
public static final HighPolySkin[] defaultHighPoly = new HighPolySkin[] {
null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null,
null, null, null,
HighPolySkin.LONG_ARMS, HighPolySkin.WEIRD_CLIMBER_DUDE, HighPolySkin.LAXATIVE_DUDE,
HighPolySkin.BABY_CHARLES, HighPolySkin.BABY_WINSTON
};
public static final boolean[] defaultVanillaSkinClassicOrSlimVariants = new boolean[] {
false, true,
false, true,
@ -182,12 +173,7 @@ public class DefaultSkinRenderer {
if(loc != null) {
loc.bindTexture();
}else {
if(defaultHighPoly[type2] != null) {
defaultHighPoly[type2].fallbackTexture.bindTexture();
return true;
}else {
return false;
}
return false;
}
}
}
@ -366,7 +352,7 @@ public class DefaultSkinRenderer {
}
public static boolean isHighPoly(int id) {
return !(defaultVanillaSkins.length > id && id >= 0) ? false : defaultHighPoly[id] != null;
return false;
}
public static boolean isPlayerNewSkin(EntityPlayer p) {
@ -489,16 +475,12 @@ public class DefaultSkinRenderer {
id2 -= 0x10000;
}
int id = id2 - EaglerProfile.skins.size();
boolean highPoly = isHighPoly(id);
boolean highPoly = false;
EaglerAdapter.glEnable(EaglerAdapter.GL_TEXTURE_2D);
EaglerAdapter.glDisable(EaglerAdapter.GL_BLEND);
if(highPoly) {
EaglerAdapter.glEnable(EaglerAdapter.GL_CULL_FACE);
}else {
EaglerAdapter.glDisable(EaglerAdapter.GL_CULL_FACE);
}
EaglerAdapter.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
EaglerAdapter.glDisable(EaglerAdapter.GL_CULL_FACE);
EaglerAdapter.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
EaglerAdapter.glPushMatrix();
EaglerAdapter.glTranslatef((float) x, (float) (y - 80), 100.0F);
EaglerAdapter.glScalef(50.0f, 50.0f, 50.0f);
@ -516,157 +498,108 @@ public class DefaultSkinRenderer {
}
EaglerAdapter.glRotatef(((x - mx) * 0.06f), 0.0f, 1.0f, 0.0f);
EaglerAdapter.glTranslatef(0.0F, -1.0F, 0.0F);
if(highPoly) {
EaglerAdapter.flipLightMatrix();
EaglerAdapter.glPushMatrix();
EaglerAdapter.glRotatef(180.0f, 0.0f, 0.0f, 1.0f);
EaglerAdapter.glTranslatef(0.0f, -1.5f, 0.0f);
EaglerAdapter.glScalef(HighPolySkin.highPolyScale, HighPolySkin.highPolyScale, HighPolySkin.highPolyScale);
HighPolySkin msh = defaultHighPoly[id];
msh.texture.bindTexture();
if(msh.bodyModel != null) {
EaglerAdapter.drawHighPoly(msh.bodyModel.getModel());
}
if(msh.headModel != null) {
EaglerAdapter.drawHighPoly(msh.headModel.getModel());
}
if(msh.limbsModel != null && msh.limbsModel.length > 0) {
for(int i = 0; i < msh.limbsModel.length; ++i) {
float offset = 0.0f;
if(msh.limbsOffset != null) {
if(msh.limbsOffset.length == 1) {
offset = msh.limbsOffset[0];
}else {
offset = msh.limbsOffset[i];
}
}
if(offset != 0.0f || msh.limbsInitialRotation != 0.0f) {
EaglerAdapter.glPushMatrix();
if(offset != 0.0f) {
EaglerAdapter.glTranslatef(0.0f, offset, 0.0f);
}
if(msh.limbsInitialRotation != 0.0f) {
EaglerAdapter.glRotatef(msh.limbsInitialRotation, 1.0f, 0.0f, 0.0f);
}
}
EaglerAdapter.drawHighPoly(msh.limbsModel[i].getModel());
if(offset != 0.0f || msh.limbsInitialRotation != 0.0f) {
EaglerAdapter.glPopMatrix();
}
}
}
EaglerAdapter.glPopMatrix();
EaglerAdapter.flipLightMatrix();
}else {
if(id < 0) {
Minecraft.getMinecraft().renderEngine.bindTexture(EaglerProfile.skins.get(id2).glTex);
}else {
defaultVanillaSkins[id].bindTexture();
}
boolean gonnaShowCape = false;
if(isStandardModel(id) || id < 0) {
if(oldSkinRenderer == null) oldSkinRenderer = new ModelBiped(0.0F, 0.0F, 64, 32);
if(newSkinRenderer == null) newSkinRenderer = new ModelBipedNewSkins(0.0F, false);
if(newSkinRendererSlim == null) newSkinRendererSlim = new ModelBipedNewSkins(0.0F, true);
oldSkinRenderer.isChild = false;
newSkinRenderer.isChild = false;
newSkinRendererSlim.isChild = false;
boolean isNew = isNewSkin(id);
if(id < 0) {
int type = EaglerProfile.getSkinSize(EaglerProfile.skins.get(id2).data.length);
isNew = (type == 1 || type == 3);
}
if(isNew) {
if((id < 0 && EaglerProfile.skins.get(id2).slim) || (id >= 0 && isAlexSkin(id))) {
newSkinRendererSlim.blockTransparentSkin = true;
newSkinRendererSlim.render(null, 0.0f, 0.0f, (float)(EaglerAdapter.steadyTimeMillis() % 100000) / 50f, ((x - mx) * 0.06f), ((y - my) * -0.1f), 0.0625F);
newSkinRendererSlim.blockTransparentSkin = false;
}else {
newSkinRenderer.blockTransparentSkin = true;
newSkinRenderer.render(null, 0.0f, 0.0f, (float)(EaglerAdapter.steadyTimeMillis() % 100000) / 50f, ((x - mx) * 0.06f), ((y - my) * -0.1f), 0.0625F);
newSkinRenderer.blockTransparentSkin = false;
}
}else {
oldSkinRenderer.blockTransparentSkin = true;
oldSkinRenderer.render(null, 0.0f, 0.0f, (float)(EaglerAdapter.steadyTimeMillis() % 100000) / 50f, ((x - mx) * 0.06f), ((y - my) * -0.1f), 0.0625F);
oldSkinRenderer.blockTransparentSkin = false;
}
gonnaShowCape = capeMode;
}else if(isZombieModel(id)) {
if(zombieRenderer == null) zombieRenderer = new ModelZombie(0.0F, true);
zombieRenderer.isChild = false;
zombieRenderer.render(null, 0.0f, 0.0f, (float)(EaglerAdapter.steadyTimeMillis() % 100000) / 50f, ((x - mx) * 0.06f), ((y - my) * -0.1f), 0.0625F);
gonnaShowCape = capeMode;
}else if(id == 32) {
if(villagerRenderer == null) villagerRenderer = new ModelVillager(0.0F);
villagerRenderer.isChild = false;
villagerRenderer.render(null, 0.0f, 0.0f, (float)(EaglerAdapter.steadyTimeMillis() % 100000) / 50f, ((x - mx) * 0.06f), ((y - my) * -0.1f), 0.0625F);
}else if(id == 19) {
if(endermanRenderer == null) endermanRenderer = new ModelEnderman();
endermanRenderer.isChild = false;
endermanRenderer.render(null, 0.0f, 0.0f, (float)(EaglerAdapter.steadyTimeMillis() % 100000) / 50f, ((x - mx) * 0.06f), ((y - my) * -0.1f), 0.0625F);
EaglerAdapter.glColor4f(1.4f, 1.4f, 1.4f, 1.0f);
//EaglerAdapter.glEnable(EaglerAdapter.GL_BLEND);
//EaglerAdapter.glDisable(EaglerAdapter.GL_ALPHA_TEST);
//EaglerAdapter.glBlendFunc(EaglerAdapter.GL_ONE, EaglerAdapter.GL_ONE);
EaglerAdapter.glDisable(EaglerAdapter.GL_LIGHTING);
EaglerAdapter.glEnable(EaglerAdapter.GL_TEXTURE_2D);
EaglerAdapter.glDisable(EaglerAdapter.GL_DEPTH_TEST);
RenderEnderman.tex_eyes.bindTexture();
endermanRenderer.render(null, 0.0f, 0.0f, (float)(EaglerAdapter.steadyTimeMillis() % 100000) / 50f, ((x - mx) * 0.06f), ((y - my) * -0.1f), 0.0625F);
EaglerAdapter.glBlendFunc(EaglerAdapter.GL_SRC_ALPHA, EaglerAdapter.GL_ONE_MINUS_SRC_ALPHA);
EaglerAdapter.glEnable(EaglerAdapter.GL_ALPHA_TEST);
EaglerAdapter.glEnable(EaglerAdapter.GL_DEPTH_TEST);
EaglerAdapter.glDisable(EaglerAdapter.GL_TEXTURE_2D);
EaglerAdapter.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
}else if(id == 20) {
if(skeletonRenderer == null) skeletonRenderer = new ModelSkeleton(0.0F);
skeletonRenderer.isChild = false;
skeletonRenderer.render(null, 0.0f, 0.0f, (float)(EaglerAdapter.steadyTimeMillis() % 100000) / 50f, ((x - mx) * 0.06f), ((y - my) * -0.1f), 0.0625F);
}else if(id == 21) {
if(blazeRenderer == null) blazeRenderer = new ModelBlaze();
blazeRenderer.isChild = false;
EaglerAdapter.glColor4f(1.5f, 1.5f, 1.5f, 1.0f);
blazeRenderer.render(null, 0.0f, 0.0f, (float)(EaglerAdapter.steadyTimeMillis() % 100000) / 50f, ((x - mx) * 0.06f), ((y - my) * -0.1f), 0.0625F);
}
if(gonnaShowCape && !(EaglerProfile.presetCapeId >= 0 && defaultVanillaCapes[EaglerProfile.presetCapeId] == null)) {
EaglerAdapter.glPushMatrix();
EaglerAdapter.glTranslatef(0.0F, 0.0F, 0.150F);
EaglerAdapter.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
EaglerAdapter.glRotatef(-6.0F, 1.0F, 0.0F, 0.0F);
if(EaglerProfile.presetCapeId < 0) {
Minecraft.getMinecraft().renderEngine.bindTexture(EaglerProfile.capes.get(EaglerProfile.customCapeId).glTex);
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_TEXTURE);
EaglerAdapter.glPushMatrix();
EaglerAdapter.glScalef(2.0f, 1.0f, 1.0f);
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_MODELVIEW);
}else {
defaultVanillaCapes[EaglerProfile.presetCapeId].bindTexture();
}
if (id < 0) {
Minecraft.getMinecraft().renderEngine.bindTexture(EaglerProfile.skins.get(id2).glTex);
} else {
defaultVanillaSkins[id].bindTexture();
}
if(oldSkinRenderer == null) oldSkinRenderer = new ModelBiped(0.0F, 0.0F, 64, 32);
oldSkinRenderer.bipedCloak.render(0.0625F);
if(EaglerProfile.presetCapeId < 0) {
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_TEXTURE);
EaglerAdapter.glPopMatrix();
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_MODELVIEW);
}
EaglerAdapter.glPopMatrix();
}
}
EaglerAdapter.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
boolean gonnaShowCape = false;
if(isStandardModel(id) || id < 0) {
if(oldSkinRenderer == null) oldSkinRenderer = new ModelBiped(0.0F, 0.0F, 64, 32);
if(newSkinRenderer == null) newSkinRenderer = new ModelBipedNewSkins(0.0F, false);
if(newSkinRendererSlim == null) newSkinRendererSlim = new ModelBipedNewSkins(0.0F, true);
oldSkinRenderer.isChild = false;
newSkinRenderer.isChild = false;
newSkinRendererSlim.isChild = false;
boolean isNew = isNewSkin(id);
if(id < 0) {
int type = EaglerProfile.getSkinSize(EaglerProfile.skins.get(id2).data.length);
isNew = (type == 1 || type == 3);
}
if(isNew) {
if((id < 0 && EaglerProfile.skins.get(id2).slim) || (id >= 0 && isAlexSkin(id))) {
newSkinRendererSlim.blockTransparentSkin = true;
newSkinRendererSlim.render(null, 0.0f, 0.0f, (float)(EaglerAdapter.steadyTimeMillis() % 100000) / 50f, ((x - mx) * 0.06f), ((y - my) * -0.1f), 0.0625F);
newSkinRendererSlim.blockTransparentSkin = false;
}else {
newSkinRenderer.blockTransparentSkin = true;
newSkinRenderer.render(null, 0.0f, 0.0f, (float)(EaglerAdapter.steadyTimeMillis() % 100000) / 50f, ((x - mx) * 0.06f), ((y - my) * -0.1f), 0.0625F);
newSkinRenderer.blockTransparentSkin = false;
}
}else {
oldSkinRenderer.blockTransparentSkin = true;
oldSkinRenderer.render(null, 0.0f, 0.0f, (float)(EaglerAdapter.steadyTimeMillis() % 100000) / 50f, ((x - mx) * 0.06f), ((y - my) * -0.1f), 0.0625F);
oldSkinRenderer.blockTransparentSkin = false;
}
gonnaShowCape = capeMode;
}else if(isZombieModel(id)) {
if(zombieRenderer == null) zombieRenderer = new ModelZombie(0.0F, true);
zombieRenderer.isChild = false;
zombieRenderer.render(null, 0.0f, 0.0f, (float)(EaglerAdapter.steadyTimeMillis() % 100000) / 50f, ((x - mx) * 0.06f), ((y - my) * -0.1f), 0.0625F);
gonnaShowCape = capeMode;
}else if(id == 32) {
if(villagerRenderer == null) villagerRenderer = new ModelVillager(0.0F);
villagerRenderer.isChild = false;
villagerRenderer.render(null, 0.0f, 0.0f, (float)(EaglerAdapter.steadyTimeMillis() % 100000) / 50f, ((x - mx) * 0.06f), ((y - my) * -0.1f), 0.0625F);
}else if(id == 19) {
if(endermanRenderer == null) endermanRenderer = new ModelEnderman();
endermanRenderer.isChild = false;
endermanRenderer.render(null, 0.0f, 0.0f, (float)(EaglerAdapter.steadyTimeMillis() % 100000) / 50f, ((x - mx) * 0.06f), ((y - my) * -0.1f), 0.0625F);
EaglerAdapter.glColor4f(1.4f, 1.4f, 1.4f, 1.0f);
//EaglerAdapter.glEnable(EaglerAdapter.GL_BLEND);
//EaglerAdapter.glDisable(EaglerAdapter.GL_ALPHA_TEST);
//EaglerAdapter.glBlendFunc(EaglerAdapter.GL_ONE, EaglerAdapter.GL_ONE);
EaglerAdapter.glDisable(EaglerAdapter.GL_LIGHTING);
EaglerAdapter.glEnable(EaglerAdapter.GL_TEXTURE_2D);
EaglerAdapter.glDisable(EaglerAdapter.GL_DEPTH_TEST);
RenderEnderman.tex_eyes.bindTexture();
endermanRenderer.render(null, 0.0f, 0.0f, (float)(EaglerAdapter.steadyTimeMillis() % 100000) / 50f, ((x - mx) * 0.06f), ((y - my) * -0.1f), 0.0625F);
EaglerAdapter.glBlendFunc(EaglerAdapter.GL_SRC_ALPHA, EaglerAdapter.GL_ONE_MINUS_SRC_ALPHA);
EaglerAdapter.glEnable(EaglerAdapter.GL_ALPHA_TEST);
EaglerAdapter.glEnable(EaglerAdapter.GL_DEPTH_TEST);
EaglerAdapter.glDisable(EaglerAdapter.GL_TEXTURE_2D);
EaglerAdapter.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
}else if(id == 20) {
if(skeletonRenderer == null) skeletonRenderer = new ModelSkeleton(0.0F);
skeletonRenderer.isChild = false;
skeletonRenderer.render(null, 0.0f, 0.0f, (float)(EaglerAdapter.steadyTimeMillis() % 100000) / 50f, ((x - mx) * 0.06f), ((y - my) * -0.1f), 0.0625F);
}else if(id == 21) {
if(blazeRenderer == null) blazeRenderer = new ModelBlaze();
blazeRenderer.isChild = false;
EaglerAdapter.glColor4f(1.5f, 1.5f, 1.5f, 1.0f);
blazeRenderer.render(null, 0.0f, 0.0f, (float)(EaglerAdapter.steadyTimeMillis() % 100000) / 50f, ((x - mx) * 0.06f), ((y - my) * -0.1f), 0.0625F);
}
if(gonnaShowCape && !(EaglerProfile.presetCapeId >= 0 && defaultVanillaCapes[EaglerProfile.presetCapeId] == null)) {
EaglerAdapter.glPushMatrix();
EaglerAdapter.glTranslatef(0.0F, 0.0F, 0.150F);
EaglerAdapter.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
EaglerAdapter.glRotatef(-6.0F, 1.0F, 0.0F, 0.0F);
if(EaglerProfile.presetCapeId < 0) {
Minecraft.getMinecraft().renderEngine.bindTexture(EaglerProfile.capes.get(EaglerProfile.customCapeId).glTex);
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_TEXTURE);
EaglerAdapter.glPushMatrix();
EaglerAdapter.glScalef(2.0f, 1.0f, 1.0f);
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_MODELVIEW);
}else {
defaultVanillaCapes[EaglerProfile.presetCapeId].bindTexture();
}
if(oldSkinRenderer == null) oldSkinRenderer = new ModelBiped(0.0F, 0.0F, 64, 32);
oldSkinRenderer.bipedCloak.render(0.0625F);
if(EaglerProfile.presetCapeId < 0) {
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_TEXTURE);
EaglerAdapter.glPopMatrix();
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_MODELVIEW);
}
EaglerAdapter.glPopMatrix();
}
EaglerAdapter.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
EaglerAdapter.glPopMatrix();
EaglerAdapter.glDisable(EaglerAdapter.GL_RESCALE_NORMAL);

View File

@ -61,12 +61,7 @@ public class GuiScreenEditProfile extends GuiScreen {
"Pig",
"Squid",
"Mooshroom",
"Villager",
"Long Arms",
"Weird Climber",
"Laxative Dude",
"Baby Charles",
"Baby Winston"
"Villager"
};
public static final int newDefaultNotice = defaultOptions.length - 5;

View File

@ -1,96 +0,0 @@
package net.lax1dude.eaglercraft;
public enum HighPolySkin {
LONG_ARMS(
new TextureLocation("/mesh/longarms.png"),
new ModelLocation("/mesh/longarms0.mdl"),
null,
new ModelLocation("/mesh/longarms2.mdl"),
new ModelLocation[] {
new ModelLocation("/mesh/longarms1.mdl")
},
new float[] {
1.325f
},
0.0f,
new TextureLocation("/mesh/longarms.fallback.png")
),
WEIRD_CLIMBER_DUDE(
new TextureLocation("/mesh/weirdclimber.png"),
new ModelLocation("/mesh/weirdclimber0.mdl"),
null,
new ModelLocation("/mesh/weirdclimber2.mdl"),
new ModelLocation[] {
new ModelLocation("/mesh/weirdclimber1.mdl")
},
new float[] {
2.62f
},
-90.0f,
new TextureLocation("/mesh/weirdclimber.fallback.png")
),
LAXATIVE_DUDE(
new TextureLocation("/mesh/laxativedude.png"),
new ModelLocation("/mesh/laxativedude0.mdl"),
null,
new ModelLocation("/mesh/laxativedude3.mdl"),
new ModelLocation[] {
new ModelLocation("/mesh/laxativedude1.mdl"),
new ModelLocation("/mesh/laxativedude2.mdl")
},
new float[] {
2.04f
},
0.0f,
new TextureLocation("/mesh/laxativedude.fallback.png")
),
BABY_CHARLES(
new TextureLocation("/mesh/charles.png"),
new ModelLocation("/mesh/charles0.mdl"),
new ModelLocation("/mesh/charles1.mdl"),
new ModelLocation("/mesh/charles2.mdl"),
new ModelLocation[] {},
new float[] {},
0.0f,
new TextureLocation("/mesh/charles.fallback.png")
),
BABY_WINSTON(
new TextureLocation("/mesh/winston.png"),
new ModelLocation("/mesh/winston0.mdl"),
null,
new ModelLocation("/mesh/winston1.mdl"),
new ModelLocation[] {},
new float[] {},
0.0f,
new TextureLocation("/mesh/winston.fallback.png")
);
public static float highPolyScale = 0.5f;
public final TextureLocation texture;
public final ModelLocation bodyModel;
public final ModelLocation headModel;
public final ModelLocation eyesModel;
public final ModelLocation[] limbsModel;
public final float[] limbsOffset;
public final float limbsInitialRotation;
public final TextureLocation fallbackTexture;
HighPolySkin(TextureLocation texture, ModelLocation bodyModel, ModelLocation headModel, ModelLocation eyesModel,
ModelLocation[] limbsModel, float[] limbsOffset, float limbsInitialRotation, TextureLocation fallbackTexture) {
this.texture = texture;
this.bodyModel = bodyModel;
this.headModel = headModel;
this.eyesModel = eyesModel;
this.limbsModel = limbsModel;
this.limbsOffset = limbsOffset;
this.limbsInitialRotation = limbsInitialRotation;
this.fallbackTexture = fallbackTexture;
}
}

View File

@ -86,11 +86,11 @@ public class ModelBipedNewSkins extends ModelBiped {
*/
public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) {
super.render(p_78088_1_, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_);
//EaglerAdapter.glPushMatrix();
EaglerAdapter.glPushMatrix();
//if (p_78088_1_ != null && p_78088_1_.isSneaking()) {
// EaglerAdapter.glTranslatef(0.0F, 0.2F, 0.0F);
//}
if (p_78088_1_ != null && p_78088_1_.isSneaking()) {
EaglerAdapter.glTranslatef(0.0F, 0.2F, 0.0F);
}
this.field_178733_c.render(p_78088_7_);
this.field_178731_d.render(p_78088_7_);
@ -98,7 +98,7 @@ public class ModelBipedNewSkins extends ModelBiped {
this.field_178732_b.render(p_78088_7_);
this.field_178730_v.render(p_78088_7_);
//EaglerAdapter.glPopMatrix();
EaglerAdapter.glPopMatrix();
}
public void func_178727_b(float p_178727_1_) {

View File

@ -1,38 +0,0 @@
package net.minecraft.src;
import java.util.concurrent.Callable;
import net.minecraft.client.ClientBrandRetriever;
class CallableIsModded implements Callable
{
/** Reference to the IntegratedServer object. */
final IntegratedServer theIntegratedServer;
CallableIsModded(IntegratedServer par1IntegratedServer)
{
this.theIntegratedServer = par1IntegratedServer;
}
/**
* Gets if your Minecraft is Modded.
*/
public String getMinecraftIsModded()
{
String var1 = ClientBrandRetriever.getClientModName();
if (!var1.equals("vanilla"))
{
return "Definitely; Client brand changed to \'" + var1 + "\'";
}
else
{
var1 = this.theIntegratedServer.getServerModName();
return !var1.equals("vanilla") ? "Definitely; Server brand changed to \'" + var1 + "\'" : (Minecraft.class.getSigners() == null ? "Very likely; Jar signature invalidated" : "Probably not. Jar signature remains and both client + server brands are untouched.");
}
}
public Object call()
{
return this.getMinecraftIsModded();
}
}

View File

@ -1,23 +0,0 @@
package net.minecraft.src;
import java.util.concurrent.Callable;
class CallableServerType implements Callable
{
final DedicatedServer theDedicatedServer;
CallableServerType(DedicatedServer par1DedicatedServer)
{
this.theDedicatedServer = par1DedicatedServer;
}
public String callServerType()
{
return "Dedicated Server (map_server.txt)";
}
public Object call()
{
return this.callServerType();
}
}

View File

@ -1,25 +0,0 @@
package net.minecraft.src;
import java.util.concurrent.Callable;
class CallableType implements Callable
{
/** Reference to the DecitatedServer object. */
final DedicatedServer theDecitatedServer;
CallableType(DedicatedServer par1DedicatedServer)
{
this.theDecitatedServer = par1DedicatedServer;
}
public String getType()
{
String var1 = this.theDecitatedServer.getServerModName();
return !var1.equals("vanilla") ? "Definitely; Server brand changed to \'" + var1 + "\'" : "Unknown (can\'t tell)";
}
public Object call()
{
return this.getType();
}
}

View File

@ -1,24 +0,0 @@
package net.minecraft.src;
import java.util.concurrent.Callable;
class CallableType3 implements Callable
{
/** Reference to the IntegratedServer object. */
final IntegratedServer theIntegratedServer;
CallableType3(IntegratedServer par1IntegratedServer)
{
this.theIntegratedServer = par1IntegratedServer;
}
public String getType()
{
return "Integrated Server (map_client.txt)";
}
public Object call()
{
return this.getType();
}
}

View File

@ -314,8 +314,6 @@ public class Chunk
*/
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)
@ -359,8 +357,6 @@ public class Chunk
this.isGapLightingUpdated = false;
}
this.worldObj.theProfiler.endSection();
}
/**

View File

@ -1,198 +0,0 @@
package net.minecraft.src;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Iterator;
import net.minecraft.server.MinecraftServer;
public class DedicatedPlayerList extends ServerConfigurationManager
{
private File opsList;
private File whiteList;
public DedicatedPlayerList(DedicatedServer par1DedicatedServer)
{
super(par1DedicatedServer);
this.opsList = par1DedicatedServer.getFile("ops.txt");
this.whiteList = par1DedicatedServer.getFile("white-list.txt");
this.viewDistance = par1DedicatedServer.getIntProperty("view-distance", 10);
this.maxPlayers = par1DedicatedServer.getIntProperty("max-players", 20);
this.setWhiteListEnabled(par1DedicatedServer.getBooleanProperty("white-list", false));
if (!par1DedicatedServer.isSinglePlayer())
{
this.getBannedPlayers().setListActive(true);
this.getBannedIPs().setListActive(true);
}
this.getBannedPlayers().loadBanList();
this.getBannedPlayers().saveToFileWithHeader();
this.getBannedIPs().loadBanList();
this.getBannedIPs().saveToFileWithHeader();
this.loadOpsList();
this.readWhiteList();
this.saveOpsList();
if (!this.whiteList.exists())
{
this.saveWhiteList();
}
}
public void setWhiteListEnabled(boolean par1)
{
super.setWhiteListEnabled(par1);
this.getDedicatedServerInstance().setProperty("white-list", Boolean.valueOf(par1));
this.getDedicatedServerInstance().saveProperties();
}
/**
* This adds a username to the ops list, then saves the op list
*/
public void addOp(String par1Str)
{
super.addOp(par1Str);
this.saveOpsList();
}
/**
* This removes a username from the ops list, then saves the op list
*/
public void removeOp(String par1Str)
{
super.removeOp(par1Str);
this.saveOpsList();
}
/**
* Remove the specified player from the whitelist.
*/
public void removeFromWhitelist(String par1Str)
{
super.removeFromWhitelist(par1Str);
this.saveWhiteList();
}
/**
* Add the specified player to the white list.
*/
public void addToWhiteList(String par1Str)
{
super.addToWhiteList(par1Str);
this.saveWhiteList();
}
/**
* Either does nothing, or calls readWhiteList.
*/
public void loadWhiteList()
{
this.readWhiteList();
}
private void loadOpsList()
{
try
{
this.getOps().clear();
BufferedReader var1 = new BufferedReader(new FileReader(this.opsList));
String var2 = "";
while ((var2 = var1.readLine()) != null)
{
this.getOps().add(var2.trim().toLowerCase());
}
var1.close();
}
catch (Exception var3)
{
this.getDedicatedServerInstance().getLogAgent().logWarning("Failed to load operators list: " + var3);
}
}
private void saveOpsList()
{
try
{
PrintWriter var1 = new PrintWriter(new FileWriter(this.opsList, false));
Iterator var2 = this.getOps().iterator();
while (var2.hasNext())
{
String var3 = (String)var2.next();
var1.println(var3);
}
var1.close();
}
catch (Exception var4)
{
this.getDedicatedServerInstance().getLogAgent().logWarning("Failed to save operators list: " + var4);
}
}
private void readWhiteList()
{
try
{
this.getWhiteListedPlayers().clear();
BufferedReader var1 = new BufferedReader(new FileReader(this.whiteList));
String var2 = "";
while ((var2 = var1.readLine()) != null)
{
this.getWhiteListedPlayers().add(var2.trim().toLowerCase());
}
var1.close();
}
catch (Exception var3)
{
this.getDedicatedServerInstance().getLogAgent().logWarning("Failed to load white-list: " + var3);
}
}
private void saveWhiteList()
{
try
{
PrintWriter var1 = new PrintWriter(new FileWriter(this.whiteList, false));
Iterator var2 = this.getWhiteListedPlayers().iterator();
while (var2.hasNext())
{
String var3 = (String)var2.next();
var1.println(var3);
}
var1.close();
}
catch (Exception var4)
{
this.getDedicatedServerInstance().getLogAgent().logWarning("Failed to save white-list: " + var4);
}
}
/**
* Determine if the player is allowed to connect based on current server settings.
*/
public boolean isAllowedToLogin(String par1Str)
{
par1Str = par1Str.trim().toLowerCase();
return !this.isWhiteListEnabled() || this.isPlayerOpped(par1Str) || this.getWhiteListedPlayers().contains(par1Str);
}
public DedicatedServer getDedicatedServerInstance()
{
return (DedicatedServer)super.getServerInstance();
}
public MinecraftServer getServerInstance()
{
return this.getDedicatedServerInstance();
}
}

View File

@ -1,435 +0,0 @@
package net.minecraft.src;
import java.io.File;
import java.io.IOException;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import net.lax1dude.eaglercraft.EaglercraftRandom;
import net.minecraft.server.MinecraftServer;
public class DedicatedServer extends MinecraftServer implements IServer
{
private final List pendingCommandList = Collections.synchronizedList(new ArrayList());
private final ILogAgent field_98131_l;
private RConThreadQuery theRConThreadQuery;
private RConThreadMain theRConThreadMain;
private PropertyManager settings;
private boolean canSpawnStructures;
private EnumGameType gameType;
private NetworkListenThread networkThread;
private boolean guiIsEnabled;
public DedicatedServer(File par1File)
{
super(par1File);
this.field_98131_l = new LogAgent("Minecraft-Server", (String)null, (new File(par1File, "server.log")).getAbsolutePath());
new DedicatedServerSleepThread(this);
}
/**
* Initialises the server and starts it.
*/
protected boolean startServer() throws IOException
{
DedicatedServerCommandThread var1 = new DedicatedServerCommandThread(this);
var1.setDaemon(true);
var1.start();
this.getLogAgent().logInfo("Starting minecraft server version 1.6.4");
if (Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L)
{
this.getLogAgent().logWarning("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\"");
}
this.getLogAgent().logInfo("Loading properties");
this.settings = new PropertyManager(new File("server.properties"), this.getLogAgent());
if (this.isSinglePlayer())
{
this.setHostname("127.0.0.1");
}
else
{
this.setOnlineMode(this.settings.getBooleanProperty("online-mode", true));
this.setHostname(this.settings.getProperty("server-ip", ""));
}
this.setCanSpawnAnimals(this.settings.getBooleanProperty("spawn-animals", true));
this.setCanSpawnNPCs(this.settings.getBooleanProperty("spawn-npcs", true));
this.setAllowPvp(this.settings.getBooleanProperty("pvp", true));
this.setAllowFlight(this.settings.getBooleanProperty("allow-flight", false));
this.setTexturePack(this.settings.getProperty("texture-pack", ""));
this.setMOTD(this.settings.getProperty("motd", "A Minecraft Server"));
this.setForceGamemode(this.settings.getBooleanProperty("force-gamemode", false));
this.func_143006_e(this.settings.getIntProperty("player-idle-timeout", 0));
if (this.settings.getIntProperty("difficulty", 1) < 0)
{
this.settings.setProperty("difficulty", Integer.valueOf(0));
}
else if (this.settings.getIntProperty("difficulty", 1) > 3)
{
this.settings.setProperty("difficulty", Integer.valueOf(3));
}
this.canSpawnStructures = this.settings.getBooleanProperty("generate-structures", true);
int var2 = this.settings.getIntProperty("gamemode", EnumGameType.SURVIVAL.getID());
this.gameType = WorldSettings.getGameTypeById(var2);
this.getLogAgent().logInfo("Default game type: " + this.gameType);
InetAddress var3 = null;
if (this.getServerHostname().length() > 0)
{
var3 = InetAddress.getByName(this.getServerHostname());
}
if (this.getServerPort() < 0)
{
this.setServerPort(this.settings.getIntProperty("server-port", 25565));
}
this.getLogAgent().logInfo("Generating keypair");
this.getLogAgent().logInfo("Starting Minecraft server on " + (this.getServerHostname().length() == 0 ? "*" : this.getServerHostname()) + ":" + this.getServerPort());
try
{
this.networkThread = new DedicatedServerListenThread(this, var3, this.getServerPort());
}
catch (IOException var16)
{
this.getLogAgent().logWarning("**** FAILED TO BIND TO PORT!");
this.getLogAgent().logWarningFormatted("The exception was: {0}", new Object[] {var16.toString()});
this.getLogAgent().logWarning("Perhaps a server is already running on that port?");
return false;
}
if (!this.isServerInOnlineMode())
{
this.getLogAgent().logWarning("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
this.getLogAgent().logWarning("The server will make no attempt to authenticate usernames. Beware.");
this.getLogAgent().logWarning("While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.");
this.getLogAgent().logWarning("To change this, set \"online-mode\" to \"true\" in the server.properties file.");
}
this.setConfigurationManager(new DedicatedPlayerList(this));
long var4 = System.nanoTime();
if (this.getFolderName() == null)
{
this.setFolderName(this.settings.getProperty("level-name", "world"));
}
String var6 = this.settings.getProperty("level-seed", "");
String var7 = this.settings.getProperty("level-type", "DEFAULT");
String var8 = this.settings.getProperty("generator-settings", "");
long var9 = (new EaglercraftRandom()).nextLong();
if (var6.length() > 0)
{
try
{
long var11 = Long.parseLong(var6);
if (var11 != 0L)
{
var9 = var11;
}
}
catch (NumberFormatException var15)
{
var9 = (long)var6.hashCode();
}
}
WorldType var17 = WorldType.parseWorldType(var7);
if (var17 == null)
{
var17 = WorldType.DEFAULT;
}
this.setBuildLimit(this.settings.getIntProperty("max-build-height", 256));
this.setBuildLimit((this.getBuildLimit() + 8) / 16 * 16);
this.setBuildLimit(MathHelper.clamp_int(this.getBuildLimit(), 64, 256));
this.settings.setProperty("max-build-height", Integer.valueOf(this.getBuildLimit()));
this.getLogAgent().logInfo("Preparing level \"" + this.getFolderName() + "\"");
this.loadAllWorlds(this.getFolderName(), this.getFolderName(), var9, var17, var8);
long var12 = System.nanoTime() - var4;
String var14 = String.format("%.3fs", new Object[] {Double.valueOf((double)var12 / 1.0E9D)});
this.getLogAgent().logInfo("Done (" + var14 + ")! For help, type \"help\" or \"?\"");
if (this.settings.getBooleanProperty("enable-query", false))
{
this.getLogAgent().logInfo("Starting GS4 status listener");
this.theRConThreadQuery = new RConThreadQuery(this);
this.theRConThreadQuery.startThread();
}
if (this.settings.getBooleanProperty("enable-rcon", false))
{
this.getLogAgent().logInfo("Starting remote control listener");
this.theRConThreadMain = new RConThreadMain(this);
this.theRConThreadMain.startThread();
}
return true;
}
public boolean canStructuresSpawn()
{
return this.canSpawnStructures;
}
public EnumGameType getGameType()
{
return this.gameType;
}
/**
* Defaults to "1" (Easy) for the dedicated server, defaults to "2" (Normal) on the client.
*/
public int getDifficulty()
{
return this.settings.getIntProperty("difficulty", 1);
}
/**
* Defaults to false.
*/
public boolean isHardcore()
{
return this.settings.getBooleanProperty("hardcore", false);
}
/**
* Called on exit from the main run() loop.
*/
protected void finalTick(CrashReport par1CrashReport)
{
while (this.isServerRunning())
{
this.executePendingCommands();
try
{
Thread.sleep(10L);
}
catch (InterruptedException var3)
{
var3.printStackTrace();
}
}
}
/**
* Adds the server info, including from theWorldServer, to the crash report.
*/
public CrashReport addServerInfoToCrashReport(CrashReport par1CrashReport)
{
par1CrashReport = super.addServerInfoToCrashReport(par1CrashReport);
par1CrashReport.getCategory().addCrashSectionCallable("Is Modded", new CallableType(this));
par1CrashReport.getCategory().addCrashSectionCallable("Type", new CallableServerType(this));
return par1CrashReport;
}
/**
* Directly calls System.exit(0), instantly killing the program.
*/
protected void systemExitNow()
{
System.exit(0);
}
public void updateTimeLightAndEntities()
{
super.updateTimeLightAndEntities();
this.executePendingCommands();
}
public boolean getAllowNether()
{
return this.settings.getBooleanProperty("allow-nether", true);
}
public boolean allowSpawnMonsters()
{
return this.settings.getBooleanProperty("spawn-monsters", true);
}
public void addServerStatsToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper)
{
par1PlayerUsageSnooper.addData("whitelist_enabled", Boolean.valueOf(this.getDedicatedPlayerList().isWhiteListEnabled()));
par1PlayerUsageSnooper.addData("whitelist_count", Integer.valueOf(this.getDedicatedPlayerList().getWhiteListedPlayers().size()));
super.addServerStatsToSnooper(par1PlayerUsageSnooper);
}
/**
* Returns whether snooping is enabled or not.
*/
public boolean isSnooperEnabled()
{
return this.settings.getBooleanProperty("snooper-enabled", true);
}
public void addPendingCommand(String par1Str, ICommandSender par2ICommandSender)
{
this.pendingCommandList.add(new ServerCommand(par1Str, par2ICommandSender));
}
public void executePendingCommands()
{
while (!this.pendingCommandList.isEmpty())
{
ServerCommand var1 = (ServerCommand)this.pendingCommandList.remove(0);
this.getCommandManager().executeCommand(var1.sender, var1.command);
}
}
public boolean isDedicatedServer()
{
return true;
}
public DedicatedPlayerList getDedicatedPlayerList()
{
return (DedicatedPlayerList)super.getConfigurationManager();
}
public NetworkListenThread getNetworkThread()
{
return this.networkThread;
}
/**
* Gets an integer property. If it does not exist, set it to the specified value.
*/
public int getIntProperty(String par1Str, int par2)
{
return this.settings.getIntProperty(par1Str, par2);
}
/**
* Gets a string property. If it does not exist, set it to the specified value.
*/
public String getStringProperty(String par1Str, String par2Str)
{
return this.settings.getProperty(par1Str, par2Str);
}
/**
* Gets a boolean property. If it does not exist, set it to the specified value.
*/
public boolean getBooleanProperty(String par1Str, boolean par2)
{
return this.settings.getBooleanProperty(par1Str, par2);
}
/**
* Saves an Object with the given property name.
*/
public void setProperty(String par1Str, Object par2Obj)
{
this.settings.setProperty(par1Str, par2Obj);
}
/**
* Saves all of the server properties to the properties file.
*/
public void saveProperties()
{
this.settings.saveProperties();
}
/**
* Returns the filename where server properties are stored
*/
public String getSettingsFilename()
{
File var1 = this.settings.getPropertiesFile();
return var1 != null ? var1.getAbsolutePath() : "No settings file";
}
public boolean getGuiEnabled()
{
return this.guiIsEnabled;
}
/**
* On dedicated does nothing. On integrated, sets commandsAllowedForAll, gameType and allows external connections.
*/
public String shareToLAN(EnumGameType par1EnumGameType, boolean par2)
{
return "";
}
/**
* Return whether command blocks are enabled.
*/
public boolean isCommandBlockEnabled()
{
return this.settings.getBooleanProperty("enable-command-block", false);
}
/**
* Return the spawn protection area's size.
*/
public int getSpawnProtectionSize()
{
return this.settings.getIntProperty("spawn-protection", super.getSpawnProtectionSize());
}
/**
* Returns true if a player does not have permission to edit the block at the given coordinates.
*/
public boolean isBlockProtected(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
{
if (par1World.provider.dimensionId != 0)
{
return false;
}
else if (this.getDedicatedPlayerList().getOps().isEmpty())
{
return false;
}
else if (this.getDedicatedPlayerList().isPlayerOpped(par5EntityPlayer.getCommandSenderName()))
{
return false;
}
else if (this.getSpawnProtectionSize() <= 0)
{
return false;
}
else
{
ChunkCoordinates var6 = par1World.getSpawnPoint();
int var7 = MathHelper.abs_int(par2 - var6.posX);
int var8 = MathHelper.abs_int(par4 - var6.posZ);
int var9 = Math.max(var7, var8);
return var9 <= this.getSpawnProtectionSize();
}
}
public ILogAgent getLogAgent()
{
return this.field_98131_l;
}
public int func_110455_j()
{
return this.settings.getIntProperty("op-permission-level", 4);
}
public void func_143006_e(int par1)
{
super.func_143006_e(par1);
this.settings.setProperty("player-idle-timeout", Integer.valueOf(par1));
this.saveProperties();
}
public ServerConfigurationManager getConfigurationManager()
{
return this.getDedicatedPlayerList();
}
}

View File

@ -1,33 +0,0 @@
package net.minecraft.src;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
class DedicatedServerCommandThread extends Thread
{
final DedicatedServer server;
DedicatedServerCommandThread(DedicatedServer par1DedicatedServer)
{
this.server = par1DedicatedServer;
}
public void run()
{
BufferedReader var1 = new BufferedReader(new InputStreamReader(System.in));
String var2;
try
{
while (!this.server.isServerStopped() && this.server.isServerRunning() && (var2 = var1.readLine()) != null)
{
this.server.addPendingCommand(var2, this.server);
}
}
catch (IOException var4)
{
var4.printStackTrace();
}
}
}

View File

@ -1,49 +0,0 @@
package net.minecraft.src;
import java.io.IOException;
import java.net.InetAddress;
import net.minecraft.server.MinecraftServer;
public class DedicatedServerListenThread extends NetworkListenThread
{
/** Instance of ServerListenThread. */
private final ServerListenThread theServerListenThread;
public DedicatedServerListenThread(MinecraftServer par1MinecraftServer, InetAddress par2InetAddress, int par3) throws IOException
{
super(par1MinecraftServer);
this.theServerListenThread = new ServerListenThread(this, par2InetAddress, par3);
this.theServerListenThread.start();
}
public void stopListening()
{
super.stopListening();
this.theServerListenThread.func_71768_b();
this.theServerListenThread.interrupt();
}
/**
* processes packets and pending connections
*/
public void networkTick()
{
this.theServerListenThread.processPendingConnections();
super.networkTick();
}
public DedicatedServer getDedicatedServer()
{
return (DedicatedServer)super.getServer();
}
public void func_71761_a(InetAddress par1InetAddress)
{
this.theServerListenThread.func_71769_a(par1InetAddress);
}
public MinecraftServer getServer()
{
return this.getDedicatedServer();
}
}

View File

@ -1,32 +0,0 @@
package net.minecraft.src;
class DedicatedServerSleepThread extends Thread
{
/** Instance of the DecitatedServer. */
final DedicatedServer theDecitatedServer;
DedicatedServerSleepThread(DedicatedServer par1DedicatedServer)
{
this.theDecitatedServer = par1DedicatedServer;
this.setDaemon(true);
this.start();
}
public void run()
{
while (true)
{
try
{
while (true)
{
Thread.sleep(2147483647L);
}
}
catch (InterruptedException var2)
{
;
}
}
}
}

View File

@ -376,8 +376,6 @@ public abstract class Entity
*/
public void onEntityUpdate()
{
this.worldObj.theProfiler.startSection("entityBaseTick");
if (this.ridingEntity != null && this.ridingEntity.isDead)
{
this.ridingEntity = null;
@ -393,7 +391,6 @@ public abstract class Entity
if (!this.worldObj.isRemote && this.worldObj instanceof WorldServer)
{
this.worldObj.theProfiler.startSection("portal");
MinecraftServer var1 = ((WorldServer)this.worldObj).getMinecraftServer();
var2 = this.getMaxInPortalTime();
@ -440,7 +437,7 @@ public abstract class Entity
--this.timeUntilPortal;
}
this.worldObj.theProfiler.endSection();
}
if (this.isSprinting() && !this.isInWater())
@ -501,7 +498,6 @@ public abstract class Entity
}
this.firstUpdate = false;
this.worldObj.theProfiler.endSection();
}
/**
@ -578,7 +574,6 @@ public abstract class Entity
}
else
{
this.worldObj.theProfiler.startSection("move");
this.ySize *= 0.4F;
double var7 = this.posX;
double var9 = this.posY;
@ -803,8 +798,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;
@ -918,7 +911,6 @@ public abstract class Entity
this.fire = -this.fireResistance;
}
this.worldObj.theProfiler.endSection();
}
}
@ -2284,7 +2276,6 @@ public abstract class Entity
{
if (!this.worldObj.isRemote && !this.isDead)
{
this.worldObj.theProfiler.startSection("changeDimension");
MinecraftServer var2 = MinecraftServer.getServer();
int var3 = this.dimension;
WorldServer var4 = var2.worldServerForDimension(var3);
@ -2299,9 +2290,7 @@ public abstract class Entity
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)
@ -2319,10 +2308,9 @@ public abstract class Entity
}
this.isDead = true;
this.worldObj.theProfiler.endSection();
var4.resetUpdateEntityTick();
var5.resetUpdateEntityTick();
this.worldObj.theProfiler.endSection();
}
}

View File

@ -40,8 +40,6 @@ public abstract class EntityCreature extends EntityLiving
protected void updateEntityActionState()
{
this.worldObj.theProfiler.startSection("ai");
if (this.fleeingTick > 0 && --this.fleeingTick == 0)
{
AttributeInstance var1 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed);
@ -74,8 +72,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, var21, true, false, false, true);
@ -92,7 +88,6 @@ public abstract class EntityCreature extends EntityLiving
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);
@ -166,7 +161,6 @@ public abstract class EntityCreature extends EntityLiving
this.isJumping = true;
}
this.worldObj.theProfiler.endSection();
}
else
{
@ -180,7 +174,6 @@ public abstract class EntityCreature extends EntityLiving
*/
protected void updateWanderPath()
{
this.worldObj.theProfiler.startSection("stroll");
boolean var1 = false;
int var2 = -1;
int var3 = -1;
@ -209,7 +202,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

@ -50,8 +50,8 @@ public abstract class EntityLiving extends EntityLivingBase
public EntityLiving(World par1World)
{
super(par1World);
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(null);
this.targetTasks = new EntityAITasks(null);
this.lookHelper = new EntityLookHelper(this);
this.moveHelper = new EntityMoveHelper(this);
this.jumpHelper = new EntityJumpHelper(this);
@ -163,15 +163,12 @@ public abstract class EntityLiving extends EntityLivingBase
public void onEntityUpdate()
{
super.onEntityUpdate();
this.worldObj.theProfiler.startSection("mobBaseTick");
if (this.isEntityAlive() && this.rand.nextInt(1000) < this.livingSoundTime++)
{
this.livingSoundTime = -this.getTalkInterval();
this.playLivingSound();
}
this.worldObj.theProfiler.endSection();
}
/**
@ -405,7 +402,6 @@ public abstract class EntityLiving extends EntityLivingBase
public void onLivingUpdate()
{
super.onLivingUpdate();
this.worldObj.theProfiler.startSection("looting");
if (!this.worldObj.isRemote && this.canPickUpLoot() && !this.dead && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"))
{
@ -494,8 +490,6 @@ public abstract class EntityLiving extends EntityLivingBase
}
}
}
this.worldObj.theProfiler.endSection();
}
/**
@ -554,33 +548,15 @@ public abstract class EntityLiving extends EntityLivingBase
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();
}
protected void updateEntityActionState()

View File

@ -229,7 +229,6 @@ public abstract class EntityLivingBase extends Entity
{
this.prevSwingProgress = this.swingProgress;
super.onEntityUpdate();
this.worldObj.theProfiler.startSection("livingEntityBaseTick");
if (this.isEntityAlive() && this.isEntityInsideOpaqueBlock())
{
@ -324,7 +323,6 @@ public abstract class EntityLivingBase extends Entity
this.prevRotationYawHead = this.rotationYawHead;
this.prevRotationYaw = this.rotationYaw;
this.prevRotationPitch = this.rotationPitch;
this.worldObj.theProfiler.endSection();
}
/**
@ -1759,11 +1757,7 @@ public abstract class EntityLivingBase extends Entity
}
this.field_110154_aX += (var8 - this.field_110154_aX) * 0.3F;
this.worldObj.theProfiler.startSection("headTurn");
var7 = this.func_110146_f(var6, var7);
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.startSection("rangeChecks");
while (this.rotationYaw - this.prevRotationYaw < -180.0F)
{
this.prevRotationYaw -= 360.0F;
@ -1804,7 +1798,6 @@ public abstract class EntityLivingBase extends Entity
this.prevRotationYawHead += 360.0F;
}
this.worldObj.theProfiler.endSection();
this.field_70764_aw += var7;
}
@ -1885,8 +1878,6 @@ public abstract class EntityLivingBase extends Entity
this.motionZ = 0.0D;
}
this.worldObj.theProfiler.startSection("ai");
if (this.isMovementBlocked())
{
this.isJumping = false;
@ -1898,22 +1889,15 @@ public abstract class EntityLivingBase extends Entity
{
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())
@ -1934,21 +1918,15 @@ public abstract class EntityLivingBase 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;
this.moveEntityWithHeading(this.moveStrafing, this.moveForward);
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.startSection("push");
if (!this.worldObj.isRemote)
{
this.collideWithNearbyEntities();
}
this.worldObj.theProfiler.endSection();
}
protected void updateAITasks() {}

View File

@ -244,7 +244,6 @@ public abstract class EntityMinecart extends Entity
if (!this.worldObj.isRemote && this.worldObj instanceof WorldServer)
{
this.worldObj.theProfiler.startSection("portal");
MinecraftServer var1 = ((WorldServer)this.worldObj).getMinecraftServer();
var2 = this.getMaxInPortalTime();
@ -291,7 +290,6 @@ public abstract class EntityMinecart extends Entity
--this.timeUntilPortal;
}
this.worldObj.theProfiler.endSection();
}
if (this.worldObj.isRemote)

View File

@ -42,9 +42,7 @@ public class EntitySenses
}
else
{
this.entityObj.worldObj.theProfiler.startSection("canSee");
boolean var2 = this.entityObj.canEntityBeSeen(par1Entity);
this.entityObj.worldObj.theProfiler.endSection();
if (var2)
{

View File

@ -1,61 +0,0 @@
package net.minecraft.src;
import java.net.SocketAddress;
import net.minecraft.server.MinecraftServer;
public class IntegratedPlayerList extends ServerConfigurationManager
{
/**
* Holds the NBT data for the host player's save file, so this can be written to level.dat.
*/
private NBTTagCompound hostPlayerData;
public IntegratedPlayerList(IntegratedServer par1IntegratedServer)
{
super(par1IntegratedServer);
this.viewDistance = 10;
}
/**
* also stores the NBTTags if this is an intergratedPlayerList
*/
protected void writePlayerData(EntityPlayerMP par1EntityPlayerMP)
{
if (par1EntityPlayerMP.getCommandSenderName().equals(this.getIntegratedServer().getServerOwner()))
{
this.hostPlayerData = new NBTTagCompound();
par1EntityPlayerMP.writeToNBT(this.hostPlayerData);
}
super.writePlayerData(par1EntityPlayerMP);
}
/**
* checks ban-lists, then white-lists, then space for the server. Returns null on success, or an error message
*/
public String allowUserToConnect(SocketAddress par1SocketAddress, String par2Str)
{
return par2Str.equalsIgnoreCase(this.getIntegratedServer().getServerOwner()) ? "That name is already taken." : super.allowUserToConnect(par1SocketAddress, par2Str);
}
/**
* get the associated Integrated Server
*/
public IntegratedServer getIntegratedServer()
{
return (IntegratedServer)super.getServerInstance();
}
/**
* On integrated servers, returns the host's player data to be written to level.dat.
*/
public NBTTagCompound getHostPlayerData()
{
return this.hostPlayerData;
}
public MinecraftServer getServerInstance()
{
return this.getIntegratedServer();
}
}

View File

@ -1,282 +0,0 @@
package net.minecraft.src;
import java.io.File;
import java.io.IOException;
import net.minecraft.server.MinecraftServer;
public class IntegratedServer extends MinecraftServer
{
/** The Minecraft instance. */
private final Minecraft mc;
private final WorldSettings theWorldSettings;
private final ILogAgent serverLogAgent;
/** Instance of IntegratedServerListenThread. */
private IntegratedServerListenThread theServerListeningThread;
private boolean isGamePaused;
private boolean isPublic;
private ThreadLanServerPing lanServerPing;
public IntegratedServer(Minecraft par1Minecraft, String par2Str, String par3Str, WorldSettings par4WorldSettings)
{
super(new File("", "saves"));
this.serverLogAgent = new LogAgent("Minecraft-Server", " [SERVER]", (new File("", "output-server.log")).getAbsolutePath());
this.setServerOwner(par1Minecraft.getSession().getUsername());
this.setFolderName(par2Str);
this.setWorldName(par3Str);
this.setDemo(par1Minecraft.isDemo());
this.canCreateBonusChest(par4WorldSettings.isBonusChestEnabled());
this.setBuildLimit(256);
this.setConfigurationManager(new IntegratedPlayerList(this));
this.mc = par1Minecraft;
this.theWorldSettings = par4WorldSettings;
try
{
this.theServerListeningThread = new IntegratedServerListenThread(this);
}
catch (IOException var6)
{
throw new Error();
}
}
protected void loadAllWorlds(String par1Str, String par2Str, long par3, WorldType par5WorldType, String par6Str)
{
this.convertMapIfNeeded(par1Str);
this.worldServers = new WorldServer[3];
this.timeOfLastDimensionTick = new long[this.worldServers.length][100];
ISaveHandler var7 = this.getActiveAnvilConverter().getSaveLoader(par1Str, true);
for (int var8 = 0; var8 < this.worldServers.length; ++var8)
{
byte var9 = 0;
if (var8 == 1)
{
var9 = -1;
}
if (var8 == 2)
{
var9 = 1;
}
if (var8 == 0)
{
this.worldServers[var8] = new WorldServer(this, var7, par2Str, var9, this.theWorldSettings, this.theProfiler, this.getLogAgent());
}
else
{
this.worldServers[var8] = new WorldServerMulti(this, var7, par2Str, var9, this.theWorldSettings, this.worldServers[0], this.theProfiler, this.getLogAgent());
}
this.worldServers[var8].addWorldAccess(new WorldManager(this, this.worldServers[var8]));
this.getConfigurationManager().setPlayerManager(this.worldServers);
}
this.setDifficultyForAllWorlds(this.getDifficulty());
this.initialWorldChunkLoad();
}
/**
* Initialises the server and starts it.
*/
protected boolean startServer() throws IOException
{
this.serverLogAgent.logInfo("Starting integrated minecraft server version 1.6.4");
this.setOnlineMode(false);
this.setCanSpawnAnimals(true);
this.setCanSpawnNPCs(true);
this.setAllowPvp(true);
this.setAllowFlight(true);
this.serverLogAgent.logInfo("Generating keypair");
//this.setKeyPair(CryptManager.createNewKeyPair());
this.loadAllWorlds(this.getFolderName(), this.getWorldName(), this.theWorldSettings.getSeed(), this.theWorldSettings.getTerrainType(), this.theWorldSettings.func_82749_j());
this.setMOTD(this.getServerOwner() + " - " + this.worldServers[0].getWorldInfo().getWorldName());
return true;
}
/**
* Main function called by run() every loop.
*/
public void tick()
{
boolean var1 = this.isGamePaused;
this.isGamePaused = this.theServerListeningThread.isGamePaused();
if (!var1 && this.isGamePaused)
{
this.serverLogAgent.logInfo("Saving and pausing game...");
this.getConfigurationManager().saveAllPlayerData();
this.saveAllWorlds(false);
}
if (!this.isGamePaused)
{
super.tick();
}
}
public boolean canStructuresSpawn()
{
return false;
}
public EnumGameType getGameType()
{
return this.theWorldSettings.getGameType();
}
/**
* Defaults to "1" (Easy) for the dedicated server, defaults to "2" (Normal) on the client.
*/
public int getDifficulty()
{
return this.mc.gameSettings.difficulty;
}
/**
* Defaults to false.
*/
public boolean isHardcore()
{
return this.theWorldSettings.getHardcoreEnabled();
}
protected File getDataDirectory()
{
return null;
}
public boolean isDedicatedServer()
{
return false;
}
/**
* Gets the IntergratedServerListenThread.
*/
public IntegratedServerListenThread getServerListeningThread()
{
return this.theServerListeningThread;
}
/**
* Called on exit from the main run() loop.
*/
protected void finalTick(CrashReport par1CrashReport)
{
this.mc.crashed(par1CrashReport);
}
/**
* Adds the server info, including from theWorldServer, to the crash report.
*/
public CrashReport addServerInfoToCrashReport(CrashReport par1CrashReport)
{
par1CrashReport = super.addServerInfoToCrashReport(par1CrashReport);
par1CrashReport.getCategory().addCrashSectionCallable("Type", new CallableType3(this));
par1CrashReport.getCategory().addCrashSectionCallable("Is Modded", new CallableIsModded(this));
return par1CrashReport;
}
/**
* Returns whether snooping is enabled or not.
*/
public boolean isSnooperEnabled()
{
return Minecraft.getMinecraft().isSnooperEnabled();
}
/**
* On dedicated does nothing. On integrated, sets commandsAllowedForAll, gameType and allows external connections.
*/
public String shareToLAN(EnumGameType par1EnumGameType, boolean par2)
{
try
{
String var3 = this.theServerListeningThread.func_71755_c();
this.getLogAgent().logInfo("Started on " + var3);
this.isPublic = true;
this.lanServerPing = new ThreadLanServerPing(this.getMOTD(), var3);
this.lanServerPing.start();
this.getConfigurationManager().setGameType(par1EnumGameType);
this.getConfigurationManager().setCommandsAllowedForAll(par2);
return var3;
}
catch (IOException var4)
{
return null;
}
}
public ILogAgent getLogAgent()
{
return this.serverLogAgent;
}
/**
* Saves all necessary data as preparation for stopping the server.
*/
public void stopServer()
{
super.stopServer();
if (this.lanServerPing != null)
{
this.lanServerPing.interrupt();
this.lanServerPing = null;
}
}
/**
* Sets the serverRunning variable to false, in order to get the server to shut down.
*/
public void initiateShutdown()
{
super.initiateShutdown();
if (this.lanServerPing != null)
{
this.lanServerPing.interrupt();
this.lanServerPing = null;
}
}
/**
* Returns true if this integrated server is open to LAN
*/
public boolean getPublic()
{
return this.isPublic;
}
/**
* Sets the game type for all worlds.
*/
public void setGameType(EnumGameType par1EnumGameType)
{
this.getConfigurationManager().setGameType(par1EnumGameType);
}
/**
* Return whether command blocks are enabled.
*/
public boolean isCommandBlockEnabled()
{
return true;
}
public int func_110455_j()
{
return 4;
}
public NetworkListenThread getNetworkThread()
{
return this.getServerListeningThread();
}
}

View File

@ -1,119 +0,0 @@
package net.minecraft.src;
import java.io.IOException;
import java.net.InetAddress;
import net.minecraft.server.MinecraftServer;
public class IntegratedServerListenThread extends NetworkListenThread
{
private final MemoryConnection netMemoryConnection;
private MemoryConnection theMemoryConnection;
private String field_71759_e;
private boolean field_71756_f;
private ServerListenThread myServerListenThread;
public IntegratedServerListenThread(IntegratedServer par1IntegratedServer) throws IOException
{
super(par1IntegratedServer);
this.netMemoryConnection = new MemoryConnection(par1IntegratedServer.getLogAgent(), (NetHandler)null);
}
public void func_71754_a(MemoryConnection par1MemoryConnection, String par2Str)
{
this.theMemoryConnection = par1MemoryConnection;
this.field_71759_e = par2Str;
}
public String func_71755_c() throws IOException
{
if (this.myServerListenThread == null)
{
int var1 = -1;
try
{
var1 = HttpUtil.func_76181_a();
}
catch (IOException var4)
{
;
}
if (var1 <= 0)
{
var1 = 25564;
}
try
{
this.myServerListenThread = new ServerListenThread(this, (InetAddress)null, var1);
this.myServerListenThread.start();
}
catch (IOException var3)
{
throw var3;
}
}
return String.valueOf(this.myServerListenThread.getMyPort());
}
public void stopListening()
{
super.stopListening();
if (this.myServerListenThread != null)
{
this.getIntegratedServer().getLogAgent().logInfo("Stopping server connection");
this.myServerListenThread.func_71768_b();
this.myServerListenThread.interrupt();
this.myServerListenThread = null;
}
}
/**
* processes packets and pending connections
*/
public void networkTick()
{
if (this.theMemoryConnection != null)
{
EntityPlayerMP var1 = this.getIntegratedServer().getConfigurationManager().createPlayerForUser(this.field_71759_e);
if (var1 != null)
{
this.netMemoryConnection.pairWith(this.theMemoryConnection);
this.field_71756_f = true;
this.getIntegratedServer().getConfigurationManager().initializeConnectionToPlayer(this.netMemoryConnection, var1);
}
this.theMemoryConnection = null;
this.field_71759_e = null;
}
if (this.myServerListenThread != null)
{
this.myServerListenThread.processPendingConnections();
}
super.networkTick();
}
/**
* Gets MinecraftServer instance.
*/
public IntegratedServer getIntegratedServer()
{
return (IntegratedServer)super.getServer();
}
public boolean isGamePaused()
{
return this.field_71756_f && this.netMemoryConnection.getPairedConnection().isConnectionActive() && this.netMemoryConnection.getPairedConnection().isGamePaused();
}
public MinecraftServer getServer()
{
return this.getIntegratedServer();
}
}

View File

@ -1,4 +0,0 @@
package net.minecraft.src;
class LogAgentINNER1 {
}

View File

@ -32,6 +32,12 @@ public class MapStorage
this.loadIdCounts();
}
public MapStorage() // FIX THIS SHIT
{
this.saveHandler = null;
this.loadIdCounts();
}
/**
* Loads an existing MapDataBase corresponding to the given String id from disk, instantiating the given Class, or
* returns null if none such file exists. args: Class to instantiate, String dataid

View File

@ -3,25 +3,24 @@ package net.minecraft.src;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import net.lax1dude.eaglercraft.EaglerAdapter;
import net.lax1dude.eaglercraft.EaglercraftRandom;
import net.lax1dude.eaglercraft.GuiScreenSingleplayerException;
import net.lax1dude.eaglercraft.GuiScreenSingleplayerLoading;
import net.lax1dude.eaglercraft.IntegratedServer;
import net.lax1dude.eaglercraft.WebsocketNetworkManager;
import net.minecraft.client.ClientBrandRetriever;
//import net.lax1dude.eaglercraft.IntegratedServer;
import org.lwjgl.Sys;
import org.lwjgl.input.Keyboard;
import net.lax1dude.eaglercraft.WorkerNetworkManager;
import net.lax1dude.eaglercraft.adapter.EaglerAdapterImpl2.RateLimit;
public class NetClientHandler extends NetHandler
{
public class NetClientHandler extends NetHandler {
/** True if kicked or disconnected from the server. */
private boolean disconnected;
private boolean disconnected = false;
/** Reference to the NetworkManager object. */
private INetworkManager netManager;
@ -32,65 +31,45 @@ public class NetClientHandler extends NetHandler
private WorldClient worldClient;
/**
* True if the client has finished downloading terrain and may spawn. Set upon receipt of a player position packet,
* reset upon respawning.
* True if the client has finished downloading terrain and may spawn. Set upon
* receipt of a player position packet, reset upon respawning.
*/
private boolean doneLoadingTerrain;
public MapStorage mapStorage = new MapStorage((ISaveHandler)null);
private boolean doneLoadingTerrain = false;
public MapStorage mapStorage = new MapStorage();
/** A HashMap of all player names and their player information objects */
private Map playerInfoMap = new HashMap();
/**
* An ArrayList of GuiPlayerInfo (includes all the players' GuiPlayerInfo on the current server)
* An ArrayList of GuiPlayerInfo (includes all the players' GuiPlayerInfo on the
* current server)
*/
public List playerInfoList = new ArrayList();
public int currentServerMaxPlayers = 20;
private GuiScreen field_98183_l;
private GuiScreen field_98183_l = null;
/** RNG. */
EaglercraftRandom rand = new EaglercraftRandom();
public NetClientHandler(Minecraft par1Minecraft, String par2Str, int par3) throws IOException
{
this.mc = par1Minecraft;
Socket var4 = new Socket(InetAddress.getByName(par2Str), par3);
//this.netManager = new TcpConnection(par1Minecraft.getLogAgent(), var4, "Client", this); // FIX THIS SHIT
}
public NetClientHandler(Minecraft par1Minecraft, String par2Str, int par3, GuiScreen par4GuiScreen) throws IOException
{
this.mc = par1Minecraft;
this.field_98183_l = par4GuiScreen;
Socket var5 = new Socket(InetAddress.getByName(par2Str), par3);
//this.netManager = new TcpConnection(par1Minecraft.getLogAgent(), var5, "Client", this);
}
public NetClientHandler(Minecraft par1Minecraft, IntegratedServer par2IntegratedServer) throws IOException
{
this.mc = par1Minecraft;
//this.netManager = new MemoryConnection(par1Minecraft.getLogAgent(), this);
par2IntegratedServer.getServerListeningThread().func_71754_a((MemoryConnection)this.netManager, par1Minecraft.getSession().getUsername());
}
public NetClientHandler(Minecraft par1Minecraft, INetworkManager mgr) throws IOException {
this.mc = par1Minecraft;
this.netManager = mgr;
}
public NetClientHandler(Minecraft par1Minecraft, String channel) throws IOException {
this.mc = par1Minecraft;
//this.netManager = IntegratedServer.openConnection(channel, this); // FIX THIS
}
this.mc = par1Minecraft;
this.netManager = mgr;
}
public NetClientHandler(Minecraft par1Minecraft, String channel) throws IOException {
this.mc = par1Minecraft;
this.netManager = IntegratedServer.openConnection(channel, this);
}
public NetClientHandler(Minecraft par1Minecraft, String par2Str, int par3) throws IOException {
this.mc = par1Minecraft;
this.netManager = new WebsocketNetworkManager(par2Str, null, this);
}
/**
* sets netManager and worldClient to null
*/
public void cleanup()
{
if (this.netManager != null)
{
public void cleanup() {
if (this.netManager != null) {
this.netManager.wakeThreads();
}
@ -98,38 +77,67 @@ public class NetClientHandler extends NetHandler
this.worldClient = null;
}
private GuiScreen backToMenu() {
if(netManager instanceof WorkerNetworkManager) {
return new GuiMainMenu();
}else {
return new GuiMultiplayer(new GuiMainMenu());
}
}
/**
* Processes the packets that have been read since the last call to this function.
* Processes the packets that have been read since the last call to this
* function.
*/
public void processReadPackets()
{
if (!this.disconnected && this.netManager != null)
{
public void processReadPackets() {
if (this.netManager != null) {
this.netManager.processReadPackets();
}
if (this.netManager != null)
{
this.netManager.wakeThreads();
if(!EaglerAdapter.connectionOpen()) {
if(!this.disconnected) {
RateLimit r = EaglerAdapter.getRateLimitStatus();
if(r != null) {
if(r == RateLimit.NOW_LOCKED) {
this.mc.displayGuiScreen(new GuiDisconnected(backToMenu(), "disconnect.ratelimit.ipNowLocked", "disconnect.endOfStream"));
}else if(r == RateLimit.LOCKED) {
this.mc.displayGuiScreen(new GuiDisconnected(backToMenu(), "disconnect.ratelimit.ipLocked", "disconnect.endOfStream"));
}else if(r == RateLimit.BLOCKED) {
this.mc.displayGuiScreen(new GuiDisconnected(backToMenu(), "disconnect.ratelimit.ipBlocked", "disconnect.endOfStream"));
}else if(r == RateLimit.FAILED_POSSIBLY_LOCKED) {
this.mc.displayGuiScreen(new GuiDisconnected(backToMenu(), "disconnect.ratelimit.ipFailedPossiblyLocked", "disconnect.endOfStream"));
}else {
this.mc.displayGuiScreen(new GuiDisconnected(backToMenu(), "disconnect.disconnected", "RateLimit." + r.name()));
}
}else {
if(!(this.mc.currentScreen instanceof GuiDisconnected) && !(this.mc.currentScreen instanceof GuiScreenSingleplayerException) &&
!(this.mc.currentScreen instanceof GuiScreenSingleplayerLoading)) {
this.mc.stopServerAndDisplayGuiScreen(new GuiDisconnected(backToMenu(), "disconnect.disconnected", "disconnect.endOfStream"));
}
}
this.disconnected = true;
this.mc.loadWorld((WorldClient) null);
}
}else {
if(this.disconnected) {
EaglerAdapter.endConnection();
}
}
}
public void handleServerAuthData(Packet253ServerAuthData par1Packet253ServerAuthData)
{
public void handleServerAuthData(Packet253ServerAuthData par1Packet253ServerAuthData) {
this.addToSendQueue(new Packet252SharedKey());
}
public void handleSharedKey(Packet252SharedKey par1Packet252SharedKey)
{
public void handleSharedKey(Packet252SharedKey par1Packet252SharedKey) {
this.addToSendQueue(new Packet205ClientCommand(0));
}
public void handleLogin(Packet1Login par1Packet1Login)
{
public void handleLogin(Packet1Login par1Packet1Login) {
this.mc.playerController = new PlayerControllerMP(this.mc, this);
this.mc.statFileWriter.readStat(StatList.joinMultiplayerStat, 1);
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;
@ -138,7 +146,6 @@ public class NetClientHandler extends NetHandler
this.currentServerMaxPlayers = par1Packet1Login.maxPlayers;
this.mc.playerController.setGameType(par1Packet1Login.gameType);
this.mc.gameSettings.sendSettingsToServer();
//this.netManager.addToSendQueue(new Packet250CustomPayload("MC|Brand", ClientBrandRetriever.getClientModName().getBytes(Charsets.UTF_8)));
}
public void handleVehicleSpawn(Packet23VehicleSpawn par1Packet23VehicleSpawn)
@ -852,7 +859,7 @@ public class NetClientHandler extends NetHandler
{
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);
@ -1215,58 +1222,40 @@ public class NetClientHandler extends NetHandler
return this.mc != null && this.mc.theWorld != null && this.mc.thePlayer != null && this.worldClient != null;
}
public void handleGameEvent(Packet70GameEvent par1Packet70GameEvent)
{
public void handleGameEvent(Packet70GameEvent par1Packet70GameEvent) {
EntityClientPlayerMP var2 = this.mc.thePlayer;
int var3 = par1Packet70GameEvent.eventType;
int var4 = par1Packet70GameEvent.gameMode;
if (var3 >= 0 && var3 < Packet70GameEvent.clientMessage.length && Packet70GameEvent.clientMessage[var3] != null)
{
if (var3 >= 0 && var3 < Packet70GameEvent.clientMessage.length && Packet70GameEvent.clientMessage[var3] != null) {
var2.addChatMessage(Packet70GameEvent.clientMessage[var3]);
}
if (var3 == 1)
{
if (var3 == 1) {
this.worldClient.getWorldInfo().setRaining(true);
this.worldClient.setRainStrength(0.0F);
}
else if (var3 == 2)
{
} else if (var3 == 2) {
this.worldClient.getWorldInfo().setRaining(false);
this.worldClient.setRainStrength(1.0F);
}
else if (var3 == 3)
{
} else if (var3 == 3) {
this.mc.playerController.setGameType(EnumGameType.getByID(var4));
}
else if (var3 == 4)
{
} else if (var3 == 4) {
this.mc.displayGuiScreen(new GuiWinGame());
}
else if (var3 == 5)
{
} else if (var3 == 5) {
GameSettings var5 = this.mc.gameSettings;
if (var4 == 0)
{
if (var4 == 0) {
return;
} else if (var4 == 101) {
this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.movement",
new Object[] { EaglerAdapter.getKeyName(var5.keyBindForward.keyCode), EaglerAdapter.getKeyName(var5.keyBindLeft.keyCode), EaglerAdapter.getKeyName(var5.keyBindBack.keyCode), EaglerAdapter.getKeyName(var5.keyBindRight.keyCode) });
} else if (var4 == 102) {
this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.jump", new Object[] { EaglerAdapter.getKeyName(var5.keyBindJump.keyCode) });
} else if (var4 == 103) {
this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.inventory", new Object[] { EaglerAdapter.getKeyName(var5.keyBindInventory.keyCode) });
}
else if (var4 == 101)
{
this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.movement", new Object[] {Keyboard.getKeyName(var5.keyBindForward.keyCode), Keyboard.getKeyName(var5.keyBindLeft.keyCode), Keyboard.getKeyName(var5.keyBindBack.keyCode), Keyboard.getKeyName(var5.keyBindRight.keyCode)});
}
else if (var4 == 102)
{
this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.jump", new Object[] {Keyboard.getKeyName(var5.keyBindJump.keyCode)});
}
else if (var4 == 103)
{
this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.inventory", new Object[] {Keyboard.getKeyName(var5.keyBindInventory.keyCode)});
}
}
else if (var3 == 6)
{
this.worldClient.playSound(var2.posX, var2.posY + (double)var2.getEyeHeight(), var2.posZ, "random.successful_hit", 0.18F, 0.45F, false);
} else if (var3 == 6) {
this.worldClient.playSound(var2.posX, var2.posY + (double) var2.getEyeHeight(), var2.posZ, "random.successful_hit", 0.18F, 0.45F, false);
}
}

View File

@ -1,296 +0,0 @@
package net.minecraft.src;
import java.io.IOException;
import java.io.Serializable;
import java.net.InetAddress;
import java.net.Socket;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import net.lax1dude.eaglercraft.EaglercraftRandom;
import javax.crypto.SecretKey;
import net.minecraft.server.MinecraftServer;
public class NetLoginHandler extends NetHandler
{
/** The Random object used to generate serverId hex strings. */
private static EaglercraftRandom rand = new EaglercraftRandom();
/** The 4 byte verify token read from a Packet252SharedKey */
private byte[] verifyToken;
/** Reference to the MinecraftServer object. */
private final MinecraftServer mcServer;
public final TcpConnection myTCPConnection;
public boolean connectionComplete;
private int connectionTimer;
private String clientUsername;
private volatile boolean field_72544_i;
/** server ID that is randomly generated by this login handler. */
private String loginServerId = "";
private boolean field_92079_k;
/** Secret AES key obtained from the client's Packet252SharedKey */
private SecretKey sharedKey;
public NetLoginHandler(MinecraftServer par1MinecraftServer, Socket par2Socket, String par3Str) throws IOException
{
this.mcServer = par1MinecraftServer;
this.myTCPConnection = new TcpConnection(par1MinecraftServer.getLogAgent(), par2Socket, par3Str, this, par1MinecraftServer.getKeyPair().getPrivate());
this.myTCPConnection.field_74468_e = 0;
}
/**
* Logs the user in if a login packet is found, otherwise keeps processing network packets unless the timeout has
* occurred.
*/
public void tryLogin()
{
if (this.field_72544_i)
{
this.initializePlayerConnection();
}
if (this.connectionTimer++ == 600)
{
this.raiseErrorAndDisconnect("Took too long to log in");
}
else
{
this.myTCPConnection.processReadPackets();
}
}
public void raiseErrorAndDisconnect(String par1Str)
{
try
{
this.mcServer.getLogAgent().logInfo("Disconnecting " + this.getUsernameAndAddress() + ": " + par1Str);
this.myTCPConnection.addToSendQueue(new Packet255KickDisconnect(par1Str));
this.myTCPConnection.serverShutdown();
this.connectionComplete = true;
}
catch (Exception var3)
{
var3.printStackTrace();
}
}
public void handleClientProtocol(Packet2ClientProtocol par1Packet2ClientProtocol)
{
if (this.clientUsername != null)
{
this.raiseErrorAndDisconnect("Quit repeating yourself!");
}
else
{
this.clientUsername = par1Packet2ClientProtocol.getUsername();
if (!this.clientUsername.equals(StringUtils.stripControlCodes(this.clientUsername)))
{
this.raiseErrorAndDisconnect("Invalid username!");
}
else
{
PublicKey var2 = this.mcServer.getKeyPair().getPublic();
if (par1Packet2ClientProtocol.getProtocolVersion() != 78)
{
if (par1Packet2ClientProtocol.getProtocolVersion() > 78)
{
this.raiseErrorAndDisconnect("Outdated server!");
}
else
{
this.raiseErrorAndDisconnect("Outdated client!");
}
}
else
{
this.loginServerId = this.mcServer.isServerInOnlineMode() ? Long.toString(rand.nextLong(), 16) : "-";
this.verifyToken = new byte[4];
rand.nextBytes(this.verifyToken);
this.myTCPConnection.addToSendQueue(new Packet253ServerAuthData(this.loginServerId, var2, this.verifyToken));
}
}
}
}
public void handleSharedKey(Packet252SharedKey par1Packet252SharedKey)
{
PrivateKey var2 = this.mcServer.getKeyPair().getPrivate();
this.myTCPConnection.addToSendQueue(new Packet252SharedKey());
}
public void handleClientCommand(Packet205ClientCommand par1Packet205ClientCommand)
{
if (par1Packet205ClientCommand.forceRespawn == 0)
{
if (this.field_92079_k)
{
this.raiseErrorAndDisconnect("Duplicate login");
return;
}
this.field_92079_k = true;
this.field_72544_i = true;
}
}
public void handleLogin(Packet1Login par1Packet1Login) {}
/**
* on success the specified username is connected to the minecraftInstance, otherwise they are packet255'd
*/
public void initializePlayerConnection()
{
String var1 = this.mcServer.getConfigurationManager().allowUserToConnect(this.myTCPConnection.getSocketAddress(), this.clientUsername);
if (var1 != null)
{
this.raiseErrorAndDisconnect(var1);
}
else
{
EntityPlayerMP var2 = this.mcServer.getConfigurationManager().createPlayerForUser(this.clientUsername);
if (var2 != null)
{
this.mcServer.getConfigurationManager().initializeConnectionToPlayer(this.myTCPConnection, var2);
}
}
this.connectionComplete = true;
}
public void handleErrorMessage(String par1Str, Object[] par2ArrayOfObj)
{
this.mcServer.getLogAgent().logInfo(this.getUsernameAndAddress() + " lost connection");
this.connectionComplete = true;
}
/**
* Handle a server ping packet.
*/
public void handleServerPing(Packet254ServerPing par1Packet254ServerPing)
{
try
{
ServerConfigurationManager var2 = this.mcServer.getConfigurationManager();
String var3 = null;
if (par1Packet254ServerPing.func_140050_d())
{
var3 = this.mcServer.getMOTD() + "\u00a7" + var2.getCurrentPlayerCount() + "\u00a7" + var2.getMaxPlayers();
}
else
{
List var4 = Arrays.asList(new Serializable[] {Integer.valueOf(1), Integer.valueOf(78), this.mcServer.getMinecraftVersion(), this.mcServer.getMOTD(), Integer.valueOf(var2.getCurrentPlayerCount()), Integer.valueOf(var2.getMaxPlayers())});
Object var6;
for (Iterator var5 = var4.iterator(); var5.hasNext(); var3 = var3 + var6.toString().replaceAll("\u0000", ""))
{
var6 = var5.next();
if (var3 == null)
{
var3 = "\u00a7";
}
else
{
var3 = var3 + "\u0000";
}
}
}
InetAddress var8 = null;
if (this.myTCPConnection.getSocket() != null)
{
var8 = this.myTCPConnection.getSocket().getInetAddress();
}
this.myTCPConnection.addToSendQueue(new Packet255KickDisconnect(var3));
this.myTCPConnection.serverShutdown();
if (var8 != null && this.mcServer.getNetworkThread() instanceof DedicatedServerListenThread)
{
((DedicatedServerListenThread)this.mcServer.getNetworkThread()).func_71761_a(var8);
}
this.connectionComplete = true;
}
catch (Exception var7)
{
var7.printStackTrace();
}
}
/**
* Default handler called for packets that don't have their own handlers in NetClientHandler; currentlly does
* nothing.
*/
public void unexpectedPacket(Packet par1Packet)
{
this.raiseErrorAndDisconnect("Protocol error");
}
public String getUsernameAndAddress()
{
return this.clientUsername != null ? this.clientUsername + " [" + this.myTCPConnection.getSocketAddress().toString() + "]" : this.myTCPConnection.getSocketAddress().toString();
}
/**
* determine if it is a server handler
*/
public boolean isServerHandler()
{
return true;
}
public boolean isConnectionClosed()
{
return this.connectionComplete;
}
/**
* Returns the server Id randomly generated by this login handler.
*/
static String getServerId(NetLoginHandler par0NetLoginHandler)
{
return par0NetLoginHandler.loginServerId;
}
/**
* Returns the reference to Minecraft Server.
*/
static MinecraftServer getLoginMinecraftServer(NetLoginHandler par0NetLoginHandler)
{
return par0NetLoginHandler.mcServer;
}
/**
* Return the secret AES sharedKey
*/
static SecretKey getSharedKey(NetLoginHandler par0NetLoginHandler)
{
return par0NetLoginHandler.sharedKey;
}
/**
* Returns the connecting client username.
*/
static String getClientUsername(NetLoginHandler par0NetLoginHandler)
{
return par0NetLoginHandler.clientUsername;
}
static boolean func_72531_a(NetLoginHandler par0NetLoginHandler, boolean par1)
{
return par0NetLoginHandler.field_72544_i = par1;
}
}

View File

@ -1,89 +1,46 @@
package net.minecraft.src;
import org.lwjgl.opengl.ARBMultitexture;
import org.lwjgl.opengl.GL13;
import org.lwjgl.opengl.GLContext;
import net.lax1dude.eaglercraft.EaglerAdapter;
public class OpenGlHelper
{
public class OpenGlHelper {
/**
* An OpenGL constant corresponding to GL_TEXTURE0, used when setting data pertaining to auxiliary OpenGL texture
* units.
* An OpenGL constant corresponding to GL_TEXTURE0, used when setting data
* pertaining to auxiliary OpenGL texture units.
*/
public static int defaultTexUnit;
/**
* An OpenGL constant corresponding to GL_TEXTURE1, used when setting data pertaining to auxiliary OpenGL texture
* units.
* An OpenGL constant corresponding to GL_TEXTURE1, used when setting data
* pertaining to auxiliary OpenGL texture units.
*/
public static int lightmapTexUnit;
/**
* True if the renderer supports multitextures and the OpenGL version != 1.3
*/
private static boolean useMultitextureARB;
/**
* Initializes the texture constants to be used when rendering lightmap values
*/
public static void initializeTextures()
{
useMultitextureARB = GLContext.getCapabilities().GL_ARB_multitexture && !GLContext.getCapabilities().OpenGL13;
if (useMultitextureARB)
{
defaultTexUnit = 33984;
lightmapTexUnit = 33985;
}
else
{
defaultTexUnit = 33984;
lightmapTexUnit = 33985;
}
public static void initializeTextures() {
defaultTexUnit = EaglerAdapter.GL_TEXTURE0;
lightmapTexUnit = EaglerAdapter.GL_TEXTURE1;
}
/**
* Sets the current lightmap texture to the specified OpenGL constant
*/
public static void setActiveTexture(int par0)
{
if (useMultitextureARB)
{
ARBMultitexture.glActiveTextureARB(par0);
}
else
{
GL13.glActiveTexture(par0);
}
public static void setActiveTexture(int par0) {
EaglerAdapter.glActiveTexture(par0);
}
/**
* Sets the current lightmap texture to the specified OpenGL constant
*/
public static void setClientActiveTexture(int par0)
{
if (useMultitextureARB)
{
ARBMultitexture.glClientActiveTextureARB(par0);
}
else
{
GL13.glClientActiveTexture(par0);
}
public static void setClientActiveTexture(int par0) {
EaglerAdapter.glClientActiveTexture(par0);
}
/**
* Sets the current coordinates of the given lightmap texture
*/
public static void setLightmapTextureCoords(int par0, float par1, float par2)
{
if (useMultitextureARB)
{
ARBMultitexture.glMultiTexCoord2fARB(par0, par1, par2);
}
else
{
GL13.glMultiTexCoord2f(par0, par1, par2);
}
public static void setLightmapTextureCoords(int par0, float par1, float par2) {
EaglerAdapter.glMultiTexCoord2f(par0, par1, par2);
}
}

View File

@ -399,7 +399,6 @@ public class RenderGlobal implements IWorldAccess
}
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.mc.getTextureManager(), this.mc.fontRenderer, this.mc.renderViewEntity, this.mc.pointedEntityLiving, this.mc.gameSettings, par3);
this.countEntitiesTotal = 0;
@ -413,7 +412,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;
@ -430,8 +428,6 @@ public class RenderGlobal implements IWorldAccess
}
}
this.theWorld.theProfiler.endStartSection("entities");
for (var6 = 0; var6 < var5.size(); ++var6)
{
var7 = (Entity)var5.get(var6);
@ -455,7 +451,6 @@ public class RenderGlobal implements IWorldAccess
}
}
this.theWorld.theProfiler.endStartSection("tileentities");
RenderHelper.enableStandardItemLighting();
for (var6 = 0; var6 < this.tileEntities.size(); ++var6)
@ -464,7 +459,6 @@ public class RenderGlobal implements IWorldAccess
}
this.mc.entityRenderer.disableLightmap((double)par3);
this.theWorld.theProfiler.endSection();
}
}
@ -580,8 +574,6 @@ public class RenderGlobal implements IWorldAccess
*/
public int sortAndRender(EntityLivingBase par1EntityLivingBase, int par2, double par3)
{
this.theWorld.theProfiler.startSection("sortchunks");
for (int var5 = 0; var5 < 10; ++var5)
{
this.worldRenderersCheckIndex = (this.worldRenderersCheckIndex + 1) % this.worldRenderers.length;
@ -639,12 +631,10 @@ public class RenderGlobal implements IWorldAccess
this.sortedWorldRenderers[var20].isVisible = true;
}
this.theWorld.theProfiler.endStartSection("render");
var34 = var17 + this.renderSortedRenderers(var18, var19, par2, par3);
do
{
this.theWorld.theProfiler.endStartSection("occ");
int var35 = var19;
var19 *= 2;
@ -659,9 +649,7 @@ public class RenderGlobal implements IWorldAccess
EaglerAdapter.glDisable(EaglerAdapter.GL_FOG);
EaglerAdapter.glColorMask(false, false, false, false);
EaglerAdapter.glDepthMask(false);
this.theWorld.theProfiler.startSection("check");
this.checkOcclusionQueryResult(var35, var19);
this.theWorld.theProfiler.endSection();
EaglerAdapter.glPushMatrix();
float var36 = 0.0F;
float var21 = 0.0F;
@ -703,11 +691,9 @@ public class RenderGlobal implements IWorldAccess
var22 += var32;
}
this.theWorld.theProfiler.startSection("bb");
ARBOcclusionQuery.glBeginQueryARB(ARBOcclusionQuery.GL_SAMPLES_PASSED_ARB, this.sortedWorldRenderers[var23].glOcclusionQuery);
this.sortedWorldRenderers[var23].callOcclusionQueryList();
ARBOcclusionQuery.glEndQueryARB(ARBOcclusionQuery.GL_SAMPLES_PASSED_ARB);
this.theWorld.theProfiler.endSection();
this.sortedWorldRenderers[var23].isWaitingOnOcclusionQuery = true;
}
}
@ -736,18 +722,15 @@ public class RenderGlobal implements IWorldAccess
EaglerAdapter.glEnable(EaglerAdapter.GL_TEXTURE_2D);
EaglerAdapter.glEnable(EaglerAdapter.GL_ALPHA_TEST);
EaglerAdapter.glEnable(EaglerAdapter.GL_FOG);
this.theWorld.theProfiler.endStartSection("render");
var34 += this.renderSortedRenderers(var35, var19, par2, par3);
}
while (var19 < this.sortedWorldRenderers.length);
}
else
{
this.theWorld.theProfiler.endStartSection("render");
var34 = var17 + this.renderSortedRenderers(0, this.sortedWorldRenderers.length, par2, par3);
}
this.theWorld.theProfiler.endSection();
return var34;
}
@ -1387,7 +1370,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;
@ -1448,9 +1430,6 @@ public class RenderGlobal implements IWorldAccess
}
}
this.theWorld.theProfiler.endSection();
this.theWorld.theProfiler.startSection("sort");
if (var6 != null)
{
if (var6.size() > 1)
@ -1466,9 +1445,7 @@ public class RenderGlobal implements IWorldAccess
}
}
this.theWorld.theProfiler.endSection();
var9 = 0;
this.theWorld.theProfiler.startSection("rebuild");
int var16;
for (var16 = var3 - 1; var16 >= 0; --var16)
@ -1490,8 +1467,6 @@ public class RenderGlobal implements IWorldAccess
}
}
this.theWorld.theProfiler.endSection();
this.theWorld.theProfiler.startSection("cleanup");
var16 = 0;
var11 = 0;
@ -1523,16 +1498,12 @@ public class RenderGlobal implements IWorldAccess
}
}
this.theWorld.theProfiler.endSection();
this.theWorld.theProfiler.startSection("trim");
while (true)
{
--var16;
if (var16 < var11)
{
this.theWorld.theProfiler.endSection();
return var7 == var8 + var9;
}

View File

@ -512,15 +512,7 @@ public class RenderPlayer extends RendererLivingEntity
}else {
TextureLocation tx = null;
if(DefaultSkinRenderer.defaultVanillaSkins[EaglerProfile.presetSkinId] == null) {
if(DefaultSkinRenderer.defaultHighPoly[EaglerProfile.presetSkinId] == null) {
tx = entityTexture;
}else {
if(Minecraft.getMinecraft().gameSettings.allowFNAWSkins) {
tx = DefaultSkinRenderer.defaultHighPoly[EaglerProfile.presetSkinId].texture;
}else {
tx = DefaultSkinRenderer.defaultHighPoly[EaglerProfile.presetSkinId].fallbackTexture;
}
}
tx = entityTexture;
}else {
tx = DefaultSkinRenderer.defaultVanillaSkins[EaglerProfile.presetSkinId];
}

View File

@ -431,7 +431,6 @@ public abstract class ServerConfigurationManager
double var13 = par1Entity.posY;
double var15 = par1Entity.posZ;
float var17 = par1Entity.rotationYaw;
par3WorldServer.theProfiler.startSection("moving");
if (par1Entity.dimension == -1)
{
@ -479,11 +478,8 @@ public abstract 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);
@ -495,7 +491,6 @@ public abstract class ServerConfigurationManager
par4WorldServer.getDefaultTeleporter().placeInPortal(par1Entity, var11, var13, var15, var17);
}
par3WorldServer.theProfiler.endSection();
}
par1Entity.setWorld(par4WorldServer);

View File

@ -1,131 +0,0 @@
package net.minecraft.src;
import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
public class ServerListenThread extends Thread
{
private final List pendingConnections = Collections.synchronizedList(new ArrayList());
/**
* This map stores a list of InetAddresses and the last time which they connected at
*/
private final HashMap recentConnections = new HashMap();
private int connectionCounter;
private final ServerSocket myServerSocket;
private NetworkListenThread myNetworkListenThread;
private final InetAddress myServerAddress;
private final int myPort;
public ServerListenThread(NetworkListenThread par1NetworkListenThread, InetAddress par2InetAddress, int par3) throws IOException
{
super("Listen thread");
this.myNetworkListenThread = par1NetworkListenThread;
this.myPort = par3;
this.myServerSocket = new ServerSocket(par3, 0, par2InetAddress);
this.myServerAddress = par2InetAddress == null ? this.myServerSocket.getInetAddress() : par2InetAddress;
this.myServerSocket.setPerformancePreferences(0, 2, 1);
}
public void processPendingConnections()
{
List var1 = this.pendingConnections;
synchronized (this.pendingConnections)
{
for (int var2 = 0; var2 < this.pendingConnections.size(); ++var2)
{
NetLoginHandler var3 = (NetLoginHandler)this.pendingConnections.get(var2);
try
{
var3.tryLogin();
}
catch (Exception var6)
{
var3.raiseErrorAndDisconnect("Internal server error");
this.myNetworkListenThread.getServer().getLogAgent().logWarningException("Failed to handle packet for " + var3.getUsernameAndAddress() + ": " + var6, var6);
}
if (var3.connectionComplete)
{
this.pendingConnections.remove(var2--);
}
var3.myTCPConnection.wakeThreads();
}
}
}
public void run()
{
while (this.myNetworkListenThread.isListening)
{
try
{
Socket var1 = this.myServerSocket.accept();
NetLoginHandler var2 = new NetLoginHandler(this.myNetworkListenThread.getServer(), var1, "Connection #" + this.connectionCounter++);
this.addPendingConnection(var2);
}
catch (IOException var3)
{
var3.printStackTrace();
}
}
this.myNetworkListenThread.getServer().getLogAgent().logInfo("Closing listening thread");
}
private void addPendingConnection(NetLoginHandler par1NetLoginHandler)
{
if (par1NetLoginHandler == null)
{
throw new IllegalArgumentException("Got null pendingconnection!");
}
else
{
List var2 = this.pendingConnections;
synchronized (this.pendingConnections)
{
this.pendingConnections.add(par1NetLoginHandler);
}
}
}
public void func_71769_a(InetAddress par1InetAddress)
{
if (par1InetAddress != null)
{
HashMap var2 = this.recentConnections;
synchronized (this.recentConnections)
{
this.recentConnections.remove(par1InetAddress);
}
}
}
public void func_71768_b()
{
try
{
this.myServerSocket.close();
}
catch (Throwable var2)
{
;
}
}
public int getMyPort()
{
return this.myPort;
}
}

View File

@ -84,7 +84,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);
@ -140,12 +139,11 @@ public abstract class World implements IBlockAccess
return this.provider.worldChunkMgr;
}
public World(ISaveHandler par1ISaveHandler, String par2Str, WorldProvider par3WorldProvider, WorldSettings par4WorldSettings, Profiler par5Profiler)
public World(ISaveHandler par1ISaveHandler, String par2Str, WorldProvider par3WorldProvider, WorldSettings par4WorldSettings)
{
this.ambientTickCountdown = this.rand.nextInt(12000);
this.lightUpdateBlockList = new int[32768];
this.saveHandler = par1ISaveHandler;
this.theProfiler = par5Profiler;
this.worldInfo = new WorldInfo(par4WorldSettings, par2Str);
this.provider = par3WorldProvider;
this.mapStorage = new MapStorage(par1ISaveHandler);
@ -168,12 +166,11 @@ public abstract class World implements IBlockAccess
this.calculateInitialWeather();
}
public World(ISaveHandler par1ISaveHandler, String par2Str, WorldSettings par3WorldSettings, WorldProvider par4WorldProvider, Profiler par5Profiler)
public World(ISaveHandler par1ISaveHandler, String par2Str, WorldSettings par3WorldSettings, WorldProvider par4WorldProvider)
{
this.ambientTickCountdown = this.rand.nextInt(12000);
this.lightUpdateBlockList = new int[32768];
this.saveHandler = par1ISaveHandler;
this.theProfiler = par5Profiler;
this.mapStorage = new MapStorage(par1ISaveHandler);
this.worldInfo = par1ISaveHandler.loadWorldInfo();
@ -443,9 +440,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)
{
@ -1893,8 +1888,6 @@ public abstract class World implements IBlockAccess
*/
public void updateEntities()
{
this.theProfiler.startSection("entities");
this.theProfiler.startSection("global");
int var1;
Entity var2;
CrashReport var4;
@ -1932,7 +1925,6 @@ public abstract class World implements IBlockAccess
}
}
this.theProfiler.endStartSection("remove");
this.loadedEntityList.removeAll(this.unloadedEntityList);
int var3;
int var13;
@ -1955,7 +1947,6 @@ public abstract class World implements IBlockAccess
}
this.unloadedEntityList.clear();
this.theProfiler.endStartSection("regular");
for (var1 = 0; var1 < this.loadedEntityList.size(); ++var1)
{
@ -1972,7 +1963,6 @@ public abstract class World implements IBlockAccess
var2.ridingEntity = null;
}
this.theProfiler.startSection("tick");
if (!var2.isDead)
{
@ -1989,8 +1979,6 @@ public abstract class World implements IBlockAccess
}
}
this.theProfiler.endSection();
this.theProfiler.startSection("remove");
if (var2.isDead)
{
@ -2006,10 +1994,8 @@ public abstract class World implements IBlockAccess
this.onEntityRemoved(var2);
}
this.theProfiler.endSection();
}
this.theProfiler.endStartSection("tileEntities");
this.scanningTileEntities = true;
Iterator var14 = this.loadedTileEntityList.iterator();
@ -2056,7 +2042,6 @@ public abstract class World implements IBlockAccess
this.entityRemoval.clear();
}
this.theProfiler.endStartSection("pendingTileEntities");
if (!this.addedTileEntityList.isEmpty())
{
@ -2088,8 +2073,6 @@ public abstract class World implements IBlockAccess
this.addedTileEntityList.clear();
}
this.theProfiler.endSection();
this.theProfiler.endSection();
}
public void addTileEntity(Collection par1Collection)
@ -2144,8 +2127,6 @@ public abstract class World implements IBlockAccess
}
}
this.theProfiler.startSection("chunkCheck");
if (Double.isNaN(par1Entity.posX) || Double.isInfinite(par1Entity.posX))
{
par1Entity.posX = par1Entity.lastTickPosX;
@ -2193,8 +2174,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)
@ -2975,7 +2954,6 @@ public abstract class World implements IBlockAccess
protected void setActivePlayerChunksAndCheckLight()
{
this.activeChunkSet.clear();
this.theProfiler.startSection("buildList");
int var1;
EntityPlayer var2;
int var3;
@ -2997,15 +2975,12 @@ 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());
@ -3015,13 +2990,10 @@ 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)
{
@ -3045,8 +3017,6 @@ public abstract class World implements IBlockAccess
}
}
}
this.theProfiler.endStartSection("checkLight");
par3Chunk.enqueueRelightChecks();
}
@ -3234,7 +3204,6 @@ public abstract class World implements IBlockAccess
{
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;
@ -3297,9 +3266,6 @@ public abstract class World implements IBlockAccess
var5 = 0;
}
this.theProfiler.endSection();
this.theProfiler.startSection("checkedPosition < toCheckCount");
while (var5 < var6)
{
var9 = this.lightUpdateBlockList[var5++];
@ -3355,8 +3321,6 @@ public abstract class World implements IBlockAccess
}
}
}
this.theProfiler.endSection();
}
}
@ -3556,7 +3520,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);
@ -3569,13 +3532,11 @@ 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);
@ -3588,7 +3549,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

@ -29,9 +29,9 @@ public class WorldClient extends World
private final Minecraft mc = Minecraft.getMinecraft();
private final Set previousActiveChunkSet = new HashSet();
public WorldClient(NetClientHandler par1NetClientHandler, WorldSettings par2WorldSettings, int par3, int par4, Profiler par5Profiler)
public WorldClient(NetClientHandler par1NetClientHandler, WorldSettings par2WorldSettings, int par3, int par4)
{
super(new SaveHandlerMP(), "MpServer", WorldProvider.getProviderForDimension(par3), par2WorldSettings, par5Profiler);
super(new SaveHandlerMP(), "MpServer", WorldProvider.getProviderForDimension(par3), par2WorldSettings);
this.sendQueue = par1NetClientHandler;
this.difficultySetting = par4;
this.setSpawnLocation(8, 64, 8);
@ -51,7 +51,6 @@ public class WorldClient extends World
this.setWorldTime(this.getWorldTime() + 1L);
}
this.theProfiler.startSection("reEntryProcessing");
for (int var1 = 0; var1 < 10 && !this.entitySpawnQueue.isEmpty(); ++var1)
{
@ -64,13 +63,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();
}
/**
@ -113,10 +108,8 @@ public class WorldClient extends World
{
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

@ -51,7 +51,7 @@ public class WorldServer extends World
public WorldServer(MinecraftServer par1MinecraftServer, ISaveHandler par2ISaveHandler, String par3Str, int par4, WorldSettings par5WorldSettings, Profiler par6Profiler, ILogAgent par7ILogAgent)
{
super(par2ISaveHandler, par3Str, par5WorldSettings, WorldProvider.getProviderForDimension(par4), par6Profiler);
super(par2ISaveHandler, par3Str, par5WorldSettings, WorldProvider.getProviderForDimension(par4));
this.mcServer = par1MinecraftServer;
this.theEntityTracker = new EntityTracker(this);
this.thePlayerManager = new PlayerManager(this, par1MinecraftServer.getConfigurationManager().getViewDistance());
@ -110,14 +110,11 @@ public class WorldServer extends World
this.wakeAllPlayers();
}
this.theProfiler.startSection("mobSpawner");
if (this.getGameRules().getGameRuleBooleanValue("doMobSpawning"))
{
this.animalSpawner.findChunksForSpawning(this, this.spawnHostileMobs, this.spawnPeacefulMobs, this.worldInfo.getWorldTotalTime() % 400L == 0L);
}
this.theProfiler.endStartSection("chunkSource");
this.chunkProvider.unloadQueuedChunks();
int var3 = this.calculateSkylightSubtracted(1.0F);
@ -133,18 +130,12 @@ public class WorldServer extends World
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.worldTeleporter.removeStalePortalLocations(this.getTotalWorldTime());
this.theProfiler.endSection();
this.sendAndApplyBlockEvents();
}
@ -275,12 +266,9 @@ 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");
var7.updateSkylight();
this.theProfiler.endStartSection("thunder");
int var8;
int var9;
int var10;
@ -300,7 +288,6 @@ public class WorldServer extends World
}
}
this.theProfiler.endStartSection("iceandsnow");
int var13;
if (this.rand.nextInt(16) == 0)
@ -337,7 +324,6 @@ public class WorldServer extends World
}
}
this.theProfiler.endStartSection("tickTiles");
ExtendedBlockStorage[] var19 = var7.getBlockStorageArray();
var9 = var19.length;
@ -366,8 +352,6 @@ public class WorldServer extends World
}
}
}
this.theProfiler.endSection();
}
}
@ -497,7 +481,6 @@ public class WorldServer extends World
var2 = 1000;
}
this.theProfiler.startSection("cleaning");
NextTickListEntry var4;
for (int var3 = 0; var3 < var2; ++var3)
@ -514,8 +497,6 @@ public class WorldServer extends World
this.pendingTickListEntriesThisTick.add(var4);
}
this.theProfiler.endSection();
this.theProfiler.startSection("ticking");
Iterator var14 = this.pendingTickListEntriesThisTick.iterator();
while (var14.hasNext())
@ -560,7 +541,6 @@ public class WorldServer extends World
}
}
this.theProfiler.endSection();
this.pendingTickListEntriesThisTick.clear();
return !this.pendingTickListEntriesTreeSet.isEmpty();
}