summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/World.java
diff options
context:
space:
mode:
authorErik Broes <erikbroes@grum.nl>2011-02-07 10:26:12 +0100
committerErik Broes <erikbroes@grum.nl>2011-02-07 10:26:12 +0100
commit2497a610442ee73702516bc0e96ba32301894175 (patch)
treeb7c43a90b9478aa1470a9bba2f9a5c9b3308961e /src/main/java/net/minecraft/server/World.java
parent421d1c1c1f80a7ad255f7dd0539b491e4b195c2b (diff)
downloadcraftbukkit-2497a610442ee73702516bc0e96ba32301894175.tar
craftbukkit-2497a610442ee73702516bc0e96ba32301894175.tar.gz
craftbukkit-2497a610442ee73702516bc0e96ba32301894175.tar.lz
craftbukkit-2497a610442ee73702516bc0e96ba32301894175.tar.xz
craftbukkit-2497a610442ee73702516bc0e96ba32301894175.zip
Moved changes we did to WorldServer back down to World.
Diffstat (limited to 'src/main/java/net/minecraft/server/World.java')
-rw-r--r--src/main/java/net/minecraft/server/World.java23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 3fb680b9..d1a903f0 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -434,6 +434,16 @@ public class World implements IBlockAccess {
Block block = Block.byId[this.getTypeId(i, j, k)];
if (block != null) {
+ // CraftBukkit start
+ if (world != null) {
+ BlockPhysicsEvent event = new BlockPhysicsEvent(Event.Type.BLOCK_PHYSICS, world.getBlockAt(i, j, k), l);
+ server.getPluginManager().callEvent(event);
+ if (event.isCancelled()) {
+ return;
+ }
+ }
+ // CraftBukkit stop
+
block.b(this, i, j, k, l);
}
}
@@ -1623,7 +1633,18 @@ public class World implements IBlockAccess {
axisalignedbb = null;
}
- return axisalignedbb != null && !this.a(axisalignedbb) ? false : (block != Block.WATER && block != Block.STATIONARY_WATER && block != Block.LAVA && block != Block.STATIONARY_LAVA && block != Block.FIRE && block != Block.SNOW ? i > 0 && block == null && block1.a(this, j, k, l) : true);
+ // Craftbukkit start - We dont want to allow the user to override the bounding box check
+ boolean defaultReturn = axisalignedbb != null && !this.a(axisalignedbb) ? false : (block != Block.WATER && block != Block.STATIONARY_WATER && block != Block.LAVA && block != Block.STATIONARY_LAVA && block != Block.FIRE && block != Block.SNOW ? i > 0 && block == null && block1.a(this, j, k, l) : true);
+
+ if (!defaultReturn) {
+ return false;
+ }
+
+ BlockCanBuildEvent event = new BlockCanBuildEvent(Type.BLOCK_CANBUILD, getWorld().getBlockAt(j, k, l), i1, defaultReturn);
+ server.getPluginManager().callEvent(event);
+
+ return event.isBuildable();
+ // CraftBukkit end
}
public PathEntity a(Entity entity, Entity entity1, float f) {