refactor Items

By: Tahg <tahgtahv@gmail.com>
This commit is contained in:
Bukkit/Spigot 2011-02-21 19:57:06 -05:00
parent dc15009d48
commit 3cc14ab40f
5 changed files with 12 additions and 33 deletions

View file

@ -8,7 +8,7 @@ import org.bukkit.util.Vector;
import org.bukkit.entity.Creature;
import org.bukkit.entity.CreatureType;
import org.bukkit.entity.Entity;
import org.bukkit.entity.ItemDrop;
import org.bukkit.entity.Item;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.PoweredMinecart;
import org.bukkit.entity.Minecart;
@ -216,7 +216,7 @@ public interface World {
* @param item ItemStack to drop
* @return ItemDrop entity created as a result of this method
*/
public ItemDrop dropItem(Location location, ItemStack item);
public Item dropItem(Location location, ItemStack item);
/**
* Drops an item at the specified {@link Location} with a random offset
@ -225,7 +225,7 @@ public interface World {
* @param item ItemStack to drop
* @return ItemDrop entity created as a result of this method
*/
public ItemDrop dropItemNaturally(Location location, ItemStack item);
public Item dropItemNaturally(Location location, ItemStack item);
/**
* Creates an {@link Arrow} entity at the given {@link Location}

View file

@ -201,4 +201,6 @@ public interface Block {
* @return
*/
boolean isBlockIndirectlyPowered();
public byte getRawData();
}

View file

@ -104,7 +104,7 @@ public interface BlockState {
*
* @param type Type-Id to change this block to
*/
void setTypeId(int type);
boolean setTypeId(int type);
/**
* Attempts to update the block represented by this state, setting it to the
@ -135,4 +135,6 @@ public interface BlockState {
* @return true if the update was successful, otherwise false
*/
boolean update(boolean force);
public byte getRawData();
}

View file

@ -1,25 +0,0 @@
package org.bukkit.entity;
import org.bukkit.inventory.ItemStack;
/**
* Represents a dropped item.
*
* @author sk89q
*/
public interface ItemDrop extends Entity {
/**
* Gets the item stack contained in this ItemDrop
*
* @return ItemStack of the contents of this drop
*/
public ItemStack getItemStack();
/**
* sets the item stack contained in this ItemDrop
*
* @param items New contents of this drop
*/
public void setItemStack(ItemStack items);
}

View file

@ -1,6 +1,6 @@
package org.bukkit.event.player;
import org.bukkit.entity.ItemDrop;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
@ -9,10 +9,10 @@ import org.bukkit.event.Event;
* Thrown when a player drops an item from their inventory
*/
public class PlayerDropItemEvent extends PlayerEvent implements Cancellable {
private final ItemDrop drop;
private final Item drop;
private boolean cancel = false;
public PlayerDropItemEvent(final Player player, final ItemDrop drop) {
public PlayerDropItemEvent(final Player player, final Item drop) {
super(Event.Type.PLAYER_DROP_ITEM, player);
this.drop = drop;
}
@ -22,7 +22,7 @@ public class PlayerDropItemEvent extends PlayerEvent implements Cancellable {
*
* @return ItemDrop
*/
public ItemDrop getItemDrop() {
public Item getItemDrop() {
return drop;
}