Skip to content

Commit daa8456

Browse files
committed
Merge 1.20 into 1.20.4
2 parents d3758eb + c32fad1 commit daa8456

File tree

7 files changed

+88
-21
lines changed

7 files changed

+88
-21
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Bug Report
2+
description: "For reporting bugs and other defects"
3+
body:
4+
- type: markdown
5+
attributes:
6+
value: >-
7+
**Note: This issue tracker is not intended for support requests!** If you need help with crashes or other issues, then
8+
you should [ask on our Discord server](https://discord.gg/rN9Y7caguP) instead. Unless you are certain that you
9+
have found a defect, and you are able to point to where the problem is, you should not open an issue.
10+
<br><br>
11+
Additionally, please make sure you have done the following:
12+
13+
- **Have you ensured that all of your mods (including ModernFix) are up-to-date?** The latest version of ModernFix
14+
can always be found [on Modrinth](https://modrinth.com/mod/modernfix).
15+
16+
- **Have you used the [search tool](https://github.com/embeddedt/ModernFix/issues) to check whether your issue
17+
has already been reported?** If it has been, then consider adding more information to the existing issue instead.
18+
19+
- **Have you determined the minimum set of instructions to reproduce the issue?** If your problem only occurs
20+
with other mods installed, then you should narrow down exactly which mods are causing the issue. Please do not
21+
provide your entire list of mods to us and expect that we will be able to figure out the problem.
22+
- type: textarea
23+
id: description
24+
attributes:
25+
label: Bug Description
26+
description: >-
27+
Use this section to describe the issue you are experiencing in as much depth as possible. The description should
28+
explain what behavior you were expecting, and why you believe the issue to be a bug. If the issue you are reporting
29+
only occurs with specific mods installed, then provide the name and version of each mod.
30+
31+
**Hint:** If you have any screenshots, videos, or other information that you feel is necessary to
32+
explain the issue, you can attach them here.
33+
- type: textarea
34+
id: description-reproduction-steps
35+
attributes:
36+
label: Reproduction Steps
37+
description: >-
38+
Provide as much information as possible on how to reproduce this bug. Make sure your instructions are as clear and
39+
concise as possible, because other people will need to be able to follow your guide in order to re-create the issue.
40+
41+
**Hint:** A common way to fill this section out is to write a step-by-step guide.
42+
validations:
43+
required: true
44+
- type: textarea
45+
id: log-file
46+
attributes:
47+
label: Log File
48+
description: >-
49+
**Hint:** You can usually find the log files within the folder `.minecraft/logs`. Most often, you will want the `latest.log`
50+
file, since that file belongs to the last played session of the game.
51+
placeholder: >-
52+
Drag-and-drop the log file here.
53+
validations:
54+
required: true

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: For help with other issues, join our Discord community
4+
url: https://discord.gg/rN9Y7caguP
5+
about: This is the best option for getting help with mod installation, performance issues, and any other support inquiries
6+
# Copied from https://github.com/CaffeineMC/sodium-fabric#community

common/src/main/java/org/embeddedt/modernfix/api/entrypoint/ModernFixClientIntegration.java

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package org.embeddedt.modernfix.api.entrypoint;
22

3-
import net.minecraft.client.resources.model.BakedModel;
4-
import net.minecraft.client.resources.model.ModelBakery;
5-
import net.minecraft.client.resources.model.ModelState;
6-
import net.minecraft.client.resources.model.UnbakedModel;
3+
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
4+
import net.minecraft.client.resources.model.*;
75
import net.minecraft.resources.ResourceLocation;
86

7+
import java.util.function.Function;
8+
99

1010
/**
1111
* Implement this interface in a mod class and add it to "modernfix:integration_v1" in your mod metadata file
@@ -56,7 +56,22 @@ default UnbakedModel onUnbakedModelPreBake(ResourceLocation location, UnbakedMod
5656
* with dynamic resources on
5757
* @return the model which should actually be loaded for this resource location
5858
*/
59+
@Deprecated
5960
default BakedModel onBakedModelLoad(ResourceLocation location, UnbakedModel baseModel, BakedModel originalModel, ModelState state, ModelBakery bakery) {
6061
return originalModel;
6162
}
63+
64+
/**
65+
* Called to allow mods to observe the loading of a baked model and either make changes to it or wrap it with their
66+
* own instance.
67+
* @param location the ResourceLocation of the model (this may be a ModelResourceLocation)
68+
* @param originalModel the original model
69+
* @param bakery the model bakery - do not touch internal fields as they probably don't behave the way you expect
70+
* with dynamic resources on
71+
* @param textureGetter function to retrieve textures for this model
72+
* @return the model which should actually be loaded for this resource location
73+
*/
74+
default BakedModel onBakedModelLoad(ResourceLocation location, UnbakedModel baseModel, BakedModel originalModel, ModelState state, ModelBakery bakery, Function<Material, TextureAtlasSprite> textureGetter) {
75+
return onBakedModelLoad(location, baseModel, originalModel, state, bakery);
76+
}
6277
}

fabric/src/main/java/org/embeddedt/modernfix/fabric/mixin/perf/dynamic_resources/ModelBakerImplMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ private BakedModel callBakedModelIntegration(UnbakedModel unbakedModel, ModelBak
120120
BakedModel model = operation.call(unbakedModel, baker, spriteGetter, state, location);
121121

122122
for(ModernFixClientIntegration integration : ModernFixClient.CLIENT_INTEGRATIONS) {
123-
model = integration.onBakedModelLoad(location, unbakedModel, model, state, this.field_40571);
123+
model = integration.onBakedModelLoad(location, unbakedModel, model, state, this.field_40571, spriteGetter);
124124
}
125125

126126
return model;

fabric/src/main/java/org/embeddedt/modernfix/platform/fabric/ModernFixPlatformHooksImpl.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,11 @@ public boolean isDedicatedServer() {
3939
return FabricLoader.getInstance().getEnvironmentType() == EnvType.SERVER;
4040
}
4141

42-
private static String verString;
42+
private static final String verString = FabricLoader.getInstance().getModContainer("modernfix")
43+
.map(mfModContainer -> mfModContainer.getMetadata().getVersion().getFriendlyString())
44+
.orElse("[unknown]");
4345

4446
public String getVersionString() {
45-
if(verString == null) {
46-
ModContainer mfModContainer = FabricLoader.getInstance().getModContainer("modernfix").get();
47-
verString = mfModContainer.getMetadata().getVersion().getFriendlyString();
48-
}
4947
return verString;
5048
}
5149

neoforge/src/main/java/org/embeddedt/modernfix/neoforge/mixin/perf/dynamic_resources/ModelBakerImplMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ private BakedModel callBakedModelIntegration(UnbakedModel unbakedModel, ModelBak
9494
BakedModel model = operation.call(unbakedModel, baker, spriteGetter, state, location);
9595

9696
for(ModernFixClientIntegration integration : ModernFixClient.CLIENT_INTEGRATIONS) {
97-
model = integration.onBakedModelLoad(location, unbakedModel, model, state, this.field_40571);
97+
model = integration.onBakedModelLoad(location, unbakedModel, model, state, this.field_40571, spriteGetter);
9898
}
9999

100100
return model;

neoforge/src/main/java/org/embeddedt/modernfix/platform/neoforge/ModernFixPlatformHooksImpl.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import java.nio.file.Path;
3737
import java.util.List;
3838
import java.util.Map;
39-
import java.util.Objects;
39+
import java.util.Optional;
4040
import java.util.function.BiConsumer;
4141
import java.util.function.Consumer;
4242

@@ -49,17 +49,11 @@ public boolean isDedicatedServer() {
4949
return FMLLoader.getDist().isDedicatedServer();
5050
}
5151

52-
private static String verString;
52+
private static final String verString = Optional.ofNullable(
53+
ModernFixMixinPlugin.class.getPackage().getImplementationVersion())
54+
.orElse("[unknown]");
5355

5456
public String getVersionString() {
55-
if(verString == null) {
56-
try {
57-
verString = ModernFixMixinPlugin.class.getPackage().getImplementationVersion();
58-
Objects.requireNonNull(verString);
59-
} catch(Throwable e) {
60-
verString = "[unknown]";
61-
}
62-
}
6357
return verString;
6458
}
6559

0 commit comments

Comments
 (0)