mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 02:55:17 +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
@@ -55,11 +55,13 @@ public abstract class CustomizeGuiOverlayEvent extends Event
|
||||
/**
|
||||
* Fired <b>before</b> a boss health bar is rendered to the screen.
|
||||
*
|
||||
* <p>This event is not {@linkplain Cancelable cancellable}, and does not {@linkplain HasResult have a result}.
|
||||
* <p>This event is {@linkplain Cancelable cancellable}, and does not {@linkplain HasResult have a result}.
|
||||
* Cancelling this event will prevent the given bar from rendering.</p>
|
||||
*
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
@Cancelable
|
||||
public static class BossEventProgress extends CustomizeGuiOverlayEvent
|
||||
{
|
||||
private final LerpingBossEvent bossEvent;
|
||||
@@ -124,7 +126,7 @@ public abstract class CustomizeGuiOverlayEvent extends Event
|
||||
* Fired <b>before</b> textual information is rendered to the debug screen.
|
||||
* This can be used to add or remove text information.
|
||||
*
|
||||
* <p>This event is not {@linkplain Cancelable cancellable}, and does not {@linkplain HasResult have a result}.
|
||||
* <p>This event is not {@linkplain Cancelable cancellable}, and does not {@linkplain HasResult have a result}.</p>
|
||||
*
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
@@ -162,7 +164,7 @@ public abstract class CustomizeGuiOverlayEvent extends Event
|
||||
/**
|
||||
* Fired <b>before</b> the chat messages overlay is rendered to the screen.
|
||||
*
|
||||
* <p>This event is not {@linkplain Cancelable cancellable}, and does not {@linkplain HasResult have a result}.
|
||||
* <p>This event is not {@linkplain Cancelable cancellable}, and does not {@linkplain HasResult have a result}.<p/>
|
||||
*
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -29,7 +29,7 @@ public class DynamicFluidContainerModelBuilder<T extends ModelBuilder<T>> extend
|
||||
|
||||
protected DynamicFluidContainerModelBuilder(T parent, ExistingFileHelper existingFileHelper)
|
||||
{
|
||||
super(new ResourceLocation("forge:bucket"), parent, existingFileHelper);
|
||||
super(new ResourceLocation("forge:fluid_container"), parent, existingFileHelper);
|
||||
}
|
||||
|
||||
public DynamicFluidContainerModelBuilder<T> fluid(Fluid fluid)
|
||||
|
||||
@@ -18,8 +18,8 @@ import net.minecraft.resources.ResourceLocation;
|
||||
*/
|
||||
public class UnitTextureAtlasSprite extends TextureAtlasSprite
|
||||
{
|
||||
public static final UnitTextureAtlasSprite INSTANCE = new UnitTextureAtlasSprite();
|
||||
public static final ResourceLocation LOCATION = new ResourceLocation("forge", "unit");
|
||||
public static final UnitTextureAtlasSprite INSTANCE = new UnitTextureAtlasSprite();
|
||||
|
||||
private UnitTextureAtlasSprite()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user