Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avaritia Renders for MetaItems and Materials #2683

Open
wants to merge 167 commits into
base: master
Choose a base branch
from

Conversation

jude123412
Copy link

What

I have added some Avaritia Methods to GT MetaItems and GT Materials.
This allows for all Material items and MetaItems to use Avaritia render's like Halo's behind items and Cosmic Effect for items.
Making Materials like Infinity or Cosmic Neutronium are missing these methods inside the Material Builder To give them Halo noise, Pulse effect, Halo, Halo Colour, Item Pulsing or Cosmic Effect. These new Renders are only active when Avaritia is installed because I'm using Avaritia to render everything.

I think what I have listed above is a good enough reason to accept this PR, This is somthing that I desire and many other do too.

Implementation Details

The MetaItem, Material MaterialBuilder should be checked they are where most of the methods are but other things in this PR could be checked too.

Outcome

This Pr will add support for Avaritia Renders Such as shouldDrawHalo, haloTexture, haloColour, haloSize, shouldDrawPulse, shouldDrawCosmic/maskTexturePath and maskOpacity to MetaItems and Materials in the Material Builder.

These Methods will only become active when Avaritia Is installed, When it is not the Methods do nothing.

Additional Information

These are a couple of the new render methods for Materials and MetaItems I made using the methods stated above.

Avaritia Halo and Cosmic Effect for NotANoob Certificate

image
https://github.com/user-attachments/assets/fe69f436-b59a-495a-a953-cb49f0616c19

Naquadah Material With red coloured halo and Pulse Effect

Recording_2024-12-15_171620.mp4

Naquadria With Cosmic Effect

Recording_2024-12-15_171544.mp4

These are the Methods you can define inside the Material Builder.
They are all optional methods that are only active when Avaritia is installed.
.cosmic(boolean shouldDrawHalo, String haloTexture, String haloColour, int haloSize, boolean shouldDrawPulse, boolean shouldDrawCosmic, Float maskOpacity)
cosmic(boolean shouldDrawHalo, String haloTexture, String haloColour, int haloSize, boolean shouldDrawPulse)
cosmic(boolean shouldDrawHalo, String haloTexture, String haloColour, int haloSize)
cosmic( boolean shouldDrawCosmic, Float maskOpacity)
cosmic(boolean shouldDrawPulse)

shouldDrawHalo will set a Material set to draw a Halo, This will need also need haloTexture, haloColour and haloSize to be set.

haloTexture will get the halo from "gregtech:texture/items/cosmic/String haloTexture".

haloColour What colour the Halo will be as a Hex Value "00FF00" for green

haloSize The size of the halo Max value of 10. defined as an Integer, 10 would be max size.

shouldDrawCosmic will generate the correct locations for textures of the Material Set, If the IconSet is set to DULL for instance, all Mask Textures are generated under "gregtech:textures/items/material_sets/dull/%s_mask." (%s is the item type, dust, ingot, gem).

maskOpacity Defines the opacity of the mask as a float, Max value 1.0f

These are the Methods you can define for any MetaItem.
They are all optional methods that are only active when Avaritia is installed.
.cosmicProperties(boolean shouldDrawHalo, String haloTexture, String haloColour, int haloSize, boolean shouldDrawPulse, String maskTexture, float maskOpacity)
.cosmicProperties(boolean shouldDrawHalo, String haloTexture, String haloColour, int haloSize, boolean shouldDrawPulse)
.cosmicProperties(boolean shouldDrawHalo, String haloTexture, String haloColour, int haloSize)
.cosmicProperties(String maskTexture, Float maskOpacity)
.cosmicProperties(boolean shouldDrawPulse)

These work the same as the Material builder accept they are on a per item basis and the mask Texture is defined as a string and will be under "gregtech:texture/items/cosmic/mask/String maskTexture".

Potential Compatibility Issues

There shouldn't be any incompatibility issues with this. I have tested it on my PC and no issue were found, well all issues I found were fixed before this pr.

serenibyss and others added 30 commits December 10, 2023 18:55
Co-authored-by: DStrand1 <[email protected]>
Co-authored-by: alongstringofnumbers <[email protected]>
M-W-K and others added 16 commits July 6, 2024 23:11
Co-authored-by: Weblate <[email protected]>
Co-authored-by: Western01 <[email protected]>
(cherry picked from commit a706c39)
Co-authored-by: TechLord22 <[email protected]>
(cherry picked from commit 52c835c)
Co-authored-by: ALongStringOfNumbers <[email protected]>
(cherry picked from commit e4a86be)
Added Cosmic Effect to MetaPrefixItem Class. This allows for all Materials in GregTech to use some Renderers from Avaritia.
Changes to MetaItem and MetaPrefixItem to only allow cosmic effects if Avaritia is installed
Lots of Mask textures for all Material sets
@jude123412 jude123412 requested review from a team as code owners December 16, 2024 15:49
@Oganesson897
Copy link

looks very similar to the code here, and with only minor changes, but I dont see any mention of the original author

@jude123412
Copy link
Author

Hmm, I should Probably ask the Owner of Avaritia for Permission to use some of there code

@jude123412
Copy link
Author

jude123412 commented Dec 20, 2024

I think You will need to credit them on this github page or at least Avaritia for using there methods xD. I have never done somthing like this before so ill be learning along the way!

Cleaner Code + Credits to Avaritia Owners
@Zorbatron Zorbatron added the type: feature New feature or request label Dec 20, 2024
added Api Files from Avaritia to fix an issue caused by them not being there
Run ./gradlew :spotlessCheck --warning-mode all --build-cache and ./gradlew :spotlessApply --warning-mode all to fix and clean code
I have received permission from Morpheus1101 to use some of Avaritia's code for this new patch.
Permission5 is what they said.
@jude123412 jude123412 requested a review from a team as a code owner December 22, 2024 10:13
@jude123412
Copy link
Author

I have just added permission5 to the pr, we are all ok to use some of there code here for this pr
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.