Jump to content

VaritekCibus

Members
  • Posts

    9
  • Joined

  • Last visited

Posts posted by VaritekCibus

  1. 49 minutes ago, diesieben07 said:

    You can add a crafting recipe for a normal spawn egg just fine. You do not need to make your own item.

    Hm, ok ignore my last reply, i guess i did assume incorrectly. Thank you.

    Edit: it did indeed work, im mad at myself for not thinking of the nbt from the start. Thank you though diesieben.

  2. 5 hours ago, diesieben07 said:

    Why are you creating a custom spawn egg? Just use the one vanilla adds.

    Well im trying to create a craftable egg, i figured i would need to create a new item that functioned as a "spawn egg" in order to give it a recipe. I might have been wrong in that assumption, vanilla doesnt have a precedent for creating craftable eggs so i wasnt sure exactly how that would be done.

     

    9 hours ago, Cadiboo said:

    could you post your itemInit class?

     

    I believe that there is also a way to register your egg at the same time as registering your entity which could eliminate the problem

    The whole ItemInit class is like 300 lines due to the amount of items in my mod, so in the interest of space, this is the structure:

    Spoiler

    package com.varitekcibus.amazingfoodstuffs.init;

    import java.util.ArrayList;
    import java.util.List;

    import com.varitekcibus.amazingfoodstuffs.Reference;
    import com.varitekcibus.amazingfoodstuffs.objects.food.ItemFoodBase;
    import com.varitekcibus.amazingfoodstuffs.objects.items.ItemBase;
    import com.varitekcibus.amazingfoodstuffs.objects.items.ItemMobPlacers;
    import com.varitekcibus.amazingfoodstuffs.objects.tools.ToolBase;

    import net.minecraft.item.Item;
    import net.minecraft.item.Item.ToolMaterial;
    import net.minecraft.item.ItemFood;
    import net.minecraftforge.common.util.EnumHelper;

    public class ItemInit {
        
        public static final List<Item> ITEMS = new ArrayList<Item>();

     

    }

    Then within that i register all the items with the same format as the example i gave in the first post.

  3. It was a bit hard to explain in the title but basically i wanted to add a recipe for a spawn egg for one of my mod's mobs, so i created a class that extended ItemMonsterPlacer. The custom spawn egg does appear in game and it does spawn my mob successfully, the issue im having is that it created a spawn egg with my texture and name added on to vanilla mobs. So under all the vanilla eggs would be a copy of all the vanilla eggs with the name "Fame Minion Blaze" for example, and those egg copies will spawn the mob that they are copied from, so the egg in the above mentioned example would spawn a blaze, its just that the name and texture of the egg are wrong. So my question is, is there something in ItemMonsterPlacer that i need to Override to get this to stop? Or am i possibly messing something else up. Now go easy on me, its been many years since ive tried to mod and ive never tried to do this in particular before, that being said, im also an idiot.

     

    My custom spawn egg class: 

    Spoiler

    package com.varitekcibus.amazingfoodstuffs.objects.items;

    import com.varitekcibus.amazingfoodstuffs.AmazingFoodStuffs;
    import com.varitekcibus.amazingfoodstuffs.init.ItemInit;
    import com.varitekcibus.amazingfoodstuffs.util.interfaces.IHasModel;

    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.item.ItemMonsterPlacer;

    public class ItemMobPlacers extends ItemMonsterPlacer implements IHasModel

    {

        public ItemMobPlacers(String name, int id) 
        
        {
            
            setUnlocalizedName(name);
            setRegistryName(name);
            setCreativeTab(CreativeTabs.MISC);
            
            ItemInit.ITEMS.add(this);
            
        }
        
        @Override
        public void registerModels() 
        
        {
            
            AmazingFoodStuffs.proxy.registerItemRenderer(this,  0,  "inventory");
            
        }
        
        
        
        
    }
     

    Within my item initialization class, this is the entry for this item:

    Spoiler

    public static final Item FAME_MINION_EGG = new ItemMobPlacers("fame_minion_egg", Reference.ENTITY_FAME_MINION);

    So if someone could tell me the stupid thing im doing, that would be great. Thanks.

     

    P.S. Heres a pic of what it looks like in game for more reference.

    eggs.png

  4. Ok so it looks like for now i have fixed my issue. For anyone else that might have this issue, I updated my forge to the latest version (not the recommended version), and i rebuilt the mod from the ground up in a new directory and path. I shouldve kept track at each stage to see what actually worked but i tried a bunch of things before trying again so i apologize but im not sure what specifically did it for me.

  5. Basically im making a stupid mistake but i just cant identify it because......im stupid. Anyway, im able to build my mod successfully but forge isnt reading it, there are two parts to this error: 

    Spoiler

    [16:45:11] [main/WARN]: Zip file afaoe-1.2.2.7.jar failed to read properly, it will be ignored
    java.lang.NullPointerException: null
        at net.minecraftforge.fml.common.MetadataCollection.from(MetadataCollection.java:78) ~[MetadataCollection.class:?]
        at net.minecraftforge.fml.common.discovery.JarDiscoverer.discover(JarDiscoverer.java:58) [JarDiscoverer.class:?]
        at net.minecraftforge.fml.common.discovery.ContainerType.findMods(ContainerType.java:47) [ContainerType.class:?]
        at net.minecraftforge.fml.common.discovery.ModCandidate.explore(ModCandidate.java:74) [ModCandidate.class:?]
        at net.minecraftforge.fml.common.discovery.ModDiscoverer.identifyMods(ModDiscoverer.java:138) [ModDiscoverer.class:?]
        at net.minecraftforge.fml.common.Loader.identifyMods(Loader.java:401) [Loader.class:?]
        at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:541) [Loader.class:?]
        at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:231) [FMLClientHandler.class:?]
        at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:466) [bib.class:?]
        at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:377) [bib.class:?]
        at net.minecraft.client.main.Main.main(SourceFile:123) [Main.class:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_25]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_25]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_25]
        at java.lang.reflect.Method.invoke(Method.java:483) ~[?:1.8.0_25]
        at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
        at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]

    and: 

    Spoiler

    [16:45:11] [main/INFO]: FML has found a non-mod file afaoe-1.2.2.7.jar in your mods directory. It will now be injected into your classpath. This could severe stability issues, it should be removed if possible.

    The full log is here: https://pastebin.com/ZtafjmGL (short and to the point). 

     

    Now my basic understanding of the log is that something is messed up in either my build.gradle or mcmod.info (i could be wrong in my interpretation). But ive gone over the files multiple times, and ive looked to make sure my modid in both those locations and my reference class are correct and matching. 

    Im currently running forge-2555 which i know isnt the latest but all of the versions are matching (client, jar, gradle etc) so it should still work no? Here is my build.gradle:

    Spoiler

    buildscript {
        repositories {
            jcenter()
            maven { url = "http://files.minecraftforge.net/maven" }
        }
        dependencies {
            classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
        }
    }
    apply plugin: 'net.minecraftforge.gradle.forge'
    //Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.


    version = "1.2.2.7"
    group = "com.varitekcibus.afaoe" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
    archivesBaseName = "afaoe"

    sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
    compileJava {
        sourceCompatibility = targetCompatibility = '1.8'
    }


    minecraft {
        version = "1.12.2-14.23.1.2555"
        runDir = "run"
        
        // the mappings can be changed at any time, and must be in the following format.
        // snapshot_YYYYMMDD   snapshot are built nightly.
        // stable_#            stables are built at the discretion of the MCP team.
        // Use non-default mappings at your own risk. they may not always work.
        // simply re-run your setup task after changing the mappings to update your workspace.
        mappings = "snapshot_20171003"
        // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
    }

    dependencies {
        // you may put jars on which you depend on in ./libs
        // or you may define them like so..
        //compile "some.group:artifact:version:classifier"
        //compile "some.group:artifact:version"
          
        // real examples
        //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev'  // adds buildcraft to the dev env
        //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env

        // the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
        //provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'

        // the deobf configurations:  'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided,
        // except that these dependencies get remapped to your current MCP mappings
        //deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
        //deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev'

        // for more info...
        // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
        // http://www.gradle.org/docs/current/userguide/dependency_management.html

    }

    processResources {
        // this will ensure that this task is redone when the versions change.
        inputs.property "version", project.version
        inputs.property "mcversion", project.minecraft.version

        // 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 except the mcmod.info
        from(sourceSets.main.resources.srcDirs) {
            exclude 'mcmod.info'
        }
    }
     

    I just left all the comments in because i dont really care but sorry if its hard on the eyes. My mcmod.info looks like this:

    Spoiler

    [
    {
      "modid": "afaoe",
      "name": "Amazing FoodStuffs and Other Essentials",
      "description": "Adds hundreds of base ingredients that can be used to make nearly a thousand different and fully custom foods that all do different things.",
      "version": "1.2.2.7",
      "mcversion": "1.12.1, 1.12.2",
      "url": "varitekcibus.com",
      "updateUrl": "",
      "authorList": ["Varitek"],
      "credits": "Pams Harvestcraft for inspiration.",
      "logoFile": "",
      "screenshots": [],
      "dependencies": []
    }
    ]
     

    And heres my github because why not add more information over less:https://github.com/Varitek3rulz3/AFAOE

    If you need anything else just let me know, i know im just being dumb and i hope thats the case, the build is successful and everything is where its supposed to be i believe, i made a mod on 1.7 so some things have changed but making the mod on 1.12 hasnt been difficult, however ive never run into this issue before, ive browsed all the forums on multiple sites about this similar issue and have tried all sorts of things but i cant seem to crack it. I apologize that im not as good at this as some people but thanks for reading this and i would love any recommendations. 

×
×
  • Create New...

Important Information

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