Bunchafixes which may or may not have any end result

This commit is contained in:
Dinnerbone 2011-09-16 20:10:11 +01:00
parent 94d1338feb
commit 900c541246
9 changed files with 69 additions and 88 deletions

View File

@ -51,6 +51,7 @@ public class BlockMushroom extends BlockFlower {
k1 = k + random.nextInt(3) - 1; k1 = k + random.nextInt(3) - 1;
} }
if (world.isEmpty(i1, j1, k1) && this.f(world, i1, j1, k1)) {
// CraftBukkit start // CraftBukkit start
org.bukkit.World bworld = world.getWorld(); org.bukkit.World bworld = world.getWorld();
org.bukkit.block.BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState(); org.bukkit.block.BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState();
@ -65,6 +66,7 @@ public class BlockMushroom extends BlockFlower {
// CraftBukkit end // CraftBukkit end
} }
} }
}
protected boolean c(int i) { protected boolean c(int i) {
return Block.o[i]; return Block.o[i];

View File

@ -265,43 +265,6 @@ public class BlockPiston extends Block {
int k1 = k + PistonBlockTextures.d[l]; int k1 = k + PistonBlockTextures.d[l];
int l1 = 0; int l1 = 0;
while (true) {
if (l1 < 13) {
if (j1 <= 0 || j1 >= 127) {
return -1; // CraftBukkit
}
int i2 = world.getTypeId(i1, j1, k1);
if (i2 != 0) {
if (!a(i2, world, i1, j1, k1, true)) {
return -1; // CraftBukkit
}
if (Block.byId[i2].e() != 1) {
if (l1 == 12) {
return -1; // CraftBukkit
}
i1 += PistonBlockTextures.b[l];
j1 += PistonBlockTextures.c[l];
k1 += PistonBlockTextures.d[l];
++l1;
continue;
}
}
}
return l1; // CraftBukkit
}
}
private static int H(World world, int i, int j, int k, int l) {
int i1 = i + PistonBlockTextures.b[l];
int j1 = j + PistonBlockTextures.c[l];
int k1 = k + PistonBlockTextures.d[l];
int l1 = 0;
while (true) { while (true) {
if (l1 < 13) { if (l1 < 13) {
if (j1 > 0) { if (j1 > 0) {
@ -348,10 +311,10 @@ public class BlockPiston extends Block {
int i2; int i2;
if (l1 < 13) { if (l1 < 13) {
if (j1 <= 0 || j1 >= 127) { label63: {
return false; if (j1 > 0) {
} world.getClass();
if (j1 < 128 - 1) {
i2 = world.getTypeId(i1, j1, k1); i2 = world.getTypeId(i1, j1, k1);
if (i2 != 0) { if (i2 != 0) {
if (!a(i2, world, i1, j1, k1, true)) { if (!a(i2, world, i1, j1, k1, true)) {
@ -373,6 +336,12 @@ public class BlockPiston extends Block {
Block.byId[i2].g(world, i1, j1, k1, world.getData(i1, j1, k1)); Block.byId[i2].g(world, i1, j1, k1, world.getData(i1, j1, k1));
world.setTypeId(i1, j1, k1, 0); world.setTypeId(i1, j1, k1, 0);
} }
break label63;
}
}
return false;
}
} }
while (i1 != i || j1 != j || k1 != k) { while (i1 != i || j1 != j || k1 != k) {

View File

@ -31,7 +31,11 @@ public class ChunkProviderServer implements IChunkProvider {
// CraftBukkit end // CraftBukkit end
public ChunkProviderServer(WorldServer worldserver, IChunkLoader ichunkloader, IChunkProvider ichunkprovider) { public ChunkProviderServer(WorldServer worldserver, IChunkLoader ichunkloader, IChunkProvider ichunkprovider) {
this.emptyChunk = new EmptyChunk(worldserver, new byte['\u8000'], 0, 0);
worldserver.getClass();
EmptyChunk emptychunk = new EmptyChunk(worldserver, new byte[256 * 128], 0, 0);
this.emptyChunk = emptychunk;
this.world = worldserver; this.world = worldserver;
this.e = ichunkloader; this.e = ichunkloader;
this.chunkProvider = ichunkprovider; this.chunkProvider = ichunkprovider;

View File

@ -203,6 +203,10 @@ public class EntityArrow extends Entity {
} }
if (stick) { if (stick) {
// CraftBukkit end // CraftBukkit end
if (movingobjectposition.entity instanceof EntityLiving) {
++((EntityLiving) movingobjectposition.entity).aD;
}
this.world.makeSound(this, "random.drr", 1.0F, 1.2F / (this.random.nextFloat() * 0.2F + 0.9F)); this.world.makeSound(this, "random.drr", 1.0F, 1.2F / (this.random.nextFloat() * 0.2F + 0.9F));
this.die(); this.die();
} else { } else {

View File

@ -117,7 +117,7 @@ public class EntityWeatherStorm extends EntityWeather {
entity.a(this); entity.a(this);
} }
this.world.n = 2; this.world.s = 2;
} }
} }

View File

@ -384,8 +384,7 @@ public class EntityWolf extends EntityAnimal {
if (itemfood.m() && this.datawatcher.b(18) < 20) { if (itemfood.m() && this.datawatcher.b(18) < 20) {
--itemstack.count; --itemstack.count;
this.c(((ItemFood) Item.PORK).k(), RegainReason.EATING); // Craftbukkit this.c(itemfood.k(), RegainReason.EATING); // Craftbukkit
if (itemstack.count <= 0) { if (itemstack.count <= 0) {
entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, (ItemStack) null); entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, (ItemStack) null);
} }

View File

@ -80,8 +80,11 @@ public class ItemReed extends Item {
world.update(i, j, k, this.id); // <-- world.setTypeId does this on success (tell the world) world.update(i, j, k, this.id); // <-- world.setTypeId does this on success (tell the world)
// CraftBukkit end // CraftBukkit end
if (world.getTypeId(i, j, k) == this.id) {
Block.byId[this.id].postPlace(world, i, j, k, l); Block.byId[this.id].postPlace(world, i, j, k, l);
Block.byId[this.id].postPlace(world, i, j, k, entityhuman); Block.byId[this.id].postPlace(world, i, j, k, entityhuman);
}
world.makeSound((double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F), block.stepSound.getName(), (block.stepSound.getVolume1() + 1.0F) / 2.0F, block.stepSound.getVolume2() * 0.8F); world.makeSound((double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F), block.stepSound.getName(), (block.stepSound.getVolume1() + 1.0F) / 2.0F, block.stepSound.getVolume2() * 0.8F);
--itemstack.count; --itemstack.count;
} }

View File

@ -238,34 +238,34 @@ public class MinecraftServer implements Runnable, ICommandListener {
// CraftBukkit end // CraftBukkit end
short short1 = 196; short short1 = 196;
long k = System.currentTimeMillis(); long l = System.currentTimeMillis();
// CraftBukkit start // CraftBukkit start
for (int l = 0; l < this.worlds.size(); ++l) { for (int i1 = 0; i1 < this.worlds.size(); ++i1) {
// if (l == 0 || this.propertyManager.getBoolean("allow-nether", true)) { // if (i1 == 0 || this.propertyManager.getBoolean("allow-nether", true)) {
WorldServer worldserver = this.worlds.get(l); WorldServer worldserver = this.worlds.get(i1);
log.info("Preparing start region for level " + l + " (Seed: " + worldserver.getSeed() + ")"); log.info("Preparing start region for level " + i1 + " (Seed: " + worldserver.getSeed() + ")");
if (worldserver.getWorld().getKeepSpawnInMemory()) { if (worldserver.getWorld().getKeepSpawnInMemory()) {
// CraftBukkit end // CraftBukkit end
ChunkCoordinates chunkcoordinates = worldserver.getSpawn(); ChunkCoordinates chunkcoordinates = worldserver.getSpawn();
for (int i1 = -short1; i1 <= short1 && this.isRunning; i1 += 16) {
for (int j1 = -short1; j1 <= short1 && this.isRunning; j1 += 16) { for (int j1 = -short1; j1 <= short1 && this.isRunning; j1 += 16) {
long k1 = System.currentTimeMillis(); for (int k1 = -short1; k1 <= short1 && this.isRunning; k1 += 16) {
long l1 = System.currentTimeMillis();
if (k1 < k) { if (l1 < l) {
k = k1; l = l1;
} }
if (k1 > k + 1000L) { if (l1 > l + 1000L) {
int l1 = (short1 * 2 + 1) * (short1 * 2 + 1); int i2 = (short1 * 2 + 1) * (short1 * 2 + 1);
int i2 = (i1 + short1) * (short1 * 2 + 1) + j1 + 1; int j2 = (j1 + short1) * (short1 * 2 + 1) + k1 + 1;
this.a("Preparing spawn area", i2 * 100 / l1); this.a("Preparing spawn area", j2 * 100 / i2);
k = k1; l = l1;
} }
worldserver.chunkProviderServer.getChunkAt(chunkcoordinates.x + i1 >> 4, chunkcoordinates.z + j1 >> 4); worldserver.chunkProviderServer.getChunkAt(chunkcoordinates.x + j1 >> 4, chunkcoordinates.z + k1 >> 4);
while (worldserver.v() && this.isRunning) { while (worldserver.v() && this.isRunning) {
; ;

View File

@ -768,7 +768,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
a.info(s); a.info(s);
this.minecraftServer.serverConfigurationManager.sendAll(new Packet3Chat(s)); this.minecraftServer.serverConfigurationManager.sendAll(new Packet3Chat(s));
} else if (s.toLowerCase().startsWith("/kill")) { } else if (s.toLowerCase().startsWith("/kill")) {
this.player.damageEntity(DamageSource.j, 1000); this.player.damageEntity(DamageSource.GENERIC, 1000);
} else if (s.toLowerCase().startsWith("/tell ")) { } else if (s.toLowerCase().startsWith("/tell ")) {
String[] astring = s.split(" "); String[] astring = s.split(" ");