Jump to content

[1.7.10] Custom enchanttable [SOLVED]


winnetrie

Recommended Posts

While the standard enchanttable doesn't recognize custom made bookshelfs due to the fact it only checks for the standard bookshelf and not the instanceof bookshelf block, i then thought let's make a custom enchanttable, copy over all the stuff and change the checking for the bookshelf into instanceof.

So i tested it and yeah it worked, the particles where showing up. So nice done i thought, but then when i clicked on the enchanttable no window( Gui) popped up where you can enchant stuff. I couldn't figure it out why that is.

Anyone can tell me why?

Link to comment
Share on other sites

I don't know about 1.7.10, as I'm using the newer and better 1.9, but the enchantment table only checks the bookshelf block for it's particles. For the power a block provides to a enchantment table, it checks

Block#getEnchantPowerBonus

.

 

BTW, if you didn't get it before, update. 1.7.10 is old and 1.9 has a recommended release.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

I don't know about 1.7.10, as I'm using the newer and better 1.9, but the enchantment table only checks the bookshelf block for it's particles. For the power a block provides to a enchantment table, it checks

Block#getEnchantPowerBonus

.

 

BTW, if you didn't get it before, update. 1.7.10 is old and 1.9 has a recommended release.

I wonder if you even read what i said? That wasn't helpfull at all! The problem is when clicking on the table i get no GUI like you normally should get!

As for the update to 1.9, well again i use 1.7.10 because i have no use for 1.9

There is a reason someone uses 1.7.10. I do not use 1.7.10 just for fun you know.

Link to comment
Share on other sites

ContainerEnchantment#canInteractWith

checks if the block at its position is

Blocks.enchanting_table

and the player is within 8 blocks of it, so it can't be used with your block.

 

You need to create your own

Container

that extends

ContainerEnchantment

and overrides

canInteractWith

to check for your block instead.

 

You also need to create your own

GuiContainer

class that renders like

GuiEnchantment

but uses your

Container

instead of

ContainerEnchantment

.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Thank you!

Something isn't still clear.

in this:

public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_)
    {
        if (world.isRemote)
        {
            return true;
        }
        else
        {
            TileEntityEnchantmentTable tileentityenchantmenttable = (TileEntityEnchantmentTable)world.getTileEntity(x, y, z);
            player.displayGUIEnchantment(x, y, z, tileentityenchantmenttable.func_145921_b() ? tileentityenchantmenttable.func_145919_a() : null);
            return true;
        }
    }

what/how do i place in there to get mine gui?

i have made a gui class called TemGuiEnchanttable.class

Also do i have to register the gui and container somewhere? I really have no clue!

 

Link to comment
Share on other sites

I don't know about 1.7.10, as I'm using the newer and better 1.9, but the enchantment table only checks the bookshelf block for it's particles. For the power a block provides to a enchantment table, it checks

Block#getEnchantPowerBonus

.

 

BTW, if you didn't get it before, update. 1.7.10 is old and 1.9 has a recommended release.

I wonder if you even read what i said? That wasn't helpfull at all! The problem is when clicking on the table i get no GUI like you normally should get!

As for the update to 1.9, well again i use 1.7.10 because i have no use for 1.9

There is a reason someone uses 1.7.10. I do not use 1.7.10 just for fun you know.

Whoa, calm down. I was implying that you don't have to make a custom enchantment table for custom bookshelfs, the vanilla enchantment table works with them (in 1.9...).

 

I do not use 1.7.10 just for fun you know.

Then why do you use it? Are you being forced to? By what?

 

You have to use an

IGuiHandler

for custom GUIs. There are tutorials online.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

 

Whoa, calm down. I was implying that you don't have to make a custom enchantment table for custom bookshelfs, the vanilla enchantment table works with them (in 1.9...).

I'm totally calm, i only had the impression you were just saying something random, srry for that.

 

Then why do you use it? Are you being forced to? By what?

 

It is because the reason i started modding. I want to make a public server with my mod. As far as i know to have a good working server you need several plugins. There is the problem, 'plugins' do not work with forge alone, so i use cauldron wich supports forge and bukkit/spigot. Cauldron has been stuck on mc version 1.7.10 and it won't get updates to 1.9.

Now you would ask why i need plugins. I need stuff like anti griefing (a good 1 is griefprevention). As far as i know there isn't any good antigrief mod made for forge.

Making a public server without any server utilities and without any good antigrief, well i guess you got the point.

I would prefer to use 1.9, because it is newer, updated, more support and i bet much better too.

You could say, create your own antigrief mod and all the other stuff, but this is all too advanced for me right now.

I'm already happy what i have created now (see signature  :P )!

 

You have to use an

IGuiHandler

for custom GUIs. There are tutorials online.

thank you, but i guess Choonster was faster hehe.

Link to comment
Share on other sites

You have to use an

IGuiHandler

for custom GUIs. There are tutorials online.

thank you, but i guess Choonster was faster hehe.

 

What larsgerrits said still applies to my post: Once you've created your own GUI, you need to use the

IGuiHandler

system to open it.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Thanks to both of you. It is working now.  ;D

I also did the same with the workbench and that's working too.

Now i have a working enchanttable that supports my custom bookshelfs!!  :P

 

Maybe 1 last thing. Is there a way to show the enchant by it's name instead of those gibberisch letters?

Link to comment
Share on other sites

