diff options
author | EvilSeph <evilseph@unaligned.org> | 2011-06-17 14:48:20 -0400 |
---|---|---|
committer | EvilSeph <evilseph@unaligned.org> | 2011-06-17 22:19:43 -0400 |
commit | d48e9c22f5ceb9d4d75756c2f4af78f0c9ff9f75 (patch) | |
tree | ceafaf0c8093fec829c97b4c54d2aff93afb8d86 /src/main/java/net/minecraft/server/World.java | |
parent | 22f26895eca8e99f795368a9a7167852c1805a1e (diff) | |
download | craftbukkit-d48e9c22f5ceb9d4d75756c2f4af78f0c9ff9f75.tar craftbukkit-d48e9c22f5ceb9d4d75756c2f4af78f0c9ff9f75.tar.gz craftbukkit-d48e9c22f5ceb9d4d75756c2f4af78f0c9ff9f75.tar.lz craftbukkit-d48e9c22f5ceb9d4d75756c2f4af78f0c9ff9f75.tar.xz craftbukkit-d48e9c22f5ceb9d4d75756c2f4af78f0c9ff9f75.zip |
Added BlockSpread, BlockForm and BlockFade events.
Diffstat (limited to 'src/main/java/net/minecraft/server/World.java')
-rw-r--r-- | src/main/java/net/minecraft/server/World.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java index 3493b906..b718f8c5 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -19,10 +19,13 @@ import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.event.block.BlockCanBuildEvent; import org.bukkit.event.block.BlockPhysicsEvent; import org.bukkit.event.block.SnowFormEvent; +import org.bukkit.event.block.BlockFormEvent; import org.bukkit.event.entity.CreatureSpawnEvent; import org.bukkit.event.entity.ItemSpawnEvent; import org.bukkit.event.weather.WeatherChangeEvent; import org.bukkit.event.weather.ThunderChangeEvent; +import org.bukkit.block.BlockState; +import org.bukkit.craftbukkit.block.CraftBlockState; // CraftBukkit end public class World implements IBlockAccess { @@ -1830,7 +1833,7 @@ public class World implements IBlockAccess { i2 = chunk.getTypeId(l, k1, j1); if (this.v() && i2 == 0 && Block.SNOW.canPlace(this, l + i, k1, j1 + j) && l1 != 0 && l1 != Block.ICE.id && Block.byId[l1].material.isSolid()) { // CraftBukkit start - SnowFormEvent snow = new SnowFormEvent(((WorldServer) this).getWorld().getBlockAt(l + i, k1, j1 + j)); + SnowFormEvent snow = new SnowFormEvent(this.getWorld().getBlockAt(l + i, k1, j1 + j)); getServer().getPluginManager().callEvent(snow); if (!snow.isCancelled()) { @@ -1840,9 +1843,18 @@ public class World implements IBlockAccess { // CraftBukkit end } - if (l1 == Block.STATIONARY_WATER.id && chunk.getData(l, k1 - 1, j1) == 0) { - this.setTypeId(l + i, k1 - 1, j1 + j, Block.ICE.id); + // CraftBukkit start + if (l1 == Block.STATIONARY_WATER.id && chunk.getData(l, k1 - 1, j1) == 0) { + BlockState blockState = this.getWorld().getBlockAt(l + i, k1 - 1, j1 + j).getState(); + blockState.setTypeId(Block.ICE.id); + + BlockFormEvent iceBlockForm = new BlockFormEvent(this.getWorld().getBlockAt(l + i, k1 - 1, j1 + j), blockState); + this.getServer().getPluginManager().callEvent(iceBlockForm); + if (!iceBlockForm.isCancelled()) { + blockState.update(true); + } } + // CraftBukkit end } } |