Hi there. I just try some tutorial on net and get some problems below.
1. As title, i have problem about item texture missing.
(details behind.)
2. How am i suppose to know about the item mechanism ?
(Item should be register in the first place.)
3. Where can i find APIs about Item, Block, GameRegistry , etc.
(Minecraft Forge just provide a little of API.Or i just missing some?)
=========
As Q1
[01:36:26] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
[01:36:26] [Client thread/ERROR] [TEXTURE ERRORS]: The following texture errors were found.
[01:36:26] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================
[01:36:26] [Client thread/ERROR] [TEXTURE ERRORS]: DOMAIN example
[01:36:26] [Client thread/ERROR] [TEXTURE ERRORS]: --------------------------------------------------
[01:36:26] [Client thread/ERROR] [TEXTURE ERRORS]: domain example is missing 1 texture
[01:36:26] [Client thread/ERROR] [TEXTURE ERRORS]: domain example has 1 location:
[01:36:26] [Client thread/ERROR] [TEXTURE ERRORS]: mod example resources at /Users/Huang/Java/minecraft_Forge/forge-1.10.2-12.18.1.2094-mdk/build/libs/modid-1.0.jar
[01:36:26] [Client thread/ERROR] [TEXTURE ERRORS]: -------------------------
[01:36:26] [Client thread/ERROR] [TEXTURE ERRORS]: The missing resources for domain example are:
[01:36:26] [Client thread/ERROR] [TEXTURE ERRORS]: textures/items/example_item.png
[01:36:26] [Client thread/ERROR] [TEXTURE ERRORS]: -------------------------
[01:36:26] [Client thread/ERROR] [TEXTURE ERRORS]: No other errors exist for domain example
[01:36:26] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================
[01:36:26] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
[01:36:29] [Realms Notification Availability checker #1/INFO]: Could not authorize you against Realms server: Invalid session id
Photo of Project
(Btw, why can't i use <insert image>)
http://imgur.com/a/f0MJh
Main
[embed=425,349]
package com.htlord.example;
import com.example.proxy.CommonProxy;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
@Mod(modid = Main.MODID, name = Main.MODNAME, version = Main.VERSION)
public class Main {
public static final String MODID = "example";
public static final String MODNAME = "Htlord Mod!";
public static final String VERSION = "0.0.1";
@SidedProxy(clientSide="com.example.proxy.ClientProxy",
serverSide="com.example.proxy.ServerProxy")
public static CommonProxy proxy;
@Instance
public static Main instance = new Main();
@EventHandler
public void preInit(FMLPreInitializationEvent e) {
this.proxy.preInit(e);
}
@EventHandler
public void init(FMLInitializationEvent e) {
this.proxy.init(e);
}
@EventHandler
public void postInit(FMLPostInitializationEvent e) {
this.proxy.postInit(e);
}
}
[/embed]
CommonProxy
[embed=425,349]
package com.example.proxy;
import com.htlord.example.items.ModItems;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
public class CommonProxy {
public void preInit(FMLPreInitializationEvent e) {
ModItems.createItems();
}
public void init(FMLInitializationEvent e) {
}
public void postInit(FMLPostInitializationEvent e) {
}
}
[/embed]
ClientProxy
[embed=425,349]
package com.example.proxy;
import com.example.render.ItemRenderRegister;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
public class ClientProxy extends CommonProxy{
@Override
public void preInit(FMLPreInitializationEvent e) {
System.out.println("[info]Example Mod : start Pre-Init");
super.preInit(e);
System.out.println("[info]Example Mod : end Pre-Init");
}
@Override
public void init(FMLInitializationEvent e) {
System.out.println("[info]Example Mod : start Init");
super.init(e);
ItemRenderRegister.registerItemRenderer();
System.out.println("[info]Example Mod : end Init");
}
@Override
public void postInit(FMLPostInitializationEvent e) {
System.out.println("[info]Example Mod : start Post-Init");
super.postInit(e);
System.out.println("[info]Example Mod : end Post-Init");
}
}
[/embed]
BasicItem
[embed=425,349]
package com.htlord.example.items;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
public class BasicItem extends Item {
public BasicItem() {
super();
}
public BasicItem(String unloclizedName){
super();
this.setUnlocalizedName(unloclizedName);
this.setCreativeTab(CreativeTabs.MATERIALS);
}
}
[/embed]
ModItems
[embed=425,349]
package com.htlord.example.items;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.registry.GameRegistry;
public class ModItems {
public static Item exampleItem;
public static void createItems(){
GameRegistry.registerItem(exampleItem = new BasicItem("example_item"), "example_item");
}
}
[/embed]
example_item.json
[embed=425,349]
{
"parent":"builtin/generated",
"textures": {
"layer0":"example:items/example_item"
},
"display": {
"thirdperson": {
"rotation": [ -90, 0, 0 ],
"translation": [ 0, 1, -3 ],
"scale": [ 0.55, 0.55, 0.55 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
}
}
}
[/embed]