Class MappingsReader_v1
java.lang.Object
org.geysermc.geyser.registry.mappings.versions.MappingsReader
org.geysermc.geyser.registry.mappings.versions.MappingsReader_v1
A class responsible for reading custom item and block mappings from a JSON file
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionreadBlockMappingEntry(String identifier, com.fasterxml.jackson.databind.JsonNode node) Read a block mapping entry from a JSON node and Java identifiervoidreadBlockMappings(Path file, com.fasterxml.jackson.databind.JsonNode mappingsRoot, BiConsumer<String, CustomBlockMapping> consumer) Read item block from a JSON nodevoidreadBlockMappingsV1(Path file, com.fasterxml.jackson.databind.JsonNode mappingsRoot, BiConsumer<String, CustomBlockMapping> consumer) Read block mappings from a JSON nodeorg.geysermc.geyser.api.item.custom.CustomItemDatareadItemMappingEntry(com.fasterxml.jackson.databind.JsonNode node) voidreadItemMappings(Path file, com.fasterxml.jackson.databind.JsonNode mappingsRoot, BiConsumer<String, org.geysermc.geyser.api.item.custom.CustomItemData> consumer) voidreadItemMappingsV1(Path file, com.fasterxml.jackson.databind.JsonNode mappingsRoot, BiConsumer<String, org.geysermc.geyser.api.item.custom.CustomItemData> consumer) Methods inherited from class org.geysermc.geyser.registry.mappings.versions.MappingsReader
fromJsonNode, getHandOffsets, getOffsetXYZ, getPerspectiveOffsets
-
Constructor Details
-
MappingsReader_v1
public MappingsReader_v1()
-
-
Method Details
-
readItemMappings
public void readItemMappings(Path file, com.fasterxml.jackson.databind.JsonNode mappingsRoot, BiConsumer<String, org.geysermc.geyser.api.item.custom.CustomItemData> consumer) - Specified by:
readItemMappingsin classMappingsReader
-
readBlockMappings
public void readBlockMappings(Path file, com.fasterxml.jackson.databind.JsonNode mappingsRoot, BiConsumer<String, CustomBlockMapping> consumer) Read item block from a JSON node- Specified by:
readBlockMappingsin classMappingsReader- Parameters:
file- The path to the filemappingsRoot- TheJsonNodecontaining the mappingsconsumer- The consumer to accept the mappings- See Also:
-
readItemMappingsV1
public void readItemMappingsV1(Path file, com.fasterxml.jackson.databind.JsonNode mappingsRoot, BiConsumer<String, org.geysermc.geyser.api.item.custom.CustomItemData> consumer) -
readBlockMappingsV1
public void readBlockMappingsV1(Path file, com.fasterxml.jackson.databind.JsonNode mappingsRoot, BiConsumer<String, CustomBlockMapping> consumer) Read block mappings from a JSON node- Parameters:
file- The path to the filemappingsRoot- TheJsonNodecontaining the mappingsconsumer- The consumer to accept the mappings- See Also:
-
readItemMappingEntry
public org.geysermc.geyser.api.item.custom.CustomItemData readItemMappingEntry(com.fasterxml.jackson.databind.JsonNode node) throws InvalidCustomMappingsFileException - Specified by:
readItemMappingEntryin classMappingsReader- Throws:
InvalidCustomMappingsFileException
-
readBlockMappingEntry
public CustomBlockMapping readBlockMappingEntry(String identifier, com.fasterxml.jackson.databind.JsonNode node) throws InvalidCustomMappingsFileException Read a block mapping entry from a JSON node and Java identifier- Specified by:
readBlockMappingEntryin classMappingsReader- Parameters:
identifier- The Java identifier of the blocknode- TheJsonNodecontaining the block mapping entry- Returns:
- The
CustomBlockMappingrecord to be read byCustomBlockRegistryPopulator - Throws:
InvalidCustomMappingsFileException- If the JSON node is invalid
-