mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-22 10:36:09 +01:00
Potential fix for #2233
This commit is contained in:
parent
8eec73bf04
commit
aa8285f464
@ -3635,7 +3635,8 @@ public class BukkitQuester implements Quester {
|
|||||||
final BukkitStage bukkitStage = (BukkitStage) quest.getStage(stage);
|
final BukkitStage bukkitStage = (BukkitStage) quest.getStage(stage);
|
||||||
if (!bukkitStage.getBlocksToBreak().isEmpty()) {
|
if (!bukkitStage.getBlocksToBreak().isEmpty()) {
|
||||||
for (final ItemStack toBreak : bukkitStage.getBlocksToBreak()) {
|
for (final ItemStack toBreak : bukkitStage.getBlocksToBreak()) {
|
||||||
final ItemStack temp = new ItemStack(toBreak.getType(), 0, toBreak.getDurability());
|
final ItemStack temp = new ItemStack(toBreak.getType(), 1, toBreak.getDurability());
|
||||||
|
temp.setAmount(0);
|
||||||
if (data.blocksBroken.contains(toBreak)) {
|
if (data.blocksBroken.contains(toBreak)) {
|
||||||
data.blocksBroken.set(data.blocksBroken.indexOf(temp), temp);
|
data.blocksBroken.set(data.blocksBroken.indexOf(temp), temp);
|
||||||
} else {
|
} else {
|
||||||
@ -3645,7 +3646,8 @@ public class BukkitQuester implements Quester {
|
|||||||
}
|
}
|
||||||
if (!bukkitStage.getBlocksToDamage().isEmpty()) {
|
if (!bukkitStage.getBlocksToDamage().isEmpty()) {
|
||||||
for (final ItemStack toDamage : bukkitStage.getBlocksToDamage()) {
|
for (final ItemStack toDamage : bukkitStage.getBlocksToDamage()) {
|
||||||
final ItemStack temp = new ItemStack(toDamage.getType(), 0, toDamage.getDurability());
|
final ItemStack temp = new ItemStack(toDamage.getType(), 1, toDamage.getDurability());
|
||||||
|
temp.setAmount(0);
|
||||||
if (data.blocksDamaged.contains(toDamage)) {
|
if (data.blocksDamaged.contains(toDamage)) {
|
||||||
data.blocksDamaged.set(data.blocksDamaged.indexOf(temp), temp);
|
data.blocksDamaged.set(data.blocksDamaged.indexOf(temp), temp);
|
||||||
} else {
|
} else {
|
||||||
@ -3655,7 +3657,8 @@ public class BukkitQuester implements Quester {
|
|||||||
}
|
}
|
||||||
if (!bukkitStage.getBlocksToPlace().isEmpty()) {
|
if (!bukkitStage.getBlocksToPlace().isEmpty()) {
|
||||||
for (final ItemStack toPlace : bukkitStage.getBlocksToPlace()) {
|
for (final ItemStack toPlace : bukkitStage.getBlocksToPlace()) {
|
||||||
final ItemStack temp = new ItemStack(toPlace.getType(), 0, toPlace.getDurability());
|
final ItemStack temp = new ItemStack(toPlace.getType(), 1, toPlace.getDurability());
|
||||||
|
temp.setAmount(0);
|
||||||
if (data.blocksPlaced.contains(toPlace)) {
|
if (data.blocksPlaced.contains(toPlace)) {
|
||||||
data.blocksPlaced.set(data.blocksPlaced.indexOf(temp), temp);
|
data.blocksPlaced.set(data.blocksPlaced.indexOf(temp), temp);
|
||||||
} else {
|
} else {
|
||||||
@ -3665,7 +3668,8 @@ public class BukkitQuester implements Quester {
|
|||||||
}
|
}
|
||||||
if (!bukkitStage.getBlocksToUse().isEmpty()) {
|
if (!bukkitStage.getBlocksToUse().isEmpty()) {
|
||||||
for (final ItemStack toUse : bukkitStage.getBlocksToUse()) {
|
for (final ItemStack toUse : bukkitStage.getBlocksToUse()) {
|
||||||
final ItemStack temp = new ItemStack(toUse.getType(), 0, toUse.getDurability());
|
final ItemStack temp = new ItemStack(toUse.getType(), 1, toUse.getDurability());
|
||||||
|
temp.setAmount(0);
|
||||||
if (data.blocksUsed.contains(toUse)) {
|
if (data.blocksUsed.contains(toUse)) {
|
||||||
data.blocksUsed.set(data.blocksUsed.indexOf(temp), temp);
|
data.blocksUsed.set(data.blocksUsed.indexOf(temp), temp);
|
||||||
} else {
|
} else {
|
||||||
@ -3675,7 +3679,8 @@ public class BukkitQuester implements Quester {
|
|||||||
}
|
}
|
||||||
if (!bukkitStage.getBlocksToCut().isEmpty()) {
|
if (!bukkitStage.getBlocksToCut().isEmpty()) {
|
||||||
for (final ItemStack toCut : bukkitStage.getBlocksToCut()) {
|
for (final ItemStack toCut : bukkitStage.getBlocksToCut()) {
|
||||||
final ItemStack temp = new ItemStack(toCut.getType(), 0, toCut.getDurability());
|
final ItemStack temp = new ItemStack(toCut.getType(), 1, toCut.getDurability());
|
||||||
|
temp.setAmount(0);
|
||||||
if (data.blocksCut.contains(toCut)) {
|
if (data.blocksCut.contains(toCut)) {
|
||||||
data.blocksCut.set(data.blocksCut.indexOf(temp), temp);
|
data.blocksCut.set(data.blocksCut.indexOf(temp), temp);
|
||||||
} else {
|
} else {
|
||||||
@ -3685,7 +3690,8 @@ public class BukkitQuester implements Quester {
|
|||||||
}
|
}
|
||||||
if (!bukkitStage.getItemsToCraft().isEmpty()) {
|
if (!bukkitStage.getItemsToCraft().isEmpty()) {
|
||||||
for (final ItemStack toCraft : bukkitStage.getItemsToCraft()) {
|
for (final ItemStack toCraft : bukkitStage.getItemsToCraft()) {
|
||||||
final ItemStack temp = new ItemStack(toCraft.getType(), 0, toCraft.getDurability());
|
final ItemStack temp = new ItemStack(toCraft.getType(), 1, toCraft.getDurability());
|
||||||
|
temp.setAmount(0);
|
||||||
temp.addUnsafeEnchantments(toCraft.getEnchantments());
|
temp.addUnsafeEnchantments(toCraft.getEnchantments());
|
||||||
temp.setItemMeta(toCraft.getItemMeta());
|
temp.setItemMeta(toCraft.getItemMeta());
|
||||||
data.itemsCrafted.add(temp);
|
data.itemsCrafted.add(temp);
|
||||||
@ -3693,7 +3699,8 @@ public class BukkitQuester implements Quester {
|
|||||||
}
|
}
|
||||||
if (!bukkitStage.getItemsToSmelt().isEmpty()) {
|
if (!bukkitStage.getItemsToSmelt().isEmpty()) {
|
||||||
for (final ItemStack toSmelt : bukkitStage.getItemsToSmelt()) {
|
for (final ItemStack toSmelt : bukkitStage.getItemsToSmelt()) {
|
||||||
final ItemStack temp = new ItemStack(toSmelt.getType(), 0, toSmelt.getDurability());
|
final ItemStack temp = new ItemStack(toSmelt.getType(), 1, toSmelt.getDurability());
|
||||||
|
temp.setAmount(0);
|
||||||
temp.addUnsafeEnchantments(toSmelt.getEnchantments());
|
temp.addUnsafeEnchantments(toSmelt.getEnchantments());
|
||||||
temp.setItemMeta(toSmelt.getItemMeta());
|
temp.setItemMeta(toSmelt.getItemMeta());
|
||||||
data.itemsSmelted.add(temp);
|
data.itemsSmelted.add(temp);
|
||||||
@ -3701,7 +3708,8 @@ public class BukkitQuester implements Quester {
|
|||||||
}
|
}
|
||||||
if (!bukkitStage.getItemsToEnchant().isEmpty()) {
|
if (!bukkitStage.getItemsToEnchant().isEmpty()) {
|
||||||
for (final ItemStack toEnchant : bukkitStage.getItemsToEnchant()) {
|
for (final ItemStack toEnchant : bukkitStage.getItemsToEnchant()) {
|
||||||
final ItemStack temp = new ItemStack(toEnchant.getType(), 0, toEnchant.getDurability());
|
final ItemStack temp = new ItemStack(toEnchant.getType(), 1, toEnchant.getDurability());
|
||||||
|
temp.setAmount(0);
|
||||||
temp.addUnsafeEnchantments(toEnchant.getEnchantments());
|
temp.addUnsafeEnchantments(toEnchant.getEnchantments());
|
||||||
temp.setItemMeta(toEnchant.getItemMeta());
|
temp.setItemMeta(toEnchant.getItemMeta());
|
||||||
data.itemsEnchanted.add(temp);
|
data.itemsEnchanted.add(temp);
|
||||||
@ -3709,7 +3717,8 @@ public class BukkitQuester implements Quester {
|
|||||||
}
|
}
|
||||||
if (!bukkitStage.getItemsToBrew().isEmpty()) {
|
if (!bukkitStage.getItemsToBrew().isEmpty()) {
|
||||||
for (final ItemStack toBrew : bukkitStage.getItemsToBrew()) {
|
for (final ItemStack toBrew : bukkitStage.getItemsToBrew()) {
|
||||||
final ItemStack temp = new ItemStack(toBrew.getType(), 0, toBrew.getDurability());
|
final ItemStack temp = new ItemStack(toBrew.getType(), 1, toBrew.getDurability());
|
||||||
|
temp.setAmount(0);
|
||||||
temp.addUnsafeEnchantments(toBrew.getEnchantments());
|
temp.addUnsafeEnchantments(toBrew.getEnchantments());
|
||||||
temp.setItemMeta(toBrew.getItemMeta());
|
temp.setItemMeta(toBrew.getItemMeta());
|
||||||
data.itemsBrewed.add(temp);
|
data.itemsBrewed.add(temp);
|
||||||
@ -3717,7 +3726,8 @@ public class BukkitQuester implements Quester {
|
|||||||
}
|
}
|
||||||
if (!bukkitStage.getItemsToConsume().isEmpty()) {
|
if (!bukkitStage.getItemsToConsume().isEmpty()) {
|
||||||
for (final ItemStack toConsume : bukkitStage.getItemsToConsume()) {
|
for (final ItemStack toConsume : bukkitStage.getItemsToConsume()) {
|
||||||
final ItemStack temp = new ItemStack(toConsume.getType(), 0, toConsume.getDurability());
|
final ItemStack temp = new ItemStack(toConsume.getType(), 1, toConsume.getDurability());
|
||||||
|
temp.setAmount(0);
|
||||||
temp.addUnsafeEnchantments(toConsume.getEnchantments());
|
temp.addUnsafeEnchantments(toConsume.getEnchantments());
|
||||||
temp.setItemMeta(toConsume.getItemMeta());
|
temp.setItemMeta(toConsume.getItemMeta());
|
||||||
data.itemsConsumed.add(temp);
|
data.itemsConsumed.add(temp);
|
||||||
@ -3725,7 +3735,8 @@ public class BukkitQuester implements Quester {
|
|||||||
}
|
}
|
||||||
if (!bukkitStage.getItemsToDeliver().isEmpty()) {
|
if (!bukkitStage.getItemsToDeliver().isEmpty()) {
|
||||||
for (final ItemStack toDeliver : bukkitStage.getItemsToDeliver()) {
|
for (final ItemStack toDeliver : bukkitStage.getItemsToDeliver()) {
|
||||||
final ItemStack temp = new ItemStack(toDeliver.getType(), 0, toDeliver.getDurability());
|
final ItemStack temp = new ItemStack(toDeliver.getType(), 1, toDeliver.getDurability());
|
||||||
|
temp.setAmount(0);
|
||||||
temp.addUnsafeEnchantments(toDeliver.getEnchantments());
|
temp.addUnsafeEnchantments(toDeliver.getEnchantments());
|
||||||
temp.setItemMeta(toDeliver.getItemMeta());
|
temp.setItemMeta(toDeliver.getItemMeta());
|
||||||
data.itemsDelivered.add(temp);
|
data.itemsDelivered.add(temp);
|
||||||
|
Loading…
Reference in New Issue
Block a user