Jump to content

Where are the basic color values coded?


Drachenbauer

Recommended Posts

Most things that use the colors (excluding leather armor and such) don't use them dynamically; you'd have to actually change the textures, names, etc. to have any effect.

In any case, no. There's no reasonable way to change anything to do with DyeColor. Oh right, reflection duh.

Edited by imacatlolol
I'm dumb

I'm eager to learn and am prone to mistakes. Don't hesitate to tell me how I can improve.

Link to comment
Share on other sites

The sheep has this:

 

public static DyeColor getRandomSheepColor(Random random)
    {
        int i = random.nextInt(100);
        
        if (i < 5)
        {
            return DyeColor.BLACK;
        }
        else if (i < 10)
        {
            return DyeColor.GRAY;
        }
        else if (i < 15)
        {
            return DyeColor.LIGHT_GRAY;
        }
        else if (i < 18)
        {
            return DyeColor.BROWN;
        }
        else if (random.nextInt(500) == 0)
        {
            return DyeColor.PINK;
        }
        else
        {
            return DyeColor.WHITE;
        }
    }

 

Link to comment
Share on other sites

Yes.

I know about theese fields.

Must i extend and override the sheep to replace the stuff, shown above, with such custom colorvalues?

I don´t know, how to put stuff with custom values in theese fields, behind the "return" in this mthod there?

Edited by Drachenbauer
Link to comment
Share on other sites

At searching for "change fields with reflection" i found this:

        Class<?> clazz = Class.forName("Child");
        Object cc = clazz.newInstance();

        Field f1 = cc.getClass().getField("a_field");
        f1.set(cc, "reflecting on life");

 

But if i try to use DyeColors in there, it says things about IllegalAcessExeption.

i hat to put theese exeptionhandlings to the header of the function, i placed this in.

 

another question:

A color-field holds alot of content;

WHITE(0, "white", 16777215, MaterialColor.SNOW, 16777215, 16777215),

how do i put all this into the setter of this reflection-stuff?

Edited by Drachenbauer
Link to comment
Share on other sites

        ObfuscationReflectionHelper.setPrivateValue(DyeColor.class, DyeColor.WHITE, 16777215, "colorvalue");
        ObfuscationReflectionHelper.setPrivateValue(DyeColor.class, DyeColor.WHITE, 16777215, "fireworkColor");
        ObfuscationReflectionHelper.setPrivateValue(DyeColor.class, DyeColor.WHITE, 16777215, "textColor");

Is this the way to do it?

 

To repeat for all 16 colors.

Edited by Drachenbauer
Link to comment
Share on other sites

In my lines there i use the clear names DyeColor and WHITE.

I taught, maybe i have to use the SRG-Names for theese things, too, in the positions for class and instance in the code-line...

 

But maybe not, because it don´t want theese names as a string, like the fieldname.

 

Another thing, yout discord-link stucks on connecting (a black page with a rotating discord-logo)...

Edited by Drachenbauer
Link to comment
Share on other sites

Now i have theese lines for all 15 colors.

 

Is this all i need to show all this stuff in the new colors?

 

Now i found the class MaterialColors, where i als want to change fields now.

What must i put there as the class-instance?

 

Edit:

The colors of banners and stuff are not changed now.

What else must i do, to make it work?

Edited by Drachenbauer
Link to comment
Share on other sites

I made a test, but the banners, sheeps and other stuff still appear in old colors.

I tried the code in common-setup and client-registries in my main-class, both the same.

 

Now my lines look like this:

        ObfuscationReflectionHelper.setPrivateValue(DyeColor.class, DyeColor.RED, 0xff0000, "field_193351_w"); //colorvalue
        ObfuscationReflectionHelper.setPrivateValue(DyeColor.class, DyeColor.RED, 0xff0000, "field_196067_y"); //fireworkColor
        ObfuscationReflectionHelper.setPrivateValue(DyeColor.class, DyeColor.RED, 0xff0000, "field_218390_z"); //textColor

Such a stack for each color.

 

And for the material-color, i found out, that the colors there are such class-instances, zoo.

So i was able to make this:

ObfuscationReflectionHelper.setPrivateValue(MaterialColor.class, MaterialColor.RED, 0xff0000, "field_76291_p");//colorvalue

also for all theese 16 colors and terracotta-colors. (there are some more values, but i don´t want to change them.)

 

What do i miss, to get this stuff to work?

Edited by Drachenbauer
Link to comment
Share on other sites

i decided to watch a video, how to use the debugger, than try this, and than tell more here.

Like the guy in the video, i made a breakpoint at the first one of theese lines and clicked the debug-button, but it does not stop there.

 

in other mods, other code, located in common-setup and client-registries is executed.

So i´m wondering about this.

Edited by Drachenbauer
Link to comment
Share on other sites

Now i finally found the solution:

i remembered, that there is a calculation for colorComponentValues.

i placed it in a function in my main-class and passed the result of this function into another reflection-line for each color, that uses the field colorComponentValues.

now the game-stuff appears in the new colors.

Link to comment
Share on other sites

Now i noticed, there seems to be a slightly different shader, if the color comes from a texture pnr or from a colorvalue-number in the code:

2020-04-13_18_20_22.png.df1ed41520fea61350e81624b9243e35.png

The leather-armour is dyed with the new shade of pink, i gave with my mod-code.

And in my skin png (Stella from Angry Birds) i used the same color value for the pink color.

So i wonder, why it looks different on almost horizontal surfaces (like the character´s face, if looking upward, like in the upper picture or the top of the body-ModelBox)

2020-04-13_18_20_09.png.4a8025ec457fd6ba4e31a56d9ed3c401.png

in this more vertical orientation, you can see, that the lighter pink in the middie of th helmet-front is exctly the same as at the face of the character.

And directly below the head, you can see the different shading between body and armour again

 

another sample:

bed and banner

2020-04-13_18_38_44.png.f8e35ebff50f5b384ba2b7a26a75185f.png

In this bed-texture png i also used the same shade of pink and the banner get´s it´s color from my mod-code.

both models are TileEntity models

The same difference at the horizontal surfaces (the narrow top of the banner looks closer to white, than the top of the bed).

 

Why it makes a difference there, if the color comes from the texture or from a value in the code?

