BonjourLeJsonBugué:)
-
ToolsHandler.BreakFightTools.PLATINEPICKAXE.getRegistryName() renvoie quoi ?
-
Ça:
public static enum BreakFightTools {PLATINEPICKAXE(“platinePickaxe”, “ToolPlatinePickaxe”),
PINKSTARPICKAXE(“pinkstarPickaxe”, “ToolPinkstarPickaxe”),
TAFEITEPICKAXE(“tafeitePickaxe”, “ToolTafeitePickaxe”),
PAINITEPICKAXE(“painitePickaxe”, “ToolPainitePickaxe”),PLATINESHOVEL(“platineShovel”, “ToolPlatineShovel”),
PINKSTARSHOVEL(“pinkstarShovel”, “ToolPinkstarShovel”),
TAFEITESHOVEL(“tafeiteShovel”, “ToolTafeiteShovel”),
PAINITESHOVEL(“painiteShovel”, “ToolPainiteShovel”),PLATINEAXE(“platineAxe”, “ToolPlatineAxe”),
PINKSTARAXE(“pinkstarAxe”, “ToolPinkstarAxe”),
TAFEITEAXE(“tafeiteAxe”, “ToolTafeiteAxe”),
PAINITEAXE(“painiteAxe”, “ToolPainiteAxe”),PLATINESWORD(“platineSword”, “ToolPlatineSword”),
PINKSTARSWORD(“pinkstarSword”, “ToolPinkstarSword”),
TAFEITESWORD(“tafeiteSword”, “ToolTafeiteSword”),
PAINITESWORD(“painiteSword”, “ToolPainiteSword”),PLATINEHOE(“platineHoe”, “ToolPlatineHoe”),
PINKSTARHOE(“pinkstarHoe”, “ToolPinkstarHoe”),
TAFEITEHOE(“tafeiteHoe”, “ToolTafeiteHoe”),
PAINITEHOE(“painiteHoe”, “ToolPainiteHoe”);private String unlocalizedName;
private String registryName;BreakFightTools(String unlocalizedName, String registryName) {
this.unlocalizedName = unlocalizedName;
this.registryName = registryName;
}public String getUnlocalizedName() {
return unlocalizedName;
}public String getRegistryName() {
return registryName;
}
} -
Ça:
public static enum BreakFightTools { PLATINEPICKAXE("platinePickaxe", "ToolPlatinePickaxe"), PINKSTARPICKAXE("pinkstarPickaxe", "ToolPinkstarPickaxe"), TAFEITEPICKAXE("tafeitePickaxe", "ToolTafeitePickaxe"), PAINITEPICKAXE("painitePickaxe", "ToolPainitePickaxe"), PLATINESHOVEL("platineShovel", "ToolPlatineShovel"), PINKSTARSHOVEL("pinkstarShovel", "ToolPinkstarShovel"), TAFEITESHOVEL("tafeiteShovel", "ToolTafeiteShovel"), PAINITESHOVEL("painiteShovel", "ToolPainiteShovel"), PLATINEAXE("platineAxe", "ToolPlatineAxe"), PINKSTARAXE("pinkstarAxe", "ToolPinkstarAxe"), TAFEITEAXE("tafeiteAxe", "ToolTafeiteAxe"), PAINITEAXE("painiteAxe", "ToolPainiteAxe"), PLATINESWORD("platineSword", "ToolPlatineSword"), PINKSTARSWORD("pinkstarSword", "ToolPinkstarSword"), TAFEITESWORD("tafeiteSword", "ToolTafeiteSword"), PAINITESWORD("painiteSword", "ToolPainiteSword"), PLATINEHOE("platineHoe", "ToolPlatineHoe"), PINKSTARHOE("pinkstarHoe", "ToolPinkstarHoe"), TAFEITEHOE("tafeiteHoe", "ToolTafeiteHoe"), PAINITEHOE("painiteHoe", "ToolPainiteHoe"); private String unlocalizedName; private String registryName; BreakFightTools(String unlocalizedName, String registryName) { this.unlocalizedName = unlocalizedName; this.registryName = registryName; } public String getUnlocalizedName() { return unlocalizedName; } public String getRegistryName() { return registryName; } }
-
Donc pas de problème à ce niveau.
Le json est bien enregistré ?
-
Bien enregistré… ? C’est à dire ?
edit: c’Est bon j’ai compris ^^
Au pire je te donne ma classe:
package fr.breakfight.infectiion21.handlers; import fr.breakfight.infectiion21.common.BreakfMain; import fr.breakfight.infectiion21.tools.ToolPainiteAxe; import fr.breakfight.infectiion21.tools.ToolPainiteHoe; import fr.breakfight.infectiion21.tools.ToolPainitePickaxe; import fr.breakfight.infectiion21.tools.ToolPainiteShovel; import fr.breakfight.infectiion21.tools.ToolPainiteSword; import fr.breakfight.infectiion21.tools.ToolPinkstarAxe; import fr.breakfight.infectiion21.tools.ToolPinkstarHoe; import fr.breakfight.infectiion21.tools.ToolPinkstarPickaxe; import fr.breakfight.infectiion21.tools.ToolPinkstarShovel; import fr.breakfight.infectiion21.tools.ToolPinkstarSword; import fr.breakfight.infectiion21.tools.ToolPlatineAxe; import fr.breakfight.infectiion21.tools.ToolPlatineHoe; import fr.breakfight.infectiion21.tools.ToolPlatinePickaxe; import fr.breakfight.infectiion21.tools.ToolPlatineShovel; import fr.breakfight.infectiion21.tools.ToolPlatineSword; import fr.breakfight.infectiion21.tools.ToolTafeiteAxe; import fr.breakfight.infectiion21.tools.ToolTafeiteHoe; import fr.breakfight.infectiion21.tools.ToolTafeitePickaxe; import fr.breakfight.infectiion21.tools.ToolTafeiteShovel; import fr.breakfight.infectiion21.tools.ToolTafeiteSword; 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.minecraft.item.ItemHoe; import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemSpade; import net.minecraft.item.ItemSword; import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.fml.common.registry.GameRegistry; public class ToolsHandler { public static final ToolMaterial platineMaterial = EnumHelper.addToolMaterial(BreakfMain.MODID + ":platine", 2, 500, 7.0F, 2.5F, 15); public static final ToolMaterial pinkstarMaterial = EnumHelper.addToolMaterial(BreakfMain.MODID + ":pinkstar", 3, 2000, 10.0F, 4.0F, 9); public static final ToolMaterial tafeiteMaterial = EnumHelper.addToolMaterial(BreakfMain.MODID + ":tafeite", 4, 3500, 20.0F, 5.5F, 8); public static final ToolMaterial painiteMaterial = EnumHelper.addToolMaterial(BreakfMain.MODID + ":painite", 5, 5000, 32.0F, 9.25F, 7); public static ItemPickaxe platinePickaxe; public static ItemPickaxe pinkstarPickaxe; public static ItemPickaxe tafeitePickaxe; public static ItemPickaxe painitePickaxe; public static ItemSpade platineShovel; public static ItemSpade pinkstarShovel; public static ItemSpade tafeiteShovel; public static ItemSpade painiteShovel; public static ToolPlatineAxe platineAxe; public static ToolPinkstarAxe pinkstarAxe; public static ToolTafeiteAxe tafeiteAxe; public static ToolPainiteAxe painiteAxe; public static ItemSword platineSword; public static ItemSword pinkstarSword; public static ItemSword tafeiteSword; public static ItemSword painiteSword; public static ItemHoe platineHoe; public static ItemHoe pinkstarHoe; public static ItemHoe tafeiteHoe; public static ItemHoe painiteHoe; public static void init() { platinePickaxe = new ToolPlatinePickaxe(); pinkstarPickaxe = new ToolPinkstarPickaxe(pinkstarMaterial); tafeitePickaxe = new ToolTafeitePickaxe(tafeiteMaterial); painitePickaxe = new ToolPainitePickaxe(painiteMaterial); platineShovel = new ToolPlatineShovel(platineMaterial); pinkstarShovel = new ToolPinkstarShovel(pinkstarMaterial); tafeiteShovel = new ToolTafeiteShovel(tafeiteMaterial); painiteShovel = new ToolPainiteShovel(painiteMaterial); platineAxe = new ToolPlatineAxe(platineMaterial); pinkstarAxe = new ToolPinkstarAxe(pinkstarMaterial); tafeiteAxe = new ToolTafeiteAxe(tafeiteMaterial); painiteAxe = new ToolPainiteAxe(painiteMaterial); platineSword = new ToolPlatineSword(platineMaterial); pinkstarSword = new ToolPinkstarSword(pinkstarMaterial); tafeiteSword = new ToolTafeiteSword(tafeiteMaterial); painiteSword = new ToolPainiteSword(painiteMaterial); platineHoe = new ToolPlatineHoe(platineMaterial); pinkstarHoe = new ToolPinkstarHoe(pinkstarMaterial); tafeiteHoe = new ToolTafeiteHoe(tafeiteMaterial); painiteHoe = new ToolPainiteHoe(painiteMaterial); } public static void register() { GameRegistry.register(platinePickaxe); GameRegistry.register(pinkstarPickaxe); GameRegistry.register(tafeitePickaxe); GameRegistry.register(painitePickaxe); GameRegistry.register(platineShovel); GameRegistry.register(pinkstarShovel); GameRegistry.register(tafeiteShovel); GameRegistry.register(painiteShovel); GameRegistry.register(platineAxe); GameRegistry.register(pinkstarAxe); GameRegistry.register(tafeiteAxe); GameRegistry.register(painiteAxe); GameRegistry.register(platineSword); GameRegistry.register(pinkstarSword); GameRegistry.register(tafeiteSword); GameRegistry.register(painiteSword); GameRegistry.register(platineHoe); GameRegistry.register(pinkstarHoe); GameRegistry.register(tafeiteHoe); GameRegistry.register(painiteHoe); } public static void registerRenders() { registerRender(platinePickaxe); registerRender(pinkstarPickaxe); registerRender(tafeitePickaxe); registerRender(painitePickaxe); registerRender(platineShovel); registerRender(pinkstarShovel); registerRender(tafeiteShovel); registerRender(painiteShovel); registerRender(platineAxe); registerRender(pinkstarAxe); registerRender(tafeiteAxe); registerRender(painiteAxe); registerRender(platineSword); registerRender(pinkstarSword); registerRender(tafeiteSword); registerRender(painiteSword); registerRender(platineHoe); registerRender(pinkstarHoe); registerRender(tafeiteHoe); registerRender(painiteHoe); } public static void registerRender(Item item) { Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); } public static enum BreakFightTools { PLATINEPICKAXE("platinePickaxe", "ToolPlatinePickaxe"), PINKSTARPICKAXE("pinkstarPickaxe", "ToolPinkstarPickaxe"), TAFEITEPICKAXE("tafeitePickaxe", "ToolTafeitePickaxe"), PAINITEPICKAXE("painitePickaxe", "ToolPainitePickaxe"), PLATINESHOVEL("platineShovel", "ToolPlatineShovel"), PINKSTARSHOVEL("pinkstarShovel", "ToolPinkstarShovel"), TAFEITESHOVEL("tafeiteShovel", "ToolTafeiteShovel"), PAINITESHOVEL("painiteShovel", "ToolPainiteShovel"), PLATINEAXE("platineAxe", "ToolPlatineAxe"), PINKSTARAXE("pinkstarAxe", "ToolPinkstarAxe"), TAFEITEAXE("tafeiteAxe", "ToolTafeiteAxe"), PAINITEAXE("painiteAxe", "ToolPainiteAxe"), PLATINESWORD("platineSword", "ToolPlatineSword"), PINKSTARSWORD("pinkstarSword", "ToolPinkstarSword"), TAFEITESWORD("tafeiteSword", "ToolTafeiteSword"), PAINITESWORD("painiteSword", "ToolPainiteSword"), PLATINEHOE("platineHoe", "ToolPlatineHoe"), PINKSTARHOE("pinkstarHoe", "ToolPinkstarHoe"), TAFEITEHOE("tafeiteHoe", "ToolTafeiteHoe"), PAINITEHOE("painiteHoe", "ToolPainiteHoe"); private String unlocalizedName; private String registryName; BreakFightTools(String unlocalizedName, String registryName) { this.unlocalizedName = unlocalizedName; this.registryName = registryName; } public String getUnlocalizedName() { return unlocalizedName; } public String getRegistryName() { return registryName; } } }J’ai beaucoup d’outils, mais aucune des textures marchent alors je me concentrais seulement sur platinepickaxe ^^
-
Ici :
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(), “inventory”));
Essaies plutôt :
ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(BreakfMain.MODID + item.getRegistryName().toLowerCase(), “inventory”)); -
J’ai trouvé mon problème mdr ! J’avais oublié d’enlever un commentaire ‘’//‘’ dans mes proxy, que j’avais mis pour un test et depuis je n’avais pas pensé de l’enlever x)
Merci tout de même de ton aide !
Sinon, est-ce que je pourrais savoir pourquoi il y a des erreurs dans ma console à propos de l’item qui est register 2 fois 0o ? Car je ne comprend pas trop ^^
Merci encore

-
Le plus probable serait que ta fonction register est appelé deux fois.
-
Mais je ne vois pas en quoi… En tenant compte de la classe que je t’ai donné un peu plus haut, y’aurais vraiment la fonction register 2 fois x) ?
-
Mets un point d’arrêt ou un print dedans, tu verra bien.