LeoCTH Posted August 4, 2019 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
Animefan8888 Posted August 4, 2019 Posted August 4, 2019 On 8/4/2019 at 9:30 AM, 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. Expand 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.
LeoCTH Posted August 4, 2019 Author 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
Animefan8888 Posted August 4, 2019 Posted August 4, 2019 On 8/4/2019 at 10:19 AM, LeoCTH said: Okay, how? I did look for methods related to packet related stuff and overrode it, but it still didn't work somehow ? Expand On 8/4/2019 at 10:16 AM, Animefan8888 said: with a custom packet Expand 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.
LeoCTH Posted August 4, 2019 Author 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
LeoCTH Posted August 4, 2019 Author 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
Animefan8888 Posted August 4, 2019 Posted August 4, 2019 On 8/4/2019 at 11:57 AM, LeoCTH said: (don't criticize how I did it, just did a quick check, Botania used almost the same way xd) Expand 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.
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.