mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-21 04:32:15 +00:00
41 lines
1.7 KiB
Diff
41 lines
1.7 KiB
Diff
--- a/net/minecraft/client/renderer/Sheets.java
|
|
+++ b/net/minecraft/client/renderer/Sheets.java
|
|
@@ -140,11 +_,11 @@
|
|
}
|
|
|
|
private static Material createSignMaterial(WoodType p_173386_) {
|
|
- return new Material(SIGN_SHEET, ResourceLocation.withDefaultNamespace("entity/signs/" + p_173386_.name()));
|
|
+ return new Material(SIGN_SHEET, ResourceLocation.parse(p_173386_.name()).withPrefix("entity/signs/"));
|
|
}
|
|
|
|
private static Material createHangingSignMaterial(WoodType p_251735_) {
|
|
- return new Material(SIGN_SHEET, ResourceLocation.withDefaultNamespace("entity/signs/hanging/" + p_251735_.name()));
|
|
+ return new Material(SIGN_SHEET, ResourceLocation.parse(p_251735_.name()).withPrefix("entity/signs/hanging/"));
|
|
}
|
|
|
|
public static Material getSignMaterial(WoodType p_173382_) {
|
|
@@ -203,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")
|
|
+ );
|
|
}
|
|
}
|
|
}
|