From 8c57ae4a4e73cce683b21db044ed42d46d99ee18 Mon Sep 17 00:00:00 2001 From: Yan Chubikov Date: Thu, 15 Jul 2021 23:59:12 +0200 Subject: [PATCH] DashLoader compatibility (#2453). Thanks to alphaqu --- build.gradle | 8 ++++++ .../DashDynamicBucketBakedModel.java | 26 +++++++++++++++++++ .../dashloader/DashDynamicCellBakedModel.java | 26 +++++++++++++++++++ src/main/resources/fabric.mod.json | 6 +++++ 4 files changed, 66 insertions(+) create mode 100644 src/main/java/techreborn/compat/dashloader/DashDynamicBucketBakedModel.java create mode 100644 src/main/java/techreborn/compat/dashloader/DashDynamicCellBakedModel.java diff --git a/build.gradle b/build.gradle index f606eb1d1..f3bc531d1 100644 --- a/build.gradle +++ b/build.gradle @@ -34,6 +34,12 @@ repositories { includeGroup "curse.maven" } } + maven { + url = "https://maven.oskarstrom.net" + content { + includeGroup "net.oskarstrom" + } + } maven { url "https://maven.shedaniel.me/" } @@ -146,6 +152,8 @@ dependencies { optionalDependency "me.shedaniel:RoughlyEnoughItems-fabric:6.0.262-alpha" disabledOptionalDependency ('com.github.emilyploszaj:trinkets:2.6.7') disabledOptionalDependency "com.github.dexman545:autoswitch-api:-SNAPSHOT" + optionalDependency 'net.oskarstrom:DashLoader:2.0' + } def optionalDependency(String dep) { diff --git a/src/main/java/techreborn/compat/dashloader/DashDynamicBucketBakedModel.java b/src/main/java/techreborn/compat/dashloader/DashDynamicBucketBakedModel.java new file mode 100644 index 000000000..c26e90c59 --- /dev/null +++ b/src/main/java/techreborn/compat/dashloader/DashDynamicBucketBakedModel.java @@ -0,0 +1,26 @@ +package techreborn.compat.dashloader; + +import net.oskarstrom.dashloader.DashRegistry; +import net.oskarstrom.dashloader.api.annotation.DashConstructor; +import net.oskarstrom.dashloader.api.annotation.DashObject; +import net.oskarstrom.dashloader.api.enums.ConstructorMode; +import net.oskarstrom.dashloader.model.DashModel; +import techreborn.client.render.DynamicBucketBakedModel; + +@DashObject(DynamicBucketBakedModel.class) +public class DashDynamicBucketBakedModel implements DashModel { + + @DashConstructor(ConstructorMode.EMPTY) + public DashDynamicBucketBakedModel() { + } + + @Override + public DynamicBucketBakedModel toUndash(DashRegistry registry) { + return new DynamicBucketBakedModel(); + } + + @Override + public int getStage() { + return 0; + } +} diff --git a/src/main/java/techreborn/compat/dashloader/DashDynamicCellBakedModel.java b/src/main/java/techreborn/compat/dashloader/DashDynamicCellBakedModel.java new file mode 100644 index 000000000..c2547d4a0 --- /dev/null +++ b/src/main/java/techreborn/compat/dashloader/DashDynamicCellBakedModel.java @@ -0,0 +1,26 @@ +package techreborn.compat.dashloader; + +import net.oskarstrom.dashloader.DashRegistry; +import net.oskarstrom.dashloader.api.annotation.DashConstructor; +import net.oskarstrom.dashloader.api.annotation.DashObject; +import net.oskarstrom.dashloader.api.enums.ConstructorMode; +import net.oskarstrom.dashloader.model.DashModel; +import techreborn.client.render.DynamicCellBakedModel; + +@DashObject(DynamicCellBakedModel.class) +public class DashDynamicCellBakedModel implements DashModel { + + @DashConstructor(ConstructorMode.EMPTY) + public DashDynamicCellBakedModel() { + } + + @Override + public DynamicCellBakedModel toUndash(DashRegistry registry) { + return new DynamicCellBakedModel(); + } + + @Override + public int getStage() { + return 0; + } +} diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 020641b5d..52345de5c 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -26,6 +26,12 @@ "techreborn.compat.autoswitch.AutoSwitchApiImpl" ] }, + "custom": { + "dashloader:customobject": [ + "techreborn.compat.dashloader.DashDynamicBucketBakedModel", + "techreborn.compat.dashloader.DashDynamicCellBakedModel" + ] + }, "depends": { "fabricloader": ">=0.11.3", "fabric": ">=0.34.10",