Add option to load loottables as challenge rewards.
This commit is contained in:
parent
0957308a12
commit
7bec99b78e
|
|
@ -5,7 +5,9 @@ plugins {
|
|||
|
||||
dependencies {
|
||||
implementation(project(":api")) // API
|
||||
compileOnly("com.alttd:Comet-API:1.20.4-R0.1-SNAPSHOT")
|
||||
compileOnly("com.alttd:Comet-API:1.20.4-R0.1-SNAPSHOT") {
|
||||
isChanging = true
|
||||
}
|
||||
|
||||
compileOnly("org.projectlombok:lombok:1.18.24")
|
||||
annotationProcessor("org.projectlombok:lombok:1.18.24")
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.alttd.cometskyblock.api.challenges.ChallengeDifficulty;
|
|||
import com.alttd.cometskyblock.api.challenges.ChallengeType;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
|
@ -135,6 +136,10 @@ public class ChallengeLoader extends YamlConfiguration {
|
|||
plugin.getLogger().warning(String.format("Could not make itemstack for item %s, invalid separator", currentItem));
|
||||
continue;
|
||||
}
|
||||
if (strings[0].equalsIgnoreCase("loottable")) {
|
||||
itemStacks.add(Bukkit.lootTableItem(strings[1]));
|
||||
continue;
|
||||
}
|
||||
if (!isNumber(strings[1])) {
|
||||
plugin.getLogger().warning(String.format("Could not make itemstack for item %s, %s is not an int", currentItem, strings[1]));
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user