Jump to content

JonTGN

Members
  • Posts

    11
  • Joined

  • Last visited

Posts posted by JonTGN

  1. Hey guys, so I'm watching a series by technovision on youtube for modding 1.12.2 minecraft. I'm having some issues with my texture loading in game and was wondering if anyone could help.

    Here is the log from eclipse:

    [16:52:51] [main/ERROR] [FML]: Exception loading model for variant gkm;:gate_key#inventory for item "gkm;:gate_key", normal location exception: 
    net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model gkm;:item/gate_key with loader VanillaLoader.INSTANCE, skipping
    	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
    	at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:297) ~[ModelLoader.class:?]
    	at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:175) ~[ModelBakery.class:?]
    	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:160) ~[ModelLoader.class:?]
    	at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
    	at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:121) [SimpleReloadableResourceManager.class:?]
    	at net.minecraft.client.Minecraft.init(Minecraft.java:559) [Minecraft.class:?]
    	at net.minecraft.client.Minecraft.run(Minecraft.java:421) [Minecraft.class:?]
    	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_271]
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_271]
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_271]
    	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_271]
    	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:?]
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_271]
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_271]
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_271]
    	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_271]
    	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
    	at GradleStart.main(GradleStart.java:25) [start/:?]
    Caused by: java.io.FileNotFoundException: gkm;:models/item/gate_key.json
    	at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:69) ~[SimpleReloadableResourceManager.class:?]
    	at net.minecraft.client.renderer.block.model.ModelBakery.loadModel(ModelBakery.java:334) ~[ModelBakery.class:?]
    	at net.minecraftforge.client.model.ModelLoader.access$1600(ModelLoader.java:126) ~[ModelLoader.class:?]
    	at net.minecraftforge.client.model.ModelLoader$VanillaLoader.loadModel(ModelLoader.java:860) ~[ModelLoader$VanillaLoader.class:?]
    	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
    	... 20 more
    [16:52:51] [main/ERROR] [FML]: Exception loading model for variant gkm;:gate_key#inventory for item "gkm;:gate_key", blockstate location exception: 
    net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model gkm;:gate_key#inventory with loader VariantLoader.INSTANCE, skipping
    	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
    	at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:305) ~[ModelLoader.class:?]
    	at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:175) ~[ModelBakery.class:?]
    	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:160) ~[ModelLoader.class:?]
    	at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
    	at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:121) [SimpleReloadableResourceManager.class:?]
    	at net.minecraft.client.Minecraft.init(Minecraft.java:559) [Minecraft.class:?]
    	at net.minecraft.client.Minecraft.run(Minecraft.java:421) [Minecraft.class:?]
    	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_271]
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_271]
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_271]
    	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_271]
    	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:?]
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_271]
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_271]
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_271]
    	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_271]
    	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
    	at GradleStart.main(GradleStart.java:25) [start/:?]
    Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
    	at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:83) ~[ModelBlockDefinition.class:?]
    	at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1169) ~[ModelLoader$VariantLoader.class:?]
    	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
    	... 20 more

    Here is how my project is set up:

    project_view.thumb.PNG.b996027deef8f081c27fa83af89401fc.PNG

     

    And here is my ModItems.java:

    package com.jontgn.gatekey.init;
    
    import java.util.ArrayList;
    import java.util.List;
    
    import com.jontgn.gatekey.items.ItemBase;
    
    import net.minecraft.item.Item;
    
    public class ModItems {
    	
    	public static final List<Item> ITEMS = new ArrayList<Item>();
    	
    	public static final Item GATE_KEY = new ItemBase("gate_key");
    	
    }

     

    My en_us.lang:

    item.gate_key.name=Gate Key

     

    my ItemBase.java

    package com.jontgn.gatekey.items;
    
    import com.jontgn.gatekey.Main;
    import com.jontgn.gatekey.init.ModItems;
    import com.jontgn.gatekey.util.IHasModel;
    
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.item.Item;
    
    public class ItemBase extends Item implements IHasModel {
    
    	public ItemBase(String name) {
    		setUnlocalizedName(name);
    		setRegistryName(name);
    		setCreativeTab(CreativeTabs.MATERIALS);
    		
    		ModItems.ITEMS.add(this);
    	}
    	
    	@Override
    	public void registerModels() {
    		
    		Main.proxy.registerItemRenderer(this, 0, "inventory");
    	}
    
    }

     

    My RegistryHandler.java

    package com.jontgn.gatekey.util.handlers;
    
    import com.jontgn.gatekey.init.ModItems;
    import com.jontgn.gatekey.util.IHasModel;
    
    import net.minecraft.item.Item;
    import net.minecraftforge.client.event.ModelRegistryEvent;
    import net.minecraftforge.event.RegistryEvent;
    import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
    import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
    
    @EventBusSubscriber
    public class RegistryHandler {
    
    	@SubscribeEvent
    	public static void onItemRegister(RegistryEvent.Register<Item> event) {
    		event.getRegistry().registerAll(ModItems.ITEMS.toArray(new Item[0]));
    	}
    	
    	@SubscribeEvent
    	public static void onModelRegister(ModelRegistryEvent event) {
    		for(Item item : ModItems.ITEMS) {
    			if(item instanceof IHasModel) {
    				((IHasModel)item).registerModels();
    			}
    		}
    	}
    	
    }

     

    My ClientProxy.java

    package com.jontgn.gatekey.proxy;
    
    import net.minecraft.client.renderer.block.model.ModelResourceLocation;
    import net.minecraft.item.Item;
    import net.minecraftforge.client.model.ModelLoader;
    
    public class ClientProxy extends CommonProxy {
    
    	public void registerItemRenderer(Item item, int meta, String id) {
    		
    		ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName(), id));
    	}
    }


    and finally, my gate_key.json

    {
       "parent": "item/generated",
       "textures": {
           "layer0": "gkm:items/gate_key"
       }
    }

     

    Here is what is happening in minecraft:

    screenshot.thumb.PNG.7be1c7908dbc5ad1327fd20ea4feda68.PNG

    And yes, I know I do not own that domain. I tried flipping it over but it screwed up my project, and gave up since this is a private mod for a server I'm building and is only going to be used once.

     

    Thanks, and let me know if I can provide any other files.

  2. Spoiler

     

    Going off of this- post, I attempted to add the line of code at the end of my build.gradle file and it still didn't seem to work. Was wondering if anyone else had a solution to this problem. All of my textures are displaying properly it's just the name. Everything is showing up as tile.<itemname>.name or item.<itemname>.name intead of what I'm defining them to be in the lang file. I've heard it has worked for people in eclipse but I prefer intellij. Any help would be appreciated! This is what my build.gradle file looks like. I'm confident everything else is as it should be.

     

    buildscript {
        repositories {
            jcenter()
            maven {
                name = "forge"
                url = "https://files.minecraftforge.net/maven"
            }
        }
        dependencies {
            classpath "net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT"
        }
    }
    
    apply plugin: "net.minecraftforge.gradle.forge"
    
    version = modVersion
    group = modGroup
    archivesBaseName = modBaseName
    
    minecraft {
        version = project.forgeVersion
        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 = project.mcpVersion
        // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
    }
    
    repositories {
        mavenCentral()
    }
    
    dependencies {
    }
    
    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, thats not the mcmod.info
        from(sourceSets.main.resources.srcDirs) {
            exclude "mcmod.info"
        }
    }
    
    sourceSets { main { output.resourcesDir = output.classesDir } }

     

     

     

  3. I read this: A very common mistake in beginners is to call Minecraft.getMinecraft().<doStuff>() in block or tile entity classes, which will crash any physical server as soon as the class is loaded. which makes sense. What doesn't make sense is where this is happening at and what exactly I need to annotate/move to make it work.

  4. Ok sweet, so is it just a process of moving 

    public static void registerEntityRenders()
        {
            RenderingRegistry.registerEntityRenderingHandler(EntityZombieKnight.class, new IRenderFactory<EntityZombieKnight>()
            {
                @Override
                public Render<? super EntityZombieKnight> createRenderFor(RenderManager manager)
                {
                        return new RenderZombieKnight(manager);
                }
            });
        }

     

    into clientProxy and reassigning this^ in like registry handler to go to clientproxy instead?

     

     

    Or do I just move that one line? How would that work?

  5. Hey guys. My mod works fine clientside, however when I load it up into my server it crashes. Attached below is my crash report as well as the source code for my mod. I feel like it has something to do with the proxy but I'm not entirely sure and I have absolutely no clue where to start, as I am coming from Python. I now understand Java a bit better, but please be precise so I can understand it well. Thanks :)

     

    Also if you have time, one more issue I was trying to figure out how to do is make my entity have a random chance of equipping tools/armor.

     

    GitHub: https://github.com/JonTGN/JonTGN-sMod

     

    Thanks in advance guys. Would really like to see this appear on my server :)

    crash-2018-12-30_17.48.41-server.txt

×
×
  • Create New...

Important Information

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