Jump to content

[1.14.3] Gui Containers


Draco18s

Recommended Posts

I'm trying to figure out how to set up gui containers so that the client side has a reference to the TE in question so that it can get things like the current cook time.

 

Due to all the obfuscation behind factories and container types, I can't figure out how on earth the Furnace (and like classes) actually get injected into the Container used on the client side.

 

For example, the Furnace gets its GuiContainer constructed using a Container that calls a constructor that does this:

 

this(containerTypeIn, recipeTypeIn, id, playerInventoryIn, new Inventory(3), new IntArray(4));

 

That new Inventory(3) is what gets referenced on the client side later on as the Furnace inventory and the new IntArray(4) is used as field_217064_e, referenced in getCookProgressionScaled(). But it's a blank array! It never gets filled with any values as far as I can find.

 

Going a step further it appears that furnaces are just plain broken (they don't smelt, at all) in the dev environment. Can anyone confirm this?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

10 minutes ago, Draco18s said:

Going a step further it appears that furnaces are just plain broken (they don't smelt, at all) in the dev environment. Can anyone confirm this?

Gonna check this now.

 

10 minutes ago, Draco18s said:

I'm trying to figure out how to set up gui containers so that the client side has a reference to the TE in question so that it can get things like the current cook time.

Yeah the way it is kinda seems weird to me, but I figured it out. So you need an INamedContainerProvider which can have a constructor. To open a gui you use one of the NetworkHooks.openGui which has three options all of which take in a ServerPlayer and a INamedContainerProvider. One takes in a BlockPos and another takes in a Consumer<PacketBuffer>.

 

And there is this example on the github.

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

7 minutes ago, Animefan8888 said:

Yeah the way it is kinda seems weird to me, but I figured it out. So you need an INamedContainerProvider which can have a constructor. To open a gui you use one of the NetworkHooks.openGui which has three options all of which take in a ServerPlayer and a INamedContainerProvider. One takes in a BlockPos and another takes in a Consumer<PacketBuffer>.

I have that. I extended the interface, actually, but my TE still implements it. createMenu, getDisplayName, and openGUI. All the vanilla TEs implement the interface directly.

 

I'm already using the NetworkHooks.openGui that takes in the player, container, and blockpos.

 

But I don't see where I get that blockpos back on the client end of things.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

28 minutes ago, Draco18s said:

Going a step further it appears that furnaces are just plain broken (they don't smelt, at all) in the dev environment. Can anyone confirm this?

I can confirm that they work in the latest version of forge  1.14. So you may want to update.

3 minutes ago, Draco18s said:

But I don't see where I get that blockpos back on the client end of things.

There might be some behind the scenes magic with registering the ContainerType you should use IForgeContainerType.create

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

20 minutes ago, Animefan8888 said:

I can confirm that they work in the latest version of forge  1.14. So you may want to update.

1.14.3 or 1.14.4?

20 minutes ago, Animefan8888 said:

There might be some behind the scenes magic with registering the ContainerType you should use IForgeContainerType.create

And how do you register the class as an IForgeContainerType?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

7 minutes ago, Draco18s said:

1.14.3 or 1.14.4?

1.14.4 I updated when it first came out.

 

7 minutes ago, Draco18s said:

And how do you register the class as an IForgeContainerType?

ContainerTypes are a registry.

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

3 minutes ago, Animefan8888 said:

1.14.4 I updated when it first came out.

Noted. I'll give that a try.

Quote

ContainerTypes are a registry.

Yes. I know. That's not what I am having a problem with.

ContainerType's constructor requires an IFactory parameter (which defines a create method), not an IForgeContainerType (which defines a different create method).

ContainerType is already an IForgeContainerType, so either:

a) I'm already doing it right and something else is wrong

b) I'm doing it wrong

What do I need to do to get the IForgeContainerType result?

Edited by Draco18s

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

6 minutes ago, Draco18s said:

a) I'm already doing it right and something else is wrong

b) I'm doing it wrong

I'm not sure do you have your code on your github so I can look.

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

5 minutes ago, Animefan8888 said:

I'm not sure do you have your code on your github so I can look.

Will be here momentarily (need to push changes, will take a few minutes)

https://github.com/Draco18s/ReasonableRealism/blob/1.14.3/src/main/java/com/draco18s/harderores/HarderOres.java#L102

Done

Edited by Draco18s

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

16 minutes ago, Draco18s said:

b) I'm doing it wrong

EasyRegistry.registerOther(new ContainerType<>(SifterContainer::new), new ResourceLocation(HarderOres.MODID,"sifter"));

Instead of new ContainerType<?> do IForgeContainerType.create(SifterContainer::new)

 

And then in your SifterContainer have a constructor with a PacketBuffer parameter. I think it gets passed in there. And then you can send whatever info you want to the container.

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

