Jump to content

Two

Members
  • Posts

    63
  • Joined

  • Last visited

Posts posted by Two

  1. That was my second try, however the texture I get is very strange and does not include many blocks that are present in the world. The UV of leaves for example points to an empty part of that texture, and I am not sure yet why. It might be an error on my part, but then I figure that at some point the textures are loaded from disk anyway, so why get them via texture buffer?

     

    As far as I understand it, there has to be some point where the texture files are actually loaded from disk in the form of a BufferedImage. What I would like to do is to either somehow do the same, or to intercept that either while it is loading or at a later time if that image data is kept in memory afterwards.

  2. One build.gradle coming up:

     

     

    buildscript {

      repositories {

        mavenCentral()

        maven {

          name = "forge"

          url = "http://files.minecraftforge.net/maven"

        }

        maven {

          name = "sonatype"

          url = "https://oss.sonatype.org/content/repositories/snapshots/"

        }

      }

      dependencies {

        classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'

        testCompile "junit:junit:4.11"

      }

    }

     

    apply plugin: 'forge'

     

    version = '3.1710.0'

    group = 'mapwriter'

    archivesBaseName = 'MapWriter'

     

    minecraft {

      version = '1.7.10-10.13.1.1222'

      assetDir = "run/assets"

      runDir = "run"

    }

    processResources

    {

      // replace stuff in mcmod.info, nothing else

      from(sourceSets.main.resources.srcDirs) {

        include 'mcmod.info'

           

        // replace version and mcversion

        expand 'version':project.version, 'mcversion':project.minecraft.version

      }

       

      // copy everything else, thats not the mcmod.info

      from(sourceSets.main.resources.srcDirs) {

        exclude 'mcmod.info'

      }

    }

     

    jar {

      //classifier = 'universal'

      version = "${project.minecraft.version}-${project.version}"

    }

     

    task sourceJar(type: Jar) {

      from sourceSets.main.allSource

      classifier = 'sources'

      version = "${project.minecraft.version}-${project.version}"

    }

     

    task deobfJar(type: Jar) {

      from sourceSets.main.output

      classifier = 'deobf'

      version = "${project.minecraft.version}-${project.version}"

    }

     

    artifacts {

      archives sourceJar, deobfJar

    }

     

     

  3. I am currently trying to write a minimap addon and I am desperately trying to find a method that allows me to get a block's top texture reliably.

     

    So far I tried to get the texture directly from the IIcon by casting it to a TextureAtlasSprite if possible, but that is limited to only a few blocks.

     

    I also tried to fetch the image directly from the texture that holds the block faces, but that feels very hacky to me and requires exact timing to actually get the block texture properly.

     

    Is there a better/reliable way to get the top texture of any block that has one?

  4. If I try to add the very same line as you have, I get the following error:

    * What went wrong:
    A problem occurred evaluating root project 'mc-forge-1710-mapwriter'.
    > Could not find method testCompile() for arguments [junit:junit:4.11] on org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler_Decorated@ff5762d.

  5. I've been trying to get JUnit tests to run with  Forge Gradle (1222), but I can't seem to get anything to work, and external resources are not helpful at all.

     

    Situation:

    I have a class that needs testing, so I auto-generated a JUnit 4 test class, which ended up in the test packages folder.

     

    Problem:

    - JUnit jar is not recognized, therefore test classes won't compile.

    - Adding JUnit dependency manually according to the gradle guide doesn't work even the slightest.

     

    How do I add JUnit jars to the test build properly so I can run the test case?

  6. Last time I asked I was told that a Java version update would be possible as long as everyone does it. If that's still true: how about doing a version update once 1.8 is ready?

     

    As Java 8 is out for over half a year now, it can be safely assumed that it is mature enough. And with Java 8 we would get many features that would make life as a developer a lot easier.

     

    The very useful Lambda operations are just one massive reason to go with Java 8. It not only allows to shorten many constructs, in addition the ability to execute code in parallel on the fly can be a massive speed increase to many mods. Then we have enhanced concurrent operations, additional Math methods that help a lot with bit-wise operations, Optionals to get rid of all those NullPointerExceptions, default methods and function parameters which will make designing APIs a lot easier, and on top of that all features of Java 7.

     

    As far as I understand it, all that has to be done would be to change the compile target in Forge and we should be good to go?

  7. Thanks for the answers Lex, I have a feeling that this must be a difficult time for you as you already said: you base your whole income on a very vague future at the moment. Let's hope that Microsoft does not destroy the game as many fear.

     

    My estimation is that Microsoft will realize that Minecraft and its very special community is something delicate to deal with, especially since many former Mojang developers will stay to tell them. I assume they will receive some additional senior developers from the MS pool to advance the quality of the game, eventually to a state where one could call it well programmed. I am just not so sure it will still be Java once they are done.

     

    Modding is something that drives this game and keeps customers happy, Microsoft would be stupid to throw that away, and I don't think that is going to happen. I could imagine two scenarios: the one that they will develop a modding API on their own (and license it) and the other that they will acquire one. Which one that would be in scenario two is obvious I think. As a business entrepreneur, maybe it might be an idea to talk to them about that scenario while they are still in the decision making process. Because, to be honest, I'd rather like to see a Forge API than any of those Microsoft nightmares.

  8. I updated the initial post to reflect the changes. I still cannot figure out how to run individual tasks in NetBeans, just because the list of tasks is so huge that the window does not display any beyond the 'jar' task. Not sure what to do about this, but then you can always edit the run task to have it execute the proper 'runClient' or 'runServer' task.

  9. Sorry for long time no answer and big thanks for the fix!

     

    I just tested the change with the current Forge version (172-10.12.1.1061) and it works.

     

    If you just hit the run tasks, it complains because no main class has been set. This is understandable because the script doesn't know if I want to run server or client obviously. It might be a good idea to default the run to runClient, because that is what most people want to run.

     

    If I change the built-in run task to run 'runClient' instead, the client launches properly and everything seems to work fine. I got at some point an error about the lwjgl missing, but the second time I run "setupDecompWorkspace" the error was gone. No clue what caused that on my first try.

  10. Stuff compiled with java 6 should run fine with java 7. So yes, users can run mods compiled against java 6 alongside your mod if they use java 7.

     

    So basically I should enable --target 1.7 asap, because nothing can go wrong, except for the few players who happen to not have J7 installed?

  11. With your hint that the Forge build scripts actually do not define a proper run task, I tried to rule out all IDE problems by disabling the internal tasks and then writing my own run according to the official Gradle documentation:

    apply plugin: 'java'
    
    task(run, dependsOn: 'classes', type: JavaExec) {
      classpath = sourceSets.main.runtimeClasspath
      main = 'net.minecraft.launchwrapper.Launch'
      args '--version 1.6 --tweakClass cpw.mods.fml.common.launcher.FMLTweaker --accessToken FML'
      jvmArgs '-Xincgc -Xmx1G -Xms1G -Dfml.ignoreInvalidMinecraftCertificates=true'
    }

     

    And again the command-line parameters are ignored and the run fails, because Forge still uses the VanillaTweaker.

    [14:40:06] [main/INFO]: Loading tweak class name net.minecraft.launchwrapper.VanillaTweaker
    [14:40:06] [main/INFO]: Using primary tweak class name net.minecraft.launchwrapper.VanillaTweaker
    [14:40:06] [main/INFO]: Calling tweak class net.minecraft.launchwrapper.VanillaTweaker
    [14:40:06] [main/ERROR]: Unable to launch
    java.lang.NoSuchMethodException: net.minecraft.client.Minecraft.main([Ljava.lang.String;)
    at java.lang.Class.getMethod(Class.java:1665) ~[?:1.7.0_45]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) [launchwrapper-1.9.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]

     

    I would now consider this a bug.

  12. Not sure why you're trying to go through gradle to start the game, your ide should be perfectly capabile of launching java with whatever arguments you give it...

    Because the Gradle-Plugin expects the game to be launched with a Gradle call. Which kind of makes sense, since otherwise I would have to break out of the entire Gradle-concept just to launch the application.

     

    This as well renders the concept of an Eclipse support pointless, because Gradle is Gradle and independent from the IDE used if implemented correctly.

  13. I've been trying to setup Forge 1.7.2 Gradle with Netbeans without success so far. You can see the steps I've taken here.

     

    The command I added:

    -Pargs="--tweakClass cpw.mods.fml.common.launcher.FMLTweaker --version 1.6"

     

    The main problem is, that even though I have correctly added the command-line parameters for the tweaker class (according to all sources on Gradle that I could find), Forge still uses the vanilla tweaker, and I cannot figure out why. And there is no error message (except for the vanilla error) that would help me on finding the issue.

    It would be great if anyone could help me on this problem.

     

    In addition I think it would be a good idea to add the correct tweaker class parameter to the setupdev task, because every dev will have to set that parameter otherwise by hand. So setting it by default might reduce the amount of 'Gradle doesn't work' topics. ;)

  14. Edit your netbeans run configs directly, don't mess in the build.gradle.

     

    This was one of my many attempts, but whatever I do, the arguments are always ignored even if definitely present, and I have no clue why.

     

    Edit: I changed the tutorial so that it adds the required parameters to the run config. It doesn't fix the problem, however.

  15. You can see a working example in my mod.

    worldObj.playSoundEffect((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D, TwoTility.proxy.SOUND_FLUIDSUCKIN, 0.6F, worldObj.rand.nextFloat() * 0.1F + 0.9F);

     

    Where the parameters are: x, y, z, soundName, volume, pitch

     

    The point is that you first need to register the sound (as done in my ProxyBase (should actually be done in ProxyClient)):

    @ForgeSubscribe
    public void onSoundSetup(final SoundLoadEvent event) {
      event.manager.addSound(SOUND_FLUIDSUCKIN + ".ogg");
    }

     

    Where SOUND_FLUIDSUCKIN is: TwoTility.MOD_ID + ":" + "fluidsuckin"

    And the sound-file is stored in: assets\twotility\sound

×
×
  • Create New...

Important Information

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