mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-22 02:25:42 +01:00
Null checks for block items, see #2256
This commit is contained in:
parent
f63ad2f575
commit
b8519a05f4
@ -884,7 +884,7 @@ public class BukkitQuestYamlStorage implements QuestStorageImpl {
|
|||||||
// Legacy
|
// Legacy
|
||||||
is = BukkitItemUtil.processItemStack(name, breakAmounts.get(i), (short) 0);
|
is = BukkitItemUtil.processItemStack(name, breakAmounts.get(i), (short) 0);
|
||||||
}
|
}
|
||||||
if (Material.matchMaterial(name) != null) {
|
if (is != null && Material.matchMaterial(name) != null) {
|
||||||
bukkitStage.addBlockToBreak(is);
|
bukkitStage.addBlockToBreak(is);
|
||||||
} else {
|
} else {
|
||||||
throw new StageFormatException("'break-block-names' has invalid item name " + name, quest, stageNum);
|
throw new StageFormatException("'break-block-names' has invalid item name " + name, quest, stageNum);
|
||||||
@ -926,7 +926,7 @@ public class BukkitQuestYamlStorage implements QuestStorageImpl {
|
|||||||
// Legacy
|
// Legacy
|
||||||
is = BukkitItemUtil.processItemStack(name, damageAmounts.get(i), (short) 0);
|
is = BukkitItemUtil.processItemStack(name, damageAmounts.get(i), (short) 0);
|
||||||
}
|
}
|
||||||
if (Material.matchMaterial(name) != null) {
|
if (is != null && Material.matchMaterial(name) != null) {
|
||||||
bukkitStage.addBlockToDamage(is);
|
bukkitStage.addBlockToDamage(is);
|
||||||
} else {
|
} else {
|
||||||
throw new StageFormatException("'damage-block-names' has invalid item name " + name, quest, stageNum);
|
throw new StageFormatException("'damage-block-names' has invalid item name " + name, quest, stageNum);
|
||||||
@ -967,7 +967,7 @@ public class BukkitQuestYamlStorage implements QuestStorageImpl {
|
|||||||
// Legacy
|
// Legacy
|
||||||
is = BukkitItemUtil.processItemStack(name, placeAmounts.get(i), (short) 0);
|
is = BukkitItemUtil.processItemStack(name, placeAmounts.get(i), (short) 0);
|
||||||
}
|
}
|
||||||
if (Material.matchMaterial(name) != null) {
|
if (is != null && Material.matchMaterial(name) != null) {
|
||||||
bukkitStage.addBlockToPlace(is);
|
bukkitStage.addBlockToPlace(is);
|
||||||
} else {
|
} else {
|
||||||
throw new StageFormatException("'place-block-names' has invalid item name " + name, quest, stageNum);
|
throw new StageFormatException("'place-block-names' has invalid item name " + name, quest, stageNum);
|
||||||
@ -1008,7 +1008,7 @@ public class BukkitQuestYamlStorage implements QuestStorageImpl {
|
|||||||
// Legacy
|
// Legacy
|
||||||
is = BukkitItemUtil.processItemStack(name, useAmounts.get(i), (short) 0);
|
is = BukkitItemUtil.processItemStack(name, useAmounts.get(i), (short) 0);
|
||||||
}
|
}
|
||||||
if (Material.matchMaterial(name) != null) {
|
if (is != null && Material.matchMaterial(name) != null) {
|
||||||
bukkitStage.addBlockToUse(is);
|
bukkitStage.addBlockToUse(is);
|
||||||
} else {
|
} else {
|
||||||
throw new StageFormatException("'use-block-names' has invalid item name " + name, quest, stageNum);
|
throw new StageFormatException("'use-block-names' has invalid item name " + name, quest, stageNum);
|
||||||
@ -1049,7 +1049,7 @@ public class BukkitQuestYamlStorage implements QuestStorageImpl {
|
|||||||
// Legacy
|
// Legacy
|
||||||
is = BukkitItemUtil.processItemStack(name, cutAmounts.get(i), (short) 0);
|
is = BukkitItemUtil.processItemStack(name, cutAmounts.get(i), (short) 0);
|
||||||
}
|
}
|
||||||
if (Material.matchMaterial(name) != null) {
|
if (is != null && Material.matchMaterial(name) != null) {
|
||||||
bukkitStage.addBlockToCut(is);
|
bukkitStage.addBlockToCut(is);
|
||||||
} else {
|
} else {
|
||||||
throw new StageFormatException("'cut-block-names' has invalid item name " + name, quest, stageNum);
|
throw new StageFormatException("'cut-block-names' has invalid item name " + name, quest, stageNum);
|
||||||
|
Loading…
Reference in New Issue
Block a user