
Everything posted by uSkizzik
-
[Solved] [1.17.1] Is there any way to make a boss bar use a color that isn't BossBarColor enum?
I was looking at the one that BossHealthOverlay uses and didn't see the other ones... I'll try it out
-
[Solved] [1.17.1] Is there any way to make a boss bar use a color that isn't BossBarColor enum?
I need an instance of BossHealthOverlay to actually call the blit method. Yea I actually noticed that but thought it's supposed to be like that. I'll stick with the getType method. I just have to check if it's RenderGameOverlayEvent.ElementType.BOSSINFO, right?
-
[1.17.1]What is the name of class "RenderingRegistry"(in 1.16) now?
In 1.17 you need to subscribe to EntityRenderersEvent.RegisterRenderers and then use the registerEntityRenderer method. You'll also need to subscribe to EntityRenderersEvent.RegisterLayerDefinitions and then use the registerLayerDefinition method to register a layer. You can find more on that here.
-
[Solved] [1.17.1] Is there any way to make a boss bar use a color that isn't BossBarColor enum?
Alright, I finally got something! The text is finally rendering (Don't know how, but it works without any errors). What I need now is the actual bar rendering. I see that vanilla BossHealthOverlay has a method called "drawBar" which uses GuiComponent#blit to draw the bar. How would I do that in my class? Here's what I currently have: @Mod.EventBusSubscriber(modid = ProjectApple.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE) public class PA_RenderGameOverlayEvent { private static final ResourceLocation GUI_BARS_LOCATION = new ResourceLocation("textures/gui/bars.png"); private static final Minecraft minecraft = Minecraft.getInstance(); @SubscribeEvent public static void registerBossBarRendering(RenderGameOverlayEvent.Pre event) { Map<UUID, PA_LerpingBossEvent> events = PA_BossEventPacket.getEvents(); if (!events.isEmpty()) { int i = minecraft.getWindow().getGuiScaledWidth(); int j = 12; for(PA_LerpingBossEvent lerpingEvent : events.values()) { int k = i / 2 - 91; if (!event.isCanceled()) { RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.setShaderTexture(0, GUI_BARS_LOCATION); Component component = lerpingEvent.getName(); int l = minecraft.font.width(component); int i1 = i / 2 - l / 2; int j1 = j - 9; minecraft.font.drawShadow(event.getMatrixStack(), component, (float)i1, (float)j1, 16777215); } if (j >= minecraft.getWindow().getGuiScaledHeight() / 3) { break; } } } } } P.S.: I know that I need a custom bars texture. I'm using the vanilla one as a placeholder until I get the rendering done.
-
[Solved] [1.17.1] Is there any way to make a boss bar use a color that isn't BossBarColor enum?
What do you mean by that?
-
[Solved] [1.17.1] Is there any way to make a boss bar use a color that isn't BossBarColor enum?
Yea I can actually just do that-
-
[Solved] [1.17.1] Is there any way to make a boss bar use a color that isn't BossBarColor enum?
Alright, I'm running into issues with having a custom LerpingBossEvent because the vanilla events field requires a vanilla LerpingBossEvent. I can't extend it because it itself extends BossEvent and I need it to extend my custom BossEvent. I also can't make my own events field because then I'll have to call ForgeHooksClient#bossBarRenderPre myself and it also requires a vanilla LerpingBossEvent. I have no idea what I'm doing and I might just give up...
-
[Solved] [1.17.1] Is there any way to make a boss bar use a color that isn't BossBarColor enum?
Well, I need to change the BossEvent.BossBarColor to ChatFormatting. I subscribe to the event, then what?
-
[Solved] [1.17.1] Is there any way to make a boss bar use a color that isn't BossBarColor enum?
Well I need it to extend a custom version of BossBar, don't I? What method tho?
-
[Solved] [1.17.1] Is there any way to make a boss bar use a color that isn't BossBarColor enum?
Vanilla LerpingBossEvent extends vanilla BossBar which isn't what I want. How would I render it via RenderOverlayEvent?
-
Caused by: java.lang.IllegalArgumentException: Texture does not exist in any known resource pack
It isn't about the runData. It's about where your texture is placed. Data generation seems to be working perfectly fine. Please check if the path to your texture is the following: "src/main/resources/assets/tritia/textures/item/". Make sure there is no misspellings!
-
1.7.10 forge
Please read the rules and the pins (the three boxes above the title) before posting anything. 1.7.10 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
-
[1.17.1] Key Binding package net.minecraft.client.settings does not exist import net.minecraft.client.settings.KeyBinding
Official Forge Server: https://discord.gg/UvedJ9m forge-bot can be used in #bot-commands
-
[Solved] [1.17.1] Is there any way to make a boss bar use a color that isn't BossBarColor enum?
And what do I do with it? You told me to add it to the events field but it only accepts vanilla LerpingBossEvent
-
[Solved] [1.17.1] Is there any way to make a boss bar use a color that isn't BossBarColor enum?
My issue is that I need to call this event in my custom version of BossHealthOverlay but I can't because it requires a LerpingBossEvent and I'm using a custom version of that class too.
-
[Solved] [1.17.1] Is there any way to make a boss bar use a color that isn't BossBarColor enum?
Take a look at the render method of the BossHealthOverlay. It sets a variable called event that is ForgeHooksClient.bossBarRenderPre. That's on lines 37 and 38.
-
[Solved] [1.17.1] Is there any way to make a boss bar use a color that isn't BossBarColor enum?
New Question: How do I call the ForgeHook with an instance of a custom LerpingBossEvent?
-
[Solved] [1.17.1] Is there any way to make a boss bar use a color that isn't BossBarColor enum?
I still don't understand how that makes the game use my custom BossHealthOverlay. The Gui class still makes an instance of the vanilla class and uses only the vanilla class. Edit: Does the Gui class even need to use my custom class?
-
[Solved] [1.17.1] Is there any way to make a boss bar use a color that isn't BossBarColor enum?
How would I make the game use my custom version of the BossHealthOverlay class tho?
-
[Solved] [1.17.1] Is there any way to make a boss bar use a color that isn't BossBarColor enum?
Yes, I already have a custom packet but what I don't understand is how exactly I'm supposed to handle it. Currently I'm using this line: Minecraft.getInstance().gui.getBossOverlay().update(this); But getBossOverlay returns an instance of BossHealthOverlay which, as you said, won't do the job.
-
[Solved] [1.17.1] Is there any way to make a boss bar use a color that isn't BossBarColor enum?
Well, how am I supposed to handle the custom boss event packet then? As I said, in vanilla it gets the boss overlay from the GUI and then updates it.
-
[Solved] [1.17.1] Is there any way to make a boss bar use a color that isn't BossBarColor enum?
My question is do I need a custom version of BossHealthOverlay that uses ChatFormatting instead of the BossBarColor or no?
-
[Solved] [1.17.1] Is there any way to make a boss bar use a color that isn't BossBarColor enum?
Wait, don't I actually need a custom BossHealthOverlay class because most of it uses vanilla BossEvent and BossBarColor?
-
[Solved] [1.17.1] Is there any way to make a boss bar use a color that isn't BossBarColor enum?
How exactly can I render my custom boss bar? Vanilla seems to be handling the boss event packet by calling Gui.getBossOverlay().update(). Do I need a custom packet (which I already made) or I need to somehow use the vanilla packet? The issue with a custom packet is that the update method requires an instance of the vanilla boss event packet.
-
[Solved] [1.17.1] Is there any way to make a boss bar use a color that isn't BossBarColor enum?
Sweet! All that work just for a Halloween update. I'll still try it out tho.
IPS spam blocked by CleanTalk.