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.google.gson.JsonElement element) Read a block mapping entry from a JSON node and Java identifiervoidreadBlockMappings(Path file, com.google.gson.JsonObject mappingsRoot, BiConsumer<String, CustomBlockMapping> consumer) Read item block from a JSON nodevoidreadBlockMappingsV1(Path file, com.google.gson.JsonObject mappingsRoot, BiConsumer<String, CustomBlockMapping> consumer) Read block mappings from a JSON nodeorg.geysermc.geyser.api.item.custom.v2.CustomItemDefinitionreadItemMappingEntry(org.geysermc.geyser.api.util.Identifier identifier, com.google.gson.JsonElement element) Deprecated.voidreadItemMappings(Path file, com.google.gson.JsonObject mappingsRoot, BiConsumer<org.geysermc.geyser.api.util.Identifier, org.geysermc.geyser.api.item.custom.v2.CustomItemDefinition> consumer) Deprecated.voidreadItemMappingsV1(Path file, com.google.gson.JsonObject mappingsRoot, BiConsumer<org.geysermc.geyser.api.util.Identifier, org.geysermc.geyser.api.item.custom.v2.CustomItemDefinition> consumer) Deprecated.Methods inherited from class org.geysermc.geyser.registry.mappings.versions.MappingsReader
fromJsonObject, getHandOffsets, getOffsetXYZ, getPerspectiveOffsets
-
Constructor Details
-
MappingsReader_v1
public MappingsReader_v1()
-
-
Method Details
-
readItemMappings
@Deprecated public void readItemMappings(Path file, com.google.gson.JsonObject mappingsRoot, BiConsumer<org.geysermc.geyser.api.util.Identifier, org.geysermc.geyser.api.item.custom.v2.CustomItemDefinition> consumer) Deprecated.- Specified by:
readItemMappingsin classMappingsReader
-
readBlockMappings
public void readBlockMappings(Path file, com.google.gson.JsonObject mappingsRoot, BiConsumer<String, CustomBlockMapping> consumer) Read item block from a JSON node- Specified by:
readBlockMappingsin classMappingsReader- Parameters:
file- The path to the filemappingsRoot- TheJsonObjectcontaining the mappingsconsumer- The consumer to accept the mappings- See Also:
-
readItemMappingsV1
@Deprecated public void readItemMappingsV1(Path file, com.google.gson.JsonObject mappingsRoot, BiConsumer<org.geysermc.geyser.api.util.Identifier, org.geysermc.geyser.api.item.custom.v2.CustomItemDefinition> consumer) Deprecated. -
readBlockMappingsV1
public void readBlockMappingsV1(Path file, com.google.gson.JsonObject mappingsRoot, BiConsumer<String, CustomBlockMapping> consumer) Read block mappings from a JSON node- Parameters:
file- The path to the filemappingsRoot- TheJsonObjectcontaining the mappingsconsumer- The consumer to accept the mappings- See Also:
-
readItemMappingEntry
@Deprecated public org.geysermc.geyser.api.item.custom.v2.CustomItemDefinition readItemMappingEntry(org.geysermc.geyser.api.util.Identifier identifier, com.google.gson.JsonElement element) throws InvalidCustomMappingsFileException Deprecated.- Specified by:
readItemMappingEntryin classMappingsReader- Throws:
InvalidCustomMappingsFileException
-
readBlockMappingEntry
public CustomBlockMapping readBlockMappingEntry(String identifier, com.google.gson.JsonElement element) 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 blockelement- TheJsonObjectcontaining the block mapping entry- Returns:
- The
CustomBlockMappingrecord to be read byCustomBlockRegistryPopulator - Throws:
InvalidCustomMappingsFileException- If the JSON node is invalid
-