diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
new file mode 100644
index 00000000..113b6525
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -0,0 +1,54 @@
+name: Bug Report
+description: "For reporting bugs and other defects"
+body:
+ - type: markdown
+ attributes:
+ value: >-
+ **Note: This issue tracker is not intended for support requests!** If you need help with crashes or other issues, then
+ you should [ask on our Discord server](https://discord.gg/rN9Y7caguP) instead. Unless you are certain that you
+ have found a defect, and you are able to point to where the problem is, you should not open an issue.
+
+ Additionally, please make sure you have done the following:
+
+ - **Have you ensured that all of your mods (including ModernFix) are up-to-date?** The latest version of ModernFix
+ can always be found [on Modrinth](https://modrinth.com/mod/modernfix).
+
+ - **Have you used the [search tool](https://github.com/embeddedt/ModernFix/issues) to check whether your issue
+ has already been reported?** If it has been, then consider adding more information to the existing issue instead.
+
+ - **Have you determined the minimum set of instructions to reproduce the issue?** If your problem only occurs
+ with other mods installed, then you should narrow down exactly which mods are causing the issue. Please do not
+ provide your entire list of mods to us and expect that we will be able to figure out the problem.
+ - type: textarea
+ id: description
+ attributes:
+ label: Bug Description
+ description: >-
+ Use this section to describe the issue you are experiencing in as much depth as possible. The description should
+ explain what behavior you were expecting, and why you believe the issue to be a bug. If the issue you are reporting
+ only occurs with specific mods installed, then provide the name and version of each mod.
+
+ **Hint:** If you have any screenshots, videos, or other information that you feel is necessary to
+ explain the issue, you can attach them here.
+ - type: textarea
+ id: description-reproduction-steps
+ attributes:
+ label: Reproduction Steps
+ description: >-
+ Provide as much information as possible on how to reproduce this bug. Make sure your instructions are as clear and
+ concise as possible, because other people will need to be able to follow your guide in order to re-create the issue.
+
+ **Hint:** A common way to fill this section out is to write a step-by-step guide.
+ validations:
+ required: true
+ - type: textarea
+ id: log-file
+ attributes:
+ label: Log File
+ description: >-
+ **Hint:** You can usually find the log files within the folder `.minecraft/logs`. Most often, you will want the `latest.log`
+ file, since that file belongs to the last played session of the game.
+ placeholder: >-
+ Drag-and-drop the log file here.
+ validations:
+ required: true
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 00000000..2354f98d
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,6 @@
+blank_issues_enabled: true
+contact_links:
+ - name: For help with other issues, join our Discord community
+ url: https://discord.gg/rN9Y7caguP
+ about: This is the best option for getting help with mod installation, performance issues, and any other support inquiries
+ # Copied from https://github.com/CaffeineMC/sodium-fabric#community
diff --git a/common/src/main/java/org/embeddedt/modernfix/api/entrypoint/ModernFixClientIntegration.java b/common/src/main/java/org/embeddedt/modernfix/api/entrypoint/ModernFixClientIntegration.java
index aa3b78bc..8916c734 100644
--- a/common/src/main/java/org/embeddedt/modernfix/api/entrypoint/ModernFixClientIntegration.java
+++ b/common/src/main/java/org/embeddedt/modernfix/api/entrypoint/ModernFixClientIntegration.java
@@ -1,11 +1,11 @@
package org.embeddedt.modernfix.api.entrypoint;
-import net.minecraft.client.resources.model.BakedModel;
-import net.minecraft.client.resources.model.ModelBakery;
-import net.minecraft.client.resources.model.ModelState;
-import net.minecraft.client.resources.model.UnbakedModel;
+import net.minecraft.client.renderer.texture.TextureAtlasSprite;
+import net.minecraft.client.resources.model.*;
import net.minecraft.resources.ResourceLocation;
+import java.util.function.Function;
+
/**
* Implement this interface in a mod class and add it to "modernfix:integration_v1" in your mod metadata file
@@ -56,7 +56,22 @@ public interface ModernFixClientIntegration {
* with dynamic resources on
* @return the model which should actually be loaded for this resource location
*/
+ @Deprecated
default BakedModel onBakedModelLoad(ResourceLocation location, UnbakedModel baseModel, BakedModel originalModel, ModelState state, ModelBakery bakery) {
return originalModel;
}
+
+ /**
+ * Called to allow mods to observe the loading of a baked model and either make changes to it or wrap it with their
+ * own instance.
+ * @param location the ResourceLocation of the model (this may be a ModelResourceLocation)
+ * @param originalModel the original model
+ * @param bakery the model bakery - do not touch internal fields as they probably don't behave the way you expect
+ * with dynamic resources on
+ * @param textureGetter function to retrieve textures for this model
+ * @return the model which should actually be loaded for this resource location
+ */
+ default BakedModel onBakedModelLoad(ResourceLocation location, UnbakedModel baseModel, BakedModel originalModel, ModelState state, ModelBakery bakery, Function textureGetter) {
+ return onBakedModelLoad(location, baseModel, originalModel, state, bakery);
+ }
}
diff --git a/fabric/src/main/java/org/embeddedt/modernfix/fabric/mixin/perf/dynamic_resources/ModelBakerImplMixin.java b/fabric/src/main/java/org/embeddedt/modernfix/fabric/mixin/perf/dynamic_resources/ModelBakerImplMixin.java
index 2324eda4..9ed0bd79 100644
--- a/fabric/src/main/java/org/embeddedt/modernfix/fabric/mixin/perf/dynamic_resources/ModelBakerImplMixin.java
+++ b/fabric/src/main/java/org/embeddedt/modernfix/fabric/mixin/perf/dynamic_resources/ModelBakerImplMixin.java
@@ -120,7 +120,7 @@ public abstract class ModelBakerImplMixin implements IExtendedModelBaker {
BakedModel model = operation.call(unbakedModel, baker, spriteGetter, state, location);
for(ModernFixClientIntegration integration : ModernFixClient.CLIENT_INTEGRATIONS) {
- model = integration.onBakedModelLoad(location, unbakedModel, model, state, this.field_40571);
+ model = integration.onBakedModelLoad(location, unbakedModel, model, state, this.field_40571, spriteGetter);
}
return model;
diff --git a/fabric/src/main/java/org/embeddedt/modernfix/platform/fabric/ModernFixPlatformHooksImpl.java b/fabric/src/main/java/org/embeddedt/modernfix/platform/fabric/ModernFixPlatformHooksImpl.java
index e9e6ebcb..8b4d0a09 100644
--- a/fabric/src/main/java/org/embeddedt/modernfix/platform/fabric/ModernFixPlatformHooksImpl.java
+++ b/fabric/src/main/java/org/embeddedt/modernfix/platform/fabric/ModernFixPlatformHooksImpl.java
@@ -39,13 +39,11 @@ public class ModernFixPlatformHooksImpl implements ModernFixPlatformHooks {
return FabricLoader.getInstance().getEnvironmentType() == EnvType.SERVER;
}
- private static String verString;
+ private static final String verString = FabricLoader.getInstance().getModContainer("modernfix")
+ .map(mfModContainer -> mfModContainer.getMetadata().getVersion().getFriendlyString())
+ .orElse("[unknown]");
public String getVersionString() {
- if(verString == null) {
- ModContainer mfModContainer = FabricLoader.getInstance().getModContainer("modernfix").get();
- verString = mfModContainer.getMetadata().getVersion().getFriendlyString();
- }
return verString;
}
diff --git a/neoforge/src/main/java/org/embeddedt/modernfix/neoforge/mixin/perf/dynamic_resources/ModelBakerImplMixin.java b/neoforge/src/main/java/org/embeddedt/modernfix/neoforge/mixin/perf/dynamic_resources/ModelBakerImplMixin.java
index afbef46d..24171d2c 100644
--- a/neoforge/src/main/java/org/embeddedt/modernfix/neoforge/mixin/perf/dynamic_resources/ModelBakerImplMixin.java
+++ b/neoforge/src/main/java/org/embeddedt/modernfix/neoforge/mixin/perf/dynamic_resources/ModelBakerImplMixin.java
@@ -94,7 +94,7 @@ public abstract class ModelBakerImplMixin implements IModelBakerImpl, IExtendedM
BakedModel model = operation.call(unbakedModel, baker, spriteGetter, state, location);
for(ModernFixClientIntegration integration : ModernFixClient.CLIENT_INTEGRATIONS) {
- model = integration.onBakedModelLoad(location, unbakedModel, model, state, this.field_40571);
+ model = integration.onBakedModelLoad(location, unbakedModel, model, state, this.field_40571, spriteGetter);
}
return model;
diff --git a/neoforge/src/main/java/org/embeddedt/modernfix/platform/neoforge/ModernFixPlatformHooksImpl.java b/neoforge/src/main/java/org/embeddedt/modernfix/platform/neoforge/ModernFixPlatformHooksImpl.java
index 5e455b81..d203ae4b 100644
--- a/neoforge/src/main/java/org/embeddedt/modernfix/platform/neoforge/ModernFixPlatformHooksImpl.java
+++ b/neoforge/src/main/java/org/embeddedt/modernfix/platform/neoforge/ModernFixPlatformHooksImpl.java
@@ -36,7 +36,7 @@ import java.lang.reflect.Field;
import java.nio.file.Path;
import java.util.List;
import java.util.Map;
-import java.util.Objects;
+import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
@@ -49,17 +49,11 @@ public class ModernFixPlatformHooksImpl implements ModernFixPlatformHooks {
return FMLLoader.getDist().isDedicatedServer();
}
- private static String verString;
+ private static final String verString = Optional.ofNullable(
+ ModernFixMixinPlugin.class.getPackage().getImplementationVersion())
+ .orElse("[unknown]");
public String getVersionString() {
- if(verString == null) {
- try {
- verString = ModernFixMixinPlugin.class.getPackage().getImplementationVersion();
- Objects.requireNonNull(verString);
- } catch(Throwable e) {
- verString = "[unknown]";
- }
- }
return verString;
}