(1.9) Minecraft 材质异常
(1.9) Minecraft texture exception
我是 modding 初学者,我所有的纹理都是粉黑色。
我想知道我做错了什么。
当我 运行 我的我的世界 mod 我总是得到这个错误:
Exception loading model for variant spmmod:sulfur_ore_nether#inventory for item spmmod:sulfur_ore_nether
java.lang.Exception: Could not load item model either from the normal location spmmod:item/sulfur_ore_nether or from the blockstate
spmmod.java:
package com.spmmod;
import com.spmmod.blocks.CustomBlock;
com.spmmod.items.CustomItem;
import com.spmmod.lib.ProxyCommon;
import com.spmmod.lib.References;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
@Mod(modid = References.MODID, name=References.NAME, version = References.Version)
public class spmmod
{
@SidedProxy(clientSide = References.ProxyClient, serverSide = References.ProxyCommon)
public static ProxyCommon proxy;
@EventHandler
public void init(FMLInitializationEvent event)
{
System.out.println("WILL REGISTER RENDERS");
proxy.RegisterRenders();
System.out.println("DID REGISTER RENDERS");
}
//Blocks
public static CustomBlock sulfur_ore_nether;
public spmmod()
{
this.sulfur_ore_nether = new CustomBlock(Material.rock, "sulfur_ore_nether", 0.4F, 0.5F, CustomBlock.HarvestToolEnum.PICKAXE, CustomBlock.HarvestLevelEnum.WOOD, CreativeTabs.tabBlock, 1, 6, 100, 10, 0, 300, new Block[]{Blocks.netherrack}, new Block[]{Blocks.lava}, 1, false, true, false);
}
}
}
ProxyClient.java:
package com.spmmod.lib;
import com.spmmod.spmmod;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
public class ProxyClient extends ProxyCommon
{
@Override
public void RegisterRenders()
{
spmmod.sulfur_ore_nether.RegisterRender("sulfur_ore_nether");
}
}
models/block/sulfur_ore_nether.json:
{
"parent": "block/cube_all",
"textures": {
"all": "spmmod:blocks/sulfur_ore_nether"
}
}
models/item/sulfur_ore_nether.json:
{
"parent": "spmmod:block/sulfur_ore_nether",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],
"translation": [ 0, 1.5, -2.75 ],
"scale": [ 0.375, 0.375, 0.375 ]
}
}
}
blockstates/sulfur_ore_nether:
{
"variants": {
"normal": { "model": "spmmod:sulfur_ore_nether" }
}
}
我做错的是我在 TextEdit 中编辑了 JSON 文件并设置了 "smart quotes"。智能报价与普通报价不同。当我关闭智能引号时,一切正常。
我是 modding 初学者,我所有的纹理都是粉黑色。 我想知道我做错了什么。 当我 运行 我的我的世界 mod 我总是得到这个错误:
Exception loading model for variant spmmod:sulfur_ore_nether#inventory for item spmmod:sulfur_ore_nether
java.lang.Exception: Could not load item model either from the normal location spmmod:item/sulfur_ore_nether or from the blockstate
spmmod.java:
package com.spmmod;
import com.spmmod.blocks.CustomBlock;
com.spmmod.items.CustomItem;
import com.spmmod.lib.ProxyCommon;
import com.spmmod.lib.References;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
@Mod(modid = References.MODID, name=References.NAME, version = References.Version)
public class spmmod
{
@SidedProxy(clientSide = References.ProxyClient, serverSide = References.ProxyCommon)
public static ProxyCommon proxy;
@EventHandler
public void init(FMLInitializationEvent event)
{
System.out.println("WILL REGISTER RENDERS");
proxy.RegisterRenders();
System.out.println("DID REGISTER RENDERS");
}
//Blocks
public static CustomBlock sulfur_ore_nether;
public spmmod()
{
this.sulfur_ore_nether = new CustomBlock(Material.rock, "sulfur_ore_nether", 0.4F, 0.5F, CustomBlock.HarvestToolEnum.PICKAXE, CustomBlock.HarvestLevelEnum.WOOD, CreativeTabs.tabBlock, 1, 6, 100, 10, 0, 300, new Block[]{Blocks.netherrack}, new Block[]{Blocks.lava}, 1, false, true, false);
}
}
}
ProxyClient.java:
package com.spmmod.lib;
import com.spmmod.spmmod;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
public class ProxyClient extends ProxyCommon
{
@Override
public void RegisterRenders()
{
spmmod.sulfur_ore_nether.RegisterRender("sulfur_ore_nether");
}
}
models/block/sulfur_ore_nether.json:
{
"parent": "block/cube_all",
"textures": {
"all": "spmmod:blocks/sulfur_ore_nether"
}
}
models/item/sulfur_ore_nether.json:
{
"parent": "spmmod:block/sulfur_ore_nether",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],
"translation": [ 0, 1.5, -2.75 ],
"scale": [ 0.375, 0.375, 0.375 ]
}
}
}
blockstates/sulfur_ore_nether:
{
"variants": {
"normal": { "model": "spmmod:sulfur_ore_nether" }
}
}
我做错的是我在 TextEdit 中编辑了 JSON 文件并设置了 "smart quotes"。智能报价与普通报价不同。当我关闭智能引号时,一切正常。