Skip to content

Commit

Permalink
Add painted wood block variants, fix EMI recipe defaults generator
Browse files Browse the repository at this point in the history
  • Loading branch information
Juuxel committed Aug 19, 2024
1 parent 760bfe9 commit e010897
Show file tree
Hide file tree
Showing 1,320 changed files with 37,110 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public void setupForPlatform() {
public void setupForPlatform(@Nullable File generatedResources) {
var project = getProject();
project.getTasks().named("generateEmi", GenerateEmi.class, task -> {
task.mustRunAfter(project.project(":common").getTasks().named("generateData"));
var resourceDirs = new ArrayList<>(getSourceSets(project.project(":common")).getByName("main").getResources().getSrcDirs());
resourceDirs.addAll(getSourceSets(project).getByName("main").getResources().getSrcDirs());

Expand All @@ -29,11 +28,11 @@ public void setupForPlatform(@Nullable File generatedResources) {
if (dir.equals(generatedResources)) continue;

task.getRecipes().from(project.fileTree(dir, tree -> {
tree.include("data/adorn/recipes/**");
tree.include("data/adorn/recipe/**");

// The unpacking recipes create "uncraftable" vanilla items like
// nether wart, so exclude them.
tree.exclude("data/adorn/recipes/crates/unpack/**");
tree.exclude("data/adorn/recipe/crates/unpack/**");
}));
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import java.util.stream.Collectors;

public abstract class GenerateEmi extends DefaultTask {
private static final String RECIPE_DIR = "/data/adorn/recipes/";
private static final String RECIPE_DIR = "/data/adorn/recipe/";

@InputFiles
public abstract ConfigurableFileCollection getRecipes();
Expand Down Expand Up @@ -86,7 +86,7 @@ public void generateRecipeDefaults() throws IOException {
var type = fixType(recipeJson.get("type").toString());
return switch (type) {
case "minecraft:crafting_shaped", "minecraft:crafting_shapeless", "adorn:brewing", "adorn:brewing_from_fluid" ->
((Map<String, ?>) recipeJson.get("result")).get("item").toString();
((Map<String, ?>) recipeJson.get("result")).get("id").toString();

case "minecraft:stonecutting" -> recipeJson.get("result").toString();
case "adorn:fertilizer_refilling" -> null;
Expand Down
2 changes: 1 addition & 1 deletion common/src/data/vanilla.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<data_generators wool="true">
<data_generators color="true">
<wood id="minecraft:oak"/>
<wood id="minecraft:spruce"/>
<wood id="minecraft:birch">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"multipart": [
{
"when": { "axis": "x" },
"apply": { "model": "adorn:block/black_bench_top" }
},
{
"when": { "axis": "z" },
"apply": { "model": "adorn:block/black_bench_top", "y": 90 }
},
{
"when": { "axis": "x", "connected_n": false },
"apply": { "model": "adorn:block/black_bench_leg" }
},
{
"when": { "axis": "x", "connected_p": false },
"apply": { "model": "adorn:block/black_bench_leg", "y": 180 }
},
{
"when": { "axis": "z", "connected_n": false },
"apply": { "model": "adorn:block/black_bench_leg", "y": 90 }
},
{
"when": { "axis": "z", "connected_p": false },
"apply": { "model": "adorn:block/black_bench_leg", "y": 270 }
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
{
"multipart": [
{
"apply": {
"model": "adorn:block/black_chair_upper",
"y": 270
},
"when": {
"half": "upper",
"facing": "north"
}
},
{
"apply": {
"model": "adorn:block/black_chair_upper"
},
"when": {
"half": "upper",
"facing": "east"
}
},
{
"apply": {
"model": "adorn:block/black_chair_upper",
"y": 90
},
"when": {
"half": "upper",
"facing": "south"
}
},
{
"apply": {
"model": "adorn:block/black_chair_upper",
"y": 180
},
"when": {
"half": "upper",
"facing": "west"
}
},
{
"apply": {
"model": "adorn:block/black_chair_lower",
"y": 270
},
"when": {
"half": "lower",
"facing": "north"
}
},
{
"apply": {
"model": "adorn:block/black_chair_lower"
},
"when": {
"half": "lower",
"facing": "east"
}
},
{
"apply": {
"model": "adorn:block/black_chair_lower",
"y": 90
},
"when": {
"half": "lower",
"facing": "south"
}
},
{
"apply": {
"model": "adorn:block/black_chair_lower",
"y": 180
},
"when": {
"half": "lower",
"facing": "west"
}
},
{
"apply": {
"model": "minecraft:block/red_carpet"
},
"when": {
"carpet": "red"
}
},
{
"apply": {
"model": "minecraft:block/black_carpet"
},
"when": {
"carpet": "black"
}
},
{
"apply": {
"model": "minecraft:block/green_carpet"
},
"when": {
"carpet": "green"
}
},
{
"apply": {
"model": "minecraft:block/brown_carpet"
},
"when": {
"carpet": "brown"
}
},
{
"apply": {
"model": "minecraft:block/blue_carpet"
},
"when": {
"carpet": "blue"
}
},
{
"apply": {
"model": "minecraft:block/purple_carpet"
},
"when": {
"carpet": "purple"
}
},
{
"apply": {
"model": "minecraft:block/cyan_carpet"
},
"when": {
"carpet": "cyan"
}
},
{
"apply": {
"model": "minecraft:block/light_gray_carpet"
},
"when": {
"carpet": "light_gray"
}
},
{
"apply": {
"model": "minecraft:block/gray_carpet"
},
"when": {
"carpet": "gray"
}
},
{
"apply": {
"model": "minecraft:block/pink_carpet"
},
"when": {
"carpet": "pink"
}
},
{
"apply": {
"model": "minecraft:block/lime_carpet"
},
"when": {
"carpet": "lime"
}
},
{
"apply": {
"model": "minecraft:block/yellow_carpet"
},
"when": {
"carpet": "yellow"
}
},
{
"apply": {
"model": "minecraft:block/light_blue_carpet"
},
"when": {
"carpet": "light_blue"
}
},
{
"apply": {
"model": "minecraft:block/magenta_carpet"
},
"when": {
"carpet": "magenta"
}
},
{
"apply": {
"model": "minecraft:block/orange_carpet"
},
"when": {
"carpet": "orange"
}
},
{
"apply": {
"model": "minecraft:block/white_carpet"
},
"when": {
"carpet": "white"
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "adorn:block/black_coffee_table"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"variants": {
"facing=north": {
"model": "adorn:block/black_drawer"
},
"facing=east": {
"model": "adorn:block/black_drawer",
"y": 90
},
"facing=south": {
"model": "adorn:block/black_drawer",
"y": 180
},
"facing=west": {
"model": "adorn:block/black_drawer",
"y": 270
}
}
}
Loading

0 comments on commit e010897

Please sign in to comment.