Draft
Conversation
| public static org.bukkit.loot.LootTable minecraftToBukkit(ResourceKey<LootTable> minecraft) { | ||
| return (minecraft == null) ? null : Bukkit.getLootTable(CraftLootTable.minecraftToBukkitKey(minecraft)); | ||
| } | ||
| private static final org.bukkit.loot.LootTable EMPTY = new CraftLootTable(Holder.direct(LootTable.EMPTY)); // todo expose? |
Member
There was a problem hiding this comment.
Exposing this boils down to, I think, if there is a difference between using null and EMPTY in different places. Like its possible there is a distinction in different places, a loot table being set to empty vs not having one. If there is a difference, then we probably need to expose it.
| this.key = key; | ||
| public static org.bukkit.loot.LootTable minecraftToBukkit(LootTable minecraft) { | ||
| if (minecraft == LootTable.EMPTY) { | ||
| return EMPTY; |
Member
There was a problem hiding this comment.
Ok, well ignore my other comment. If we are going to return the EMPTY one, they we probably should also expose it. People need to be able to check if they one they have is the empty one. Does vanilla do a == check in places to compare it? regardless, we need to have an easy way to know if its the empty, or use null to mean empty (don't really like that)
makes it consistent with the upcoming loot context api
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.