Skip to content

Commit

Permalink
fix misplaced parenthesis
Browse files Browse the repository at this point in the history
  • Loading branch information
woodiertexas committed Jan 24, 2025
1 parent c4e93b9 commit 0965a1b
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,44 +92,44 @@ private static void generateModels(TypedGroupedBlock block) {
if (rawModel.contains(textureId)) model.addTexture(textureId, textureConfiguration.apply(block.type(), textureId));
}

ArchitectureExtensions.RESOURCE_PACK.putTextAsync(ResourceType.CLIENT_RESOURCES, Identifier.of(MOD_ID, (modelId.getNamespace(), modelId.getPath() + variant + ".json"), path -> model.serialize().toString());
ArchitectureExtensions.RESOURCE_PACK.putTextAsync(ResourceType.CLIENT_RESOURCES, Identifier.of(MOD_ID, modelId.getNamespace() + modelId.getPath() + variant + ".json"), path -> model.serialize().toString());
}

var itemModel = "{\"parent\":\"" + modelId.toString().replaceFirst("models/", "") + "\"}";
ArchitectureExtensions.RESOURCE_PACK.putText(ResourceType.CLIENT_RESOURCES, Identifier.of(MOD_ID, (modelId.getNamespace(), modelId.getPath().replaceFirst("block", "item") + ".json"), itemModel);
ArchitectureExtensions.RESOURCE_PACK.putText(ResourceType.CLIENT_RESOURCES, Identifier.of(MOD_ID, modelId.getNamespace() + modelId.getPath().replaceFirst("block", "item") + ".json"), itemModel);
}

private static void generateBlockState(TypedGroupedBlock block) {
var rawBlockState = getBlockStateTemplate(block.type());
if (rawBlockState == null) return;
var blockState = new BlockStateTemplate(rawBlockState);
blockState.addConstant(MODEL_PLACEHOLDER, Identifier.of(MOD_ID, (block.id().getNamespace(), "block/" + block.id().getPath()).toString());
blockState.addConstant(MODEL_PLACEHOLDER, Identifier.of(MOD_ID, block.id().getNamespace()) + "block/" + block.id().getPath()).toString();
ArchitectureExtensions.RESOURCE_PACK.putTextAsync(ResourceType.CLIENT_RESOURCES, Identifier.of(MOD_ID, (block.id().getNamespace(), "blockstates/" + block.id().getPath() + ".json"), path -> blockState.serialize().toString());
}

private static void generateMineableByPickaxeTag() {
var tag = TagTemplate.DEFAULT.get();
BLOCKS.forEach(block -> { if (BlockContentRegistries.STRIPPABLE.get(block.groupedBlock().baseBlock().get()).isEmpty()) tag.addValue(block.id().toString()); });
ArchitectureExtensions.RESOURCE_PACK.putTextAsync(ResourceType.SERVER_DATA, Identifier.of(MOD_ID, ("tags/blocks/mineable/pickaxe.json"), path -> tag.serialize().toString());
ArchitectureExtensions.RESOURCE_PACK.putTextAsync(ResourceType.SERVER_DATA, Identifier.of(MOD_ID, "tags/blocks/mineable/pickaxe.json"), path -> tag.serialize().toString());
}

private static void generateMineableByAxeTag() {
var tag = TagTemplate.DEFAULT.get();
BLOCKS.forEach(block -> { if (BlockContentRegistries.STRIPPABLE.get(block.groupedBlock().baseBlock().get()).isPresent()) tag.addValue(block.id().toString()); });
ArchitectureExtensions.RESOURCE_PACK.putTextAsync(ResourceType.SERVER_DATA, Identifier.of(MOD_ID, ("tags/blocks/mineable/axe.json"), path -> tag.serialize().toString());
ArchitectureExtensions.RESOURCE_PACK.putTextAsync(ResourceType.SERVER_DATA, Identifier.of(MOD_ID, "tags/blocks/mineable/axe.json"), path -> tag.serialize().toString());
}

private static void generateNeedsStoneToolTag() {
var tag = TagTemplate.DEFAULT.get();
BLOCKS.forEach(block -> tag.addValue(block.id().toString()));
ArchitectureExtensions.RESOURCE_PACK.putTextAsync(ResourceType.SERVER_DATA, Identifier.of(MOD_ID, ("tags/blocks/needs_stone_tool.json"), path -> tag.serialize().toString());
ArchitectureExtensions.RESOURCE_PACK.putTextAsync(ResourceType.SERVER_DATA, Identifier.of(MOD_ID, "tags/blocks/needs_stone_tool.json"), path -> tag.serialize().toString());
}

private static void generateLootTables() {
for (TypedGroupedBlock block : BLOCKS) {
var lootTable = LootTableTemplate.BLOCK_BREAK.get();
lootTable.addPool(JPool.ofItems(block.id()).addCondition(JCondition.SURVIVES_EXPLOSION.get()));
ArchitectureExtensions.RESOURCE_PACK.putTextAsync(ResourceType.SERVER_DATA, Identifier.of(MOD_ID, (block.id().getNamespace(), "loot_tables/blocks/" + block.id().getPath() + ".json"), path -> lootTable.serialize().toString());
ArchitectureExtensions.RESOURCE_PACK.putTextAsync(ResourceType.SERVER_DATA, Identifier.of(MOD_ID, block.id().getNamespace() + "loot_tables/blocks/" + block.id().getPath() + ".json"), path -> lootTable.serialize().toString());
}
}

Expand All @@ -148,7 +148,7 @@ private static void generateRecipes() {

final var path = template.tablesaw() ? "custom_recipes/tablesaw/" : "recipes/";
final var prefix = template.simple() ? "" : block.id().getPath() + "_";
ArchitectureExtensions.RESOURCE_PACK.putTextAsync(ResourceType.SERVER_DATA, Identifier.of(MOD_ID, (block.id().getNamespace(), path + prefix + template.id() + ".json"), blah -> recipe.serialize().toString());
ArchitectureExtensions.RESOURCE_PACK.putTextAsync(ResourceType.SERVER_DATA, Identifier.of(MOD_ID, block.id().getNamespace() + path + prefix + template.id() + ".json"), blah -> recipe.serialize().toString());
}
templates.clear();
}
Expand Down

0 comments on commit 0965a1b

Please sign in to comment.