Jump to content

ProspectPyxis

Members
  • Posts

    33
  • Joined

  • Last visited

Everything posted by ProspectPyxis

  1. I guess I'll have to poke the mod author about this one, then. Thanks for the help.
  2. Alright, after some testing, it seems that for whatever reason, the chopping block won't trigger PlayerDestroyItemEvent, either. Which is odd, because looking at Pyrotech's code, it seems to use stack.damageItem properly for this. Wonder what's going on...
  3. So, here's what I wanna do: I have an item that's supposed to be used with another block that would damage it (if you want specifics, it's supposed to be for Pyrotech's chopping block). I want it so that once the item runs out of durability, it'd transform into another item rather than breaking outright. I can't seem to figure out how I'd do this, though. Here are the things I've tried: Edit the setDamage function. Problem is, there's no method to change the stack's item or get the holder of the itemstack that I've seen, so it wouldn't work. Use onItemUseFinish. It...doesn't seem to fire at all with this. Subscribe to PlayerDestroyItemEvent. This feels too unspecific, and the event might fire when I don't want it to. Is there some way of doing this properly?
  4. So since I want to only do something with the item if you're holding it, I'd check if the player is holding the item first before sending the packet, correct?
  5. I mean, I already know how to send packets, I'm just not sure about the performance impact which, looking back, shouldn't really be that big even combined with the few other packets already in the mod. Oh well, I'll be looking into the event then.
  6. I want an item to do something when you left click it while pointing at the air. How would I do this? I tried subscribing to onEntitySwing, but that event seems to also fire even if you're pointing at a block or entity. I also tried checking if the player is looking at anything with Item.rayTrace, but the method always returns null somehow. One way I've seen is subscribing to a clientside event, but from my understanding that would require a packet, and I'd like to limit that if possible. Is there any other way, or is that the best way?
  7. Hm, I suppose I'll go with the keybind route, then. Thanks for the help anyways!
  8. I'm gonna have to look into all those methods, but one more thing you're missing: I only want to change the mode when shift-right clicking the item, not just when hovering while holding shift. Since a right click constitutes removing the item from the inventory temporarily, I assume this will be a bit more difficult? If it gets too impractical to implement, I can simply use a keybind while holding the item for this, but I wanna see what I can do first.
  9. Just an NBT change so that the item knows what "mode" it's in and behave accordingly.
  10. I'm trying to make an item change its mode by shift-right clicking while hovering over the item in an inventory screen. How would I do this? I don't see any methods in the Item class that would do something like this.
  11. I went with offsetting the blockpos for the lighting issue, and it works perfectly now. Thank you!
  12. Alright, so adding a lightmap value actually got rid of the weird stretching, but now I have a couple new problems, as you can see in the image here: The texture is completely dark. The texture doesn't fully fill the outline of the blockstate texture - you can see the empty gaps in the image. How would I fix this? The new TESR code is here (I'm only testing for one face for now so I removed a massive chunk of the code):
  13. So from what I can understand from the code you sent, one square face of a block is equal to four vertices. I don't really know what I'm doing wrong, though, since I already translated the buffer in the first line of renderTileEntityFast - do I need to add an offset to the pos as well? Also, is a lightmap value absolutely required? It seems to be used in all the code you've sent me but I don't fully understand what it does.
  14. So this is a bit of a follow up to my previous topic - I'm currently trying to use a FastTESR to render a tile entity that stores its color. I can't really find any pointers on how to use it, though - trying to follow a code example I found just...made it break horribly, as you can see in the attached image. Here's the relevant code that I'm using, can anyone give some pointers on what I'm doing wrong? FastTESR class: ClientProxy where the textures are registered: TileEntity class:
  15. Well, this post can be ignored now - I eventually decided to just switch to a TESR.
  16. Right here: https://github.com/ProspectPyxis/CustomCapacitors/blob/master/src/main/java/prospectpyxis/customcapacitors/block/tile/TileEntityCapacitor.java
  17. Currently, I have a tile entity that stores two colors within itself, and it gets that color from the nbt tag of its item form. However, the block only changes to the correct color when a block update happens - before that, it uses a fallback color that I manually defined. How would I make it so that it uses the correct color right away? I've tried forcing a block update in readFromNbt, but that didn't do anything.
  18. Yep, after testing, doing that works perfectly. Thank you!
  19. So from what I'm understanding, let's say my energy container class is named EnergyManager. I should make one primary EnergyManager instance, then have two other anonymous EnergyManager instances that override every method to only interact with the first instance. Am I going about this correctly?
  20. A bit of a noob question now, but how would I do that? I'm trying to look for some code examples but I'm coming up dry.
  21. So what I should do is have two capabilities, one that can only input and another that can only output, return those for the right faces, and somehow sync the two energy values?
  22. I'm trying to make a capacitor block with one side being an output and the rest of the sides being input. How would I go about implementing this?
  23. Well, consider this solved. I eventually figured out you could pass null as the player and it'll work fine.
  24. I have a tileentity that I want to play a sound after a certain time has passed, but I'm struggling to find the right event for this. I've looked at the world.playSound methods, but they seem to require a player while my tileentity doesn't interact with players in any way, and the one that actually doesn't require a player seems to do nothing. What would I do here?
×
×
  • Create New...

Important Information

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