Skip to content

Commit

Permalink
Whoops almost removed v2 mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
eclipseisoffline committed Jan 19, 2025
1 parent a7fbcc6 commit 0ae556c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.geysermc.geyser.registry.mappings.util.CustomBlockMapping;
import org.geysermc.geyser.registry.mappings.versions.MappingsReader;
import org.geysermc.geyser.registry.mappings.versions.MappingsReader_v1;
import org.geysermc.geyser.registry.mappings.versions.MappingsReader_v2;

import java.io.FileReader;
import java.io.IOException;
Expand All @@ -48,6 +49,7 @@ public class MappingsConfigReader {

public MappingsConfigReader() {
this.mappingReaders.put(1, new MappingsReader_v1());
this.mappingReaders.put(2, new MappingsReader_v2());
}

public Path[] getCustomMappingsFiles() {
Expand Down Expand Up @@ -75,7 +77,7 @@ public boolean ensureMappingsDirectory(Path mappingsDirectory) {
return true;
}

public void loadItemMappingsFromJson(BiConsumer<String, CustomItemData> consumer) {
public void loadItemMappingsFromJson(BiConsumer<String, CustomItemDefinition> consumer) {
if (!ensureMappingsDirectory(this.customMappingsDirectory)) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ private void readItemDefinitionEntry(JsonElement data, String itemIdentifier, Id
// Read model of group if it's present, or default to the model of the parent group, if that's present
// If the parent group model is not present (or there is no parent group), and this group also doesn't have a model, then it is expected the definitions supply their model themselves
Identifier groupModel = MappingsUtil.readOrDefault(data, "model", NodeReader.IDENTIFIER, model, context);

// The method above should have already thrown a properly formatted error if data is not a JSON object
JsonElement definitions = data.getAsJsonObject().get("definitions");

Expand Down Expand Up @@ -171,8 +172,6 @@ private CustomItemBedrockOptions.Builder readBedrockOptions(JsonElement element,
MappingsUtil.readIfPresent(element, "protection_value", builder::protectionValue, NodeReader.NON_NEGATIVE_INT, context);
MappingsUtil.readIfPresent(element, "creative_category", builder::creativeCategory, NodeReader.CREATIVE_CATEGORY, context);
MappingsUtil.readIfPresent(element, "creative_group", builder::creativeGroup, NodeReader.NON_EMPTY_STRING, context);
MappingsUtil.readIfPresent(element, "texture_size", builder::textureSize, NodeReader.POSITIVE_INT, context);
MappingsUtil.readIfPresent(element, "render_offsets", builder::renderOffsets, MappingsReader::fromJsonObject, context);

if (element.getAsJsonObject().get("tags") instanceof JsonArray tags) {
Set<String> tagsSet = new ObjectOpenHashSet<>();
Expand Down

0 comments on commit 0ae556c

Please sign in to comment.