Edited by Drachenbauer
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

    • OLXTOTO: Platform Maxwin dan Gacor Terbesar Sepanjang Masa OLXTOTO telah menetapkan standar baru dalam dunia perjudian dengan menjadi platform terbesar untuk pengalaman gaming yang penuh kemenangan dan kegacoran, sepanjang masa. Dengan fokus yang kuat pada menyediakan permainan yang menghadirkan kesenangan tanpa batas dan peluang kemenangan besar, OLXTOTO telah menjadi pilihan utama bagi para pencinta judi berani di Indonesia. Maxwin: Mengejar Kemenangan Terbesar Maxwin bukan sekadar kata-kata kosong di OLXTOTO. Ini adalah konsep yang ditanamkan dalam setiap aspek permainan yang mereka tawarkan. Dari permainan slot yang menghadirkan jackpot besar hingga berbagai opsi permainan togel dengan hadiah fantastis, para pemain dapat memperoleh peluang nyata untuk mencapai kemenangan terbesar dalam setiap taruhan yang mereka lakukan. OLXTOTO tidak hanya menawarkan kesempatan untuk menang, tetapi juga menjadi wadah bagi para pemain untuk meraih impian mereka dalam perjudian yang berani. Gacor: Keberuntungan yang Tak Tertandingi Keberuntungan seringkali menjadi faktor penting dalam perjudian, dan OLXTOTO memahami betul akan hal ini. Dengan berbagai strategi dan analisis yang disediakan, pemain dapat menemukan peluang gacor yang tidak tertandingi dalam setiap taruhan. Dari hasil togel yang tepat hingga putaran slot yang menguntungkan, OLXTOTO memastikan bahwa setiap taruhan memiliki potensi untuk menjadi momen yang mengubah hidup. Inovasi dan Kualitas Tanpa Batas Tidak puas dengan prestasi masa lalu, OLXTOTO terus berinovasi untuk memberikan pengalaman gaming terbaik kepada para pengguna. Dengan menggabungkan teknologi terbaru dengan desain yang ramah pengguna, platform ini menyajikan antarmuka yang mudah digunakan tanpa mengorbankan kualitas. Setiap pembaruan dan peningkatan dilakukan dengan tujuan tunggal: memberikan pengalaman gaming yang tanpa kompromi kepada setiap pengguna. Komitmen Terhadap Kepuasan Pelanggan Di balik kesuksesan OLXTOTO adalah komitmen mereka terhadap kepuasan pelanggan. Tim dukungan pelanggan yang profesional siap membantu para pemain dalam setiap langkah perjalanan gaming mereka. Dari pertanyaan teknis hingga bantuan dengan transaksi keuangan, OLXTOTO selalu siap memberikan pelayanan terbaik kepada para pengguna mereka. Penutup: Mengukir Sejarah dalam Dunia Perjudian Daring OLXTOTO bukan sekadar platform perjudian berani biasa. Ini adalah ikon dalam dunia perjudian daring Indonesia, sebuah destinasi yang menyatukan kemenangan dan keberuntungan dalam satu tempat yang mengasyikkan. Dengan komitmen mereka terhadap kualitas, inovasi, dan kepuasan pelanggan, OLXTOTO terus mengukir sejarah dalam perjudian dunia berani, menjadi nama yang tak terpisahkan dari pengalaman gaming terbaik. Bersiaplah untuk mengalami sensasi kemenangan terbesar dan keberuntungan tak terduga di OLXTOTO - platform maxwin dan gacor terbesar sepanjang masa.
    • OLXTOTO - Bandar Togel Online Dan Slot Terbesar Di Indonesia OLXTOTO telah lama dikenal sebagai salah satu bandar online terkemuka di Indonesia, terutama dalam pasar togel dan slot. Dengan reputasi yang solid dan pengalaman bertahun-tahun, OLXTOTO menawarkan platform yang aman dan andal bagi para penggemar perjudian daring. DAFTAR OLXTOTO DISINI DAFTAR OLXTOTO DISINI DAFTAR OLXTOTO DISINI Beragam Permainan Togel Sebagai bandar online terbesar di Indonesia, OLXTOTO menawarkan berbagai macam permainan togel. Mulai dari togel Singapura, togel Hongkong, hingga togel Sidney, pemain memiliki banyak pilihan untuk mencoba keberuntungan mereka. Dengan sistem yang transparan dan hasil yang adil, OLXTOTO memastikan bahwa setiap taruhan diproses dengan cepat dan tanpa keadaan. Slot Online Berkualitas Selain togel, OLXTOTO juga menawarkan berbagai permainan slot online yang menarik. Dari slot klasik hingga slot video modern, pemain dapat menemukan berbagai opsi permainan yang sesuai dengan preferensi mereka. Dengan grafis yang memukau dan fitur bonus yang menggiurkan, pengalaman bermain slot di OLXTOTO tidak akan pernah membosankan. Keamanan dan Kepuasan Pelanggan Terjamin Keamanan dan kepuasan pelanggan merupakan prioritas utama di OLXTOTO. Mereka menggunakan teknologi enkripsi terbaru untuk melindungi data pribadi dan keuangan para pemain. Tim dukungan pelanggan yang ramah dan responsif siap membantu pemain dengan setiap pertanyaan atau masalah yang mereka hadapi. Promosi dan Bonus Menarik OLXTOTO sering menawarkan promosi dan bonus menarik kepada para pemainnya. Mulai dari bonus selamat datang hingga bonus deposit, pemain memiliki kesempatan untuk meningkatkan kemenangan mereka dengan memanfaatkan berbagai penawaran yang tersedia. Penutup Dengan reputasi yang solid, beragam permainan berkualitas, dan komitmen terhadap keamanan dan kepuasan pelanggan, OLXTOTO tetap menjadi salah satu pilihan utama bagi para pecinta judi online di Indonesia. Jika Anda mencari pengalaman berjudi yang menyenangkan dan terpercaya, OLXTOTO layak dipertimbangkan.
    • 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!  
  • Topics

×
×
  • Create New...

Important Information

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