Merge remote-tracking branch 'origin/1.17' into 1.17

This commit is contained in:
CreepyCre 2021-02-16 11:19:58 +01:00
commit 8b84a21d99
4 changed files with 46 additions and 12 deletions

1
.gitignore vendored
View file

@ -29,3 +29,4 @@ Thumbs.db
remappedSrc
logs
*.hprof
generated

View file

@ -45,6 +45,10 @@ repositories {
name = "Ladysnake Libs"
url = "https://dl.bintray.com/ladysnake/libs"
}
maven {
url = "https://maven.shedaniel.me/"
}
}
def includeCompile(group, artifact, version) {
@ -73,6 +77,17 @@ def includeCompile(group, artifact, version) {
}
}
sourceSets {
main {
java {
srcDir "src/main/schematics"
srcDir "src/main/registry"
srcDir "src/main/config"
}
}
datagen
}
dependencies {
minecraft "com.mojang:minecraft:21w06a"
mappings "net.fabricmc:yarn:21w06a+build.3:v2"
@ -101,6 +116,10 @@ dependencies {
modCompileOnly 'com.github.badasintended:wthit:3.0.0'
modRuntime 'com.github.badasintended:wthit:3.0.0'
datagenImplementation sourceSets.main.output
datagenImplementation sourceSets.main.compileClasspath
datagenImplementation "me.shedaniel.cloth.api:cloth-datagen-api-v1:2.0.0"
testImplementation('org.junit.jupiter:junit-jupiter:5.5.2')
}
@ -114,16 +133,6 @@ static def computeVersion(String version) {
return version
}
sourceSets {
main {
java {
srcDir "src/main/schematics"
srcDir "src/main/registry"
srcDir "src/main/config"
}
}
}
processResources {
filesMatching("fabric.mod.json") {
expand "version": project.version

View file

@ -0,0 +1,24 @@
package org.dimdev.dimdoors.datagen;
import java.nio.file.Paths;
import java.util.Map;
import me.shedaniel.cloth.api.datagen.v1.DataGeneratorHandler;
import me.shedaniel.cloth.api.datagen.v1.RecipeData;
import org.dimdev.dimdoors.block.ModBlocks;
import org.dimdev.dimdoors.item.ModItems;
import net.minecraft.block.Block;
import net.minecraft.util.DyeColor;
public class DatagenInitializer {
public static void main(String[] args) {
ModBlocks.init();
ModItems.init();
DataGeneratorHandler handler = DataGeneratorHandler.create(Paths.get("./generated"));
RecipeData recipes = handler.getRecipes();
for (Map.Entry<DyeColor, Block> entry : ModBlocks.FABRIC_BLOCKS.entrySet()) {
// TODO
}
}
}

View file

@ -19,8 +19,8 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
public final class ModBlocks {
private static final Map<String, Block> BLOCKS = Maps.newLinkedHashMap();
private static final Map<DyeColor, Block> FABRIC_BLOCKS = new HashMap<>();
private static final Map<DyeColor, Block> ANCIENT_FABRIC_BLOCKS = new HashMap<>();
public static final Map<DyeColor, Block> FABRIC_BLOCKS = new HashMap<>();
public static final Map<DyeColor, Block> ANCIENT_FABRIC_BLOCKS = new HashMap<>();
public static final Block GOLD_DOOR = register("dimdoors:gold_door", new DoorBlock(FabricBlockSettings.of(Material.METAL, MapColor.GOLD).nonOpaque()));
public static final Block QUARTZ_DOOR = register("dimdoors:quartz_door", new DoorBlock(FabricBlockSettings.of(Material.STONE, MapColor.OFF_WHITE).nonOpaque()));