mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Fix build and slightly adjust documentation
This commit is contained in:
parent
9a40e5de09
commit
8c8c46bf92
2 changed files with 5 additions and 2 deletions
|
@ -32,6 +32,7 @@ import org.geysermc.geyser.item.Items;
|
|||
import org.geysermc.geyser.registry.Registries;
|
||||
import org.geysermc.geyser.session.cache.registry.RegistryEntryContext;
|
||||
import org.geysermc.geyser.session.cache.tags.HolderSet;
|
||||
import org.geysermc.geyser.session.cache.tags.TagRegistry;
|
||||
import org.geysermc.geyser.translator.text.MessageTranslator;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
@ -55,12 +56,12 @@ public record Enchantment(String identifier,
|
|||
NbtMap data = context.data();
|
||||
Set<EnchantmentComponent> effects = readEnchantmentComponents(data.getCompound("effects"));
|
||||
|
||||
HolderSet supportedItems = HolderSet.readHolderSet(data.get("supported_items"), itemId -> Registries.JAVA_ITEM_IDENTIFIERS.getOrDefault(itemId.asString(), Items.AIR).javaId());
|
||||
HolderSet supportedItems = HolderSet.readHolderSet(TagRegistry.ITEM, data.get("supported_items"), itemId -> Registries.JAVA_ITEM_IDENTIFIERS.getOrDefault(itemId.asString(), Items.AIR).javaId());
|
||||
|
||||
int maxLevel = data.getInt("max_level");
|
||||
int anvilCost = data.getInt("anvil_cost");
|
||||
|
||||
HolderSet exclusiveSet = HolderSet.readHolderSet(data.get("exclusive_set"), context::getNetworkId);
|
||||
HolderSet exclusiveSet = HolderSet.readHolderSet(TagRegistry.ENCHANTMENT, data.get("exclusive_set"), context::getNetworkId);
|
||||
|
||||
BedrockEnchantment bedrockEnchantment = BedrockEnchantment.getByJavaIdentifier(context.id().asString());
|
||||
|
||||
|
|
|
@ -36,6 +36,8 @@ import org.geysermc.geyser.session.cache.TagCache;
|
|||
/**
|
||||
* Similar to vanilla Minecraft's HolderSets, stores either a tag or a list of IDs (this list can also be represented as a single ID in vanilla HolderSets).
|
||||
*
|
||||
* Because HolderSets utilise tags, when loading a HolderSet, Geyser must store tags for the registry the HolderSet is for (it must be listed in {@link TagRegistry}).
|
||||
*
|
||||
* Use the {@link HolderSet#readHolderSet} method to easily read a HolderSet from NBT sent by a server. To turn the HolderSet into a list of network IDs, use the {@link HolderSet#resolve} method.
|
||||
*/
|
||||
@Data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue