Implemented BlockInteract, BlockRightClicked and PlayerItem. Removed

BlockItem as we're not doing it that way anymore.
This commit is contained in:
durron597
2011-01-08 05:44:42 -05:00
parent e9611ee6f9
commit 98b6937ac2
9 changed files with 282 additions and 122 deletions

View File

@@ -0,0 +1,59 @@
package org.bukkit.event.block;
import org.bukkit.Block;
import org.bukkit.BlockFace;
import org.bukkit.ItemStack;
import org.bukkit.Player;
/**
* Not implemented yet
*/
public class BlockRightClickedEvent extends BlockEvent {
protected Block clickedBlock;
protected BlockFace direction;
protected ItemStack itemInHand;
protected Player player;
public BlockRightClickedEvent(Type type, Block placedAgainst, BlockFace direction, ItemStack itemInHand, Player thePlayer) {
super(type, placedAgainst);
this.clickedBlock = placedAgainst;
this.direction = direction;
this.itemInHand = itemInHand;
this.player = thePlayer;
}
/**
* Gets the player who placed this block
*
* @return Player who placed the block
*/
public Player getPlayer() {
return player;
}
/**
* Get the block that this block was placed against
*
* @return Block the block that the new block was placed against
*/
public Block getBlockAgainst() {
return clickedBlock;
}
/**
* @return BlockFace the direction this block was clicked
*/
public BlockFace getDirection() {
return direction;
}
/**
* Returns the item in your hand when you placed the block
*
* @return ItemStack the item in your hand when placing the block
*/
public ItemStack getItemInHand() {
return itemInHand;
}
}