Jump to content

kitsushadow

Members
  • Posts

    134
  • Joined

  • Last visited

Everything posted by kitsushadow

  1. @Animefan8888 @Choonster You all are lifesavers! It's working now! Thanks again for your help. For those looking for the final solution I have linked my source code here https://github.com/kitsushadow/forgecraft/tree/master/1.11/src/main The files that you would need to look at are: init/ModItems.java items/ItemStoneTongs.java proxy/ClientProxy.java ForgeCraft.java resources/models/item/
  2. @Animefan8888 so I gave that a try and I'm pretty close. I think the next step is the json trickery to make it work. The model with no NBT loads as seen in the creative mode inventory. The model WITH NBT fails to load. I have a stonetongs.json and a stonetongs_defualt.json in the models/item directory If you'd like to view the source code you can find it here. https://github.com/kitsushadow/forgecraft/tree/master/1.11/src/main RenderRegistry public static void registerCustomRenders(){ ModelBakery.registerItemVariants(ModItems.stonetongs, ModItems.stonetongs.getRegistryName(), new ResourceLocation(ModInfo.MOD_ID, "stonetongs")); ModelLoader.setCustomMeshDefinition(ModItems.stonetongs, new ItemMeshDefinition() { @Override public ModelResourceLocation getModelLocation(ItemStack stack) { if (stack.hasTagCompound()) { //if (stack.getTagCompound().getInteger("type")) { if (stack.getTagCompound().getInteger("type") == 0 ){ return new ModelResourceLocation(stack.getItem().getRegistryName() + "_default"); } else { return new ModelResourceLocation(stack.getItem().getRegistryName(), "inventory"); } } return new ModelResourceLocation(stack.getItem().getRegistryName(), "inventory"); } }); } ItemClass public class ItemStoneTongs extends Item { public ItemStoneTongs(String unlocalizedName) { setUnlocalizedName(unlocalizedName); this.setRegistryName(unlocalizedName); //this.setMaxDamage(0); //this.setHasSubtypes(true); //This just says the item has metadata this.setMaxStackSize(1); this.setCreativeTab(ModInfo.TAB_FORGECRAFT); } public void onUpdate(ItemStack item, World world, Entity player, int itemSlot, boolean isSelected) { if (!item.hasTagCompound()) { item.setTagCompound(new NBTTagCompound()); item.getTagCompound().setInteger("type", 0); } } public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { //pos = pos.offset(facing); ItemStack itemstack = player.getHeldItem(hand); if (world.getBlockState(pos).getBlock() == ModBlocks.bloomery) { TileBloomery tile = (TileBloomery) world.getTileEntity(pos); System.out.println(tile.getSlotStack(1)); //itemstack.damageItem(1, player); return EnumActionResult.SUCCESS; } else return EnumActionResult.FAIL; } }
  3. @Animefan8888 this goes in my RegistryRender which gets initialized in the main class yes?
  4. Thanks, will give it a shot!
  5. Thank you both for the response, can I get a more concrete example. Like a source code example to use as reference?
  6. I have an item which needs to change its model based on NBT. How do I go about utilizing and implementing an item with NBT that can take advantage of the ModelLoader.setCustomMeshDefinition() I was reading this article https://gist.github.com/williewillus/57d7093efa80163e96e0 It was suggested that, "You can do things like return different models depending on NBT" when using ModelLoader.setCustomMeshDefinition() Now I've read a lot of articles from Choonster and other informed members of the community. I have yet to succeed with anything I have tried due to the lack of concrete complete implementations. I am already aware of how to write NBT data to an item. Anyones help with this will be greatly appreciated but if you do intend to leave an answer please be patient and leave a well informed detailed response or please link a source code example as reference. Thanks!
  7. thanks, for the informative response. This is really difficult to follow though. I'm seeing four parts? - The model class? - the tile class? - the animation manager json? - the pump animation json? @Choonster
  8. I saw this commit while googling around from RainWarrior https://github.com/MinecraftForge/MinecraftForge/pull/2331/commits/0710bdf3f5a64e5fe1c725a30421b2c7523dca44 I was wondering if anyone has an example of an animated TE json model. Thanks
  9. I c, the title is severley misleading
  10. U really didn't have to go through any of that. I made a block with a custom block model and texture and literally copied exactly what was in prismarine_rough and the mcmeta file and the texture and got a perfect animation.
  11. Even a point in the direction of the vanilla rendering code for Item Entities would be great. I looked for it myself but no luck.
  12. Still looking for help with this. Thanks
  13. When i unpack a super fresh instance of Forge and run ./gradlew setupDecompWorkspace then copy the src directory over then ./gradlew build i get a succesful build but then block texture for when the block is an item does not load but when the Block is placed everything is right.
  14. The opposite of that is that minecraft now has too many logs and are having to make classes like logs_old and logs_new which seems like it's time to make the individual blocks. I do agree that using that kind of implementation on a small scale is beneficial but not for such a ubiquitous block type like a log.
  15. No, this is definitely not working. - When i do ./gradlew build i get the duplicate entry error - When i do ./gradlew build -x reobfJar and add the mod to a test minecraft launcher i get this error Caused by: java.lang.NoSuchMethodError: net.minecraft.block.properties.PropertyDirection.create(Ljava/lang/String;Lcom/google/common/base/Predicate;)Lnet/minecraft/block/properties/PropertyDirection; And btw, the above classes that the error is referencing is definitely there You can view the source code here: https://bitbucket.org/kitsushadow/forgecraft/src/46874e6d0dd62273dfee1263ce87cc0ecbbfca1b/1.10.2/?at=master
  16. I tested this from my Mac as well just to make sure it's not a windows thing. The error is appearing during reobfJar. When I run ./gradlew build -x reobfJar I can get a build but then I get two jar files mminaie:libs mminaie$ ls modid-1.0-sources.jar modid-1.0.jar
  17. Minecraft's implementation of logs is pretty poor and I would not emulate it if i were u. Rather, I would just make a cuatom generic block log class and make each log its own block and have facing block states.
  18. ForgeCraft is the name of the mod i'm trying to build
  19. For reference the shelf is from my 1.7 mod and I have linked the code below that I am looking to emulate.
  20. Look in here at the Test Item and see how i got it https://bitbucket.org/kitsushadow/forgecraft/src/0c6cb00316b3d00b05a01a68c11c7a3ec042e8f9/1.10.2/src/main/java/nmd/primal/forgecraft/?at=master
  21. What does the item name look like in game? if it is item.cheese.name then the problem is something else but if u aren't using the prefix in ur lang file its not gonna work. I followed the same tutorial as you btw =p
  22. Currently my block renders an Item that is in the slot. However, it does not visually indicate the amount of the stack in the slot. I would like it to look like the Iron Ore or the Rail in this picture: A source code example would be really beneficial here as I'm still getting my bearings in the post 1.8 workspaces
  23. So i had the Server and Client print out their stack contents respectively and after removing the stack from the inventory the Server showed null but the Client still thought that there was an item in the slot. This definitely coincides with the rendering.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.