Jump to content

[1.8.9][Gradlew build] missing textures


thvardhan

Recommended Posts

hello everyone, after a lot of work i got my mod run perfectly on eclipse IDE however the jar file that i get after gradlew build command contains errors D:

 

when i run my jar file with forge in normal minecraft all textures are gone. (all blocks and items have purple black texture) any idea how to fix it?

 

This is a small part of my (original minecraft not IDE console) log

java.lang.Exception: Could not load model definition for variant ytstuff:killer#inventory
at net.minecraftforge.client.model.ModelLoader.func_177586_a(ModelLoader.java:215) ~[ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader.loadItems(ModelLoader.java:252) ~[ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader.func_177570_a(ModelLoader.java:116) ~[ModelLoader.class:?]
at net.minecraft.client.resources.model.ModelManager.func_110549_a(ModelManager.java:28) [bou.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.func_110542_a(SimpleReloadableResourceManager.java:120) [bnn.class:?]
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:478) [ave.class:?]
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:329) [ave.class:?]
at net.minecraft.client.main.Main.main(SourceFile:124) [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:?]
Caused by: java.lang.RuntimeException: Encountered an exception when loading model definition of model ytstuff:blockstates/killer.json
at net.minecraft.client.resources.model.ModelBakery.func_177586_a(ModelBakery.java:165) ~[bot.class:?]
at net.minecraftforge.client.model.ModelLoader.func_177586_a(ModelLoader.java:211) ~[ModelLoader.class:?]
... 13 more
Caused by: java.io.FileNotFoundException: ytstuff:blockstates/killer.json
at net.minecraft.client.resources.FallbackResourceManager.func_135056_b(FallbackResourceManager.java:93) ~[bnb.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.func_135056_b(SimpleReloadableResourceManager.java:78) ~[bnn.class:?]
at net.minecraft.client.resources.model.ModelBakery.func_177586_a(ModelBakery.java:143) ~[bot.class:?]
at net.minecraftforge.client.model.ModelLoader.func_177586_a(ModelLoader.java:211) ~[ModelLoader.class:?]
... 13 more

 

 

these are 2 files generated by build gradle

 

IDM3ur0.jpg

 

inside both of these contains same thing. but i dont know why they are different in size.

 

this is inside the first jar file >

 

Nf4JxnK.jpg

 

then there is a assets folder and after there is my modid folder and then everything as it should be

 

cnRo4qP.jpg

 

and all texture names are small no caps used.

 

this is my build.gradle file

 

// For those who want the bleeding edge
buildscript {
repositories {
jcenter()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'

/*
// for people who want stable - not yet functional for MC 1.8.8 - we require the forgegradle 2.1 snapshot
plugins {
id "net.minecraftforge.gradle.forge" version "2.0.2"
}
*/
version = "1.0"
group= "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "modid"

minecraft {
version = "1.8.9-11.15.1.1722"
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 allways work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings = "stable_20"
// 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, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}

Link to comment
Share on other sites

Show your code.

 

which class i have soo many i assume you are asking for rendering class because thats where i think error might be,

and 1 update i noticed that entitys added by mod have their texture.

 

 

 

public class ItemRenderRegistry {


public static void registerItemRender(){
	reg(ModItems.swordBlack);
	reg(ModItems.swordLogdotzip);
	reg(ModItems.devilSword);
	reg(ModItems.levinSword);
	reg(ModItems.mic);
	reg(ModItems.ytIcon);
	reg(ModItems.ytBoots);
	reg(ModItems.ytChestplate);
	reg(ModItems.ytHelmet);
	reg(ModItems.ytLeggings);
}

private static void reg(Item item) {
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Main.MODID+ ":" +item.getUnlocalizedName().substring(5), "inventory"));

}


}

 

 

here is my modItems class which contains game registrys of items

 

public class ModItems {

public static ToolMaterial Black = EnumHelper.addToolMaterial("Black", 0, 2005, 0, 7F, 22);
public static ToolMaterial Log=EnumHelper.addToolMaterial("log", 0, 4000, 0, 21F, 40);
public static ToolMaterial Devil=EnumHelper.addToolMaterial("devil", 0,5000,0, 26F, 100);
public static ToolMaterial Levin=EnumHelper.addToolMaterial("levin", 0, 10, 0, 996F, 0);

public static ArmorMaterial YtArmor = EnumHelper.addArmorMaterial("YtArmor", "ytstuff:ytarmor", 30, new int[]{4, 7, 5, 4}, 1);

public static Item swordBlack;
public static Item swordLogdotzip;
public static Item devilSword;
public static Item levinSword;
public static Item mic;
public static Item ytIcon;

public static Item ytHelmet;
public static Item ytChestplate;
public static Item ytLeggings;
public static Item ytBoots;


public static void createTools(){


	GameRegistry.registerItem(swordBlack = new SwordBlack("black_sword", Black), "black_sword");
	GameRegistry.registerItem(swordLogdotzip=new SwordLogdotzip("logdotzip_sword",Log),"logdotzip_sword");
	GameRegistry.registerItem(devilSword=new DevilSword("devil_sword",Devil),"devil_sword");
	GameRegistry.registerItem(levinSword=new LevinSword("levin_sword",Levin),"levin_sword");
	GameRegistry.registerItem(mic=new MicItem("mic"),"mic");
	GameRegistry.registerItem(ytIcon=new YtIcon("yticon"),"yticon");


	GameRegistry.registerItem(ytHelmet = new ItemModArmor("yt_helmet", YtArmor, 1, 0), "yt_helmet");
	GameRegistry.registerItem(ytChestplate = new ItemModArmor("yt_chestplate", YtArmor, 1, 1), "yt_chestplate");
	GameRegistry.registerItem(ytLeggings = new ItemModArmor("yt_leggings", YtArmor, 2, 2), "yt_leggings");
	GameRegistry.registerItem(ytBoots = new ItemModArmor("yt_boots", YtArmor, 1, 3), "yt_boots");

}


}

Link to comment
Share on other sites

okay here is my main mod class

 

@Mod(modid = Main.MODID, version = Main.VERSION, name=Main.NAME)
public class Main {

@SidedProxy(clientSide="com.thvardhan.ytstuff.ClientProxy", serverSide="com.thvardhan.ytstuff.ServerProxy")
public static CommonProxy proxy;



    public static final String MODID = "ytstuff";
    public static final String VERSION = "1.0.0";
    public static final String NAME="Youtuber Lucky Block";   
    
 @Instance(MODID)
    public static Main instance;
     
    @EventHandler
    public void preInit(FMLPreInitializationEvent e) {
    	proxy.preInit(e);
    }
        
    @EventHandler
    public void init(FMLInitializationEvent e) {
    	
    	
    	proxy.init(e);
    }
        
    @EventHandler
    public void postInit(FMLPostInitializationEvent e) {
    	
    	proxy.postInit(e); 
    }
}

 

this is common proxy

public class CommonProxy {

public static CreativeTabs tabYTStuffMod = new TabYTStuffMod(CreativeTabs.getNextID(), "YTSuffMod");

 public void preInit(FMLPreInitializationEvent e) {

	 ModBlocks.createBlocks();
	 ModItems.createTools();

    }

	public void init(FMLInitializationEvent e) {
    	FMLCommonHandler.instance().bus().register(new YTEventHandler());

    }

    public void postInit(FMLPostInitializationEvent e) {

    }
    
    
}

 

and this is client proxy

 

public class ClientProxy extends CommonProxy {

private static int modEntitys=0;

    @Override
    public void preInit(FMLPreInitializationEvent e) {
    	
    	registerModEntityWithEgg(EntityLogDotZip.class, "logdotzip", 0xff3333, 0xffaa00);
    	registerModEntityWithEgg(EntityPopularMMO.class, "popularmmo", 0x262626, 0x005580);
    	registerModEntityWithEgg(EntityAntVenom.class, "antvenom", 0x77b300, 0x111a00);
    	registerModEntityWithEgg(EntityCaptainSparklez.class, "captainsparklez", 0xff4d4d, 0xffffcc);
    	registerModEntityWithEgg(EntityGhost.class, "ghost", 0x4d0000, 0x000000);
    	registerModEntityWithEgg(EntityDanTDM.class, "dantdm", 0x66ffff, 0xffffff);
    	registerModEntityWithEgg(EntitySerialPlayer.class,"thvardhan", 0xcc9900, 0xffff66);
    	registerModEntityWithEgg(EntitySuperGirlyGamer.class, "supergirlygamer", 0xff33cc, 0xe6005c);
    	registerModEntityWithEgg(EntityISquid.class, "iballisticsquid", 0x000066,0x000000);
    	registerModEntityWithEgg(EntitySkyDoesMinecraft.class, "skydoesminecraft", 0xffff33, 0x000000);
    	registerModEntityWithEgg(EntityTruemu.class, "truemu", 0x0066ff, 0xff9933);
    	
      super.preInit(e);
          
    }

   




@Override
    public void init(FMLInitializationEvent e) {
        super.init(e);
        
       BlockRenderRegister.registerBlockRenderer();
       ItemRenderRegistry.registerItemRender();
      
       RenderingRegistry.registerEntityRenderingHandler(EntityTruemu.class, new EntityTruemuRender(new EntityTruemuModel(),0.5F));
       RenderingRegistry.registerEntityRenderingHandler(EntityISquid.class, new EntityISquidRender(new EntityISquidModel(),0.5F));
       RenderingRegistry.registerEntityRenderingHandler(EntitySkyDoesMinecraft.class, new EntitySkyDoesMinecraftRender(new EntitySkyDoesMinecraftModel(),0.5F));
       RenderingRegistry.registerEntityRenderingHandler(EntitySuperGirlyGamer.class, new EntitySuperGirlyGamerRender(new EntitySuperGirlyGamerModel(),0.5F));
       RenderingRegistry.registerEntityRenderingHandler(EntitySerialPlayer.class, new EntitySerialPlayerRender(new EntitySerialPlayerModel(),0.1F));
       RenderingRegistry.registerEntityRenderingHandler(EntityDanTDM.class, new EntityDanTDMRender(new EntityDanTDMModel(),0.5F));
       RenderingRegistry.registerEntityRenderingHandler(EntityGhost.class, new EntityGhostRender(new EntityGhostModel(),0F));
       RenderingRegistry.registerEntityRenderingHandler(EntityCaptainSparklez.class, new EntityCaptainSparklezRender(new EntityCaptiainSparklezModel(),0.5F));
       RenderingRegistry.registerEntityRenderingHandler(EntityLogDotZip.class, new EntityLogDotZipRender(new EntityLogDotZipModel(),0.5F));
       RenderingRegistry.registerEntityRenderingHandler(EntityPopularMMO.class, new EntityPopularMMORender(new EntityPopularMMOModel(),0.5F));
       RenderingRegistry.registerEntityRenderingHandler(EntityAntVenom.class, new EntityAntVenomRender(new EntityAntVenomModel(),0.8F));
    }

    @Override
    public void postInit(FMLPostInitializationEvent e) {
        super.postInit(e);
    }
    

    
    
    public void registerModEntityWithEgg(Class parEntityClass, String parEntityName, 
    	      int parEggColor, int parEggSpotsColor)
    	{
    	    EntityRegistry.registerModEntity(parEntityClass, parEntityName, ++modEntitys, 
    	        Main.instance, 80, 3, false);
    	    registerSpawnEgg(parEntityName,parEntityClass, parEggColor, parEggSpotsColor);
    	}

private void registerSpawnEgg(String parEntityName,Class parEntityClass ,int parEggColor,
		int parEggSpotsColor) {
	EntityRegistry.registerEgg(parEntityClass, parEggColor, parEggSpotsColor);

}
    

}

 

can you please show me a example code of using ModelLoader.setCustomModelResourceLocation? thank you :D

Link to comment
Share on other sites

i have changed my reg method to

 

private static void reg(Item item) {
//	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Main.MODID+ ":" +item.getUnlocalizedName().substring(5), "inventory"));
	ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(Main.MODID+ ":" +item.getUnlocalizedName().substring(5)));
}

 

however after this textures are not showing up in development IDE as well... i tried removing unlocalizedName and doing it a fixed name e.g

 

ModelLoader.setCustomModelResourceLocation(modItems.blackSword, 0, new ModelResourceLocation(Main.MODID+ ":black_sword" ));//and paste this outside reg method so it wont get called always

 

however now textures are not even appearing in IDE

Link to comment
Share on other sites

oh sorry i forgot to change it xD well i moved it to preinit which fixed things in IDE (i see all textures in ide) but in build still same error D:

 

ajsQxsR.png

 

 

can i simply send the src folder? on PM so you can tell me whats wrong here?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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