diff --git a/src/main/java/net/minecraft/server/BlockButton.java b/src/main/java/net/minecraft/server/BlockButton.java index f20a881878..9f11dec6d0 100644 --- a/src/main/java/net/minecraft/server/BlockButton.java +++ b/src/main/java/net/minecraft/server/BlockButton.java @@ -3,11 +3,9 @@ package net.minecraft.server; import java.util.Random; // CraftBukkit start -import org.bukkit.block.BlockFace; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.block.CraftBlock; -import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.entity.LivingEntity; import org.bukkit.event.Event.Type; import org.bukkit.event.block.BlockInteractEvent; @@ -167,29 +165,33 @@ public class BlockButton extends Block { if (j1 == 0) { return true; } else { - //Allow the button to change the current + // Craftbukkit start int old = (j1 != 8) ? 1 : 0; int current = (j1 == 8) ? 1 : 0; BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, old, current); server.getPluginManager().callEvent(eventRedstone); - if ((eventRedstone.getNewCurrent() > 0) == (j1 == 8)) { - world.c(i, j, k, i1 + j1); - world.b(i, j, k, i, j, k); - world.a((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "random.click", 0.3F, 0.6F); - world.h(i, j, k, this.id); - if (i1 == 1) { - world.h(i - 1, j, k, this.id); - } else if (i1 == 2) { - world.h(i + 1, j, k, this.id); - } else if (i1 == 3) { - world.h(i, j, k - 1, this.id); - } else if (i1 == 4) { - world.h(i, j, k + 1, this.id); - } else { - world.h(i, j - 1, k, this.id); - } - world.i(i, j, k, this.id); + if ((eventRedstone.getNewCurrent() > 0) != (j1 == 8)) { + return true; } + // Craftbukkit end + + world.c(i, j, k, i1 + j1); + world.b(i, j, k, i, j, k); + world.a((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "random.click", 0.3F, 0.6F); + world.h(i, j, k, this.id); + if (i1 == 1) { + world.h(i - 1, j, k, this.id); + } else if (i1 == 2) { + world.h(i + 1, j, k, this.id); + } else if (i1 == 3) { + world.h(i, j, k - 1, this.id); + } else if (i1 == 4) { + world.h(i, j, k + 1, this.id); + } else { + world.h(i, j - 1, k, this.id); + } + + world.i(i, j, k, this.id); return true; } } diff --git a/src/main/java/net/minecraft/server/BlockChest.java b/src/main/java/net/minecraft/server/BlockChest.java index c74ffa0fcb..224fd576ce 100644 --- a/src/main/java/net/minecraft/server/BlockChest.java +++ b/src/main/java/net/minecraft/server/BlockChest.java @@ -6,7 +6,6 @@ import java.util.Random; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.block.CraftBlock; -import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.entity.LivingEntity; import org.bukkit.event.Event.Type; import org.bukkit.event.block.BlockInteractEvent; diff --git a/src/main/java/net/minecraft/server/BlockDoor.java b/src/main/java/net/minecraft/server/BlockDoor.java index da7fb16671..76f1fd9cf2 100644 --- a/src/main/java/net/minecraft/server/BlockDoor.java +++ b/src/main/java/net/minecraft/server/BlockDoor.java @@ -6,7 +6,6 @@ import java.util.Random; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.block.CraftBlock; -import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.entity.LivingEntity; import org.bukkit.event.Event.Type; import org.bukkit.event.block.BlockInteractEvent; @@ -88,7 +87,7 @@ public class BlockDoor extends Block { BlockInteractEvent event = new BlockInteractEvent(eventType, block, who); server.getPluginManager().callEvent(event); - // CraftBukkit the client updates the doors before the server does it's thing. + // The client updates the doors before the server does it's thing. // Forcibly send correct data. if (event.isCancelled()) { ((EntityPlayer) entityhuman).a.b(new Packet53BlockChange(i, j, k, (WorldServer) world)); diff --git a/src/main/java/net/minecraft/server/BlockFire.java b/src/main/java/net/minecraft/server/BlockFire.java index aacec77126..62cbbc1bdf 100644 --- a/src/main/java/net/minecraft/server/BlockFire.java +++ b/src/main/java/net/minecraft/server/BlockFire.java @@ -137,18 +137,20 @@ public class BlockFire extends Block { org.bukkit.block.Block theBlock = (cworld.getBlockAt(i, j, k)); BlockBurnEvent event = new BlockBurnEvent(theBlock); server.getPluginManager().callEvent(event); - if(!event.isCancelled()) { - if (random.nextInt(2) == 0) { - world.e(i, j, k, this.id); - } else { - world.e(i, j, k, 0); - } - - if (flag) { - Block.TNT.a(world, i, j, k, 0); - } + if(event.isCancelled()) { + return; } // CraftBukkit end + + if (random.nextInt(2) == 0) { + world.e(i, j, k, this.id); + } else { + world.e(i, j, k, 0); + } + + if (flag) { + Block.TNT.a(world, i, j, k, 0); + } } } diff --git a/src/main/java/net/minecraft/server/BlockFurnace.java b/src/main/java/net/minecraft/server/BlockFurnace.java index 728548ade3..4eacfeab2e 100644 --- a/src/main/java/net/minecraft/server/BlockFurnace.java +++ b/src/main/java/net/minecraft/server/BlockFurnace.java @@ -6,7 +6,6 @@ import java.util.Random; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.block.CraftBlock; -import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.entity.LivingEntity; import org.bukkit.event.Event.Type; import org.bukkit.event.block.BlockInteractEvent; diff --git a/src/main/java/net/minecraft/server/BlockJukeBox.java b/src/main/java/net/minecraft/server/BlockJukeBox.java index 1413f431a9..536df7f015 100644 --- a/src/main/java/net/minecraft/server/BlockJukeBox.java +++ b/src/main/java/net/minecraft/server/BlockJukeBox.java @@ -4,7 +4,6 @@ package net.minecraft.server; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.block.CraftBlock; -import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.entity.LivingEntity; import org.bukkit.event.Event.Type; import org.bukkit.event.block.BlockInteractEvent; diff --git a/src/main/java/net/minecraft/server/BlockLever.java b/src/main/java/net/minecraft/server/BlockLever.java index 174d8b5d4f..1db1637ecd 100644 --- a/src/main/java/net/minecraft/server/BlockLever.java +++ b/src/main/java/net/minecraft/server/BlockLever.java @@ -1,11 +1,9 @@ package net.minecraft.server; // CraftBukkit start -import org.bukkit.block.BlockFace; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.block.CraftBlock; -import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.entity.LivingEntity; import org.bukkit.event.Event.Type; import org.bukkit.event.block.BlockInteractEvent; @@ -152,7 +150,7 @@ public class BlockLever extends Block { BlockInteractEvent event = new BlockInteractEvent(eventType, block, who); server.getPluginManager().callEvent(event); - // CraftBukkit the client updates the doors before the server does it's thing. + // The client updates the doors before the server does it's thing. // Forcibly send correct data. if (event.isCancelled()) { ((EntityPlayer) entityhuman).a.b(new Packet53BlockChange(i, j, k, (WorldServer) world)); @@ -170,25 +168,27 @@ public class BlockLever extends Block { BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, old, current); server.getPluginManager().callEvent(eventRedstone); - if ((eventRedstone.getNewCurrent() > 0) == (j1 == 8)) { - // CraftBukkit end + if ((eventRedstone.getNewCurrent() > 0) != (j1 == 8)) { + return true; + } + // CraftBukkit end + + world.c(i, j, k, i1 + j1); + world.b(i, j, k, i, j, k); + world.a((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "random.click", 0.3F, j1 > 0 ? 0.6F : 0.5F); + world.h(i, j, k, this.id); + if (i1 == 1) { + world.h(i - 1, j, k, this.id); + } else if (i1 == 2) { + world.h(i + 1, j, k, this.id); + } else if (i1 == 3) { + world.h(i, j, k - 1, this.id); + } else if (i1 == 4) { + world.h(i, j, k + 1, this.id); + } else { + world.h(i, j - 1, k, this.id); + } - world.c(i, j, k, i1 + j1); - world.b(i, j, k, i, j, k); - world.a((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "random.click", 0.3F, j1 > 0 ? 0.6F : 0.5F); - world.h(i, j, k, this.id); - if (i1 == 1) { - world.h(i - 1, j, k, this.id); - } else if (i1 == 2) { - world.h(i + 1, j, k, this.id); - } else if (i1 == 3) { - world.h(i, j, k - 1, this.id); - } else if (i1 == 4) { - world.h(i, j, k + 1, this.id); - } else { - world.h(i, j - 1, k, this.id); - } - } // CraftBukkit return true; } } diff --git a/src/main/java/net/minecraft/server/BlockPressurePlate.java b/src/main/java/net/minecraft/server/BlockPressurePlate.java index 7fedf6cec8..10e55f190d 100644 --- a/src/main/java/net/minecraft/server/BlockPressurePlate.java +++ b/src/main/java/net/minecraft/server/BlockPressurePlate.java @@ -4,12 +4,9 @@ import java.util.List; import java.util.Random; // CraftBukkit start -import org.bukkit.block.BlockFace; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.block.CraftBlock; -import org.bukkit.craftbukkit.entity.CraftLivingEntity; -import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.entity.LivingEntity; import org.bukkit.event.Event.Type; import org.bukkit.event.block.BlockInteractEvent; diff --git a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java index 825393811a..d745686fc1 100644 --- a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java +++ b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java @@ -5,7 +5,6 @@ import java.util.List; import java.util.Random; // CraftBukkit start -import org.bukkit.block.BlockFace; import org.bukkit.craftbukkit.block.CraftBlock; import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/BlockRedstoneWire.java b/src/main/java/net/minecraft/server/BlockRedstoneWire.java index 8ef27ef196..a12c023af7 100644 --- a/src/main/java/net/minecraft/server/BlockRedstoneWire.java +++ b/src/main/java/net/minecraft/server/BlockRedstoneWire.java @@ -6,7 +6,6 @@ import java.util.Random; import java.util.Set; // CraftBukkit start -import org.bukkit.block.BlockFace; import org.bukkit.craftbukkit.block.CraftBlock; import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java index 8b2b44bd15..5a6116d9a3 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -9,11 +9,9 @@ import java.util.Map; import java.util.Set; // CraftBukkit start -import org.bukkit.Location; import org.bukkit.Server; import org.bukkit.craftbukkit.CraftChunk; import org.bukkit.craftbukkit.CraftServer; -import org.bukkit.entity.Player; import org.bukkit.event.Event.Type; import org.bukkit.event.world.ChunkLoadEvent; import org.bukkit.event.world.ChunkUnloadEvent; @@ -35,11 +33,9 @@ public class ChunkProviderServer implements IChunkProvider { this.c = ichunkprovider; } - // CraftBukkit start public boolean a(int i, int j) { - return this.e.containsKey(i, j); + return this.e.containsKey(i, j); // Craftbukkit - entire method removed } - // CraftBukkit end public void c(int i, int j) { int k = i * 16 + 8 - this.g.spawnX; diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java index fa74527a1e..51e9876998 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -1,6 +1,15 @@ package net.minecraft.server; +import java.util.List; +import java.util.Random; + // CraftBukkit start +import org.bukkit.block.BlockFace; +import org.bukkit.craftbukkit.entity.CraftVehicle; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Vehicle; +import org.bukkit.event.vehicle.VehicleBlockCollisionEvent; +import org.bukkit.event.vehicle.VehicleExitEvent; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.event.Event.Type; import org.bukkit.event.entity.EntityCombustEvent; @@ -9,16 +18,6 @@ import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; // CraftBukkit end -import java.util.List; -import java.util.Random; -import org.bukkit.block.BlockFace; -import org.bukkit.craftbukkit.entity.CraftVehicle; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Vehicle; -import org.bukkit.event.vehicle.VehicleBlockCollisionEvent; -import org.bukkit.event.vehicle.VehicleCollisionEvent; -import org.bukkit.event.vehicle.VehicleExitEvent; - public abstract class Entity { private static int entityCount = 0; diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java index fa85935b19..368e7396fb 100644 --- a/src/main/java/net/minecraft/server/EntityArrow.java +++ b/src/main/java/net/minecraft/server/EntityArrow.java @@ -3,7 +3,6 @@ package net.minecraft.server; import java.util.List; // CraftBukkit start -import org.bukkit.craftbukkit.entity.CraftArrow; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.event.entity.EntityDamageByProjectileEvent; import org.bukkit.event.entity.EntityDamageEvent; diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java index 49b4c7a260..a068372c55 100644 --- a/src/main/java/net/minecraft/server/EntityCreature.java +++ b/src/main/java/net/minecraft/server/EntityCreature.java @@ -1,13 +1,9 @@ package net.minecraft.server; // CraftBukkit start -import org.bukkit.craftbukkit.entity.CraftMonster; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftEntity; import org.bukkit.craftbukkit.TrigMath; -import org.bukkit.event.entity.EntityDamageByEntityEvent; -import org.bukkit.event.entity.EntityDamageEvent; -import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityTargetEvent; import org.bukkit.event.entity.EntityTargetEvent.TargetReason; // CraftBukkit end @@ -119,7 +115,7 @@ public class EntityCreature extends EntityLiving { double d1 = vec3d.a - this.locX; double d2 = vec3d.c - this.locZ; double d3 = vec3d.b - (double) l1; - float f4 = (float) (TrigMath.atan2(d2, d1) * 180.0D / 3.1415927410125732D) - 90.0F; + float f4 = (float) (TrigMath.atan2(d2, d1) * 180.0D / 3.1415927410125732D) - 90.0F; // Craftbukkit float f5 = f4 - this.yaw; for (this.by = this.bC; f5 < -180.0F; f5 += 360.0F) { diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java index 0ab89a59e1..c7f25b0935 100644 --- a/src/main/java/net/minecraft/server/EntityCreeper.java +++ b/src/main/java/net/minecraft/server/EntityCreeper.java @@ -1,7 +1,6 @@ package net.minecraft.server; //CraftBukkit start -import org.bukkit.Server; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftEntity; import org.bukkit.event.entity.ExplosionPrimedEvent; diff --git a/src/main/java/net/minecraft/server/EntityEgg.java b/src/main/java/net/minecraft/server/EntityEgg.java index 251060240d..9a0467fa7a 100644 --- a/src/main/java/net/minecraft/server/EntityEgg.java +++ b/src/main/java/net/minecraft/server/EntityEgg.java @@ -3,7 +3,6 @@ package net.minecraft.server; import java.util.List; // CraftBukkit start -import org.bukkit.entity.CreatureType; import org.bukkit.entity.Egg; import org.bukkit.entity.MobType; import org.bukkit.entity.Player; @@ -184,7 +183,6 @@ public class EntityEgg extends Entity { } } - // CraftBukkit start boolean hatching = !this.world.isStatic && this.random.nextInt(8) == 0; byte numHatching = (this.random.nextInt(32) == 0) ? (byte) 4 : (byte) 1; if (!hatching) { diff --git a/src/main/java/net/minecraft/server/EntityFireball.java b/src/main/java/net/minecraft/server/EntityFireball.java index cb83052131..d822bb5035 100644 --- a/src/main/java/net/minecraft/server/EntityFireball.java +++ b/src/main/java/net/minecraft/server/EntityFireball.java @@ -7,7 +7,6 @@ import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftEntity; import org.bukkit.event.entity.EntityDamageByProjectileEvent; import org.bukkit.event.entity.EntityDamageEvent; -import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.ExplosionPrimedEvent; // CraftBukkit end @@ -149,9 +148,7 @@ public class EntityFireball extends Entity { ; } } - // CraftBukkit end - - // Craftbukkit start + CraftServer server = ((WorldServer) this.world).getServer(); org.bukkit.event.Event.Type eventType = ExplosionPrimedEvent.Type.EXPLOSION_PRIMED; ExplosionPrimedEvent event = new ExplosionPrimedEvent(eventType, CraftEntity.getEntity(server, this), 1.0F, false); diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java index c2c371db1c..d23e2d341e 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -4,12 +4,10 @@ import java.util.ArrayList; import java.util.List; // CraftBukkit start -import org.bukkit.Location; import org.bukkit.Server; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.entity.CraftEntity; -import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.craftbukkit.TrigMath; import org.bukkit.event.Event.Type; import org.bukkit.event.entity.EntityDamageEvent; @@ -237,7 +235,7 @@ public abstract class EntityLiving extends Entity { if (f > 0.05F) { f3 = 1.0F; f2 = f * 3.0F; - f1 = (float) TrigMath.atan2(d1, d0) * 180.0F / 3.1415927F - 90.0F; + f1 = (float) TrigMath.atan2(d1, d0) * 180.0F / 3.1415927F - 90.0F; // Craftbukkit } if (this.aY > 0.0F) { diff --git a/src/main/java/net/minecraft/server/EntityMinecart.java b/src/main/java/net/minecraft/server/EntityMinecart.java index a2c25489b3..0f040f109a 100644 --- a/src/main/java/net/minecraft/server/EntityMinecart.java +++ b/src/main/java/net/minecraft/server/EntityMinecart.java @@ -327,9 +327,7 @@ public class EntityMinecart extends Entity implements IInventory { this.a(this.locX, this.locY + (double) aint[1][1], this.locZ); } - // CraftBukkit start - if (this.passenger != null || !slowWhenEmpty) { - // CraftBukkit end + if (this.passenger != null || !slowWhenEmpty) { // Craftbukkit this.motX *= 0.996999979019165D; this.motY *= 0.0D; this.motZ *= 0.996999979019165D; diff --git a/src/main/java/net/minecraft/server/EntitySnowball.java b/src/main/java/net/minecraft/server/EntitySnowball.java index c47b59815c..8775996599 100644 --- a/src/main/java/net/minecraft/server/EntitySnowball.java +++ b/src/main/java/net/minecraft/server/EntitySnowball.java @@ -175,8 +175,8 @@ public class EntitySnowball extends Entity { if (stick) { ; } - // CraftBukkit end } + // CraftBukkit end for (int k = 0; k < 8; ++k) { this.world.a("snowballpoof", this.locX, this.locY, this.locZ, 0.0D, 0.0D, 0.0D); diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java index aa0ddca999..814833b7a7 100644 --- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java +++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java @@ -1,7 +1,6 @@ package net.minecraft.server; //CraftBukkit start -import org.bukkit.Server; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftEntity; import org.bukkit.event.entity.ExplosionPrimedEvent; diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java index d3a886e3ba..a400cae51c 100644 --- a/src/main/java/net/minecraft/server/ItemBlock.java +++ b/src/main/java/net/minecraft/server/ItemBlock.java @@ -28,7 +28,6 @@ public class ItemBlock extends Item { return false; } - // CraftBukkit store info of the clicked block CraftBlock blockClicked = (CraftBlock) ((WorldServer) world).getWorld().getBlockAt(i, j, k); BlockFace faceClicked = CraftBlock.notchToBlockFace(l); // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/ItemBucket.java b/src/main/java/net/minecraft/server/ItemBucket.java index 9482013873..8aee3d1697 100644 --- a/src/main/java/net/minecraft/server/ItemBucket.java +++ b/src/main/java/net/minecraft/server/ItemBucket.java @@ -4,7 +4,6 @@ package net.minecraft.server; import org.bukkit.block.BlockFace; import org.bukkit.craftbukkit.block.CraftBlock; import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.entity.Player; diff --git a/src/main/java/net/minecraft/server/ItemMinecart.java b/src/main/java/net/minecraft/server/ItemMinecart.java index 4da2550327..7de9701a93 100644 --- a/src/main/java/net/minecraft/server/ItemMinecart.java +++ b/src/main/java/net/minecraft/server/ItemMinecart.java @@ -26,7 +26,6 @@ public class ItemMinecart extends Item { if (i1 == Block.RAILS.id) { if (!world.isStatic) { - // CraftBukkit start - Minecarts CraftWorld craftWorld = ((WorldServer) world).getWorld(); CraftServer craftServer = ((WorldServer) world).getServer(); diff --git a/src/main/java/net/minecraft/server/ItemRedstone.java b/src/main/java/net/minecraft/server/ItemRedstone.java index 8e3cd8852a..a534cec856 100644 --- a/src/main/java/net/minecraft/server/ItemRedstone.java +++ b/src/main/java/net/minecraft/server/ItemRedstone.java @@ -6,7 +6,6 @@ import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.block.CraftBlock; import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.event.Event.Type; import org.bukkit.event.player.PlayerItemEvent; diff --git a/src/main/java/net/minecraft/server/ItemSeeds.java b/src/main/java/net/minecraft/server/ItemSeeds.java index 9d4e067fc7..2ddb68cca4 100644 --- a/src/main/java/net/minecraft/server/ItemSeeds.java +++ b/src/main/java/net/minecraft/server/ItemSeeds.java @@ -6,7 +6,6 @@ import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.block.CraftBlock; import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.event.Event.Type; import org.bukkit.event.player.PlayerItemEvent; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java index f3c4c97d71..bcb9ebc24e 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -30,7 +30,7 @@ public class MinecraftServer implements ICommandListener, Runnable { public static HashMap b = new HashMap(); public NetworkListenThread c; public PropertyManager d; - //public WorldServer e; + //public WorldServer e; // Craftbukkit - removed public ServerConfigurationManager f; private boolean o = true; public boolean g = false; @@ -43,21 +43,21 @@ public class MinecraftServer implements ICommandListener, Runnable { public boolean l; public boolean m; public boolean n; - public int spawnProtection; // CraftBukkit Configurable spawn protection start - public List worlds = new ArrayList(); - // Craftbukkit start - adds argument OptionSet - public MinecraftServer(OptionSet options) { - new ThreadSleepForever(this); - // CraftBukkit start - this.options = options; - } + // Craftbukkit start + public int spawnProtection; + public List worlds = new ArrayList(); public CraftServer server; public OptionSet options; public ConsoleCommandSender console = new ConsoleCommandSender(); + // Craftbukkit end - private boolean d() throws UnknownHostException { - // CraftBukkit end -- added throws UnknownHostException + public MinecraftServer(OptionSet options) { // Craftbukkit - adds argument OptionSet + new ThreadSleepForever(this); + this.options = options; // CraftBukkit + } + + private boolean d() throws UnknownHostException { // CraftBukkit - added throws UnknownHostException ThreadCommandReader threadcommandreader = new ThreadCommandReader(this); threadcommandreader.setDaemon(true); @@ -95,8 +95,7 @@ public class MinecraftServer implements ICommandListener, Runnable { try { this.c = new NetworkListenThread(this, inetaddress, i); - // CraftBukkit: Be more generic; IOException -> Throwable - } catch (Throwable ioexception) { + } catch (Throwable ioexception) { // CraftBukkit - IOException -> Throwable a.warning("**** FAILED TO BIND TO PORT!"); a.log(Level.WARNING, "The exception was: " + ioexception.toString()); a.warning("Perhaps a server is already running on that port?"); @@ -194,10 +193,11 @@ public class MinecraftServer implements ICommandListener, Runnable { private void g() { a.info("Stopping server"); - // CraftBukkit + // CraftBukkit start if(server != null) { server.disablePlugins(); } + // Craftbukkit end if (this.f != null) { this.f.d(); @@ -570,8 +570,7 @@ public class MinecraftServer implements ICommandListener, Runnable { this.p.add(iupdateplayerlistbox); } - // Craftbukkit start - replaces main(String args[]) - public static void main(final OptionSet options) { + public static void main(final OptionSet options) { // Craftbukkit - replaces main(String args[]) try { MinecraftServer minecraftserver = new MinecraftServer(options); diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index 7713d24bf7..a38b768d6f 100644 --- a/src/main/java/net/minecraft/server/NetServerHandler.java +++ b/src/main/java/net/minecraft/server/NetServerHandler.java @@ -16,22 +16,11 @@ import org.bukkit.craftbukkit.block.CraftBlock; import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.craftbukkit.CraftServer; -import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.TextWrapper; import org.bukkit.entity.Player; import org.bukkit.event.Event.Type; -import org.bukkit.event.block.BlockDamageEvent; -import org.bukkit.event.block.BlockRedstoneEvent; -import org.bukkit.event.block.BlockRightClickEvent; -import org.bukkit.event.block.SignChangeEvent; -import org.bukkit.event.player.PlayerAnimationEvent; -import org.bukkit.event.player.PlayerChatEvent; -import org.bukkit.event.player.PlayerItemEvent; -import org.bukkit.event.player.PlayerItemHeldEvent; -import org.bukkit.event.player.PlayerKickEvent; -import org.bukkit.event.player.PlayerMoveEvent; -import org.bukkit.event.player.PlayerToggleSneakEvent; -import org.bukkit.plugin.Plugin; +import org.bukkit.event.block.*; +import org.bukkit.event.player.*; // CraftBukkit end public class NetServerHandler extends NetHandler implements ICommandListener { @@ -500,9 +489,9 @@ public class NetServerHandler extends NetHandler implements ICommandListener { server.getPluginManager().callEvent(event); this.e.c.a(this.e, this.e.world, itemstack, i, j, k, l); + this.e.a.b((Packet) (new Packet53BlockChange(i, j, k, this.e.world))); // CraftBukkit end - this.e.a.b((Packet) (new Packet53BlockChange(i, j, k, this.e.world))); if (l == 0) { --j; } @@ -527,7 +516,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener { ++i; } - this.e.a.b((Packet) (new Packet53BlockChange(i, j, k, this.e.world))); + this.e.a.b((Packet) (new Packet53BlockChange(i, j, k, this.e.world))); // Craftbukkit } if (itemstack != null && itemstack.count == 0) { @@ -541,8 +530,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener { this.e.activeContainer.a(); this.e.am = false; - // CraftBukkit - Boolean flag - if (!ItemStack.a(this.e.inventory.e(), packet15place.e) || always) { + if (!ItemStack.a(this.e.inventory.e(), packet15place.e) || always) { // CraftBukkit this.b((Packet) (new Packet103SetSlot(this.e.activeContainer.f, slot.c, this.e.inventory.e()))); } @@ -589,9 +577,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener { } } - // CraftBukkit start - chat(s); - // CraftBukkit end + chat(s); // CraftBukkit } } diff --git a/src/main/java/net/minecraft/server/PlayerInstance.java b/src/main/java/net/minecraft/server/PlayerInstance.java index 76c475fc4e..95b8467c70 100644 --- a/src/main/java/net/minecraft/server/PlayerInstance.java +++ b/src/main/java/net/minecraft/server/PlayerInstance.java @@ -29,9 +29,7 @@ class PlayerInstance { this.d = j; this.e = new ChunkCoordIntPair(i, j); - // Craftbukkit start - playermanager.world.A.d(i, j); - // Craftbukkit end + playermanager.world.A.d(i, j); // Craftbukkit } public void a(EntityPlayer entityplayer) { @@ -133,10 +131,13 @@ class PlayerInstance { i = this.c * 16 + this.h; j = this.j; k = this.d * 16 + this.l; - this.a((Packet) (new Packet53BlockChange(i, j, k, a.world))); // Craftbukkit - if (Block.p[a.world.getTypeId(i, j, k)]) { // Craftbukkit - this.a(a.world.getTileEntity(i, j, k)); // Craftbukkit + + // Craftbukkit start + this.a((Packet) (new Packet53BlockChange(i, j, k, a.world))); + if (Block.p[a.world.getTypeId(i, j, k)]) { + this.a(a.world.getTileEntity(i, j, k)); } + // Craftbukkit end } else { int l; diff --git a/src/main/java/net/minecraft/server/PlayerManager.java b/src/main/java/net/minecraft/server/PlayerManager.java index 9d05d2439f..ca71a459c5 100644 --- a/src/main/java/net/minecraft/server/PlayerManager.java +++ b/src/main/java/net/minecraft/server/PlayerManager.java @@ -106,7 +106,7 @@ public class PlayerManager { for (int k = i - 10; k <= i + 10; ++k) { for (int l = j - 10; l <= j + 10; ++l) { - PlayerInstance playerinstance = this.a(k, l, false, ((WorldServer)entityplayer.world)); + PlayerInstance playerinstance = this.a(k, l, false, ((WorldServer)entityplayer.world)); // Craftbukkit if (playerinstance != null) { playerinstance.b(entityplayer); @@ -141,11 +141,11 @@ public class PlayerManager { for (int k1 = i - 10; k1 <= i + 10; ++k1) { for (int l1 = j - 10; l1 <= j + 10; ++l1) { if (!this.a(k1, l1, k, l)) { - this.a(k1, l1, true, ((WorldServer)entityplayer.world)).a(entityplayer); + this.a(k1, l1, true, ((WorldServer)entityplayer.world)).a(entityplayer); // Craftbukkit } if (!this.a(k1 - i1, l1 - j1, i, j)) { - PlayerInstance playerinstance = this.a(k1 - i1, l1 - j1, false, ((WorldServer)entityplayer.world)); + PlayerInstance playerinstance = this.a(k1 - i1, l1 - j1, false, ((WorldServer)entityplayer.world)); // Craftbukkit if (playerinstance != null) { playerinstance.b(entityplayer); diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java index f8bf94e365..5ce1f87e61 100644 --- a/src/main/java/net/minecraft/server/TileEntityChest.java +++ b/src/main/java/net/minecraft/server/TileEntityChest.java @@ -13,7 +13,7 @@ public class TileEntityChest extends TileEntity implements IInventory { public TileEntityChest() {} public int h_() { - return this.e.length; + return this.e.length; // Craftbukkit } public ItemStack a(int i) { diff --git a/src/main/java/net/minecraft/server/WorldManager.java b/src/main/java/net/minecraft/server/WorldManager.java index c12c53691a..8fc2b32deb 100644 --- a/src/main/java/net/minecraft/server/WorldManager.java +++ b/src/main/java/net/minecraft/server/WorldManager.java @@ -8,7 +8,7 @@ public class WorldManager implements IWorldAccess { // Craftbukkit - changed signature public WorldManager(MinecraftServer minecraftserver, WorldServer world) { this.a = minecraftserver; - this.world = world; + this.world = world; // Craftbukkit } public void a(String s, double d0, double d1, double d2, double d3, double d4, double d5) {} diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java index 7a29714f1d..7b9da45a02 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -16,7 +16,7 @@ public class WorldServer extends World implements BlockChangeDelegate { public ChunkProviderServer A; public boolean B = false; public boolean C; - public final MinecraftServer D; + public final MinecraftServer D; // Craftbukkit private EntityList E = new EntityList(); public PlayerManager manager; // Craftbukkit