diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-09-16 20:10:11 +0100 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-09-16 20:10:11 +0100 |
commit | 900c541246e2b480b63be60e71a4a9a8acc61d77 (patch) | |
tree | 763d7de40757a8115b1c686f7c9ecefd19a8b119 /src/main/java/net/minecraft/server | |
parent | 94d1338febfe844faa42179e47ddc5d3432b0843 (diff) | |
download | craftbukkit-900c541246e2b480b63be60e71a4a9a8acc61d77.tar craftbukkit-900c541246e2b480b63be60e71a4a9a8acc61d77.tar.gz craftbukkit-900c541246e2b480b63be60e71a4a9a8acc61d77.tar.lz craftbukkit-900c541246e2b480b63be60e71a4a9a8acc61d77.tar.xz craftbukkit-900c541246e2b480b63be60e71a4a9a8acc61d77.zip |
Bunchafixes which may or may not have any end result
Diffstat (limited to 'src/main/java/net/minecraft/server')
9 files changed, 69 insertions, 88 deletions
diff --git a/src/main/java/net/minecraft/server/BlockMushroom.java b/src/main/java/net/minecraft/server/BlockMushroom.java index aae8a13d..775d7e18 100644 --- a/src/main/java/net/minecraft/server/BlockMushroom.java +++ b/src/main/java/net/minecraft/server/BlockMushroom.java @@ -51,18 +51,20 @@ public class BlockMushroom extends BlockFlower { k1 = k + random.nextInt(3) - 1; } - // CraftBukkit start - org.bukkit.World bworld = world.getWorld(); - org.bukkit.block.BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState(); - blockState.setTypeId(this.id); + if (world.isEmpty(i1, j1, k1) && this.f(world, i1, j1, k1)) { + // CraftBukkit start + org.bukkit.World bworld = world.getWorld(); + org.bukkit.block.BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState(); + blockState.setTypeId(this.id); - BlockSpreadEvent event = new BlockSpreadEvent(blockState.getBlock(), bworld.getBlockAt(i, j, k), blockState); - world.getServer().getPluginManager().callEvent(event); + BlockSpreadEvent event = new BlockSpreadEvent(blockState.getBlock(), bworld.getBlockAt(i, j, k), blockState); + world.getServer().getPluginManager().callEvent(event); - if (!event.isCancelled()) { - blockState.update(true); + if (!event.isCancelled()) { + blockState.update(true); + } + // CraftBukkit end } - // CraftBukkit end } } diff --git a/src/main/java/net/minecraft/server/BlockPiston.java b/src/main/java/net/minecraft/server/BlockPiston.java index a6423ed8..d8f68e91 100644 --- a/src/main/java/net/minecraft/server/BlockPiston.java +++ b/src/main/java/net/minecraft/server/BlockPiston.java @@ -267,43 +267,6 @@ public class BlockPiston extends Block { 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) { - if (l1 < 13) { if (j1 > 0) { world.getClass(); if (j1 < 128 - 1) { @@ -348,30 +311,36 @@ public class BlockPiston extends Block { int i2; if (l1 < 13) { - if (j1 <= 0 || j1 >= 127) { - return false; - } + label63: { + if (j1 > 0) { + world.getClass(); + if (j1 < 128 - 1) { + i2 = world.getTypeId(i1, j1, k1); + if (i2 != 0) { + if (!a(i2, world, i1, j1, k1, true)) { + return false; + } - i2 = world.getTypeId(i1, j1, k1); - if (i2 != 0) { - if (!a(i2, world, i1, j1, k1, true)) { - return false; - } + if (Block.byId[i2].e() != 1) { + if (l1 == 12) { + return false; + } - if (Block.byId[i2].e() != 1) { - if (l1 == 12) { - return false; - } + i1 += PistonBlockTextures.b[l]; + j1 += PistonBlockTextures.c[l]; + k1 += PistonBlockTextures.d[l]; + ++l1; + continue; + } - i1 += PistonBlockTextures.b[l]; - j1 += PistonBlockTextures.c[l]; - k1 += PistonBlockTextures.d[l]; - ++l1; - continue; + Block.byId[i2].g(world, i1, j1, k1, world.getData(i1, j1, k1)); + world.setTypeId(i1, j1, k1, 0); + } + break label63; + } } - Block.byId[i2].g(world, i1, j1, k1, world.getData(i1, j1, k1)); - world.setTypeId(i1, j1, k1, 0); + return false; } } diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java index 6fd568cb..9d19faa3 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -31,7 +31,11 @@ public class ChunkProviderServer implements IChunkProvider { // CraftBukkit end 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.e = ichunkloader; this.chunkProvider = ichunkprovider; diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java index 7f788ec0..3c6f9ad2 100644 --- a/src/main/java/net/minecraft/server/EntityArrow.java +++ b/src/main/java/net/minecraft/server/EntityArrow.java @@ -203,6 +203,10 @@ public class EntityArrow extends Entity { } if (stick) { // 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.die(); } else { diff --git a/src/main/java/net/minecraft/server/EntityWeatherStorm.java b/src/main/java/net/minecraft/server/EntityWeatherStorm.java index de745542..b9adf026 100644 --- a/src/main/java/net/minecraft/server/EntityWeatherStorm.java +++ b/src/main/java/net/minecraft/server/EntityWeatherStorm.java @@ -117,7 +117,7 @@ public class EntityWeatherStorm extends EntityWeather { entity.a(this); } - this.world.n = 2; + this.world.s = 2; } } diff --git a/src/main/java/net/minecraft/server/EntityWolf.java b/src/main/java/net/minecraft/server/EntityWolf.java index a7ff3d04..cc4b15de 100644 --- a/src/main/java/net/minecraft/server/EntityWolf.java +++ b/src/main/java/net/minecraft/server/EntityWolf.java @@ -384,8 +384,7 @@ public class EntityWolf extends EntityAnimal { if (itemfood.m() && this.datawatcher.b(18) < 20) { --itemstack.count; - this.c(((ItemFood) Item.PORK).k(), RegainReason.EATING); // Craftbukkit - + this.c(itemfood.k(), RegainReason.EATING); // Craftbukkit if (itemstack.count <= 0) { entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, (ItemStack) null); } diff --git a/src/main/java/net/minecraft/server/ItemReed.java b/src/main/java/net/minecraft/server/ItemReed.java index cb4c6907..b0bd521b 100644 --- a/src/main/java/net/minecraft/server/ItemReed.java +++ b/src/main/java/net/minecraft/server/ItemReed.java @@ -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) // CraftBukkit end - Block.byId[this.id].postPlace(world, i, j, k, l); - Block.byId[this.id].postPlace(world, i, j, k, entityhuman); + 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, 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); --itemstack.count; } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java index 713eb412..8d560875 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -238,34 +238,34 @@ public class MinecraftServer implements Runnable, ICommandListener { // CraftBukkit end short short1 = 196; - long k = System.currentTimeMillis(); + long l = System.currentTimeMillis(); // CraftBukkit start - for (int l = 0; l < this.worlds.size(); ++l) { - // if (l == 0 || this.propertyManager.getBoolean("allow-nether", true)) { - WorldServer worldserver = this.worlds.get(l); - log.info("Preparing start region for level " + l + " (Seed: " + worldserver.getSeed() + ")"); + for (int i1 = 0; i1 < this.worlds.size(); ++i1) { + // if (i1 == 0 || this.propertyManager.getBoolean("allow-nether", true)) { + WorldServer worldserver = this.worlds.get(i1); + log.info("Preparing start region for level " + i1 + " (Seed: " + worldserver.getSeed() + ")"); if (worldserver.getWorld().getKeepSpawnInMemory()) { // CraftBukkit end ChunkCoordinates chunkcoordinates = worldserver.getSpawn(); - for (int i1 = -short1; i1 <= short1 && this.isRunning; i1 += 16) { - for (int j1 = -short1; j1 <= short1 && this.isRunning; j1 += 16) { - long k1 = System.currentTimeMillis(); + for (int j1 = -short1; j1 <= short1 && this.isRunning; j1 += 16) { + for (int k1 = -short1; k1 <= short1 && this.isRunning; k1 += 16) { + long l1 = System.currentTimeMillis(); - if (k1 < k) { - k = k1; + if (l1 < l) { + l = l1; } - if (k1 > k + 1000L) { - int l1 = (short1 * 2 + 1) * (short1 * 2 + 1); - int i2 = (i1 + short1) * (short1 * 2 + 1) + j1 + 1; + if (l1 > l + 1000L) { + int i2 = (short1 * 2 + 1) * (short1 * 2 + 1); + int j2 = (j1 + short1) * (short1 * 2 + 1) + k1 + 1; - this.a("Preparing spawn area", i2 * 100 / l1); - k = k1; + this.a("Preparing spawn area", j2 * 100 / i2); + 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) { ; diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index 5b1e9939..e0dfeac5 100644 --- a/src/main/java/net/minecraft/server/NetServerHandler.java +++ b/src/main/java/net/minecraft/server/NetServerHandler.java @@ -768,7 +768,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener { a.info(s); this.minecraftServer.serverConfigurationManager.sendAll(new Packet3Chat(s)); } else if (s.toLowerCase().startsWith("/kill")) { - this.player.damageEntity(DamageSource.j, 1000); + this.player.damageEntity(DamageSource.GENERIC, 1000); } else if (s.toLowerCase().startsWith("/tell ")) { String[] astring = s.split(" "); |