3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-09-19 22:30:05 +02:00

Changed all references to BaseItem.getDamage to getData.

Dieser Commit ist enthalten in:
TomyLobo 2012-08-24 13:39:52 +02:00
Ursprung 07e270289e
Commit 186fbb98a2
6 geänderte Dateien mit 10 neuen und 10 gelöschten Zeilen

Datei anzeigen

@ -343,7 +343,7 @@ public abstract class LocalWorld implements World {
final int amount = stack.getAmount(); final int amount = stack.getAmount();
if (amount > 1) { if (amount > 1) {
dropItem(pt, new BaseItemStack(stack.getType(), 1, stack.getDamage()), amount); dropItem(pt, new BaseItemStack(stack.getType(), 1, stack.getData()), amount);
} else { } else {
dropItem(pt, stack, amount); dropItem(pt, stack, amount);
} }

Datei anzeigen

@ -77,7 +77,7 @@ public abstract class ContainerBlock extends BaseBlock implements TileEntityBloc
public Map<String, Tag> serializeItem(BaseItemStack item) { public Map<String, Tag> serializeItem(BaseItemStack item) {
Map<String, Tag> data = new HashMap<String, Tag>(); Map<String, Tag> data = new HashMap<String, Tag>();
data.put("id", new ShortTag("id", (short) item.getType())); 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())); data.put("Count", new ByteTag("Count", (byte) item.getAmount()));
if (item.getEnchantments().size() > 0) { if (item.getEnchantments().size() > 0) {
List<CompoundTag> enchantmentList = new ArrayList<CompoundTag>(); List<CompoundTag> enchantmentList = new ArrayList<CompoundTag>();

Datei anzeigen

@ -73,7 +73,7 @@ public class BukkitPlayerBlockBag extends BlockBag {
@Override @Override
public void fetchItem(BaseItem item) throws BlockBagException { public void fetchItem(BaseItem item) throws BlockBagException {
final int id = item.getType(); final int id = item.getType();
final int damage = item.getDamage(); final int damage = item.getData();
int amount = (item instanceof BaseItemStack) ? ((BaseItemStack) item).getAmount() : 1; int amount = (item instanceof BaseItemStack) ? ((BaseItemStack) item).getAmount() : 1;
assert(amount == 1); assert(amount == 1);
boolean usesDamageValue = ItemType.usesDamageValue(id); boolean usesDamageValue = ItemType.usesDamageValue(id);
@ -133,7 +133,7 @@ public class BukkitPlayerBlockBag extends BlockBag {
@Override @Override
public void storeItem(BaseItem item) throws BlockBagException { public void storeItem(BaseItem item) throws BlockBagException {
final int id = item.getType(); final int id = item.getType();
final int damage = item.getDamage(); final int damage = item.getData();
int amount = (item instanceof BaseItemStack) ? ((BaseItemStack) item).getAmount() : 1; int amount = (item instanceof BaseItemStack) ? ((BaseItemStack) item).getAmount() : 1;
assert(amount <= 64); assert(amount <= 64);
boolean usesDamageValue = ItemType.usesDamageValue(id); boolean usesDamageValue = ItemType.usesDamageValue(id);

Datei anzeigen

@ -596,7 +596,7 @@ public class BukkitWorld extends LocalWorld {
@Override @Override
public void dropItem(Vector pt, BaseItemStack item) { public void dropItem(Vector pt, BaseItemStack item) {
ItemStack bukkitItem = new ItemStack(item.getType(), item.getAmount(), ItemStack bukkitItem = new ItemStack(item.getType(), item.getAmount(),
item.getDamage()); item.getData());
world.dropItemNaturally(BukkitUtil.toLocation(world, pt), bukkitItem); world.dropItemNaturally(BukkitUtil.toLocation(world, pt), bukkitItem);
} }
@ -843,7 +843,7 @@ public class BukkitWorld extends LocalWorld {
if (contents[i] != null) { if (contents[i] != null) {
ItemStack toAdd = new ItemStack(contents[i].getType(), ItemStack toAdd = new ItemStack(contents[i].getType(),
contents[i].getAmount(), contents[i].getAmount(),
contents[i].getDamage()); contents[i].getData());
try { try {
for (Map.Entry<Integer, Integer> entry : contents[i].getEnchantments().entrySet()) { for (Map.Entry<Integer, Integer> entry : contents[i].getEnchantments().entrySet()) {
toAdd.addEnchantment(Enchantment.getById(entry.getKey()), entry.getValue()); toAdd.addEnchantment(Enchantment.getById(entry.getKey()), entry.getValue());

Datei anzeigen

@ -81,7 +81,7 @@ public class SpoutPlayerBlockBag extends BlockBag {
@Override @Override
public void fetchItem(BaseItem item) throws BlockBagException { public void fetchItem(BaseItem item) throws BlockBagException {
final short id = (short)item.getType(); 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; int amount = (item instanceof BaseItemStack) ? ((BaseItemStack) item).getAmount() : 1;
assert(amount == 1); assert(amount == 1);
Material mat = VanillaMaterials.getMaterial(id); Material mat = VanillaMaterials.getMaterial(id);
@ -139,7 +139,7 @@ public class SpoutPlayerBlockBag extends BlockBag {
@Override @Override
public void storeItem(BaseItem item) throws BlockBagException { public void storeItem(BaseItem item) throws BlockBagException {
final short id = (short) item.getType(); final short id = (short) item.getType();
final short damage = item.getDamage(); final short damage = item.getData();
Material mat = VanillaMaterials.getMaterial(id); Material mat = VanillaMaterials.getMaterial(id);
if (mat.hasSubMaterials()) { if (mat.hasSubMaterials()) {
mat = mat.getSubMaterial(damage); mat = mat.getSubMaterial(damage);

Datei anzeigen

@ -444,9 +444,9 @@ public class SpoutWorld extends LocalWorld {
public void dropItem(Vector pt, BaseItemStack item) { public void dropItem(Vector pt, BaseItemStack item) {
Material mat = VanillaMaterials.getMaterial((short) item.getType()); Material mat = VanillaMaterials.getMaterial((short) item.getType());
if (mat.hasSubMaterials()) { 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()))); world.createAndSpawnEntity(SpoutUtil.toPoint(world, pt), new Item(spoutItem, new Vector3(pt.getX(), pt.getY(), pt.getZ())));
} }