Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Zemelua

Members
  • Joined

  • Last visited

Everything posted by Zemelua

  1. Why is it 256x256? Where did the number come from?
  2. I'm ashamed to say that I'm new to giyhub so I don't know if it's made, but it's a url. https://github.com/Zemelua/Depression-Mod
  3. sorry. I wrote it in various positions and tried it, so the first AbstractGui.GUI_ICONS_LOCATION is just a mistake. However, even if I turn it off, it still doesn't work properly.
  4. public class MentalOverlayHander { public static final ResourceLocation MENTALICON = new ResourceLocation("depressionmod:textures/gui/overlay.png"); private final Minecraft mc = Minecraft.getInstance(); @SubscribeEvent public void onPreRenderOverlay(RenderGameOverlayEvent.Post event) { if (event.getType() == ElementType.ALL && mc.playerController.gameIsSurvivalOrAdventure()) { int scaledWidth = this.mc.getMainWindow().getScaledWidth(); int scaledHeight = this.mc.getMainWindow().getScaledHeight(); int left_height = ForgeIngameGui.left_height; int left = scaledWidth / 2 - 91; int top = scaledHeight - left_height; int level = 9; //((PlayerMentalInterface) PlayerMentalCapabilityRegistry.PLAYER_MENTAL_CAPABILITY).getMental(); mc.getTextureManager().bindTexture(AbstractGui.GUI_ICONS_LOCATION); RenderSystem.enableBlend(); RenderSystem.enableAlphaTest(); RenderSystem.color4f(1F, 1F, 1F, 1F); mc.getTextureManager().bindTexture(MENTALICON); for (int i = 0; i < 10; ++i) { //iが10未満のとき繰り返す。iは繰り返しごとに1増える。 if (i < level) { //iがMPより小さいとき普通の薬を描画。 //mc.getTextureManager().bindTexture(MENTALICON); mc.ingameGUI.blit(left, top, 0, 0, 9, 9); } else if (i == level) { //iがMPと同じとき半分の薬を描画。 //mc.getTextureManager().bindTexture(MENTALICON); mc.ingameGUI.blit(left, top, 9, 0, 9, 9); } else if (i > level) { //iがMPより大きいとき黒の薬を描画。 //mc.getTextureManager().bindTexture(MENTALICON); mc.ingameGUI.blit(left, top, 18, 0, 9, 9); } left += 8; //アイコンを描画する位置を右に一つ分ずらす } RenderSystem.disableBlend(); mc.getTextureManager().bindTexture(AbstractGui.GUI_ICONS_LOCATION); } } }
  5. I rebinded the vanilla texture immediately after RenderSystem.disableBlend (); but it doesn't work. Is it wrong?
  6. public class MentalOverlayHander { public static final ResourceLocation MENTALICON = new ResourceLocation("depressionmod:textures/gui/overlay.png"); private final Minecraft mc = Minecraft.getInstance(); @SubscribeEvent public void onPreRenderOverlay(RenderGameOverlayEvent.Post event) { if (event.getType() == ElementType.ALL && mc.playerController.gameIsSurvivalOrAdventure()) { int scaledWidth = this.mc.getMainWindow().getScaledWidth(); int scaledHeight = this.mc.getMainWindow().getScaledHeight(); int left_height = ForgeIngameGui.left_height; int left = scaledWidth / 2 - 91; int top = scaledHeight - left_height; int level = 9; //((PlayerMentalInterface) PlayerMentalCapabilityRegistry.PLAYER_MENTAL_CAPABILITY).getMental(); RenderSystem.enableBlend(); RenderSystem.enableAlphaTest(); RenderSystem.color4f(1F, 1F, 1F, 1F); mc.getTextureManager().bindTexture(MENTALICON); for (int i = 0; i < 10; ++i) { //iが10未満のとき繰り返す。iは繰り返しごとに1増える。 if (i < level) { //iがMPより小さいとき普通の薬を描画。 //mc.getTextureManager().bindTexture(MENTALICON); mc.ingameGUI.blit(left, top, 0, 0, 9, 9); } else if (i == level) { //iがMPと同じとき半分の薬を描画。 //mc.getTextureManager().bindTexture(MENTALICON); mc.ingameGUI.blit(left, top, 9, 0, 9, 9); } else if (i > level) { //iがMPより大きいとき黒の薬を描画。 //mc.getTextureManager().bindTexture(MENTALICON); mc.ingameGUI.blit(left, top, 18, 0, 9, 9); } left += 8; //アイコンを描画する位置を右に一つ分ずらす mc.getTextureManager().bindTexture(AbstractGui.GUI_ICONS_LOCATION); } RenderSystem.disableBlend(); } } } I tried to fix the code but it doesn't work. Can you tell me specifically where and how to fix it?
  7. What does it mean to rebind a vanilla texture? I'm sorry for my poor understanding. Could you please show me the complete code to work with that as well?
  8. When I checked the entity type ALL, the white bar also disappeared. I'm not sure about AbstractGui.GUI_ICONS_LOCATION, so could you please write some sample code?
  9. I don't know why, but when I restarted the computer, even the white bar disappeared, so when I restarted with the element type set to ARMOR, this time it was displayed like this. The error log was not displayed.
  10. Why shouldn't I use the Air element type?
  11. sorry. It's just a typo. The texture is neatly in the gui folder. Still it is not displayed correctly. Why?
  12. public class MentalOverlayHander { public static final ResourceLocation MENTALICON = new ResourceLocation("depressionmod:textures/gui/overlay.png"); private final Minecraft mc = Minecraft.getInstance(); //private final IngameGui iGUI = mc.ingameGUI; @SubscribeEvent public void onPreRenderOverlay(RenderGameOverlayEvent.Post event) { if (event.getType() == ElementType.AIR && mc.playerController.gameIsSurvivalOrAdventure()) { int scaledWidth = this.mc.getMainWindow().getScaledWidth(); int scaledHeight = this.mc.getMainWindow().getScaledHeight(); int left_height = ForgeIngameGui.left_height; int left = scaledWidth / 2 - 91; int top = scaledHeight - left_height; int level = 9; //((PlayerMentalInterface) PlayerMentalCapabilityRegistry.PLAYER_MENTAL_CAPABILITY).getMental(); RenderSystem.enableBlend(); mc.getTextureManager().bindTexture(MENTALICON); for (int i = 0; i < 10; ++i) { //iが10未満のとき繰り返す。iは繰り返しごとに1増える。 if (i < level) { //iがMPより小さいとき普通の薬を描画。 mc.ingameGUI.blit(left, top, 0, 0, 9, 9); } else if (i == level) { //iがMPと同じとき半分の薬を描画。 mc.ingameGUI.blit(left, top, 9, 0, 9, 9); } else if (i > level) { //iがMPより大きいとき黒の薬を描画。 mc.ingameGUI.blit(left, top, 18, 0, 9, 9); } left += 8; //アイコンを描画する位置を右に一つ分ずらす RenderSystem.disableBlend(); } } } } My English may be unnatural because I use a translator. sorry. When I apply the mod with the above code, it doesn't draw correctly like the image. Can anyone please tell me this solution? The position of the texture is src / main / resources / assets / depressionmod / textures / overlay.png, which is the second image.
  13. What is the difference between ForgeInGameGUI and InGameGUI of minecraft?
  14. Since I am writing using a translator, the text may be a little unnatural. sorry. I want to display my magic points in the same way as the health bar and food bar (the magic points capacity is already complete). After searching, I found that I could use RenderGameOverlayEvent, but it seems that there are various ways to actually draw. blit? buffer? Can you explain because I don't understand the difference between them? Also, it would be helpful if you could write the sample code as well.

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.