Jump to content

jcranky

Forge Modder
  • Posts

    106
  • Joined

  • Last visited

Everything posted by jcranky

  1. You can try communicate over the wire. TCP/IP might be too have, but there are other, lighter, options out there (their names just escaped me ).
  2. If you are not understanding what people are telling you, you need to research a bit about what a library (a jar file in the Java world) is.
  3. If you really want to find GradleStart you can open the .class file and see the recreated source code in your IDE. In IDEA, you would do ctrl + shift + n, type in GradleStart and there it is. Although diesieben07's answers seems really good to me.
  4. Another wild guess: most events have a setCanceled method.
  5. Wild guess, entity.onGround being false makes it try to fall?
  6. I'm not sure about Mac, since I'm a linux user myself. But it's been a while since Oracle provides Java for Mac OS as well: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html Or perhaps what TGG meant was the combination Java 8 + Mac + Minecraft Launcher?
  7. For 2. check EntityRegistry.addSpawn - you have to pass in the biome to spawn in there. Perhaps you can get the list of available biomes and use it with this method.
  8. Thank you TGG ! I managed to kick-start my tests from a preInit - which is enough for now. I might change for a item or something if I end up needing a running world at some point. I'm not using junit as well, but specs2 instead, a scala testing framework. I still have to figure out a good way to call specs2 (its a bit ugly right now) - but I already know it is possible and solve the previous issues. My plan to lower issue with the tests in the src/main folder is to have all tests in a separated mod, so that they don't have to be bundled with the library itself. So the idea would be that the test mod depends on the library, and all I have to do is to add the mod to a mods folder of any minecraft installation and it should work. Makes sense? []s,
  9. No more errors in the console? Nothing like a FileNotFoundException nor anything like that?
  10. Now this is something I haven't considered. Other than being triggered from inside the game, the tests ended up being just plain old junit tests? Even if it is not a clean way to write tests, it certainly sounds like a whole lot more fun then fighting classloaders or stubbing whole universes =)
  11. I would be ok with a full startup if that is what is required. I'm developing a lib for modders, so it is quite hard to be totally isolated here. From the error, I got that using the LaunchClassLoader is necessary. I tried a custom junit runner which included the code bellow. The code is scala but is very straightforward to read. val classLoader = new LaunchClassLoader(Thread.currentThread.getContextClassLoader.asInstanceOf[urlClassLoader].getURLs) Thread.currentThread.setContextClassLoader(classLoader) But then this ended up destroying the specs2 context. The error is: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.intellij.junit4.IdeaSuite.getDescription(IdeaSuite.java:55) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:43) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) Caused by: java.lang.ClassCastException: com.easyforger.recipes.RecipesSpec cannot be cast to org.specs2.specification.core.SpecificationStructure which feels like classloaders being mixed up. Does what I tried make sense? Or perhaps there is a better way to trigger the full startup and lets things be available for usage?
  12. I see. So I figured I could call Item.registerItems() but this fails with: sun.misc.Launcher$AppClassLoader cannot be cast to net.minecraft.launchwrapper.LaunchClassLoader java.lang.ClassCastException: sun.misc.Launcher$AppClassLoader cannot be cast to net.minecraft.launchwrapper.LaunchClassLoader at cpw.mods.fml.common.ModClassLoader.<init>(ModClassLoader.java:46) at cpw.mods.fml.common.Loader.<init>(Loader.java:181)
  13. Hi, I'm trying to write a unit test that access Items and Blocks. Now, Items and Blocks lists are null during such tests.... Like: println(Items.leather) This prints null. Is there a way to initialize correctly the items and blocks in a test scope, i.e., without having the game running? thank you! []s,
  14. Problem solved. See my comment at the OPs script here: https://gist.github.com/mosabua/cd0d5a4ddac550273157
  15. Hi, Since gradle cache cannot be moved from machine to machine, your tutorial is exactly what I need. Except that it is not working for me =( The error I'm getting is the following: > Could not resolve all dependencies for configuration ':classpath'. > Could not find net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT. Searched in the following locations: http://localhost:8081/nexus/content/groups/public/net/minecraftforge/gradle/ForgeGradle/1.2-SNAPSHOT/maven-metadata.xml http://localhost:8081/nexus/content/groups/public/net/minecraftforge/gradle/ForgeGradle/1.2-SNAPSHOT/ForgeGradle-1.2-SNAPSHOT.pom http://localhost:8081/nexus/content/groups/public/net/minecraftforge/gradle/ForgeGradle/1.2-SNAPSHOT/ForgeGradle-1.2-SNAPSHOT.jar I even tried to add files.minecraftforge.net/maven to nexus, but without any different results. thank you! []s,
  16. I was trying to do it without the whole ForgeGradle environment. Now, since I decided to stick to gradle, having that environment probably won't be really a problem - I'll roll with that for now. Thank you =)
  17. So... I'll try to keep things simple and run with gradle. I added this to my build: but gradle couldn't find it. What's wrong? I have a full forge mod project that runs fine, so the jar is there. I also tried this: with the same results. thanks!
  18. But that only publishes to the gradle cache, right? This means I would have to use gradle in my lib as well (I planned to use sbt). should install stuff in the maven cache, and then I would be able to access to it from sbt as well. I guess the jars are published via code, so that's why install doesn't do that to them? Can you point me at where those tasks are implemented? I'm not familiar with gradle plugin development. Also, if I end up using gradle instead, where should I look to understand what group / artifact / version I need to mention in my project config? thanks!
  19. Makes sense, unfortunately. Publishing locally should be safe, though? Would ForgeGradle support that? I tried a quick ./gradlew install but nothing seemed to happen. thanks!
  20. Hi, Is there any way to access the forge jar as a maven dependency? I want to write a library with helpers, that can later be used by a mod, in a normal gradle mod build. Or perhaps my only alternative would be to add 'forge-<version>-userdev.jar' directly? thank you! []s,
  21. I'm also facing this problem. I have no firewalls running, and even so, its a 403 from the server, so...
×
×
  • Create New...

Important Information

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