summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEvilSeph <evilseph@unaligned.org>2011-05-02 01:48:08 -0400
committerEvilSeph <evilseph@unaligned.org>2011-05-02 01:48:08 -0400
commite56a8d47201b4adc48da2576ddedb623b95090ab (patch)
treefe8a9f6da7da0ac077d983f54ce2323f1e442b59 /src
parentf342db744ad9367417c6fc85439d8c22410f15a5 (diff)
downloadcraftbukkit-e56a8d47201b4adc48da2576ddedb623b95090ab.tar
craftbukkit-e56a8d47201b4adc48da2576ddedb623b95090ab.tar.gz
craftbukkit-e56a8d47201b4adc48da2576ddedb623b95090ab.tar.lz
craftbukkit-e56a8d47201b4adc48da2576ddedb623b95090ab.tar.xz
craftbukkit-e56a8d47201b4adc48da2576ddedb623b95090ab.zip
Added SnowFormEvent. Thanks aPunch!
Diffstat (limited to 'src')
-rw-r--r--src/main/java/net/minecraft/server/World.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 7a2c67fa..f8178e9e 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -14,6 +14,7 @@ import org.bukkit.craftbukkit.CraftWorld;
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.entity.CreatureSpawnEvent;
import org.bukkit.event.weather.WeatherChangeEvent;
import org.bukkit.event.weather.ThunderChangeEvent;
@@ -1521,7 +1522,6 @@ public class World implements IBlockAccess {
// CraftBukkit start
CraftServer server = ((WorldServer) this).getServer();
-
WeatherChangeEvent weather = new WeatherChangeEvent(((WorldServer) this).getWorld(), !this.worldData.l());
server.getPluginManager().callEvent(weather);
if (!weather.isCancelled()) {
@@ -1664,7 +1664,14 @@ public class World implements IBlockAccess {
l1 = chunk.getTypeId(l, k1 - 1, j1);
i2 = chunk.getTypeId(l, k1, j1);
if (i2 == 0 && Block.SNOW.canPlace(this, l + i, k1, j1 + j) && l1 != 0 && l1 != Block.ICE.id && Block.byId[l1].material.isSolid()) {
- this.setTypeId(l + i, k1, j1 + j, Block.SNOW.id);
+ // CraftBukkit start
+ SnowFormEvent snow = new SnowFormEvent(((WorldServer)this).getWorld().getBlockAt(l + i, k1, j1 + j));
+ ((WorldServer)this).getServer().getPluginManager().callEvent(snow);
+ if (!snow.isCancelled()) {
+ this.setTypeId(l + i, k1, j1 + j, snow.getMaterial().getId());
+ this.setData(l + i, k1, j1 + j, snow.getData());
+ }
+ // CraftBukkit end
}
if (l1 == Block.STATIONARY_WATER.id && chunk.getData(l, k1 - 1, j1) == 0) {