I swear I tried doing that and Eclipse wouldn't let me. I probably inferred something wrong and the autocompletion was (correctly, but unhelpfully) not suggesting things or otherwise complaining.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • LadangToto2 adalah pilihan terbaik bagi Anda yang mencari pengalaman bermain slot gacor dengan transaksi mudah menggunakan Bank Mestika. Berikut adalah beberapa alasan mengapa Anda harus memilih LadangToto2: Slot Gacor Terbaik Kami menyajikan koleksi slot gacor terbaik yang menawarkan kesenangan bermain dan peluang kemenangan besar. Dengan fitur-fitur unggulan dan tema-tema menarik, setiap putaran permainan akan memberikan Anda pengalaman yang tak terlupakan. Transaksi Mudah dengan Bank Mestika Kami menyediakan layanan transaksi mudah melalui Bank Mestika untuk kenyamanan dan keamanan Anda. Dengan proses yang cepat dan efisien, Anda dapat melakukan deposit dan penarikan dana dengan lancar dan tanpa hambatan. Hadiah Hingga 100 Juta LadangToto2 memberikan kesempatan untuk meraih hadiah hingga 100 juta dalam kemenangan. Dengan jackpot dan hadiah-hadiah besar yang ditawarkan, setiap putaran permainan bisa menjadi peluang untuk meraih keberuntungan besar.  
    • Mengapa Memilih LadangToto? LadangToto adalah pilihan terbaik bagi Anda yang mencari pengalaman bermain slot gacor WD Maxwin dengan transaksi mudah menggunakan Bank BNI. Berikut adalah beberapa alasan mengapa Anda harus memilih LadangToto: Slot Gacor WD Maxwin Terbaik Kami menyajikan koleksi slot gacor WD Maxwin terbaik yang menawarkan kesenangan bermain dan peluang kemenangan besar. Dengan fitur-fitur unggulan dan tema-tema menarik, setiap putaran permainan akan memberikan Anda pengalaman yang tak terlupakan. Transaksi Mudah dengan Bank BNI Kami menyediakan layanan transaksi mudah melalui Bank BNI untuk kenyamanan dan keamanan Anda. Dengan proses yang cepat dan efisien, Anda dapat melakukan deposit dan penarikan dana dengan lancar dan tanpa hambatan.  
    • Akun Pro Kamboja adalah pilihan terbaik bagi Anda yang mencari pengalaman bermain slot Maxwin dengan transaksi mudah menggunakan Bank Lampung. Berikut adalah beberapa alasan mengapa Anda harus memilih Akun Pro Kamboja: Slot Maxwin Terbaik Kami menyajikan koleksi slot Maxwin terbaik yang menawarkan kesenangan bermain dan peluang kemenangan besar. Dengan fitur-fitur unggulan dan tema-tema menarik, setiap putaran permainan akan memberikan Anda pengalaman yang tak terlupakan. Transaksi Mudah dengan Bank Lampung Kami menyediakan layanan transaksi mudah melalui Bank Lampung untuk kenyamanan dan keamanan Anda. Dengan proses yang cepat dan efisien, Anda dapat melakukan deposit dan penarikan dana dengan lancar dan tanpa hambatan. Anti Rungkat Akun Pro Kamboja memberikan jaminan "anti rungkat" kepada para pemainnya. Dengan fitur ini, Anda dapat merasakan sensasi bermain dengan percaya diri, karena kami memastikan pengalaman bermain yang adil dan menyenangkan bagi semua pemain.  
    • BINGO188: Destinasi Terbaik untuk Pengalaman Slot yang Terjamin Selamat datang di BINGO188, tempat terbaik bagi para pecinta slot yang mencari pengalaman bermain yang terjamin dan penuh kemenangan. Di sini, kami menawarkan fitur unggulan yang dirancang untuk memastikan kepuasan dan keamanan Anda. Situs Slot Garansi Kekalahan 100 Kami memahami bahwa kadang-kadang kekalahan adalah bagian dari permainan. Namun, di BINGO188, kami memberikan jaminan keamanan dengan fitur garansi kekalahan 100. Jika Anda mengalami kekalahan, kami akan mengembalikan saldo Anda secara penuh. Kemenangan atau uang kembali, kami memastikan Anda tetap merasa aman dan nyaman. Bebas IP Tanpa TO Nikmati kebebasan bermain tanpa batasan IP dan tanpa harus khawatir tentang TO (Turn Over) di BINGO188. Fokuslah pada permainan Anda dan rasakan sensasi kemenangan tanpa hambatan. Server Thailand Paling Gacor Hari Ini Bergabunglah dengan server terbaik di Thailand hanya di BINGO188! Dengan tingkat kemenangan yang tinggi dan pengalaman bermain yang lancar, server kami dijamin akan memberikan Anda pengalaman slot yang tak tertandingi. Kesimpulan BINGO188 adalah pilihan terbaik bagi Anda yang menginginkan pengalaman bermain slot yang terjamin dan penuh kemenangan. Dengan fitur situs slot garansi kekalahan 100, bebas IP tanpa TO, dan server Thailand paling gacor hari ini, kami siap memberikan Anda pengalaman bermain yang aman, nyaman, dan menguntungkan. Bergabunglah sekarang dan mulailah petualangan slot Anda di BINGO188!
    • Mengapa Memilih AlibabaSlot? AlibabaSlot adalah pilihan terbaik bagi Anda yang mencari slot gacor dari Pgsoft dengan transaksi mudah menggunakan Bank Panin. Berikut adalah beberapa alasan mengapa Anda harus memilih AlibabaSlot: Slot Gacor dari Pgsoft Kami menyajikan koleksi slot gacor terbaik dari Pgsoft. Dengan fitur-fitur unggulan dan peluang kemenangan yang tinggi, setiap putaran permainan akan memberikan Anda kesenangan dan keuntungan yang maksimal. Transaksi Mudah dengan Bank Panin Kami menyediakan layanan transaksi mudah melalui Bank Panin untuk kenyamanan dan keamanan Anda. Dengan proses yang cepat dan efisien, Anda dapat melakukan deposit dan penarikan dana dengan lancar dan tanpa masalah.  
  • Topics

×
×
  • Create New...

Important Information

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