Jump to content

Search the Community

Showing results for tags '1.8.9'.

Found 15 results

  1. My x and y for drawing the rectangle is right above my health bar but it moves when i change my GUI and resolution. How to make it stay in the same place? package studio.zipcord; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class HudRenderer { @SubscribeEvent public void onRenderGameOverlay(RenderGameOverlayEvent.Post event) { if (event.type == RenderGameOverlayEvent.ElementType.ALL) { if (main.hideHealthBar) { drawRectangle(630, 860, 1000, 5, 0xFF0000FF); } } } private void drawRectangle(int x, int y, int width, int height, int color) { Gui.drawRect(x, y, x + width, y + height, color); } }
  2. Hello everyone, today I would like to touch upon the topic of: How to properly install the Forge 1.8.9 project on a Mac M1 Pro (or Mac Silicon) using IntelliJ IDE. (I would like to note that on Windows 11 everything works fine for me, and I was able to launch IDE without errors!) Yes, you can follow the instructions from the readme file in the forge1.8.9 mdk, but at some point I encounter an error that the Gradle wrapper is not the appropriate version (2.7), and IDE requests permission to download version 4.5 or 8 (for it, this is the appropriate version, but, as I understand it, this is a lie). After allowing the installation of one or another version, error 400 pops up (which means, as I understand it, "Internet connection error"). I tried to solve this problem with chatgpt, but it could not help me in any way. I am writing this post now and if there are people who code minecraft mods for old versions using Mac Silicone, please respond. For an answer, you can also write to me in discord: somikyy. All answers written to me in PM will be published here. I hope this post will also be useful for your subsequent questions about modding on forge 1.8.9.
  3. Hi, I am trying to get custom GUIs working, and I would like to have a GUI that works only client-side, which means that you are not supposed to pull items out, but I do want to display items in my GUI and let the player click them. I have a GUI working that has a size of 54 slots and I made a custom texture to remove the player inventory from the GUI texture (see image) Everything kinda works, but is seems like the inventory is in some way still linked to the player's inventory, even though I didn't add any slots linked to the player's inventory. As an example: If is click in the 5th row of my GUI, I get the chest that was in my hot bar slot (see image). It seems like the handling of the clicking of the inventory is handled by the player inventory still. I also get an error if I click in the bottom row because "java.lang.IndexOutOfBoundsException: Index: 49, Size: 45" the player inventory has a size of 45 I guess? I have posted all my relevant code below, if more is needed to solve this issue please tell me, thanks! Image of weird behaviour: FlipsMenu.java: Opens the menu by changing a "screen to open" variable that gets checked every tick. AHFlipsGui.java: draws the background image and specifies size of the gui. AHFlipsContainer.java: Where we assign the slots. AHFlipsInventory.java: The actual inventory.
  4. Hi, I am trying to use a shadowed dependency in my mod for version 1.8.9, but I just can't get it fully working. I think the shadowing is working (at least a little) because I can use the dependency in my mod without getting a classdefnotfound, but if I actually try to use the dependency it just crashes with this error: The error: I have no idea if this is me using the dependency wrong, me shadowing the dependency wrong, or the dependency just being broken. Can someone maybe check if something obvious is wrong? Thanks in advance! I have provided everything I could think of, if something more is needed, please tell me. Dependency I am trying to shadow into my jar: https://github.com/NotEnoughUpdates/MoulConfig I have downloaded this dependency as "/libs/legacy-3.0.0-beta.13.jar" Example of how the dependency should work (their own example): https://github.com/NotEnoughUpdates/MoulConfig/blob/master/legacy/src/main/java/io/github/notenoughupdates/moulconfig/test/MoulConfigTest.java Example of how the dependency should work (another mod written in kotlin (see line 91)): https://github.com/hannibal002/SkyHanni/blob/beta/src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt My ConfigManager.java (Where it breaks (see comment on line 16)): My FMLInitializationEvent: My build.gradle file (gradle 4.5): (I run the tasks: "build shadowJar copyJarToBin" to build my mod)
  5. Hi, I need some help upgrading my Gradle and ForgeGradle versions for my 1.8.9 mod. I just started modding for forge. I do have quite some experience with coding in Java, but I always used the Maven build system instead of Gradle, so this is still quite hard for me. If I load my "build.gradle" it tells me that I need to / that it is better to upgrade my ForgeGradle to a 5.x version, I guess that I need to upgrade my Gradle then also? (IntelliJ was already mad that I was using this old of a version). Can someone maybe help me with this because I don't even really know where to start... (I tried just upgrading Gradle and changing the version of ForgeGradle, but I couldn't get anything working) This is my last working build.gradle (for gradle 4.5 and ForgeGradle 2.1-SNAPSHOT):
  6. Hello, I am writing about an issue I have been experiencing whilst modding for forge 1.8.9. A few days ago I started modding my small own mod using the 1.8.9 version of forge. everything worked smooth & fast, and no issues occurred. after giving my friend the mod to test it out, it kept crashing & crashing, and upon inspection in the logs, I saw that I had an error while trying to access an endpoint on my site. I happened to use a site provider to load data from my api site, which is not certified in java version "1.8.0_51" of the "Java HotSpot(TM) 64-Bit Server VM". Upon further inspection, I found out that the reason the mod worked fluidly inside my IDE, (and also inside the modrinth app, ) was that they use java version "1.8.0_202" of the "Java HotSpot(TM) 64-Bit Server VM" The difference over here is minor, they both use the JRE of the java HotSpot server, using java 8, but the difference between them is "1.8.0_51" vs "1.8.0_202" -> modrinth & my IDE both use the new small version with the new patches, & forge normally installs on an older instance of this same version. When taking a look inside .\jre1.8.0_202\lib\security\cacerts (modrinth & intellij idea normal) and .\jre-legacy\lib\security\cacerts (forge normal) I noticed that the caret file forge uses is indeed lighter in size, leading even more evidence to this assumption. An explanation the error: When establishing a connection with a site using HttpURLConnection, java checks through its certified list to make sure the website is secure, at this part all of the above information comes into play and the error fires: Error executing task java.util.concurrent.ExecutionException: java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at java.util.concurrent.FutureTask.report(FutureTask.java:122) Key part: "unable to find valid certification path in ..." The mod fails to create a connection with the site *only in this particular version of java*. The current site provider is pythonanywhere, which allowed me to set up a website using a python backend for free (hence, why used). There is a chance I was wrong about "blaming it on forge", but only while using it and not vanilla minecraft, I got the log about the java version (The one that stated what version I am using). Please let me know if there is anything I can do in the situation, even pointing me into another place to address my issue, really all help appriciated. Kind regards, Whiteout12.
  7. Hi all, I am a beginner when it comes to Minecraft modding and ChatGPT has run out its course in ways of being helpful. The mod itself runs fine within the IntelliJ IDE environment and performs exactly how I'd like it to. However, after compiling all necessary elements of my mod using gradlew build, and gradlew shadowJar and putting it into the mods folder (both with and without other mods present) it simply doesn't show up in my mods list and is therefore rendered useless. The mods functionality is pretty basic; fetch embeds from a certain Discord channel sent by a certain user and relay them into the client-sided Minecraft chat with slight modifications to the formatting. ExampleMod.java: https://hastebin.com/share/yizizojodi.java build.gradle: https://hastebin.com/share/yowukonoju.java Any help is appreciated - thank you! /S
  8. public class HUD { public Minecraft mc = Minecraft.getMinecraft(); public static class ModuleComparator implements Comparator<Module>{ @Override public int compare(Module o1, Module o2) { if (Minecraft.getMinecraft().fontRendererObj.getStringWidth(o1.name) > Minecraft.getMinecraft().fontRendererObj.getStringWidth(o2.name)){ return -1; } if (Minecraft.getMinecraft().fontRendererObj.getStringWidth(o1.name) < Minecraft.getMinecraft().fontRendererObj.getStringWidth(o2.name)){ return 1; } return 0; } } public void draw(){ ScaledResolution sr = new ScaledResolution(mc); FontRenderer fr = mc.fontRendererObj; Collections.sort(Client.modules, new ModuleComparator()); GlStateManager.pushMatrix(); GlStateManager.translate(4,4,0); GlStateManager.scale(1.5,1.5,1); GlStateManager.translate(-4, -4, 0); fr.drawString("Skyline", 10, 10, -1); GlStateManager.popMatrix(); int count = 0; for (Module m : Client.modules){ if (!m.toggled || m.name.equals("TabGUI")) continue; int offset = count* (fr.FONT_HEIGHT + 6); GL11.glTranslated(0.0f, 0.0f, -1.0f); Gui.drawRect(sr.getScaledWidth() - fr.getStringWidth(m.name) - 10, offset, sr.getScaledWidth() - fr.getStringWidth(m.name) - 8, 6 + fr.FONT_HEIGHT + offset, -1); Gui.drawRect(sr.getScaledWidth() - fr.getStringWidth(m.name) - 8, offset, sr.getScaledWidth(), 6 + fr.FONT_HEIGHT + offset, 0x90000000); fr.drawString(m.name, sr.getScaledWidth() - fr.getStringWidth(m.name) - 4, offset + 4, -1); count++; } Client.onEvent(new EventRenderGUI()); } } I have just recently stumbled upon this Problem, where the HudRenderer renders the wrong section of the textures and therefore completely destroys the Minecraft Armour and Hunger Bar. I am currently thinking if it is an issue with the DrawRect changing something it shouldn't. But I couldn't find anything about it. (To keep things Clean, the function is Called from another file) public class RenderGUIHandler { @SubscribeEvent public void renderGUI(RenderGameOverlayEvent.Post event){ Client.hud.draw(); } } Any help would be greatly appreciated
  9. I tried to get the player list, but in game servers like Hypixel, it is unrealistic to get the players of the entire server, so I want to make a module to get the player list in the Tab (players in a lobby) Is this possible? Thanks.
  10. Can anyone please make a script for when you get hit by another entity (or player only), you jump? This can be toggled on/off via the CAPSLOCK key.
  11. So I was told that "only one string" needed to change for this 1.8.9 mod to become a 1.16.5 mod. Im not very sure what this line is as I am new to this coding thing, so I thought I might ask around. Thanks in advance. Here is pt.1 of the code: package studio.dreamys.gui; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import java.awt.Color; import java.io.IOException; import java.net.HttpURLConnection; import java.net.URL; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.util.Session; import org.apache.commons.io.IOUtils; import org.lwjgl.input.Keyboard; import studio.dreamys.TokenAuth; public class SessionGui extends GuiScreen { private GuiScreen previousScreen; private String status = "Session:"; private GuiTextField sessionField; private ScaledResolution sr; public SessionGui(GuiScreen previousScreen) { this.previousScreen = previousScreen; } public void func_73866_w_() { Keyboard.enableRepeatEvents(true); this.sr = new ScaledResolution(this.field_146297_k); this.sessionField = new GuiTextField(1, this.field_146297_k.field_71466_p, this.sr.func_78326_a() / 2 - 100, this.sr.func_78328_b() / 2, 200, 20); this.sessionField.func_146203_f(32767); this.sessionField.func_146195_b(true); this.field_146292_n.add(new GuiButton(998, this.sr.func_78326_a() / 2 - 100, this.sr.func_78328_b() / 2 + 30, 200, 20, "Login")); this.field_146292_n.add(new GuiButton(999, this.sr.func_78326_a() / 2 - 100, this.sr.func_78328_b() / 2 + 60, 200, 20, "Restore")); super.func_73866_w_(); } public void func_146281_b() { Keyboard.enableRepeatEvents(false); super.func_146281_b(); } public void func_73863_a(int mouseX, int mouseY, float partialTicks) { this.func_146276_q_(); this.field_146297_k.field_71466_p.func_78276_b(this.status, this.sr.func_78326_a() / 2 - this.field_146297_k.field_71466_p.func_78256_a(this.status) / 2, this.sr.func_78328_b() / 2 - 30, Color.WHITE.getRGB()); this.sessionField.func_146194_f(); super.func_73863_a(mouseX, mouseY, partialTicks); } protected void func_146284_a(GuiButton button) throws IOException { if (button.field_146127_k == 998) { try { String session = this.sessionField.func_146179_b(); String username; String uuid; String token; if (session.contains(":")) { username = session.split(":")[0]; uuid = session.split(":")[1]; token = session.split(":")[2]; } else { HttpURLConnection c = (HttpURLConnection)(new URL("https://api.minecraftservices.com/minecraft/profile/")).openConnection(); c.setRequestProperty("Content-type", "application/json"); c.setRequestProperty("Authorization", "Bearer " + this.sessionField.func_146179_b()); c.setDoOutput(true); JsonObject json = (new JsonParser()).parse(IOUtils.toString(c.getInputStream())).getAsJsonObject(); username = json.get("name").getAsString(); uuid = json.get("id").getAsString(); token = session; } this.field_146297_k.field_71449_j = new Session(username, uuid, token, "mojang"); this.field_146297_k.func_147108_a(this.previousScreen); } catch (Exception var9) { this.status = "§cError: Couldn't set session (check mc logs)"; var9.printStackTrace(); } } if (button.field_146127_k == 999) { try { this.field_146297_k.field_71449_j = TokenAuth.originalSession; this.field_146297_k.func_147108_a(this.previousScreen); } catch (Exception var8) { this.status = "§cError: Couldn't restore session (check mc logs)"; var8.printStackTrace(); } } super.func_146284_a(button); } protected void func_73869_a(char typedChar, int keyCode) throws IOException { this.sessionField.func_146201_a(typedChar, keyCode); if (1 == keyCode) { this.field_146297_k.func_147108_a(this.previousScreen); } else { super.func_73869_a(typedChar, keyCode); } } } and heres pt.2 : package studio.dreamys; import java.awt.Color; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiMultiplayer; import net.minecraft.util.Session; import net.minecraftforge.client.event.GuiScreenEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import studio.dreamys.gui.SessionGui; @Mod( modid = "ta", name = "TokenAuth", version = "1.1.0" ) public class TokenAuth { public static Minecraft mc = Minecraft.func_71410_x(); public static Session originalSession; public TokenAuth() { } @EventHandler public void preInit(FMLPreInitializationEvent e) { MinecraftForge.EVENT_BUS.register(this); } @SubscribeEvent public void onInitGuiPost(GuiScreenEvent.InitGuiEvent.Post e) { if (e.gui instanceof GuiMultiplayer) { e.buttonList.add(new GuiButton(999, 5, 5, 100, 20, "TokenAuth")); } } @SubscribeEvent public void onDrawScreenPost(GuiScreenEvent.DrawScreenEvent.Post e) { if (e.gui instanceof GuiMultiplayer) { String status = String.format("User: §a%s §rUUID: §a%s", mc.field_71449_j.func_111285_a(), mc.field_71449_j.func_148255_b()); Minecraft.func_71410_x().field_71466_p.func_78276_b(status, 115, 10, Color.WHITE.getRGB()); } } @SubscribeEvent public void onActionPerformedPre(GuiScreenEvent.ActionPerformedEvent.Pre e) { if (e.gui instanceof GuiMultiplayer && e.button.field_146127_k == 999) { Minecraft.func_71410_x().func_147108_a(new SessionGui(e.gui)); } } static { originalSession = mc.field_71449_j; } }
  12. Here, I don't have the version 1.8.9, the oldest version here is 1.16.5. I need help setting up 1.8.9 minecraft version for creating mods in IntelliJ IDEA.
  13. I'm having issues getting my animated model to work properly. When the block is placed, the model animates properly however there is an underlying, non-animating black version of it that is rendering within it. I get no console errors. The black version has all of the fan-blades rendered instead of alternating from one set to another. Block Init: Fan Class: Fan Blockstate:
  14. I am working on updating my mod from 1.7.10 to 1.8.9. In 1.7 i had an inventory that can hold a single block and that block changes the look of the block to the one in the inventory. but with the new json rendering thing i have no idea about how to even touch this. if you can give me any information about how to get this done, I would be grateful.
×
×
  • Create New...

Important Information

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