mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 19:59:42 +00:00
Multiple tweaks and fixes to the recent changes in the client refactor PR (#8836)
* Add an easy way to get the NamedGuiOverlay from a vanilla overlay * Fix static member ordering crash in UnitTextureAtlasSprite * Allow boss bar rendering to be cancelled * Make fluid container datagen use the new name
This commit is contained in:
1 parent
b558b132cd
commit
a98eeb9d08
6 files changed
+24
-7
No files matched your search
@@ -59,6 +59,7 @@ public final class GuiOverlayManager
|
||||
.collect(ImmutableList.toImmutableList());
|
||||
OVERLAYS_BY_NAME = OVERLAYS.stream()
|
||||
.collect(ImmutableMap.toImmutableMap(NamedGuiOverlay::id, Function.identity()));
|
||||
assignVanillaOverlayTypes();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,6 +74,12 @@ public final class GuiOverlayManager
|
||||
}
|
||||
}
|
||||
|
||||
private static void assignVanillaOverlayTypes()
|
||||
{
|
||||
for (var entry : VanillaGuiOverlay.values())
|
||||
entry.type = OVERLAYS_BY_NAME.get(entry.id());
|
||||
}
|
||||
|
||||
private GuiOverlayManager()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -209,6 +209,7 @@ public enum VanillaGuiOverlay
|
||||
|
||||
private final ResourceLocation id;
|
||||
final IGuiOverlay overlay;
|
||||
NamedGuiOverlay type;
|
||||
|
||||
VanillaGuiOverlay(String id, IGuiOverlay overlay)
|
||||
{
|
||||
@@ -221,4 +222,9 @@ public enum VanillaGuiOverlay
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public NamedGuiOverlay type()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user