summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Adams <dinnerbone@dinnerbone.com>2011-11-23 00:08:56 +0000
committerNathan Adams <dinnerbone@dinnerbone.com>2011-11-23 00:08:56 +0000
commit03762600df11ee775c55e9e6129d1ed386b83b6a (patch)
treeb9632db2f2cb7c9f2e2dc632d004620aaa8499e6
parent929e5ff6c762228952f873166f1bd985c68ed1e3 (diff)
downloadcraftbukkit-03762600df11ee775c55e9e6129d1ed386b83b6a.tar
craftbukkit-03762600df11ee775c55e9e6129d1ed386b83b6a.tar.gz
craftbukkit-03762600df11ee775c55e9e6129d1ed386b83b6a.tar.lz
craftbukkit-03762600df11ee775c55e9e6129d1ed386b83b6a.tar.xz
craftbukkit-03762600df11ee775c55e9e6129d1ed386b83b6a.zip
Fixed trapdoors + few comments
-rw-r--r--src/main/java/net/minecraft/server/BlockDoor.java2
-rw-r--r--src/main/java/net/minecraft/server/BlockTrapdoor.java6
-rw-r--r--src/main/java/net/minecraft/server/EntityLiving.java4
3 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/net/minecraft/server/BlockDoor.java b/src/main/java/net/minecraft/server/BlockDoor.java
index c7ceab0e..8dc9e9ee 100644
--- a/src/main/java/net/minecraft/server/BlockDoor.java
+++ b/src/main/java/net/minecraft/server/BlockDoor.java
@@ -166,7 +166,7 @@ public class BlockDoor extends Block {
if (!world.isStatic) {
this.b(world, i, j, k, i1, 0);
}
- } else if (l > 0 && Block.byId[l].isPowerSource()) {
+ } else if (l > 0) {
// CraftBukkit start
org.bukkit.World bworld = world.getWorld();
org.bukkit.block.Block block = bworld.getBlockAt(i, j, k);
diff --git a/src/main/java/net/minecraft/server/BlockTrapdoor.java b/src/main/java/net/minecraft/server/BlockTrapdoor.java
index 153e8961..a69c4063 100644
--- a/src/main/java/net/minecraft/server/BlockTrapdoor.java
+++ b/src/main/java/net/minecraft/server/BlockTrapdoor.java
@@ -30,7 +30,7 @@ public class BlockTrapdoor extends Block {
}
public AxisAlignedBB e(World world, int i, int j, int k) {
- this.a(world, i, j, k);
+ this.a((IBlockAccess)world, i, j, k); // CraftBukkit - Make sure this points to the below method!
return super.e(world, i, j, k);
}
@@ -121,14 +121,14 @@ public class BlockTrapdoor extends Block {
}
// CraftBukkit start
- if (l > 0 && Block.byId[l] != null && Block.byId[l].isPowerSource()) {
+ if (l > 0) {
org.bukkit.World bworld = world.getWorld();
org.bukkit.block.Block block = bworld.getBlockAt(i, j, k);
int power = block.getBlockPower();
int oldPower = (world.getData(i, j, k) & 4) > 0 ? 15 : 0;
- if (oldPower == 0 ^ power == 0) {
+ if (oldPower == 0 ^ power == 0 || (Block.byId[l] != null && Block.byId[l].isPowerSource())) {
BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, oldPower, power);
world.getServer().getPluginManager().callEvent(eventRedstone);
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 56e6dc8c..5b0231b6 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -134,8 +134,8 @@ public abstract class EntityLiving extends Entity {
this.ae();
}
+ // CraftBukkit start - don't inline the damage, perform it with an event
if (this.aj() && this.T()) {
- // CraftBukkit start
EntityDamageEvent event = new EntityDamageEvent(this.getBukkitEntity(), EntityDamageEvent.DamageCause.SUFFOCATION, 1);
this.world.getServer().getPluginManager().callEvent(event);
@@ -225,7 +225,7 @@ public abstract class EntityLiving extends Entity {
if (this.deathTicks == 20) {
int i;
- // CraftBukkit start - update getExpReward() below if the removed if() changes!
+ // CraftBukkit start - update getExpReward() above if the removed if() changes!
i = expToDrop;
while (i > 0) {
int j = EntityExperienceOrb.b(i);