refactor Items

This commit is contained in:
Tahg
2011-02-21 19:43:12 -05:00
parent f659231e34
commit 96435cfc76
8 changed files with 72 additions and 58 deletions

View File

@@ -7,7 +7,6 @@ import org.bukkit.entity.Entity;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import net.minecraft.server.*;
@@ -15,7 +14,6 @@ import org.bukkit.entity.Arrow;
import org.bukkit.block.Block;
import org.bukkit.entity.Boat;
import org.bukkit.Chunk;
import org.bukkit.entity.ItemDrop;
import org.bukkit.inventory.ItemStack;
import org.bukkit.util.Vector;
import org.bukkit.BlockChangeDelegate;
@@ -212,7 +210,7 @@ public class CraftWorld implements World {
return world;
}
public ItemDrop dropItem(Location loc, ItemStack item) {
public org.bukkit.entity.Item dropItem(Location loc, ItemStack item) {
net.minecraft.server.ItemStack stack = new net.minecraft.server.ItemStack(
item.getTypeId(),
item.getAmount(),
@@ -223,10 +221,10 @@ public class CraftWorld implements World {
world.a(entity);
//TODO this is inconsistent with how Entity.getBukkitEntity() works.
// However, this entity is not at the moment backed by a server entity class so it may be left.
return new CraftItemDrop(world.getServer(), entity);
return new CraftItem(world.getServer(), entity);
}
public ItemDrop dropItemNaturally(Location loc, ItemStack item) {
public org.bukkit.entity.Item dropItemNaturally(Location loc, ItemStack item) {
double xs = world.l.nextFloat() * 0.7F + (1.0F - 0.7F) * 0.5D;
double ys = world.l.nextFloat() * 0.7F + (1.0F - 0.7F) * 0.5D;
double zs = world.l.nextFloat() * 0.7F + (1.0F - 0.7F) * 0.5D;