Jump to content

Kander16

Members
  • Posts

    403
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • URL
    https://www.minetronic.com
  • Location
    Belgium
  • Personal Text
    Java programmer/modder

Recent Profile Visitors

6257 profile views

Kander16's Achievements

Diamond Finder

Diamond Finder (5/8)

2

Reputation

  1. Hi, I have been trying to figure out what the difference is between a BlockNamedItem and a BlockItem. I can see that wheat-seeds use BlockNamedItem for example, but I don't know why. Can anyone give me an example code of when this is used, or explain the difference? Thanks! Thanks in advance, Kander16
  2. Hi, I'm currently creating a 'containerItem', an item which has a specified containerItem set and if used (eaten, for example) it returns this containerItem into the inventory of the player. I made this class to get arbitrary items to work like a SoupItem (so that it can return an arbitrary item back in inventory. Everything seems to work fine except for one special case, and I don't know where to look. My code: https://pastebin.com/gwX2yDiJ The different possible cases: If the item you were eating is gone: If the containerItem is stackable and the player has the containerItemStack in its inventory, use player.addItemStackToInventory to add the containerItem to the current stack This is the one case that doesn't work sometimes. If I am eating an item with a count of 1, and had a containerItem already in my inventory with the maxStackSize reached (in my case, 64), the item completely vanishes. Any idea of what I'm doing wrong here? In any other case, just return the containerItemStack to get the containerItem If the item you were eating isn't gone: player.addItemStackToInventory (to not replace the item you were eating) Thanks in advance, Kander16
  3. Hi, I have a quick question about handling game logic while modding in minecraft. I understand that I need to use !worldIn.isRemote to check if you wanted to execute game logic in minecraft (such as onBlockActivated). But there's one thing I don't understand then. If I look at the 'SoupItem' inside the onItemUseFinish for example, there are no checks for (!worldIn.isRemote). Why is that? The code inside soupItem: public ItemStack onItemUseFinish(ItemStack stack, World worldIn, LivingEntity entityLiving) { ItemStack itemstack = super.onItemUseFinish(stack, worldIn, entityLiving); return entityLiving instanceof PlayerEntity && ((PlayerEntity)entityLiving).abilities.isCreativeMode ? itemstack : new ItemStack(Items.BOWL); } Thanks in advance, Kander16
  4. O yeah, also: What is the replacement for OreDictionary.WILDCARD_VALUE to get an item work in a recipe no matter what the damage is?
  5. Hi, I want to create a recipe where you can put this as input: " X" " Y " "Z " but also this pattern: "X" "Y" "Z" So can you put multiple patterns in one json file? I can't make the recipe work in these directions without two patterns. Otherwise I'll need two json files. Another question: If I have a shapeless recipe, and I need more than one item of the same, can I just put in the id of that item once and then say "I need 4 of this item" instead of putting the id of the item multiple times? Thanks.
  6. Hi, I'm trying to figure out how the new recipe system works and I've found that I'm better off creating recipes with json files. So I made the json files for my recipes. But now, what do I need to do in order to make the recipes work in-game based off the json files? Is there a method to register all the json recipe files inside the recipes folder? Thanks.
  7. So there's no solution for this? Hopefully someone could help me with this.
  8. Hi, Is there an event to check if a chunk has been updated (when a block is placed/removed in a chunk)? Or is there another way to find out? Thanks.
  9. I think the cache is working properly. When the cache doesn't contain a specific model, it will call "getQuadsForCache" to get the new quads of the model. I have System.out.println("Creating new entry..."); in my getQuadsForCache method. So when there's something new to put in the cache "Creating new entry..." will appear on the log. Since I've placed a 256 of those ripening racks and "Creating new entry..." only comes up 1 time, I think the cache works properly. Maybe is the list of the quads too big? One ripening rack holds 528 quads. If I have one chunk, that means it needs to get 2.162.688 quads at the same time when placing / breaking a block. So what I mean is that getQuads is called whenever I place/break a block inside the same chunk. Is it possible to only call getQuads when the state of the ripening rack actually changes? I think that would make a lot of difference. But I'm not sure of that of course.
  10. Okay, so I tried to fill a whole chunk with a custom model from vanilla minecraft (fences), and it had the same problem. The problem was a little bit less noticable because the model isn't as complex as mine. So is there a way that I don't need to re-render all my ripening racks at once when I place/break my ripening rack? The only ripening racks that need to change model are the ripening racks that changes their state. But most of the ripening racks re-render even when no state changes are done to the ripening rack. Thanks for helping. Hope I get this solved, there has been put much effort into the model.
  11. Hello? This is what the console prints, even when I use the cache (if I remove or place a block in that same chunk): [18:12:43] [Client thread/WARN]: Something's taking too long! 'root.gameRenderer.level.terrain_setup.rebuildNear.build near' took aprox 110.59864 ms [18:12:43] [Client thread/WARN]: Something's taking too long! 'root.gameRenderer.level.terrain_setup.rebuildNear' took aprox 110.84558 ms [18:12:43] [Client thread/WARN]: Something's taking too long! 'root.gameRenderer.level.terrain_setup' took aprox 111.868795 ms [18:12:43] [Client thread/WARN]: Something's taking too long! 'root.gameRenderer.level' took aprox 114.511115 ms [18:12:43] [Client thread/WARN]: Something's taking too long! 'root.gameRenderer' took aprox 115.475238 ms [18:12:43] [Client thread/WARN]: Something's taking too long! 'root' took aprox 119.817526 ms The rest of the log is just the same, so I'm not going to put the whole log in here.
  12. Okay, so this is the new BakedModel code: https://pastebin.com/CkkCkLmE Could you maybe take a look at it? Could be that I'm missing something / doing something wrong. Otherwise, are there more options I could try to improve performance without remoddeling my model? Why does it even reload all the quads every time I place/break a block in the same chunk? It's not like my models needs to change when I do that. Only when something in the slots change or another block is placed on top of the ripening rack. But then I would manually tell the block to change model. Thanks!
  13. By the way, could it be that it's still not fast enough? Or do you think I would be doing something wrong with the cache then? (It's a lot faster but not so fast that I could consider it done)
  14. I want to check if a state exists in the guava cache, so that if it doesn't exist yet I can create a cache.
  15. Hi, I want to now which is the best way to get the full state of a block. I have trouble with it because I have unlisted properties, listed properties are fine. Thanks.
×
×
  • Create New...

Important Information

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