LeoCTH Posted August 4, 2019 Share Posted August 4, 2019 (edited) I was trying to retrieve what item does the TileEntity current has (in a ItemStackHandler) in a TileEntityRenderer. It simply returns no items each time I want to access it. My TileEntity code: https://github.com/LeoCTH/TryingOut/blob/master/src/main/java/com/leocth/tryingout/blocks/energy/ChargingStationTE.java My TESR: https://github.com/LeoCTH/TryingOut/blob/master/src/main/java/com/leocth/tryingout/client/render/tile/RenderChargingStation.java My Main Class: https://github.com/LeoCTH/TryingOut/blob/master/src/main/java/com/leocth/tryingout/TryingOut.java P.S. It's been a long time since my last post. I might have upset somebody on this forum while having a dispute, so my apologies ;P Edited August 4, 2019 by LeoCTH oops Quote Link to comment Share on other sites More sharing options...
Animefan8888 Posted August 4, 2019 Share Posted August 4, 2019 44 minutes ago, LeoCTH said: I was trying to retrieve what item does the TileEntity current has (in a ItemStackHandler) in a TileEntityRenderer. It simply returns no items each time I want to access it. You must sync the items in the ItemStackHandler to the client with a custom packet. And do this only whenever the contents change. Quote VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator. Link to comment Share on other sites More sharing options...
LeoCTH Posted August 4, 2019 Author Share Posted August 4, 2019 Okay, how? I did look for methods related to packet related stuff and overrode it, but it still didn't work somehow :p Quote Link to comment Share on other sites More sharing options...
Animefan8888 Posted August 4, 2019 Share Posted August 4, 2019 3 minutes ago, LeoCTH said: Okay, how? I did look for methods related to packet related stuff and overrode it, but it still didn't work somehow ? 6 minutes ago, Animefan8888 said: with a custom packet Documentation here. Quote VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator. Link to comment Share on other sites More sharing options...
LeoCTH Posted August 4, 2019 Author Share Posted August 4, 2019 Oh thanks, I forgot to check there ;P (oh btw at the start I didn't think that a 1.13.x documentation would help, and plus it sooooo different for what actually happens in 1.14.x lol) Quote Link to comment Share on other sites More sharing options...
LeoCTH Posted August 4, 2019 Author Share Posted August 4, 2019 Problem solved!!! Thank you! Just realized I don't need a custom packet tho, I can just use SUpdateTileEntityPacket and pass the NBT data on the packet when the player changes the item lol (don't criticize how I did it, just did a quick check, Botania used almost the same way xd) Quote Link to comment Share on other sites More sharing options...
Animefan8888 Posted August 4, 2019 Share Posted August 4, 2019 9 hours ago, LeoCTH said: (don't criticize how I did it, just did a quick check, Botania used almost the same way xd) But critiques are helpful. It might be more network efficient if you make your own custom packet that only sends when the specific Item slot changes. But it's not my mod. Quote VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.