You'd have to do that in the GUI, and search for where it renders those strings. I don't have a 1.7.10 workspace, and enchantment tables have changed in 1.8/1.9, sou I wouldn't be of much help here.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

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

    • Perjudian online telah menjadi tren yang populer di kalangan penggemar permainan kasino. Salah satu permainan yang paling diminati adalah mesin slot online. Mesin slot online menawarkan kesenangan dan kegembiraan yang tak tertandingi, serta peluang untuk memenangkan hadiah besar. Salah satu situs slot online resmi yang menarik perhatian banyak pemain adalah Tuyul Slot. Kenapa Memilih Tuyul Slot? Tuyul Slot adalah situs slot online resmi yang menawarkan berbagai keuntungan bagi para pemainnya. Berikut adalah beberapa alasan mengapa Anda harus memilih Tuyul Slot: 1. Keamanan dan Kepercayaan Tuyul Slot adalah situs slot online resmi yang terpercaya dan memiliki reputasi yang baik di kalangan pemain judi online. Situs ini menggunakan teknologi keamanan terkini untuk melindungi data pribadi dan transaksi keuangan pemain. Anda dapat bermain dengan tenang dan yakin bahwa informasi Anda aman. 2. Pilihan Permainan yang Beragam Tuyul Slot menawarkan berbagai macam permainan slot online yang menarik. Anda dapat memilih dari ratusan judul permainan yang berbeda, dengan tema dan fitur yang beragam. Setiap permainan memiliki tampilan grafis yang menarik dan suara yang menghibur, memberikan pengalaman bermain yang tak terlupakan. 3. Kemudahan Menang Salah satu keunggulan utama dari Tuyul Slot adalah kemudahan untuk memenangkan hadiah. Situs ini menyediakan mesin slot online dengan tingkat pengembalian yang tinggi, sehingga peluang Anda untuk memenangkan hadiah besar lebih tinggi. Selain itu, Tuyul Slot juga menawarkan berbagai bonus dan promosi menarik yang dapat meningkatkan peluang Anda untuk menang. Cara Memulai Bermain di Tuyul Slot Untuk memulai bermain di Tuyul Slot, Anda perlu mengikuti langkah-langkah berikut: 1. Daftar Akun Kunjungi situs Tuyul Slot dan klik tombol "Daftar" untuk membuat akun baru. Isi formulir pendaftaran dengan informasi pribadi yang valid dan lengkap. Pastikan untuk memberikan data yang akurat dan jaga kerahasiaan informasi Anda. 2. Deposit Dana Setelah mendaftar, Anda perlu melakukan deposit dana ke akun Anda. Tuyul Slot menyediakan berbagai metode pembayaran yang aman dan terpercaya. Pilih metode yang paling nyaman untuk Anda dan ikuti petunjuk untuk melakukan deposit. 3. Pilih Permainan Setelah memiliki dana di akun Anda, Anda dapat memilih permainan slot online yang ingin Anda mainkan. Telusuri koleksi permainan yang tersedia dan pilih yang paling menarik bagi Anda. Anda juga dapat mencoba permainan secara gratis sebelum memasang taruhan uang sungguhan. 4. Mulai Bermain Saat Anda sudah memilih permainan, klik tombol "Main" untuk memulai permainan. Anda dapat mengatur jumlah taruhan dan jumlah garis pembayaran sesuai dengan preferensi Anda. Setelah itu, tekan tombol "Putar" dan lihat apakah Anda beruntung untuk memenangkan hadiah. Promosi dan Bonus Tuyul Slot menawarkan berbagai promosi dan bonus menarik kepada para pemainnya. Beberapa jenis promosi yang tersedia termasuk bonus deposit, cashback, dan turnamen slot. Pastikan untuk memanfaatkan promosi ini untuk meningkatkan peluang Anda memenangkan hadiah besar. Kesimpulan Tuyul Slot adalah situs slot online resmi yang menawarkan pengalaman bermain yang seru dan peluang menang yang tinggi. Dengan keamanan dan kepercayaan yang terjamin, berbagai pilihan permainan yang menarik, serta bonus dan promosi yang menguntungkan, Tuyul Slot menjadi pilihan yang tepat bagi para penggemar mesin slot online. Segera daftar akun dan mulai bermain di Tuyul Slot untuk kesempatan memenangkan hadiah besar!
    • I have been having a problem with minecraft forge. Any version. Everytime I try to launch it it always comes back with error code 1. I have tried launching from curseforge, from the minecraft launcher. I have also tried resetting my computer to see if that would help. It works on my other computer but that one is too old to run it properly. I have tried with and without mods aswell. Fabric works, optifine works, and MultiMC works aswell but i want to use forge. If you can help with this issue please DM on discord my # is Haole_Dawg#6676
    • Add the latest.log (logs-folder) with sites like https://paste.ee/ and paste the link to it here  
    • I have no idea how a UI mod crashed a whole world but HUGE props to you man, just saved me +2 months of progress!  
    • So i know for a fact this has been asked before but Render stuff troubles me a little and i didnt find any answer for recent version. I have a custom nausea effect. Currently i add both my nausea effect and the vanilla one for the effect. But the problem is that when I open the inventory, both are listed, while I'd only want mine to show up (both in the inv and on the GUI)   I've arrived to the GameRender (on joined/net/minecraft/client) and also found shaders on client-extra/assets/minecraft/shaders/post and client-extra/assets/minecraft/shaders/program but I'm lost. I understand that its like a regular screen, where I'd render stuff "over" the game depending on data on the server, but If someone could point to the right client and server classes that i can read to see how i can manage this or any tip would be apreciated
  • Topics

×
×
  • Create New...

Important Information

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