Jump to content

GloriousAlpaca

Members
  • Posts

    103
  • Joined

  • Last visited

Everything posted by GloriousAlpaca

  1. Oh, thank you! Where should I save the timer int then ? Or rather how should I time the method ?
  2. How can I use the NBT share tag (or where can I see an example of it being used)? Thank you very much.
  3. The Item is supposed to be for crafting: You charge it in a machine after which you need to supply it with energy to keep it from exploding. You can craft things with the void stored in it. The capacity is useless I can see that, however the timer integer is for slowly reducing the energy stored or am I doing something wrong ? I don't think it did when I tested it. I thought it's called when the item is crafted, is it not ? You're right I could just save the value in the energy capability. The onRightClick Method is only temporarily there for me to test things. Thank you!
  4. Hello, I have made an item with the energy capability, a custom description showing the currently stored energy and a durability bar that also shows the stored energy. Sadly however the information of the itemstack is only set on the creation of a new itemstack, so the durability bar just stays the same even if the energy changes. That also applies if I put my item in something like an energetic infuser by thermal expansion: It just gives out an item with a full durability bar after a while. This is the Code of my item: https://github.com/GloriousAlpaca/Leer/blob/master/Void Mod/src/main/java/mod/leer/item/ItemTrap.java Thank you for your help!
  5. Well it seems to be working now but what would I ideally do instead of: if(!message.valid && ctx.side != Side.CLIENT) return null; Minecraft.getMinecraft().addScheduledTask(() -> processMessage(message,ctx));
  6. Well the Packet is only sent to the client so that shouldn't be a problem right ? There's also a check right before that as to not call that method on the server. That's true, I'll try that. Thank you!
  7. Hello, for some reason all of my Packets are leaking. This is the Code of my Packet: https://github.com/GloriousAlpaca/Leer/blob/master/Void Mod/src/main/java/mod/leer/network/VoidcomReturnMessage.java I have used nearly the same code in another class and there it is working fine. The progress and energy variables do have the right values, however the processMessage() method does not work. Thank you for your help.
  8. I thought the ResourceLocation already was a registry name thank you.
  9. Everything except the soundevents are working now! This is the crash I get when I register the soundevents:
  10. Sorry to bother you again, however now my items are not appearing in-game. I have updated the github repository if you would like to take a look.
  11. Thank you so much! Everything should be correctly set up now.
  12. I am not sure if I have understood this correctly but I tried using the ObjectHolder Annotation: This is the ItemHolder class:
  13. Okay so should I just rename it to serverproxy ? Would this be okay then (I have not removed ItemBase yet): Again thank you very much!
  14. Well surely I won't need to buy a domain ? I'll just drop the com then. About Issue 1: So I can just safely delete the commonproxy class? Issue 2: Could you tell me where I did not use @Override ? Is the class InitItems as a whole considered static or is it just the registerModels method? Also I can't seem to find the event for registering tile entities. I would like to change the blockstate based on whether an item is inserted or not. Yes I was testing something, originally I was checking for the unlocalized name, but I assume this is bad practice. Should I rather check for the registry name ? Okay so I am supposed to first extract the ItemStack, then modify it and lastly insert it again ? Thank you very much for taking your time to help me, this has been incredibely useful and I am very sorry for making such common errors.
  15. Okay here you go: https://github.com/GloriousAlpaca/Leer I'm not used to using github, so let me know if there are any github related errors!
  16. For some reason my gui packet is no longer working since I made them non-static ?
  17. When I say "not saved" I mean that if I close the gui the itemstack in slot 0 is gone.
  18. First of all thank you for the advice! My problem is that when I close the gui the content of the slot is not saved everytime. It is however sometimes saved, if I wait long enough and I think that has something to do with changing the progress variable, as when I removed the part I marked(in the tile entity class) the itemstack was not saved anymore.
  19. Hello, my container is exhibiting some weird behaviour: The itemstack inside is not saved if I close the gui, if however my code reaches a certain point (I have marked it with a comment) then the itemstack is saved normally. My Code: Container: The Gui: The Tile Entity(Code is marked here): Thank you for your help!
  20. Well okay then I'll just use the loop. Thank you very much!
  21. I have used that for another block, I just wanted to try using raycasts once, however maybe it isn't the right application. How performance heavy are raycasts compared to just checking the blocks one by one ?
  22. Hello, I am trying to use the method rayTraceBlocks to see if my block can see the bottom of the world, however after approximately 11 Blocks of height (I say approximately as the distance has changed from time to time) the detected collision shifts 1 Block to the center of the world. If my block were for example at the position x: 4 y: 77 z: 0 the collision would be detected at x: 3 y: 55 z: 0 shifting 1 Block in the direction of the world center. This is the Code of my raycast (-100 is just a test value): Thank you for your help!
×
×
  • Create New...

Important Information

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