refactor Items
This commit is contained in:
parent
b93f044983
commit
dbab772ca8
@ -8,7 +8,7 @@ import org.bukkit.util.Vector;
|
|||||||
import org.bukkit.entity.Creature;
|
import org.bukkit.entity.Creature;
|
||||||
import org.bukkit.entity.CreatureType;
|
import org.bukkit.entity.CreatureType;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.ItemDrop;
|
import org.bukkit.entity.Item;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.PoweredMinecart;
|
import org.bukkit.entity.PoweredMinecart;
|
||||||
import org.bukkit.entity.Minecart;
|
import org.bukkit.entity.Minecart;
|
||||||
@ -216,7 +216,7 @@ public interface World {
|
|||||||
* @param item ItemStack to drop
|
* @param item ItemStack to drop
|
||||||
* @return ItemDrop entity created as a result of this method
|
* @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
|
* Drops an item at the specified {@link Location} with a random offset
|
||||||
@ -225,7 +225,7 @@ public interface World {
|
|||||||
* @param item ItemStack to drop
|
* @param item ItemStack to drop
|
||||||
* @return ItemDrop entity created as a result of this method
|
* @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}
|
* Creates an {@link Arrow} entity at the given {@link Location}
|
||||||
|
@ -201,4 +201,6 @@ public interface Block {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
boolean isBlockIndirectlyPowered();
|
boolean isBlockIndirectlyPowered();
|
||||||
|
|
||||||
|
public byte getRawData();
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,7 @@ public interface BlockState {
|
|||||||
*
|
*
|
||||||
* @param type Type-Id to change this block to
|
* @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
|
* 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
|
* @return true if the update was successful, otherwise false
|
||||||
*/
|
*/
|
||||||
boolean update(boolean force);
|
boolean update(boolean force);
|
||||||
|
|
||||||
|
public byte getRawData();
|
||||||
}
|
}
|
||||||
|
@ -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);
|
|
||||||
}
|
|
@ -1,6 +1,6 @@
|
|||||||
package org.bukkit.event.player;
|
package org.bukkit.event.player;
|
||||||
|
|
||||||
import org.bukkit.entity.ItemDrop;
|
import org.bukkit.entity.Item;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.Cancellable;
|
import org.bukkit.event.Cancellable;
|
||||||
import org.bukkit.event.Event;
|
import org.bukkit.event.Event;
|
||||||
@ -9,10 +9,10 @@ import org.bukkit.event.Event;
|
|||||||
* Thrown when a player drops an item from their inventory
|
* Thrown when a player drops an item from their inventory
|
||||||
*/
|
*/
|
||||||
public class PlayerDropItemEvent extends PlayerEvent implements Cancellable {
|
public class PlayerDropItemEvent extends PlayerEvent implements Cancellable {
|
||||||
private final ItemDrop drop;
|
private final Item drop;
|
||||||
private boolean cancel = false;
|
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);
|
super(Event.Type.PLAYER_DROP_ITEM, player);
|
||||||
this.drop = drop;
|
this.drop = drop;
|
||||||
}
|
}
|
||||||
@ -22,7 +22,7 @@ public class PlayerDropItemEvent extends PlayerEvent implements Cancellable {
|
|||||||
*
|
*
|
||||||
* @return ItemDrop
|
* @return ItemDrop
|
||||||
*/
|
*/
|
||||||
public ItemDrop getItemDrop() {
|
public Item getItemDrop() {
|
||||||
return drop;
|
return drop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user