Compare commits
2 commits
8e29869a76
...
968ca5bb0e
Author | SHA1 | Date | |
---|---|---|---|
968ca5bb0e | |||
027c27b90c |
67 changed files with 908 additions and 735 deletions
|
@ -168,7 +168,7 @@ public abstract class Minecraft implements Runnable {
|
|||
Display.setDisplayMode(new DisplayMode(this.displayWidth, this.displayHeight));
|
||||
}
|
||||
|
||||
Display.setTitle("Minecraft Minecraft Alpha v1.0.15");
|
||||
Display.setTitle("Minecraft Minecraft Alpha v1.0.16");
|
||||
|
||||
try {
|
||||
Display.create();
|
||||
|
@ -928,7 +928,7 @@ public abstract class Minecraft implements Runnable {
|
|||
}
|
||||
|
||||
if(this.theWorld != null) {
|
||||
this.theWorld.difficultySetting = this.options.difficulty;
|
||||
this.theWorld.j = this.options.difficulty;
|
||||
if(!this.isGamePaused) {
|
||||
this.entityRenderer.updateRenderer();
|
||||
}
|
||||
|
@ -958,14 +958,14 @@ public abstract class Minecraft implements Runnable {
|
|||
}
|
||||
|
||||
public boolean isMultiplayerWorld() {
|
||||
return this.theWorld != null && this.theWorld.multiplayerWorld;
|
||||
return this.theWorld != null && this.theWorld.worldChunkLoadOverride;
|
||||
}
|
||||
|
||||
public void startWorld(String var1) {
|
||||
this.changeWorld1((World)null);
|
||||
System.gc();
|
||||
World var2 = new World(new File(getMinecraftDir(), "saves"), var1);
|
||||
if(var2.isNewWorld) {
|
||||
if(var2.p) {
|
||||
this.changeWorld(var2, "Generating level");
|
||||
} else {
|
||||
this.changeWorld(var2, "Loading level");
|
||||
|
@ -986,7 +986,7 @@ public abstract class Minecraft implements Runnable {
|
|||
this.theWorld = var1;
|
||||
if(var1 != null) {
|
||||
this.playerController.onWorldChange(var1);
|
||||
var1.fontRenderer = this.fontRenderer;
|
||||
var1.k = this.fontRenderer;
|
||||
if(!this.isMultiplayerWorld()) {
|
||||
this.thePlayer = (EntityPlayerSP)var1.createDebugPlayer(EntityPlayerSP.class);
|
||||
} else if(this.thePlayer != null) {
|
||||
|
@ -996,7 +996,7 @@ public abstract class Minecraft implements Runnable {
|
|||
}
|
||||
}
|
||||
|
||||
if(!var1.multiplayerWorld) {
|
||||
if(!var1.worldChunkLoadOverride) {
|
||||
this.preloadWorld(var2);
|
||||
}
|
||||
|
||||
|
@ -1017,7 +1017,7 @@ public abstract class Minecraft implements Runnable {
|
|||
|
||||
this.playerController.onRespawn(this.thePlayer);
|
||||
var1.spawnPlayerWithLoadedChunks(this.thePlayer);
|
||||
if(var1.isNewWorld) {
|
||||
if(var1.p) {
|
||||
var1.saveWorldIndirectly(this.loadingScreen);
|
||||
}
|
||||
} else {
|
||||
|
@ -1037,8 +1037,8 @@ public abstract class Minecraft implements Runnable {
|
|||
var4 *= var4;
|
||||
|
||||
for(int var5 = -var2; var5 <= var2; var5 += 16) {
|
||||
int var6 = this.theWorld.spawnX;
|
||||
int var7 = this.theWorld.spawnZ;
|
||||
int var6 = this.theWorld.m;
|
||||
int var7 = this.theWorld.spawnY;
|
||||
if(this.thePlayer != null) {
|
||||
var6 = (int)this.thePlayer.posX;
|
||||
var7 = (int)this.thePlayer.posZ;
|
||||
|
@ -1107,12 +1107,12 @@ public abstract class Minecraft implements Runnable {
|
|||
this.preloadWorld("Respawning");
|
||||
}
|
||||
|
||||
public static void startMainThread() {
|
||||
startMainThread((String)null, (String)null);
|
||||
public static void startMainThread(String var0, String var1) {
|
||||
startMainThread(var0, var1, (String)null);
|
||||
}
|
||||
|
||||
public static void startMainThread(String var0, String var1) {
|
||||
boolean var2 = false;
|
||||
public static void startMainThread(String var0, String var1, String var2) {
|
||||
boolean var3 = false;
|
||||
Frame var5 = new Frame("Minecraft");
|
||||
Canvas var6 = new Canvas();
|
||||
var5.setLayout(new BorderLayout());
|
||||
|
@ -1120,19 +1120,19 @@ public abstract class Minecraft implements Runnable {
|
|||
var6.setPreferredSize(new Dimension(854, 480));
|
||||
var5.pack();
|
||||
var5.setLocationRelativeTo((Component)null);
|
||||
MinecraftImpl var7 = new MinecraftImpl(var5, var6, (MinecraftApplet)null, 854, 480, var2, var5);
|
||||
MinecraftImpl var7 = new MinecraftImpl(var5, var6, (MinecraftApplet)null, 854, 480, var3, var5);
|
||||
Thread var8 = new Thread(var7, "Minecraft main thread");
|
||||
var8.setPriority(10);
|
||||
var7.appletMode = false;
|
||||
var7.minecraftUri = "www.minecraft.net";
|
||||
if(var0 != null && var0 != null) {
|
||||
var7.session = new Session(var0, var0);
|
||||
if(var0 != null && var1 != null) {
|
||||
var7.session = new Session(var0, var1);
|
||||
} else {
|
||||
var7.session = new Session("Player" + System.currentTimeMillis() % 1000L, "");
|
||||
}
|
||||
|
||||
if(var1 != null) {
|
||||
String[] var9 = var1.split(":");
|
||||
if(var2 != null) {
|
||||
String[] var9 = var2.split(":");
|
||||
var7.setServer(var9[0], Integer.parseInt(var9[1]));
|
||||
}
|
||||
|
||||
|
@ -1142,6 +1142,16 @@ public abstract class Minecraft implements Runnable {
|
|||
}
|
||||
|
||||
public static void main(String[] var0) {
|
||||
startMainThread();
|
||||
String var1 = "Player";
|
||||
if(var0.length > 0) {
|
||||
var1 = var0[0];
|
||||
}
|
||||
|
||||
String var2 = "-";
|
||||
if(var0.length > 1) {
|
||||
var2 = var0[1];
|
||||
}
|
||||
|
||||
startMainThread(var1, var2);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -281,17 +281,17 @@ public class Block {
|
|||
}
|
||||
|
||||
public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6) {
|
||||
if(!var1.multiplayerWorld) {
|
||||
int var7 = this.quantityDropped(var1.rand);
|
||||
if(!var1.worldChunkLoadOverride) {
|
||||
int var7 = this.quantityDropped(var1.l);
|
||||
|
||||
for(int var8 = 0; var8 < var7; ++var8) {
|
||||
if(var1.rand.nextFloat() <= var6) {
|
||||
int var9 = this.idDropped(var5, var1.rand);
|
||||
if(var1.l.nextFloat() <= var6) {
|
||||
int var9 = this.idDropped(var5, var1.l);
|
||||
if(var9 > 0) {
|
||||
float var10 = 0.7F;
|
||||
double var11 = (double)(var1.rand.nextFloat() * var10) + (double)(1.0F - var10) * 0.5D;
|
||||
double var13 = (double)(var1.rand.nextFloat() * var10) + (double)(1.0F - var10) * 0.5D;
|
||||
double var15 = (double)(var1.rand.nextFloat() * var10) + (double)(1.0F - var10) * 0.5D;
|
||||
double var11 = (double)(var1.l.nextFloat() * var10) + (double)(1.0F - var10) * 0.5D;
|
||||
double var13 = (double)(var1.l.nextFloat() * var10) + (double)(1.0F - var10) * 0.5D;
|
||||
double var15 = (double)(var1.l.nextFloat() * var10) + (double)(1.0F - var10) * 0.5D;
|
||||
EntityItem var17 = new EntityItem(var1, (double)var2 + var11, (double)var3 + var13, (double)var4 + var15, new ItemStack(var9));
|
||||
var17.delayBeforeCanPickup = 10;
|
||||
var1.spawnEntityInWorld(var17);
|
||||
|
|
|
@ -86,11 +86,11 @@ public class BlockCrops extends BlockFlower {
|
|||
super.onBlockDestroyedByPlayer(var1, var2, var3, var4, var5);
|
||||
|
||||
for(int var6 = 0; var6 < 3; ++var6) {
|
||||
if(var1.rand.nextInt(15) <= var5) {
|
||||
if(var1.l.nextInt(15) <= var5) {
|
||||
float var7 = 0.7F;
|
||||
float var8 = var1.rand.nextFloat() * var7 + (1.0F - var7) * 0.5F;
|
||||
float var9 = var1.rand.nextFloat() * var7 + (1.0F - var7) * 0.5F;
|
||||
float var10 = var1.rand.nextFloat() * var7 + (1.0F - var7) * 0.5F;
|
||||
float var8 = var1.l.nextFloat() * var7 + (1.0F - var7) * 0.5F;
|
||||
float var9 = var1.l.nextFloat() * var7 + (1.0F - var7) * 0.5F;
|
||||
float var10 = var1.l.nextFloat() * var7 + (1.0F - var7) * 0.5F;
|
||||
EntityItem var11 = new EntityItem(var1, (double)((float)var2 + var8), (double)((float)var3 + var9), (double)((float)var4 + var10), new ItemStack(Item.seeds));
|
||||
var11.delayBeforeCanPickup = 10;
|
||||
var1.spawnEntityInWorld(var11);
|
||||
|
|
|
@ -105,9 +105,9 @@ public class BlockDoor extends Block {
|
|||
var1.setBlockMetadataWithNotify(var2, var3, var4, var6 ^ 4);
|
||||
var1.markBlocksDirty(var2, var3 - 1, var4, var2, var3, var4);
|
||||
if(Math.random() < 0.5D) {
|
||||
var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.door_open", 1.0F, var1.rand.nextFloat() * 0.1F + 0.9F);
|
||||
var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.door_open", 1.0F, var1.l.nextFloat() * 0.1F + 0.9F);
|
||||
} else {
|
||||
var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.door_close", 1.0F, var1.rand.nextFloat() * 0.1F + 0.9F);
|
||||
var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.door_close", 1.0F, var1.l.nextFloat() * 0.1F + 0.9F);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -132,9 +132,9 @@ public class BlockDoor extends Block {
|
|||
var1.setBlockMetadataWithNotify(var2, var3, var4, var6 ^ 4);
|
||||
var1.markBlocksDirty(var2, var3 - 1, var4, var2, var3, var4);
|
||||
if(Math.random() < 0.5D) {
|
||||
var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.door_open", 1.0F, var1.rand.nextFloat() * 0.1F + 0.9F);
|
||||
var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.door_open", 1.0F, var1.l.nextFloat() * 0.1F + 0.9F);
|
||||
} else {
|
||||
var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.door_close", 1.0F, var1.rand.nextFloat() * 0.1F + 0.9F);
|
||||
var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.door_close", 1.0F, var1.l.nextFloat() * 0.1F + 0.9F);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ public class BlockFarmland extends Block {
|
|||
}
|
||||
|
||||
public void onEntityWalking(World var1, int var2, int var3, int var4, Entity var5) {
|
||||
if(var1.rand.nextInt(4) == 0) {
|
||||
if(var1.l.nextInt(4) == 0) {
|
||||
var1.setBlockWithNotify(var2, var3, var4, Block.dirt.blockID);
|
||||
}
|
||||
|
||||
|
|
|
@ -64,8 +64,8 @@ public class BlockFire extends Block {
|
|||
if(var6 % 2 == 0 && var6 > 2) {
|
||||
this.tryToCatchBlockOnFire(var1, var2 + 1, var3, var4, 300, var5);
|
||||
this.tryToCatchBlockOnFire(var1, var2 - 1, var3, var4, 300, var5);
|
||||
this.tryToCatchBlockOnFire(var1, var2, var3 - 1, var4, 100, var5);
|
||||
this.tryToCatchBlockOnFire(var1, var2, var3 + 1, var4, 200, var5);
|
||||
this.tryToCatchBlockOnFire(var1, var2, var3 - 1, var4, 200, var5);
|
||||
this.tryToCatchBlockOnFire(var1, var2, var3 + 1, var4, 250, var5);
|
||||
this.tryToCatchBlockOnFire(var1, var2, var3, var4 - 1, 300, var5);
|
||||
this.tryToCatchBlockOnFire(var1, var2, var3, var4 + 1, 300, var5);
|
||||
|
||||
|
|
|
@ -265,7 +265,7 @@ public abstract class BlockFluid extends Block {
|
|||
}
|
||||
|
||||
protected void triggerLavaMixEffects(World var1, int var2, int var3, int var4) {
|
||||
var1.playSoundEffect((double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), "random.fizz", 0.5F, 2.6F + (var1.rand.nextFloat() - var1.rand.nextFloat()) * 0.8F);
|
||||
var1.playSoundEffect((double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), "random.fizz", 0.5F, 2.6F + (var1.l.nextFloat() - var1.l.nextFloat()) * 0.8F);
|
||||
|
||||
for(int var5 = 0; var5 < 8; ++var5) {
|
||||
var1.spawnParticle("largesmoke", (double)var2 + Math.random(), (double)var3 + 1.2D, (double)var4 + Math.random(), 0.0D, 0.0D, 0.0D);
|
||||
|
|
|
@ -24,16 +24,16 @@ public class BlockJukeBox extends Block {
|
|||
var1.setBlockMetadataWithNotify(var2, var3, var4, 0);
|
||||
int var6 = Item.record13.shiftedIndex + var5 - 1;
|
||||
float var7 = 0.7F;
|
||||
double var8 = (double)(var1.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D;
|
||||
double var10 = (double)(var1.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.2D + 0.6D;
|
||||
double var12 = (double)(var1.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D;
|
||||
double var8 = (double)(var1.l.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D;
|
||||
double var10 = (double)(var1.l.nextFloat() * var7) + (double)(1.0F - var7) * 0.2D + 0.6D;
|
||||
double var12 = (double)(var1.l.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D;
|
||||
EntityItem var14 = new EntityItem(var1, (double)var2 + var8, (double)var3 + var10, (double)var4 + var12, new ItemStack(var6));
|
||||
var14.delayBeforeCanPickup = 10;
|
||||
var1.spawnEntityInWorld(var14);
|
||||
}
|
||||
|
||||
public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6) {
|
||||
if(!var1.multiplayerWorld) {
|
||||
if(!var1.worldChunkLoadOverride) {
|
||||
if(var5 > 0) {
|
||||
this.ejectRecord(var1, var2, var3, var4, var5);
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ public class BlockLever extends Block {
|
|||
int var7 = var6 & 8;
|
||||
var6 &= 7;
|
||||
if(var5 == 1 && var1.isBlockNormalCube(var2, var3 - 1, var4)) {
|
||||
var6 = 5 + var1.rand.nextInt(2);
|
||||
var6 = 5 + var1.l.nextInt(2);
|
||||
}
|
||||
|
||||
if(var5 == 2 && var1.isBlockNormalCube(var2, var3, var4 + 1)) {
|
||||
|
@ -62,7 +62,7 @@ public class BlockLever extends Block {
|
|||
} else if(var1.isBlockNormalCube(var2, var3, var4 + 1)) {
|
||||
var1.setBlockMetadataWithNotify(var2, var3, var4, 4);
|
||||
} else if(var1.isBlockNormalCube(var2, var3 - 1, var4)) {
|
||||
var1.setBlockMetadataWithNotify(var2, var3, var4, 5 + var1.rand.nextInt(2));
|
||||
var1.setBlockMetadataWithNotify(var2, var3, var4, 5 + var1.l.nextInt(2));
|
||||
}
|
||||
|
||||
this.checkIfAttachedToBlock(var1, var2, var3, var4);
|
||||
|
|
|
@ -64,7 +64,7 @@ public class BlockRedstoneOre extends Block {
|
|||
}
|
||||
|
||||
private void sparkle(World var1, int var2, int var3, int var4) {
|
||||
Random var5 = var1.rand;
|
||||
Random var5 = var1.l;
|
||||
double var6 = 1.0D / 16.0D;
|
||||
|
||||
for(int var8 = 0; var8 < 6; ++var8) {
|
||||
|
|
|
@ -14,7 +14,7 @@ public class BlockRedstoneTorch extends BlockTorch {
|
|||
|
||||
private boolean checkForBurnout(World var1, int var2, int var3, int var4, boolean var5) {
|
||||
if(var5) {
|
||||
torchUpdates.add(new RedstoneUpdateInfo(var2, var3, var4, var1.worldTime));
|
||||
torchUpdates.add(new RedstoneUpdateInfo(var2, var3, var4, var1.b));
|
||||
}
|
||||
|
||||
int var6 = 0;
|
||||
|
@ -87,7 +87,7 @@ public class BlockRedstoneTorch extends BlockTorch {
|
|||
public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
|
||||
boolean var6 = this.isIndirectlyPowered(var1, var2, var3, var4);
|
||||
|
||||
while(torchUpdates.size() > 0 && var1.worldTime - ((RedstoneUpdateInfo)torchUpdates.get(0)).updateTime > 100L) {
|
||||
while(torchUpdates.size() > 0 && var1.b - ((RedstoneUpdateInfo)torchUpdates.get(0)).updateTime > 100L) {
|
||||
torchUpdates.remove(0);
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ public class BlockRedstoneTorch extends BlockTorch {
|
|||
if(var6) {
|
||||
var1.setBlockAndMetadataWithNotify(var2, var3, var4, Block.torchRedstoneIdle.blockID, var1.getBlockMetadata(var2, var3, var4));
|
||||
if(this.checkForBurnout(var1, var2, var3, var4, true)) {
|
||||
var1.playSoundEffect((double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), "random.fizz", 0.5F, 2.6F + (var1.rand.nextFloat() - var1.rand.nextFloat()) * 0.8F);
|
||||
var1.playSoundEffect((double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), "random.fizz", 0.5F, 2.6F + (var1.l.nextFloat() - var1.l.nextFloat()) * 0.8F);
|
||||
|
||||
for(int var7 = 0; var7 < 5; ++var7) {
|
||||
double var8 = (double)var2 + var5.nextDouble() * 0.6D + 0.2D;
|
||||
|
|
|
@ -42,9 +42,9 @@ public class BlockSnow extends Block {
|
|||
public void harvestBlock(World var1, int var2, int var3, int var4, int var5) {
|
||||
int var6 = Item.snowball.shiftedIndex;
|
||||
float var7 = 0.7F;
|
||||
double var8 = (double)(var1.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D;
|
||||
double var10 = (double)(var1.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D;
|
||||
double var12 = (double)(var1.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D;
|
||||
double var8 = (double)(var1.l.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D;
|
||||
double var10 = (double)(var1.l.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D;
|
||||
double var12 = (double)(var1.l.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D;
|
||||
EntityItem var14 = new EntityItem(var1, (double)var2 + var8, (double)var3 + var10, (double)var4 + var12, new ItemStack(var6));
|
||||
var14.delayBeforeCanPickup = 10;
|
||||
var1.spawnEntityInWorld(var14);
|
||||
|
|
|
@ -22,11 +22,11 @@ public class BlockStationary extends BlockFluid {
|
|||
|
||||
private void setNotStationary(World var1, int var2, int var3, int var4) {
|
||||
int var5 = var1.getBlockMetadata(var2, var3, var4);
|
||||
var1.editingBlocks = true;
|
||||
var1.g = true;
|
||||
var1.setBlockAndMetadata(var2, var3, var4, this.blockID - 1, var5);
|
||||
var1.markBlocksDirty(var2, var3, var4, var2, var3, var4);
|
||||
var1.scheduleBlockUpdate(var2, var3, var4, this.blockID - 1);
|
||||
var1.editingBlocks = false;
|
||||
var1.g = false;
|
||||
}
|
||||
|
||||
public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
|
||||
|
|
|
@ -25,7 +25,7 @@ public class BlockTNT extends Block {
|
|||
|
||||
public void onBlockDestroyedByExplosion(World var1, int var2, int var3, int var4) {
|
||||
EntityTNTPrimed var5 = new EntityTNTPrimed(var1, (float)var2 + 0.5F, (float)var3 + 0.5F, (float)var4 + 0.5F);
|
||||
var5.fuse = var1.rand.nextInt(var5.fuse / 4) + var5.fuse / 8;
|
||||
var5.fuse = var1.l.nextInt(var5.fuse / 4) + var5.fuse / 8;
|
||||
var1.spawnEntityInWorld(var5);
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ public class CanvasIsomPreview extends Canvas implements KeyListener, MouseListe
|
|||
public void loadLevel(String var1) {
|
||||
this.translateX = this.translateY = 0;
|
||||
this.level = new WorldIso(this, new File(this.dataFolder, "saves"), var1);
|
||||
this.level.skylightSubtracted = 0;
|
||||
this.level.d = 0;
|
||||
List var2 = this.zonesToRender;
|
||||
synchronized(var2) {
|
||||
this.zonesToRender.clear();
|
||||
|
@ -111,7 +111,7 @@ public class CanvasIsomPreview extends Canvas implements KeyListener, MouseListe
|
|||
private void setBrightness(int var1) {
|
||||
List var2 = this.zonesToRender;
|
||||
synchronized(var2) {
|
||||
this.level.skylightSubtracted = var1;
|
||||
this.level.d = var1;
|
||||
this.zonesToRender.clear();
|
||||
|
||||
for(int var3 = 0; var3 < 64; ++var3) {
|
||||
|
@ -208,7 +208,7 @@ public class CanvasIsomPreview extends Canvas implements KeyListener, MouseListe
|
|||
var1.scale((double)this.zoomLevel, (double)this.zoomLevel);
|
||||
var1.translate(this.translateX, this.translateY);
|
||||
if(this.level != null) {
|
||||
var1.translate(-(this.level.spawnX + this.level.spawnZ), -(-this.level.spawnX + this.level.spawnZ) + 64);
|
||||
var1.translate(-(this.level.m + this.level.spawnY), -(-this.level.m + this.level.spawnY) + 64);
|
||||
}
|
||||
|
||||
Rectangle var3 = var1.getClipBounds();
|
||||
|
|
|
@ -221,7 +221,7 @@ public class Chunk {
|
|||
int var9 = this.xPosition * 16 + var1;
|
||||
int var10 = this.zPosition * 16 + var3;
|
||||
this.blocks[var1 << 11 | var3 << 7 | var2] = var6;
|
||||
if(var8 != 0 && !this.worldObj.multiplayerWorld) {
|
||||
if(var8 != 0 && !this.worldObj.worldChunkLoadOverride) {
|
||||
Block.blocksList[var8].onBlockRemoval(this.worldObj, var9, var2, var10);
|
||||
}
|
||||
|
||||
|
@ -272,7 +272,7 @@ public class Chunk {
|
|||
this.worldObj.scheduleLightingUpdate(EnumSkyBlock.Sky, var8, var2, var9, var8, var2, var9);
|
||||
this.worldObj.scheduleLightingUpdate(EnumSkyBlock.Block, var8, var2, var9, var8, var2, var9);
|
||||
this.updateSkylight_do(var1, var3);
|
||||
if(var4 != 0 && !this.worldObj.multiplayerWorld) {
|
||||
if(var4 != 0 && !this.worldObj.worldChunkLoadOverride) {
|
||||
Block.blocksList[var4].onBlockAdded(this.worldObj, var8, var2, var9);
|
||||
}
|
||||
|
||||
|
@ -398,10 +398,10 @@ public class Chunk {
|
|||
if(this.getBlockID(var1, var2, var3) != 0 && Block.blocksList[this.getBlockID(var1, var2, var3)] instanceof BlockContainer) {
|
||||
if(this.isChunkLoaded) {
|
||||
if(this.chunkTileEntityMap.get(var5) != null) {
|
||||
this.worldObj.loadedTileEntityList.remove(this.chunkTileEntityMap.get(var5));
|
||||
this.worldObj.loadedEntityList.remove(this.chunkTileEntityMap.get(var5));
|
||||
}
|
||||
|
||||
this.worldObj.loadedTileEntityList.add(var4);
|
||||
this.worldObj.loadedEntityList.add(var4);
|
||||
}
|
||||
|
||||
this.chunkTileEntityMap.put(var5, var4);
|
||||
|
@ -413,14 +413,14 @@ public class Chunk {
|
|||
public void removeChunkBlockTileEntity(int var1, int var2, int var3) {
|
||||
ChunkPosition var4 = new ChunkPosition(var1, var2, var3);
|
||||
if(this.isChunkLoaded) {
|
||||
this.worldObj.loadedTileEntityList.remove(this.chunkTileEntityMap.remove(var4));
|
||||
this.worldObj.loadedEntityList.remove(this.chunkTileEntityMap.remove(var4));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void onChunkLoad() {
|
||||
this.isChunkLoaded = true;
|
||||
this.worldObj.loadedTileEntityList.addAll(this.chunkTileEntityMap.values());
|
||||
this.worldObj.loadedEntityList.addAll(this.chunkTileEntityMap.values());
|
||||
|
||||
for(int var1 = 0; var1 < this.entities.length; ++var1) {
|
||||
this.worldObj.addLoadedEntities(this.entities[var1]);
|
||||
|
@ -430,7 +430,7 @@ public class Chunk {
|
|||
|
||||
public void onChunkUnload() {
|
||||
this.isChunkLoaded = false;
|
||||
this.worldObj.loadedTileEntityList.removeAll(this.chunkTileEntityMap.values());
|
||||
this.worldObj.loadedEntityList.removeAll(this.chunkTileEntityMap.values());
|
||||
|
||||
for(int var1 = 0; var1 < this.entities.length; ++var1) {
|
||||
this.worldObj.unloadEntities(this.entities[var1]);
|
||||
|
@ -491,7 +491,7 @@ public class Chunk {
|
|||
}
|
||||
|
||||
public boolean needsSaving(boolean var1) {
|
||||
return this.neverSave ? false : (this.hasEntities && this.worldObj.worldTime != this.lastSaveTime ? true : this.isModified);
|
||||
return this.neverSave ? false : (this.hasEntities && this.worldObj.b != this.lastSaveTime ? true : this.isModified);
|
||||
}
|
||||
|
||||
public int setChunkData(byte[] var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8) {
|
||||
|
@ -541,6 +541,6 @@ public class Chunk {
|
|||
}
|
||||
|
||||
public Random getRandomWithSeed(long var1) {
|
||||
return new Random(this.worldObj.randomSeed + (long)(this.xPosition * this.xPosition * 4987142) + (long)(this.xPosition * 5947611) + (long)(this.zPosition * this.zPosition) * 4392871L + (long)(this.zPosition * 389711) ^ var1);
|
||||
return new Random(this.worldObj.q + (long)(this.xPosition * this.xPosition * 4987142) + (long)(this.xPosition * 5947611) + (long)(this.zPosition * this.zPosition) * 4392871L + (long)(this.zPosition * 389711) ^ var1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ public class ChunkCache implements IBlockAccess {
|
|||
}
|
||||
|
||||
public float getBrightness(int var1, int var2, int var3) {
|
||||
return World.lightBrightnessTable[this.getLightValue(var1, var2, var3)];
|
||||
return World.h[this.getLightValue(var1, var2, var3)];
|
||||
}
|
||||
|
||||
public int getLightValue(int var1, int var2, int var3) {
|
||||
|
@ -83,7 +83,7 @@ public class ChunkCache implements IBlockAccess {
|
|||
if(var2 < 0) {
|
||||
return 0;
|
||||
} else if(var2 >= 128) {
|
||||
var5 = 15 - this.worldObj.skylightSubtracted;
|
||||
var5 = 15 - this.worldObj.d;
|
||||
if(var5 < 0) {
|
||||
var5 = 0;
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ public class ChunkCache implements IBlockAccess {
|
|||
} else {
|
||||
var5 = (var1 >> 4) - this.chunkX;
|
||||
var6 = (var3 >> 4) - this.chunkZ;
|
||||
return this.chunkArray[var5][var6].getBlockLightValue(var1 & 15, var2, var3 & 15, this.worldObj.skylightSubtracted);
|
||||
return this.chunkArray[var5][var6].getBlockLightValue(var1 & 15, var2, var3 & 15, this.worldObj.d);
|
||||
}
|
||||
} else {
|
||||
return 15;
|
||||
|
|
|
@ -77,7 +77,7 @@ public class ChunkLoader implements IChunkLoader {
|
|||
var1.checkSessionLock();
|
||||
File var3 = this.chunkFileForXZ(var2.xPosition, var2.zPosition);
|
||||
if(var3.exists()) {
|
||||
var1.sizeOnDisk -= var3.length();
|
||||
var1.randomSeed -= var3.length();
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -94,7 +94,7 @@ public class ChunkLoader implements IChunkLoader {
|
|||
}
|
||||
|
||||
var4.renameTo(var3);
|
||||
var1.sizeOnDisk += var3.length();
|
||||
var1.randomSeed += var3.length();
|
||||
} catch (Exception var8) {
|
||||
var8.printStackTrace();
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ public class ChunkLoader implements IChunkLoader {
|
|||
var2.checkSessionLock();
|
||||
var3.setInteger("xPos", var1.xPosition);
|
||||
var3.setInteger("zPos", var1.zPosition);
|
||||
var3.setLong("LastUpdate", var2.worldTime);
|
||||
var3.setLong("LastUpdate", var2.b);
|
||||
var3.setByteArray("Blocks", var1.blocks);
|
||||
var3.setByteArray("Data", var1.data.data);
|
||||
var3.setByteArray("SkyLight", var1.skylightMap.data);
|
||||
|
|
|
@ -75,7 +75,7 @@ public class ChunkProviderGenerate implements IChunkProvider {
|
|||
for(int var50 = 0; var50 < 4; ++var50) {
|
||||
int var51 = 0;
|
||||
if(var11 * 8 + var30 < var5) {
|
||||
if(this.worldObj.snowCovered && var11 * 8 + var30 >= var5 - 1) {
|
||||
if(this.worldObj.c && var11 * 8 + var30 >= var5 - 1) {
|
||||
var51 = Block.ice.blockID;
|
||||
} else {
|
||||
var51 = Block.waterStill.blockID;
|
||||
|
@ -344,13 +344,13 @@ public class ChunkProviderGenerate implements IChunkProvider {
|
|||
|
||||
private void c(int var1, int var2, byte[] var3) {
|
||||
byte var4 = 8;
|
||||
this.rand.setSeed(this.worldObj.randomSeed);
|
||||
this.rand.setSeed(this.worldObj.q);
|
||||
long var5 = this.rand.nextLong() / 2L * 2L + 1L;
|
||||
long var7 = this.rand.nextLong() / 2L * 2L + 1L;
|
||||
|
||||
for(int var9 = var1 - var4; var9 <= var1 + var4; ++var9) {
|
||||
for(int var10 = var2 - var4; var10 <= var2 + var4; ++var10) {
|
||||
this.rand.setSeed((long)var9 * var5 + (long)var10 * var7 ^ this.worldObj.randomSeed);
|
||||
this.rand.setSeed((long)var9 * var5 + (long)var10 * var7 ^ this.worldObj.q);
|
||||
int var11 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(40) + 1) + 1);
|
||||
if(this.rand.nextInt(15) != 0) {
|
||||
var11 = 0;
|
||||
|
@ -484,10 +484,10 @@ public class ChunkProviderGenerate implements IChunkProvider {
|
|||
BlockSand.fallInstantly = true;
|
||||
int var4 = var2 * 16;
|
||||
int var5 = var3 * 16;
|
||||
this.rand.setSeed(this.worldObj.randomSeed);
|
||||
this.rand.setSeed(this.worldObj.q);
|
||||
long var6 = this.rand.nextLong() / 2L * 2L + 1L;
|
||||
long var8 = this.rand.nextLong() / 2L * 2L + 1L;
|
||||
this.rand.setSeed((long)var2 * var6 + (long)var3 * var8 ^ this.worldObj.randomSeed);
|
||||
this.rand.setSeed((long)var2 * var6 + (long)var3 * var8 ^ this.worldObj.q);
|
||||
double var10 = 0.25D;
|
||||
|
||||
int var12;
|
||||
|
@ -637,7 +637,7 @@ public class ChunkProviderGenerate implements IChunkProvider {
|
|||
(new WorldGenLiquids(Block.lavaMoving.blockID)).generate(this.worldObj, this.rand, var15, var16, var17);
|
||||
}
|
||||
|
||||
if(this.worldObj.snowCovered) {
|
||||
if(this.worldObj.c) {
|
||||
for(var14 = var4 + 8 + 0; var14 < var4 + 8 + 16; ++var14) {
|
||||
for(var15 = var5 + 8 + 0; var15 < var5 + 8 + 16; ++var15) {
|
||||
var16 = this.worldObj.getTopSolidOrLiquidBlock(var14, var15);
|
||||
|
|
|
@ -91,7 +91,7 @@ public class ChunkProviderLoadOrGenerate implements IChunkProvider {
|
|||
try {
|
||||
Chunk var3 = this.chunkLoader.loadChunk(this.worldObj, var1, var2);
|
||||
if(var3 != null) {
|
||||
var3.lastSaveTime = this.worldObj.worldTime;
|
||||
var3.lastSaveTime = this.worldObj.b;
|
||||
}
|
||||
|
||||
return var3;
|
||||
|
@ -116,7 +116,7 @@ public class ChunkProviderLoadOrGenerate implements IChunkProvider {
|
|||
private void saveChunk(Chunk var1) {
|
||||
if(this.chunkLoader != null) {
|
||||
try {
|
||||
var1.lastSaveTime = this.worldObj.worldTime;
|
||||
var1.lastSaveTime = this.worldObj.b;
|
||||
this.chunkLoader.saveChunk(this.worldObj, var1);
|
||||
} catch (IOException var3) {
|
||||
var3.printStackTrace();
|
||||
|
|
|
@ -2,21 +2,10 @@ package net.minecraft.src;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
|
||||
import paulscode.sound.codecs.CodecJOrbis;
|
||||
|
||||
public class CodecMus extends CodecJOrbis {
|
||||
private URL myURL;
|
||||
@Override
|
||||
public boolean initialize(URL url)
|
||||
{
|
||||
myURL = url;
|
||||
return super.initialize(url);
|
||||
}
|
||||
|
||||
/*
|
||||
protected InputStream openInputStream() throws IOException {
|
||||
//return new MusInputStream(this, this.url, this.urlConnection.getInputStream());
|
||||
/*protected InputStream openInputStream() throws IOException {
|
||||
return new MusInputStream(this, this.url, this.urlConnection.getInputStream());
|
||||
}*/
|
||||
}
|
||||
|
|
|
@ -177,7 +177,7 @@ public class EntityItem extends Entity {
|
|||
}
|
||||
|
||||
public void onCollideWithPlayer(EntityPlayer var1) {
|
||||
if(!this.worldObj.multiplayerWorld) {
|
||||
if(!this.worldObj.worldChunkLoadOverride) {
|
||||
int var2 = this.item.stackSize;
|
||||
if(this.delayBeforeCanPickup == 0 && var1.inventory.addItemStackToInventory(this.item)) {
|
||||
this.worldObj.playSoundAtEntity(this, "random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
|
||||
|
|
|
@ -113,7 +113,7 @@ public class EntityMinecart extends Entity implements IInventory {
|
|||
|
||||
public void onUpdate() {
|
||||
double var7;
|
||||
if(this.worldObj.multiplayerWorld) {
|
||||
if(this.worldObj.worldChunkLoadOverride) {
|
||||
if(this.turnProgress > 0) {
|
||||
double var41 = this.posX + (this.minecartX - this.posX) / (double)this.turnProgress;
|
||||
double var42 = this.posY + (this.minecartY - this.posY) / (double)this.turnProgress;
|
||||
|
|
|
@ -19,7 +19,7 @@ public class EntityMob extends EntityCreature implements IMobs {
|
|||
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
if(this.worldObj.difficultySetting == 0) {
|
||||
if(this.worldObj.j == 0) {
|
||||
this.setEntityDead();
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ public class EntityPlayer extends EntityLiving {
|
|||
public EntityPlayer(World var1) {
|
||||
super(var1);
|
||||
this.yOffset = 1.62F;
|
||||
this.setLocationAndAngles((double)var1.spawnX + 0.5D, (double)(var1.spawnY + 1), (double)var1.spawnZ + 0.5D, 0.0F, 0.0F);
|
||||
this.setLocationAndAngles((double)var1.m + 0.5D, (double)(var1.spawnX + 1), (double)var1.spawnY + 0.5D, 0.0F, 0.0F);
|
||||
this.health = 20;
|
||||
this.entityType = "humanoid";
|
||||
this.unusedRotation = 180.0F;
|
||||
|
@ -53,7 +53,7 @@ public class EntityPlayer extends EntityLiving {
|
|||
}
|
||||
|
||||
public void onLivingUpdate() {
|
||||
if(this.worldObj.difficultySetting == 0 && this.health < 20 && this.ticksExisted % 20 * 4 == 0) {
|
||||
if(this.worldObj.j == 0 && this.health < 20 && this.ticksExisted % 20 * 4 == 0) {
|
||||
this.heal(1);
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,7 @@ public class EntityPlayer extends EntityLiving {
|
|||
|
||||
public void dropPlayerItemWithRandomChoice(ItemStack var1, boolean var2) {
|
||||
if(var1 != null) {
|
||||
EntityItem var3 = new EntityItem(this.worldObj, this.posX, this.posY - (double)0.3F, this.posZ, var1);
|
||||
EntityItem var3 = new EntityItem(this.worldObj, this.posX, this.posY - (double)0.3F + (double)this.getEyeHeight(), this.posZ, var1);
|
||||
var3.delayBeforeCanPickup = 40;
|
||||
float var4 = 0.1F;
|
||||
float var5;
|
||||
|
@ -201,15 +201,15 @@ public class EntityPlayer extends EntityLiving {
|
|||
return false;
|
||||
} else {
|
||||
if(var1 instanceof EntityMob || var1 instanceof EntityArrow) {
|
||||
if(this.worldObj.difficultySetting == 0) {
|
||||
if(this.worldObj.j == 0) {
|
||||
var2 = 0;
|
||||
}
|
||||
|
||||
if(this.worldObj.difficultySetting == 1) {
|
||||
if(this.worldObj.j == 1) {
|
||||
var2 = var2 / 3 + 1;
|
||||
}
|
||||
|
||||
if(this.worldObj.difficultySetting == 3) {
|
||||
if(this.worldObj.j == 3) {
|
||||
var2 = var2 * 3 / 2;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -377,7 +377,7 @@ public class EntityRenderer {
|
|||
}
|
||||
|
||||
GL11.glDisable(GL11.GL_FOG);
|
||||
if(this.mc.theWorld.snowCovered) {
|
||||
if(this.mc.theWorld.c) {
|
||||
this.renderSnow(var1);
|
||||
}
|
||||
|
||||
|
|
|
@ -120,7 +120,7 @@ public class EntitySlime extends EntityLiving implements IMobs {
|
|||
|
||||
public boolean getCanSpawnHere() {
|
||||
Chunk var1 = this.worldObj.getChunkFromBlockCoords(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY));
|
||||
return (this.size == 1 || this.worldObj.difficultySetting > 0) && this.rand.nextInt(10) == 0 && var1.getRandomWithSeed(987234911L).nextInt(100) == 0 && this.posY < 16.0D;
|
||||
return (this.size == 1 || this.worldObj.j > 0) && this.rand.nextInt(10) == 0 && var1.getRandomWithSeed(987234911L).nextInt(100) == 0 && this.posY < 16.0D;
|
||||
}
|
||||
|
||||
protected float getSoundVolume() {
|
||||
|
|
|
@ -6,7 +6,7 @@ import java.util.List;
|
|||
|
||||
public class Explosion {
|
||||
public void doExplosion(World var1, Entity var2, double var3, double var5, double var7, float var9) {
|
||||
var1.playSoundEffect(var3, var5, var7, "random.explode", 4.0F, (1.0F + (var1.rand.nextFloat() - var1.rand.nextFloat()) * 0.2F) * 0.7F);
|
||||
var1.playSoundEffect(var3, var5, var7, "random.explode", 4.0F, (1.0F + (var1.l.nextFloat() - var1.l.nextFloat()) * 0.2F) * 0.7F);
|
||||
HashSet var10 = new HashSet();
|
||||
float var11 = var9;
|
||||
byte var12 = 16;
|
||||
|
@ -28,7 +28,7 @@ public class Explosion {
|
|||
var16 /= var22;
|
||||
var18 /= var22;
|
||||
var20 /= var22;
|
||||
float var24 = var9 * (0.7F + var1.rand.nextFloat() * 0.6F);
|
||||
float var24 = var9 * (0.7F + var1.l.nextFloat() * 0.6F);
|
||||
var25 = var3;
|
||||
var27 = var5;
|
||||
var29 = var7;
|
||||
|
@ -100,9 +100,9 @@ public class Explosion {
|
|||
int var54 = var1.getBlockId(var52, var53, var26);
|
||||
|
||||
for(int var28 = 0; var28 < 1; ++var28) {
|
||||
var29 = (double)((float)var52 + var1.rand.nextFloat());
|
||||
var55 = (double)((float)var53 + var1.rand.nextFloat());
|
||||
var56 = (double)((float)var26 + var1.rand.nextFloat());
|
||||
var29 = (double)((float)var52 + var1.l.nextFloat());
|
||||
var55 = (double)((float)var53 + var1.l.nextFloat());
|
||||
var56 = (double)((float)var26 + var1.l.nextFloat());
|
||||
var57 = var29 - var3;
|
||||
double var37 = var55 - var5;
|
||||
double var39 = var56 - var7;
|
||||
|
@ -111,7 +111,7 @@ public class Explosion {
|
|||
var37 /= var41;
|
||||
var39 /= var41;
|
||||
double var43 = 0.5D / (var41 / (double)var9 + 0.1D);
|
||||
var43 *= (double)(var1.rand.nextFloat() * var1.rand.nextFloat() + 0.3F);
|
||||
var43 *= (double)(var1.l.nextFloat() * var1.l.nextFloat() + 0.3F);
|
||||
var57 *= var43;
|
||||
var37 *= var43;
|
||||
var39 *= var43;
|
||||
|
|
|
@ -139,7 +139,7 @@ public class GuiIngame extends Gui {
|
|||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
String var21;
|
||||
if(this.mc.options.d) {
|
||||
var8.drawStringWithShadow("Minecraft Alpha v1.0.15 (" + this.mc.debug + ")", 2, 2, 16777215);
|
||||
var8.drawStringWithShadow("Minecraft Alpha v1.0.16 (" + this.mc.debug + ")", 2, 2, 16777215);
|
||||
var8.drawStringWithShadow(this.mc.debugInfoRenders(), 2, 12, 16777215);
|
||||
var8.drawStringWithShadow(this.mc.getEntityDebug(), 2, 22, 16777215);
|
||||
var8.drawStringWithShadow(this.mc.debugInfoEntities(), 2, 32, 16777215);
|
||||
|
@ -152,7 +152,7 @@ public class GuiIngame extends Gui {
|
|||
var21 = "Allocated memory: " + var27 * 100L / var22 + "% (" + var27 / 1024L / 1024L + "MB)";
|
||||
this.drawString(var8, var21, var6 - var8.getStringWidth(var21) - 2, 12, 14737632);
|
||||
} else {
|
||||
var8.drawStringWithShadow("Minecraft Alpha v1.0.15", 2, 2, 16777215);
|
||||
var8.drawStringWithShadow("Minecraft Alpha v1.0.16", 2, 2, 16777215);
|
||||
}
|
||||
|
||||
if(this.recordPlayingUpFor > 0) {
|
||||
|
|
|
@ -17,14 +17,14 @@ public class ItemHoe extends Item {
|
|||
var3.playSoundEffect((double)((float)var4 + 0.5F), (double)((float)var5 + 0.5F), (double)((float)var6 + 0.5F), var10.stepSound.getStepSound(), (var10.stepSound.getVolume() + 1.0F) / 2.0F, var10.stepSound.getPitch() * 0.8F);
|
||||
var3.setBlockWithNotify(var4, var5, var6, var10.blockID);
|
||||
var1.damageItem(1);
|
||||
if(var3.rand.nextInt(8) == 0 && var8 == Block.grass.blockID) {
|
||||
if(var3.l.nextInt(8) == 0 && var8 == Block.grass.blockID) {
|
||||
byte var11 = 1;
|
||||
|
||||
for(int var12 = 0; var12 < var11; ++var12) {
|
||||
float var13 = 0.7F;
|
||||
float var14 = var3.rand.nextFloat() * var13 + (1.0F - var13) * 0.5F;
|
||||
float var14 = var3.l.nextFloat() * var13 + (1.0F - var13) * 0.5F;
|
||||
float var15 = 1.2F;
|
||||
float var16 = var3.rand.nextFloat() * var13 + (1.0F - var13) * 0.5F;
|
||||
float var16 = var3.l.nextFloat() * var13 + (1.0F - var13) * 0.5F;
|
||||
EntityItem var17 = new EntityItem(var3, (double)((float)var4 + var14), (double)((float)var5 + var15), (double)((float)var6 + var16), new ItemStack(Item.seeds));
|
||||
var17.delayBeforeCanPickup = 10;
|
||||
var3.spawnEntityInWorld(var17);
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.InetAddress;
|
||||
import java.net.Socket;
|
||||
import java.net.URL;
|
||||
import java.util.Random;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
|
@ -31,10 +34,10 @@ public class NetClientHandler extends NetHandler {
|
|||
}
|
||||
}
|
||||
|
||||
public void handleLogin(Packet2Handshake var1) {
|
||||
public void handleLogin(Packet1Login var1) {
|
||||
this.mc.playerController = new PlayerControllerMP(this.mc, this);
|
||||
this.worldClient = new WorldClient(this);
|
||||
this.worldClient.multiplayerWorld = true;
|
||||
this.worldClient.worldChunkLoadOverride = true;
|
||||
this.mc.changeWorld1(this.worldClient);
|
||||
this.mc.displayGuiScreen(new GuiDownloadTerrain(this));
|
||||
}
|
||||
|
@ -275,6 +278,28 @@ public class NetClientHandler extends NetHandler {
|
|||
this.mc.thePlayer.inventory.addItemStackToInventory(new ItemStack(var1.itemID, var1.count, var1.itemDamage));
|
||||
}
|
||||
|
||||
public void handleHandshake(Packet2Handshake var1) {
|
||||
if(var1.username.equals("-")) {
|
||||
this.addToSendQueue(new Packet1Login(this.mc.session.username, "Password", 14));
|
||||
} else {
|
||||
try {
|
||||
URL var2 = new URL("http://www.minecraft.net/game/joinserver.jsp?user=" + this.mc.session.username + "&sessionId=" + this.mc.session.sessionId + "&serverId=" + var1.username);
|
||||
BufferedReader var3 = new BufferedReader(new InputStreamReader(var2.openStream()));
|
||||
String var4 = var3.readLine();
|
||||
var3.close();
|
||||
if(var4.equalsIgnoreCase("ok")) {
|
||||
this.addToSendQueue(new Packet1Login(this.mc.session.username, "Password", 14));
|
||||
} else {
|
||||
this.netManager.networkShutdown("Failed to login: " + var4);
|
||||
}
|
||||
} catch (Exception var5) {
|
||||
var5.printStackTrace();
|
||||
this.netManager.networkShutdown("Internal client error: " + var5.toString());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void disconnect() {
|
||||
this.disconnected = true;
|
||||
this.netManager.networkShutdown("Closed");
|
||||
|
|
|
@ -14,7 +14,7 @@ public class NetHandler {
|
|||
this.registerPacket(var1);
|
||||
}
|
||||
|
||||
public void handleLogin(Packet2Handshake var1) {
|
||||
public void handleLogin(Packet1Login var1) {
|
||||
this.registerPacket(var1);
|
||||
}
|
||||
|
||||
|
@ -85,4 +85,8 @@ public class NetHandler {
|
|||
public void handleArmAnimation(Packet18ArmAnimation var1) {
|
||||
this.registerPacket(var1);
|
||||
}
|
||||
|
||||
public void handleHandshake(Packet2Handshake var1) {
|
||||
this.registerPacket(var1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,7 +67,8 @@ public abstract class Packet {
|
|||
|
||||
static {
|
||||
addIdClassMapping(0, Packet0KeepAlive.class);
|
||||
addIdClassMapping(1, Packet2Handshake.class);
|
||||
addIdClassMapping(1, Packet1Login.class);
|
||||
addIdClassMapping(2, Packet2Handshake.class);
|
||||
addIdClassMapping(3, Packet3Chat.class);
|
||||
addIdClassMapping(10, Packet10Flying.class);
|
||||
addIdClassMapping(11, Packet11PlayerPosition.class);
|
||||
|
|
40
client/src/main/java/net/minecraft/src/Packet1Login.java
Normal file
40
client/src/main/java/net/minecraft/src/Packet1Login.java
Normal file
|
@ -0,0 +1,40 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class Packet1Login extends Packet {
|
||||
public int protocolVersion;
|
||||
public String username;
|
||||
public String password;
|
||||
|
||||
public Packet1Login() {
|
||||
}
|
||||
|
||||
public Packet1Login(String var1, String var2, int var3) {
|
||||
this.username = var1;
|
||||
this.password = var2;
|
||||
this.protocolVersion = var3;
|
||||
}
|
||||
|
||||
public void readPacketData(DataInputStream var1) throws IOException {
|
||||
this.protocolVersion = var1.readInt();
|
||||
this.username = var1.readUTF();
|
||||
this.password = var1.readUTF();
|
||||
}
|
||||
|
||||
public void writePacket(DataOutputStream var1) throws IOException {
|
||||
var1.writeInt(this.protocolVersion);
|
||||
var1.writeUTF(this.username);
|
||||
var1.writeUTF(this.password);
|
||||
}
|
||||
|
||||
public void processPacket(NetHandler var1) {
|
||||
var1.handleLogin(this);
|
||||
}
|
||||
|
||||
public int getPacketSize() {
|
||||
return 4 + this.username.length() + this.password.length() + 4;
|
||||
}
|
||||
}
|
|
@ -5,36 +5,28 @@ import java.io.DataOutputStream;
|
|||
import java.io.IOException;
|
||||
|
||||
public class Packet2Handshake extends Packet {
|
||||
public int protocol;
|
||||
public String username;
|
||||
public String password;
|
||||
|
||||
public Packet2Handshake() {
|
||||
}
|
||||
|
||||
public Packet2Handshake(String var1, String var2, int var3) {
|
||||
public Packet2Handshake(String var1) {
|
||||
this.username = var1;
|
||||
this.password = var2;
|
||||
this.protocol = var3;
|
||||
}
|
||||
|
||||
public void readPacketData(DataInputStream var1) throws IOException {
|
||||
this.protocol = var1.readInt();
|
||||
this.username = var1.readUTF();
|
||||
this.password = var1.readUTF();
|
||||
}
|
||||
|
||||
public void writePacket(DataOutputStream var1) throws IOException {
|
||||
var1.writeInt(this.protocol);
|
||||
var1.writeUTF(this.username);
|
||||
var1.writeUTF(this.password);
|
||||
}
|
||||
|
||||
public void processPacket(NetHandler var1) {
|
||||
var1.handleLogin(this);
|
||||
var1.handleHandshake(this);
|
||||
}
|
||||
|
||||
public int getPacketSize() {
|
||||
return 4 + this.username.length() + this.password.length() + 4;
|
||||
return 4 + this.username.length() + 4;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ public class PanelCrashReport extends Panel {
|
|||
try {
|
||||
var5 = var5 + "Generated " + (new SimpleDateFormat()).format(new Date()) + "\n";
|
||||
var5 = var5 + "\n";
|
||||
var5 = var5 + "Minecraft: Minecraft Alpha v1.0.15\n";
|
||||
var5 = var5 + "Minecraft: Minecraft Alpha v1.0.16\n";
|
||||
var5 = var5 + "OS: " + System.getProperty("os.name") + " (" + System.getProperty("os.arch") + ") version " + System.getProperty("os.version") + "\n";
|
||||
var5 = var5 + "Java: " + System.getProperty("java.version") + ", " + System.getProperty("java.vendor") + "\n";
|
||||
var5 = var5 + "VM: " + System.getProperty("java.vm.name") + " (" + System.getProperty("java.vm.info") + "), " + System.getProperty("java.vm.vendor") + "\n";
|
||||
|
|
|
@ -27,9 +27,9 @@ public class SpawnerAnimals {
|
|||
}
|
||||
|
||||
protected ChunkPosition getRandomSpawningPointInChunk(World var1, int var2, int var3) {
|
||||
int var4 = var2 + var1.rand.nextInt(16);
|
||||
int var5 = var1.rand.nextInt(128);
|
||||
int var6 = var3 + var1.rand.nextInt(16);
|
||||
int var4 = var2 + var1.l.nextInt(16);
|
||||
int var5 = var1.l.nextInt(128);
|
||||
int var6 = var3 + var1.l.nextInt(16);
|
||||
return new ChunkPosition(var4, var5, var6);
|
||||
}
|
||||
|
||||
|
@ -40,8 +40,8 @@ public class SpawnerAnimals {
|
|||
int var7;
|
||||
int var9;
|
||||
int var10;
|
||||
for(var4 = 0; var4 < var1.playerEntities.size(); ++var4) {
|
||||
EntityPlayer var5 = (EntityPlayer)var1.playerEntities.get(var4);
|
||||
for(var4 = 0; var4 < var1.i.size(); ++var4) {
|
||||
EntityPlayer var5 = (EntityPlayer)var1.i.get(var4);
|
||||
int var6 = MathHelper.floor_double(var5.posX / 16.0D);
|
||||
var7 = MathHelper.floor_double(var5.posZ / 16.0D);
|
||||
byte var8 = 4;
|
||||
|
@ -64,9 +64,9 @@ public class SpawnerAnimals {
|
|||
}
|
||||
|
||||
var27 = (ChunkCoordIntPair)var26.next();
|
||||
} while(var1.rand.nextInt(10) != 0);
|
||||
} while(var1.l.nextInt(10) != 0);
|
||||
|
||||
var7 = var1.rand.nextInt(this.entities.length);
|
||||
var7 = var1.l.nextInt(this.entities.length);
|
||||
ChunkPosition var28 = this.getRandomSpawningPointInChunk(var1, var27.chunkXPos * 16, var27.chunkZPos * 16);
|
||||
var9 = var28.x;
|
||||
var10 = var28.y;
|
||||
|
@ -86,17 +86,17 @@ public class SpawnerAnimals {
|
|||
byte var16 = 6;
|
||||
|
||||
for(int var17 = 0; var17 < 2; ++var17) {
|
||||
var13 += var1.rand.nextInt(var16) - var1.rand.nextInt(var16);
|
||||
var14 += var1.rand.nextInt(1) - var1.rand.nextInt(1);
|
||||
var15 += var1.rand.nextInt(var16) - var1.rand.nextInt(var16);
|
||||
var13 += var1.l.nextInt(var16) - var1.l.nextInt(var16);
|
||||
var14 += var1.l.nextInt(1) - var1.l.nextInt(1);
|
||||
var15 += var1.l.nextInt(var16) - var1.l.nextInt(var16);
|
||||
if(var1.isBlockNormalCube(var13, var14 - 1, var15) && !var1.isBlockNormalCube(var13, var14, var15) && !var1.getBlockMaterial(var13, var14, var15).getIsLiquid() && !var1.isBlockNormalCube(var13, var14 + 1, var15)) {
|
||||
float var18 = (float)var13 + 0.5F;
|
||||
float var19 = (float)var14;
|
||||
float var20 = (float)var15 + 0.5F;
|
||||
if(var1.getClosestPlayer((double)var18, (double)var19, (double)var20, 24.0D) == null) {
|
||||
float var21 = var18 - (float)var1.spawnX;
|
||||
float var22 = var19 - (float)var1.spawnY;
|
||||
float var23 = var20 - (float)var1.spawnZ;
|
||||
float var21 = var18 - (float)var1.m;
|
||||
float var22 = var19 - (float)var1.spawnX;
|
||||
float var23 = var20 - (float)var1.spawnY;
|
||||
float var24 = var21 * var21 + var22 * var22 + var23 * var23;
|
||||
if(var24 >= 576.0F) {
|
||||
EntityLiving var29;
|
||||
|
@ -107,7 +107,7 @@ public class SpawnerAnimals {
|
|||
return var4;
|
||||
}
|
||||
|
||||
var29.setLocationAndAngles((double)var18, (double)var19, (double)var20, var1.rand.nextFloat() * 360.0F, 0.0F);
|
||||
var29.setLocationAndAngles((double)var18, (double)var19, (double)var20, var1.l.nextFloat() * 360.0F, 0.0F);
|
||||
if(var29.getCanSpawnHere()) {
|
||||
++var4;
|
||||
var1.spawnEntityInWorld(var29);
|
||||
|
|
|
@ -9,9 +9,9 @@ class SpawnerMonsters extends SpawnerAnimals {
|
|||
}
|
||||
|
||||
protected ChunkPosition getRandomSpawningPointInChunk(World var1, int var2, int var3) {
|
||||
int var4 = var2 + var1.rand.nextInt(16);
|
||||
int var5 = var1.rand.nextInt(var1.rand.nextInt(120) + 8);
|
||||
int var6 = var3 + var1.rand.nextInt(16);
|
||||
int var4 = var2 + var1.l.nextInt(16);
|
||||
int var5 = var1.l.nextInt(var1.l.nextInt(120) + 8);
|
||||
int var6 = var3 + var1.l.nextInt(16);
|
||||
return new ChunkPosition(var4, var5, var6);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ class ThreadConnectToServer extends Thread {
|
|||
return;
|
||||
}
|
||||
|
||||
GuiConnecting.getNetClientHandler(this.connectingGui).addToSendQueue(new Packet2Handshake(this.mc.session.username, "Password", 13));
|
||||
GuiConnecting.getNetClientHandler(this.connectingGui).addToSendQueue(new Packet2Handshake(this.mc.session.username));
|
||||
} catch (UnknownHostException var2) {
|
||||
if(GuiConnecting.isCancelled(this.connectingGui)) {
|
||||
return;
|
||||
|
|
|
@ -17,9 +17,9 @@ public class TileEntityMobSpawner extends TileEntity {
|
|||
public void updateEntity() {
|
||||
this.prevYaw = this.yaw;
|
||||
if(this.anyPlayerInRange()) {
|
||||
double var1 = (double)((float)this.xCoord + this.worldObj.rand.nextFloat());
|
||||
double var3 = (double)((float)this.yCoord + this.worldObj.rand.nextFloat());
|
||||
double var5 = (double)((float)this.zCoord + this.worldObj.rand.nextFloat());
|
||||
double var1 = (double)((float)this.xCoord + this.worldObj.l.nextFloat());
|
||||
double var3 = (double)((float)this.yCoord + this.worldObj.l.nextFloat());
|
||||
double var5 = (double)((float)this.zCoord + this.worldObj.l.nextFloat());
|
||||
this.worldObj.spawnParticle("smoke", var1, var3, var5, 0.0D, 0.0D, 0.0D);
|
||||
this.worldObj.spawnParticle("flame", var1, var3, var5, 0.0D, 0.0D, 0.0D);
|
||||
|
||||
|
@ -49,17 +49,17 @@ public class TileEntityMobSpawner extends TileEntity {
|
|||
}
|
||||
|
||||
if(var9 != null) {
|
||||
double var11 = (double)this.xCoord + (this.worldObj.rand.nextDouble() - this.worldObj.rand.nextDouble()) * 4.0D;
|
||||
double var13 = (double)(this.yCoord + this.worldObj.rand.nextInt(3) - 1);
|
||||
double var15 = (double)this.zCoord + (this.worldObj.rand.nextDouble() - this.worldObj.rand.nextDouble()) * 4.0D;
|
||||
var9.setLocationAndAngles(var11, var13, var15, this.worldObj.rand.nextFloat() * 360.0F, 0.0F);
|
||||
double var11 = (double)this.xCoord + (this.worldObj.l.nextDouble() - this.worldObj.l.nextDouble()) * 4.0D;
|
||||
double var13 = (double)(this.yCoord + this.worldObj.l.nextInt(3) - 1);
|
||||
double var15 = (double)this.zCoord + (this.worldObj.l.nextDouble() - this.worldObj.l.nextDouble()) * 4.0D;
|
||||
var9.setLocationAndAngles(var11, var13, var15, this.worldObj.l.nextFloat() * 360.0F, 0.0F);
|
||||
if(var9.getCanSpawnHere()) {
|
||||
this.worldObj.spawnEntityInWorld(var9);
|
||||
|
||||
for(int var17 = 0; var17 < 20; ++var17) {
|
||||
var1 = (double)this.xCoord + 0.5D + ((double)this.worldObj.rand.nextFloat() - 0.5D) * 2.0D;
|
||||
var3 = (double)this.yCoord + 0.5D + ((double)this.worldObj.rand.nextFloat() - 0.5D) * 2.0D;
|
||||
var5 = (double)this.zCoord + 0.5D + ((double)this.worldObj.rand.nextFloat() - 0.5D) * 2.0D;
|
||||
var1 = (double)this.xCoord + 0.5D + ((double)this.worldObj.l.nextFloat() - 0.5D) * 2.0D;
|
||||
var3 = (double)this.yCoord + 0.5D + ((double)this.worldObj.l.nextFloat() - 0.5D) * 2.0D;
|
||||
var5 = (double)this.zCoord + 0.5D + ((double)this.worldObj.l.nextFloat() - 0.5D) * 2.0D;
|
||||
this.worldObj.spawnParticle("smoke", var1, var3, var5, 0.0D, 0.0D, 0.0D);
|
||||
this.worldObj.spawnParticle("flame", var1, var3, var5, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ public class TileEntityMobSpawner extends TileEntity {
|
|||
}
|
||||
|
||||
private void updateDelay() {
|
||||
this.delay = 200 + this.worldObj.rand.nextInt(600);
|
||||
this.delay = 200 + this.worldObj.l.nextInt(600);
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound var1) {
|
||||
|
|
|
@ -15,44 +15,44 @@ import java.util.Set;
|
|||
import java.util.TreeSet;
|
||||
|
||||
public class World implements IBlockAccess {
|
||||
private List v;
|
||||
private List lightingToUpdate;
|
||||
private List loadedEntityList;
|
||||
private List unloadedEntityList;
|
||||
private TreeSet scheduledTickTreeSet;
|
||||
private Set scheduledTickSet;
|
||||
public List loadedTileEntityList;
|
||||
public long worldTime;
|
||||
public boolean snowCovered;
|
||||
public List loadedEntityList;
|
||||
public long b;
|
||||
public boolean c;
|
||||
private long skyColor;
|
||||
private long fogColor;
|
||||
private long cloudColor;
|
||||
public int skylightSubtracted;
|
||||
public int d;
|
||||
protected int skylightSubtracted;
|
||||
protected int updateLCG;
|
||||
protected int DIST_HASH_MAGIC;
|
||||
public boolean editingBlocks;
|
||||
public static float[] lightBrightnessTable = new float[16];
|
||||
public boolean g;
|
||||
public static float[] h = new float[16];
|
||||
private final long lockTimestamp;
|
||||
public List playerEntities;
|
||||
public int difficultySetting;
|
||||
public Object fontRenderer;
|
||||
public Random rand;
|
||||
public List i;
|
||||
public int j;
|
||||
public Object k;
|
||||
public Random l;
|
||||
public int m;
|
||||
public int spawnX;
|
||||
public int spawnY;
|
||||
public int spawnZ;
|
||||
public boolean isNewWorld;
|
||||
public boolean p;
|
||||
private List worldAccesses;
|
||||
private IChunkProvider chunkProvider;
|
||||
private File saveDirectory;
|
||||
public long randomSeed;
|
||||
public long q;
|
||||
private NBTTagCompound nbtCompoundPlayer;
|
||||
public long sizeOnDisk;
|
||||
public final String levelName;
|
||||
public boolean worldChunkLoadOverride;
|
||||
public long randomSeed;
|
||||
public final String s;
|
||||
public boolean t;
|
||||
private ArrayList collidingBoundingBoxes;
|
||||
private Set positionsToUpdate;
|
||||
private int soundCounter;
|
||||
private List entitiesWithinAABBExcludingEntity;
|
||||
public boolean multiplayerWorld;
|
||||
public boolean worldChunkLoadOverride;
|
||||
|
||||
public static NBTTagCompound getLevelData(File var0, String var1) {
|
||||
File var2 = new File(var0, "saves");
|
||||
|
@ -100,67 +100,67 @@ public class World implements IBlockAccess {
|
|||
}
|
||||
|
||||
public World(String var1) {
|
||||
this.v = new ArrayList();
|
||||
this.lightingToUpdate = new ArrayList();
|
||||
this.loadedEntityList = new ArrayList();
|
||||
this.unloadedEntityList = new ArrayList();
|
||||
this.scheduledTickTreeSet = new TreeSet();
|
||||
this.scheduledTickSet = new HashSet();
|
||||
this.loadedTileEntityList = new ArrayList();
|
||||
this.worldTime = 0L;
|
||||
this.snowCovered = false;
|
||||
this.loadedEntityList = new ArrayList();
|
||||
this.b = 0L;
|
||||
this.c = false;
|
||||
this.skyColor = 8961023L;
|
||||
this.fogColor = 12638463L;
|
||||
this.cloudColor = 16777215L;
|
||||
this.skylightSubtracted = 0;
|
||||
this.updateLCG = (new Random()).nextInt();
|
||||
this.DIST_HASH_MAGIC = 1013904223;
|
||||
this.editingBlocks = false;
|
||||
this.d = 0;
|
||||
this.skylightSubtracted = (new Random()).nextInt();
|
||||
this.updateLCG = 1013904223;
|
||||
this.g = false;
|
||||
this.lockTimestamp = System.currentTimeMillis();
|
||||
this.playerEntities = new ArrayList();
|
||||
this.rand = new Random();
|
||||
this.isNewWorld = false;
|
||||
this.i = new ArrayList();
|
||||
this.l = new Random();
|
||||
this.p = false;
|
||||
this.worldAccesses = new ArrayList();
|
||||
this.q = 0L;
|
||||
this.randomSeed = 0L;
|
||||
this.sizeOnDisk = 0L;
|
||||
this.collidingBoundingBoxes = new ArrayList();
|
||||
this.positionsToUpdate = new HashSet();
|
||||
this.soundCounter = this.rand.nextInt(12000);
|
||||
this.soundCounter = this.l.nextInt(12000);
|
||||
this.entitiesWithinAABBExcludingEntity = new ArrayList();
|
||||
this.multiplayerWorld = false;
|
||||
this.levelName = var1;
|
||||
this.worldChunkLoadOverride = false;
|
||||
this.s = var1;
|
||||
this.chunkProvider = this.getChunkProvider(this.saveDirectory);
|
||||
this.calculateInitialSkylight();
|
||||
}
|
||||
|
||||
public World(File var1, String var2, long var3) {
|
||||
this.v = new ArrayList();
|
||||
this.lightingToUpdate = new ArrayList();
|
||||
this.loadedEntityList = new ArrayList();
|
||||
this.unloadedEntityList = new ArrayList();
|
||||
this.scheduledTickTreeSet = new TreeSet();
|
||||
this.scheduledTickSet = new HashSet();
|
||||
this.loadedTileEntityList = new ArrayList();
|
||||
this.worldTime = 0L;
|
||||
this.snowCovered = false;
|
||||
this.loadedEntityList = new ArrayList();
|
||||
this.b = 0L;
|
||||
this.c = false;
|
||||
this.skyColor = 8961023L;
|
||||
this.fogColor = 12638463L;
|
||||
this.cloudColor = 16777215L;
|
||||
this.skylightSubtracted = 0;
|
||||
this.updateLCG = (new Random()).nextInt();
|
||||
this.DIST_HASH_MAGIC = 1013904223;
|
||||
this.editingBlocks = false;
|
||||
this.d = 0;
|
||||
this.skylightSubtracted = (new Random()).nextInt();
|
||||
this.updateLCG = 1013904223;
|
||||
this.g = false;
|
||||
this.lockTimestamp = System.currentTimeMillis();
|
||||
this.playerEntities = new ArrayList();
|
||||
this.rand = new Random();
|
||||
this.isNewWorld = false;
|
||||
this.i = new ArrayList();
|
||||
this.l = new Random();
|
||||
this.p = false;
|
||||
this.worldAccesses = new ArrayList();
|
||||
this.q = 0L;
|
||||
this.randomSeed = 0L;
|
||||
this.sizeOnDisk = 0L;
|
||||
this.collidingBoundingBoxes = new ArrayList();
|
||||
this.positionsToUpdate = new HashSet();
|
||||
this.soundCounter = this.rand.nextInt(12000);
|
||||
this.soundCounter = this.l.nextInt(12000);
|
||||
this.entitiesWithinAABBExcludingEntity = new ArrayList();
|
||||
this.multiplayerWorld = false;
|
||||
this.levelName = var2;
|
||||
this.worldChunkLoadOverride = false;
|
||||
this.s = var2;
|
||||
var1.mkdirs();
|
||||
this.saveDirectory = new File(var1, var2);
|
||||
this.saveDirectory.mkdirs();
|
||||
|
@ -180,18 +180,18 @@ public class World implements IBlockAccess {
|
|||
}
|
||||
|
||||
var5 = new File(this.saveDirectory, "level.dat");
|
||||
this.isNewWorld = !var5.exists();
|
||||
this.p = !var5.exists();
|
||||
if(var5.exists()) {
|
||||
try {
|
||||
NBTTagCompound var14 = CompressedStreamTools.readCompressed(new FileInputStream(var5));
|
||||
NBTTagCompound var7 = var14.getCompoundTag("Data");
|
||||
this.randomSeed = var7.getLong("RandomSeed");
|
||||
this.spawnX = var7.getInteger("SpawnX");
|
||||
this.spawnY = var7.getInteger("SpawnY");
|
||||
this.spawnZ = var7.getInteger("SpawnZ");
|
||||
this.worldTime = var7.getLong("Time");
|
||||
this.sizeOnDisk = var7.getLong("SizeOnDisk");
|
||||
this.snowCovered = var7.getBoolean("SnowCovered");
|
||||
this.q = var7.getLong("RandomSeed");
|
||||
this.m = var7.getInteger("SpawnX");
|
||||
this.spawnX = var7.getInteger("SpawnY");
|
||||
this.spawnY = var7.getInteger("SpawnZ");
|
||||
this.b = var7.getLong("Time");
|
||||
this.randomSeed = var7.getLong("SizeOnDisk");
|
||||
this.c = var7.getBoolean("SnowCovered");
|
||||
if(var7.hasKey("Player")) {
|
||||
this.nbtCompoundPlayer = var7.getCompoundTag("Player");
|
||||
}
|
||||
|
@ -199,43 +199,43 @@ public class World implements IBlockAccess {
|
|||
var11.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
this.snowCovered = this.rand.nextInt(4) == 0;
|
||||
this.c = this.l.nextInt(4) == 0;
|
||||
}
|
||||
|
||||
boolean var15 = false;
|
||||
if(this.randomSeed == 0L) {
|
||||
this.randomSeed = var3;
|
||||
if(this.q == 0L) {
|
||||
this.q = var3;
|
||||
var15 = true;
|
||||
}
|
||||
|
||||
this.chunkProvider = this.getChunkProvider(this.saveDirectory);
|
||||
if(var15) {
|
||||
this.worldChunkLoadOverride = true;
|
||||
this.spawnX = 0;
|
||||
this.spawnY = 64;
|
||||
this.t = true;
|
||||
this.m = 0;
|
||||
this.spawnX = 64;
|
||||
|
||||
for(this.spawnZ = 0; !this.findSpawn(this.spawnX, this.spawnZ); this.spawnZ += this.rand.nextInt(64) - this.rand.nextInt(64)) {
|
||||
this.spawnX += this.rand.nextInt(64) - this.rand.nextInt(64);
|
||||
for(this.spawnY = 0; !this.findSpawn(this.m, this.spawnY); this.spawnY += this.l.nextInt(64) - this.l.nextInt(64)) {
|
||||
this.m += this.l.nextInt(64) - this.l.nextInt(64);
|
||||
}
|
||||
|
||||
this.worldChunkLoadOverride = false;
|
||||
this.t = false;
|
||||
}
|
||||
|
||||
this.calculateInitialSkylight();
|
||||
}
|
||||
|
||||
protected IChunkProvider getChunkProvider(File var1) {
|
||||
return new ChunkProviderLoadOrGenerate(this, new ChunkLoader(var1, true), new ChunkProviderGenerate(this, this.randomSeed));
|
||||
return new ChunkProviderLoadOrGenerate(this, new ChunkLoader(var1, true), new ChunkProviderGenerate(this, this.q));
|
||||
}
|
||||
|
||||
public void setSpawnLocation() {
|
||||
if(this.spawnY <= 0) {
|
||||
this.spawnY = 64;
|
||||
if(this.spawnX <= 0) {
|
||||
this.spawnX = 64;
|
||||
}
|
||||
|
||||
while(this.getFirstUncoveredBlock(this.spawnX, this.spawnZ) == 0) {
|
||||
this.spawnX += this.rand.nextInt(8) - this.rand.nextInt(8);
|
||||
this.spawnZ += this.rand.nextInt(8) - this.rand.nextInt(8);
|
||||
while(this.getFirstUncoveredBlock(this.m, this.spawnY) == 0) {
|
||||
this.m += this.l.nextInt(8) - this.l.nextInt(8);
|
||||
this.spawnY += this.l.nextInt(8) - this.l.nextInt(8);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -285,17 +285,17 @@ public class World implements IBlockAccess {
|
|||
private void saveLevel() {
|
||||
this.checkSessionLock();
|
||||
NBTTagCompound var1 = new NBTTagCompound();
|
||||
var1.setLong("RandomSeed", this.randomSeed);
|
||||
var1.setInteger("SpawnX", this.spawnX);
|
||||
var1.setInteger("SpawnY", this.spawnY);
|
||||
var1.setInteger("SpawnZ", this.spawnZ);
|
||||
var1.setLong("Time", this.worldTime);
|
||||
var1.setLong("SizeOnDisk", this.sizeOnDisk);
|
||||
var1.setBoolean("SnowCovered", this.snowCovered);
|
||||
var1.setLong("RandomSeed", this.q);
|
||||
var1.setInteger("SpawnX", this.m);
|
||||
var1.setInteger("SpawnY", this.spawnX);
|
||||
var1.setInteger("SpawnZ", this.spawnY);
|
||||
var1.setLong("Time", this.b);
|
||||
var1.setLong("SizeOnDisk", this.randomSeed);
|
||||
var1.setBoolean("SnowCovered", this.c);
|
||||
var1.setLong("LastPlayed", System.currentTimeMillis());
|
||||
EntityPlayer var2 = null;
|
||||
if(this.playerEntities.size() > 0) {
|
||||
var2 = (EntityPlayer)this.playerEntities.get(0);
|
||||
if(this.i.size() > 0) {
|
||||
var2 = (EntityPlayer)this.i.get(0);
|
||||
}
|
||||
|
||||
NBTTagCompound var3;
|
||||
|
@ -518,7 +518,7 @@ public class World implements IBlockAccess {
|
|||
}
|
||||
|
||||
private void notifyBlockOfNeighborChange(int var1, int var2, int var3, int var4) {
|
||||
if(!this.editingBlocks && !this.multiplayerWorld) {
|
||||
if(!this.g && !this.worldChunkLoadOverride) {
|
||||
Block var5 = Block.blocksList[this.getBlockId(var1, var2, var3)];
|
||||
if(var5 != null) {
|
||||
var5.onNeighborBlockChange(this, var1, var2, var3, var4);
|
||||
|
@ -569,7 +569,7 @@ public class World implements IBlockAccess {
|
|||
if(var2 < 0) {
|
||||
return 0;
|
||||
} else if(var2 >= 128) {
|
||||
var5 = 15 - this.skylightSubtracted;
|
||||
var5 = 15 - this.d;
|
||||
if(var5 < 0) {
|
||||
var5 = 0;
|
||||
}
|
||||
|
@ -579,7 +579,7 @@ public class World implements IBlockAccess {
|
|||
Chunk var11 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4);
|
||||
var1 &= 15;
|
||||
var3 &= 15;
|
||||
return var11.getBlockLightValue(var1, var2, var3, this.skylightSubtracted);
|
||||
return var11.getBlockLightValue(var1, var2, var3, this.d);
|
||||
}
|
||||
} else {
|
||||
return 15;
|
||||
|
@ -672,11 +672,11 @@ public class World implements IBlockAccess {
|
|||
}
|
||||
|
||||
public float getBrightness(int var1, int var2, int var3) {
|
||||
return lightBrightnessTable[this.getBlockLightValue(var1, var2, var3)];
|
||||
return h[this.getBlockLightValue(var1, var2, var3)];
|
||||
}
|
||||
|
||||
public boolean isDaytime() {
|
||||
return this.skylightSubtracted < 4;
|
||||
return this.d < 4;
|
||||
}
|
||||
|
||||
public MovingObjectPosition rayTraceBlocks(Vec3D var1, Vec3D var2) {
|
||||
|
@ -861,12 +861,12 @@ public class World implements IBlockAccess {
|
|||
return false;
|
||||
} else {
|
||||
if(var1 instanceof EntityPlayer) {
|
||||
this.playerEntities.add((EntityPlayer)var1);
|
||||
System.out.println("Player count: " + this.playerEntities.size());
|
||||
this.i.add((EntityPlayer)var1);
|
||||
System.out.println("Player count: " + this.i.size());
|
||||
}
|
||||
|
||||
this.getChunkFromChunkCoords(var2, var3).addEntity(var1);
|
||||
this.loadedEntityList.add(var1);
|
||||
this.lightingToUpdate.add(var1);
|
||||
this.obtainEntitySkin(var1);
|
||||
return true;
|
||||
}
|
||||
|
@ -889,8 +889,8 @@ public class World implements IBlockAccess {
|
|||
public void setEntityDead(Entity var1) {
|
||||
var1.setEntityDead();
|
||||
if(var1 instanceof EntityPlayer) {
|
||||
this.playerEntities.remove((EntityPlayer)var1);
|
||||
System.out.println("Player count: " + this.playerEntities.size());
|
||||
this.i.remove((EntityPlayer)var1);
|
||||
System.out.println("Player count: " + this.i.size());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -978,7 +978,7 @@ public class World implements IBlockAccess {
|
|||
}
|
||||
|
||||
public float getCelestialAngle(float var1) {
|
||||
int var2 = (int)(this.worldTime % 24000L);
|
||||
int var2 = (int)(this.b % 24000L);
|
||||
float var3 = ((float)var2 + var1) / 24000.0F - 0.25F;
|
||||
if(var3 < 0.0F) {
|
||||
++var3;
|
||||
|
@ -1072,7 +1072,7 @@ public class World implements IBlockAccess {
|
|||
byte var6 = 8;
|
||||
if(this.checkChunksExist(var1 - var6, var2 - var6, var3 - var6, var1 + var6, var2 + var6, var3 + var6)) {
|
||||
if(var4 > 0) {
|
||||
var5.setScheduledTime((long)Block.blocksList[var4].tickRate() + this.worldTime);
|
||||
var5.setScheduledTime((long)Block.blocksList[var4].tickRate() + this.b);
|
||||
}
|
||||
|
||||
if(!this.scheduledTickSet.contains(var5)) {
|
||||
|
@ -1084,7 +1084,7 @@ public class World implements IBlockAccess {
|
|||
}
|
||||
|
||||
public void updateEntities() {
|
||||
this.loadedEntityList.removeAll(this.unloadedEntityList);
|
||||
this.lightingToUpdate.removeAll(this.unloadedEntityList);
|
||||
|
||||
int var1;
|
||||
Entity var2;
|
||||
|
@ -1105,8 +1105,8 @@ public class World implements IBlockAccess {
|
|||
|
||||
this.unloadedEntityList.clear();
|
||||
|
||||
for(var1 = 0; var1 < this.loadedEntityList.size(); ++var1) {
|
||||
var2 = (Entity)this.loadedEntityList.get(var1);
|
||||
for(var1 = 0; var1 < this.lightingToUpdate.size(); ++var1) {
|
||||
var2 = (Entity)this.lightingToUpdate.get(var1);
|
||||
if(var2.ridingEntity != null) {
|
||||
if(!var2.ridingEntity.isDead && var2.ridingEntity.riddenByEntity == var2) {
|
||||
continue;
|
||||
|
@ -1127,13 +1127,13 @@ public class World implements IBlockAccess {
|
|||
this.getChunkFromChunkCoords(var3, var4).removeEntity(var2);
|
||||
}
|
||||
|
||||
this.loadedEntityList.remove(var1--);
|
||||
this.lightingToUpdate.remove(var1--);
|
||||
this.releaseEntitySkin(var2);
|
||||
}
|
||||
}
|
||||
|
||||
for(var1 = 0; var1 < this.loadedTileEntityList.size(); ++var1) {
|
||||
TileEntity var5 = (TileEntity)this.loadedTileEntityList.get(var1);
|
||||
for(var1 = 0; var1 < this.loadedEntityList.size(); ++var1) {
|
||||
TileEntity var5 = (TileEntity)this.loadedEntityList.get(var1);
|
||||
var5.updateEntity();
|
||||
}
|
||||
|
||||
|
@ -1415,7 +1415,7 @@ public class World implements IBlockAccess {
|
|||
}
|
||||
|
||||
if(this.getBlockId(var1, var2, var3) == Block.fire.blockID) {
|
||||
this.playSoundEffect((double)((float)var1 + 0.5F), (double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), "random.fizz", 0.5F, 2.6F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.8F);
|
||||
this.playSoundEffect((double)((float)var1 + 0.5F), (double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), "random.fizz", 0.5F, 2.6F + (this.l.nextFloat() - this.l.nextFloat()) * 0.8F);
|
||||
this.setBlockWithNotify(var1, var2, var3, 0);
|
||||
}
|
||||
|
||||
|
@ -1426,7 +1426,7 @@ public class World implements IBlockAccess {
|
|||
}
|
||||
|
||||
public String getDebugLoadedEntities() {
|
||||
return "All: " + this.loadedEntityList.size();
|
||||
return "All: " + this.lightingToUpdate.size();
|
||||
}
|
||||
|
||||
public TileEntity getBlockTileEntity(int var1, int var2, int var3) {
|
||||
|
@ -1462,13 +1462,13 @@ public class World implements IBlockAccess {
|
|||
public boolean updatingLighting() {
|
||||
int var1 = 1000;
|
||||
|
||||
while(this.lightingToUpdate.size() > 0) {
|
||||
while(this.v.size() > 0) {
|
||||
--var1;
|
||||
if(var1 <= 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
((MetadataChunkBlock)this.lightingToUpdate.remove(this.lightingToUpdate.size() - 1)).updateLight(this);
|
||||
((MetadataChunkBlock)this.v.remove(this.v.size() - 1)).updateLight(this);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -1482,7 +1482,7 @@ public class World implements IBlockAccess {
|
|||
int var9 = (var5 + var2) / 2;
|
||||
int var10 = (var7 + var4) / 2;
|
||||
if(this.blockExists(var9, 64, var10)) {
|
||||
int var11 = this.lightingToUpdate.size();
|
||||
int var11 = this.v.size();
|
||||
if(var8) {
|
||||
int var12 = 4;
|
||||
if(var12 > var11) {
|
||||
|
@ -1490,16 +1490,16 @@ public class World implements IBlockAccess {
|
|||
}
|
||||
|
||||
for(int var13 = 0; var13 < var12; ++var13) {
|
||||
MetadataChunkBlock var14 = (MetadataChunkBlock)this.lightingToUpdate.get(this.lightingToUpdate.size() - var13 - 1);
|
||||
MetadataChunkBlock var14 = (MetadataChunkBlock)this.v.get(this.v.size() - var13 - 1);
|
||||
if(var14.skyBlock == var1 && var14.getLightUpdated(var2, var3, var4, var5, var6, var7)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.lightingToUpdate.add(new MetadataChunkBlock(var1, var2, var3, var4, var5, var6, var7));
|
||||
if(this.lightingToUpdate.size() > 100000) {
|
||||
while(this.lightingToUpdate.size() > '\uc350') {
|
||||
this.v.add(new MetadataChunkBlock(var1, var2, var3, var4, var5, var6, var7));
|
||||
if(this.v.size() > 100000) {
|
||||
while(this.v.size() > '\uc350') {
|
||||
this.updatingLighting();
|
||||
}
|
||||
}
|
||||
|
@ -1509,8 +1509,8 @@ public class World implements IBlockAccess {
|
|||
|
||||
public void calculateInitialSkylight() {
|
||||
int var1 = this.calculateSkylightSubtracted(1.0F);
|
||||
if(var1 != this.skylightSubtracted) {
|
||||
this.skylightSubtracted = var1;
|
||||
if(var1 != this.d) {
|
||||
this.d = var1;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1518,16 +1518,16 @@ public class World implements IBlockAccess {
|
|||
public void tick() {
|
||||
this.chunkProvider.unload100OldestChunks();
|
||||
int var1 = this.calculateSkylightSubtracted(1.0F);
|
||||
if(var1 != this.skylightSubtracted) {
|
||||
this.skylightSubtracted = var1;
|
||||
if(var1 != this.d) {
|
||||
this.d = var1;
|
||||
|
||||
for(int var2 = 0; var2 < this.worldAccesses.size(); ++var2) {
|
||||
((IWorldAccess)this.worldAccesses.get(var2)).updateAllRenderers();
|
||||
}
|
||||
}
|
||||
|
||||
++this.worldTime;
|
||||
if(this.worldTime % 20L == 0L) {
|
||||
++this.b;
|
||||
if(this.b % 4L == 0L) {
|
||||
this.saveWorld(false, (IProgressUpdate)null);
|
||||
}
|
||||
|
||||
|
@ -1542,8 +1542,8 @@ public class World implements IBlockAccess {
|
|||
int var4;
|
||||
int var6;
|
||||
int var7;
|
||||
for(int var1 = 0; var1 < this.playerEntities.size(); ++var1) {
|
||||
EntityPlayer var2 = (EntityPlayer)this.playerEntities.get(var1);
|
||||
for(int var1 = 0; var1 < this.i.size(); ++var1) {
|
||||
EntityPlayer var2 = (EntityPlayer)this.i.get(var1);
|
||||
var3 = MathHelper.floor_double(var2.posX / 16.0D);
|
||||
var4 = MathHelper.floor_double(var2.posZ / 16.0D);
|
||||
byte var5 = 9;
|
||||
|
@ -1570,26 +1570,26 @@ public class World implements IBlockAccess {
|
|||
int var9;
|
||||
int var10;
|
||||
if(this.soundCounter == 0) {
|
||||
this.updateLCG = this.updateLCG * 3 + this.DIST_HASH_MAGIC;
|
||||
var6 = this.updateLCG >> 2;
|
||||
this.skylightSubtracted = this.skylightSubtracted * 3 + this.updateLCG;
|
||||
var6 = this.skylightSubtracted >> 2;
|
||||
var7 = var6 & 15;
|
||||
var8 = var6 >> 8 & 15;
|
||||
var9 = var6 >> 16 & 127;
|
||||
var10 = var14.getBlockID(var7, var9, var8);
|
||||
var7 += var3;
|
||||
var8 += var4;
|
||||
if(var10 == 0 && this.getBlockLightValue(var7, var9, var8) <= this.rand.nextInt(8) && this.getSavedLightValue(EnumSkyBlock.Sky, var7, var9, var8) <= 0) {
|
||||
if(var10 == 0 && this.getBlockLightValue(var7, var9, var8) <= this.l.nextInt(8) && this.getSavedLightValue(EnumSkyBlock.Sky, var7, var9, var8) <= 0) {
|
||||
EntityPlayer var11 = this.getClosestPlayer((double)var7 + 0.5D, (double)var9 + 0.5D, (double)var8 + 0.5D, 8.0D);
|
||||
if(var11 != null && var11.getDistanceSq((double)var7 + 0.5D, (double)var9 + 0.5D, (double)var8 + 0.5D) > 4.0D) {
|
||||
this.playSoundEffect((double)var7 + 0.5D, (double)var9 + 0.5D, (double)var8 + 0.5D, "ambient.cave.cave", 0.7F, 0.8F + this.rand.nextFloat() * 0.2F);
|
||||
this.soundCounter = this.rand.nextInt(12000) + 6000;
|
||||
this.playSoundEffect((double)var7 + 0.5D, (double)var9 + 0.5D, (double)var8 + 0.5D, "ambient.cave.cave", 0.7F, 0.8F + this.l.nextFloat() * 0.2F);
|
||||
this.soundCounter = this.l.nextInt(12000) + 6000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(this.snowCovered && this.rand.nextInt(4) == 0) {
|
||||
this.updateLCG = this.updateLCG * 3 + this.DIST_HASH_MAGIC;
|
||||
var6 = this.updateLCG >> 2;
|
||||
if(this.c && this.l.nextInt(4) == 0) {
|
||||
this.skylightSubtracted = this.skylightSubtracted * 3 + this.updateLCG;
|
||||
var6 = this.skylightSubtracted >> 2;
|
||||
var7 = var6 & 15;
|
||||
var8 = var6 >> 8 & 15;
|
||||
var9 = this.getTopSolidOrLiquidBlock(var7 + var3, var8 + var4);
|
||||
|
@ -1606,14 +1606,14 @@ public class World implements IBlockAccess {
|
|||
}
|
||||
|
||||
for(var6 = 0; var6 < 80; ++var6) {
|
||||
this.updateLCG = this.updateLCG * 3 + this.DIST_HASH_MAGIC;
|
||||
var7 = this.updateLCG >> 2;
|
||||
this.skylightSubtracted = this.skylightSubtracted * 3 + this.updateLCG;
|
||||
var7 = this.skylightSubtracted >> 2;
|
||||
var8 = var7 & 15;
|
||||
var9 = var7 >> 8 & 15;
|
||||
var10 = var7 >> 16 & 127;
|
||||
byte var15 = var14.blocks[var8 << 11 | var9 << 7 | var10];
|
||||
if(Block.tickOnLoad[var15]) {
|
||||
Block.blocksList[var15].updateTick(this, var8 + var3, var10, var9 + var4, this.rand);
|
||||
Block.blocksList[var15].updateTick(this, var8 + var3, var10, var9 + var4, this.l);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1631,7 +1631,7 @@ public class World implements IBlockAccess {
|
|||
|
||||
for(int var3 = 0; var3 < var2; ++var3) {
|
||||
NextTickListEntry var4 = (NextTickListEntry)this.scheduledTickTreeSet.first();
|
||||
if(!var1 && var4.scheduledTime > this.worldTime) {
|
||||
if(!var1 && var4.scheduledTime > this.b) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1641,7 +1641,7 @@ public class World implements IBlockAccess {
|
|||
if(this.checkChunksExist(var4.xCoord - var5, var4.yCoord - var5, var4.zCoord - var5, var4.xCoord + var5, var4.yCoord + var5, var4.zCoord + var5)) {
|
||||
int var6 = this.getBlockId(var4.xCoord, var4.yCoord, var4.zCoord);
|
||||
if(var6 == var4.blockID && var6 > 0) {
|
||||
Block.blocksList[var6].updateTick(this, var4.xCoord, var4.yCoord, var4.zCoord, this.rand);
|
||||
Block.blocksList[var6].updateTick(this, var4.xCoord, var4.yCoord, var4.zCoord, this.l);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1655,9 +1655,9 @@ public class World implements IBlockAccess {
|
|||
Random var5 = new Random();
|
||||
|
||||
for(int var6 = 0; var6 < 1000; ++var6) {
|
||||
int var7 = var1 + this.rand.nextInt(var4) - this.rand.nextInt(var4);
|
||||
int var8 = var2 + this.rand.nextInt(var4) - this.rand.nextInt(var4);
|
||||
int var9 = var3 + this.rand.nextInt(var4) - this.rand.nextInt(var4);
|
||||
int var7 = var1 + this.l.nextInt(var4) - this.l.nextInt(var4);
|
||||
int var8 = var2 + this.l.nextInt(var4) - this.l.nextInt(var4);
|
||||
int var9 = var3 + this.l.nextInt(var4) - this.l.nextInt(var4);
|
||||
int var10 = this.getBlockId(var7, var8, var9);
|
||||
if(var10 > 0) {
|
||||
Block.blocksList[var10].randomDisplayTick(this, var7, var8, var9, var5);
|
||||
|
@ -1703,7 +1703,7 @@ public class World implements IBlockAccess {
|
|||
}
|
||||
|
||||
public List getLoadedEntityList() {
|
||||
return this.loadedEntityList;
|
||||
return this.lightingToUpdate;
|
||||
}
|
||||
|
||||
public void updateTileEntityChunkAndDoNothing(int var1, int var2, int var3) {
|
||||
|
@ -1716,8 +1716,8 @@ public class World implements IBlockAccess {
|
|||
public int countEntities(Class var1) {
|
||||
int var2 = 0;
|
||||
|
||||
for(int var3 = 0; var3 < this.loadedEntityList.size(); ++var3) {
|
||||
Entity var4 = (Entity)this.loadedEntityList.get(var3);
|
||||
for(int var3 = 0; var3 < this.lightingToUpdate.size(); ++var3) {
|
||||
Entity var4 = (Entity)this.lightingToUpdate.get(var3);
|
||||
if(var1.isAssignableFrom(var4.getClass())) {
|
||||
++var2;
|
||||
}
|
||||
|
@ -1727,7 +1727,7 @@ public class World implements IBlockAccess {
|
|||
}
|
||||
|
||||
public void addLoadedEntities(List var1) {
|
||||
this.loadedEntityList.addAll(var1);
|
||||
this.lightingToUpdate.addAll(var1);
|
||||
|
||||
for(int var2 = 0; var2 < var1.size(); ++var2) {
|
||||
this.obtainEntitySkin((Entity)var1.get(var2));
|
||||
|
@ -1817,8 +1817,8 @@ public class World implements IBlockAccess {
|
|||
double var9 = -1.0D;
|
||||
EntityPlayer var11 = null;
|
||||
|
||||
for(int var12 = 0; var12 < this.playerEntities.size(); ++var12) {
|
||||
EntityPlayer var13 = (EntityPlayer)this.playerEntities.get(var12);
|
||||
for(int var12 = 0; var12 < this.i.size(); ++var12) {
|
||||
EntityPlayer var13 = (EntityPlayer)this.i.get(var12);
|
||||
double var14 = var13.getDistanceSq(var1, var3, var5);
|
||||
if((var7 < 0.0D || var14 < var7 * var7) && (var9 == -1.0D || var14 < var9)) {
|
||||
var9 = var14;
|
||||
|
@ -1900,7 +1900,7 @@ public class World implements IBlockAccess {
|
|||
|
||||
for(int var1 = 0; var1 <= 15; ++var1) {
|
||||
float var2 = 1.0F - (float)var1 / 15.0F;
|
||||
lightBrightnessTable[var1] = (1.0F - var2) / (var2 * 3.0F + 1.0F) * (1.0F - var0) + var0;
|
||||
h[var1] = (1.0F - var2) / (var2 * 3.0F + 1.0F) * (1.0F - var0) + var0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,60 +6,60 @@ import java.util.LinkedList;
|
|||
import java.util.Set;
|
||||
|
||||
public class WorldClient extends World {
|
||||
private LinkedList blocksToReceive = new LinkedList();
|
||||
private NetClientHandler sendQueue;
|
||||
private ChunkProviderClient clientChunkProvider;
|
||||
private MCHashTable entityHashTable = new MCHashTable();
|
||||
private LinkedList v = new LinkedList();
|
||||
private NetClientHandler w;
|
||||
private ChunkProviderClient x;
|
||||
private MCHashTable y = new MCHashTable();
|
||||
private Set z = new HashSet();
|
||||
private Set entityList = new HashSet();
|
||||
private Set entitySpawnQueue = new HashSet();
|
||||
|
||||
public WorldClient(NetClientHandler var1) {
|
||||
super("MpServer");
|
||||
this.sendQueue = var1;
|
||||
this.spawnX = 8;
|
||||
this.spawnY = 64;
|
||||
this.spawnZ = 8;
|
||||
this.w = var1;
|
||||
this.m = 8;
|
||||
this.spawnX = 64;
|
||||
this.spawnY = 8;
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
int var1;
|
||||
for(var1 = 0; var1 < 10 && !this.entitySpawnQueue.isEmpty(); ++var1) {
|
||||
Entity var2 = (Entity)this.entitySpawnQueue.iterator().next();
|
||||
for(var1 = 0; var1 < 10 && !this.entityList.isEmpty(); ++var1) {
|
||||
Entity var2 = (Entity)this.entityList.iterator().next();
|
||||
this.spawnEntityInWorld(var2);
|
||||
}
|
||||
|
||||
this.sendQueue.processReadPackets();
|
||||
this.w.processReadPackets();
|
||||
|
||||
for(var1 = 0; var1 < this.blocksToReceive.size(); ++var1) {
|
||||
WorldBlockPositionType var3 = (WorldBlockPositionType)this.blocksToReceive.get(var1);
|
||||
for(var1 = 0; var1 < this.v.size(); ++var1) {
|
||||
WorldBlockPositionType var3 = (WorldBlockPositionType)this.v.get(var1);
|
||||
if(--var3.acceptCountdown == 0) {
|
||||
super.setBlockAndMetadata(var3.posX, var3.posY, var3.posZ, var3.blockID, var3.metadata);
|
||||
super.markBlockNeedsUpdate(var3.posX, var3.posY, var3.posZ);
|
||||
this.blocksToReceive.remove(var1--);
|
||||
this.v.remove(var1--);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void invalidateBlockReceiveRegion(int var1, int var2, int var3, int var4, int var5, int var6) {
|
||||
for(int var7 = 0; var7 < this.blocksToReceive.size(); ++var7) {
|
||||
WorldBlockPositionType var8 = (WorldBlockPositionType)this.blocksToReceive.get(var7);
|
||||
for(int var7 = 0; var7 < this.v.size(); ++var7) {
|
||||
WorldBlockPositionType var8 = (WorldBlockPositionType)this.v.get(var7);
|
||||
if(var8.posX >= var1 && var8.posY >= var2 && var8.posZ >= var3 && var8.posX <= var4 && var8.posY <= var5 && var8.posZ <= var6) {
|
||||
this.blocksToReceive.remove(var7--);
|
||||
this.v.remove(var7--);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected IChunkProvider getChunkProvider(File var1) {
|
||||
this.clientChunkProvider = new ChunkProviderClient(this);
|
||||
return this.clientChunkProvider;
|
||||
this.x = new ChunkProviderClient(this);
|
||||
return this.x;
|
||||
}
|
||||
|
||||
public void setSpawnLocation() {
|
||||
this.spawnX = 8;
|
||||
this.spawnY = 64;
|
||||
this.spawnZ = 8;
|
||||
this.m = 8;
|
||||
this.spawnX = 64;
|
||||
this.spawnY = 8;
|
||||
}
|
||||
|
||||
protected void updateBlocksAndPlayCaveSounds() {
|
||||
|
@ -74,9 +74,9 @@ public class WorldClient extends World {
|
|||
|
||||
public void doPreChunk(int var1, int var2, boolean var3) {
|
||||
if(var3) {
|
||||
this.clientChunkProvider.loadChunk(var1, var2);
|
||||
this.x.loadChunk(var1, var2);
|
||||
} else {
|
||||
this.clientChunkProvider.unloadChunk(var1, var2);
|
||||
this.x.unloadChunk(var1, var2);
|
||||
}
|
||||
|
||||
if(!var3) {
|
||||
|
@ -88,7 +88,7 @@ public class WorldClient extends World {
|
|||
public boolean spawnEntityInWorld(Entity var1) {
|
||||
boolean var2 = super.spawnEntityInWorld(var1);
|
||||
if(var1 instanceof EntityPlayerSP) {
|
||||
this.entityList.add(var1);
|
||||
this.z.add(var1);
|
||||
}
|
||||
|
||||
return var2;
|
||||
|
@ -97,44 +97,44 @@ public class WorldClient extends World {
|
|||
public void setEntityDead(Entity var1) {
|
||||
super.setEntityDead(var1);
|
||||
if(var1 instanceof EntityPlayerSP) {
|
||||
this.entityList.remove(var1);
|
||||
this.z.remove(var1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void obtainEntitySkin(Entity var1) {
|
||||
super.obtainEntitySkin(var1);
|
||||
if(this.entitySpawnQueue.contains(var1)) {
|
||||
this.entitySpawnQueue.remove(var1);
|
||||
if(this.entityList.contains(var1)) {
|
||||
this.entityList.remove(var1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void releaseEntitySkin(Entity var1) {
|
||||
super.releaseEntitySkin(var1);
|
||||
if(this.entityList.contains(var1)) {
|
||||
this.entitySpawnQueue.add(var1);
|
||||
if(this.z.contains(var1)) {
|
||||
this.entityList.add(var1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void addEntityToWorld(int var1, Entity var2) {
|
||||
this.entityList.add(var2);
|
||||
this.z.add(var2);
|
||||
if(!this.spawnEntityInWorld(var2)) {
|
||||
this.entitySpawnQueue.add(var2);
|
||||
this.entityList.add(var2);
|
||||
}
|
||||
|
||||
this.entityHashTable.addKey(var1, var2);
|
||||
this.y.addKey(var1, var2);
|
||||
}
|
||||
|
||||
public Entity getEntityByID(int var1) {
|
||||
return (Entity)this.entityHashTable.lookup(var1);
|
||||
return (Entity)this.y.lookup(var1);
|
||||
}
|
||||
|
||||
public Entity removeEntityFromWorld(int var1) {
|
||||
Entity var2 = (Entity)this.entityHashTable.removeObject(var1);
|
||||
Entity var2 = (Entity)this.y.removeObject(var1);
|
||||
if(var2 != null) {
|
||||
this.entityList.remove(var2);
|
||||
this.z.remove(var2);
|
||||
this.setEntityDead(var2);
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,7 @@ public class WorldClient extends World {
|
|||
int var5 = this.getBlockId(var1, var2, var3);
|
||||
int var6 = this.getBlockMetadata(var1, var2, var3);
|
||||
if(super.setBlockMetadata(var1, var2, var3, var4)) {
|
||||
this.blocksToReceive.add(new WorldBlockPositionType(this, var1, var2, var3, var5, var6));
|
||||
this.v.add(new WorldBlockPositionType(this, var1, var2, var3, var5, var6));
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
@ -156,7 +156,7 @@ public class WorldClient extends World {
|
|||
int var6 = this.getBlockId(var1, var2, var3);
|
||||
int var7 = this.getBlockMetadata(var1, var2, var3);
|
||||
if(super.setBlockAndMetadata(var1, var2, var3, var4, var5)) {
|
||||
this.blocksToReceive.add(new WorldBlockPositionType(this, var1, var2, var3, var6, var7));
|
||||
this.v.add(new WorldBlockPositionType(this, var1, var2, var3, var6, var7));
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
@ -167,7 +167,7 @@ public class WorldClient extends World {
|
|||
int var5 = this.getBlockId(var1, var2, var3);
|
||||
int var6 = this.getBlockMetadata(var1, var2, var3);
|
||||
if(super.setBlock(var1, var2, var3, var4)) {
|
||||
this.blocksToReceive.add(new WorldBlockPositionType(this, var1, var2, var3, var5, var6));
|
||||
this.v.add(new WorldBlockPositionType(this, var1, var2, var3, var5, var6));
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
@ -185,6 +185,6 @@ public class WorldClient extends World {
|
|||
}
|
||||
|
||||
public void sendQuittingDisconnectingPacket() {
|
||||
this.sendQueue.addToSendQueue(new Packet255KickDisconnect("Quitting"));
|
||||
this.w.addToSendQueue(new Packet255KickDisconnect("Quitting"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,11 +3,11 @@ package net.minecraft.src;
|
|||
import java.io.File;
|
||||
|
||||
class WorldIso extends World {
|
||||
final CanvasIsomPreview isomPreview;
|
||||
final CanvasIsomPreview v;
|
||||
|
||||
WorldIso(CanvasIsomPreview var1, File var2, String var3) {
|
||||
super(var2, var3);
|
||||
this.isomPreview = var1;
|
||||
this.v = var1;
|
||||
}
|
||||
|
||||
protected IChunkProvider getChunkProvider(File var1) {
|
||||
|
|
|
@ -192,9 +192,13 @@ Omnipotent!
|
|||
Gasp!
|
||||
...!
|
||||
Bees, bees, bees, bees!
|
||||
Jag k<EFBFBD>nner en bot!
|
||||
Jag känner en bot!
|
||||
This text is hard to read if you play the game at the default resolution, but at 1080p it's fine!
|
||||
Haha, LOL!
|
||||
Hampsterdance!
|
||||
Switches and ores!
|
||||
Revived by Aria!
|
||||
Menger sponge!
|
||||
idspispopd!
|
||||
Eple (original edit)!
|
||||
So fresh, so clean!
|
||||
Revived by Aria!
|
||||
|
|
|
@ -17,9 +17,11 @@ import net.minecraft.src.EntityPlayerMP;
|
|||
import net.minecraft.src.EntityTracker;
|
||||
import net.minecraft.src.ICommandListener;
|
||||
import net.minecraft.src.IProgressUpdate;
|
||||
import net.minecraft.src.IUpdatePlayerListBox;
|
||||
import net.minecraft.src.Item;
|
||||
import net.minecraft.src.ItemStack;
|
||||
import net.minecraft.src.NetworkListenThread;
|
||||
import net.minecraft.src.NoiseGenerator;
|
||||
import net.minecraft.src.Packet3Chat;
|
||||
import net.minecraft.src.PropertyManager;
|
||||
import net.minecraft.src.ServerConfigurationManager;
|
||||
|
@ -31,7 +33,7 @@ import net.minecraft.src.Vec3D;
|
|||
import net.minecraft.src.WorldManager;
|
||||
import net.minecraft.src.WorldServer;
|
||||
|
||||
public class MinecraftServer implements Runnable {
|
||||
public class MinecraftServer implements ICommandListener, Runnable {
|
||||
public static Logger logger = Logger.getLogger("Minecraft");
|
||||
public static HashMap playerList = new HashMap();
|
||||
public NetworkListenThread networkServer;
|
||||
|
@ -57,7 +59,7 @@ public class MinecraftServer implements Runnable {
|
|||
var1.setDaemon(true);
|
||||
var1.start();
|
||||
ConsoleLogManager.init();
|
||||
logger.info("Starting minecraft server version 0.1.2_01");
|
||||
logger.info("Starting minecraft server version 0.1.3");
|
||||
if(Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) {
|
||||
logger.warning("**** NOT ENOUGH RAM!");
|
||||
logger.warning("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\"");
|
||||
|
@ -243,7 +245,7 @@ public class MinecraftServer implements Runnable {
|
|||
this.entityTracker.updateTrackedEntities();
|
||||
|
||||
for(var6 = 0; var6 < this.playersOnline.size(); ++var6) {
|
||||
((ICommandListener)this.playersOnline.get(var6)).getUsername();
|
||||
((IUpdatePlayerListBox)this.playersOnline.get(var6)).addAllPlayers();
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -254,199 +256,179 @@ public class MinecraftServer implements Runnable {
|
|||
|
||||
}
|
||||
|
||||
public void addCommand(String var1) {
|
||||
this.commands.add(var1);
|
||||
public void addCommand(String var1, ICommandListener var2) {
|
||||
this.commands.add(new NoiseGenerator(var1, var2));
|
||||
}
|
||||
|
||||
public void commandLineParser() {
|
||||
while(this.commands.size() > 0) {
|
||||
String var1 = (String)this.commands.remove(0);
|
||||
if(!var1.toLowerCase().startsWith("help") && !var1.toLowerCase().startsWith("?")) {
|
||||
if(var1.toLowerCase().startsWith("list")) {
|
||||
logger.info("Connected players: " + this.configManager.getPlayerList());
|
||||
} else if(var1.toLowerCase().startsWith("stop")) {
|
||||
NoiseGenerator var1 = (NoiseGenerator)this.commands.remove(0);
|
||||
String var2 = var1.a;
|
||||
ICommandListener var3 = var1.b;
|
||||
String var4 = var3.getUsername();
|
||||
if(!var2.toLowerCase().startsWith("help") && !var2.toLowerCase().startsWith("?")) {
|
||||
if(var2.toLowerCase().startsWith("list")) {
|
||||
var3.addHelpCommandMessage("Connected players: " + this.configManager.getPlayerList());
|
||||
} else if(var2.toLowerCase().startsWith("stop")) {
|
||||
this.print(var4, "Stopping the server..");
|
||||
this.serverRunning = false;
|
||||
} else if(var1.toLowerCase().startsWith("save-all")) {
|
||||
logger.log(Level.INFO, "Forcing save..");
|
||||
} else if(var2.toLowerCase().startsWith("save-all")) {
|
||||
this.print(var4, "Forcing save..");
|
||||
this.worldMngr.saveWorld(true, (IProgressUpdate)null);
|
||||
logger.log(Level.INFO, "Save complete.");
|
||||
} else if(var1.toLowerCase().startsWith("save-off")) {
|
||||
logger.log(Level.INFO, "Disabling level saving..");
|
||||
this.print(var4, "Save complete.");
|
||||
} else if(var2.toLowerCase().startsWith("save-off")) {
|
||||
this.print(var4, "Disabling level saving..");
|
||||
this.worldMngr.levelSaving = true;
|
||||
} else if(var1.toLowerCase().startsWith("save-on")) {
|
||||
logger.log(Level.INFO, "Enabling level saving..");
|
||||
} else if(var2.toLowerCase().startsWith("save-on")) {
|
||||
this.print(var4, "Enabling level saving..");
|
||||
this.worldMngr.levelSaving = false;
|
||||
} else {
|
||||
String var8;
|
||||
if(var1.toLowerCase().startsWith("op ")) {
|
||||
var8 = var1.substring(var1.indexOf(" ")).trim();
|
||||
this.configManager.opPlayer(var8);
|
||||
logger.log(Level.INFO, "Opping " + var8);
|
||||
} else if(var1.toLowerCase().startsWith("deop ")) {
|
||||
var8 = var1.substring(var1.indexOf(" ")).trim();
|
||||
this.configManager.deopPlayer(var8);
|
||||
logger.log(Level.INFO, "De-opping " + var8);
|
||||
} else if(var1.toLowerCase().startsWith("ban-ip ")) {
|
||||
var8 = var1.substring(var1.indexOf(" ")).trim();
|
||||
this.configManager.banIP(var8);
|
||||
logger.log(Level.INFO, "Banning ip " + var8);
|
||||
} else if(var1.toLowerCase().startsWith("pardon-ip ")) {
|
||||
var8 = var1.substring(var1.indexOf(" ")).trim();
|
||||
this.configManager.pardonIP(var8);
|
||||
logger.log(Level.INFO, "Pardoning ip " + var8);
|
||||
String var11;
|
||||
if(var2.toLowerCase().startsWith("op ")) {
|
||||
var11 = var2.substring(var2.indexOf(" ")).trim();
|
||||
this.configManager.opPlayer(var11);
|
||||
this.print(var4, "Opping " + var11);
|
||||
this.configManager.sendChatMessageToPlayer(var11, "\u00a7eYou are now op!");
|
||||
} else if(var2.toLowerCase().startsWith("deop ")) {
|
||||
var11 = var2.substring(var2.indexOf(" ")).trim();
|
||||
this.configManager.deopPlayer(var11);
|
||||
this.configManager.sendChatMessageToPlayer(var11, "\u00a7eYou are no longer op!");
|
||||
this.print(var4, "De-opping " + var11);
|
||||
} else if(var2.toLowerCase().startsWith("ban-ip ")) {
|
||||
var11 = var2.substring(var2.indexOf(" ")).trim();
|
||||
this.configManager.banIP(var11);
|
||||
this.print(var4, "Banning ip " + var11);
|
||||
} else if(var2.toLowerCase().startsWith("pardon-ip ")) {
|
||||
var11 = var2.substring(var2.indexOf(" ")).trim();
|
||||
this.configManager.pardonIP(var11);
|
||||
this.print(var4, "Pardoning ip " + var11);
|
||||
} else {
|
||||
EntityPlayerMP var9;
|
||||
int var10;
|
||||
EntityPlayerMP var12;
|
||||
if(var1.toLowerCase().startsWith("ban ")) {
|
||||
var8 = var1.substring(var1.indexOf(" ")).trim();
|
||||
this.configManager.banPlayer(var8);
|
||||
logger.log(Level.INFO, "Banning " + var8);
|
||||
var9 = null;
|
||||
if(var2.toLowerCase().startsWith("ban ")) {
|
||||
var11 = var2.substring(var2.indexOf(" ")).trim();
|
||||
this.configManager.banPlayer(var11);
|
||||
this.print(var4, "Banning " + var11);
|
||||
var12 = this.configManager.getPlayerEntity(var11);
|
||||
if(var12 != null) {
|
||||
var12.playerNetServerHandler.kickPlayer("Banned by admin");
|
||||
}
|
||||
} else if(var2.toLowerCase().startsWith("pardon ")) {
|
||||
var11 = var2.substring(var2.indexOf(" ")).trim();
|
||||
this.configManager.pardonPlayer(var11);
|
||||
this.print(var4, "Pardoning " + var11);
|
||||
} else if(var2.toLowerCase().startsWith("kick ")) {
|
||||
var11 = var2.substring(var2.indexOf(" ")).trim();
|
||||
var12 = null;
|
||||
|
||||
for(var10 = 0; var10 < this.configManager.playerEntities.size(); ++var10) {
|
||||
var12 = (EntityPlayerMP)this.configManager.playerEntities.get(var10);
|
||||
if(var12.username.equalsIgnoreCase(var8)) {
|
||||
var9 = var12;
|
||||
for(int var13 = 0; var13 < this.configManager.playerEntities.size(); ++var13) {
|
||||
EntityPlayerMP var14 = (EntityPlayerMP)this.configManager.playerEntities.get(var13);
|
||||
if(var14.username.equalsIgnoreCase(var11)) {
|
||||
var12 = var14;
|
||||
}
|
||||
}
|
||||
|
||||
if(var9 != null) {
|
||||
var9.playerNetServerHandler.kickPlayer("Banned by admin");
|
||||
}
|
||||
} else if(var1.toLowerCase().startsWith("pardon ")) {
|
||||
var8 = var1.substring(var1.indexOf(" ")).trim();
|
||||
this.configManager.pardonPlayer(var8);
|
||||
logger.log(Level.INFO, "Pardoning " + var8);
|
||||
} else if(var1.toLowerCase().startsWith("kick ")) {
|
||||
var8 = var1.substring(var1.indexOf(" ")).trim();
|
||||
var9 = null;
|
||||
|
||||
for(var10 = 0; var10 < this.configManager.playerEntities.size(); ++var10) {
|
||||
var12 = (EntityPlayerMP)this.configManager.playerEntities.get(var10);
|
||||
if(var12.username.equalsIgnoreCase(var8)) {
|
||||
var9 = var12;
|
||||
}
|
||||
}
|
||||
|
||||
if(var9 != null) {
|
||||
var9.playerNetServerHandler.kickPlayer("Kicked by admin");
|
||||
logger.log(Level.INFO, "Kicking " + var9.username);
|
||||
if(var12 != null) {
|
||||
var12.playerNetServerHandler.kickPlayer("Kicked by admin");
|
||||
this.print(var4, "Kicking " + var12.username);
|
||||
} else {
|
||||
logger.log(Level.INFO, "Can\'t find user " + var8 + ". No kick.");
|
||||
var3.addHelpCommandMessage("Can\'t find user " + var11 + ". No kick.");
|
||||
}
|
||||
} else {
|
||||
String[] var2;
|
||||
EntityPlayerMP var4;
|
||||
int var5;
|
||||
EntityPlayerMP var6;
|
||||
if(var1.toLowerCase().startsWith("tp ")) {
|
||||
var2 = var1.split(" ");
|
||||
if(var2.length == 3) {
|
||||
var9 = null;
|
||||
var4 = null;
|
||||
|
||||
for(var5 = 0; var5 < this.configManager.playerEntities.size(); ++var5) {
|
||||
var6 = (EntityPlayerMP)this.configManager.playerEntities.get(var5);
|
||||
if(var6.username.equalsIgnoreCase(var2[1])) {
|
||||
var9 = var6;
|
||||
}
|
||||
|
||||
if(var6.username.equalsIgnoreCase(var2[2])) {
|
||||
var4 = var6;
|
||||
}
|
||||
}
|
||||
|
||||
if(var9 == null) {
|
||||
logger.log(Level.INFO, "Can\'t find user " + var2[1] + ". No tp.");
|
||||
} else if(var4 == null) {
|
||||
logger.log(Level.INFO, "Can\'t find user " + var2[2] + ". No tp.");
|
||||
String[] var5;
|
||||
EntityPlayerMP var7;
|
||||
if(var2.toLowerCase().startsWith("tp ")) {
|
||||
var5 = var2.split(" ");
|
||||
if(var5.length == 3) {
|
||||
var12 = this.configManager.getPlayerEntity(var5[1]);
|
||||
var7 = this.configManager.getPlayerEntity(var5[2]);
|
||||
if(var12 == null) {
|
||||
var3.addHelpCommandMessage("Can\'t find user " + var5[1] + ". No tp.");
|
||||
} else if(var7 == null) {
|
||||
var3.addHelpCommandMessage("Can\'t find user " + var5[2] + ". No tp.");
|
||||
} else {
|
||||
var9.playerNetServerHandler.teleportTo(var4.posX, var4.posY, var4.posZ, var4.rotationYaw, var4.rotationPitch);
|
||||
logger.log(Level.INFO, "Teleporting " + var2[1] + " to " + var2[2] + ".");
|
||||
var12.playerNetServerHandler.teleportTo(var7.posX, var7.posY, var7.posZ, var7.rotationYaw, var7.rotationPitch);
|
||||
this.print(var4, "Teleporting " + var5[1] + " to " + var5[2] + ".");
|
||||
}
|
||||
} else {
|
||||
logger.log(Level.INFO, "Teleporting " + var2[1] + " to " + var2[2] + ".");
|
||||
var3.addHelpCommandMessage("Syntax error, please provice a source and a target-");
|
||||
}
|
||||
} else if(var1.toLowerCase().startsWith("give ")) {
|
||||
var2 = var1.split(" ");
|
||||
if(var2.length != 3 && var2.length != 4) {
|
||||
} else if(var2.toLowerCase().startsWith("give ")) {
|
||||
var5 = var2.split(" ");
|
||||
if(var5.length != 3 && var5.length != 4) {
|
||||
return;
|
||||
}
|
||||
|
||||
String var3 = var2[1];
|
||||
var4 = null;
|
||||
|
||||
for(var5 = 0; var5 < this.configManager.playerEntities.size(); ++var5) {
|
||||
var6 = (EntityPlayerMP)this.configManager.playerEntities.get(var5);
|
||||
if(var6.username.equalsIgnoreCase(var3)) {
|
||||
var4 = var6;
|
||||
}
|
||||
}
|
||||
|
||||
if(var4 != null) {
|
||||
String var6 = var5[1];
|
||||
var7 = this.configManager.getPlayerEntity(var6);
|
||||
if(var7 != null) {
|
||||
try {
|
||||
var5 = Integer.parseInt(var2[2]);
|
||||
if(Item.itemsList[var5] != null) {
|
||||
logger.log(Level.INFO, "Giving " + var4.username + " some " + var5);
|
||||
int var11 = 1;
|
||||
if(var2.length > 3) {
|
||||
var11 = this.parseInt(var2[3], 1);
|
||||
int var8 = Integer.parseInt(var5[2]);
|
||||
if(Item.itemsList[var8] != null) {
|
||||
this.print(var4, "Giving " + var7.username + " some " + var8);
|
||||
int var9 = 1;
|
||||
if(var5.length > 3) {
|
||||
var9 = this.parseInt(var5[3], 1);
|
||||
}
|
||||
|
||||
if(var11 < 1) {
|
||||
var11 = 1;
|
||||
if(var9 < 1) {
|
||||
var9 = 1;
|
||||
}
|
||||
|
||||
if(var11 > 64) {
|
||||
var11 = 64;
|
||||
if(var9 > 64) {
|
||||
var9 = 64;
|
||||
}
|
||||
|
||||
var4.dropPlayerItem(new ItemStack(var5, var11));
|
||||
var7.dropPlayerItem(new ItemStack(var8, var9));
|
||||
} else {
|
||||
logger.log(Level.INFO, "There\'s no item with id " + var5);
|
||||
var3.addHelpCommandMessage("There\'s no item with id " + var8);
|
||||
}
|
||||
} catch (NumberFormatException var7) {
|
||||
logger.log(Level.INFO, "There\'s no item with id " + var2[2]);
|
||||
} catch (NumberFormatException var10) {
|
||||
var3.addHelpCommandMessage("There\'s no item with id " + var5[2]);
|
||||
}
|
||||
} else {
|
||||
logger.log(Level.INFO, "Can\'t find user " + var3);
|
||||
var3.addHelpCommandMessage("Can\'t find user " + var6);
|
||||
}
|
||||
} else if(var1.toLowerCase().startsWith("say ")) {
|
||||
var1 = var1.substring(var1.indexOf(" ")).trim();
|
||||
logger.info("[Server] " + var1);
|
||||
this.configManager.sendPacketToPlayer(new Packet3Chat("\u00a7d[Server] " + var1));
|
||||
} else if(var2.toLowerCase().startsWith("say ")) {
|
||||
var2 = var2.substring(var2.indexOf(" ")).trim();
|
||||
logger.info("[" + var4 + "] " + var2);
|
||||
this.configManager.sendPacketToPlayer(new Packet3Chat("\u00a7d[Server] " + var2));
|
||||
} else {
|
||||
logger.warning("Unknown console command. Type \"help\" for help.");
|
||||
logger.info("Unknown console command. Type \"help\" for help.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
logger.info("To run the server without a gui, start it like this:");
|
||||
logger.info(" java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui");
|
||||
logger.info("Console commands:");
|
||||
logger.info(" help or ? shows this message");
|
||||
logger.info(" kick <player> removes a player from the server");
|
||||
logger.info(" ban <player> bans a player from the server");
|
||||
logger.info(" pardon <player> pardons a banned player so that they can connect again");
|
||||
logger.info(" ban-ip <ip> bans an IP address from the server");
|
||||
logger.info(" pardon-ip <ip> pardons a banned IP address so that they can connect again");
|
||||
logger.info(" op <player> turns a player into an op");
|
||||
logger.info(" deop <player> removes op status from a player");
|
||||
logger.info(" tp <player1> <player2> moves one player to the same location as another player");
|
||||
logger.info(" give <player> <id> [num] gives a player a resource");
|
||||
logger.info(" stop gracefully stops the server");
|
||||
logger.info(" save-all forces a server-wide level save");
|
||||
logger.info(" save-off disables terrain saving (useful for backup scripts)");
|
||||
logger.info(" save-on re-enables terrain saving");
|
||||
logger.info(" list lists all currently connected players");
|
||||
logger.info(" say <message> broadcasts a message to all players");
|
||||
var3.addHelpCommandMessage("To run the server without a gui, start it like this:");
|
||||
var3.addHelpCommandMessage(" java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui");
|
||||
var3.addHelpCommandMessage("Console commands:");
|
||||
var3.addHelpCommandMessage(" help or ? shows this message");
|
||||
var3.addHelpCommandMessage(" kick <player> removes a player from the server");
|
||||
var3.addHelpCommandMessage(" ban <player> bans a player from the server");
|
||||
var3.addHelpCommandMessage(" pardon <player> pardons a banned player so that they can connect again");
|
||||
var3.addHelpCommandMessage(" ban-ip <ip> bans an IP address from the server");
|
||||
var3.addHelpCommandMessage(" pardon-ip <ip> pardons a banned IP address so that they can connect again");
|
||||
var3.addHelpCommandMessage(" op <player> turns a player into an op");
|
||||
var3.addHelpCommandMessage(" deop <player> removes op status from a player");
|
||||
var3.addHelpCommandMessage(" tp <player1> <player2> moves one player to the same location as another player");
|
||||
var3.addHelpCommandMessage(" give <player> <id> [num] gives a player a resource");
|
||||
var3.addHelpCommandMessage(" stop gracefully stops the server");
|
||||
var3.addHelpCommandMessage(" save-all forces a server-wide level save");
|
||||
var3.addHelpCommandMessage(" save-off disables terrain saving (useful for backup scripts)");
|
||||
var3.addHelpCommandMessage(" save-on re-enables terrain saving");
|
||||
var3.addHelpCommandMessage(" list lists all currently connected players");
|
||||
var3.addHelpCommandMessage(" say <message> broadcasts a message to all players");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void print(String var1, String var2) {
|
||||
String var3 = var1 + ": " + var2;
|
||||
this.configManager.setPlayerManager("\u00a77(" + var3 + ")");
|
||||
logger.info(var3);
|
||||
}
|
||||
|
||||
private int parseInt(String var1, int var2) {
|
||||
try {
|
||||
return Integer.parseInt(var1);
|
||||
|
@ -455,7 +437,7 @@ public class MinecraftServer implements Runnable {
|
|||
}
|
||||
}
|
||||
|
||||
public void addToOnlinePlayerList(ICommandListener var1) {
|
||||
public void addToOnlinePlayerList(IUpdatePlayerListBox var1) {
|
||||
this.playersOnline.add(var1);
|
||||
}
|
||||
|
||||
|
@ -477,6 +459,14 @@ public class MinecraftServer implements Runnable {
|
|||
return new File(var1);
|
||||
}
|
||||
|
||||
public void addHelpCommandMessage(String var1) {
|
||||
logger.info(var1);
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return "CONSOLE";
|
||||
}
|
||||
|
||||
public static boolean isServerRunning(MinecraftServer var0) {
|
||||
return var0.serverRunning;
|
||||
}
|
||||
|
|
|
@ -10,9 +10,9 @@ public class Block {
|
|||
public static final StepSound soundGrassFootstep = new StepSound("grass", 1.0F, 1.0F);
|
||||
public static final StepSound soundStoneFootstep = new StepSound("stone", 1.0F, 1.0F);
|
||||
public static final StepSound soundMetalFootstep = new StepSound("stone", 1.0F, 1.5F);
|
||||
public static final StepSound soundGlassFootstepo = new StepSoundSand("stone", 1.0F, 1.0F);
|
||||
public static final StepSound soundGlassFootstepo = new StepSoundGlass("stone", 1.0F, 1.0F);
|
||||
public static final StepSound soundClothFootstep = new StepSound("cloth", 1.0F, 1.0F);
|
||||
public static final StepSound soundSandFootstep = new StepSoundGlass("sand", 1.0F, 1.0F);
|
||||
public static final StepSound soundSandFootstep = new StepSoundSand("sand", 1.0F, 1.0F);
|
||||
public static final Block[] canBlockGrass = new Block[256];
|
||||
public static final boolean[] tickOnLoad = new boolean[256];
|
||||
public static final boolean[] opaqueCubeLookup = new boolean[256];
|
||||
|
|
|
@ -17,6 +17,8 @@ public class ChunkProviderGenerate implements IChunkProvider {
|
|||
private double[] sandNoise = new double[256];
|
||||
private double[] gravelNoise = new double[256];
|
||||
private double[] stoneNoise = new double[256];
|
||||
private MapGenBase caveGenerator = new MapGenCaves();
|
||||
private MapGenBase caveGenerator2 = new MapGenBase2();
|
||||
double[] noise3;
|
||||
double[] noise1;
|
||||
double[] noise2;
|
||||
|
@ -183,201 +185,11 @@ public class ChunkProviderGenerate implements IChunkProvider {
|
|||
Chunk var4 = new Chunk(this.worldObj, var3, var1, var2);
|
||||
this.generateTerrain(var1, var2, var3);
|
||||
this.replaceSurfaceBlocks(var1, var2, var3);
|
||||
this.c(var1, var2, var3);
|
||||
this.caveGenerator.generate(this, this.worldObj, var1, var2, var3);
|
||||
var4.generateHeightMap();
|
||||
return var4;
|
||||
}
|
||||
|
||||
protected void a(int var1, int var2, byte[] var3, double var4, double var6, double var8) {
|
||||
this.a(var1, var2, var3, var4, var6, var8, 1.0F + this.rand.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D);
|
||||
}
|
||||
|
||||
protected void a(int var1, int var2, byte[] var3, double var4, double var6, double var8, float var10, float var11, float var12, int var13, int var14, double var15) {
|
||||
double var17 = (double)(var1 * 16 + 8);
|
||||
double var19 = (double)(var2 * 16 + 8);
|
||||
float var21 = 0.0F;
|
||||
float var22 = 0.0F;
|
||||
Random var23 = new Random(this.rand.nextLong());
|
||||
if(var14 <= 0) {
|
||||
byte var24 = 112;
|
||||
var14 = var24 - var23.nextInt(var24 / 4);
|
||||
}
|
||||
|
||||
boolean var52 = false;
|
||||
if(var13 == -1) {
|
||||
var13 = var14 / 2;
|
||||
var52 = true;
|
||||
}
|
||||
|
||||
int var25 = var23.nextInt(var14 / 2) + var14 / 4;
|
||||
|
||||
for(boolean var26 = var23.nextInt(6) == 0; var13 < var14; ++var13) {
|
||||
double var27 = 1.5D + (double)(MathHelper.sin((float)var13 * (float)Math.PI / (float)var14) * var10 * 1.0F);
|
||||
double var29 = var27 * var15;
|
||||
float var31 = MathHelper.cos(var12);
|
||||
float var32 = MathHelper.sin(var12);
|
||||
var4 += (double)(MathHelper.cos(var11) * var31);
|
||||
var6 += (double)var32;
|
||||
var8 += (double)(MathHelper.sin(var11) * var31);
|
||||
if(var26) {
|
||||
var12 *= 0.92F;
|
||||
} else {
|
||||
var12 *= 0.7F;
|
||||
}
|
||||
|
||||
var12 += var22 * 0.1F;
|
||||
var11 += var21 * 0.1F;
|
||||
var22 *= 0.9F;
|
||||
var21 *= 12.0F / 16.0F;
|
||||
var22 += (var23.nextFloat() - var23.nextFloat()) * var23.nextFloat() * 2.0F;
|
||||
var21 += (var23.nextFloat() - var23.nextFloat()) * var23.nextFloat() * 4.0F;
|
||||
if(!var52 && var13 == var25 && var10 > 1.0F) {
|
||||
this.a(var1, var2, var3, var4, var6, var8, var23.nextFloat() * 0.5F + 0.5F, var11 - (float)Math.PI * 0.5F, var12 / 3.0F, var13, var14, 1.0D);
|
||||
this.a(var1, var2, var3, var4, var6, var8, var23.nextFloat() * 0.5F + 0.5F, var11 + (float)Math.PI * 0.5F, var12 / 3.0F, var13, var14, 1.0D);
|
||||
return;
|
||||
}
|
||||
|
||||
if(var52 || var23.nextInt(4) != 0) {
|
||||
double var33 = var4 - var17;
|
||||
double var35 = var8 - var19;
|
||||
double var37 = (double)(var14 - var13);
|
||||
double var39 = (double)(var10 + 2.0F + 16.0F);
|
||||
if(var33 * var33 + var35 * var35 - var37 * var37 > var39 * var39) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(var4 >= var17 - 16.0D - var27 * 2.0D && var8 >= var19 - 16.0D - var27 * 2.0D && var4 <= var17 + 16.0D + var27 * 2.0D && var8 <= var19 + 16.0D + var27 * 2.0D) {
|
||||
int var53 = MathHelper.floor_double(var4 - var27) - var1 * 16 - 1;
|
||||
int var34 = MathHelper.floor_double(var4 + var27) - var1 * 16 + 1;
|
||||
int var54 = MathHelper.floor_double(var6 - var29) - 1;
|
||||
int var36 = MathHelper.floor_double(var6 + var29) + 1;
|
||||
int var55 = MathHelper.floor_double(var8 - var27) - var2 * 16 - 1;
|
||||
int var38 = MathHelper.floor_double(var8 + var27) - var2 * 16 + 1;
|
||||
if(var53 < 0) {
|
||||
var53 = 0;
|
||||
}
|
||||
|
||||
if(var34 > 16) {
|
||||
var34 = 16;
|
||||
}
|
||||
|
||||
if(var54 < 1) {
|
||||
var54 = 1;
|
||||
}
|
||||
|
||||
if(var36 > 120) {
|
||||
var36 = 120;
|
||||
}
|
||||
|
||||
if(var55 < 0) {
|
||||
var55 = 0;
|
||||
}
|
||||
|
||||
if(var38 > 16) {
|
||||
var38 = 16;
|
||||
}
|
||||
|
||||
boolean var56 = false;
|
||||
|
||||
int var40;
|
||||
int var43;
|
||||
for(var40 = var53; !var56 && var40 < var34; ++var40) {
|
||||
for(int var41 = var55; !var56 && var41 < var38; ++var41) {
|
||||
for(int var42 = var36 + 1; !var56 && var42 >= var54 - 1; --var42) {
|
||||
var43 = (var40 * 16 + var41) * 128 + var42;
|
||||
if(var42 >= 0 && var42 < 128) {
|
||||
if(var3[var43] == Block.waterMoving.blockID || var3[var43] == Block.waterStill.blockID) {
|
||||
var56 = true;
|
||||
}
|
||||
|
||||
if(var42 != var54 - 1 && var40 != var53 && var40 != var34 - 1 && var41 != var55 && var41 != var38 - 1) {
|
||||
var42 = var54;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!var56) {
|
||||
for(var40 = var53; var40 < var34; ++var40) {
|
||||
double var57 = ((double)(var40 + var1 * 16) + 0.5D - var4) / var27;
|
||||
|
||||
for(var43 = var55; var43 < var38; ++var43) {
|
||||
double var44 = ((double)(var43 + var2 * 16) + 0.5D - var8) / var27;
|
||||
int var46 = (var40 * 16 + var43) * 128 + var36;
|
||||
boolean var47 = false;
|
||||
|
||||
for(int var48 = var36 - 1; var48 >= var54; --var48) {
|
||||
double var49 = ((double)var48 + 0.5D - var6) / var29;
|
||||
if(var49 > -0.7D && var57 * var57 + var49 * var49 + var44 * var44 < 1.0D) {
|
||||
byte var51 = var3[var46];
|
||||
if(var51 == Block.grass.blockID) {
|
||||
var47 = true;
|
||||
}
|
||||
|
||||
if(var51 == Block.stone.blockID || var51 == Block.dirt.blockID || var51 == Block.grass.blockID) {
|
||||
if(var48 < 10) {
|
||||
var3[var46] = (byte)Block.lavaMoving.blockID;
|
||||
} else {
|
||||
var3[var46] = 0;
|
||||
if(var47 && var3[var46 - 1] == Block.dirt.blockID) {
|
||||
var3[var46 - 1] = (byte)Block.grass.blockID;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
--var46;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(var52) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void c(int var1, int var2, byte[] var3) {
|
||||
byte var4 = 8;
|
||||
this.rand.setSeed(this.worldObj.randomSeed);
|
||||
long var5 = this.rand.nextLong() / 2L * 2L + 1L;
|
||||
long var7 = this.rand.nextLong() / 2L * 2L + 1L;
|
||||
|
||||
for(int var9 = var1 - var4; var9 <= var1 + var4; ++var9) {
|
||||
for(int var10 = var2 - var4; var10 <= var2 + var4; ++var10) {
|
||||
this.rand.setSeed((long)var9 * var5 + (long)var10 * var7 ^ this.worldObj.randomSeed);
|
||||
int var11 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(40) + 1) + 1);
|
||||
if(this.rand.nextInt(15) != 0) {
|
||||
var11 = 0;
|
||||
}
|
||||
|
||||
for(int var12 = 0; var12 < var11; ++var12) {
|
||||
double var13 = (double)(var9 * 16 + this.rand.nextInt(16));
|
||||
double var15 = (double)this.rand.nextInt(this.rand.nextInt(120) + 8);
|
||||
double var17 = (double)(var10 * 16 + this.rand.nextInt(16));
|
||||
int var19 = 1;
|
||||
if(this.rand.nextInt(4) == 0) {
|
||||
this.a(var1, var2, var3, var13, var15, var17);
|
||||
var19 += this.rand.nextInt(4);
|
||||
}
|
||||
|
||||
for(int var20 = 0; var20 < var19; ++var20) {
|
||||
float var21 = this.rand.nextFloat() * (float)Math.PI * 2.0F;
|
||||
float var22 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F;
|
||||
float var23 = this.rand.nextFloat() * 2.0F + this.rand.nextFloat();
|
||||
this.a(var1, var2, var3, var13, var15, var17, var23, var21, var22, 0, 0, 1.0D);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private double[] initializeNoiseField(double[] var1, int var2, int var3, int var4, int var5, int var6, int var7) {
|
||||
if(var1 == null) {
|
||||
var1 = new double[var5 * var6 * var7];
|
||||
|
@ -637,13 +449,11 @@ public class ChunkProviderGenerate implements IChunkProvider {
|
|||
(new WorldGenLiquids(Block.lavaMoving.blockID)).generate(this.worldObj, this.rand, var15, var16, var17);
|
||||
}
|
||||
|
||||
if(this.worldObj.snowCovered) {
|
||||
for(var14 = var4 + 8 + 0; var14 < var4 + 8 + 16; ++var14) {
|
||||
for(var15 = var5 + 8 + 0; var15 < var5 + 8 + 16; ++var15) {
|
||||
var16 = this.worldObj.getTopSolidOrLiquidBlock(var14, var15);
|
||||
if(var16 > 0 && var16 < 128 && this.worldObj.getBlockId(var14, var16, var15) == 0 && this.worldObj.getBlockMaterial(var14, var16 - 1, var15).getIsSolid() && this.worldObj.getBlockMaterial(var14, var16 - 1, var15) != Material.ice) {
|
||||
this.worldObj.setBlockWithNotify(var14, var16, var15, Block.snow.blockID);
|
||||
}
|
||||
for(var14 = var4 + 8 + 0; var14 < var4 + 8 + 16; ++var14) {
|
||||
for(var15 = var5 + 8 + 0; var15 < var5 + 8 + 16; ++var15) {
|
||||
var16 = this.worldObj.getTopSolidOrLiquidBlock(var14, var15);
|
||||
if(this.worldObj.snowCovered && var16 > 0 && var16 < 128 && this.worldObj.getBlockId(var14, var16, var15) == 0 && this.worldObj.getBlockMaterial(var14, var16 - 1, var15).getIsSolid() && this.worldObj.getBlockMaterial(var14, var16 - 1, var15) != Material.ice) {
|
||||
this.worldObj.setBlockWithNotify(var14, var16, var15, Block.snow.blockID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -194,6 +194,6 @@ public class ChunkProviderServer implements IChunkProvider {
|
|||
}
|
||||
|
||||
public boolean canSave() {
|
||||
return true;
|
||||
return !this.worldObj.levelSaving;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,12 +41,16 @@ public class EntityChicken extends EntityAnimal {
|
|||
|
||||
this.wingRotation += this.moveWings * 2.0F;
|
||||
if(--this.timeUntilNextEgg <= 0) {
|
||||
this.worldObj.playSoundAtEntity(this, "mob.chickenplop", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
|
||||
this.dropItem(Item.egg.shiftedIndex, 1);
|
||||
this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void fall(float var1) {
|
||||
}
|
||||
|
||||
public void writeEntityToNBT(NBTTagCompound var1) {
|
||||
super.writeEntityToNBT(var1);
|
||||
}
|
||||
|
|
4
server/src/main/java/net/minecraft/src/IAnimals.java
Normal file
4
server/src/main/java/net/minecraft/src/IAnimals.java
Normal file
|
@ -0,0 +1,4 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
public abstract class IAnimals {
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
public interface ICommandListener {
|
||||
void getUsername();
|
||||
void addHelpCommandMessage(String var1);
|
||||
|
||||
String getUsername();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
public interface IUpdatePlayerListBox {
|
||||
void addAllPlayers();
|
||||
}
|
|
@ -43,7 +43,7 @@ public class Item {
|
|||
public static Item hoeStone = (new ItemHoe(35, 1)).setIconIndex(129);
|
||||
public static Item hoeSteel = (new ItemHoe(36, 2)).setIconIndex(130);
|
||||
public static Item hoeDiamond = (new ItemHoe(37, 3)).setIconIndex(131);
|
||||
public static Item hoeGold = (new ItemHoe(38, 4)).setIconIndex(132);
|
||||
public static Item hoeGold = (new ItemHoe(38, 1)).setIconIndex(132);
|
||||
public static Item seeds = (new ItemSeeds(39, Block.crops.blockID)).setIconIndex(9);
|
||||
public static Item wheat = (new Item(40)).setIconIndex(25);
|
||||
public static Item bread = (new ItemFood(41, 5)).setIconIndex(41);
|
||||
|
|
26
server/src/main/java/net/minecraft/src/MapGenBase.java
Normal file
26
server/src/main/java/net/minecraft/src/MapGenBase.java
Normal file
|
@ -0,0 +1,26 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class MapGenBase {
|
||||
protected int range = 8;
|
||||
protected Random rand = new Random();
|
||||
|
||||
public void generate(ChunkProviderGenerate var1, World var2, int var3, int var4, byte[] var5) {
|
||||
int var6 = this.range;
|
||||
this.rand.setSeed(var2.randomSeed);
|
||||
long var7 = this.rand.nextLong() / 2L * 2L + 1L;
|
||||
long var9 = this.rand.nextLong() / 2L * 2L + 1L;
|
||||
|
||||
for(int var11 = var3 - var6; var11 <= var3 + var6; ++var11) {
|
||||
for(int var12 = var4 - var6; var12 <= var4 + var6; ++var12) {
|
||||
this.rand.setSeed((long)var11 * var7 + (long)var12 * var9 ^ var2.randomSeed);
|
||||
this.recursiveGenerate(var2, var11, var12, var3, var4, var5);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void recursiveGenerate(World var1, int var2, int var3, int var4, int var5, byte[] var6) {
|
||||
}
|
||||
}
|
11
server/src/main/java/net/minecraft/src/MapGenBase2.java
Normal file
11
server/src/main/java/net/minecraft/src/MapGenBase2.java
Normal file
|
@ -0,0 +1,11 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
public class MapGenBase2 extends MapGenBase {
|
||||
protected void recursiveGenerate(World var1, int var2, int var3, int var4, int var5, byte[] var6) {
|
||||
int var7 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(40) + 1) + 1);
|
||||
if(this.rand.nextInt(15) != 0) {
|
||||
boolean var8 = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
185
server/src/main/java/net/minecraft/src/MapGenCaves.java
Normal file
185
server/src/main/java/net/minecraft/src/MapGenCaves.java
Normal file
|
@ -0,0 +1,185 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class MapGenCaves extends MapGenBase {
|
||||
protected void generateLargeCaveNode(int var1, int var2, byte[] var3, double var4, double var6, double var8) {
|
||||
this.generateCaveNode(var1, var2, var3, var4, var6, var8, 1.0F + this.rand.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D);
|
||||
}
|
||||
|
||||
protected void generateCaveNode(int var1, int var2, byte[] var3, double var4, double var6, double var8, float var10, float var11, float var12, int var13, int var14, double var15) {
|
||||
double var17 = (double)(var1 * 16 + 8);
|
||||
double var19 = (double)(var2 * 16 + 8);
|
||||
float var21 = 0.0F;
|
||||
float var22 = 0.0F;
|
||||
Random var23 = new Random(this.rand.nextLong());
|
||||
if(var14 <= 0) {
|
||||
int var24 = this.range * 16 - 16;
|
||||
var14 = var24 - var23.nextInt(var24 / 4);
|
||||
}
|
||||
|
||||
boolean var52 = false;
|
||||
if(var13 == -1) {
|
||||
var13 = var14 / 2;
|
||||
var52 = true;
|
||||
}
|
||||
|
||||
int var25 = var23.nextInt(var14 / 2) + var14 / 4;
|
||||
|
||||
for(boolean var26 = var23.nextInt(6) == 0; var13 < var14; ++var13) {
|
||||
double var27 = 1.5D + (double)(MathHelper.sin((float)var13 * (float)Math.PI / (float)var14) * var10 * 1.0F);
|
||||
double var29 = var27 * var15;
|
||||
float var31 = MathHelper.cos(var12);
|
||||
float var32 = MathHelper.sin(var12);
|
||||
var4 += (double)(MathHelper.cos(var11) * var31);
|
||||
var6 += (double)var32;
|
||||
var8 += (double)(MathHelper.sin(var11) * var31);
|
||||
if(var26) {
|
||||
var12 *= 0.92F;
|
||||
} else {
|
||||
var12 *= 0.7F;
|
||||
}
|
||||
|
||||
var12 += var22 * 0.1F;
|
||||
var11 += var21 * 0.1F;
|
||||
var22 *= 0.9F;
|
||||
var21 *= 12.0F / 16.0F;
|
||||
var22 += (var23.nextFloat() - var23.nextFloat()) * var23.nextFloat() * 2.0F;
|
||||
var21 += (var23.nextFloat() - var23.nextFloat()) * var23.nextFloat() * 4.0F;
|
||||
if(!var52 && var13 == var25 && var10 > 1.0F) {
|
||||
this.generateCaveNode(var1, var2, var3, var4, var6, var8, var23.nextFloat() * 0.5F + 0.5F, var11 - (float)Math.PI * 0.5F, var12 / 3.0F, var13, var14, 1.0D);
|
||||
this.generateCaveNode(var1, var2, var3, var4, var6, var8, var23.nextFloat() * 0.5F + 0.5F, var11 + (float)Math.PI * 0.5F, var12 / 3.0F, var13, var14, 1.0D);
|
||||
return;
|
||||
}
|
||||
|
||||
if(var52 || var23.nextInt(4) != 0) {
|
||||
double var33 = var4 - var17;
|
||||
double var35 = var8 - var19;
|
||||
double var37 = (double)(var14 - var13);
|
||||
double var39 = (double)(var10 + 2.0F + 16.0F);
|
||||
if(var33 * var33 + var35 * var35 - var37 * var37 > var39 * var39) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(var4 >= var17 - 16.0D - var27 * 2.0D && var8 >= var19 - 16.0D - var27 * 2.0D && var4 <= var17 + 16.0D + var27 * 2.0D && var8 <= var19 + 16.0D + var27 * 2.0D) {
|
||||
int var53 = MathHelper.floor_double(var4 - var27) - var1 * 16 - 1;
|
||||
int var34 = MathHelper.floor_double(var4 + var27) - var1 * 16 + 1;
|
||||
int var54 = MathHelper.floor_double(var6 - var29) - 1;
|
||||
int var36 = MathHelper.floor_double(var6 + var29) + 1;
|
||||
int var55 = MathHelper.floor_double(var8 - var27) - var2 * 16 - 1;
|
||||
int var38 = MathHelper.floor_double(var8 + var27) - var2 * 16 + 1;
|
||||
if(var53 < 0) {
|
||||
var53 = 0;
|
||||
}
|
||||
|
||||
if(var34 > 16) {
|
||||
var34 = 16;
|
||||
}
|
||||
|
||||
if(var54 < 1) {
|
||||
var54 = 1;
|
||||
}
|
||||
|
||||
if(var36 > 120) {
|
||||
var36 = 120;
|
||||
}
|
||||
|
||||
if(var55 < 0) {
|
||||
var55 = 0;
|
||||
}
|
||||
|
||||
if(var38 > 16) {
|
||||
var38 = 16;
|
||||
}
|
||||
|
||||
boolean var56 = false;
|
||||
|
||||
int var40;
|
||||
int var43;
|
||||
for(var40 = var53; !var56 && var40 < var34; ++var40) {
|
||||
for(int var41 = var55; !var56 && var41 < var38; ++var41) {
|
||||
for(int var42 = var36 + 1; !var56 && var42 >= var54 - 1; --var42) {
|
||||
var43 = (var40 * 16 + var41) * 128 + var42;
|
||||
if(var42 >= 0 && var42 < 128) {
|
||||
if(var3[var43] == Block.waterMoving.blockID || var3[var43] == Block.waterStill.blockID) {
|
||||
var56 = true;
|
||||
}
|
||||
|
||||
if(var42 != var54 - 1 && var40 != var53 && var40 != var34 - 1 && var41 != var55 && var41 != var38 - 1) {
|
||||
var42 = var54;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!var56) {
|
||||
for(var40 = var53; var40 < var34; ++var40) {
|
||||
double var57 = ((double)(var40 + var1 * 16) + 0.5D - var4) / var27;
|
||||
|
||||
for(var43 = var55; var43 < var38; ++var43) {
|
||||
double var44 = ((double)(var43 + var2 * 16) + 0.5D - var8) / var27;
|
||||
int var46 = (var40 * 16 + var43) * 128 + var36;
|
||||
boolean var47 = false;
|
||||
|
||||
for(int var48 = var36 - 1; var48 >= var54; --var48) {
|
||||
double var49 = ((double)var48 + 0.5D - var6) / var29;
|
||||
if(var49 > -0.7D && var57 * var57 + var49 * var49 + var44 * var44 < 1.0D) {
|
||||
byte var51 = var3[var46];
|
||||
if(var51 == Block.grass.blockID) {
|
||||
var47 = true;
|
||||
}
|
||||
|
||||
if(var51 == Block.stone.blockID || var51 == Block.dirt.blockID || var51 == Block.grass.blockID) {
|
||||
if(var48 < 10) {
|
||||
var3[var46] = (byte)Block.lavaMoving.blockID;
|
||||
} else {
|
||||
var3[var46] = 0;
|
||||
if(var47 && var3[var46 - 1] == Block.dirt.blockID) {
|
||||
var3[var46 - 1] = (byte)Block.grass.blockID;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
--var46;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(var52) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void recursiveGenerate(World var1, int var2, int var3, int var4, int var5, byte[] var6) {
|
||||
int var7 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(40) + 1) + 1);
|
||||
if(this.rand.nextInt(15) != 0) {
|
||||
var7 = 0;
|
||||
}
|
||||
|
||||
for(int var8 = 0; var8 < var7; ++var8) {
|
||||
double var9 = (double)(var2 * 16 + this.rand.nextInt(16));
|
||||
double var11 = (double)this.rand.nextInt(this.rand.nextInt(120) + 8);
|
||||
double var13 = (double)(var3 * 16 + this.rand.nextInt(16));
|
||||
int var15 = 1;
|
||||
if(this.rand.nextInt(4) == 0) {
|
||||
this.generateLargeCaveNode(var4, var5, var6, var9, var11, var13);
|
||||
var15 += this.rand.nextInt(4);
|
||||
}
|
||||
|
||||
for(int var16 = 0; var16 < var15; ++var16) {
|
||||
float var17 = this.rand.nextFloat() * (float)Math.PI * 2.0F;
|
||||
float var18 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F;
|
||||
float var19 = this.rand.nextFloat() * 2.0F + this.rand.nextFloat();
|
||||
this.generateCaveNode(var4, var5, var6, var9, var11, var13, var19, var17, var18, 0, 0, 1.0D);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@ import java.io.IOException;
|
|||
import java.util.logging.Logger;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
|
||||
public class NetServerHandler extends NetHandler {
|
||||
public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
public static Logger logger = Logger.getLogger("Minecraft");
|
||||
public NetworkManager netManager;
|
||||
public boolean connectionClosed = false;
|
||||
|
@ -180,22 +180,24 @@ public class NetServerHandler extends NetHandler {
|
|||
}
|
||||
|
||||
public void handlePlace(Packet15Place var1) {
|
||||
int var2 = var1.xPosition;
|
||||
int var3 = var1.yPosition;
|
||||
int var4 = var1.zPosition;
|
||||
int var5 = var1.direction;
|
||||
int var6 = (int)MathHelper.abs((float)(var2 - this.mcServer.worldMngr.spawnX));
|
||||
int var7 = (int)MathHelper.abs((float)(var4 - this.mcServer.worldMngr.spawnZ));
|
||||
if(var6 > var7) {
|
||||
var7 = var6;
|
||||
boolean var2 = this.mcServer.worldMngr.disableSpawnProtection = this.mcServer.configManager.isOp(this.playerEntity.username);
|
||||
int var3 = var1.xPosition;
|
||||
int var4 = var1.yPosition;
|
||||
int var5 = var1.zPosition;
|
||||
int var6 = var1.direction;
|
||||
int var7 = (int)MathHelper.abs((float)(var3 - this.mcServer.worldMngr.spawnX));
|
||||
int var8 = (int)MathHelper.abs((float)(var5 - this.mcServer.worldMngr.spawnZ));
|
||||
if(var7 > var8) {
|
||||
var8 = var7;
|
||||
}
|
||||
|
||||
if(var7 > 16) {
|
||||
ItemStack var8 = new ItemStack(var1.id);
|
||||
this.playerEntity.theItemInWorldManager.activeBlockOrUseItem(this.playerEntity, this.mcServer.worldMngr, var8, var2, var3, var4, var5);
|
||||
if(var8 > 16 || var2) {
|
||||
ItemStack var9 = new ItemStack(var1.id);
|
||||
this.playerEntity.theItemInWorldManager.activeBlockOrUseItem(this.playerEntity, this.mcServer.worldMngr, var9, var3, var4, var5, var6);
|
||||
}
|
||||
|
||||
this.playerEntity.playerNetServerHandler.sendPacket(new Packet53BlockChange(var2, var3, var4, this.mcServer.worldMngr));
|
||||
this.playerEntity.playerNetServerHandler.sendPacket(new Packet53BlockChange(var3, var4, var5, this.mcServer.worldMngr));
|
||||
this.mcServer.worldMngr.disableSpawnProtection = false;
|
||||
}
|
||||
|
||||
public void handleErrorMessage(String var1) {
|
||||
|
@ -266,12 +268,21 @@ public class NetServerHandler extends NetHandler {
|
|||
var1 = "* " + this.playerEntity.username + " " + var1.substring(var1.indexOf(" ")).trim();
|
||||
logger.info(var1);
|
||||
this.mcServer.configManager.sendPacketToPlayer(new Packet3Chat(var1));
|
||||
} else if(var1.toLowerCase().startsWith("/tell ")) {
|
||||
String[] var2 = var1.split(" ");
|
||||
if(var2.length >= 3) {
|
||||
var1 = var1.substring(var1.indexOf(" ")).trim();
|
||||
var1 = var1.substring(var1.indexOf(" ")).trim();
|
||||
var1 = "\u00a77" + this.playerEntity.username + " whispers " + var1;
|
||||
logger.info(var1);
|
||||
this.mcServer.configManager.sendPacketToPlayer(new Packet3Chat(var1));
|
||||
}
|
||||
} else {
|
||||
int var2;
|
||||
int var3;
|
||||
if(var1.toLowerCase().equalsIgnoreCase("/home")) {
|
||||
logger.info(this.playerEntity.username + " returned home");
|
||||
var2 = this.mcServer.worldMngr.getTopSolidOrLiquidBlock(this.mcServer.worldMngr.spawnX, this.mcServer.worldMngr.spawnZ);
|
||||
this.teleportTo((double)this.mcServer.worldMngr.spawnX + 0.5D, (double)var2 + 1.5D, (double)this.mcServer.worldMngr.spawnZ + 0.5D, 0.0F, 0.0F);
|
||||
var3 = this.mcServer.worldMngr.getTopSolidOrLiquidBlock(this.mcServer.worldMngr.spawnX, this.mcServer.worldMngr.spawnZ);
|
||||
this.teleportTo((double)this.mcServer.worldMngr.spawnX + 0.5D, (double)var3 + 1.5D, (double)this.mcServer.worldMngr.spawnZ + 0.5D, 0.0F, 0.0F);
|
||||
} else if(var1.toLowerCase().equalsIgnoreCase("/iron")) {
|
||||
if(MinecraftServer.playerList.containsKey(this.playerEntity.username)) {
|
||||
logger.info(this.playerEntity.username + " failed to iron!");
|
||||
|
@ -280,7 +291,7 @@ public class NetServerHandler extends NetHandler {
|
|||
MinecraftServer.playerList.put(this.playerEntity.username, Integer.valueOf(6000));
|
||||
logger.info(this.playerEntity.username + " ironed!");
|
||||
|
||||
for(var2 = 0; var2 < 4; ++var2) {
|
||||
for(var3 = 0; var3 < 4; ++var3) {
|
||||
this.playerEntity.dropPlayerItem(new ItemStack(Item.ingotIron, 1));
|
||||
}
|
||||
}
|
||||
|
@ -292,17 +303,20 @@ public class NetServerHandler extends NetHandler {
|
|||
MinecraftServer.playerList.put(this.playerEntity.username, Integer.valueOf(6000));
|
||||
logger.info(this.playerEntity.username + " wooded!");
|
||||
|
||||
for(var2 = 0; var2 < 4; ++var2) {
|
||||
for(var3 = 0; var3 < 4; ++var3) {
|
||||
this.playerEntity.dropPlayerItem(new ItemStack(Block.sapling, 1));
|
||||
}
|
||||
}
|
||||
} else if(var1.startsWith("/") && this.mcServer.configManager.isOp(this.playerEntity.username)) {
|
||||
String var3 = var1.substring(1);
|
||||
logger.info(this.playerEntity.username + " issued server command: " + var3);
|
||||
this.mcServer.addCommand(var3);
|
||||
} else {
|
||||
logger.info(this.playerEntity.username + " tried command " + var1);
|
||||
this.sendPacket(new Packet3Chat("\u00a79Unknown command"));
|
||||
String var4;
|
||||
if(this.mcServer.configManager.isOp(this.playerEntity.username)) {
|
||||
var4 = var1.substring(1);
|
||||
logger.info(this.playerEntity.username + " issued server command: " + var4);
|
||||
this.mcServer.addCommand(var4, this);
|
||||
} else {
|
||||
var4 = var1.substring(1);
|
||||
logger.info(this.playerEntity.username + " tried command: " + var4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -322,4 +336,12 @@ public class NetServerHandler extends NetHandler {
|
|||
public int getNumChunkDataPackets() {
|
||||
return this.netManager.getNumChunkDataPackets();
|
||||
}
|
||||
|
||||
public void addHelpCommandMessage(String var1) {
|
||||
this.sendPacket(new Packet3Chat("\u00a77" + var1));
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return this.playerEntity.username;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,11 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
public abstract class NoiseGenerator {
|
||||
public class NoiseGenerator {
|
||||
public final String a;
|
||||
public final ICommandListener b;
|
||||
|
||||
public NoiseGenerator(String var1, ICommandListener var2) {
|
||||
this.a = var1;
|
||||
this.b = var2;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package net.minecraft.src;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
public class NoiseGeneratorOctaves extends NoiseGenerator {
|
||||
public class NoiseGeneratorOctaves extends IAnimals {
|
||||
private NoiseGeneratorPerlin[] generatorCollection;
|
||||
private int octaves;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package net.minecraft.src;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
public class NoiseGeneratorPerlin extends NoiseGenerator {
|
||||
public class NoiseGeneratorPerlin extends IAnimals {
|
||||
private int[] permutations;
|
||||
public double xCoord;
|
||||
public double yCoord;
|
||||
|
|
|
@ -4,21 +4,21 @@ import java.util.Vector;
|
|||
import javax.swing.JList;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
|
||||
public class PlayerListBox extends JList implements ICommandListener {
|
||||
private MinecraftServer a;
|
||||
private int b = 0;
|
||||
public class PlayerListBox extends JList implements IUpdatePlayerListBox {
|
||||
private MinecraftServer mcServer;
|
||||
private int playerCount = 0;
|
||||
|
||||
public PlayerListBox(MinecraftServer var1) {
|
||||
this.a = var1;
|
||||
this.mcServer = var1;
|
||||
var1.addToOnlinePlayerList(this);
|
||||
}
|
||||
|
||||
public void getUsername() {
|
||||
if(this.b++ % 20 == 0) {
|
||||
public void addAllPlayers() {
|
||||
if(this.playerCount++ % 20 == 0) {
|
||||
Vector var1 = new Vector();
|
||||
|
||||
for(int var2 = 0; var2 < this.a.configManager.playerEntities.size(); ++var2) {
|
||||
var1.add(((EntityPlayerMP)this.a.configManager.playerEntities.get(var2)).username);
|
||||
for(int var2 = 0; var2 < this.mcServer.configManager.playerEntities.size(); ++var2) {
|
||||
var1.add(((EntityPlayerMP)this.mcServer.configManager.playerEntities.get(var2)).username);
|
||||
}
|
||||
|
||||
this.setListData(var1);
|
||||
|
|
|
@ -266,4 +266,35 @@ public class ServerConfigurationManager {
|
|||
public boolean isOp(String var1) {
|
||||
return this.ops.contains(var1.trim().toLowerCase());
|
||||
}
|
||||
|
||||
public EntityPlayerMP getPlayerEntity(String var1) {
|
||||
for(int var2 = 0; var2 < this.playerEntities.size(); ++var2) {
|
||||
EntityPlayerMP var3 = (EntityPlayerMP)this.playerEntities.get(var2);
|
||||
if(var3.username.equalsIgnoreCase(var1)) {
|
||||
return var3;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void sendChatMessageToPlayer(String var1, String var2) {
|
||||
EntityPlayerMP var3 = this.getPlayerEntity(var1);
|
||||
if(var3 != null) {
|
||||
var3.playerNetServerHandler.sendPacket(new Packet3Chat(var2));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setPlayerManager(String var1) {
|
||||
Packet3Chat var2 = new Packet3Chat(var1);
|
||||
|
||||
for(int var3 = 0; var3 < this.playerEntities.size(); ++var3) {
|
||||
EntityPlayerMP var4 = (EntityPlayerMP)this.playerEntities.get(var3);
|
||||
if(this.isOp(var4.username)) {
|
||||
var4.playerNetServerHandler.sendPacket(var2);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ import javax.swing.border.EtchedBorder;
|
|||
import javax.swing.border.TitledBorder;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
|
||||
public class ServerGUI extends JComponent {
|
||||
public class ServerGUI extends JComponent implements ICommandListener {
|
||||
public static Logger logger = Logger.getLogger("Minecraft");
|
||||
private MinecraftServer mcServer;
|
||||
|
||||
|
@ -78,6 +78,14 @@ public class ServerGUI extends JComponent {
|
|||
return var1;
|
||||
}
|
||||
|
||||
public void addHelpCommandMessage(String var1) {
|
||||
logger.info(var1);
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return "CONSOLE";
|
||||
}
|
||||
|
||||
static MinecraftServer getMinecraftServer(ServerGUI var0) {
|
||||
return var0.mcServer;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ class ServerGuiCommandListener implements ActionListener {
|
|||
public void actionPerformed(ActionEvent var1) {
|
||||
String var2 = this.textField.getText().trim();
|
||||
if(var2.length() > 0) {
|
||||
ServerGUI.getMinecraftServer(this.mcServerGui).addCommand(var2);
|
||||
ServerGUI.getMinecraftServer(this.mcServerGui).addCommand(var2, this.mcServerGui);
|
||||
}
|
||||
|
||||
this.textField.setText("");
|
||||
|
|
|
@ -23,7 +23,7 @@ public class ThreadCommandReader extends Thread {
|
|||
break;
|
||||
}
|
||||
|
||||
this.mcServer.addCommand(var2);
|
||||
this.mcServer.addCommand(var2, this.mcServer);
|
||||
}
|
||||
} catch (IOException var4) {
|
||||
var4.printStackTrace();
|
||||
|
|
|
@ -773,6 +773,10 @@ public class World implements IBlockAccess {
|
|||
int var2 = MathHelper.floor_double(var1.posX / 16.0D);
|
||||
int var3 = MathHelper.floor_double(var1.posZ / 16.0D);
|
||||
boolean var4 = false;
|
||||
if(var1 instanceof EntityPlayer) {
|
||||
var4 = true;
|
||||
}
|
||||
|
||||
if(!var4 && !this.chunkExists(var2, var3)) {
|
||||
return false;
|
||||
} else {
|
||||
|
|
|
@ -9,7 +9,6 @@ public class WorldServer extends World {
|
|||
|
||||
public WorldServer(File var1, String var2) {
|
||||
super(var1, var2);
|
||||
this.snowCovered = false;
|
||||
}
|
||||
|
||||
protected IChunkProvider getChunkProvider(File var1) {
|
||||
|
|
Loading…
Reference in a new issue