Skip to content

Commit

Permalink
cleanups related to last PR
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jun 24, 2022
1 parent 725632b commit 1f14fd2
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 76 deletions.
Expand Up @@ -4117,7 +4117,7 @@ else if (getBukkitEntity() instanceof Creeper) {

// <--[mechanism]
// @object EntityTag
// @name loot_table
// @name loot_table_id
// @input ElementTag
// @description
// Sets the loot table of a lootable entity.
Expand All @@ -4133,7 +4133,12 @@ else if (getBukkitEntity() instanceof Creeper) {
mechanism.echoError("'loot_table_id' is only valid for lootable entities.");
return;
}
((Lootable) getBukkitEntity()).setLootTable(Bukkit.getLootTable(Utilities.parseNamespacedKey(mechanism.getValue().asString())));
LootTable table = Bukkit.getLootTable(Utilities.parseNamespacedKey(mechanism.getValue().asString()));
if (table == null) {
mechanism.echoError("Invalid loot table ID.");
return;
}
((Lootable) getBukkitEntity()).setLootTable(table);
}

CoreUtilities.autoPropertyMechanism(this, mechanism);
Expand Down

0 comments on commit 1f14fd2

Please sign in to comment.