Jump to content

XenoPyax

Members
  • Posts

    21
  • Joined

  • Last visited

Everything posted by XenoPyax

  1. I've been following this doc (https://mcforge.readthedocs.io/en/latest/networking/simpleimpl/) but I don't see how the INSTANCE encodes the message how should know how to decode the message? and also does the MessageClass packet need to implement something or does it just send the Object of a class as the message?
  2. Hey, I just got back to modding, and I was wondering how drawing rectangles works in the new system, I figured out how it works with texture but since I don't always want to use textures I was wondering If a simple draw rect method with a color an alpha values exists.
  3. I want to override the default in game UI and show my custom one. Uh, iirc in Java 16 they made it impossible to use reflection to re-assign final fields.
  4. Hello, I was just upgrading my mod and notice that `gui` is not exposed even tho java 16 change the whole final system to being re-assignable, how are we supposed to set out custom GUI now?
  5. Well is there anyway I can see the lag spikes causes from ingame like F3 menu or is it just purely testing and knowing what could cause this?
  6. Okay so it is in the dev env and in the "production" use with other mods, my mod is using RestAPIs to request data and displaying UI and data from the api requests.
  7. Hello I am noticing lags spikes when using my mod what ways are there to identify what part of my mod is causing this?
  8. my bad I was looking at the wrong project, it was my 1.8 project found it in the 1.16 one thanks!
  9. this is all I could find in TextureAtlasSprite : TextureUtil.uploadTextureMipmap
  10. Another question how do I draw over the blocks texture like what do I need to be able to draw over the block object? And when do I draw them I can't imagine drawing them each individually on chunk load or? any pseudocode or example class I could look at?
  11. Hello, so I wanted to make a mod that changes the blocks texture under certain conditions like for example if the scoreboard has a certain string all wool textures will be replaced with my custom texture. How would I set the texture for a block and show it when they enter a world with the scoreboard condition?
  12. SO I was trying to get the player to render in the gui I only got it to receive the skinResource and draw that skintexture in the gui but without a player model just the blank file texture in the gui. Any resources where I can look for an example on how to do it.
  13. SO I have the following code I've been looking through the gui of the Minecraft menus and replicated them but somehow my buttons don't seem to take the correct texture. Code: https://paste.md-5.net/figovuzufa.java Image:
  14. So I am switching from 1.8 to 1.16 and until now I feel like the documentation got worse there are only a few things that are explained and some easy to do suddenly got 10x more complicated. My question now is I can't seem to figure out how to render an overlay to the players HUD, I figured out how to open a GUI to them but that will enable the mouse, and they can't move or interact is there a better source for figuring things like this out? The docs seem to only explain a few specific topics.
  15. Hey there, so I try rending a calendar and an item info the calendar works fine and shows up as a semitransparent gray but for some reason the item info now renders the texture with a purple shade. Any idea what might be causing this or where I should start looking for. EDIT: Where would I ask for support if it's not supported here anymore? package dev.xenopyax.skyblockutils.gui; import java.util.ArrayList; import java.util.List; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; public class ItemStatsOverlay extends Gui { private Minecraft mc; private final ResourceLocation ITEM_DISPLAY_BACKGROUND; public ItemStatsOverlay(Minecraft mc) { this.mc = mc; ITEM_DISPLAY_BACKGROUND = new ResourceLocation("skyblockutils:textures/gui/itembackground.png"); if(getStats().size() > 0) { int length = 0; for(String s : getStats()) { if(mc.fontRendererObj.getStringWidth(s) > length) length = mc.fontRendererObj.getStringWidth(s); } if(mc.fontRendererObj.getStringWidth(getName()) > length) length = mc.fontRendererObj.getStringWidth(getName()); mc.getTextureManager().bindTexture(ITEM_DISPLAY_BACKGROUND); drawModalRectWithCustomSizedTexture(4, 4, length + 16, 45, (int) length + 16, (int) 45, length + 16, 45); drawString(mc.fontRendererObj, getName(), 30, 14, 0xffffff); getStats().forEach((stat) -> drawString(mc.fontRendererObj, stat, 12, 30, 0xffffff)); if(mc.thePlayer.getHeldItem() != null) drawItemStack(10, 10, mc.thePlayer.getHeldItem()); } } private void drawItemStack(int x, int y, ItemStack item) { RenderItem itemRender = mc.getRenderItem(); RenderHelper.enableStandardItemLighting(); itemRender.renderItemIntoGUI(item, x, y); } public String getName() { return mc.thePlayer.getHeldItem().getTooltip(mc.thePlayer, true).get(0).split("\\(")[0]; } public List<String> getStats() { List<String> stats = new ArrayList<String>(); for(String s : mc.thePlayer.getHeldItem().getTooltip(mc.thePlayer, false)) { String lore = s.replaceAll("(§[0-9a-fk-or])(?!.*\\1)", ""); if(lore.startsWith("Counter:") || lore.startsWith("Compact")) { stats.add(s); } } return stats; } }
  16. So I've been working on this for several days and cant get the gui to show what am I missing? https://github.com/XenoPyax/XenMod
×
×
  • Create New...

Important Information

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