mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-27 21:26:29 +01:00
Ignore block durability on 1.13+ servers, fixes #602
This commit is contained in:
parent
0857f1079d
commit
8440ab2b80
@ -49,6 +49,7 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import me.blackvein.quests.util.ItemUtil;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
import me.blackvein.quests.util.LocaleQuery;
|
||||
import me.blackvein.quests.util.MiscUtil;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
|
||||
@ -838,9 +839,13 @@ public class Quester {
|
||||
for (ItemStack is : getQuestData(quest).blocksBroken) {
|
||||
if (m.getType() == is.getType()) {
|
||||
if (m.getType().isSolid() && is.getType().isSolid()) {
|
||||
|
||||
//Blocks are solid so check for durability
|
||||
if (m.getDurability() == is.getDurability()) {
|
||||
broken = is;
|
||||
} else if (!LocaleQuery.oldVersion) {
|
||||
//Ignore durability for 1.13+
|
||||
broken = is;
|
||||
}
|
||||
} else {
|
||||
//Blocks are not solid so ignore durability
|
||||
@ -851,9 +856,13 @@ public class Quester {
|
||||
for (ItemStack is : getCurrentStage(quest).blocksToBreak) {
|
||||
if (m.getType() == is.getType()) {
|
||||
if (m.getType().isSolid() && is.getType().isSolid()) {
|
||||
|
||||
//Blocks are solid so check for durability
|
||||
if (m.getDurability() == is.getDurability()) {
|
||||
toBreak = is;
|
||||
} else if (!LocaleQuery.oldVersion) {
|
||||
//Ignore durability for 1.13+
|
||||
toBreak = is;
|
||||
}
|
||||
} else {
|
||||
//Blocks are not solid so ignore durability
|
||||
@ -885,6 +894,9 @@ public class Quester {
|
||||
//Blocks are solid so check for durability
|
||||
if (m.getDurability() == is.getDurability()) {
|
||||
damaged = is;
|
||||
} else if (!LocaleQuery.oldVersion) {
|
||||
//Ignore durability for 1.13+
|
||||
damaged = is;
|
||||
}
|
||||
} else {
|
||||
//Blocks are not solid so ignore durability
|
||||
@ -898,6 +910,9 @@ public class Quester {
|
||||
//Blocks are solid so check for durability
|
||||
if (m.getDurability() == is.getDurability()) {
|
||||
toDamage = is;
|
||||
} else if (!LocaleQuery.oldVersion) {
|
||||
//Ignore durability for 1.13+
|
||||
toDamage = is;
|
||||
}
|
||||
} else {
|
||||
//Blocks are not solid so ignore durability
|
||||
@ -929,6 +944,9 @@ public class Quester {
|
||||
//Blocks are solid so check for durability
|
||||
if (m.getDurability() == is.getDurability()) {
|
||||
placed = is;
|
||||
} else if (!LocaleQuery.oldVersion) {
|
||||
//Ignore durability for 1.13+
|
||||
placed = is;
|
||||
}
|
||||
} else {
|
||||
//Blocks are not solid so ignore durability
|
||||
@ -942,6 +960,9 @@ public class Quester {
|
||||
//Blocks are solid so check for durability
|
||||
if (m.getDurability() == is.getDurability()) {
|
||||
toPlace = is;
|
||||
} else if (!LocaleQuery.oldVersion) {
|
||||
//Ignore durability for 1.13+
|
||||
toPlace = is;
|
||||
}
|
||||
} else {
|
||||
//Blocks are not solid so ignore durability
|
||||
@ -973,6 +994,9 @@ public class Quester {
|
||||
//Blocks are solid so check for durability
|
||||
if (m.getDurability() == is.getDurability()) {
|
||||
used = is;
|
||||
} else if (!LocaleQuery.oldVersion) {
|
||||
//Ignore durability for 1.13+
|
||||
used = is;
|
||||
}
|
||||
} else {
|
||||
//Blocks are not solid so ignore durability
|
||||
@ -986,6 +1010,9 @@ public class Quester {
|
||||
//Blocks are solid, so check durability
|
||||
if (m.getDurability() == is.getDurability()) {
|
||||
toUse = is;
|
||||
} else if (!LocaleQuery.oldVersion) {
|
||||
//Ignore durability for 1.13+
|
||||
toUse = is;
|
||||
}
|
||||
} else {
|
||||
//Blocks are not solid, so ignore durability
|
||||
@ -1017,6 +1044,9 @@ public class Quester {
|
||||
//Blocks are solid so check for durability
|
||||
if (m.getDurability() == is.getDurability()) {
|
||||
cut = is;
|
||||
} else if (!LocaleQuery.oldVersion) {
|
||||
//Ignore durability for 1.13+
|
||||
cut = is;
|
||||
}
|
||||
} else {
|
||||
//Blocks are not solid so ignore durability
|
||||
@ -1030,6 +1060,9 @@ public class Quester {
|
||||
//Blocks are solid so check for durability
|
||||
if (m.getDurability() == is.getDurability()) {
|
||||
toCut = is;
|
||||
} else if (!LocaleQuery.oldVersion) {
|
||||
//Ignore durability for 1.13+
|
||||
toCut = is;
|
||||
}
|
||||
} else {
|
||||
//Blocks are not solid so ignore durability
|
||||
|
@ -31,7 +31,7 @@ public class LocaleQuery {
|
||||
private static Class<?> craftMagicNumbers = null;
|
||||
private static Class<?> itemClazz = null;
|
||||
private final Quests plugin;
|
||||
private static boolean oldVersion = false;
|
||||
public static boolean oldVersion = false;
|
||||
|
||||
public LocaleQuery(Quests plugin){
|
||||
this.plugin = plugin;
|
||||
|
Loading…
Reference in New Issue
Block a user