Only subtract progress from place block objs if same type, fixes #866

This commit is contained in:
PikaMug 2019-07-26 02:14:38 -04:00
parent 742d6252c1
commit 0dfe461b71

View File

@ -461,7 +461,7 @@ public class PlayerListener implements Listener {
} }
if (quester.containsObjective(quest, "placeBlock")) { if (quester.containsObjective(quest, "placeBlock")) {
for (ItemStack is : quester.getQuestData(quest).blocksPlaced) { for (ItemStack is : quester.getQuestData(quest).blocksPlaced) {
if (is.getAmount() > 0) { if (evt.getBlock().getType().equals(is.getType()) && is.getAmount() > 0) {
int index = quester.getQuestData(quest).blocksPlaced.indexOf(is); int index = quester.getQuestData(quest).blocksPlaced.indexOf(is);
is.setAmount(is.getAmount() - 1); is.setAmount(is.getAmount() - 1);
quester.getQuestData(quest).blocksPlaced.set(index, is); quester.getQuestData(quest).blocksPlaced.set(index, is);