Jump to content

Kander16

Members
  • Posts

    403
  • Joined

  • Last visited

Everything posted by Kander16

  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.
  16. Every combination? There are 8 different slots, a boolean "block on top", 4 facings and 11 types of what could be in that slots. That would be way to much I think.
  17. Hi, Instead of explaining to you what the problem is, I'm going to show it in this little video and give more information afterwards: https://www.youtube.com/watch?v=OA76IJWPYMM So, I created a custom rendered block which is called a ripening rack. This block has a custom baked model, so I can place arbitrary sub-models on the ripening rack (E.g cheese). The problem I have is that whenever I add another ripening rack inside the same chunk, the longer the game freezes than the previous ripening rack I placed. E.g: When I place the 256th block it wil freeze for a while and then continues to run without any problems. But you don't notice anything if one or two ripening racks are being placed. After I've placed 256 blocks of the ripening rack and the game-freeze is done, it acts normally. Nothing freezes anymore. I now it's a very complex model, it exists out of 528 quads. But I've put way to much effort in this model to give up now. So, could someone help me with this please? 1. Why does this actually happen? When I have many ripening racks inside a chunk, and place a ripening rack outside of that chunk (which doesn't contain any ripening racks), the game doesn't freeze. 2. What could I do to prevent this from happening? The rendering after the placement isn't a problem. Placing it is a problem. Some code that you might want to take a look at (Okay, I could improve some things on that code. It would help, but it wouldn't solve it): - RipeningRackBakedModel: https://hastebin.com/zabaxivugo.java EDIT: New RipeningRackBakedModel: https://pastebin.com/CkkCkLmE - RipeningRackModel: https://hastebin.com/ecofopejod.java If you need some more info, ask me! Thank you very much to help out.
  18. Hi, The log didn't print anything, but I think I've found the problem. The "inner" texture I have set in the file isn't used by any "block". The cheese wedge I render inside the ripening rack is only used as a model, and not as an individual block. I found out that whenever I changed the "inner" texture to a texture that has been used by a normal block (E.g, the texture of an iron block) it works like it should be. I don't have to do (F3 + T) to see the texture. The texture is rendered when I log-in. So this is what I did: I used the "inner" texture that I want on the cheese wedge, on a normal block's json file (testing purposes). After that, the "inner" texture of the wedge showed up without me having to do (F3 + T). My question is, can I do this better than using the "inner" texture on a normal block so that it render's on my cheese wedge's model without (F3 + T)? I hope you understand what I mean. If not, please say so. It's a very weird problem and I find it hard to explain. Thanks.
  19. Hi, I'm working on an update of my mod, which includes that the modid of my mod changes. This means that my items / blocks aren't 'chef:item' but 'masterchef:item'. If I try to update my mod, when I log into a world where the masterchef mod was loaded before this update, forge says the items are 'gone'. (but they actually just have another modid). Can I do something so forge will know that only the modid's have changed? Then upon log-in, the items/blocks won't be gone? Otherwise all the progress that people who update to the latest version of the mod will be lost. Thanks in advance!
  20. Hi, I'm trying to update my mod for minecraft version 1.12. But I'm stuck at the recipes. "GameRegistry.addShapedRecipe" doesn't work anymore. Could anyone explain to me how I can create new recipes in minecraft 1.12, or give an example so I can learn how it works now? Thanks in advance. The code I used before: GameRegistry.addShapedRecipe(new ItemStack(ModItems.sushi_cone, 1), "X X", "XXX", 'X', ModItems.nori_leaf);
  21. Hi, I have this wedge-shaped model (Cheese Wedge). The top, bottom and rear side render with the proper texture. However, the other two sides don't. But if I hit F3 + T to reload the resources, those last two sides do render properly. I assume that it should work right on start, because it's using one model file as start and on reload. But maybe I'm missing something. Does anyone have an idea why it behaves differently on start and reload? This is how it looks: - Before the (F3 + T): http://imgur.com/a/pNEwf - After the (F3 + T): http://imgur.com/ejpdpvf The JSON file for the model: https://hastebin.com/itabokijaz.json Thanks in advance.
  22. Hi, I'm making a ripening rack and I want to update that block when the state changes in the tileEntity (The state is changed when an item is removed/added/changed inside a slot of that ripening rack). I have a boolean "stateChanged". When that boolean is true, the block should be updated once with world.notifyBlockUpdate() and then the boolean should be set to false again. The problem I have is with the client/server sides. I'm setting "stateChanged" to true in the server side, but the client side still thinks it's false. Because "stateChanged" is false on the client side, world.notifyBlockUpdate() will never be executed. My question is, could I send a message to the TileEntity client "make 'stateChanged' true" so that the client knows that the state has changed and world.notifyBlockUpdate() will be exectuted (or something like that)? TileEntity code: https://hastebin.com/ayobomenuc.java
  23. I still can't figure it out how I can do the rotation properly. I've tried to use ((TRSRTransformation) state).rotate(EnumFacing.NORTH) etc. But it doesn't seem to do anything. EDIT: Fixed it, used TRSRTransformation.getMatrix(EnumFacing facing) to get the matrix for a specific facing.
×
×
  • Create New...

Important Information

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