mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-11-02 10:57:11 +00:00
Changed all references to BaseItem.getDamage to getData.
This commit is contained in:
parent
07e270289e
commit
186fbb98a2
@ -343,7 +343,7 @@ public abstract class LocalWorld implements World {
|
||||
|
||||
final int amount = stack.getAmount();
|
||||
if (amount > 1) {
|
||||
dropItem(pt, new BaseItemStack(stack.getType(), 1, stack.getDamage()), amount);
|
||||
dropItem(pt, new BaseItemStack(stack.getType(), 1, stack.getData()), amount);
|
||||
} else {
|
||||
dropItem(pt, stack, amount);
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ public abstract class ContainerBlock extends BaseBlock implements TileEntityBloc
|
||||
public Map<String, Tag> serializeItem(BaseItemStack item) {
|
||||
Map<String, Tag> data = new HashMap<String, Tag>();
|
||||
data.put("id", new ShortTag("id", (short) item.getType()));
|
||||
data.put("Damage", new ShortTag("Damage", item.getDamage()));
|
||||
data.put("Damage", new ShortTag("Damage", item.getData()));
|
||||
data.put("Count", new ByteTag("Count", (byte) item.getAmount()));
|
||||
if (item.getEnchantments().size() > 0) {
|
||||
List<CompoundTag> enchantmentList = new ArrayList<CompoundTag>();
|
||||
|
@ -73,7 +73,7 @@ public class BukkitPlayerBlockBag extends BlockBag {
|
||||
@Override
|
||||
public void fetchItem(BaseItem item) throws BlockBagException {
|
||||
final int id = item.getType();
|
||||
final int damage = item.getDamage();
|
||||
final int damage = item.getData();
|
||||
int amount = (item instanceof BaseItemStack) ? ((BaseItemStack) item).getAmount() : 1;
|
||||
assert(amount == 1);
|
||||
boolean usesDamageValue = ItemType.usesDamageValue(id);
|
||||
@ -133,7 +133,7 @@ public class BukkitPlayerBlockBag extends BlockBag {
|
||||
@Override
|
||||
public void storeItem(BaseItem item) throws BlockBagException {
|
||||
final int id = item.getType();
|
||||
final int damage = item.getDamage();
|
||||
final int damage = item.getData();
|
||||
int amount = (item instanceof BaseItemStack) ? ((BaseItemStack) item).getAmount() : 1;
|
||||
assert(amount <= 64);
|
||||
boolean usesDamageValue = ItemType.usesDamageValue(id);
|
||||
|
@ -596,7 +596,7 @@ public class BukkitWorld extends LocalWorld {
|
||||
@Override
|
||||
public void dropItem(Vector pt, BaseItemStack item) {
|
||||
ItemStack bukkitItem = new ItemStack(item.getType(), item.getAmount(),
|
||||
item.getDamage());
|
||||
item.getData());
|
||||
world.dropItemNaturally(BukkitUtil.toLocation(world, pt), bukkitItem);
|
||||
}
|
||||
|
||||
@ -843,7 +843,7 @@ public class BukkitWorld extends LocalWorld {
|
||||
if (contents[i] != null) {
|
||||
ItemStack toAdd = new ItemStack(contents[i].getType(),
|
||||
contents[i].getAmount(),
|
||||
contents[i].getDamage());
|
||||
contents[i].getData());
|
||||
try {
|
||||
for (Map.Entry<Integer, Integer> entry : contents[i].getEnchantments().entrySet()) {
|
||||
toAdd.addEnchantment(Enchantment.getById(entry.getKey()), entry.getValue());
|
||||
|
@ -81,7 +81,7 @@ public class SpoutPlayerBlockBag extends BlockBag {
|
||||
@Override
|
||||
public void fetchItem(BaseItem item) throws BlockBagException {
|
||||
final short id = (short)item.getType();
|
||||
final short damage = item.getDamage();
|
||||
final short damage = item.getData();
|
||||
int amount = (item instanceof BaseItemStack) ? ((BaseItemStack) item).getAmount() : 1;
|
||||
assert(amount == 1);
|
||||
Material mat = VanillaMaterials.getMaterial(id);
|
||||
@ -139,7 +139,7 @@ public class SpoutPlayerBlockBag extends BlockBag {
|
||||
@Override
|
||||
public void storeItem(BaseItem item) throws BlockBagException {
|
||||
final short id = (short) item.getType();
|
||||
final short damage = item.getDamage();
|
||||
final short damage = item.getData();
|
||||
Material mat = VanillaMaterials.getMaterial(id);
|
||||
if (mat.hasSubMaterials()) {
|
||||
mat = mat.getSubMaterial(damage);
|
||||
|
@ -444,9 +444,9 @@ public class SpoutWorld extends LocalWorld {
|
||||
public void dropItem(Vector pt, BaseItemStack item) {
|
||||
Material mat = VanillaMaterials.getMaterial((short) item.getType());
|
||||
if (mat.hasSubMaterials()) {
|
||||
mat = mat.getSubMaterial(item.getDamage());
|
||||
mat = mat.getSubMaterial(item.getData());
|
||||
}
|
||||
ItemStack spoutItem = new ItemStack(mat, item.getDamage(), item.getAmount());
|
||||
ItemStack spoutItem = new ItemStack(mat, item.getData(), item.getAmount());
|
||||
world.createAndSpawnEntity(SpoutUtil.toPoint(world, pt), new Item(spoutItem, new Vector3(pt.getX(), pt.getY(), pt.getZ())));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user