Fixed lack of calling callEvent(event), finished Item Use

This commit is contained in:
durron597
2011-01-08 06:18:05 -05:00
parent 65c8df24b6
commit fab66092e2
10 changed files with 417 additions and 3 deletions

View File

@@ -1,8 +1,5 @@
package net.minecraft.server;
import java.util.Random;
import org.bukkit.BlockFace;
import org.bukkit.craftbukkit.CraftBlock;
import org.bukkit.craftbukkit.CraftItemStack;
@@ -65,6 +62,7 @@ public class ItemBucket extends Item {
if (a == 0) {
if (world.c(i, j, k) == Material.f && world.b(i, j, k) == 0) {
PlayerItemEvent pie = new PlayerItemEvent(Type.PLAYER_ITEM, thePlayer, itemInHand, blockClicked, direction);
((WorldServer) world).getServer().getPluginManager().callEvent(pie);
if (!pie.isCancelled()) {
world.d(i, j, k, 0);
@@ -75,6 +73,7 @@ public class ItemBucket extends Item {
}
if (world.c(i, j, k) == Material.g && world.b(i, j, k) == 0) {
PlayerItemEvent pie = new PlayerItemEvent(Type.PLAYER_ITEM, thePlayer, itemInHand, blockClicked, direction);
((WorldServer) world).getServer().getPluginManager().callEvent(pie);
if (!pie.isCancelled()) {
world.d(i, j, k, 0);