
kitsushadow
Members-
Posts
134 -
Joined
-
Last visited
Everything posted by kitsushadow
-
@LogicTechCorp Can you link your source code? I'm looking for examples of creating custom enchantments
-
Block with blockstates don't render as item models
kitsushadow replied to kitsushadow's topic in Modder Support
Shit, I know how to override a fkng method. My previous question wasn't about the method override it was about the content of the override. Thanks for the help thus far mate, I know it's like pulling teeth dealing with some people but you should consider that the feeling is mutual. I stay patient and ask the simple stupid questions to progress the resolution of the issue. Please share the same patience as those whose whom your helping. -
Block with blockstates don't render as item models
kitsushadow replied to kitsushadow's topic in Modder Support
I added the ClientSide Annotation and the server crash is gone, i'll add the enum object tomorrow and try again. Thanks for your patience guys =) -
Block with blockstates don't render as item models
kitsushadow replied to kitsushadow's topic in Modder Support
He's frustrated i dont understand the basics of the Forge Framework... I'm actually pretty frustrated myself with it. Tons of not so great tutorials and it kinda lands you right where we are now. Regardless, yes ur right at @Draco18s i setup a ServerStart and it did crash exactly how u said it would. Thanks for the source code example, that makes our lives a little easier. -
Block with blockstates don't render as item models
kitsushadow replied to kitsushadow's topic in Modder Support
Yes.... I'm asking what the contents of the method should be. Or am i not adding anything to the method? I say that because I overrode the method in the ItemBlock class but nothing changed. I remember vaguely about needing to make an Enum with the subTypes in it or something. I can't remember. And i still don't feel like the itemSubtypes are being registered. -
Block with blockstates don't render as item models
kitsushadow replied to kitsushadow's topic in Modder Support
I'm not registering the rendering in common code. What do I override getSubItems with? I'm asking so many questions cuz i really dont have a good example to study and figure it out from. Sorry -
Block with blockstates don't render as item models
kitsushadow replied to kitsushadow's topic in Modder Support
So i registered renders for the different subtypes and it picked up on when the meta is 0 but i still see no item in the creative tab for the other subtype. I feel like i haven't registered the subTypes of the itemBlock. This is the new rendering method i used. public class ModBlocks { public static Block firebox; public static Block bloomery; public static Block pistonbellowsoak; public static Block pistonbellowsjungle; public static Block pistonbellowsbirch; public static Block pistonbellowsspruce; public static Block pistonbellowsdarkoak; public static Block pistonbellowsacacia; public static Block emptycrucible; public static Block emptycruciblehot; public static Block emptycruciblecracked; public static Block emptycruciblecrackedhot; public static Block rawironcrucible; public static Block hotironcrucible; public static Block hotcookedironcrucible; public static Block coolironcrucible; public static Block failedironcrucible; public static Block failedironcruciblehot; public static Block ironball; public static ItemBlock ironballitem; public static void init() { firebox = new Forge(Material.ROCK); bloomery = new Bloomery(Material.ROCK, "bloomery"); pistonbellowsoak = new PistonBellows(Material.WOOD, "pistonbellowsoak"); pistonbellowsjungle = new PistonBellows(Material.WOOD, "pistonbellowsjungle"); pistonbellowsbirch = new PistonBellows(Material.WOOD, "pistonbellowsbirch"); pistonbellowsspruce = new PistonBellows(Material.WOOD, "pistonbellowsspruce"); pistonbellowsdarkoak = new PistonBellows(Material.WOOD, "pistonbellowsdarkoak"); pistonbellowsacacia = new PistonBellows(Material.WOOD, "pistonbellowsacacia"); emptycrucible = new Crucible(Material.ROCK, "emptycrucible"); emptycruciblehot = new CrucibleHot(Material.ROCK, "emptycruciblehot"); emptycruciblecracked = new Crucible(Material.ROCK, "emptycruciblecracked"); emptycruciblecrackedhot = new CrucibleHot(Material.ROCK, "emptycruciblecrackedhot"); rawironcrucible = new Crucible(Material.ROCK, "rawironcrucible"); hotironcrucible = new CrucibleHot(Material.ROCK, "hotironcrucible"); hotcookedironcrucible = new CrucibleHot(Material.ROCK, "hotcookedironcrucible"); coolironcrucible = new Crucible(Material.ROCK, "coolironcrucible"); failedironcrucible = new Crucible(Material.ROCK, "failedironcrucible"); failedironcruciblehot = new CrucibleHot(Material.ROCK, "failedironcruciblehot"); ironball = new IngotBall(Material.IRON, "ironball", 5.0F); ironballitem = new ItemBlockIngotBall(ironball); } public static void register() { registerBlock(firebox); registerBlock(bloomery); registerBlock(pistonbellowsoak); registerBlock(pistonbellowsjungle); registerBlock(pistonbellowsbirch); registerBlock(pistonbellowsspruce); registerBlock(pistonbellowsdarkoak); registerBlock(pistonbellowsacacia); registerBlock(emptycrucible); registerBlock(emptycruciblehot); registerBlock(emptycruciblecracked); registerBlock(emptycruciblecrackedhot); registerBlock(rawironcrucible); registerBlock(hotironcrucible); registerBlock(hotcookedironcrucible); registerBlock(coolironcrucible); registerBlock(failedironcrucible); registerBlock(failedironcruciblehot); registerBlockSubType(ironball, ironballitem); } public static void registerRenders() { registerRender(firebox); registerRender(pistonbellowsoak); registerRender(pistonbellowsjungle); registerRender(pistonbellowsbirch); registerRender(pistonbellowsspruce); registerRender(pistonbellowsdarkoak); registerRender(pistonbellowsacacia); registerRender(bloomery); registerRender(emptycrucible); registerRender(emptycruciblehot); registerRender(emptycruciblecracked); registerRender(emptycruciblecrackedhot); registerRender(rawironcrucible); registerRender(hotironcrucible); registerRender(hotcookedironcrucible); registerRender(coolironcrucible); registerRender(failedironcrucible); registerRender(failedironcruciblehot); registerRender(ironball); registerRenderCustom(ironballitem, 0, new ModelResourceLocation(ironballitem.getUnlocalizedName() + "_0")); registerRenderCustom(ironballitem, 1, new ModelResourceLocation(ironballitem.getUnlocalizedName() + "_1")); } private static void registerBlock(Block block) { GameRegistry.register(block); ItemBlock item = new ItemBlock(block); item.setRegistryName(block.getRegistryName()); GameRegistry.register(item); } private static void registerBlockSubType(Block block, ItemBlock itemBlock){ GameRegistry.register(block); ItemBlock item = itemBlock; item.setRegistryName(block.getRegistryName()); GameRegistry.register(item); } private static void registerRender(Block block) { Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory")); } private static void registerRenderCustom(ItemBlock item, Integer meta, ModelResourceLocation model){ ModelLoader.setCustomModelResourceLocation(item, meta, model); } } -
Block with blockstates don't render as item models
kitsushadow replied to kitsushadow's topic in Modder Support
Just for this instance of the itemSubtypes or in general for registering renderers? -
Block with blockstates don't render as item models
kitsushadow replied to kitsushadow's topic in Modder Support
Is it just the rendering at this point??? private static void registerRender(Block block) { Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory")); } } That probably is not enough to register the itemSubtypes but if that was the case wouldn't the itemSubtype at least show up in the creative tab? -
Block with blockstates don't render as item models
kitsushadow replied to kitsushadow's topic in Modder Support
Ok, so now i was able to launch successfully and no registration warnings in the console so thats good but I see only the defaults state of the Item in the UI https://github.com/kitsushadow/forgecraft/blob/master/1.11/src/main/java/nmd/primal/forgecraft/init/ModBlocks.java -
Block with blockstates don't render as item models
kitsushadow replied to kitsushadow's topic in Modder Support
@Draco18s sorry thought i had included it Caused by: java.lang.NullPointerException at nmd.primal.forgecraft.init.ModBlocks.registerBlockSubType(ModBlocks.java:131) at nmd.primal.forgecraft.init.ModBlocks.register(ModBlocks.java:93) at nmd.primal.forgecraft.ForgeCraft.preInit(ForgeCraft.java:47) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) Line 131 item.setRegistryName(block.getRegistryName()); Line 93 registerBlockSubType(ironball, ironballitem); -
Block with blockstates don't render as item models
kitsushadow replied to kitsushadow's topic in Modder Support
@Animefan8888 I think i see what u mean i updated my Block class but getting a null pointer again package nmd.primal.forgecraft.init; import net.minecraft.block.Block; import net.minecraft.block.material.Material; 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.registry.GameRegistry; import nmd.primal.forgecraft.blocks.*; /** * Created by kitsu on 11/26/2016. */ public class ModBlocks { public static Block firebox; public static Block bloomery; public static Block pistonbellowsoak; public static Block pistonbellowsjungle; public static Block pistonbellowsbirch; public static Block pistonbellowsspruce; public static Block pistonbellowsdarkoak; public static Block pistonbellowsacacia; public static Block emptycrucible; public static Block emptycruciblehot; public static Block emptycruciblecracked; public static Block emptycruciblecrackedhot; public static Block rawironcrucible; public static Block hotironcrucible; public static Block hotcookedironcrucible; public static Block coolironcrucible; public static Block failedironcrucible; public static Block failedironcruciblehot; public static Block ironball; public static ItemBlock ironballitem; public static void init() { firebox = new Forge(Material.ROCK); bloomery = new Bloomery(Material.ROCK, "bloomery"); pistonbellowsoak = new PistonBellows(Material.WOOD, "pistonbellowsoak"); pistonbellowsjungle = new PistonBellows(Material.WOOD, "pistonbellowsjungle"); pistonbellowsbirch = new PistonBellows(Material.WOOD, "pistonbellowsbirch"); pistonbellowsspruce = new PistonBellows(Material.WOOD, "pistonbellowsspruce"); pistonbellowsdarkoak = new PistonBellows(Material.WOOD, "pistonbellowsdarkoak"); pistonbellowsacacia = new PistonBellows(Material.WOOD, "pistonbellowsacacia"); emptycrucible = new Crucible(Material.ROCK, "emptycrucible"); emptycruciblehot = new CrucibleHot(Material.ROCK, "emptycruciblehot"); emptycruciblecracked = new Crucible(Material.ROCK, "emptycruciblecracked"); emptycruciblecrackedhot = new CrucibleHot(Material.ROCK, "emptycruciblecrackedhot"); rawironcrucible = new Crucible(Material.ROCK, "rawironcrucible"); hotironcrucible = new CrucibleHot(Material.ROCK, "hotironcrucible"); hotcookedironcrucible = new CrucibleHot(Material.ROCK, "hotcookedironcrucible"); coolironcrucible = new Crucible(Material.ROCK, "coolironcrucible"); failedironcrucible = new Crucible(Material.ROCK, "failedironcrucible"); failedironcruciblehot = new CrucibleHot(Material.ROCK, "failedironcruciblehot"); ironball = new IngotBall(Material.IRON, "ironball", 5.0F); } public static void register() { registerBlock(firebox); registerBlock(bloomery); registerBlock(pistonbellowsoak); registerBlock(pistonbellowsjungle); registerBlock(pistonbellowsbirch); registerBlock(pistonbellowsspruce); registerBlock(pistonbellowsdarkoak); registerBlock(pistonbellowsacacia); registerBlock(emptycrucible); registerBlock(emptycruciblehot); registerBlock(emptycruciblecracked); registerBlock(emptycruciblecrackedhot); registerBlock(rawironcrucible); registerBlock(hotironcrucible); registerBlock(hotcookedironcrucible); registerBlock(coolironcrucible); registerBlock(failedironcrucible); registerBlock(failedironcruciblehot); registerBlockSubType(ironball, ironballitem); } public static void registerRenders() { registerRender(firebox); registerRender(pistonbellowsoak); registerRender(pistonbellowsjungle); registerRender(pistonbellowsbirch); registerRender(pistonbellowsspruce); registerRender(pistonbellowsdarkoak); registerRender(pistonbellowsacacia); registerRender(bloomery); registerRender(emptycrucible); registerRender(emptycruciblehot); registerRender(emptycruciblecracked); registerRender(emptycruciblecrackedhot); registerRender(rawironcrucible); registerRender(hotironcrucible); registerRender(hotcookedironcrucible); registerRender(coolironcrucible); registerRender(failedironcrucible); registerRender(failedironcruciblehot); registerRender(ironball); } private static void registerBlock(Block block) { GameRegistry.register(block); ItemBlock item = new ItemBlock(block); item.setRegistryName(block.getRegistryName()); GameRegistry.register(item); } private static void registerBlockSubType(Block block, ItemBlock itemBlock){ GameRegistry.register(block); ItemBlock item = itemBlock; item.setRegistryName(block.getRegistryName()); GameRegistry.register(item); } private static void registerRender(Block block) { Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory")); } } -
Block with blockstates don't render as item models
kitsushadow replied to kitsushadow's topic in Modder Support
Ok, so what do i do about registering the subTypes? All i see in the UI is the default state of the item. -
Block with blockstates don't render as item models
kitsushadow replied to kitsushadow's topic in Modder Support
I dont have any other ItemBlocks, this is my first ItemBlock https://github.com/kitsushadow/forgecraft/blob/master/1.11/src/main/java/nmd/primal/forgecraft/init/ModItems.java -
Block with blockstates don't render as item models
kitsushadow replied to kitsushadow's topic in Modder Support
Can u say that again? I am registering my ItemBlock in my Item Class. Is that wrong? -
Block with blockstates don't render as item models
kitsushadow replied to kitsushadow's topic in Modder Support
Thank for the help guys getting a new error now Seems like the Block Registry Name and the ItemBlock registry name are conflicting? net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Kitsu's Forgecraft (forgecraft) Caused by: java.lang.IllegalStateException: Attempted to set registry name with existing registry name! New: forgecraft:ironball Old: forgecraft:ironball at net.minecraftforge.fml.common.registry.IForgeRegistryEntry$Impl.setRegistryName(IForgeRegistryEntry.java:73) at net.minecraftforge.fml.common.registry.IForgeRegistryEntry$Impl.setRegistryName(IForgeRegistryEntry.java:90) at nmd.primal.forgecraft.init.ModItems.init(ModItems.java:40) at nmd.primal.forgecraft.ForgeCraft.preInit(ForgeCraft.java:48) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) New Registry Code public static Item pistonbellows; public static Item softcrucible; public static Item stonetongs; public static ItemBlock ironingotball; //public static Item forgingmanual; public static void init() { OBJLoader.INSTANCE.addDomain(ModInfo.MOD_ID); pistonbellows = new ItemBellowsHandle(); softcrucible = new ItemSoftCrucible(); stonetongs = new ItemStoneTongs("stonetongs"); ironingotball = new ItemBlockIngotBall(ModBlocks.ironball.setRegistryName(ModBlocks.ironball.getRegistryName())); //forgingmanual = new ItemForgingManual(); } public static void register() { GameRegistry.register(pistonbellows); GameRegistry.register(softcrucible); GameRegistry.register(stonetongs); GameRegistry.register(ironingotball); //GameRegistry.register(forgingmanual); } -
Block with blockstates don't render as item models
kitsushadow replied to kitsushadow's topic in Modder Support
getting a null pointer exception with that Error: net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Kitsu's Forgecraft (forgecraft) Caused by: java.lang.NullPointerException at net.minecraftforge.fml.common.registry.GameData$ItemCallbacks.onAdd(GameData.java:367) at net.minecraftforge.fml.common.registry.GameData$ItemCallbacks.onAdd(GameData.java:356) at net.minecraftforge.fml.common.registry.FMLControlledNamespacedRegistry.addObjectRaw(FMLControlledNamespacedRegistry.java:601) at net.minecraftforge.fml.common.registry.FMLControlledNamespacedRegistry.add(FMLControlledNamespacedRegistry.java:499) at net.minecraftforge.fml.common.registry.FMLControlledNamespacedRegistry.register(FMLControlledNamespacedRegistry.java:852) at net.minecraftforge.fml.common.registry.GameData.register_impl(GameData.java:225) at net.minecraftforge.fml.common.registry.GameRegistry.register(GameRegistry.java:155) at nmd.primal.forgecraft.init.ModItems.register(ModItems.java:45) at nmd.primal.forgecraft.ForgeCraft.preInit(ForgeCraft.java:47) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) Registry Class: public class ModItems { public static Item pistonbellows; public static Item softcrucible; public static Item stonetongs; public static ItemBlock ironingotball; //public static Item forgingmanual; public static void init() { OBJLoader.INSTANCE.addDomain(ModInfo.MOD_ID); pistonbellows = new ItemBellowsHandle(); softcrucible = new ItemSoftCrucible(); stonetongs = new ItemStoneTongs("stonetongs"); ironingotball = new ItemBlockIngotBall(ModBlocks.ironball, "ironingotball"); //forgingmanual = new ItemForgingManual(); } public static void register() { GameRegistry.register(pistonbellows); GameRegistry.register(softcrucible); GameRegistry.register(stonetongs); GameRegistry.register(ironingotball); //GameRegistry.register(forgingmanual); } public static void registerRenders() { registerRender(pistonbellows); registerRender(softcrucible); registerRenderItemBlock(ironingotball); //registerRender(forgingmanual); } public static void registerCustomRenders(){ ModelBakery.registerItemVariants(ModItems.stonetongs, ModItems.stonetongs.getRegistryName(), new ResourceLocation(ModInfo.MOD_ID, "stonetongs"), new ResourceLocation(ModInfo.MOD_ID, "stonetongs_default"), new ResourceLocation(ModInfo.MOD_ID, "stonetongs_emptyhot"), new ResourceLocation(ModInfo.MOD_ID, "stonetongs_emptyhotcracked"), new ResourceLocation(ModInfo.MOD_ID, "stonetongs_hotiron"), new ResourceLocation(ModInfo.MOD_ID, "stonetongs_hotironcooked"), new ResourceLocation(ModInfo.MOD_ID, "stonetongs_hotironfailed") ); ModelLoader.setCustomMeshDefinition(ModItems.stonetongs, new ItemMeshDefinition() { @Override public ModelResourceLocation getModelLocation(ItemStack stack) { if (stack.hasTagCompound()) { if (stack.getTagCompound().getInteger("type") == 0 ){ return new ModelResourceLocation(stack.getItem().getRegistryName() + "_default", "inventory"); } else if (stack.getTagCompound().getInteger("type") == 1 ) { return new ModelResourceLocation(stack.getItem().getRegistryName() + "_emptyhot", "inventory"); } else if (stack.getTagCompound().getInteger("type") == 2 ) { return new ModelResourceLocation(stack.getItem().getRegistryName() + "_emptyhotcracked", "inventory"); } else if (stack.getTagCompound().getInteger("type") == 3 ) { return new ModelResourceLocation(stack.getItem().getRegistryName() + "_hotiron", "inventory"); } else if (stack.getTagCompound().getInteger("type") == 4 ) { return new ModelResourceLocation(stack.getItem().getRegistryName() + "_hotironcooked", "inventory"); } else if (stack.getTagCompound().getInteger("type") == 5 ) { return new ModelResourceLocation(stack.getItem().getRegistryName() + "_hotironfailed", "inventory"); } else return new ModelResourceLocation(stack.getItem().getRegistryName(), "inventory"); } return new ModelResourceLocation(stack.getItem().getRegistryName(), "inventory"); } }); } private static void registerRender(Item item) { Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); } private static void registerRenderItemBlock(ItemBlock item){ Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); } /*public static void registerRender(Item item, int meta, String fileName) { ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(new ResourceLocation(fileName), "inventory")); } public static void registerRender(Item item, int meta, String fileName) { Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, meta, new ModelResourceLocation(fileName, "inventory")); }*/ } -
Block with blockstates don't render as item models
kitsushadow replied to kitsushadow's topic in Modder Support
I'm looking at source code examples and getting lost how to register the the block and item now. How and where do i register the ItemBlock i've made? -
Block with blockstates don't render as item models
kitsushadow replied to kitsushadow's topic in Modder Support
Got it, thanks for your help. -
Block with blockstates don't render as item models
kitsushadow replied to kitsushadow's topic in Modder Support
Ahh! So should my IngotBall class which is a block extend ItemBlock instead of Block? Or do I need both the Block class and an ItemBlock Class? thanks -
Block with blockstates don't render as item models
kitsushadow replied to kitsushadow's topic in Modder Support
@diesieben07 I'm looking through the source code, only thing I see is that I need to have the subtypes as a list and call getSubBlocks in the block class. I found that in the Block class BlockColored I know this is something relatively simple but I could really use a mod source code example cuz i'm having difficulty following your suggestions. @SideOnly(Side.CLIENT) public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> list) { for (EnumDyeColor enumdyecolor : EnumDyeColor.values()) { list.add(new ItemStack(itemIn, 1, enumdyecolor.getMetadata())); } } -
Block with blockstates don't render as item models
kitsushadow replied to kitsushadow's topic in Modder Support
Does that mean I need a basic item that does nothing other than be the subtype place holder item??? So a furnaceLit and furnaceOff would need two separate items? Just want to make sure I understand right. -
Block with blockstates don't render as item models
kitsushadow replied to kitsushadow's topic in Modder Support
https://github.com/kitsushadow/forgecraft/blob/master/1.11/src/main/java/nmd/primal/forgecraft/blocks/IngotBall.java @diesieben07 -
Block with blockstates don't render as item models
kitsushadow replied to kitsushadow's topic in Modder Support
@diesieben07 The source code can be found here https://github.com/kitsushadow/forgecraft/tree/master/1.11/src/main Specifically related to the IngotBall class and the ironball block. Thanks for the help -
I have a block with multiple states, when i change the state of the block and it is rendered as an item by Minecraft, either as an entity or in gui or etc. i get the null model and texture. I know that there is something about register blocks / items with subtypes to get their models to render correctly. Could someone point me to some source code that shows how to register a block that has subtypes so that the Item Models register correctly as well? Or perhaps i'm registering my blocks right and the blockstate / item model json is wrong? Regardless some source code that highlights doing the above will let me debug and find out for myself. Thanks in advance.