Jump to content

powns

Members
  • Posts

    32
  • Joined

  • Last visited

Everything posted by powns

  1. That indeed worked.... I am willing to jump off a cliff rn lol thanks for your help
  2. I am basically willing to bind a resourcelocation to the renderEngine using a file stored in my assets folder. Whenever i try to bind it using this.mc.renderEngine.bindTexture(new ResourceLocation("pownscoordshud", "textures/gui/idek.png")); it keeps throwing the following error: [21:05:53] [Client thread/WARN]: Failed to load texture: pownscoordshud:textures/textures/gui/idek.png java.io.FileNotFoundException: pownscoordshud:textures/textures/gui/idek.png My modid is: pownscoordshud. I have checked it mutliple times and i do not have any spelling errors within the ResourceLocation adress. Can someone please explain me what I am doing wrong here?
  3. Whenever I try to obtain info from the scoreboard in f.e. Skywars it only seems to return the first 14 characters of the full string....Does anyone know how to fix this?Src of the method i use to parse the strings: The method: public static Collection<String> getAllSBInfo(Scoreboard sb){ return sb.getObjectiveNames(); } How I call it in my test command: for(String s : this.mod.getAllSBInfo(Minecraft.getMinecraft().theWorld.getScoreboard())){ sender.addChatMessage((IChatComponent) new ChatComponentText(EnumChatFormatting.getTextWithoutFormattingCodes(s))); }
  4. People still don't seem to realise the fuckton of people making mods in 1.7 and 1.8 since they are the best version out there... lol
  5. I made a mod which contains a tweakerclass which actually gets loaded and does what it has to do (modify some minor values from a vanilla class using ASM). For some odd reason however, it does not load the main mod class, it looks like its completely ignored..? Would anyone know why this happens?
  6. Whenever i run my mod within the test environment from eclipse everything works fine, but as soon as i try to build the mod and install it in my modsfolders this happens: java.lang.NoClassDefFoundError: net/minecraft/command/ICommand at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:344) at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:440) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119) at cpw.mods.fml.common.Loader.loadMods(Loader.java:513) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:208) at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:480) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:878) at net.minecraft.client.main.Main.main(SourceFile:148) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) Caused by: java.lang.ClassNotFoundException: net.minecraft.command.ICommand at java.net.URLClassLoader$1.run(URLClassLoader.java:372) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:360) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 35 more Could someone tell me whats wrong?
  7. As i said before, if mojang did not completely ignore the pvp community and keep the combat mechanics the same i would have never ever used minecraft versions from 2014. But in that case I understand and respect it that you guys are not willing to support me into doing this. Regardless of that, I want to thank you for all your help.
  8. But modifying the vanilla EntityLivingBase class would be possible with ASM right? What if i just modify the vanilla method that updates potions so that i can get it to un every tick regardless of the boolean's state?
  9. I do know what overriding means. I do not know how to get that to work in forge modding as i am still rather new to this. The way i would want this to work is by setting the private boolean potionsNeedUpdate to true as soon as i change the color of a certain potion type. That way, correct me if im wrong, it should update all the potions to have its new liquidColor. My idea was to override the updatePotionMetadata() method from the LivingEntityBase class so that i can call that method whenever i need it. It makes sense for me, but it is probably a rather amateuristic way of seeing this.
  10. Yeah, in 1.8.9 it is handled by a DataWatcher, but unfortunately I have no idea how to override the method you mentioned above. Could you maybe explain that to me a bit more?
  11. would it be possible to recode that event in forge 1.7.10 and 1.8.9?
  12. well it looks like it has to do with the method on the screenshot i added to this reply would you know how to keep the private boolean potionsNeedUpdate on true all the time? @diesieben07
  13. I will do that, I might have found a solution and i will post it here if it works so that other people would be able to benefit from it too thanks for your help!
  14. I would do that if 1.9+ would be good for pvp. The mods i make have an audience that either plays on 1.7.10 or 1.8.9. But you said that the color is queried and computed every tick, is there a way that i can see where that happens in the vanilla source code?
  15. If i start up a game and do not get the potion item to show up at all, either in an inventory or in my hand, i can change the color. Once i "load" the potion by showing it in an inventory or in my hand the color will have changed to the latest color i changed it to. But after that i can still change the liquidColor Integer but it will no longer update potion colors anymore. I thought it wouldve been possible to make it still work by making all the textures reload, but that does not seem to work. Now I am lowkey clueless on how to make it possible to change the color whenever i want, even if i have shown/seen the item before.
  16. As i said before, when i change the color field it does work as long as i do not load any potions. Once i have loaded them the color will stay to the last color i set it to before loading them in, even if i change the liquidColor again. If i would log the color int in the console it will log the most recent color i want it to be. But it will still not render with that color because it loaded with another, previous, color. How would i be able to make it update instantly after changing the color using the method i showed?
  17. My question is: Would there be any way to maybe reload the Potion class and the textures so that it would possibly work without having to restart minecraft?
  18. public void changeHealpotColor(int color){ try{ Class potionClass = Potion.class; ReflectionHelper.setPrivateValue(potionClass, Potion.heal, color, "liquidColor"); //Minecraft.getMinecraft().refreshResources(); } catch(Exception e){ e.printStackTrace(); } } this is what i am using, the method i commented out is what i tried to do to re-render the potion overlay to hopefully update the color. But that did not work
  19. I thought this would remove the "final" modifier . I know it works without but i seem to not have removed it after testing. Even when i remove it it doesnt work. I feel like i need to reload something within forge for the recoloring to work without restarting the game, but i do not know how
  20. public void changeHealpotColor(int color){ try{ Class potionClass = Potion.class; Field f = potionClass.getField("heal"); f.setAccessible(true); Field modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); modifiersField.setInt(f, f.getModifiers() & ~Modifier.FINAL); ReflectionHelper.setPrivateValue(potionClass, Potion.heal, color, "liquidColor"); } catch(Exception e){ e.printStackTrace(); } } this is the source code i use to change the liquidColor
  21. As the title says, I used reflection to modify the liquidColor value of a healing potion (Potion.heal). Whenever i use a command to change its color i let it print out the RGB color int in the console which does actually change (System.out.println(Potion.heal.getLiquidColor());) but it does not seem to actually change the color once the potion texture has been loaded once... Is there something i forgot to do? Let me know if you need to have some insight on my source code.
  22. I got it to work after some time, i had to remove the "final" modifier before being able to change it. And for Jabelar, idk how its in new versions of forge but in 1.8.9, the version im coding in, this does work. Thank you both for your time!
  23. All i pretty much want to do is modify the vanilla Potion class. I want to change the field Potion.heal by replacing it with a new instance of a custom potion class that extends Potion. The code which i have in my post init method can be found down below: try{ Class potionClass = Potion.class; Field f = potionClass.getField("heal"); f.setAccessible(true); f.set(Potion.heal, ChromaPotion.recoloredHeal); } catch(Exception e){ e.printStackTrace(); } Even though i do set the field's accesibilty to true it still throws an IllegalAccessException... Could someone please explain me where I messed up? (yes i am aware that reflection isn't the most efficient way of doing stuff)
×
×
  • Create New...

Important Information

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