Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Blu_Nighttime

Members
  • Content Count

    30
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Blu_Nighttime

  • Rank
    Tree Puncher

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thanks for the examples, shows me some options on how I might be able to restructure my class if needs be in the future. However, I'm failing to understand what I'm passing into getRecipe() that satisfies C as the inventoryIn as the second parameter. the input slot for the custom smelter is an ItemStackHandler but passing this isn't allowed and I'm not sure if it's something that needs casting/converting to something else or what that would mean that C is satisfied. Any knowledge on this is greatly appreciated.
  2. Apologies, do you have any example references you can provide for this? Thank you.
  3. So I've implemented the following statement to be as similar to what's in AbstractFurnaceTileEntity#tick IRecipe<?> irecipe = world.getRecipeManager().getRecipe(IRecipeType.SMELTING, this, world).orElse(null); My tile entity class now implements ISidedInventory like AbstractTileEntity does but now I only ever receive null. Should the param this actually reference my container class for the block or am I missing something else? If I should be referencing the container class, how would I go about doing that to satisfy the inventoryIn param?
  4. Sorry, was trying to be a bit more general for all applications. It's for a custom smelter so currently how it works as just a quickly thrown together system is that when the tile entity is loaded into the world it executed the function, as shown above, and adds the ingredient and result to a map that I then iterate over if the contents for the 0th slot (input slot) are changed and gets corresponding result from the ingredient if it's in that map. I was trying to find a way if I could get a recipe output from the ingredient that's placed inside first, which is how a crafting table
  5. for (Item item : ForgeRegistries.ITEMS) { IRecipe<?> iRecipe = world.getRecipeManager().getRecipe(Objects.requireNonNull(item.getRegistryName())).orElse(null); if (iRecipe != null) { // get ingredients ... } I'm using the above function to get the recipes of items that have been registered referencing ForgeRegistries. This is successful and I'm able to get the ingredients for a smelting recipe for example, for all vanilla items; however, getRecipes() returns null when item belongs to my mod. There are recipes for smelting/blasting those items and work with a normal fu
  6. Thanks, I messed around this this and never got it to work how I wanted it too. So I just used player.inventory.decrStackSize() and used currentItem() and the value of 1 which did what I needed.
  7. Ah right, I got you. Simple mistake that can be easily made. I changed it to Supplier and Block, now don't get the issue. Of course you're attaching the TileEntity to the block. Also thank you, sometimes seeing an example helps with what it is you have to do Thanks guys.
  8. Trying to register the TileEntity but Eclipse gives me the errors The constructed object of type GrindingWorkbenchTileEntity is incompatible with the descriptor's return type: T The method create(Supplier<? extends T>, Block...) in the type TileEntityType.Builder is not applicable for the arguments (GrindingWorkbenchTileEntity::new, TileEntityType<GrindingWorkbenchTileEntity>) My code register event code looks like this @SubscribeEvent public static void onTileEntityRegistry(final RegistryEvent.Register<TileEntityType<?>> event) { event.getRegistry().re
  9. Actually, I thought i had it working but turns out when I right-clicked my block, the game crashed. I add this line IItemHandler inv = (IItemHandler) player.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) but I don't think this is right, any pointers on this one? And PlayerInventory#currentItem is what I was looking for. Thanks.
  10. OK, I have this implemented now; thanks for the redirection from the old API. However, how do I get the slot number that the ItemStack is at? I see get slots but that just returns the number of slots available so is there another way? Cheers.
  11. When the player right-clicks my custom block, I want the a single item from the stack to be removed from the players inventory, i.e. if the player has 50 of an item it goes down to 49. I can easily add items to the players inventory use player.addItemStackToInventory but can't seem to find something similar for removing an item. I thought player.entityDropItem might work but that doesn't seem to work; my block also knows what item was used on right-click. Any help is appreciated.
  12. Ah ha, so the loot tables that I saw mentioned somewhere else is the way that blocks are now dropped. I looked up in the reference library once you said, if I did have a loot table, and found out how to do it. Once I added the loot table for my mod and custom block to it, the block dropped when broken in survival. Thanks again.
  13. When a custom block is broken in survival, it doesn't drop and is just destroyed. I create a block like this: public static final Block CUSTOM_BLOCK = new Block(Block.Properties.create(Material.ROCK).hardnessAndResistance(3.0F, 3.0F)).setRegistryName(id, "custom_block"); And register inside of getRegistry#registerAll, so the block appears and functions 'normally' but doesn't drop on break. I think I saw somewhere that block breaks are something to do with getLootTable but not 100 percent sure. Also looking at the docs for 1.13.x, and not sure if it changed in 1.14.4, there's a function
  14. Ah thanks for the quick reply. After you saying this and me being a little confused I checked ItemAxe class to see how it's performed and now understand how to implement the feature. Thanks again.
  15. Just starting updating my mod to Forge Minecraft 1.14 from 1.12 and all is good, however, I'm trying to implement an onItemUse and depending on the direction the player is looking in, set blocks around the player if they are air to fire - I'm trying to keep the code similar to my 1.12 version and make changes to the code where I need to for 1.14. The issue is that when the player right clicks with the item, nothing more than what the item extends happens (the item extends the flint & steel) so I'm not sure if onItemUse is even triggering. Here's the code listed below. package com.githu
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.