I've been trying to render my sword but it wont render correctly, but it does not look correct in game, can anyone help me please?
nichirinblack.json
{
"parent": "item/handheld",
"textures": {
"layer0": "dslayer:items/nichirinblack"
}
}
ClientEvents.java
package me.entonez.dslayer.utils;
import me.entonez.dslayer.items.ItemRegistry;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
@EventBusSubscriber(modid = RefStrings.MODID, value = Side.CLIENT)
public final class ClientEvents {
@SubscribeEvent
public static void registerModels(ModelRegistryEvent event) {
registerModel(ItemRegistry.kblack);
}
private static void registerModel(Item item) {
ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
}
}
ClientProxy.java
package me.entonez.dslayer.proxies;
import me.entonez.dslayer.client.gui.GuiBreath;
import me.entonez.dslayer.client.render.Renders;
import me.entonez.dslayer.utils.KeyInputHandler;
import me.entonez.dslayer.utils.Keybinds;
import me.entonez.dslayer.utils.RefStrings;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.client.model.obj.OBJLoader;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
public class ClientProxy extends ServerProxy {
public void preInit() {
Keybinds.register();
MinecraftForge.EVENT_BUS.register(new KeyInputHandler());
}
public void postInit() {
}
@Override
public void addOBJLoaderDomainIfOnClient() {
OBJLoader.INSTANCE.addDomain(RefStrings.MODID);
}
@Override
public void registerItemRenderer(Item item, int meta, String id) {
ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName(), id));
}
@Override
public EntityPlayer getPlayerFromMessage(final MessageContext ctx) {
return (EntityPlayer)Minecraft.getMinecraft().player;
}
@Override
public void initRenders() {
Renders.renderEntities();
MinecraftForge.EVENT_BUS.register((Object)new GuiBreath(Minecraft.getMinecraft()));
}
}