mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-27 07:23:33 +00:00
There a lot of performance improvements related to events. No more InheritableEvent for abstract events that you shouldn't add listeners to anyway, like EntityEvent. Use their sub-events. Made a lot more events records and interfaces. Mostly just a binary break, but has better performance. Mod bus posting methods are now static, no more ModLoader.get() for those. ObjectHolder was removed, use RegistryObject. Changed RuntimeEnumExtender to only target Minecraft classes. If you want other modders to interact with your API, use an Interface instead of Enum. Moved some abstract event methods to only the relevant sub-events now, e.g. can no longer check the side of a ClientTickEvent, because it'll always be client Rendering has changed a lot, they now batch most things together so that the game will render faster. RenderHighlightEvent changed a lot See https://github.com/MinecraftForge/MinecraftForge-Experimental/tree/1.21.9-dev for unsquashed commits. Co-authored-by: Paint_Ninja <[email protected]>
41 lines
1.5 KiB
Diff
41 lines
1.5 KiB
Diff
--- a/net/minecraft/client/renderer/Sheets.java
|
|
+++ b/net/minecraft/client/renderer/Sheets.java
|
|
@@ -171,11 +_,11 @@
|
|
}
|
|
|
|
private static Material createSignMaterial(WoodType p_173386_) {
|
|
- return SIGN_MAPPER.defaultNamespaceApply(p_173386_.name());
|
|
+ return SIGN_MAPPER.apply(ResourceLocation.parse(p_173386_.name()));
|
|
}
|
|
|
|
private static Material createHangingSignMaterial(WoodType p_251735_) {
|
|
- return HANGING_SIGN_MAPPER.defaultNamespaceApply(p_251735_.name());
|
|
+ return HANGING_SIGN_MAPPER.apply(ResourceLocation.parse(p_251735_.name()));
|
|
}
|
|
|
|
public static Material getSignMaterial(WoodType p_173382_) {
|
|
@@ -221,6 +_,23 @@
|
|
case SINGLE:
|
|
default:
|
|
return p_110773_;
|
|
+ }
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * Not thread-safe. Enqueue it in client setup.
|
|
+ */
|
|
+ public static void addWoodType(WoodType woodType) {
|
|
+ SIGN_MATERIALS.put(woodType, createSignMaterial(woodType));
|
|
+ HANGING_SIGN_MATERIALS.put(woodType, createHangingSignMaterial(woodType));
|
|
+ }
|
|
+
|
|
+ static {
|
|
+ if (net.minecraftforge.fml.ModLoader.isLoadingStateValid() && !net.minecraftforge.fml.ModLoader.get().hasCompletedState("LOAD_REGISTRIES")) {
|
|
+ com.mojang.logging.LogUtils.getLogger().error(
|
|
+ "net.minecraft.client.renderer.Sheets loaded too early, modded registry-based materials may not work correctly",
|
|
+ new IllegalStateException("net.minecraft.client.renderer.Sheets loaded too early")
|
|
+ );
|
|
}
|
|
}
|
|
}
|