Résolu Problème rendue items
-
Alors j’ai un petit soucis de rendue sur mes items sauf le block et je ne sait pas pourquoi :
ItemInit :
package fr.malyumod.init;
import fr.malyumod.Reference;
import fr.malyumod.init.items.CustomIngot;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import net.minecraftforge.fml.common.registry.GameRegistry;public class ItemInit
{
public static Item maki_ingot;public static void init()
{
maki_ingot = new CustomIngot(“maki_ingot”);
}public static void registerItems()
{
registerItemsModels(maki_ingot);
}public static void registerItemsModels(Item item)
{
ForgeRegistries.ITEMS.register(item);Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MODID + “:” + item.getUnlocalizedName().substring(5), “inventory”));
}
}ArmourInit :
package fr.malyumod.init;
import fr.malyumod.MalyuMod;
import fr.malyumod.Reference;
import fr.malyumod.init.armour.MakiArmor;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.init.SoundEvents;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.ForgeRegistries;public class ArmourInit
{
public static final ArmorMaterial maki_armor = EnumHelper.addArmorMaterial(“maki_armor”, Reference.MODID + “:maki_armor”, 25, new int[]{5, 7, 9, 4}, 25, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND, 1.5F);public static Item maki_helmet, maki_chestplate, maki_leggings, maki_boots;
public static void init()
{
maki_helmet = new MakiArmor(“maki_helmet”, maki_armor, 1, EntityEquipmentSlot.HEAD);
maki_chestplate = new MakiArmor(“maki_chestplate”, maki_armor, 1, EntityEquipmentSlot.CHEST);
maki_leggings = new MakiArmor(“maki_leggings”, maki_armor, 2, EntityEquipmentSlot.LEGS);
maki_boots = new MakiArmor(“maki_boots”, maki_armor, 1, EntityEquipmentSlot.FEET);
}public static void registerItems()
{
registerItemsModels(maki_helmet);
registerItemsModels(maki_chestplate);
registerItemsModels(maki_leggings);
registerItemsModels(maki_boots);
}public static void registerItemsModels(Item item)
{
ForgeRegistries.ITEMS.register(item);
item.setCreativeTab(MalyuMod.makiTab);Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MODID + “:” + item.getUnlocalizedName().substring(5), “inventory”));
}
}ToolInit :
package fr.malyumod.init;
import fr.malyumod.MalyuMod;
import fr.malyumod.Reference;
import fr.malyumod.init.tools.CustomAxe;
import fr.malyumod.init.tools.CustomHoe;
import fr.malyumod.init.tools.CustomPickaxe;
import fr.malyumod.init.tools.CustomShovel;
import fr.malyumod.init.tools.MakiSword;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.ForgeRegistries;public class ToolInit
{
public static final ToolMaterial MakiMaterial = EnumHelper.addToolMaterial(“MakiMaterial”, 3, 1200, 7.0F, 2.5F, 22);public static Item tutorial_pickaxe, tutorial_axe, tutorial_hoe, tutorial_shovel, maki_sword;
public static void init()
{
tutorial_pickaxe = new CustomPickaxe(“tutorial_pickaxe”, MakiMaterial);
tutorial_axe = new CustomAxe(“tutorial_axe”, MakiMaterial);
tutorial_hoe = new CustomHoe(“tutorial_hoe”, MakiMaterial);
tutorial_shovel = new CustomShovel(“tutorial_shovel”, MakiMaterial);
maki_sword = new MakiSword(“maki_sword”, MakiMaterial);
}public static void registerItems()
{
registerItemsModels(tutorial_pickaxe);
registerItemsModels(tutorial_axe);
registerItemsModels(tutorial_hoe);
registerItemsModels(tutorial_shovel);
registerItemsModels(maki_sword);
}public static void registerItemsModels(Item item)
{
ForgeRegistries.ITEMS.register(item);
item.setCreativeTab(MalyuMod.makiTab);Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MODID + “:” + item.getUnlocalizedName().substring(5), “inventory”));
}
}BlockInit :
package fr.malyumod.init;
import fr.malyumod.MalyuMod;
import fr.malyumod.Reference;
import fr.malyumod.init.blocks.MakiOre;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.ForgeRegistries;public class BlockInit
{
public static Block maki_ore;public static void init()
{
maki_ore = new MakiOre(“maki_ore”, 2.0F, 4.0F, 2);
}public static void register()
{
registerBlock(maki_ore);
}public static void registerBlock(Block block)
{
ForgeRegistries.BLOCKS.register(block);
block.setCreativeTab(MalyuMod.makiTab);
ItemBlock item = new ItemBlock(block);
item.setRegistryName(block.getRegistryName());
ForgeRegistries.ITEMS.register(item);
}public static void registerRenders()
{
registerRender(maki_ore);
}public static void registerRender(Block block)
{
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation(Reference.MODID + “:” + block.getUnlocalizedName().substring(5)));
}
}RegistryHandler :
package fr.malyumod.handlers;
import fr.malyumod.init.ArmourInit;
import fr.malyumod.init.BlockInit;
import fr.malyumod.init.ItemInit;
import fr.malyumod.init.ToolInit;public class RegistryHandler
{
public static void Client()
{
ItemInit.registerItems();
ToolInit.registerItems();
ArmourInit.registerItems();
BlockInit.registerRenders();
RecipeHandler.registerCrafting();
RecipeHandler.registerSmelting();
}public static void Common()
{
ItemInit.init();
BlockInit.init();
ToolInit.init();
ArmourInit.init();
BlockInit.register();
}
}Merci d’avance à ceux qui m’aideront
-
Yo peut tu envoyer ton dossier src stp car c’est ilisible et j’aurais besoin des jsons en plus
-
J’ai résolue ce problème j’aimerais savoir si tu pourrait m’aider à faire un item animer en mains mon fichier png fait 16x128 mais l’animation ce fait pas il faut du json je pense mais je sait pas comment faire merci d’avance
-
normalement faut un fichier .mcmeta
et sinon c’était quoi la solution a ton problème car j’ai le même -
Sa venais des init (je sait pas où mais bon) j’ai tout refait du coup ^^