Changed all references to BaseItem.getDamage to getData.

This commit is contained in:
TomyLobo 2012-08-24 13:39:52 +02:00
parent 07e270289e
commit 186fbb98a2
6 changed files with 10 additions and 10 deletions

View File

@ -343,7 +343,7 @@ public void simulateBlockMine(Vector pt) {
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);
}

View File

@ -77,7 +77,7 @@ public boolean hasNbtData() {
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>();

View File

@ -73,7 +73,7 @@ public Player getPlayer() {
@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 void fetchItem(BaseItem item) throws BlockBagException {
@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);

View File

@ -596,7 +596,7 @@ public boolean generateTree(TreeGenerator.TreeType type, EditSession editSession
@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 @@ private boolean setContainerBlockContents(Vector pt, BaseItemStack[] contents) {
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());

View File

@ -81,7 +81,7 @@ public Player getPlayer() {
@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 void fetchItem(BaseItem item) throws BlockBagException {
@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);

View File

@ -444,9 +444,9 @@ public boolean generateTree(TreeGenerator.TreeType type, EditSession editSession
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())));
}