Jump to content

sequituri

Forge Modder
  • Posts

    669
  • Joined

  • Last visited

Posts posted by sequituri

  1. Just to see if my project could use some new java features - iterfaces with default methods, method references in lambdas, and such, I set the sourceCompatibility and targetCompatibility = 8 in my build.gradle and tried to build.

     

    The build failed and the error is here: (I snipped away the successful stuff)

     

     

    14:59:22.177 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :reobf FAILED
    14:59:22.183 [iNFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :reobf (Thread[main,5,main]) completed. Took 0.793 secs.
    14:59:22.189 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[main,5,main]] finished, busy: 6.546 secs, idle: 0.098 secs
    14:59:22.198 [ERROR] [org.gradle.BuildExceptionReporter]
    14:59:22.206 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
    14:59:22.215 [ERROR] [org.gradle.BuildExceptionReporter]
    14:59:22.220 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
    14:59:22.225 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':reobf'.
    14:59:22.230 [ERROR] [org.gradle.BuildExceptionReporter] > java.lang.IllegalArgumentException (no error message)
    14:59:22.802 [ERROR] [org.gradle.BuildExceptionReporter]
    14:59:22.807 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
    14:59:22.811 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':reobf'.
    14:59:22.815 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActi
    onsTaskExecuter.java:69)
    14:59:22.820 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTask
    Executer.java:46)
    14:59:22.824 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecuti
    onAnalysisTaskExecuter.java:35)
    14:59:22.827 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExec
    uter.java:64)
    14:59:22.832 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter
    .java:58)
    14:59:22.836 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySou
    rceFilesTaskExecuter.java:42)
    14:59:22.841 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoA
    ctionsExecuter.java:52)
    14:59:22.845 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter
    .java:53)
    14:59:22.849 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOn
    ceTaskExecuter.java:43)
    14:59:22.853 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:289)
    
    14:59:22.857 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(Abstra
    ctTaskPlanExecutor.java:79)
    14:59:22.861 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(Abstra
    ctTaskPlanExecutor.java:63)
    14:59:22.866 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPl
    anExecutor.java:51)
    14:59:22.870 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:2
    3)
    14:59:22.874 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java
    :86)
    14:59:22.878 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
    
    14:59:22.882 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
    14:59:22.886 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
    14:59:22.890 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
    14:59:22.894 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
    14:59:22.899 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
    14:59:22.903 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
    14:59:22.907 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:166)
    
    14:59:22.911 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
    14:59:22.915 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
    14:59:22.919 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBui
    ldActionExecuter.java:64)
    14:59:22.923 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
    14:59:22.927 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
    14:59:22.931 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.ja
    va:35)
    14:59:22.935 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.ja
    va:26)
    14:59:22.940 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
    14:59:22.944 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
    14:59:22.948 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActio
    nFactory.java:201)
    14:59:22.952 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActio
    nFactory.java:174)
    14:59:22.956 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory
    .java:170)
    14:59:22.960 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory
    .java:139)
    14:59:22.967 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
    14:59:22.971 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
    14:59:22.975 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.Main.doAction(Main.java:46)
    14:59:22.979 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
    14:59:22.983 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.Main.main(Main.java:37)
    14:59:22.987 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
    14:59:22.991 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
    14:59:22.995 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
    14:59:22.999 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.IllegalArgumentException
    14:59:23.003 [ERROR] [org.gradle.BuildExceptionReporter]        at org.objectweb.asm.ClassReader.<init>(ClassReader.java:170)
    14:59:23.007 [ERROR] [org.gradle.BuildExceptionReporter]        at org.objectweb.asm.ClassReader.<init>(ClassReader.java:153)
    14:59:23.011 [ERROR] [org.gradle.BuildExceptionReporter]        at org.objectweb.asm.ClassReader.<init>(ClassReader.java:424)
    14:59:23.015 [ERROR] [org.gradle.BuildExceptionReporter]        at net.md_5.specialsource.JarRemapper.remapClassFile(JarRemapper.java:228)
    14:59:23.019 [ERROR] [org.gradle.BuildExceptionReporter]        at net.md_5.specialsource.JarRemapper.remapJar(JarRemapper.java:189)
    14:59:23.023 [ERROR] [org.gradle.BuildExceptionReporter]        at net.minecraftforge.gradle.tasks.user.reobf.ObfArtifact.applySpecialSource(ObfArtifact.java:36
    7)
    14:59:23.027 [ERROR] [org.gradle.BuildExceptionReporter]        at net.minecraftforge.gradle.tasks.user.reobf.ObfArtifact.generate(ObfArtifact.java:336)
    14:59:23.031 [ERROR] [org.gradle.BuildExceptionReporter]        at net.minecraftforge.gradle.tasks.user.reobf.ReobfTask.doTask(ReobfTask.java:294)
    14:59:23.035 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
    14:59:23.039 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskActio
    n.doExecute(AnnotationProcessingTaskFactory.java:219)
    14:59:23.043 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskActio
    n.execute(AnnotationProcessingTaskFactory.java:212)
    14:59:23.047 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskActio
    n.execute(AnnotationProcessingTaskFactory.java:201)
    14:59:23.052 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:533)
    14:59:23.056 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:516)
    14:59:23.060 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActio
    nsTaskExecuter.java:80)
    14:59:23.064 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActi
    onsTaskExecuter.java:61)
    14:59:23.071 [ERROR] [org.gradle.BuildExceptionReporter]        ... 43 more
    14:59:23.077 [ERROR] [org.gradle.BuildExceptionReporter]
    14:59:23.081 [LIFECYCLE] [org.gradle.BuildResultLogger]
    14:59:23.085 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED
    14:59:23.090 [LIFECYCLE] [org.gradle.BuildResultLogger]
    14:59:23.094 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 22.516 secs
    

     

     

    It appears that org.ow2.asm.4x is not compatible with java 8 for the :reObf task to complete properly. There is a 5.0 and 5.0.1 version available that would solve this issue, but I could not figure out how to make gradle use it. Is this a future enhancement, or will Forge always be stuck at 1.6 compatibility?

     

  2. derp! I just realized that despite the similarity of names, TileEntities do not inherit from Entity in any way.

     

    I also just figured out that an Entity (like EntityMinecartChest) can move but a TileEntity (like TileEntityChest) cannot. I wonder if that is the only difference, since both can have inventories and additional data and NBT's. I would be nice to be able to learn all this on the Wiki...

  3. The Hopper uses a method that looks somewhat reasonable for finding nearby TEs.

    world.getEntitiesWithinAABBExcludingEntity((Entity)null, AxisAlignedBB.getAABBPool().getAABB(xPos, yPos, zPos, xPos + 1.0D, yPos + 1.0D, zPos + 1.0D), IEntitySelector.selectInventories);
    

    The first argument is the entity to exclude - don't want to include oneself.

    The last one filters by EntityTypes.

    It would be nice to know if this is one of the better (faster) methods.

  4. You didn't happen to notice that part of your copied code sets the metadata in the range [2,5] and the rest sets the metadata in the range [0,3]? You really need to decide if you are encoding the facing direction as in 0==north, 1==west... etc. or are you encoding it as a an unencoded direction (as in 0=down, 1=up, 2=north.. etc). You really cannot code it both ways.

  5. Why are you testing this tag:

    if (item.stackTagCompound.getTag("ench") != null) 

    and then using this other tag as if you know its contents are non-null:

    enchants = (NBTTagList) item.stackTagCompound.getTag("StoredEnchantments")

    ? The "ench" tag is not the same tag as the "StoredEnchantments" tag. Why not test the tag you are actually setting enchants to?

  6. Did you check that EntityAnimal actually has the attributes:

    this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D);
            this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.3D);

    that you are trying to set values on?

    I'm guessing it doesn't and that is causing your NPE.

  7. This code might save a few bytes of space. But, I haven't tested it, so use as your own risk.

     

        @Override
        public void readFromNBT(final NBTTagCompound nbttagcompound) {
            if (nbttagcompound == null)
                //Assembly.logger.warn("AssemblyCounter should read from null NBT ?!");
                return;
            super.readFromNBT(nbttagcompound);
            NBTTagCompound cdTag = nbttagcompound.getCompoundTag("counterdata");
            int sizes = cdTag.getInteger("countersize");
            int[] ids = cdTag.getIntArray("id");
            int[] damages = cdTag.getIntArray("damage");
            int[] counts = cdTag.getIntArray("count");
            counter.clear();
            for (int i = 0; i < sizes; ++i)
                counter.put(new int[] {ids[i],  damages[i]}, counts[i]);
        }
        @Override
        public void writeToNBT(final NBTTagCompound nbttagcompound) {
            super.writeToNBT(nbttagcompound);
            final NBTTagCompound nbt = new NBTTagCompound();
    
            nbt.setInteger("countersize", counter.size());
            final int[][] splat = split(counter.keySet());
            nbt.setIntArray("id",  splat[0]);
            nbt.setIntArray("damage", splat[1]);
            nbt.setIntArray("count", ArrayUtils.toPrimitive(counter.values().toArray(new Integer[0])));
    
            nbttagcompound.setTag("counterdata", nbt);
        }
        int[][] split(final Set<int[]> in) {
            final int[] a0 = new int[in.size()];
            final int[] a1 = new int[in.size()];
            int o = 0;
            for (final int[] a: in) {
                a0[o] = a[0];
                a1[o++] = a[1];
            }
            return new int[][] { a0, a1};
        }
    

     

  8. I'll give you the answer that someone else on the forum gave a couple days ago:

    Use getIconFromSideAndMetadata for your furnace block.

    If side == 0 and metadata == 0, return the icon for side 2

    Of course, this assumes your storing your orientation in metadata like the vanilla furnace does. Because, furnaces are never oriented to side 0 or 1 (top of bottom side), so it's safe to assume the item is still in inventory.

  9. If you are running Java 8 then you'll want to get the newest Forge (1049) from the Files section. LexManos explains that it works with Java 8 because of the FernFLower fix he made.

    If you aren't using Java 8, then IDK what's wrong, and I can't help you.

  10. In 1.7.x, you can use the method setHarvestLevel("axe",n) and setHarvestLevel("pickaxe",m), and so on. Derive from itemTool for a start or the main type of tool it is. Or you could derive from ItemSword and just add in the toolClass settings.

    There is more to make it all work than just that, but it should get you started.

  11. I just found this, so it may already have been tried and failed...

    There is a MinecraftForge event called

    WorldEvent.PotentialSpawns

    that can be handled and will allow the spawnlist to be set to any spawnlist desired (added to, or removed from). That might make your creature spawn wherever you want. I have not tested this theory, so it's up to you.

  12. This is probably handled with events now.

    For instance, there is the

    getModdedBiomeGenerators(WorldType wtype, long seed, GenLayer[] original)

    that fires

    WorldTypeEvent.InitBiomeGens

    event on TERRAIN_GEN_BUS, that allows new biomegenerators to be added/removed.

  13. Ok. After diving into gradle a little more it looks like using clean and other commands will not clear out the cache. Before I had been looking for the .gradle folder but couldn't find it to delete it manually in case something was wrong with the downloads from before. I found I can override the manual cache directory using the "-g" option. I set it to a blank folder and it has started downloading and getting assets which is a lot farther then it ever got before. I will update if this continues well.

     

    EDIT: It looks like that has worked. 1 hour and 34 minutes later I have a BUILD SUCCESSFUL.

     

    I've heard that cleanCache is the switch to make it clean out the cache and start over.

  14. I went looking for the spawn code for different creatureTypes and I discovered the possible problem you are encountering getting your creatureType to spawn.

    Check this code in BiomeGenBase:

        public List getSpawnableList(EnumCreatureType par1EnumCreatureType)
        {
            return par1EnumCreatureType == EnumCreatureType.monster ? this.spawnableMonsterList : (par1EnumCreatureType == EnumCreatureType.creature ? this.spawnableCreatureList : (par1EnumCreatureType == EnumCreatureType.waterCreature ? this.spawnableWaterCreatureList : (par1EnumCreatureType == EnumCreatureType.ambient ? this.spawnableCaveCreatureList : null)));
        }

    Apparently it is not smart enough to support spawning custom CreatureTypes. This makes is hard to accomplish what you want short of using ASM and changing the method. On the other hand, if you used a standard creature type from the list then it should spawn nicely.

  15. ItemFood (porkchops) heals the dog/wolf when he is tamed.

    Items.bone (from skeletons) can tame the wolf (with some random chance) unless he is angry.

    isBreedingTime returns true if the item passed in is the wolfsFavoriteMeat (property held by an ItemFood:  like porkChop)

    Most of the otherstuff is pretty standard tameable methodology.

    I don't know where the follow player code come into play.

×
×
  • Create New...

Important Information

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