Jump to content

freundTech

Members
  • Posts

    14
  • Joined

  • Last visited

Everything posted by freundTech

  1. Ok. Making progress almost everything works. (In my dev env everything works, but when exported not). The problem is, that the natives are missing. I noticed that, when minecraft is being started a natives folder is created inside ~/.minecraft/versions/<forgeversion>. This folder is deleted when minecraft is being shutdown. When I now try to restart it it won't start, because the natives are missing. What is putting the natives there (I guess it's the launcher) and how is it putting them there? Can this be triggered by a program or do I have to search and copy them manually? (Edit: Also when searching through .minecraft those are the only files with those names. So where are they from?) (Edit2: Launcher profile states 16:13:04 INFO]: Unpacking natives to /home/******/.minecraft/versions/1.8-Forge11.14.0.1296/1.8-Forge11.14.0.1296-natives-5775183669701 But where are they being unpacked from?) (Edit3: Found them. They are packed into jars at /home/******/.minecraft/libraries/org/lwjgl/lwjgl/lwjgl-platform/2.9.1/lwjgl-platform-2.9.1-natives-linux.jar and /home/******/.minecraft/libraries/net/java/jinput/jinput-platform/2.0.5/jinput-platform-2.0.5-natives-linux.jar. Anyone can tell me how they are named on Windows? (I can check Mac myself.))
  2. Not really. dlls have to be unpacked to be used. But you could pack in in to the .jar and have your mod automatically unpack it. That would work.
  3. I don't think there is a way to get around using a .dll. But you can, instead of installing it, put in in the same folder as your mod (Or any other folder) and specify the folder using System.setProperty( "java.library.path", "/path/to/libs" ); Field fieldSysPath = ClassLoader.class.getDeclaredField( "sys_paths" ); fieldSysPath.setAccessible( true ); fieldSysPath.set( null, null ); (Source: http://blog.cedarsoft.com/2010/11/setting-java-library-path-programmatically/) (Normally you have to specify the path before starting the program as a jvm argument, but this hack can change it afterwards) Also you might get better answers in an arduino forum, than in a minecraft modding forum
  4. As far as I know forge has an api for adding config pages to mods, but the last time I checked it out it wasn't finished. The other way would be to register a GuiScreenEvent.DrawScreenEvent, check which GUI is being drawn and if it is the options gui draw your own stuff on top. (Like for example a Button that opens your mods config page.)
  5. I'm trying to do the same thing. This might help: http://www.minecraftforge.net/forum/index.php/topic,28688.0.html
  6. Thanks. I think I know what I have to do now. In case anyone else is trying to figure out how to get the commandline arguments (Took me quite a while to figure out, because I couldn't find it on google): import net.minecraft.launchwrapper.Launch; Launch.blackboard.get("ArgumentList");
  7. Hello, I'm trying to write an ingame modupdate notifier/1-click mod updater and for this I need to restart Minecraft. I wanted to look at the source of the GradleStart.class to see how the forge dev workspace starts it, but I can't find the source code anywhere. (I looked at the local files and the Minecraftforge and ForgeGradle Github) Is the sourcecode for those classes even public? If yes: where can I find it, if no: Can anyone tell me how I can start minecraft without the launcher (From command line)? freundTech
  8. It CAN, but it doesn't most of the time. It should work fine as long as both items are just normal items without any special data saved to them. EDIT: Typo
  9. I actually tried to figure out the same thing just yesterday, and I managed to do it without a Core Mod. I'm using 1.8, so I'm not sure if my code will work in 1.7. First add those to attributes to your mod class: private FMLControlledNamespacedRegistry<Item> iItemRegistry; private Method addObjectRaw; Second add this to your preInit: try { Method getMain = GameData.class.getDeclaredMethod("getMain"); getMain.setAccessible(true); GameData gameData = (GameData) getMain.invoke(null); Field f = GameData.class.getDeclaredField("iItemRegistry"); f.setAccessible(true); iItemRegistry = (FMLControlledNamespacedRegistry<Item>) f.get(gameData); addObjectRaw = FMLControlledNamespacedRegistry.class.getDeclaredMethod("addObjectRaw", Integer.TYPE, Object.class, Object.class); addObjectRaw.setAccessible(true); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } The last thing you have to do is call addObjectRaw.invoke in your init: addObjectRaw.invoke(iItemRegistry, <item it to overwrite>, new ResourceLocation(<resource name>), <item to overwrite with>); NOTE: You have to manually replace the Method and Field names with their obfuscated names before releasing the mod or do something like this: Method getMain; try { try { getMain = GameData.class.getDeclaredMethod("getMain"); } catch(NoSuchMethodException e) { getMain = GameData.class.getDeclaredMethod("<Obfuscated name>"); } } catch(Exception e) { }
  10. Hello. Is there an event to detect whenever a mob/entity spawns? I want to get notified whenever a Pigman spawns and give them a custom Item (at random). I've Tried LivingSpawnEvent.CheckSpawn in combination with LivingSpawnEvent.SpecialSpawn, but It doesn't fire when spawning from a spawnegg or using /summon. I've also tried EntityJoinWorldEvent, but it fires again when you reload the world. What I need is an event, that get's fired once per mob, as soon as the mob spawns. freundTech
  11. I found a workaround. I'm listening for an onPlayerTick event and then I'm checking if event.player.hurtTime>0. It works, but it would be nicer if I could do it with an onLivingHurt event.
  12. I'm writing a clientside only mod, that adds support for playing with a Wii remote. I tried activating the rumble on the Wii remote when the player takes damage by listening for a onLivingHurt event and checking if a player was hurt, but it seams like the event is only getting fired on the server (In singleplayer my code works but not on a server). Is there a way to listen for this event on the client or another event that is fired when the client's player takes damage?
×
×
  • Create New...

Important Information

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