Repository: Ladysnake/Illuminations Branch: main Commit: f6ec2bf4a18b Files: 188 Total size: 423.1 KB Directory structure: gitextract_kldsscd_/ ├── .gitignore ├── CHANGELOG.md ├── LICENSE-ART ├── LICENSE-CODE ├── README.md ├── build.gradle ├── gradle/ │ └── wrapper/ │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── gradlew ├── gradlew.bat ├── lib/ │ ├── javax.annotation.jar │ ├── javax.ejb.jar │ ├── javax.jms.jar │ ├── javax.persistence.jar │ ├── javax.resource.jar │ ├── javax.servlet.jar │ ├── javax.servlet.jsp.jar │ ├── javax.servlet.jsp.jstl.jar │ └── javax.transaction.jar ├── logs/ │ └── latest.log ├── release.gradle ├── settings.gradle └── src/ └── main/ ├── java/ │ └── ladysnake/ │ └── illuminations/ │ ├── IlluminationsMixinConfigPlugin.java │ ├── client/ │ │ ├── Illuminations.java │ │ ├── IlluminationsModMenuIntegration.java │ │ ├── Rainbowlluminations.java │ │ ├── config/ │ │ │ ├── Config.java │ │ │ └── DefaultConfig.java │ │ ├── data/ │ │ │ ├── AuraData.java │ │ │ ├── AuraSettings.java │ │ │ ├── BiomeSettings.java │ │ │ ├── IlluminationData.java │ │ │ ├── OverheadData.java │ │ │ └── PlayerCosmeticData.java │ │ ├── enums/ │ │ │ ├── BiomeCategory.java │ │ │ ├── EyesInTheDarkSpawnRate.java │ │ │ ├── FireflySpawnRate.java │ │ │ ├── GlowwormSpawnRate.java │ │ │ ├── HalloweenFeatures.java │ │ │ ├── PlanktonSpawnRate.java │ │ │ └── WillOWispsSpawnRate.java │ │ ├── gui/ │ │ │ ├── AutoUpdateGreetingScreen.java │ │ │ ├── DonateToast.java │ │ │ └── UpdateToast.java │ │ ├── particle/ │ │ │ ├── ChorusPetalParticle.java │ │ │ ├── EmberParticle.java │ │ │ ├── EyesParticle.java │ │ │ ├── FireflyParticle.java │ │ │ ├── GlowwormParticle.java │ │ │ ├── PlanktonParticle.java │ │ │ ├── PoltergeistParticle.java │ │ │ ├── PrismarineCrystalParticle.java │ │ │ ├── PumpkinSpiritParticle.java │ │ │ ├── WillOWispParticle.java │ │ │ ├── WispTrailParticle.java │ │ │ ├── WispTrailParticleEffect.java │ │ │ ├── aura/ │ │ │ │ ├── AutumnLeavesParticle.java │ │ │ │ ├── ChorusAuraParticle.java │ │ │ │ ├── ConfettiParticle.java │ │ │ │ ├── GhostlyAuraParticle.java │ │ │ │ ├── GoldenrodAuraParticle.java │ │ │ │ ├── PrismarineAuraParticle.java │ │ │ │ ├── PrismaticConfettiParticle.java │ │ │ │ ├── SculkTendrilParticle.java │ │ │ │ ├── ShadowbringerParticle.java │ │ │ │ └── TwilightFireflyParticle.java │ │ │ └── pet/ │ │ │ ├── JackoParticle.java │ │ │ ├── PetParticle.java │ │ │ ├── PlayerLanternParticle.java │ │ │ ├── PlayerWispParticle.java │ │ │ └── PrideHeartParticle.java │ │ └── render/ │ │ ├── GlowyRenderLayer.java │ │ └── entity/ │ │ ├── feature/ │ │ │ └── OverheadFeatureRenderer.java │ │ └── model/ │ │ ├── hat/ │ │ │ ├── CrownModel.java │ │ │ ├── HaloModel.java │ │ │ ├── HornsModel.java │ │ │ ├── OverheadModel.java │ │ │ ├── TiaraModel.java │ │ │ ├── VoidheartTiaraModel.java │ │ │ └── WreathModel.java │ │ └── pet/ │ │ ├── LanternModel.java │ │ ├── PrideHeartModel.java │ │ └── WillOWispModel.java │ ├── mixin/ │ │ ├── BlockMixin.java │ │ ├── CarvedPumpkinBlockMixin.java │ │ ├── ChorusFlowerBlockMixin.java │ │ ├── ClientWorldMixin.java │ │ ├── LanternBlockMixin.java │ │ ├── LivingEntityMixin.java │ │ ├── ParticleManagerMixin.java │ │ ├── PlayerEntityMixin.java │ │ ├── RenderLayerAccessor.java │ │ ├── SkullBlockMixin.java │ │ ├── TitleScreenMixin.java │ │ └── jeb/ │ │ ├── FeatureRendererMixin.java │ │ └── LivingEntityRendererMixin.java │ └── updater/ │ └── IlluminationsUpdater.java └── resources/ ├── assets/ │ ├── illuminations/ │ │ ├── lang/ │ │ │ ├── de_de.json │ │ │ ├── en_us.json │ │ │ ├── id_id.json │ │ │ ├── ru_ru.json │ │ │ └── zh_cn.json │ │ ├── materialmaps/ │ │ │ ├── entity/ │ │ │ │ └── will_o_wisp.json │ │ │ └── particle/ │ │ │ ├── ace_pride_pet.json │ │ │ ├── autumn_leaves.json │ │ │ ├── bi_pride_pet.json │ │ │ ├── chorus_aura.json │ │ │ ├── chorus_petal.json │ │ │ ├── confetti.json │ │ │ ├── dissolution_wisp_pet.json │ │ │ ├── eyes.json │ │ │ ├── firefly.json │ │ │ ├── ghostly_aura.json │ │ │ ├── glowworm.json │ │ │ ├── goldenrod_aura.json │ │ │ ├── intersex_pride_pet.json │ │ │ ├── jacko_pet.json │ │ │ ├── lesbian_pride_pet.json │ │ │ ├── nb_pride_pet.json │ │ │ ├── plankton.json │ │ │ ├── pride_pet.json │ │ │ ├── prismarine_aura.json │ │ │ ├── prismarine_crystal.json │ │ │ ├── prismatic_confetti.json │ │ │ ├── sculk_tendril.json │ │ │ ├── shadowbringer_aura.json │ │ │ ├── trans_pride_pet.json │ │ │ ├── twilight_aura.json │ │ │ └── wisp_trail.json │ │ ├── particles/ │ │ │ ├── ace_pride_pet.json │ │ │ ├── agender_pride_pet.json │ │ │ ├── aro_pride_pet.json │ │ │ ├── autumn_leaves.json │ │ │ ├── bi_pride_pet.json │ │ │ ├── chorus_aura.json │ │ │ ├── chorus_petal.json │ │ │ ├── confetti.json │ │ │ ├── crying_lantern_pet.json │ │ │ ├── dissolution_wisp_pet.json │ │ │ ├── ember.json │ │ │ ├── ember_trail.json │ │ │ ├── eyes.json │ │ │ ├── firefly.json │ │ │ ├── founding_skull_pet.json │ │ │ ├── gay_pride_pet.json │ │ │ ├── ghostly.json │ │ │ ├── ghostly_aura.json │ │ │ ├── glowworm.json │ │ │ ├── golden_will_pet.json │ │ │ ├── goldenrod_aura.json │ │ │ ├── intersex_pride_pet.json │ │ │ ├── jacko_pet.json │ │ │ ├── lantern_pet.json │ │ │ ├── lesbian_pride_pet.json │ │ │ ├── nb_pride_pet.json │ │ │ ├── pan_pride_pet.json │ │ │ ├── plankton.json │ │ │ ├── poltergeist.json │ │ │ ├── poltergeist_pet.json │ │ │ ├── pride_pet.json │ │ │ ├── prismarine_aura.json │ │ │ ├── prismarine_crystal.json │ │ │ ├── prismatic_confetti.json │ │ │ ├── pumpkin_spirit.json │ │ │ ├── pumpkin_spirit_pet.json │ │ │ ├── sculk_tendril.json │ │ │ ├── shadowbringer_aura.json │ │ │ ├── soothing_lantern_pet.json │ │ │ ├── soul_lantern_pet.json │ │ │ ├── trans_pride_pet.json │ │ │ ├── twilight_aura.json │ │ │ ├── will_o_wisp.json │ │ │ ├── will_o_wisp_pet.json │ │ │ └── wisp_trail.json │ │ ├── shaders/ │ │ │ └── core/ │ │ │ ├── jeb.fsh │ │ │ ├── jeb.json │ │ │ └── jeb.vsh │ │ └── textures/ │ │ └── particle/ │ │ ├── dissolution_wisp.png.mcmeta │ │ ├── tendril_active.png.mcmeta │ │ └── tendril_inactive.png.mcmeta │ └── minecraft/ │ ├── materialmaps/ │ │ └── entity/ │ │ └── player.json │ └── shaders/ │ └── core/ │ └── particle.fsh ├── fabric.mod.json ├── illuminations-uninstaller.jar ├── illuminations.accesswidener ├── illuminations.mixins.json └── pack.mcmeta ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ # gradle .gradle/ build/ out/ # idea bin/ .idea/ .settings/ .project *.iml *.ipr *.iws *.launch # fabric run/ ================================================ FILE: CHANGELOG.md ================================================ # Illuminations - Changelog: ### Illuminations 1.10.2 - 1.18 - Update to Minecraft 1.18 ### Illuminations 1.10.1 - 1.17.1 - Added two integrated resource packs that control the firefly, glowworm and plankton texture. Two options are now available: "lowerres", a lower resolution of the firefly texture, and "pixelaccurate", a firefly texture made to look like the Minecraft Live 2021 firefly announced for the Wild Update - Added a debug mode config option to enable debug mode logs to troubleshoot issues with cosmetics loading ### Illuminations 1.10 - 1.17.1 - Added a new Illuminations type: Prismarine Crystals. Spawning in the shade of sea lanterns, these crystals will float underwater and oscillate between white, cyan and green. - Added a new aura for tier 2 donators: Prismarine aura - Added a new crown for tier 2 donators: Prismarine crown - Fixed the texture issue with the auto-update toast - Added a new donation toast to inform users of donation perks ### Illuminations 1.9: Hearts and Lanterns - 1.17.1 - Reworked all pride hearts to now be in 3D, better looking, and spinning! - Added Gay, Aromantic, Pansexual and Agender pride hearts - Added 4 new pets for supporters: the floating lanterns! Available in normal lantern, soul lantern as well as crying lantern and soothing lantern (from Spawn Lanterns). They also have two cute faces and spin! - All 3D particles are no longer shaded ### Illuminations 1.8 - 1.17.1 - Added Pumpkin Spirits! These mischievous entities take the form of small flying Jack o' Lanterns and will act like Will o' Wisps, appearing from Jack o' Lanterns at night - Added Poltergeists! These devious flying skulls will appear from placed skeleton skulls at night, and may also appear when you kill undead at night - These two new spirits are also available as pets for Illuminations supporters - Transformed the Eyes in the Dark option to Halloween Features. Eyes in the dark, Pumpkin spirits and poltergeists will now be controlled by this setting. - Fixed an issue that caused very transparent particles to not appear ruining the intended design of several auras and effects ### Illuminations 1.7.2 - 1.17.1 - Illuminations will now be able to spawn much further from the player. - This change dilutes illumination density and dispersion them more, but also increases the ambient immersion, as you will no longer have the feeling illuminations only appear in a 16 block radius around you! - Fixed illuminations spawning in blocks other than air - Fixed Jacko pet lighting up during the day and lighting off during the night ### Illuminations 1.7.1 - 1.17.1 - Fixed an issue that cause the greeting screen to always show - Fixed fireflies not spawning at night if the world time is invalid ### Illuminations 1.7: Configuminations - 1.17.1 - Added new biome settings tabs for Overworld, Nether, End and Other dimensions to modify firefly, glowworm and plankton spawn rates and firefly colors for each biome category! - Added spawn rate settings for eyes in the dark, will o' wisps and chorus petals - Added options for fireflies to spawn every time of day and underground - Added a custom rainbow mode options for fireflies! All of this update was entirely made by a community member: Boerdereinar, so big kudos and thanks to them! ### Illuminations 1.6.4 - 1.17.1 - Optimized mod assets thanks to RDKRACZ! - Added indonesian localization thanks to suryomujahid! ### Illuminations 1.6.3 - 1.17.1 - Made a minor refactor for eventual mod compatibility features ### Illuminations 1.6.2 - 1.17.1 - Added two new auras for tier 2 donators: Confetti and Prismatic Confetti - These auras will sprinkle confetti around the player, that will stay on the ground for around 20 seconds! - Normal confetti aura will spawn randomly colored confetti, prismatic confetti aura will spawn confetti according to the player's color - Fixed config button not showing up in Mod Menu ### Illuminations 1.6.1 - 1.17.1 - Fixed a crash that would sometimes occur with Satin API installed ### Illuminations 1.6 - 1.17.1 - Added "jeb_" mobs: - Any mob named jeb will be applied a glowing rainbow effect shifting its colors gradually - Requires Satin API (https://www.curseforge.com/minecraft/mc-mods/satin-api). If Satin API is present, the functionality will be enabled. If Satin is not present, the functionality will be disabled. - The functionality will not work if Canvas Renderer is present. - The functionality is incompatible with Iris. If Iris is present, the functionality will be disabled. - Fixed the game crashing on startup if Iris is loaded - Removed an annoying log spam every time the player reloads Illuminations cosmetics - Updated to Minecraft 1.17.1 ### Illuminations 1.5.2 - 1.17 - Updated to Minecraft 1.17 ### Illuminations 1.5.1 - 1.16.5 - Added a config option to see your own cosmetics in first person ### Illuminations 1.5: Souls and Wisps - 1.16.5 - Added Will o' Wisps! Inhabiting Soul Sand Valleys, these wandering spirits roam the dead fields and will appear, phase through and disappear into soul sand. - Will o' Wisps can also spawn from Soul Lanterns so you can use them for an eerie or magical ambience outside of soul sand valleys - Added pets for Illuminations donators: - Added Will o' Wisp, Golden Will, Founding Skull and the classic Dissolution Wisp pets - All free pride overheads and Jacko have been converted into pets - Reduced eyes in the dark spawn chances tenfold - Fixed eyes in the dark not glowing - Removed Vanguard and replaced it for an internal auto-updater, as well as making that auto-updater opt-in - Added a first time greeting screen for the user to choose if they want to enable the auto-updates or not ### Illuminations 1.4.9 - 1.16.5 - Added the Lesbian, Bi, Ace, NB and Intersex pride free overheads thanks to JothGC Get them for free at https://illuminations.uuid.gg/pride ### Illuminations 1.4.8 - 1.16.5 - Fixed an issue that caused the prismatic color to not be retrieved from the dashboard - Fixed the bad UV mapping of the Summerbreeze Wreath and the Voidhearrt Tiara crowns - Fixed Drip only appearing when invisible ### Illuminations 1.4.7 - 1.16.5 - Added the Illuminations contest winning crowns and auras for tier 2 donators - Added the Voidheart Tiara and Shadowbringer Soul aura by azazelthedemonlord - Added the Deepsculk Horns, Springfae Horns and Worldweaver Halo overheads by ArathainFarqoe - Added the Glowsquid Cult and Time Aspect Cult crowns by Heather Shadelight - Added the Golden Rod aura and Summerbreaze Wreath overhead by 24Chrome - Added the Sculk Tendrils and Autumn Leaves auras by SekoiaTree - Added a color customizable Drip cosmetic for over-generous donators ### Illuminations 1.4.6 - 1.16.5 - Fixed chorus petals not uniformly rotating - Improved log output when having trouble with cosmetics ### Illuminations 1.4.5 - 1.16.5 - Illuminations cosmetics will now be reloaded upon a player joining a world, no longer needing to restart the game in order to see changes ### Illuminations 1.4.4 - 1.16.5 - Fixed an issue that caused fireflies not to spawn if time is set to something greater than 24000 - Updated to Vanguard 1.0.5 ### Illuminations 1.4.3 - 1.16.4 - Updated to Vanguard 1.0.4 - Removed the no longer used auto-update config option ### Illuminations 1.4.2 - 1.16.4 - Updated to Vanguard 1.0.1 ### Illuminations 1.4.1 - 1.16.4 - Added missing Canvas compatibility with the Chorus aura - Switched from the integrated auto-updater to Vanguard - Added three new occult-themed crowns for tier 2 donators: Bloodfiend, Dreadlich and Mooncult, all desgined by ArathainFarqoe! ### Illuminations 1.4: The Chorus Petals Update - 1.16.4 - Introduced Chorus Petals: appearing near Chorus flowers, these beautiful petals will twirl down to the ground, to the winds of the End, transitioning from a beautiful white to a majestic purple - The younger the flower is, the more petals will appear - Breaking a Chorus flower will provoke a burst of petals - Again, the younger the flower, the more petals will burst - Added the Chorus aura for Tier 2 donators - Added the Chorus crown for Tier 2 donators ### Illuminations 1.3.1 - 1.16.4 - Fixed an issue where illuminations would not glow in the dark without Canvas - Added a firefly white alpha config options - Controls the alpha value of the white center glow for fireflies, glowworms, plankton and twilight aura fireflies (0 is no white center, 100 is a full alpha white center) - Fixed an issue where values under 100 for illumination spawn density would prevent spawn entirely - Fixed an issue where the config file would only generate with ModMenu loaded ### Illuminations 1.3 - 1.16.4 - Tweaked firefly render - Added proper Canvas bloom compatibility for illuminations and cosmetics - Introduced two new unique overheads: the frost crown and the solar crown On an unrelated but still important note: the way donator rewards work has been changed. - Instead of having special rewards depending on the time of your donation, donators will be classed into two tiers: - Tier 1: Donations of at least 2€ will reward you with the color customizable **Twilight aura** - Tier 2: Donations of at least 5€ will reward you with **all other cosmetics as well as future cosmetics** (as well as tier 1 rewards) - All previous donators have been rewarded with Tier 2 ### Illuminations 1.2.6 - 1.16.4 - Added a "density" config option that multiplies the amount of illuminations appearing - Added an auto-updater built into the mod : if Illuminations is outdated, it will notify you and automatically install the latest version - Enabled by default, can be disabled via a config option - Fixed (ONCE MORE, CAUSE I HAVE DUM) an issue where server players using Illuminations would crash upon a player with an aura dying - This time it's fixed for good (I swear (I think (I hope))) - Added some disgusting temporary hacks to fix an issue where illuminations would never appear if BetterEnd was installed ### Illuminations 1.2.5 - 1.16.4 - Fixed an issue that caused a crash when Illuminations servers aren't reachable - Updated to Minecraft 1.16.4 ### Illuminations 1.2.4 - 20w45a - Removed bugballs, making the mod client-only again - Updated to Minecraft snapshot 20w45a ### Illuminations 1.2.3 - 1.16.3 - Fixed an issue where server players using Illuminations would crash upon a player with an aura dying (again) - Fixed an issue where players with an aura would crash upon dying in third person modes (again) ### Illuminations 1.2.2 - 1.16.3 - Introduced a config - Added a config option to enable, disable or always display eyes in the dark - Eyes in the dark no longer appear if the player has night vision ### Illuminations 1.2.1 - 1.16.3 - Fixed an issue with glowing eyes appearing in other dimensions than the overworld - Added website and issue links to the mod description ### Illuminations 1.2 - 1.16.3 and 1.16.1 - Added autumn flies: during the month of October, fireflies will be orange - Added eyes in the dark: during the month of October, glowing eyes may appear in very dark places to creep on you - Added the Jacko overhead - Added the Ghostly aura ### Illuminations 1.1 - 1.16.3 and 1.16.1 - Introduced bugballs: get them from a full composter (up to four) and throw them around to spawn fireflies! (only available if Illuminations is installed on both server and clients) - Introduced overheads, a new type of cosmetic that can be equipped independently of auras and will float over your head - Added the Pride and Trans Pride overheads, obtainable for free at https://illuminations.uuid.gg/pride - Fixed an issue where server players using Illuminations would crash upon a player with an aura dying - Fixed an issue where players with an aura would crash upon dying in third person modes - Updated to Minecraft 1.16.3 ### Illuminations 1.0.5 - 1.16.2 - Restricted firefly spawn between daily times 13000 and 23000 (previously was between 13000 and 1000) - Updated to Minecraft 1.16.2 ### Illuminations 1.0.4 - 1.16.1 - Fixed an issue that caused illuminations to be incorrectly rendered with higher resolution resource packs ### Illuminations 1.0.3 - 1.16.1 - Added an offline mode so the mod doesn't crash when unable to contact the Illuminations server ### Illuminations 1.0.2 - 1.16.1 - Introduced prismatic auras, auras that you can change the color of on the [Illuminations dashboard](https://illuminations.uuid.gg/) - Made the twilight aura prismatic ### Illuminations 1.0.1 - 1.16.1 - Fixed an issue where the game would crash upon loading the mod with Sodium ### Illuminations 1.0 - 1.16.1 The great overhaul is here! Illuminations is now client only for better performance, spawn control, and the ability to connect to vanilla servers with it. - Illuminations are now particles instead of entities, enjoy being able having ten million fireflies without your server committing seppuku - Fireflies will now appear regularly in varying quantities depending on the various biomes instead of clouds - Added glowworms, illuminations that will stick to cave ceilings - Added glowing plankton, illuminations that will spawn in the dark sea depths - Removed firefly grass and firefly lantern blocks, glowmeal and firefly items and firefly grass world features - Introduced auras, special Illuminations effects around the player visible to other players that have the mod. These auras are currently a bonus for donators but some may be available through giveaways and other special events in the future. - Added the Twilight aura ### Illuminations 0.5.1 - 1.16.1 - Updated to Minecraft 1.16.1 (thanks to Bulldog83 for the contribution!) ### Illuminations 0.5 - 20w06a - Updated to Minecraft snapshot 20w06a ### Illuminations 0.4 - 1.15.1 - Reduced firefly AI tasks (light checking, despawn checking) - Removed firefly render distance limit - Removed the bug net - Fireflies are now catchable by hand - Firefly flickering animations are now paused when the game is paused - Increased firefly in a bottle light strength from 10 to 15 (now equivalent to a lantern) - Recipes for firefly grass (short and tall) and firefly in a bottle now unlocks upon getting a firefly for the first time - Recipe for glow meal now unlocks upon getting lime dye, glowstone dust or bone meal - Updated to Minecraft 1.15.1 ### Illuminations 0.3 - 1.14.3 + Added glow meal + Crafted from a lime dye, bone meal and glowstone dust + When used on grass, grows firefly grass + Updated to Minecraft 1.14.3 ### Illuminations 0.2 - 1.14.2 + Added Firefly grass (and Firefly tall grass) + Generates in the world in plain, swamp, forest, jungle, savanna and river biomes + Acts exactly like normal grass and tall grass + Has a luminosity of 1 + Can be crafted from one Grass and one Firefly + Completely change Firefly spawning mechanics + Fireflies no longer spawn randomly, but now spawn from Firefly grass during night + Fireflies are now very common to see in their habitat biomes + Optimize firefly spawns and despawns, greatly decreasing the lag caused by the mod + Fireflies now disappear on daytime + Added trail particles to Will o' Wisps + Reduced Firefly health to 1 + Added french localization + Updated to Minecraft 1.14.2 ### Illuminations 0.1.7 - 1.14.1 + Fixed the bug where mip map levels wouldn't work + Completely removed the experimental items ### Illuminations 0.1.6 - 1.14.1 + Added Firefly in a bottle + Added Bug Net (can be used to capture Fireflies by attacking them) + Added Firefly item + Removed experimental items (nests, throwable Will o' Wisp...) from the creative inventory + Updated to Minecraft 1.14.1 ### Illuminations 0.1.5 - 1.14 + Updated to Minecraft 1.14 ### Illuminations 0.1.4 - 19w14b + Updated to Minecraft snapshot 19w14b ### Illuminations 0.1.3 - 19w11b + Added firefly and lightning bug nests: acts as a spawner for fireflies and lightning bugs during night + Updated to Minecraft snapshot 19w11b (thanks Fab!) ### Illuminations 0.1.2 - 19w02a + Implemented Will o' Wisps, flaming spirits spawning in swamps at night (experimental) + Will o' Wisps are catchable + Will o' Wisps (in a player's hand) can be thrown + Updated to Minecraft snapshot 19w02a ### Illuminations 0.1.1 - 18w50a + Fixed server side crashing on startup ### Illuminations 0.1 - 18w50a + Ported to Fabric mod loader (only fireflies and lightning bugs) + Corrected firefly spawn rates + Fireflies now flicker + Changed the name of the mod from Lumen to Illuminations. see full changelog [here](https://github.com/Ladysnake/Illuminations/blob/main/CHANGELOG.md "Changelog") ================================================ FILE: LICENSE-ART ================================================ All Rights Reserved Copyright (C) 2017-2021 Ladysnake ================================================ FILE: LICENSE-CODE ================================================ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . "MINECRAFT" LINKING EXCEPTION TO THE GPL Linking this mod statically or dynamically with other modules is making a combined work based on this mod. Thus, the terms and conditions of the GNU General Public License cover the whole combination. In addition, as a special exception, the copyright holders of this mod give you permission to combine this mod with free software programs or libraries that are released under the GNU LGPL and with code included in the standard release of Minecraft under All Rights Reserved (or modified versions of such code, with unchanged license). You may copy and distribute such a system following the terms of the GNU GPL for this mod and the licenses of the other code concerned. Note that people who make modified versions of this mod are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU General Public License gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception. ================================================ FILE: README.md ================================================ # Illuminations **Illuminations** is a client sided Minecraft Fabric mod that adds multiple ambient particles in order to make your world more enjoyable at night or in dark places. *(All screenshots with a bloom effect were taken with Canvas Renderer)* ## Illuminations types ### Fireflies **Fireflies** are small flying insects that come out during the night and disappear when the sun rises. They will appear in small quantities in jungle, plains, savanna and taiga type biomes, medium quantities in forest and river type biomes and great quantity in swamp type biomes. ![illuminations-1.0-fireflies](./README.assets/illuminations-1.0-fireflies.png) ### Chorus Petals Appearing near Chorus flowers, these beautiful petals will twirl down to the ground, to the winds of the End, transitioning from a beautiful white to a majestic purple. The younger the flower is, the more petals will appear, and breaking a Chorus flower will provoke a burst of petals (again, the younger the flower, the more petals will burst). ![illuminations-1.4-choruspetals](./README.assets/illuminations-1.4-choruspetals.png) ### Glowworms **Glowworms** are small larvae living in caves by sticking to the ceiling that will fall down if their support block is removed. They will appear in small quantities in jungle, plains, savanna and taiga type biomes, medium quantities in forest and river type biomes and great quantity in swamp type biomes. ![illuminations-1.0-glowworms](./README.assets/illuminations-1.0-glowworms.png) ### Plankton Glowing **plankton** - even though difficult to notice because of its size - can be found floating around in the dark parts of the oceanic depths. They appear in any ocean biome as long as the light is sufficiently low. ![illuminations-1.0-plankton](./README.assets/illuminations-1.0-plankton.png) ### "Autumnflies" During the month of October, fireflies will adopt an orange tint instead of their regular green one. ![illuminations-1.2-autumnflies](./README.assets/illuminations-1.2-autumnflies.png) ### Eyes in the Dark Also during the month of October, you may come across glowing eyes in absolutely dark spots. These eyes will disappear if you come too close or if their darkness is disturbed by a light source. ![](./README.assets/illuminations-1.2-eyes.png) ## Configurability Illuminations possesses a few config options you can use to change how the mod behaves to better fit your needs. ### Eyes in the Dark Enable glowing eyes appearing in low light environments. Set on ENABLE by default. - ENABLE: Eyes will appear during October - DISABLE: Eyes will never appear - ALWAYS: Eyes will appear no matter the date ### Spawn Density The spawn rate percentage multiplier. Does not affect eyes in the dark. 0% Disables illuminations, 1000% Multiplies the amount of illuminations appearing by 10. ## Cosmetics **Auras** are special Illuminations effects around the player visible to other players that have the mod. Auras currently serve as a bonus for donators that support the mod and are purely cosmetic with no other provided advantage whatsoever. They are visible to other players with Illuminations installed (even on vanilla servers). **Overheads** are cosmetics that float above player heads. They are visible to other players with Illuminations installed (even on vanilla servers). Auras and overheads can be selected and changed via the [Illuminations dashboard](https://doctor4t.uuid.gg/). ### Twilight aura The **Twilight** aura creates colored fireflies that will orbit around the player. The color of the fireflies can be changed to any color you want via the Illuminations dashboard. If the player moves, they will leave a trail of these fireflies. This aura is available to tier 1 donators. ![illuminations-1.0-twilight-aura](./README.assets/illuminations-1.0-twilight-aura.gif) ### Ghostly aura The **Ghostly** aura emanates little ghosts that fly upward and gradually appear and disappear. This aura is available to tier 2 donators. ![](./README.assets/illuminations-1.2-ghostly-aura.gif) ### Frost and Solar crowns 3D overheads fit for a king or queen, that will either make you insanely cool, or astoundingly hot, depending on your choice. ![illuminations-1.3-crowns](./README.assets/illuminations-1.3-crowns.png) ### Bloodfiend, Dreadlich and Mooncult crowns *Designed by ArathainFarqoe!* ![image-20210113112423799](./README.assets/illuminations-1.4.1-crowns.png) ### Chorus aura and crown ![illuminations-1.4-choruscosmetics](./README.assets/illuminations-1.4-choruscosmetics.gif) ### Pride (and trans pride) heart Available for free to anyone that registers for an Illuminations account. https://doctor4t.uuid.gg/pride ![illuminations-1.1](./README.assets/illuminations-1.1.png) ### Jacko A happy jack o' lantern that lights up at night and in dark areas. Available to tier 2 donators. ![](./README.assets/illuminations-1.2-jacko.gif) ## FAQ #### Can I include this mod in a modpack? **Yes**: You can. Go ahead, don't bother asking. Please however provide credit and a link to either the GitHub repository or Curse Forge project page. #### Can I use this mod on a vanilla server? **Yes**: If you have installed this mod on your Minecraft client, you will be able to connect to vanilla Minecraft servers and the ambient illuminations will work as intended. #### Are cosmetics visible to other players? **Yes**: If the player has the mod installed on their client, all your cosmetics will be visible to them, just like theirs will be visible to you. #### How to get an aura or crown? **Auras are currently only available to donators**, [more information here](https://doctor4t.uuid.gg/register). #### I want to change my cosmetics / the color of my prismatic auras / disable it, what do I do? If you have donated multiple times, you may have multiple auras and may want to select a specific one. Or you may just simply want to change your prismatic color or disable your aura. **You can do all this via the [Illuminations dashboard](https://doctor4t.uuid.gg/)** with no restrictions whatsoever. ###### Copyright (C) 2021 Ladysnake This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . ================================================ FILE: build.gradle ================================================ plugins { id 'fabric-loom' version '0.10-SNAPSHOT' id 'maven-publish' id 'com.matthewprenger.cursegradle' version '1.4.0' id 'org.ajoberstar.grgit' version '3.1.1' id 'com.github.breadmoirai.github-release' version '2.2.12' } sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 // Adds a few utility methods like getProjectProperty apply from: 'https://raw.githubusercontent.com/NerdHubMC/Gradle-Scripts/master/scripts/utilities.gradle' apply from: 'https://raw.githubusercontent.com/NerdHubMC/Gradle-Scripts/master/scripts/fabric/publish/changelog.gradle' archivesBaseName = project.archives_base_name version = project.mod_version group = project.maven_group loom { accessWidener = file("src/main/resources/illuminations.accesswidener") } //def apiModules = [ // "fabric-api-base", // "fabric-resource-loader-v0", // "fabric-particles-v1" //] repositories { maven { url 'https://jitpack.io' } // where grondag's mods live maven { name = "dblsaiko" url = "https://maven.dblsaiko.net/" } maven { name = "Cotton" url = "http://server.bbkr.space:8081/artifactory/libs-release/" allowInsecureProtocol = true } // REI, odds and ends maven { name = "CurseForge" url = "https://minecraft.curseforge.com/api/maven" } // cloth config maven { url "https://maven.shedaniel.me/" } // satin maven { name = 'Ladysnake Mods' url = 'https://ladysnake.jfrog.io/artifactory/mods' content { includeGroup 'io.github.ladysnake' includeGroupByRegex 'io\\.github\\.onyxstudios.*' } } // mod menu maven { name = 'TerraformersMC' url = 'https://maven.terraformersmc.com/' } } dependencies { //to change the versions see the gradle.properties file minecraft "com.mojang:minecraft:${project.minecraft_version}" mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" // Fabric API. This is technically optional, but you probably want it anyway. modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" // apiModules.each { // modImplementation include(fabricApi.module(it, project.fabric_version)) // } // Sodium // modRuntime 'com.github.jellysquid3:sodium-fabric:mc1.16.1-0.1.0' // cloth config modApi("me.shedaniel.cloth:cloth-config-fabric:5.+") { exclude(group: "net.fabricmc.fabric-api") } include "me.shedaniel.cloth:cloth-config-fabric:5.0.34" // mod menu modCompileOnly("com.terraformersmc:modmenu:2.0.5") { exclude module: "fabric-api" } modRuntime("com.terraformersmc:modmenu:2.0.5") { exclude module: "fabric-api" } // canvas renderer // modImplementation "grondag:canvas-mc117-1.17:1.0.2033" // satin modCompileOnly "io.github.ladysnake:satin:${satin_version}" } processResources { inputs.property "version", project.version filesMatching("fabric.mod.json") { expand "version": project.version } } // ensure that the encoding is set to UTF-8, no matter what the system default is // this fixes some edge cases with special characters not displaying correctly // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html tasks.withType(JavaCompile) { options.encoding = "UTF-8" } // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task // if it is present. // If you remove this task, sources will not be generated. task sourcesJar(type: Jar, dependsOn: classes) { classifier = "sources" from sourceSets.main.allSource } jar { from "LICENSE" } // configure the maven publication publishing { publications { mavenJava(MavenPublication) { // add all the jars that should be included when publishing to maven artifact(remapJar) { builtBy remapJar } artifact(sourcesJar) { builtBy remapSourcesJar } } } // select the repositories you want to publish to repositories { // uncomment to publish to the local maven // mavenLocal() } } task checkGitStatus() { group = 'publishing' description = 'Checks that the git repository is in a state suitable for release' doLast { if (grgit == null) throw new RuntimeException('No git repository') if (!grgit.status().isClean()) { throw new RuntimeException("Git repository not ready for release (${grgit.status()})") } def currentBranch = grgit.branch.current().getName() grgit.fetch() if (grgit.tag.list().any { it.name == project.version }) { throw new RuntimeException("A tag already exists for ${project.version}") } def status = grgit.branch.status(name: currentBranch) if (status.aheadCount != 0) { throw new RuntimeException('Some commits have not been pushed') } if (status.behindCount != 0) { throw new RuntimeException('Some commits have not been pulled') } } } githubRelease { repo "Illuminations" token "${getProjectProperty('github_releases_token')}" // default owner: last component of maven group // default repo: name of the project tagName = project.version targetCommitish = { grgit.branch.current().name } body = { project.getChangelogText() } FilenameFilter filter = { dir, filename -> filename.contains(project.version) && !filename.contains('-dev.jar') } releaseAssets = { jar.destinationDirectory.asFile.get().listFiles filter } } tasks.githubRelease.dependsOn(checkGitStatus) curseforge { if (project.getProjectProperty('curse_key') != null) { apiKey = project.getProjectProperty('curse_key') } if (project.hasProperty('curseforge_id')) { project { id = findProperty('curseforge_id') releaseType = project.release_type //usually automatically determined by the CurseGradle plugin, but won't work with fabric "${project.curseforge_versions}".split('; ').each { addGameVersion it } addGameVersion 'Fabric' mainArtifact(remapJar) { displayName = "${project.name}-${project.version}.jar" if (project.hasProperty('cf_requirements') || project.hasProperty('cf_optionals') || project.hasProperty('cf_embeddeds') || project.hasProperty('cf_tools') || project.hasProperty('cf_incompatibles') || project.hasProperty('cf_includes')) { relations { if (project.hasProperty('cf_requirements')) { "${project.cf_requirements}".split('; ').each { requiredDependency "${it}" } } if (project.hasProperty('cf_optionals')) { "${project.cf_optionals}".split('; ').each { optionalDependency "${it}" } } if (project.hasProperty('cf_embeddeds')) { "${project.cf_embeddeds}".split('; ').each { embeddedLibrary "${it}" } } if (project.hasProperty('cf_tools')) { "${project.cf_tools}".split('; ').each { tool "${it}" } } if (project.hasProperty('cf_incompatibles')) { "${project.cf_incompatibles}".split('; ').each { incompatible "${it}" } } if (project.hasProperty('cf_includes')) { "${project.cf_includes}".split('; ').each { include "${it}" } } } } } changelogType = 'markdown' changelog = project.getChangelogText() afterEvaluate { uploadTask.dependsOn remapSourcesJar } } options { forgeGradleIntegration = false } } } tasks.curseforge.dependsOn(checkGitStatus) task release(dependsOn: [tasks.githubRelease, tasks.curseforge]) { group = 'publishing' description = 'Releases a new version to Github and Curseforge' } ================================================ FILE: gradle/wrapper/gradle-wrapper.properties ================================================ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists ================================================ FILE: gradle.properties ================================================ # Done to increase the memory available to gradle. org.gradle.jvmargs=-Xmx1G # Fabric Properties minecraft_version=1.18 yarn_mappings=1.18+build.1 loader_version=0.12.6 #Fabric api fabric_version=0.43.1+1.18 # Mod Properties mod_version = 1.10.2 maven_group = io.github.ladysnake archives_base_name = illuminations #Other Dependencies findbugs_version = 3.0.2 jb_annotations_version = 15.0 apiguardian_version = 1.0.0 satin_version = 1.+ #Publishing owners = Ladysnake license_header = GPL-3.0-or-later curseforge_id = 292908 curseforge_versions = 1.18 cf_requirements = fabric-api release_type = release changelog_url = https://github.com/Ladysnake/Illuminations/blob/main/CHANGELOG.md ================================================ FILE: gradlew ================================================ #!/usr/bin/env sh # # Copyright 2015 the original author or authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ############################################################################## ## ## Gradle start up script for UN*X ## ############################################################################## # Attempt to set APP_HOME # Resolve links: $0 may be a link PRG="$0" # Need this for relative symlinks. while [ -h "$PRG" ] ; do ls=`ls -ld "$PRG"` link=`expr "$ls" : '.*-> \(.*\)$'` if expr "$link" : '/.*' > /dev/null; then PRG="$link" else PRG=`dirname "$PRG"`"/$link" fi done SAVED="`pwd`" cd "`dirname \"$PRG\"`/" >/dev/null APP_HOME="`pwd -P`" cd "$SAVED" >/dev/null APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" warn () { echo "$*" } die () { echo echo "$*" echo exit 1 } # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false case "`uname`" in CYGWIN* ) cygwin=true ;; Darwin* ) darwin=true ;; MINGW* ) msys=true ;; NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD="$JAVA_HOME/jre/sh/java" else JAVACMD="$JAVA_HOME/bin/java" fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else JAVACMD="java" which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi # Increase the maximum file descriptors if we can. if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then MAX_FD="$MAX_FD_LIMIT" fi ulimit -n $MAX_FD if [ $? -ne 0 ] ; then warn "Could not set maximum file descriptor limit: $MAX_FD" fi else warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" fi fi # For Darwin, add options to specify how the application appears in the dock if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi # For Cygwin, switch paths to Windows format before running java if $cygwin ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` SEP="" for dir in $ROOTDIRSRAW ; do ROOTDIRS="$ROOTDIRS$SEP$dir" SEP="|" done OURCYGPATTERN="(^($ROOTDIRS))" # Add a user-defined pattern to the cygpath arguments if [ "$GRADLE_CYGPATTERN" != "" ] ; then OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" fi # Now convert the arguments - kludge to limit ourselves to /bin/sh i=0 for arg in "$@" ; do CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` else eval `echo args$i`="\"$arg\"" fi i=$((i+1)) done case $i in (0) set -- ;; (1) set -- "$args0" ;; (2) set -- "$args0" "$args1" ;; (3) set -- "$args0" "$args1" "$args2" ;; (4) set -- "$args0" "$args1" "$args2" "$args3" ;; (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi # Escape application args save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } APP_ARGS=$(save "$@") # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then cd "$(dirname "$0")" fi exec "$JAVACMD" "$@" ================================================ FILE: gradlew.bat ================================================ @rem @rem Copyright 2015 the original author or authors. @rem @rem Licensed under the Apache License, Version 2.0 (the "License"); @rem you may not use this file except in compliance with the License. @rem You may obtain a copy of the License at @rem @rem https://www.apache.org/licenses/LICENSE-2.0 @rem @rem Unless required by applicable law or agreed to in writing, software @rem distributed under the License is distributed on an "AS IS" BASIS, @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @rem @rem ########################################################################## @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if "%ERRORLEVEL%" == "0" goto init echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo. echo Please set the JAVA_HOME variable in your environment to match the echo location of your Java installation. goto fail :findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto init echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo. echo Please set the JAVA_HOME variable in your environment to match the echo location of your Java installation. goto fail :init @rem Get command-line arguments, handling Windows variants if not "%OS%" == "Windows_NT" goto win9xME_args :win9xME_args @rem Slurp the command line arguments. set CMD_LINE_ARGS= set _SKIP=2 :win9xME_args_slurp if "x%~1" == "x" goto execute set CMD_LINE_ARGS=%* :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% :end @rem End local scope for the variables with windows NT shell if "%ERRORLEVEL%"=="0" goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 exit /b 1 :mainEnd if "%OS%"=="Windows_NT" endlocal :omega ================================================ FILE: logs/latest.log ================================================ ================================================ FILE: release.gradle ================================================ task checkGitStatus() { group = 'publishing' description = 'Checks that the git repository is in a state suitable for release' doLast { if (grgit == null) throw new RuntimeException('No git repository') if (!grgit.status().isClean()) { throw new RuntimeException("Git repository not ready for release (${grgit.status()})") } def currentBranch = grgit.branch.current().getName() if (currentBranch != 'master' && !currentBranch.matches(/\d+\.\d+(?>\.\d+)?/)) { throw new RuntimeException("Need to be on master or a snapshot branch to release (currently on ${currentBranch})") } grgit.fetch() if (grgit.tag.list().any { it.name == project.version }) { throw new RuntimeException("A tag already exists for ${project.version}") } def status = grgit.branch.status(name: currentBranch) if (status.aheadCount != 0) { throw new RuntimeException('Some commits have not been pushed') } if (status.behindCount != 0) { throw new RuntimeException('Some commits have not been pulled') } } } githubRelease { token "${findProperty('github_releases_token')}" // default owner: last component of maven group // default repo: name of the project tagName = project.version targetCommitish = { grgit.branch.current().name } body = { project.getChangelogText() } FilenameFilter filter = { dir, filename -> filename.contains(project.version) && !filename.contains('-dev.jar') } releaseAssets = { jar.destinationDirectory.asFile.get().listFiles filter } } tasks.githubRelease.dependsOn(checkGitStatus) curseforge { apiKey = project.findProperty('curse_key') ?: "" if (project.hasProperty('curseforge_id')) { project { id = findProperty('curseforge_id') releaseType = project.release_type //usually automatically determined by the CurseGradle plugin, but won't work with fabric "${project.curseforge_versions}".split('; ').each { addGameVersion it } addGameVersion 'Fabric' mainArtifact(remapJar) { displayName = "${project.name}-${project.version}.jar" if (project.hasProperty('cf_requirements') || project.hasProperty('cf_optionals') || project.hasProperty('cf_embeddeds') || project.hasProperty('cf_tools') || project.hasProperty('cf_incompatibles') || project.hasProperty('cf_includes')) { relations { if (project.hasProperty('cf_requirements')) { "${project.cf_requirements}".split('; ').each { requiredDependency "${it}" } } if (project.hasProperty('cf_optionals')) { "${project.cf_optionals}".split('; ').each { optionalDependency "${it}" } } if (project.hasProperty('cf_embeddeds')) { "${project.cf_embeddeds}".split('; ').each { embeddedLibrary "${it}" } } if (project.hasProperty('cf_tools')) { "${project.cf_tools}".split('; ').each { tool "${it}" } } if (project.hasProperty('cf_incompatibles')) { "${project.cf_incompatibles}".split('; ').each { incompatible "${it}" } } if (project.hasProperty('cf_includes')) { "${project.cf_includes}".split('; ').each { include "${it}" } } } } } changelogType = 'markdown' changelog = project.getChangelogText() afterEvaluate { uploadTask.dependsOn remapSourcesJar } } options { forgeGradleIntegration = false } } } tasks.curseforge.dependsOn(checkGitStatus) task release(dependsOn: [tasks.publish, tasks.githubRelease, tasks.curseforge]) { group = 'publishing' description = 'Releases a new version to Github and Curseforge' } ================================================ FILE: settings.gradle ================================================ pluginManagement { repositories { jcenter() maven { name = 'Fabric' url = 'https://maven.fabricmc.net/' } gradlePluginPortal() } } ================================================ FILE: src/main/java/ladysnake/illuminations/IlluminationsMixinConfigPlugin.java ================================================ package ladysnake.illuminations; import net.fabricmc.loader.api.FabricLoader; import org.objectweb.asm.tree.ClassNode; import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; import org.spongepowered.asm.mixin.extensibility.IMixinInfo; import java.util.List; import java.util.Set; public class IlluminationsMixinConfigPlugin implements IMixinConfigPlugin { @Override public void onLoad(String mixinPackage) { } @Override public String getRefMapperConfig() { return null; } @Override public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { if (mixinClassName.startsWith("ladysnake.illuminations.mixin.jeb")) { return FabricLoader.getInstance().isModLoaded("satin") && !FabricLoader.getInstance().isModLoaded("iris"); } else { return true; } } @Override public void acceptTargets(Set myTargets, Set otherTargets) { } @Override public List getMixins() { return null; } @Override public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { } @Override public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/Illuminations.java ================================================ package ladysnake.illuminations.client; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.gson.*; import com.google.gson.reflect.TypeToken; import com.mojang.serialization.Codec; import ladysnake.illuminations.client.config.Config; import ladysnake.illuminations.client.config.DefaultConfig; import ladysnake.illuminations.client.data.AuraData; import ladysnake.illuminations.client.data.IlluminationData; import ladysnake.illuminations.client.data.OverheadData; import ladysnake.illuminations.client.data.PlayerCosmeticData; import ladysnake.illuminations.client.enums.BiomeCategory; import ladysnake.illuminations.client.enums.HalloweenFeatures; import ladysnake.illuminations.client.particle.*; import ladysnake.illuminations.client.particle.aura.*; import ladysnake.illuminations.client.particle.pet.*; import ladysnake.illuminations.client.render.entity.feature.OverheadFeatureRenderer; import ladysnake.illuminations.client.render.entity.model.hat.*; import ladysnake.illuminations.client.render.entity.model.pet.LanternModel; import ladysnake.illuminations.client.render.entity.model.pet.PrideHeartModel; import ladysnake.illuminations.client.render.entity.model.pet.WillOWispModel; import ladysnake.illuminations.updater.IlluminationsUpdater; import net.fabricmc.api.ClientModInitializer; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.fabricmc.fabric.api.client.particle.v1.ParticleFactoryRegistry; import net.fabricmc.fabric.api.client.rendereregistry.v1.EntityModelLayerRegistry; import net.fabricmc.fabric.api.client.rendereregistry.v1.LivingEntityFeatureRendererRegistrationCallback; import net.fabricmc.fabric.api.particle.v1.FabricParticleTypes; import net.fabricmc.fabric.api.resource.ResourceManagerHelper; import net.fabricmc.fabric.api.resource.ResourcePackActivationType; import net.fabricmc.loader.api.FabricLoader; import net.minecraft.block.Block; import net.minecraft.block.Blocks; import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.AbstractClientPlayerEntity; import net.minecraft.client.render.entity.feature.FeatureRendererContext; import net.minecraft.client.render.entity.model.EntityModelLayer; import net.minecraft.client.render.entity.model.PlayerEntityModel; import net.minecraft.entity.EntityType; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.particle.DefaultParticleType; import net.minecraft.particle.ParticleType; import net.minecraft.tag.BlockTags; import net.minecraft.tag.FluidTags; import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; import net.minecraft.util.registry.Registry; import net.minecraft.world.World; import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.jetbrains.annotations.Nullable; import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; import java.lang.reflect.Type; import java.net.MalformedURLException; import java.net.URL; import java.time.LocalDate; import java.time.Month; import java.util.Collections; import java.util.Map; import java.util.UUID; import java.util.concurrent.CompletableFuture; import java.util.function.BiPredicate; @Environment(EnvType.CLIENT) public class Illuminations implements ClientModInitializer { public static final String MODID = "illuminations"; public static final Logger logger = LogManager.getLogger("Illuminations"); // illuminations constants public static final int EYES_VANISHING_DISTANCE = 5; public static final Gson COSMETICS_GSON = new GsonBuilder().registerTypeAdapter(PlayerCosmeticData.class, new PlayerCosmeticDataParser()).create(); // spawn predicates public static final BiPredicate FIREFLY_LOCATION_PREDICATE = (world, blockPos) -> { Block block = world.getBlockState(blockPos).getBlock(); return world.getDimension().hasFixedTime() ? (block == Blocks.AIR || block == Blocks.VOID_AIR) : block == Blocks.AIR && (Config.doesFireflySpawnAlways() || Illuminations.isNightTime(world)) && (Config.doesFireflySpawnUnderground() || world.isSkyVisible(blockPos)); }; public static final BiPredicate GLOWWORM_LOCATION_PREDICATE = (world, blockPos) -> world.getBlockState(blockPos).getBlock() == Blocks.CAVE_AIR; public static final BiPredicate PLANKTON_LOCATION_PREDICATE = (world, blockPos) -> world.getBlockState(blockPos).getFluidState().isIn(FluidTags.WATER) && world.getLightLevel(blockPos) < 2; public static final BiPredicate EYES_LOCATION_PREDICATE = (world, blockPos) -> ((Config.getHalloweenFeatures() == HalloweenFeatures.ENABLE && LocalDate.now().getMonth() == Month.OCTOBER) || Config.getHalloweenFeatures() == HalloweenFeatures.ALWAYS) && (world.getBlockState(blockPos).getBlock() == Blocks.AIR || world.getBlockState(blockPos).getBlock() == Blocks.CAVE_AIR) && world.getLightLevel(blockPos) <= 0 && world.getClosestPlayer(blockPos.getX(), blockPos.getY(), blockPos.getZ(), EYES_VANISHING_DISTANCE, false) == null && world.getRegistryKey().equals(World.OVERWORLD); public static final BiPredicate WISP_LOCATION_PREDICATE = (world, blockPos) -> world.getBlockState(blockPos).isIn(BlockTags.SOUL_FIRE_BASE_BLOCKS); // register overhead models public static final EntityModelLayer CROWN = new EntityModelLayer(new Identifier(MODID, "crown"), "main"); static final Type COSMETIC_SELECT_TYPE = new TypeToken>() { }.getType(); // illuminations cosmetics private static final String COSMETICS_URL = "https://illuminations.uuid.gg/data"; public static ImmutableMap AURAS_DATA; public static ImmutableMap PETS_DATA; public static ImmutableMap OVERHEADS_DATA; // particle types public static DefaultParticleType FIREFLY; public static DefaultParticleType GLOWWORM; public static DefaultParticleType PLANKTON; public static DefaultParticleType EYES; public static DefaultParticleType CHORUS_PETAL; public static DefaultParticleType WILL_O_WISP; public static ParticleType WISP_TRAIL; public static DefaultParticleType PUMPKIN_SPIRIT; public static DefaultParticleType POLTERGEIST; public static DefaultParticleType PRISMARINE_CRYSTAL; // public static DefaultParticleType EMBER; // public static DefaultParticleType EMBER_TRAIL; // auras public static DefaultParticleType TWILIGHT_AURA; public static DefaultParticleType GHOSTLY_AURA; public static DefaultParticleType CHORUS_AURA; public static DefaultParticleType AUTUMN_LEAVES_AURA; public static DefaultParticleType SCULK_TENDRIL_AURA; public static DefaultParticleType SHADOWBRINGER_AURA; public static DefaultParticleType GOLDENROD_AURA; public static DefaultParticleType CONFETTI_AURA; public static DefaultParticleType PRISMATIC_CONFETTI_AURA; public static DefaultParticleType PRISMARINE_AURA; // pets public static DefaultParticleType PRIDE_PET; public static DefaultParticleType GAY_PRIDE_PET; public static DefaultParticleType TRANS_PRIDE_PET; public static DefaultParticleType JACKO_PET; public static DefaultParticleType LESBIAN_PRIDE_PET; public static DefaultParticleType BI_PRIDE_PET; public static DefaultParticleType ACE_PRIDE_PET; public static DefaultParticleType NB_PRIDE_PET; public static DefaultParticleType INTERSEX_PRIDE_PET; public static DefaultParticleType ARO_PRIDE_PET; public static DefaultParticleType PAN_PRIDE_PET; public static DefaultParticleType AGENDER_PRIDE_PET; public static DefaultParticleType WILL_O_WISP_PET; public static DefaultParticleType GOLDEN_WILL_PET; public static DefaultParticleType FOUNDING_SKULL_PET; public static DefaultParticleType DISSOLUTION_WISP_PET; public static DefaultParticleType PUMPKIN_SPIRIT_PET; public static DefaultParticleType POLTERGEIST_PET; public static DefaultParticleType LANTERN_PET; public static DefaultParticleType SOUL_LANTERN_PET; public static DefaultParticleType CRYING_LANTERN_PET; public static DefaultParticleType SOOTHING_LANTERN_PET; // spawn biome categories and biomes public static ImmutableMap> ILLUMINATIONS_BIOME_CATEGORIES; public static ImmutableMap> ILLUMINATIONS_BIOMES; private static Map PLAYER_COSMETICS = Collections.emptyMap(); public static @Nullable PlayerCosmeticData getCosmeticData(PlayerEntity player) { return PLAYER_COSMETICS.get(player.getUuid()); } public static @Nullable PlayerCosmeticData getCosmeticData(UUID uuid) { return PLAYER_COSMETICS.get(uuid); } public static void loadPlayerCosmetics() { // get illuminations player cosmetics CompletableFuture.supplyAsync(() -> { try (Reader reader = new InputStreamReader(new URL(COSMETICS_URL).openStream())) { if (Config.isDebugMode()) logger.log(Level.INFO, "Retrieving Illuminations cosmetics from the dashboard..."); return COSMETICS_GSON.>fromJson(reader, COSMETIC_SELECT_TYPE); } catch (MalformedURLException e) { if (Config.isDebugMode()) logger.log(Level.ERROR, "Could not get player cosmetics because of malformed URL: " + e.getMessage()); } catch (IOException e) { if (Config.isDebugMode()) logger.log(Level.ERROR, "Could not get player cosmetics because of I/O Error: " + e.getMessage()); } return null; }).exceptionally(throwable -> { if (Config.isDebugMode()) logger.log(Level.ERROR, "Could not get player cosmetics because wtf is happening", throwable); return null; }).thenAcceptAsync(playerData -> { if (playerData != null) { PLAYER_COSMETICS = playerData; if (Config.isDebugMode()) logger.log(Level.INFO, "Player cosmetics successfully registered"); } else { PLAYER_COSMETICS = Collections.emptyMap(); if (Config.isDebugMode()) logger.log(Level.WARN, "Player cosmetics could not registered, cosmetics will be ignored"); } }, MinecraftClient.getInstance()); } public static boolean isNightTime(World world) { return world.getSkyAngle(world.getTimeOfDay()) >= 0.25965086 && world.getSkyAngle(world.getTimeOfDay()) <= 0.7403491; } @Override public void onInitializeClient() { // load config Config.load(); // get illuminations player cosmetics loadPlayerCosmetics(); // auto-updater if (!FabricLoader.getInstance().isDevelopmentEnvironment() && Config.isAutoUpdate()) { IlluminationsUpdater.init(); } // load jeb shader if (FabricLoader.getInstance().isModLoaded("satin")) { Rainbowlluminations.init(); } // register resource packs FabricLoader.getInstance().getModContainer(MODID).ifPresent(modContainer -> { ResourceManagerHelper.registerBuiltinResourcePack(new Identifier(MODID, "lowerres"), modContainer, ResourcePackActivationType.NORMAL); ResourceManagerHelper.registerBuiltinResourcePack(new Identifier(MODID, "pixelaccurate"), modContainer, ResourcePackActivationType.NORMAL); }); // register model layers EntityModelLayerRegistry.registerModelLayer(CrownModel.MODEL_LAYER, CrownModel::getTexturedModelData); EntityModelLayerRegistry.registerModelLayer(HornsModel.MODEL_LAYER, HornsModel::getTexturedModelData); EntityModelLayerRegistry.registerModelLayer(HaloModel.MODEL_LAYER, HaloModel::getTexturedModelData); EntityModelLayerRegistry.registerModelLayer(TiaraModel.MODEL_LAYER, TiaraModel::getTexturedModelData); EntityModelLayerRegistry.registerModelLayer(VoidheartTiaraModel.MODEL_LAYER, VoidheartTiaraModel::getTexturedModelData); EntityModelLayerRegistry.registerModelLayer(WreathModel.MODEL_LAYER, WreathModel::getTexturedModelData); EntityModelLayerRegistry.registerModelLayer(WillOWispModel.MODEL_LAYER, WillOWispModel::getTexturedModelData); EntityModelLayerRegistry.registerModelLayer(LanternModel.MODEL_LAYER, LanternModel::getTexturedModelData); EntityModelLayerRegistry.registerModelLayer(PrideHeartModel.MODEL_LAYER, PrideHeartModel::getTexturedModelData); // particles FIREFLY = Registry.register(Registry.PARTICLE_TYPE, "illuminations:firefly", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.FIREFLY, FireflyParticle.DefaultFactory::new); GLOWWORM = Registry.register(Registry.PARTICLE_TYPE, "illuminations:glowworm", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.GLOWWORM, GlowwormParticle.DefaultFactory::new); PLANKTON = Registry.register(Registry.PARTICLE_TYPE, "illuminations:plankton", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.PLANKTON, PlanktonParticle.DefaultFactory::new); EYES = Registry.register(Registry.PARTICLE_TYPE, "illuminations:eyes", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.EYES, EyesParticle.DefaultFactory::new); CHORUS_PETAL = Registry.register(Registry.PARTICLE_TYPE, "illuminations:chorus_petal", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.CHORUS_PETAL, ChorusPetalParticle.DefaultFactory::new); WILL_O_WISP = Registry.register(Registry.PARTICLE_TYPE, "illuminations:will_o_wisp", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.WILL_O_WISP, fabricSpriteProvider -> new WillOWispParticle.DefaultFactory(fabricSpriteProvider, new Identifier(Illuminations.MODID, "textures/entity/will_o_wisp.png"), 1.0f, 1.0f, 1.0f, -0.1f, -0.01f, 0.0f)); WISP_TRAIL = Registry.register(Registry.PARTICLE_TYPE, "illuminations:wisp_trail", new ParticleType(true, WispTrailParticleEffect.PARAMETERS_FACTORY) { @Override public Codec getCodec() { return WispTrailParticleEffect.CODEC; } }); ParticleFactoryRegistry.getInstance().register(Illuminations.WISP_TRAIL, WispTrailParticle.Factory::new); PUMPKIN_SPIRIT = Registry.register(Registry.PARTICLE_TYPE, "illuminations:pumpkin_spirit", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.PUMPKIN_SPIRIT, fabricSpriteProvider -> new PumpkinSpiritParticle.DefaultFactory(fabricSpriteProvider, new Identifier(Illuminations.MODID, "textures/entity/pumpkin_spirit.png"), 1.0f, 0.95f, 0.0f, 0.0f, -0.03f, 0.0f)); POLTERGEIST = Registry.register(Registry.PARTICLE_TYPE, "illuminations:poltergeist", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.POLTERGEIST, fabricSpriteProvider -> new PoltergeistParticle.DefaultFactory(fabricSpriteProvider, new Identifier(Illuminations.MODID, "textures/entity/poltergeist.png"), 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f)); PRISMARINE_CRYSTAL = Registry.register(Registry.PARTICLE_TYPE, "illuminations:prismarine_crystal", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.PRISMARINE_CRYSTAL, PrismarineCrystalParticle.DefaultFactory::new); // EMBER = Registry.register(Registry.PARTICLE_TYPE, "illuminations:ember", FabricParticleTypes.simple(true)); // ParticleFactoryRegistry.getInstance().register(Illuminations.EMBER, EmberParticle.DefaultFactory::new); // aura particles TWILIGHT_AURA = Registry.register(Registry.PARTICLE_TYPE, "illuminations:twilight_aura", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.TWILIGHT_AURA, TwilightFireflyParticle.DefaultFactory::new); GHOSTLY_AURA = Registry.register(Registry.PARTICLE_TYPE, "illuminations:ghostly_aura", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.GHOSTLY_AURA, GhostlyAuraParticle.DefaultFactory::new); CHORUS_AURA = Registry.register(Registry.PARTICLE_TYPE, "illuminations:chorus_aura", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.CHORUS_AURA, ChorusAuraParticle.DefaultFactory::new); AUTUMN_LEAVES_AURA = Registry.register(Registry.PARTICLE_TYPE, "illuminations:autumn_leaves", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.AUTUMN_LEAVES_AURA, AutumnLeavesParticle.DefaultFactory::new); SCULK_TENDRIL_AURA = Registry.register(Registry.PARTICLE_TYPE, "illuminations:sculk_tendril", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.SCULK_TENDRIL_AURA, SculkTendrilParticle.DefaultFactory::new); SHADOWBRINGER_AURA = Registry.register(Registry.PARTICLE_TYPE, "illuminations:shadowbringer_aura", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.SHADOWBRINGER_AURA, ShadowbringerParticle.DefaultFactory::new); GOLDENROD_AURA = Registry.register(Registry.PARTICLE_TYPE, "illuminations:goldenrod_aura", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.GOLDENROD_AURA, GoldenrodAuraParticle.DefaultFactory::new); CONFETTI_AURA = Registry.register(Registry.PARTICLE_TYPE, "illuminations:confetti", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.CONFETTI_AURA, ConfettiParticle.DefaultFactory::new); PRISMATIC_CONFETTI_AURA = Registry.register(Registry.PARTICLE_TYPE, "illuminations:prismatic_confetti", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.PRISMATIC_CONFETTI_AURA, PrismaticConfettiParticle.DefaultFactory::new); PRISMARINE_AURA = Registry.register(Registry.PARTICLE_TYPE, "illuminations:prismarine_aura", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.PRISMARINE_AURA, PrismarineAuraParticle.DefaultFactory::new); /* PRIDE PETS */ PRIDE_PET = Registry.register(Registry.PARTICLE_TYPE, "illuminations:pride_pet", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.PRIDE_PET, fabricSpriteProvider -> new PrideHeartParticle.DefaultFactory(fabricSpriteProvider, new Identifier(Illuminations.MODID, "textures/entity/pride_heart.png"), 1.0f, 1.0f, 1.0f)); GAY_PRIDE_PET = Registry.register(Registry.PARTICLE_TYPE, "illuminations:gay_pride_pet", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.GAY_PRIDE_PET, fabricSpriteProvider -> new PrideHeartParticle.DefaultFactory(fabricSpriteProvider, new Identifier(Illuminations.MODID, "textures/entity/gay_pride_heart.png"), 1.0f, 1.0f, 1.0f)); TRANS_PRIDE_PET = Registry.register(Registry.PARTICLE_TYPE, "illuminations:trans_pride_pet", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.TRANS_PRIDE_PET, fabricSpriteProvider -> new PrideHeartParticle.DefaultFactory(fabricSpriteProvider, new Identifier(Illuminations.MODID, "textures/entity/trans_pride_heart.png"), 1.0f, 1.0f, 1.0f)); LESBIAN_PRIDE_PET = Registry.register(Registry.PARTICLE_TYPE, "illuminations:lesbian_pride_pet", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.LESBIAN_PRIDE_PET, fabricSpriteProvider -> new PrideHeartParticle.DefaultFactory(fabricSpriteProvider, new Identifier(Illuminations.MODID, "textures/entity/lesbian_pride_heart.png"), 1.0f, 1.0f, 1.0f)); BI_PRIDE_PET = Registry.register(Registry.PARTICLE_TYPE, "illuminations:bi_pride_pet", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.BI_PRIDE_PET, fabricSpriteProvider -> new PrideHeartParticle.DefaultFactory(fabricSpriteProvider, new Identifier(Illuminations.MODID, "textures/entity/bi_pride_heart.png"), 1.0f, 1.0f, 1.0f)); ACE_PRIDE_PET = Registry.register(Registry.PARTICLE_TYPE, "illuminations:ace_pride_pet", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.ACE_PRIDE_PET, fabricSpriteProvider -> new PrideHeartParticle.DefaultFactory(fabricSpriteProvider, new Identifier(Illuminations.MODID, "textures/entity/ace_pride_heart.png"), 1.0f, 1.0f, 1.0f)); NB_PRIDE_PET = Registry.register(Registry.PARTICLE_TYPE, "illuminations:nb_pride_pet", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.NB_PRIDE_PET, fabricSpriteProvider -> new PrideHeartParticle.DefaultFactory(fabricSpriteProvider, new Identifier(Illuminations.MODID, "textures/entity/nb_pride_heart.png"), 1.0f, 1.0f, 1.0f)); INTERSEX_PRIDE_PET = Registry.register(Registry.PARTICLE_TYPE, "illuminations:intersex_pride_pet", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.INTERSEX_PRIDE_PET, fabricSpriteProvider -> new PrideHeartParticle.DefaultFactory(fabricSpriteProvider, new Identifier(Illuminations.MODID, "textures/entity/intersex_pride_heart.png"), 1.0f, 1.0f, 1.0f)); ARO_PRIDE_PET = Registry.register(Registry.PARTICLE_TYPE, "illuminations:aro_pride_pet", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.ARO_PRIDE_PET, fabricSpriteProvider -> new PrideHeartParticle.DefaultFactory(fabricSpriteProvider, new Identifier(Illuminations.MODID, "textures/entity/aro_pride_heart.png"), 1.0f, 1.0f, 1.0f)); PAN_PRIDE_PET = Registry.register(Registry.PARTICLE_TYPE, "illuminations:pan_pride_pet", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.PAN_PRIDE_PET, fabricSpriteProvider -> new PrideHeartParticle.DefaultFactory(fabricSpriteProvider, new Identifier(Illuminations.MODID, "textures/entity/pan_pride_heart.png"), 1.0f, 1.0f, 1.0f)); AGENDER_PRIDE_PET = Registry.register(Registry.PARTICLE_TYPE, "illuminations:agender_pride_pet", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.AGENDER_PRIDE_PET, fabricSpriteProvider -> new PrideHeartParticle.DefaultFactory(fabricSpriteProvider, new Identifier(Illuminations.MODID, "textures/entity/agender_pride_heart.png"), 1.0f, 1.0f, 1.0f)); /* WILL O' WISP PETS */ WILL_O_WISP_PET = Registry.register(Registry.PARTICLE_TYPE, "illuminations:will_o_wisp_pet", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.WILL_O_WISP_PET, fabricSpriteProvider -> new PlayerWispParticle.DefaultFactory(fabricSpriteProvider, new Identifier(Illuminations.MODID, "textures/entity/will_o_wisp.png"), 1.0f, 1.0f, 1.0f, -0.1f, -0.01f, 0.0f)); GOLDEN_WILL_PET = Registry.register(Registry.PARTICLE_TYPE, "illuminations:golden_will_pet", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.GOLDEN_WILL_PET, fabricSpriteProvider -> new PlayerWispParticle.DefaultFactory(fabricSpriteProvider, new Identifier(Illuminations.MODID, "textures/entity/golden_will.png"), 1.0f, 0.3f, 1.0f, -0.05f, -0.01f, 0.0f)); FOUNDING_SKULL_PET = Registry.register(Registry.PARTICLE_TYPE, "illuminations:founding_skull_pet", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.FOUNDING_SKULL_PET, fabricSpriteProvider -> new PlayerWispParticle.DefaultFactory(fabricSpriteProvider, new Identifier(Illuminations.MODID, "textures/entity/founding_skull.png"), 1.0f, 0.0f, 0.25f, -0.03f, 0.0f, -0.01f)); DISSOLUTION_WISP_PET = Registry.register(Registry.PARTICLE_TYPE, "illuminations:dissolution_wisp_pet", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.DISSOLUTION_WISP_PET, PetParticle.DefaultFactory::new); /* SPOOKY PETS */ JACKO_PET = Registry.register(Registry.PARTICLE_TYPE, "illuminations:jacko_pet", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.JACKO_PET, JackoParticle.DefaultFactory::new); PUMPKIN_SPIRIT_PET = Registry.register(Registry.PARTICLE_TYPE, "illuminations:pumpkin_spirit_pet", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.PUMPKIN_SPIRIT_PET, fabricSpriteProvider -> new PlayerWispParticle.DefaultFactory(fabricSpriteProvider, new Identifier(Illuminations.MODID, "textures/entity/pumpkin_spirit.png"), 1.0f, 0.95f, 0.0f, 0.0f, -0.03f, 0.0f)); POLTERGEIST_PET = Registry.register(Registry.PARTICLE_TYPE, "illuminations:poltergeist_pet", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.POLTERGEIST_PET, fabricSpriteProvider -> new PlayerWispParticle.DefaultFactory(fabricSpriteProvider, new Identifier(Illuminations.MODID, "textures/entity/poltergeist.png"), 1.0f, 1.0f, 1.0f, 0f, 0f, 0f)); LANTERN_PET = Registry.register(Registry.PARTICLE_TYPE, "illuminations:lantern_pet", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.LANTERN_PET, fabricSpriteProvider -> new PlayerLanternParticle.DefaultFactory(fabricSpriteProvider, new Identifier(Illuminations.MODID, "textures/entity/lantern.png"), 1.0f, 1.0f, 1.0f)); SOUL_LANTERN_PET = Registry.register(Registry.PARTICLE_TYPE, "illuminations:soul_lantern_pet", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.SOUL_LANTERN_PET, fabricSpriteProvider -> new PlayerLanternParticle.DefaultFactory(fabricSpriteProvider, new Identifier(Illuminations.MODID, "textures/entity/soul_lantern.png"), 1.0f, 1.0f, 1.0f)); CRYING_LANTERN_PET = Registry.register(Registry.PARTICLE_TYPE, "illuminations:crying_lantern_pet", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.CRYING_LANTERN_PET, fabricSpriteProvider -> new PlayerLanternParticle.DefaultFactory(fabricSpriteProvider, new Identifier(Illuminations.MODID, "textures/entity/crying_lantern.png"), 1.0f, 1.0f, 1.0f)); SOOTHING_LANTERN_PET = Registry.register(Registry.PARTICLE_TYPE, "illuminations:soothing_lantern_pet", FabricParticleTypes.simple(true)); ParticleFactoryRegistry.getInstance().register(Illuminations.SOOTHING_LANTERN_PET, fabricSpriteProvider -> new PlayerLanternParticle.DefaultFactory(fabricSpriteProvider, new Identifier(Illuminations.MODID, "textures/entity/soothing_lantern.png"), 1.0f, 1.0f, 1.0f)); /* CROWNS FEATURE RENDERER REGISTRATION */ LivingEntityFeatureRendererRegistrationCallback.EVENT.register((entityType, entityRenderer, registrationHelper, context) -> { if (entityType == EntityType.PLAYER) { @SuppressWarnings("unchecked") var playerRenderer = (FeatureRendererContext>) entityRenderer; registrationHelper.register(new OverheadFeatureRenderer(playerRenderer, context)); } }); /* ADDING FIRFLY, GLOWWORM AND PLANKTON BIOMES SPAWN RATES */ ImmutableMap.Builder> biomeBuilder = ImmutableMap.builder(); Config.getBiomeSettings().forEach((biome, settings) -> { ImmutableSet.Builder illuminationDataBuilder = ImmutableSet.builder(); illuminationDataBuilder.add(new IlluminationData(FIREFLY, FIREFLY_LOCATION_PREDICATE, () -> Config.getBiomeSettings(biome).fireflySpawnRate().spawnRate)); if (settings.glowwormSpawnRate() != null) illuminationDataBuilder.add(new IlluminationData(GLOWWORM, GLOWWORM_LOCATION_PREDICATE, () -> Config.getBiomeSettings(biome).glowwormSpawnRate().spawnRate)); if (settings.planktonSpawnRate() != null) illuminationDataBuilder.add(new IlluminationData(PLANKTON, PLANKTON_LOCATION_PREDICATE, () -> Config.getBiomeSettings(biome).planktonSpawnRate().spawnRate)); biomeBuilder.put(biome, illuminationDataBuilder.build()); }); ILLUMINATIONS_BIOME_CATEGORIES = biomeBuilder.build(); /* WILL O' WISP BIOME SPAWN */ ILLUMINATIONS_BIOMES = ImmutableMap.>builder() .put(new Identifier("minecraft:soul_sand_valley"), ImmutableSet.of( new IlluminationData(WILL_O_WISP, WISP_LOCATION_PREDICATE, () -> Config.getWillOWispsSpawnRate().spawnRate))) .build(); /* Aura matching and spawn chances + overhead matching + crown matching Currently set to default aura settings. Uncomment settings related to auras in Config.java and change getDefaultAuraSettings to getAuraSettings to restore. */ AURAS_DATA = ImmutableMap.builder() .put("twilight", new AuraData(TWILIGHT_AURA, () -> DefaultConfig.getAuraSettings("twilight"))) .put("ghostly", new AuraData(GHOSTLY_AURA, () -> DefaultConfig.getAuraSettings("ghostly"))) .put("chorus", new AuraData(CHORUS_AURA, () -> DefaultConfig.getAuraSettings("chorus"))) .put("autumn_leaves", new AuraData(AUTUMN_LEAVES_AURA, () -> DefaultConfig.getAuraSettings("autumn_leaves"))) .put("sculk_tendrils", new AuraData(SCULK_TENDRIL_AURA, () -> DefaultConfig.getAuraSettings("sculk_tendrils"))) .put("shadowbringer_soul", new AuraData(SHADOWBRINGER_AURA, () -> DefaultConfig.getAuraSettings("shadowbringer_soul"))) .put("goldenrod", new AuraData(GOLDENROD_AURA, () -> DefaultConfig.getAuraSettings("goldenrod"))) .put("confetti", new AuraData(CONFETTI_AURA, () -> DefaultConfig.getAuraSettings("confetti"))) .put("prismatic_confetti", new AuraData(PRISMATIC_CONFETTI_AURA, () -> DefaultConfig.getAuraSettings("prismatic_confetti"))) .put("prismarine", new AuraData(PRISMARINE_AURA, () -> DefaultConfig.getAuraSettings("prismarine"))) .build(); OVERHEADS_DATA = ImmutableMap.builder() .put("solar_crown", new OverheadData(CrownModel::new, "solar_crown")) .put("frost_crown", new OverheadData(CrownModel::new, "frost_crown")) .put("pyro_crown", new OverheadData(CrownModel::new, "pyro_crown")) .put("chorus_crown", new OverheadData(CrownModel::new, "chorus_crown")) .put("bloodfiend_crown", new OverheadData(CrownModel::new, "bloodfiend_crown")) .put("dreadlich_crown", new OverheadData(CrownModel::new, "dreadlich_crown")) .put("mooncult_crown", new OverheadData(CrownModel::new, "mooncult_crown")) .put("deepsculk_horns", new OverheadData(HornsModel::new, "deepsculk_horns")) .put("springfae_horns", new OverheadData(HornsModel::new, "springfae_horns")) .put("voidheart_tiara", new OverheadData(VoidheartTiaraModel::new, "voidheart_tiara")) .put("worldweaver_halo", new OverheadData(HaloModel::new, "worldweaver_halo")) .put("summerbreeze_wreath", new OverheadData(WreathModel::new, "summerbreeze_wreath")) .put("glowsquid_cult_crown", new OverheadData(TiaraModel::new, "glowsquid_cult_crown")) .put("timeaspect_cult_crown", new OverheadData(TiaraModel::new, "timeaspect_cult_crown")) .put("prismarine_crown", new OverheadData(CrownModel::new, "prismarine_crown")) .build(); PETS_DATA = ImmutableMap.builder() .put("pride", PRIDE_PET) .put("gay_pride", GAY_PRIDE_PET) .put("trans_pride", TRANS_PRIDE_PET) .put("lesbian_pride", LESBIAN_PRIDE_PET) .put("bi_pride", BI_PRIDE_PET) .put("ace_pride", ACE_PRIDE_PET) .put("nb_pride", NB_PRIDE_PET) .put("intersex_pride", INTERSEX_PRIDE_PET) .put("aro_pride", ARO_PRIDE_PET) .put("pan_pride", PAN_PRIDE_PET) .put("agender_pride", AGENDER_PRIDE_PET) .put("jacko", JACKO_PET) .put("will_o_wisp", WILL_O_WISP_PET) .put("golden_will", GOLDEN_WILL_PET) .put("founding_skull", FOUNDING_SKULL_PET) .put("dissolution_wisp", DISSOLUTION_WISP_PET) .put("pumpkin_spirit", PUMPKIN_SPIRIT_PET) .put("poltergeist", POLTERGEIST_PET) .put("lantern", LANTERN_PET) .put("soul_lantern", SOUL_LANTERN_PET) .put("crying_lantern", CRYING_LANTERN_PET) .put("soothing_lantern", SOOTHING_LANTERN_PET) .build(); } private static class PlayerCosmeticDataParser implements JsonDeserializer { @Override public PlayerCosmeticData deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { JsonObject jsonObject = json.getAsJsonObject(); return new PlayerCosmeticData(jsonObject.get("aura") , jsonObject.get("color") , jsonObject.get("overhead") , jsonObject.get("drip") , jsonObject.get("pet")); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/IlluminationsModMenuIntegration.java ================================================ package ladysnake.illuminations.client; import com.google.common.base.CaseFormat; import com.terraformersmc.modmenu.api.ConfigScreenFactory; import com.terraformersmc.modmenu.api.ModMenuApi; import ladysnake.illuminations.client.config.Config; import ladysnake.illuminations.client.config.DefaultConfig; import ladysnake.illuminations.client.data.BiomeSettings; import ladysnake.illuminations.client.enums.*; import me.shedaniel.clothconfig2.api.ConfigBuilder; import me.shedaniel.clothconfig2.api.ConfigCategory; import me.shedaniel.clothconfig2.api.ConfigEntryBuilder; import me.shedaniel.clothconfig2.impl.builders.SubCategoryBuilder; import net.minecraft.text.StringVisitable; import net.minecraft.text.Text; import net.minecraft.text.TranslatableText; import net.minecraft.util.Identifier; import java.util.HashMap; import static ladysnake.illuminations.client.enums.BiomeCategory.OTHER; public class IlluminationsModMenuIntegration implements ModMenuApi { private ConfigBuilder builder; private ConfigEntryBuilder entryBuilder; @Override public ConfigScreenFactory getModConfigScreenFactory() { return parent -> { // load config Config.load(); // create the config builder = ConfigBuilder.create() .setParentScreen(parent) .setTitle(new TranslatableText("title.illuminations.config")); builder.setSavingRunnable(Config::save); entryBuilder = builder.entryBuilder(); // config categories and entries GenerateGeneralSettings(); GenerateBiomeSettings(); // build and return the config screen return builder.build(); }; } private void GenerateGeneralSettings() { ConfigCategory general = builder.getOrCreateCategory(new TranslatableText("category.illuminations.general")); general.addEntry(entryBuilder .startEnumSelector(new TranslatableText("option.illuminations.halloweenFeatures"), HalloweenFeatures.class, Config.getHalloweenFeatures()) .setTooltip( new TranslatableText("option.tooltip.illuminations.halloweenFeatures"), new TranslatableText("option.tooltip.illuminations.halloweenFeatures.default"), new TranslatableText("option.tooltip.illuminations.halloweenFeatures.enable"), new TranslatableText("option.tooltip.illuminations.halloweenFeatures.disable"), new TranslatableText("option.tooltip.illuminations.halloweenFeatures.always")) .setSaveConsumer(Config::setHalloweenFeatures) .setDefaultValue(DefaultConfig.HALLOWEEN_FEATURES) .build()); general.addEntry(entryBuilder .startEnumSelector(new TranslatableText("option.illuminations.eyesInTheDarkSpawnRate"), EyesInTheDarkSpawnRate.class, Config.getEyesInTheDarkSpawnRate()) .setTooltip( new TranslatableText("option.tooltip.illuminations.eyesInTheDarkSpawnRate"), new TranslatableText("option.tooltip.illuminations.eyesInTheDarkSpawnRate.default"), new TranslatableText("option.tooltip.illuminations.eyesInTheDarkSpawnRate.low"), new TranslatableText("option.tooltip.illuminations.eyesInTheDarkSpawnRate.medium"), new TranslatableText("option.tooltip.illuminations.eyesInTheDarkSpawnRate.high")) .setSaveConsumer(Config::setEyesInTheDarkSpawnRate) .setDefaultValue(DefaultConfig.EYES_IN_THE_DARK_SPAWN_RATE) .build()); general.addEntry(entryBuilder .startEnumSelector(new TranslatableText("option.illuminations.willOWispsSpawnRate"), WillOWispsSpawnRate.class, Config.getWillOWispsSpawnRate()) .setTooltip( new TranslatableText("option.tooltip.illuminations.willOWispsSpawnRate"), new TranslatableText("option.tooltip.illuminations.willOWispsSpawnRate.default"), new TranslatableText("option.tooltip.illuminations.willOWispsSpawnRate.disable"), new TranslatableText("option.tooltip.illuminations.willOWispsSpawnRate.low"), new TranslatableText("option.tooltip.illuminations.willOWispsSpawnRate.medium"), new TranslatableText("option.tooltip.illuminations.willOWispsSpawnRate.high")) .setSaveConsumer(Config::setWillOWispsSpawnRate) .setDefaultValue(DefaultConfig.WILL_O_WISPS_SPAWN_RATE) .build()); general.addEntry(entryBuilder .startIntSlider(new TranslatableText("option.illuminations.chorusPetalsSpawnMultiplier"), Config.getChorusPetalsSpawnMultiplier(), 0, 10) .setTooltip( new TranslatableText("option.tooltip.illuminations.chorusPetalsSpawnMultiplier"), new TranslatableText("option.tooltip.illuminations.chorusPetalsSpawnMultiplier.lowest"), new TranslatableText("option.tooltip.illuminations.chorusPetalsSpawnMultiplier.highest")) .setSaveConsumer(Config::setChorusPetalsSpawnMultiplier) .setDefaultValue(DefaultConfig.CHORUS_PETALS_SPAWN_MULTIPLIER) .build()); general.addEntry(entryBuilder .startIntSlider(new TranslatableText("option.illuminations.density"), Config.getDensity(), 0, 1000) .setTooltip( new TranslatableText("option.tooltip.illuminations.density"), new TranslatableText("option.tooltip.illuminations.density.lowest"), new TranslatableText("option.tooltip.illuminations.density.highest")) .setSaveConsumer(Config::setDensity) .setDefaultValue(DefaultConfig.DENSITY) .build()); general.addEntry(entryBuilder .startBooleanToggle(new TranslatableText("option.illuminations.fireflySpawnAlways"), Config.doesFireflySpawnAlways()) .setTooltip(new TranslatableText("option.tooltip.illuminations.fireflySpawnAlways")) .setSaveConsumer(Config::setFireflySpawnAlways) .setDefaultValue(DefaultConfig.FIREFLY_SPAWN_ALWAYS) .build()); general.addEntry(entryBuilder .startBooleanToggle(new TranslatableText("option.illuminations.fireflySpawnUnderground"), Config.doesFireflySpawnUnderground()) .setTooltip(new TranslatableText("option.tooltip.illuminations.fireflySpawnUnderground")) .setSaveConsumer(Config::setFireflySpawnUnderground) .setDefaultValue(DefaultConfig.FIREFLY_SPAWN_UNDERGROUND) .build()); general.addEntry(entryBuilder .startIntSlider(new TranslatableText("option.illuminations.fireflyWhiteAlpha"), Config.getFireflyWhiteAlpha(), 0, 100) .setTooltip(new TranslatableText("option.tooltip.illuminations.fireflyWhiteAlpha")) .setSaveConsumer(Config::setFireflyWhiteAlpha) .setDefaultValue(DefaultConfig.FIREFLY_WHITE_ALPHA) .build()); general.addEntry(entryBuilder .startBooleanToggle(new TranslatableText("option.illuminations.fireflyRainbow"), Config.getFireflyRainbow()) .setSaveConsumer(Config::setFireflyRainbow) .setDefaultValue(DefaultConfig.FIREFLY_RAINBOW) .build()); general.addEntry(entryBuilder .startBooleanToggle(new TranslatableText("option.illuminations.autoUpdate"), Config.isAutoUpdate()) .setTooltip(new TranslatableText("option.tooltip.illuminations.autoUpdate")) .setSaveConsumer(Config::setAutoUpdate) .setDefaultValue(DefaultConfig.AUTO_UPDATE) .build()); general.addEntry(entryBuilder .startBooleanToggle(new TranslatableText("option.illuminations.viewAurasFP"), Config.getViewAurasFP()) .setTooltip(new TranslatableText("option.tooltip.illuminations.viewAurasFP")) .setSaveConsumer(Config::setViewAurasFP) .setDefaultValue(DefaultConfig.VIEW_AURAS_FP) .build()); general.addEntry(entryBuilder .startBooleanToggle(new TranslatableText("option.illuminations.displayDonationToast"), Config.isDisplayDonationToast()) .setTooltip(new TranslatableText("option.tooltip.illuminations.displayDonationToast")) .setSaveConsumer(Config::setDisplayDonationToast) .setDefaultValue(DefaultConfig.DISPLAY_DONATION_TOAST) .build()); general.addEntry(entryBuilder .startBooleanToggle(new TranslatableText("option.illuminations.debugMode"), Config.isDebugMode()) .setTooltip(new TranslatableText("option.tooltip.illuminations.debugMode")) .setSaveConsumer(Config::setDebugMode) .setDefaultValue(DefaultConfig.DEBUG_MODE) .build()); } private void GenerateBiomeSettings() { HashMap biomeCategories = new HashMap<>(); for (Identifier dimension : BiomeCategory.getDimensions()) { String name = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, dimension.getPath()); ConfigCategory category = builder.getOrCreateCategory(new TranslatableText("category.illuminations." + name)); category.setDescription(new StringVisitable[]{new TranslatableText("category.illuminations." + name + ".description")}); biomeCategories.put(dimension, category); } for (BiomeCategory biome : BiomeCategory.values()) { ConfigCategory category = biomeCategories.get(biome.getDimension()); String name = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, biome.name()); BiomeSettings defaultSettings = DefaultConfig.getBiomeSettings(biome); BiomeSettings settings = Config.getBiomeSettings(biome); // Biome tooltip Text[] tooltip = new Text[biome.getBiomes().length + 1]; tooltip[0] = new TranslatableText("option.tooltip.illuminations.biome"); for (int i = 0; i < biome.getBiomes().length; i++) { tooltip[i + 1] = new TranslatableText("biome.minecraft." + biome.getBiomes()[i].getPath()); } // Biome sub category SubCategoryBuilder biomeCategoryBuilder = entryBuilder .startSubCategory(new TranslatableText("option.illuminations.biome." + name)) .setTooltip(tooltip); // Firefly spawn rate biomeCategoryBuilder.add(entryBuilder .startEnumSelector(new TranslatableText("option.illuminations.fireflySpawnRate"), FireflySpawnRate.class, settings.fireflySpawnRate()) .setTooltip( new TranslatableText("option.tooltip.illuminations.fireflySpawnRate"), new TranslatableText("option.tooltip.illuminations.fireflySpawnRate.disable"), new TranslatableText("option.tooltip.illuminations.fireflySpawnRate.low"), new TranslatableText("option.tooltip.illuminations.fireflySpawnRate.medium"), new TranslatableText("option.tooltip.illuminations.fireflySpawnRate.high")) .setSaveConsumer(x -> Config.setFireflySettings(biome, x)) .setDefaultValue(defaultSettings.fireflySpawnRate()) .build()); // Firefly color biomeCategoryBuilder.add(entryBuilder .startColorField(new TranslatableText("option.illuminations.fireflyColor"), settings.fireflyColor()) .setTooltip(new TranslatableText("option.tooltip.illuminations.fireflyColor")) .setSaveConsumer(x -> Config.setFireflyColorSettings(biome, x)) .setDefaultValue(defaultSettings.fireflyColor()) .build()); // Glowworm spawn rate if (settings.glowwormSpawnRate() != null) biomeCategoryBuilder.add(entryBuilder .startEnumSelector(new TranslatableText("option.illuminations.glowwormSpawnRate"), GlowwormSpawnRate.class, settings.glowwormSpawnRate()) .setTooltip( new TranslatableText("option.tooltip.illuminations.glowwormSpawnRate"), new TranslatableText("option.tooltip.illuminations.glowwormSpawnRate.disable"), new TranslatableText("option.tooltip.illuminations.glowwormSpawnRate.low"), new TranslatableText("option.tooltip.illuminations.glowwormSpawnRate.medium"), new TranslatableText("option.tooltip.illuminations.glowwormSpawnRate.high")) .setSaveConsumer(x -> Config.setGlowwormSettings(biome, x)) .setDefaultValue(defaultSettings.glowwormSpawnRate()) .build()); // Plankton spawn rate if (settings.planktonSpawnRate() != null) biomeCategoryBuilder.add(entryBuilder .startEnumSelector(new TranslatableText("option.illuminations.planktonSpawnRate"), PlanktonSpawnRate.class, settings.planktonSpawnRate()) .setTooltip( new TranslatableText("option.tooltip.illuminations.planktonSpawnRate"), new TranslatableText("option.tooltip.illuminations.planktonSpawnRate.disable"), new TranslatableText("option.tooltip.illuminations.planktonSpawnRate.low"), new TranslatableText("option.tooltip.illuminations.planktonSpawnRate.medium"), new TranslatableText("option.tooltip.illuminations.planktonSpawnRate.high")) .setSaveConsumer(x -> Config.setPlanktonSettings(biome, x)) .setDefaultValue(defaultSettings.planktonSpawnRate()) .build()); if (biome == OTHER) { biomeCategoryBuilder.forEach(category::addEntry); } else { category.addEntry(biomeCategoryBuilder.build()); } } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/Rainbowlluminations.java ================================================ package ladysnake.illuminations.client; import ladysnake.satin.api.event.EntitiesPreRenderCallback; import ladysnake.satin.api.managed.ManagedCoreShader; import ladysnake.satin.api.managed.ShaderEffectManager; import ladysnake.satin.api.managed.uniform.Uniform1f; import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; import net.minecraft.util.Identifier; public class Rainbowlluminations { // rainbow shader for jeb mobs public static final ManagedCoreShader RAINBOW_SHADER = ShaderEffectManager.getInstance().manageCoreShader(new Identifier(Illuminations.MODID, "jeb")); private static final Uniform1f uniformSTime = RAINBOW_SHADER.findUniform1f("Time"); private static int ticks; public static void init() { ClientTickEvents.END_CLIENT_TICK.register(client -> ticks++); EntitiesPreRenderCallback.EVENT.register((camera, frustum, tickDelta) -> uniformSTime.set((ticks + tickDelta) * 0.05f)); } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/config/Config.java ================================================ package ladysnake.illuminations.client.config; import com.google.common.base.CaseFormat; import ladysnake.illuminations.client.data.BiomeSettings; import ladysnake.illuminations.client.enums.*; import net.fabricmc.loader.api.FabricLoader; import org.jetbrains.annotations.NotNull; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.util.*; import java.util.function.Consumer; public class Config { public static final Path PROPERTIES_PATH = FabricLoader.getInstance().getConfigDir().resolve("illuminations.properties"); private static final Properties config = new Properties() { @Override public @NotNull Set> entrySet() { Iterator> iterator = super.entrySet().stream().sorted(Comparator.comparing(o -> o.getKey().toString())).iterator(); Set> temp = new LinkedHashSet<>(super.entrySet().size()); while (iterator.hasNext()) temp.add(iterator.next()); return temp; } }; private static HalloweenFeatures halloweenFeatures; private static EyesInTheDarkSpawnRate eyesInTheDarkSpawnRate; private static WillOWispsSpawnRate willOWispsSpawnRate; private static int chorusPetalsSpawnMultiplier; private static int density; private static boolean fireflySpawnAlways; private static boolean fireflySpawnUnderground; private static int fireflyWhiteAlpha; private static boolean fireflyRainbow; private static boolean viewAurasFP; private static boolean autoUpdate; private static boolean debugMode; private static boolean displayGreetingScreen; private static boolean displayDonationToast; private static HashMap biomeSettings; // private static HashMap auraSettings; public static void load() { // if illuminations.properties exist, load it if (Files.isRegularFile(PROPERTIES_PATH)) { // load illuminations.properties try { config.load(Files.newBufferedReader(PROPERTIES_PATH)); } catch (IOException e) { e.printStackTrace(); } } else { // if no illuminations.properties, load default values // define default properties setHalloweenFeatures(DefaultConfig.HALLOWEEN_FEATURES); setEyesInTheDarkSpawnRate(DefaultConfig.EYES_IN_THE_DARK_SPAWN_RATE); setWillOWispsSpawnRate(DefaultConfig.WILL_O_WISPS_SPAWN_RATE); setChorusPetalsSpawnMultiplier(DefaultConfig.CHORUS_PETALS_SPAWN_MULTIPLIER); setDensity(DefaultConfig.DENSITY); setFireflySpawnAlways(DefaultConfig.FIREFLY_SPAWN_ALWAYS); setFireflySpawnUnderground(DefaultConfig.FIREFLY_SPAWN_UNDERGROUND); setFireflyWhiteAlpha(DefaultConfig.FIREFLY_WHITE_ALPHA); setAutoUpdate(DefaultConfig.AUTO_UPDATE); setViewAurasFP(DefaultConfig.VIEW_AURAS_FP); setDisplayGreetingScreen(DefaultConfig.DISPLAY_GREETING_SCREEN); setDisplayDonationToast(DefaultConfig.DISPLAY_DONATION_TOAST); biomeSettings = new HashMap<>(); DefaultConfig.BIOME_SETTINGS.forEach(Config::setBiomeSettings); /* auraSettings = new HashMap<>(); defaultAuraSettings.forEach(Config::setAuraSettings); */ Config.save(); return; } parseProperty("halloween-features", Config::setHalloweenFeatures, DefaultConfig.HALLOWEEN_FEATURES); parseProperty("eyes-in-the-dark-spawn-rate", Config::setEyesInTheDarkSpawnRate, DefaultConfig.EYES_IN_THE_DARK_SPAWN_RATE); parseProperty("will-o-wisps-spawn-rate", Config::setWillOWispsSpawnRate, DefaultConfig.WILL_O_WISPS_SPAWN_RATE); parseProperty("chorus-petal-spawn-multiplier", Config::setChorusPetalsSpawnMultiplier, DefaultConfig.CHORUS_PETALS_SPAWN_MULTIPLIER); parseProperty("density", Config::setDensity, DefaultConfig.DENSITY); parseProperty("firefly-spawn-always", Config::setFireflySpawnAlways, DefaultConfig.FIREFLY_SPAWN_ALWAYS); parseProperty("firefly-spawn-underground", Config::setFireflySpawnUnderground, DefaultConfig.FIREFLY_SPAWN_UNDERGROUND); parseProperty("firefly-white-alpha", Config::setFireflyWhiteAlpha, DefaultConfig.FIREFLY_WHITE_ALPHA); parseProperty("firefly-rainbow", Config::setFireflyRainbow, DefaultConfig.FIREFLY_RAINBOW); parseProperty("auto-update", Config::setAutoUpdate, DefaultConfig.AUTO_UPDATE); parseProperty("debug-mode", Config::setDebugMode, DefaultConfig.DEBUG_MODE); parseProperty("view-auras-fp", Config::setViewAurasFP, DefaultConfig.VIEW_AURAS_FP); parseProperty("display-greeting-screen", Config::setDisplayGreetingScreen, DefaultConfig.DISPLAY_GREETING_SCREEN); parseProperty("display-donation-toast", Config::setDisplayDonationToast, DefaultConfig.DISPLAY_DONATION_TOAST); biomeSettings = new HashMap<>(); DefaultConfig.BIOME_SETTINGS.forEach((biome, defaultValue) -> parseProperty(biome.name(), x -> Config.setBiomeSettings(biome, x), defaultValue)); /* auraSettings = new HashMap<>(); defaultAuraSettings.forEach((aura, v) -> setAuraSettings(aura, tryOrDefault(() -> { String name = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, aura); float s = Float.parseFloat(config.getProperty(name + "-aura-spawn-rate")); int d = Integer.parseInt(config.getProperty(name + "-aura-delay")); return new AuraSettings(s, d); }, v))); */ Config.save(); } private static > void parseProperty(String property, Consumer setter, T defaultValue) { try { setter.accept(Enum.valueOf(defaultValue.getDeclaringClass(), config.getProperty(property))); } catch (Exception e) { setter.accept(defaultValue); } } private static void parseProperty(String property, Consumer setter, Boolean defaultValue) { try { setter.accept(Boolean.parseBoolean(config.getProperty(property))); } catch (Exception e) { setter.accept(defaultValue); } } private static void parseProperty(String property, Consumer setter, Integer defaultValue) { try { setter.accept(Integer.parseInt(config.getProperty(property))); } catch (Exception e) { setter.accept(defaultValue); } } private static void parseProperty(String biome, Consumer setter, BiomeSettings defaultValue) { try { String name = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, biome); FireflySpawnRate fireflySpawnRate = FireflySpawnRate.valueOf(config.getProperty(name + "-firefly-spawn-rate")); GlowwormSpawnRate glowwormSpawnRate = defaultValue.glowwormSpawnRate() == null ? null : GlowwormSpawnRate.valueOf(config.getProperty(name + "-glowworm-spawn-rate")); PlanktonSpawnRate planktonSpawnRate = defaultValue.planktonSpawnRate() == null ? null : PlanktonSpawnRate.valueOf(config.getProperty(name + "-plankton-spawn-rate")); int fireflyColor = Integer.parseInt(config.getProperty(name + "-firefly-color"), 16); setter.accept(new BiomeSettings(fireflySpawnRate, fireflyColor, glowwormSpawnRate, planktonSpawnRate)); } catch (Exception e) { setter.accept(defaultValue); } } public static void save() { try { config.store(Files.newBufferedWriter(Config.PROPERTIES_PATH), null); } catch (IOException e) { e.printStackTrace(); } } //region Getters/Setters public static HalloweenFeatures getHalloweenFeatures() { return halloweenFeatures; } public static void setHalloweenFeatures(HalloweenFeatures value) { halloweenFeatures = value; config.setProperty("halloween-features", value.toString()); } public static EyesInTheDarkSpawnRate getEyesInTheDarkSpawnRate() { return eyesInTheDarkSpawnRate; } public static void setEyesInTheDarkSpawnRate(EyesInTheDarkSpawnRate value) { eyesInTheDarkSpawnRate = value; config.setProperty("eyes-in-the-dark-spawn-rate", value.name()); } public static WillOWispsSpawnRate getWillOWispsSpawnRate() { return willOWispsSpawnRate; } public static void setWillOWispsSpawnRate(WillOWispsSpawnRate value) { willOWispsSpawnRate = value; config.setProperty("will-o-wisps-spawn-rate", value.name()); } public static int getChorusPetalsSpawnMultiplier() { return chorusPetalsSpawnMultiplier; } public static void setChorusPetalsSpawnMultiplier(int value) { chorusPetalsSpawnMultiplier = value; config.setProperty("chorus-petal-spawn-multiplier", Integer.toString(value)); } public static int getDensity() { return density; } public static void setDensity(int value) { density = value; config.setProperty("density", Integer.toString(value)); } public static boolean doesFireflySpawnAlways() { return fireflySpawnAlways; } public static void setFireflySpawnAlways(boolean value) { fireflySpawnAlways = value; config.setProperty("firefly-spawn-always", Boolean.toString(value)); } public static boolean doesFireflySpawnUnderground() { return fireflySpawnUnderground; } public static void setFireflySpawnUnderground(boolean value) { fireflySpawnUnderground = value; config.setProperty("firefly-spawn-underground", Boolean.toString(value)); } public static int getFireflyWhiteAlpha() { return fireflyWhiteAlpha; } public static void setFireflyWhiteAlpha(int value) { fireflyWhiteAlpha = value; config.setProperty("firefly-white-alpha", Integer.toString(value)); } public static boolean getFireflyRainbow() { return fireflyRainbow; } public static void setFireflyRainbow(boolean value) { fireflyRainbow = value; config.setProperty("firefly-rainbow", Boolean.toString(value)); } public static boolean getViewAurasFP() { return viewAurasFP; } public static void setViewAurasFP(boolean value) { viewAurasFP = value; config.setProperty("view-auras-fp", Boolean.toString(value)); } public static boolean isAutoUpdate() { return autoUpdate; } public static void setAutoUpdate(boolean value) { autoUpdate = value; config.setProperty("auto-update", Boolean.toString(value)); } public static boolean isDebugMode() { return debugMode; } public static void setDebugMode(boolean value) { debugMode = value; config.setProperty("debug-mode", Boolean.toString(value)); } public static boolean isDisplayGreetingScreen() { return displayGreetingScreen; } public static void setDisplayGreetingScreen(boolean value) { displayGreetingScreen = value; config.setProperty("display-greeting-screen", Boolean.toString(value)); } public static boolean isDisplayDonationToast() { return displayDonationToast; } public static void setDisplayDonationToast(boolean value) { displayDonationToast = value; config.setProperty("display-donation-toast", Boolean.toString(value)); } public static Map getBiomeSettings() { return biomeSettings; } public static BiomeSettings getBiomeSettings(BiomeCategory biome) { return biomeSettings.get(biome); } public static void setBiomeSettings(BiomeCategory biome, BiomeSettings settings) { biomeSettings.put(biome, settings); String name = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, biome.name()); config.setProperty(name + "-firefly-spawn-rate", settings.fireflySpawnRate().name()); config.setProperty(name + "-firefly-color", Integer.toString(settings.fireflyColor(), 16)); if (settings.glowwormSpawnRate() != null) config.setProperty(name + "-glowworm-spawn-rate", settings.glowwormSpawnRate().name()); if (settings.planktonSpawnRate() != null) config.setProperty(name + "-plankton-spawn-rate", settings.planktonSpawnRate().name()); } public static void setFireflySettings(BiomeCategory biome, FireflySpawnRate value) { BiomeSettings settings = biomeSettings.get(biome); biomeSettings.put(biome, settings.withFireflySpawnRate(value)); String name = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, biome.name()); config.setProperty(name + "-firefly-spawn-rate", value.name()); } public static void setFireflyColorSettings(BiomeCategory biome, int color) { BiomeSettings settings = biomeSettings.get(biome); biomeSettings.put(biome, settings.withFireflyColor(color)); String name = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, biome.name()); config.setProperty(name + "-firefly-color", Integer.toString(color, 16)); } public static void setGlowwormSettings(BiomeCategory biome, GlowwormSpawnRate value) { BiomeSettings settings = biomeSettings.get(biome); biomeSettings.put(biome, settings.withGlowwormSpawnRate(value)); String name = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, biome.name()); config.setProperty(name + "-glowworm-spawn-rate", value.name()); } public static void setPlanktonSettings(BiomeCategory biome, PlanktonSpawnRate value) { BiomeSettings settings = biomeSettings.get(biome); biomeSettings.put(biome, settings.withPlanktonSpawnRate(value)); String name = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, biome.name()); config.setProperty(name + "-plankton-spawn-rate", value.name()); } /* public static Map getAuraSettings() { return auraSettings; } public static AuraSettings getAuraSettings(String aura) { return auraSettings.get(aura); } public static void setAuraSettings(String aura, AuraSettings settings) { auraSettings.put(aura, settings); String name = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, aura); config.setProperty(name + "-aura-spawn-rate", Float.toString(settings.spawnRate())); config.setProperty(name + "-aura-delay", Integer.toString(settings.delay())); } public static void setAuraSpawnRate(String aura, float value) { AuraSettings settings = auraSettings.get(aura); auraSettings.put(aura, settings.withSpawnRate(value)); String name = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, aura); config.setProperty(name + "-aura-spawn-rate", Float.toString(value)); } public static void setAuraDelay(String aura, int value) { AuraSettings settings = auraSettings.get(aura); auraSettings.put(aura, settings.withDelay(value)); String name = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, aura); config.setProperty(name + "-aura-delay", Integer.toString(value)); }*/ //endregion } ================================================ FILE: src/main/java/ladysnake/illuminations/client/config/DefaultConfig.java ================================================ package ladysnake.illuminations.client.config; import com.google.common.collect.ImmutableMap; import ladysnake.illuminations.client.data.AuraSettings; import ladysnake.illuminations.client.data.BiomeSettings; import ladysnake.illuminations.client.enums.*; import static ladysnake.illuminations.client.enums.BiomeCategory.*; public final class DefaultConfig { public static final HalloweenFeatures HALLOWEEN_FEATURES = HalloweenFeatures.ENABLE; public static final EyesInTheDarkSpawnRate EYES_IN_THE_DARK_SPAWN_RATE = EyesInTheDarkSpawnRate.MEDIUM; public static final WillOWispsSpawnRate WILL_O_WISPS_SPAWN_RATE = WillOWispsSpawnRate.MEDIUM; public static final int CHORUS_PETALS_SPAWN_MULTIPLIER = 1; public static final int DENSITY = 100; public static final boolean FIREFLY_SPAWN_ALWAYS = false; public static final boolean FIREFLY_SPAWN_UNDERGROUND = false; public static final int FIREFLY_WHITE_ALPHA = 100; public static final boolean FIREFLY_RAINBOW = false; public static final boolean AUTO_UPDATE = false; public static final boolean DEBUG_MODE = false; public static final boolean VIEW_AURAS_FP = false; public static final boolean DISPLAY_GREETING_SCREEN = true; public static final boolean DISPLAY_DONATION_TOAST = true; public static final ImmutableMap BIOME_SETTINGS = ImmutableMap.builder() .put(FOREST, new BiomeSettings(FireflySpawnRate.MEDIUM, 0xBFFF00, GlowwormSpawnRate.MEDIUM, PlanktonSpawnRate.DISABLE)) .put(TAIGA, new BiomeSettings(FireflySpawnRate.LOW, 0xBFFF00, GlowwormSpawnRate.LOW, PlanktonSpawnRate.DISABLE)) .put(SNOWY, new BiomeSettings(FireflySpawnRate.DISABLE, 0x00BFFF, GlowwormSpawnRate.DISABLE, PlanktonSpawnRate.DISABLE)) .put(PLAINS, new BiomeSettings(FireflySpawnRate.LOW, 0xBFFF00, GlowwormSpawnRate.LOW, PlanktonSpawnRate.DISABLE)) .put(DESERT, new BiomeSettings(FireflySpawnRate.DISABLE, 0xFFA755, GlowwormSpawnRate.DISABLE, PlanktonSpawnRate.DISABLE)) .put(SAVANNA, new BiomeSettings(FireflySpawnRate.LOW, 0xBFFF00, GlowwormSpawnRate.LOW, PlanktonSpawnRate.DISABLE)) .put(JUNGLE, new BiomeSettings(FireflySpawnRate.LOW, 0x00FF21, GlowwormSpawnRate.LOW, PlanktonSpawnRate.DISABLE)) .put(BEACH, new BiomeSettings(FireflySpawnRate.DISABLE, 0xBFFF00, GlowwormSpawnRate.DISABLE, PlanktonSpawnRate.DISABLE)) .put(SWAMP, new BiomeSettings(FireflySpawnRate.HIGH, 0x009F00, GlowwormSpawnRate.HIGH, PlanktonSpawnRate.DISABLE)) .put(RIVER, new BiomeSettings(FireflySpawnRate.MEDIUM, 0xBFFF00, GlowwormSpawnRate.MEDIUM, PlanktonSpawnRate.DISABLE)) .put(OCEAN, new BiomeSettings(FireflySpawnRate.DISABLE, 0xBFFF00, GlowwormSpawnRate.DISABLE, PlanktonSpawnRate.HIGH)) .put(WARM_OCEAN, new BiomeSettings(FireflySpawnRate.DISABLE, 0xBFFF00, GlowwormSpawnRate.DISABLE, PlanktonSpawnRate.HIGH)) .put(BADLANDS, new BiomeSettings(FireflySpawnRate.DISABLE, 0xBFFF00, GlowwormSpawnRate.DISABLE, PlanktonSpawnRate.DISABLE)) .put(MOUNTAINS, new BiomeSettings(FireflySpawnRate.DISABLE, 0xBFFF00, GlowwormSpawnRate.DISABLE, PlanktonSpawnRate.DISABLE)) .put(DRIPSTONE_CAVES, new BiomeSettings(FireflySpawnRate.DISABLE, 0xBFFF00, GlowwormSpawnRate.DISABLE, PlanktonSpawnRate.DISABLE)) .put(LUSH_CAVES, new BiomeSettings(FireflySpawnRate.DISABLE, 0xEB8931, GlowwormSpawnRate.DISABLE, PlanktonSpawnRate.DISABLE)) .put(MUSHROOM, new BiomeSettings(FireflySpawnRate.DISABLE, 0xFF7F8F, GlowwormSpawnRate.DISABLE, PlanktonSpawnRate.DISABLE)) .put(THE_VOID, new BiomeSettings(FireflySpawnRate.DISABLE, 0x8000FF, GlowwormSpawnRate.DISABLE, PlanktonSpawnRate.DISABLE)) // Nether Biomes .put(NETHER_WASTES, new BiomeSettings(FireflySpawnRate.DISABLE, 0xFF8000, null, null)) .put(CRIMSON_FOREST, new BiomeSettings(FireflySpawnRate.DISABLE, 0xFF8000, null, null)) .put(WARPED_FOREST, new BiomeSettings(FireflySpawnRate.DISABLE, 0x008080, null, null)) .put(SOUL_SAND_VALLEY, new BiomeSettings(FireflySpawnRate.DISABLE, 0x00FFFF, null, null)) .put(BASALT_DELTAS, new BiomeSettings(FireflySpawnRate.DISABLE, 0xFF8000, null, null)) // End Biomes .put(THE_END, new BiomeSettings(FireflySpawnRate.DISABLE, 0x8000FF, null, null)) .put(SMALL_END_ISLANDS, new BiomeSettings(FireflySpawnRate.DISABLE, 0x8000FF, null, null)) .put(END_MIDLANDS, new BiomeSettings(FireflySpawnRate.DISABLE, 0x8000FF, null, null)) .put(END_HIGHLANDS, new BiomeSettings(FireflySpawnRate.DISABLE, 0x8000FF, null, null)) .put(END_BARRENS, new BiomeSettings(FireflySpawnRate.DISABLE, 0x8000FF, null, null)) // Other Biomes .put(OTHER, new BiomeSettings(FireflySpawnRate.DISABLE, 0xBFFF00, GlowwormSpawnRate.DISABLE, PlanktonSpawnRate.DISABLE)) .build(); public static final ImmutableMap AURA_SETTINGS = ImmutableMap.builder() .put("twilight", new AuraSettings(0.1f, 1)) .put("ghostly", new AuraSettings(0.1f, 1)) .put("chorus", new AuraSettings(0.1f, 1)) .put("autumn_leaves", new AuraSettings(0.3f, 1)) .put("sculk_tendrils", new AuraSettings(0.1f, 1)) .put("shadowbringer_soul", new AuraSettings(0.1f, 1)) .put("goldenrod", new AuraSettings(0.4f, 1)) .put("confetti", new AuraSettings(0.1f, 1)) .put("prismatic_confetti", new AuraSettings(0.1f, 1)) .put("prismarine", new AuraSettings(0.1f, 1)) .build(); private DefaultConfig() { throw new UnsupportedOperationException(); } public static BiomeSettings getBiomeSettings(BiomeCategory biome) { return BIOME_SETTINGS.get(biome); } public static AuraSettings getAuraSettings(String aura) { return AURA_SETTINGS.get(aura); } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/data/AuraData.java ================================================ package ladysnake.illuminations.client.data; import net.minecraft.particle.DefaultParticleType; import java.util.Random; import java.util.function.Supplier; public record AuraData(DefaultParticleType particle, Supplier auraSettingsSupplier) { public boolean shouldAddParticle(Random random, int age) { AuraSettings settings = auraSettingsSupplier().get(); if (settings.spawnRate() == 0) return false; float rand = random.nextFloat(); return rand <= settings.spawnRate() && (age % settings.delay() == 0); } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/data/AuraSettings.java ================================================ package ladysnake.illuminations.client.data; public record AuraSettings(float spawnRate, int delay) { public AuraSettings withSpawnRate(float value) { return new AuraSettings(value, delay); } public AuraSettings withDelay(int value) { return new AuraSettings(spawnRate, value); } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/data/BiomeSettings.java ================================================ package ladysnake.illuminations.client.data; import ladysnake.illuminations.client.enums.FireflySpawnRate; import ladysnake.illuminations.client.enums.GlowwormSpawnRate; import ladysnake.illuminations.client.enums.PlanktonSpawnRate; public record BiomeSettings(FireflySpawnRate fireflySpawnRate, int fireflyColor, GlowwormSpawnRate glowwormSpawnRate, PlanktonSpawnRate planktonSpawnRate) { public BiomeSettings withFireflySpawnRate(FireflySpawnRate value) { return new BiomeSettings(value, fireflyColor, glowwormSpawnRate, planktonSpawnRate); } public BiomeSettings withFireflyColor(int value) { return new BiomeSettings(fireflySpawnRate, value, glowwormSpawnRate, planktonSpawnRate); } public BiomeSettings withGlowwormSpawnRate(GlowwormSpawnRate value) { return new BiomeSettings(fireflySpawnRate, fireflyColor, value, planktonSpawnRate); } public BiomeSettings withPlanktonSpawnRate(PlanktonSpawnRate value) { return new BiomeSettings(fireflySpawnRate, fireflyColor, glowwormSpawnRate, value); } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/data/IlluminationData.java ================================================ package ladysnake.illuminations.client.data; import ladysnake.illuminations.client.config.Config; import net.minecraft.particle.DefaultParticleType; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import java.util.Random; import java.util.function.BiPredicate; import java.util.function.Supplier; public record IlluminationData(DefaultParticleType illuminationType, BiPredicate locationSpawnPredicate, Supplier chanceSupplier) { public boolean shouldAddParticle(Random random) { float chance = chanceSupplier.get(); if (chance <= 0f) return false; float density = Config.getDensity() / 100f; return random.nextFloat() <= chance * density; } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/data/OverheadData.java ================================================ package ladysnake.illuminations.client.data; import ladysnake.illuminations.client.Illuminations; import ladysnake.illuminations.client.render.entity.model.hat.OverheadModel; import net.minecraft.client.render.entity.EntityRendererFactory; import net.minecraft.util.Identifier; import java.util.function.Function; public class OverheadData { private final Function model; private final Identifier texture; public OverheadData(Function model, String textureName) { this.model = model; this.texture = new Identifier(Illuminations.MODID, "textures/entity/" + textureName + ".png"); } public OverheadModel createModel(EntityRendererFactory.Context ctx) { return model.apply(ctx); } public Identifier getTexture() { return texture; } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/data/PlayerCosmeticData.java ================================================ package ladysnake.illuminations.client.data; import com.google.gson.JsonElement; public class PlayerCosmeticData { private final int colorRed; private final int colorGreen; private final int colorBlue; private String aura; private String overhead; private boolean drip; private String pet; public PlayerCosmeticData(JsonElement aura, JsonElement color, JsonElement overhead, JsonElement drip, JsonElement pet) { if (aura.isJsonNull()) { this.aura = null; } else { this.aura = aura.getAsString(); } if (color.isJsonNull()) { this.colorRed = 0; this.colorGreen = 0; this.colorBlue = 0; } else { this.colorRed = Integer.valueOf(color.getAsString().substring(1, 3), 16); this.colorGreen = Integer.valueOf(color.getAsString().substring(3, 5), 16); this.colorBlue = Integer.valueOf(color.getAsString().substring(5), 16); } if (overhead.isJsonNull()) { this.overhead = null; } else { this.overhead = overhead.getAsString(); } if (pet.isJsonNull()) { this.pet = null; } else { this.pet = pet.getAsString(); } if (drip.isJsonNull()) { this.drip = false; } else { this.drip = drip.getAsBoolean(); } } public String getAura() { return aura; } public int getColorRed() { return colorRed; } public int getColorBlue() { return colorBlue; } public int getColorGreen() { return colorGreen; } public boolean isDrip() { return drip; } public String getOverhead() { return overhead; } public String getPet() { return pet; } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/enums/BiomeCategory.java ================================================ package ladysnake.illuminations.client.enums; import net.minecraft.util.Identifier; import net.minecraft.world.biome.Biome; import java.util.*; public enum BiomeCategory { FOREST("minecraft:overworld", Biome.Category.FOREST, "minecraft:forest", "minecraft:wooded_hills", "minecraft:flower_forest", "minecraft:birch_forest", "minecraft:birch_forest_hills", "minecraft:tall_birch_forest", "minecraft:tall_birch_hills", "minecraft:dark_forest", "minecraft:dark_forest_hills"), TAIGA("minecraft:overworld", Biome.Category.TAIGA, "minecraft:taiga", "minecraft:taiga_hills", "minecraft:taiga_mountains", "minecraft:giant_tree_taiga", "minecraft:giant_tree_taiga_hills", "minecraft:giant_spruce_taiga", "minecraft:giant_spruce_taiga_hills"), SNOWY("minecraft:overworld", Biome.Category.ICY, "minecraft:snowy_tundra", "minecraft:snowy_mountains", "minecraft:ice_spikes", "minecraft:snowy_taiga", "minecraft:snowy_taiga_hills", "minecraft:snowy_taiga_mountains", "minecraft:frozen_river", "minecraft:frozen_ocean", "minecraft:deep_frozen_ocean"), PLAINS("minecraft:overworld", Biome.Category.PLAINS, "minecraft:plains", "minecraft:sunflower_plains"), DESERT("minecraft:overworld", Biome.Category.DESERT, "minecraft:desert", "minecraft:desert_hills", "minecraft:desert_lakes"), SAVANNA("minecraft:overworld", Biome.Category.SAVANNA, "minecraft:savanna", "minecraft:savanna_plateau", "minecraft:shattered_savanna", "minecraft:shattered_savanna_plateau"), JUNGLE("minecraft:overworld", Biome.Category.JUNGLE, "minecraft:jungle", "minecraft:jungle_hills", "minecraft:modified_jungle", "minecraft:jungle_edge", "minecraft:modified_jungle_edge", "minecraft:bamboo_jungle", "minecraft:bamboo_jungle_hills"), BEACH("minecraft:overworld", Biome.Category.BEACH, "minecraft:beach", "minecraft:stone_shore"), SWAMP("minecraft:overworld", Biome.Category.SWAMP, "minecraft:swamp", "minecraft:swamp_hills"), RIVER("minecraft:overworld", Biome.Category.RIVER, "minecraft:river"), OCEAN("minecraft:overworld", Biome.Category.OCEAN, "minecraft:ocean", "minecraft:deep_ocean", "minecraft:cold_ocean", "minecraft:deep_cold_ocean"), WARM_OCEAN("minecraft:overworld", null, "minecraft:lukewarm_ocean", "minecraft:deep_lukewarm_ocean", "minecraft:warm_ocean", "minecraft:deep_warm_ocean"), BADLANDS("minecraft:overworld", Biome.Category.MESA, "minecraft:badlands", "minecraft:badlands_plateau", "minecraft:modified_badlands_plateau", "minecraft:wooded_badlands_plateau", "minecraft:modified_wooded_badlands_plateau", "minecraft:eroded_badlands"), MOUNTAINS("minecraft:overworld", Biome.Category.EXTREME_HILLS, "minecraft:mountains", "minecraft:wooded_mountains", "minecraft:gravelly_mountains", "minecraft:modified_gravelly_mountains", "minecraft:mountain_edge"), DRIPSTONE_CAVES("minecraft:overworld", Biome.Category.UNDERGROUND, "minecraft:dripstone_caves"), LUSH_CAVES("minecraft:overworld", null, "minecraft:lush_caves"), MUSHROOM("minecraft:overworld", Biome.Category.MUSHROOM, "minecraft:mushroom_fields", "minecraft:mushroom_field_shore"), THE_VOID("minecraft:overworld", null, "minecraft:the_void"), // Nether Biomes NETHER_WASTES("minecraft:the_nether", Biome.Category.NETHER, "minecraft:nether_wastes"), CRIMSON_FOREST("minecraft:the_nether", null, "minecraft:crimson_forest"), WARPED_FOREST("minecraft:the_nether", null, "minecraft:warped_forest"), SOUL_SAND_VALLEY("minecraft:the_nether", null, "minecraft:soul_sand_valley"), BASALT_DELTAS("minecraft:the_nether", null, "minecraft:basalt_deltas"), // End Biomes THE_END("minecraft:the_end", Biome.Category.THEEND, "minecraft:the_end"), SMALL_END_ISLANDS("minecraft:the_end", null, "minecraft:small_end_islands"), END_MIDLANDS("minecraft:the_end", null, "minecraft:end_midlands"), END_HIGHLANDS("minecraft:the_end", null, "minecraft:end_highlands"), END_BARRENS("minecraft:the_end", null, "minecraft:end_barrens"), // Other Biomes OTHER("minecraft:other", Biome.Category.NONE); private static final Set dimensions = Collections.unmodifiableSet(initializeDimensions()); private static final Map lookUp = Collections.unmodifiableMap(initializeLookUp()); private static final Map fallbackLookUp = Collections.unmodifiableMap(initializeFallbackLookUp()); private final Identifier dimension; private final Biome.Category fallback; private final Identifier[] biomes; BiomeCategory(String dimension, Biome.Category fallback, String... biomes) { this.dimension = new Identifier(dimension); this.fallback = fallback; this.biomes = new Identifier[biomes.length]; for (int i = 0; i < biomes.length; i++) this.biomes[i] = new Identifier(biomes[i]); } public static Set getDimensions() { return dimensions; } private static Set initializeDimensions() { Set dimensions = new LinkedHashSet<>(); for (BiomeCategory category : BiomeCategory.values()) { dimensions.add(category.dimension); } return dimensions; } private static Map initializeLookUp() { Map lookUp = new HashMap<>(); for (BiomeCategory category : BiomeCategory.values()) { for (Identifier biome : category.biomes) { lookUp.put(biome, category); } } return lookUp; } private static Map initializeFallbackLookUp() { Map lookUp = new HashMap<>(); for (BiomeCategory category : BiomeCategory.values()) { if (category.fallback != null) { lookUp.put(category.fallback, category); } } return lookUp; } public static BiomeCategory find(Identifier biome, Biome.Category biomeCategory) { return lookUp.containsKey(biome) ? lookUp.get(biome) : fallbackLookUp.getOrDefault(biomeCategory, OTHER); } public Identifier getDimension() { return dimension; } public Identifier[] getBiomes() { return biomes; } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/enums/EyesInTheDarkSpawnRate.java ================================================ package ladysnake.illuminations.client.enums; public enum EyesInTheDarkSpawnRate { LOW(0.00002f), MEDIUM(0.00010f), HIGH(0.00025f); public final float spawnRate; EyesInTheDarkSpawnRate(float spawnRate) { this.spawnRate = spawnRate; } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/enums/FireflySpawnRate.java ================================================ package ladysnake.illuminations.client.enums; public enum FireflySpawnRate { DISABLE(0f), LOW(0.00002f), MEDIUM(0.00010f), HIGH(0.00025f); public final float spawnRate; FireflySpawnRate(float spawnRate) { this.spawnRate = spawnRate; } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/enums/GlowwormSpawnRate.java ================================================ package ladysnake.illuminations.client.enums; public enum GlowwormSpawnRate { DISABLE(0f), LOW(0.00004f), MEDIUM(0.00020f), HIGH(0.00050f); public final float spawnRate; GlowwormSpawnRate(float spawnRate) { this.spawnRate = spawnRate; } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/enums/HalloweenFeatures.java ================================================ package ladysnake.illuminations.client.enums; public enum HalloweenFeatures { ENABLE, DISABLE, ALWAYS } ================================================ FILE: src/main/java/ladysnake/illuminations/client/enums/PlanktonSpawnRate.java ================================================ package ladysnake.illuminations.client.enums; public enum PlanktonSpawnRate { DISABLE(0f), LOW(0.00020f), MEDIUM(0.00100f), HIGH(0.00250f); public final float spawnRate; PlanktonSpawnRate(float spawnRate) { this.spawnRate = spawnRate; } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/enums/WillOWispsSpawnRate.java ================================================ package ladysnake.illuminations.client.enums; public enum WillOWispsSpawnRate { DISABLE(0f), LOW(0.00002f), MEDIUM(0.00010f), HIGH(0.00025f); public final float spawnRate; WillOWispsSpawnRate(float spawnRate) { this.spawnRate = spawnRate; } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/gui/AutoUpdateGreetingScreen.java ================================================ package ladysnake.illuminations.client.gui; import ladysnake.illuminations.client.config.Config; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.widget.ButtonWidget; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.TranslatableText; import net.minecraft.util.Formatting; @Environment(EnvType.CLIENT) public class AutoUpdateGreetingScreen extends Screen { private final Screen parent; public AutoUpdateGreetingScreen(Screen parent) { super(new TranslatableText("title.illuminations.autoUpdater")); this.parent = parent; } protected static int row(int index) { return 40 + index * 13; } protected void init() { this.addDrawableChild(new ButtonWidget(this.width / 2 - 125, this.height / 6 + 168, 100, 20, new TranslatableText("option.illuminations.disable").formatted(Formatting.RED), (button) -> { Config.setAutoUpdate(false); Config.save(); this.client.setScreen(this.parent); })); this.addDrawableChild(new ButtonWidget(this.width / 2 + 25, this.height / 6 + 168, 100, 20, new TranslatableText("option.illuminations.enable").formatted(Formatting.GREEN), (button) -> { Config.setAutoUpdate(true); Config.save(); this.client.setScreen(this.parent); })); } public void removed() { Config.setDisplayGreetingScreen(false); Config.save(); } public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) { this.renderBackground(matrices); drawCenteredText(matrices, this.textRenderer, this.title, this.width / 2, row(1), 16777215); for (int i = 1; i <= 8; i++) { drawCenteredText(matrices, this.textRenderer, new TranslatableText("description.illuminations.autoUpdater" + i), this.width / 2, row(i + 2), 16777215); } super.render(matrices, mouseX, mouseY, delta); } @Override public void onClose() { super.onClose(); this.client.setScreen(this.parent); } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/gui/DonateToast.java ================================================ package ladysnake.illuminations.client.gui; import com.mojang.blaze3d.systems.RenderSystem; import ladysnake.illuminations.client.Illuminations; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.TitleScreen; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.toast.Toast; import net.minecraft.client.toast.ToastManager; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.LiteralText; import net.minecraft.text.Style; import net.minecraft.util.Formatting; import net.minecraft.util.Identifier; public class DonateToast implements Toast { private static final Identifier TEXTURE = new Identifier(Illuminations.MODID, "textures/gui/donate_toast.png"); public static void add() { ToastManager toastManager = MinecraftClient.getInstance().getToastManager(); DonateToast toast = toastManager.getToast(DonateToast.class, Toast.TYPE); if (toast == null) { toastManager.add(new DonateToast()); } } @Override public Visibility draw(MatrixStack matrices, ToastManager manager, long startTime) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderTexture(0, TEXTURE); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); manager.drawTexture(matrices, 0, 0, 0, 0, getWidth(), getHeight()); manager.getClient().textRenderer.draw(matrices, new LiteralText("Wish to support Illuminations?"), 34, 7, -256); manager.getClient().textRenderer.draw(matrices, new LiteralText("Get cool cosmetics for only 5€!"), 34, 18, -1); manager.getClient().textRenderer.draw(matrices, new LiteralText("More info: illuminations.uuid.gg/donators").setStyle(Style.EMPTY.withColor(Formatting.GREEN)), 34, 29, -1); return MinecraftClient.getInstance().currentScreen instanceof TitleScreen ? Visibility.SHOW : Visibility.HIDE; } @Override public Object getType() { return TYPE; } @Override public int getWidth() { return 240; } @Override public int getHeight() { return 43; } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/gui/UpdateToast.java ================================================ package ladysnake.illuminations.client.gui; import com.mojang.blaze3d.systems.RenderSystem; import ladysnake.illuminations.client.Illuminations; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.TitleScreen; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.toast.Toast; import net.minecraft.client.toast.ToastManager; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.LiteralText; import net.minecraft.util.Identifier; public class UpdateToast implements Toast { private static final Identifier TEXTURE = new Identifier(Illuminations.MODID, "textures/gui/update_toast.png"); public static void add() { ToastManager toastManager = MinecraftClient.getInstance().getToastManager(); UpdateToast toast = toastManager.getToast(UpdateToast.class, Toast.TYPE); if (toast == null) { toastManager.add(new UpdateToast()); } } @Override public Visibility draw(MatrixStack matrices, ToastManager manager, long startTime) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderTexture(0, TEXTURE); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); manager.drawTexture(matrices, 0, 0, 0, 0, getWidth(), getHeight()); manager.getClient().textRenderer.draw(matrices, new LiteralText("Illuminations update available!"), 34, 7, -256); manager.getClient().textRenderer.draw(matrices, new LiteralText("Illuminations automatically downloaded it"), 34, 18, -1); manager.getClient().textRenderer.draw(matrices, new LiteralText("Restart your game to finish installing"), 34, 29, -1); return MinecraftClient.getInstance().currentScreen instanceof TitleScreen ? Visibility.SHOW : Visibility.HIDE; } @Override public Object getType() { return TYPE; } @Override public int getWidth() { return 240; } @Override public int getHeight() { return 43; } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/ChorusPetalParticle.java ================================================ package ladysnake.illuminations.client.particle; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.particle.*; import net.minecraft.client.render.Camera; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.world.ClientWorld; import net.minecraft.particle.DefaultParticleType; import net.minecraft.tag.FluidTags; import net.minecraft.util.math.*; import java.util.Random; public class ChorusPetalParticle extends SpriteBillboardParticle { private static final Random RANDOM = new Random(); protected final float rotationFactor; private final int variant = RANDOM.nextInt(3); private final SpriteProvider spriteProvider; public ChorusPetalParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) { super(world, x, y, z, velocityX, velocityY, velocityZ); this.spriteProvider = spriteProvider; this.scale *= 1f + RANDOM.nextFloat(); this.maxAge = 30 + random.nextInt(60); this.collidesWithWorld = true; this.setSprite(spriteProvider.getSprite(variant, 2)); if (velocityY == 0f && velocityX == 0f && velocityZ == 0f) { this.colorAlpha = 0f; } this.velocityY = velocityY - 0.15D - random.nextFloat() / 10; this.velocityX = velocityX - 0.05D - random.nextFloat() / 10; this.velocityZ = velocityZ - 0.05D - random.nextFloat() / 10; this.rotationFactor = ((float) Math.random() - 0.5F) * 0.01F; this.angle = random.nextFloat() * 360f; } @Override public void buildGeometry(VertexConsumer vertexConsumer, Camera camera, float tickDelta) { this.colorRed = Math.max(this.colorGreen, 0.3f); Vec3d vec3d = camera.getPos(); float f = (float) (MathHelper.lerp(tickDelta, this.prevPosX, this.x) - vec3d.getX()); float g = (float) (MathHelper.lerp(tickDelta, this.prevPosY, this.y) - vec3d.getY()); float h = (float) (MathHelper.lerp(tickDelta, this.prevPosZ, this.z) - vec3d.getZ()); Quaternion quaternion2; if (this.angle == 0.0F) { quaternion2 = camera.getRotation(); } else { quaternion2 = new Quaternion(camera.getRotation()); float i = MathHelper.lerp(tickDelta, this.prevAngle, this.angle); quaternion2.hamiltonProduct(Vec3f.POSITIVE_Z.getDegreesQuaternion(i)); } Vec3f Vec3f = new Vec3f(-1.0F, -1.0F, 0.0F); Vec3f.rotate(quaternion2); Vec3f[] Vec3fs = new Vec3f[]{new Vec3f(-1.0F, -1.0F, 0.0F), new Vec3f(-1.0F, 1.0F, 0.0F), new Vec3f(1.0F, 1.0F, 0.0F), new Vec3f(1.0F, -1.0F, 0.0F)}; float j = this.getSize(tickDelta); for (int k = 0; k < 4; ++k) { Vec3f Vec3f2 = Vec3fs[k]; Vec3f2.rotate(quaternion2); Vec3f2.scale(j); Vec3f2.add(f, g, h); } float minU = this.getMinU(); float maxU = this.getMaxU(); float minV = this.getMinV(); float maxV = this.getMaxV(); int l = 15728880; vertexConsumer.vertex(Vec3fs[0].getX(), Vec3fs[0].getY(), Vec3fs[0].getZ()).texture(maxU, maxV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); vertexConsumer.vertex(Vec3fs[1].getX(), Vec3fs[1].getY(), Vec3fs[1].getZ()).texture(maxU, minV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); vertexConsumer.vertex(Vec3fs[2].getX(), Vec3fs[2].getY(), Vec3fs[2].getZ()).texture(minU, minV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); vertexConsumer.vertex(Vec3fs[3].getX(), Vec3fs[3].getY(), Vec3fs[3].getZ()).texture(minU, maxV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); } public ParticleTextureSheet getType() { return ParticleTextureSheet.PARTICLE_SHEET_TRANSLUCENT; } public void tick() { if (this.age++ < this.maxAge) { this.colorAlpha = Math.min(1f, this.colorAlpha + 0.1f); } this.prevPosX = this.x; this.prevPosY = this.y; this.prevPosZ = this.z; this.move(this.velocityX, this.velocityY, this.velocityZ); this.velocityX *= 0.99D; this.velocityY *= 0.99D; this.velocityZ *= 0.99D; this.colorRed *= 0.99; this.colorGreen *= 0.98; if (this.age >= this.maxAge) { // this.colorRed *= 0.9; // this.colorGreen *= 0.8; this.colorAlpha = Math.max(0f, this.colorAlpha - 0.1f); if (this.colorAlpha <= 0f) { this.markDead(); } } this.prevAngle = this.angle; if (this.onGround || this.world.getFluidState(new BlockPos(this.x, this.y, this.z)).isIn(FluidTags.WATER)) { this.velocityX = 0; this.velocityY = 0; this.velocityZ = 0; } if (this.velocityY != 0) { this.angle += Math.PI * Math.sin(rotationFactor * this.age) / 2; } } @Environment(EnvType.CLIENT) public static class DefaultFactory implements ParticleFactory { private final SpriteProvider spriteProvider; public DefaultFactory(SpriteProvider spriteProvider) { this.spriteProvider = spriteProvider; } public Particle createParticle(DefaultParticleType defaultParticleType, ClientWorld clientWorld, double d, double e, double f, double g, double h, double i) { return new ChorusPetalParticle(clientWorld, d, e, f, g, h, i, this.spriteProvider); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/EmberParticle.java ================================================ package ladysnake.illuminations.client.particle; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.CampfireBlock; import net.minecraft.block.FireBlock; import net.minecraft.client.particle.*; import net.minecraft.client.render.Camera; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.world.ClientWorld; import net.minecraft.particle.DefaultParticleType; import net.minecraft.util.math.*; public class EmberParticle extends SpriteBillboardParticle { protected static final float BLINK_STEP = 0.2f; private final SpriteProvider spriteProvider; protected float nextAlphaGoal; protected double xTarget; protected double yTarget; protected double zTarget; protected int targetChangeCooldown = 0; public EmberParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) { super(world, x, y, z, velocityX, velocityY, velocityZ); this.spriteProvider = spriteProvider; this.maxAge = 100; this.collidesWithWorld = true; this.setSpriteForAge(spriteProvider); this.colorAlpha = 0f; this.nextAlphaGoal = 1f; this.scale = 0.01f; this.colorRed = 1.0f; this.colorGreen = 106f / 255f; this.colorBlue = 0f / 255f; } public ParticleTextureSheet getType() { return ParticleTextureSheet.PARTICLE_SHEET_TRANSLUCENT; } @Override public void buildGeometry(VertexConsumer vertexConsumer, Camera camera, float tickDelta) { Vec3d vec3d = camera.getPos(); float f = (float) (MathHelper.lerp(tickDelta, this.prevPosX, this.x) - vec3d.getX()); float g = (float) (MathHelper.lerp(tickDelta, this.prevPosY, this.y) - vec3d.getY()); float h = (float) (MathHelper.lerp(tickDelta, this.prevPosZ, this.z) - vec3d.getZ()); Quaternion quaternion2; if (this.angle == 0.0F) { quaternion2 = camera.getRotation(); } else { quaternion2 = new Quaternion(camera.getRotation()); float i = MathHelper.lerp(tickDelta, this.prevAngle, this.angle); quaternion2.hamiltonProduct(Vec3f.POSITIVE_Z.getRadialQuaternion(i)); } Vec3f Vec3f = new Vec3f(-1.0F, -1.0F, 0.0F); Vec3f.rotate(quaternion2); Vec3f[] Vec3fs = new Vec3f[]{new Vec3f(-1.0F, -1.0F, 0.0F), new Vec3f(-1.0F, 1.0F, 0.0F), new Vec3f(1.0F, 1.0F, 0.0F), new Vec3f(1.0F, -1.0F, 0.0F)}; float j = this.getSize(tickDelta); for (int k = 0; k < 4; ++k) { Vec3f Vec3f2 = Vec3fs[k]; Vec3f2.rotate(quaternion2); Vec3f2.scale(j); Vec3f2.add(f, g, h); } float minU = this.getMinU(); float maxU = this.getMaxU(); float minV = this.getMinV(); float maxV = this.getMaxV(); int l = 15728880; float a = Math.min(1f, Math.max(0f, this.colorAlpha)); vertexConsumer.vertex(Vec3fs[0].getX(), Vec3fs[0].getY(), Vec3fs[0].getZ()).texture(maxU, maxV).color(colorRed, colorGreen, colorBlue, a).light(l).next(); vertexConsumer.vertex(Vec3fs[1].getX(), Vec3fs[1].getY(), Vec3fs[1].getZ()).texture(maxU, minV).color(colorRed, colorGreen, colorBlue, a).light(l).next(); vertexConsumer.vertex(Vec3fs[2].getX(), Vec3fs[2].getY(), Vec3fs[2].getZ()).texture(minU, minV).color(colorRed, colorGreen, colorBlue, a).light(l).next(); vertexConsumer.vertex(Vec3fs[3].getX(), Vec3fs[3].getY(), Vec3fs[3].getZ()).texture(minU, maxV).color(colorRed, colorGreen, colorBlue, a).light(l).next(); } public void tick() { this.prevPosX = this.x; this.prevPosY = this.y; this.prevPosZ = this.z; for (int i = 0; i < 5; i++) { Block blockUnder = world.getBlockState(new BlockPos(this.x, this.y - i, this.z)).getBlock(); if (blockUnder instanceof CampfireBlock || blockUnder instanceof FireBlock) { this.velocityY += 0.01f / (i + 1); break; } else { this.velocityY = Math.max(this.velocityY - 0.001f, 0.05f); } } if (this.age++ >= this.maxAge) { if (this.colorAlpha <= 0f) { this.markDead(); } else { this.colorAlpha -= 0.1f; } } else { this.colorAlpha += 0.1f; } if (nextAlphaGoal > colorAlpha) { colorAlpha = Math.min(colorAlpha + BLINK_STEP, 1f); } else if (nextAlphaGoal < colorAlpha) { colorAlpha = Math.max(colorAlpha - BLINK_STEP, 0f); } this.targetChangeCooldown -= (new Vec3d(x, y, z).squaredDistanceTo(prevPosX, prevPosY, prevPosZ) < 0.0125) ? 10 : 1; if ((this.world.getTime() % 20 == 0) && ((xTarget == 0 && yTarget == 0 && zTarget == 0) || new Vec3d(x, y, z).squaredDistanceTo(xTarget, yTarget, zTarget) < 9 || targetChangeCooldown <= 0)) { selectBlockTarget(); } Vec3d targetVector = new Vec3d(this.xTarget - this.x, this.yTarget - this.y, this.zTarget - this.z); double length = targetVector.length(); targetVector = targetVector.multiply(0.1 / length); velocityX = (0.3) * velocityX + (0.1) * targetVector.x * 3; velocityZ = (0.3) * velocityZ + (0.1) * targetVector.z * 3; if (!new BlockPos(x, y, z).equals(this.getTargetPosition())) { this.move(velocityX, velocityY, velocityZ); } } private void selectBlockTarget() { // Behaviour double groundLevel = 0; for (int i = 0; i < 20; i++) { BlockState checkedBlock = this.world.getBlockState(new BlockPos(this.x, this.y - i, this.z)); if (!checkedBlock.getBlock().canMobSpawnInside()) { groundLevel = this.y - i; } if (groundLevel != 0) break; } this.xTarget = this.x + random.nextGaussian(); this.yTarget = this.y + random.nextGaussian() * 5; this.zTarget = this.z + random.nextGaussian(); targetChangeCooldown = random.nextInt() % 10; } public BlockPos getTargetPosition() { return new BlockPos(this.xTarget, this.yTarget, this.zTarget); } @Environment(EnvType.CLIENT) public static class DefaultFactory implements ParticleFactory { private final SpriteProvider spriteProvider; public DefaultFactory(SpriteProvider spriteProvider) { this.spriteProvider = spriteProvider; } public Particle createParticle(DefaultParticleType defaultParticleType, ClientWorld clientWorld, double d, double e, double f, double g, double h, double i) { return new EmberParticle(clientWorld, d, e, f, g, h, i, this.spriteProvider); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/EyesParticle.java ================================================ package ladysnake.illuminations.client.particle; import ladysnake.illuminations.client.Illuminations; import ladysnake.illuminations.client.config.Config; import ladysnake.illuminations.client.enums.HalloweenFeatures; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.particle.*; import net.minecraft.client.render.Camera; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.world.ClientWorld; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.effect.StatusEffects; import net.minecraft.particle.DefaultParticleType; import net.minecraft.util.math.*; import java.util.Random; import java.util.concurrent.ThreadLocalRandom; public class EyesParticle extends SpriteBillboardParticle { private static final Random RANDOM = new Random(); private final SpriteProvider spriteProvider; protected float alpha = 1f; public EyesParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) { super(world, x, y, z, velocityX, velocityY, velocityZ); this.spriteProvider = spriteProvider; this.setSprite(spriteProvider.getSprite(0, 3)); this.scale *= 1f + new Random().nextFloat(); this.maxAge = ThreadLocalRandom.current().nextInt(400, 1201); // live between seconds and one minute this.collidesWithWorld = true; this.colorRed = 1f; this.colorGreen = 1f; this.colorBlue = 1f; } @Override public void buildGeometry(VertexConsumer vertexConsumer, Camera camera, float tickDelta) { // disable if night vision or config is set to disabled if (camera.getFocusedEntity() instanceof LivingEntity && ((LivingEntity) camera.getFocusedEntity()).hasStatusEffect(StatusEffects.NIGHT_VISION) || Config.getHalloweenFeatures() == HalloweenFeatures.DISABLE) { this.markDead(); } Vec3d vec3d = camera.getPos(); float f = (float) (MathHelper.lerp(tickDelta, this.prevPosX, this.x) - vec3d.getX()); float g = (float) (MathHelper.lerp(tickDelta, this.prevPosY, this.y) - vec3d.getY()); float h = (float) (MathHelper.lerp(tickDelta, this.prevPosZ, this.z) - vec3d.getZ()); Quaternion quaternion2; if (this.angle == 0.0F) { quaternion2 = camera.getRotation(); } else { quaternion2 = new Quaternion(camera.getRotation()); float i = MathHelper.lerp(tickDelta, this.prevAngle, this.angle); quaternion2.hamiltonProduct(Vec3f.POSITIVE_Z.getRadialQuaternion(i)); } Vec3f Vec3f = new Vec3f(-1.0F, -1.0F, 0.0F); Vec3f.rotate(quaternion2); Vec3f[] Vec3fs = new Vec3f[]{new Vec3f(-1.0F, -1.0F, 0.0F), new Vec3f(-1.0F, 1.0F, 0.0F), new Vec3f(1.0F, 1.0F, 0.0F), new Vec3f(1.0F, -1.0F, 0.0F)}; float j = this.getSize(tickDelta); for (int k = 0; k < 4; ++k) { Vec3f Vec3f2 = Vec3fs[k]; Vec3f2.rotate(quaternion2); Vec3f2.scale(j); Vec3f2.add(f, g, h); } float minU = this.getMinU(); float maxU = this.getMaxU(); float minV = this.getMinV(); float maxV = this.getMaxV(); int l = 15728880; float a = Math.min(1f, Math.max(0f, this.colorAlpha)); vertexConsumer.vertex(Vec3fs[0].getX(), Vec3fs[0].getY(), Vec3fs[0].getZ()).texture(maxU, maxV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); vertexConsumer.vertex(Vec3fs[1].getX(), Vec3fs[1].getY(), Vec3fs[1].getZ()).texture(maxU, minV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); vertexConsumer.vertex(Vec3fs[2].getX(), Vec3fs[2].getY(), Vec3fs[2].getZ()).texture(minU, minV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); vertexConsumer.vertex(Vec3fs[3].getX(), Vec3fs[3].getY(), Vec3fs[3].getZ()).texture(minU, maxV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); } public ParticleTextureSheet getType() { return ParticleTextureSheet.PARTICLE_SHEET_TRANSLUCENT; } public void tick() { if (this.age++ < this.maxAge) { if (this.age < 1) { this.setSprite(spriteProvider.getSprite(0, 3)); } else if (this.age < 2) { this.setSprite(spriteProvider.getSprite(1, 3)); } else if (this.age < 3) { this.setSprite(spriteProvider.getSprite(2, 3)); } else { this.setSprite(spriteProvider.getSprite(3, 3)); } } else { if (this.age < this.maxAge + 1) { this.setSprite(spriteProvider.getSprite(2, 3)); } else if (this.age < this.maxAge + 2) { this.setSprite(spriteProvider.getSprite(1, 3)); } else if (this.age < this.maxAge + 3) { this.setSprite(spriteProvider.getSprite(0, 3)); } else { this.markDead(); } } this.prevPosX = this.x; this.prevPosY = this.y; this.prevPosZ = this.z; // disappear if light or if player gets too close if (this.maxAge > this.age && (world.getLightLevel(new BlockPos(x, y, z)) > 0 || world.getClosestPlayer(x, y, z, Illuminations.EYES_VANISHING_DISTANCE, false) != null)) { this.maxAge = this.age; } } @Environment(EnvType.CLIENT) public static class DefaultFactory implements ParticleFactory { private final SpriteProvider spriteProvider; public DefaultFactory(SpriteProvider spriteProvider) { this.spriteProvider = spriteProvider; } public Particle createParticle(DefaultParticleType defaultParticleType, ClientWorld clientWorld, double d, double e, double f, double g, double h, double i) { return new EyesParticle(clientWorld, d, e, f, g, h, i, this.spriteProvider); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/FireflyParticle.java ================================================ package ladysnake.illuminations.client.particle; import ladysnake.illuminations.client.Illuminations; import ladysnake.illuminations.client.config.Config; import ladysnake.illuminations.client.enums.BiomeCategory; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.block.BlockState; import net.minecraft.client.particle.*; import net.minecraft.client.render.Camera; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.world.ClientWorld; import net.minecraft.particle.DefaultParticleType; import net.minecraft.util.Identifier; import net.minecraft.util.math.*; import net.minecraft.util.registry.Registry; import net.minecraft.world.LightType; import net.minecraft.world.biome.Biome; import java.awt.*; import java.util.HashMap; import java.util.concurrent.ThreadLocalRandom; public class FireflyParticle extends SpriteBillboardParticle { protected static final float BLINK_STEP = 0.05f; private final SpriteProvider spriteProvider; private final boolean isAttractedByLight = true; protected float nextAlphaGoal = 0f; protected double xTarget; protected double yTarget; protected double zTarget; protected int targetChangeCooldown = 0; protected int maxHeight; private BlockPos lightTarget; public FireflyParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) { super(world, x, y, z, velocityX, velocityY, velocityZ); this.spriteProvider = spriteProvider; this.scale *= 0.25f + random.nextFloat() * 0.50f; this.maxAge = ThreadLocalRandom.current().nextInt(400, 1201); // live between 20 seconds and one minute this.maxHeight = 4; this.collidesWithWorld = true; this.setSpriteForAge(spriteProvider); this.colorAlpha = 0f; Color c; if (Config.getFireflyRainbow()) { c = Color.getHSBColor(random.nextFloat(), 1f, 1f); } else { // Get color for current biome Biome b = world.getBiome(new BlockPos(x, y, z)); Identifier biome = world.getRegistryManager().get(Registry.BIOME_KEY).getId(b); BiomeCategory biomeCategory = BiomeCategory.find(biome, b.getCategory()); int rgb = Config.getBiomeSettings(biomeCategory).fireflyColor(); float[] hsb = Color.RGBtoHSB(rgb >> 16 & 0xFF, rgb >> 8 & 0xFF, rgb & 0xFF, null); // Shift hue by random ±30 deg angle hsb[0] += (random.nextFloat() - 0.5f) * 30 / 360f; // Convert back to rgb c = Color.getHSBColor(hsb[0], hsb[1], hsb[2]); } this.colorRed = c.getRed() / 255f; this.colorGreen = c.getGreen() / 255f; this.colorBlue = c.getBlue() / 255f; /*if (LocalDate.now().getMonth() == Month.OCTOBER) { this.colorRed = 1f; this.colorGreen = 0.25f + new Random().nextFloat() * 0.25f; } else { this.colorRed = 0.5f + new Random().nextFloat() * 0.5f; this.colorGreen = 1f; } this.colorBlue = 0f;*/ } public ParticleTextureSheet getType() { return ParticleTextureSheet.PARTICLE_SHEET_TRANSLUCENT; } @Override public void buildGeometry(VertexConsumer vertexConsumer, Camera camera, float tickDelta) { Vec3d vec3d = camera.getPos(); float f = (float) (MathHelper.lerp(tickDelta, this.prevPosX, this.x) - vec3d.getX()); float g = (float) (MathHelper.lerp(tickDelta, this.prevPosY, this.y) - vec3d.getY()); float h = (float) (MathHelper.lerp(tickDelta, this.prevPosZ, this.z) - vec3d.getZ()); Quaternion quaternion2; if (this.angle == 0.0F) { quaternion2 = camera.getRotation(); } else { quaternion2 = new Quaternion(camera.getRotation()); float i = MathHelper.lerp(tickDelta, this.prevAngle, this.angle); quaternion2.hamiltonProduct(Vec3f.POSITIVE_Z.getRadialQuaternion(i)); } Vec3f Vec3f = new Vec3f(-1.0F, -1.0F, 0.0F); Vec3f.rotate(quaternion2); Vec3f[] Vec3fs = new Vec3f[]{new Vec3f(-1.0F, -1.0F, 0.0F), new Vec3f(-1.0F, 1.0F, 0.0F), new Vec3f(1.0F, 1.0F, 0.0F), new Vec3f(1.0F, -1.0F, 0.0F)}; float j = this.getSize(tickDelta); for (int k = 0; k < 4; ++k) { Vec3f Vec3f2 = Vec3fs[k]; Vec3f2.rotate(quaternion2); Vec3f2.scale(j); Vec3f2.add(f, g, h); } float minU = this.getMinU(); float maxU = this.getMaxU(); float minV = this.getMinV(); float maxV = this.getMaxV(); int l = 15728880; float a = Math.min(1f, Math.max(0f, this.colorAlpha)); // colored layer vertexConsumer.vertex(Vec3fs[0].getX(), Vec3fs[0].getY(), Vec3fs[0].getZ()).texture(maxU, minV + (maxV - minV) / 2.0F).color(this.colorRed, this.colorGreen, this.colorBlue, a).light(l).next(); vertexConsumer.vertex(Vec3fs[1].getX(), Vec3fs[1].getY(), Vec3fs[1].getZ()).texture(maxU, minV).color(this.colorRed, this.colorGreen, this.colorBlue, a).light(l).next(); vertexConsumer.vertex(Vec3fs[2].getX(), Vec3fs[2].getY(), Vec3fs[2].getZ()).texture(minU, minV).color(this.colorRed, this.colorGreen, this.colorBlue, a).light(l).next(); vertexConsumer.vertex(Vec3fs[3].getX(), Vec3fs[3].getY(), Vec3fs[3].getZ()).texture(minU, minV + (maxV - minV) / 2.0F).color(this.colorRed, this.colorGreen, this.colorBlue, a).light(l).next(); // white center vertexConsumer.vertex(Vec3fs[0].getX(), Vec3fs[0].getY(), Vec3fs[0].getZ()).texture(maxU, maxV).color(1f, 1f, 1f, (a * Config.getFireflyWhiteAlpha()) / 100f).light(l).next(); vertexConsumer.vertex(Vec3fs[1].getX(), Vec3fs[1].getY(), Vec3fs[1].getZ()).texture(maxU, minV + (maxV - minV) / 2.0F).color(1f, 1f, 1f, (a * Config.getFireflyWhiteAlpha()) / 100f).light(l).next(); vertexConsumer.vertex(Vec3fs[2].getX(), Vec3fs[2].getY(), Vec3fs[2].getZ()).texture(minU, minV + (maxV - minV) / 2.0F).color(1f, 1f, 1f, (a * Config.getFireflyWhiteAlpha()) / 100f).light(l).next(); vertexConsumer.vertex(Vec3fs[3].getX(), Vec3fs[3].getY(), Vec3fs[3].getZ()).texture(minU, maxV).color(1f, 1f, 1f, (a * Config.getFireflyWhiteAlpha()) / 100f).light(l).next(); } public void tick() { this.prevPosX = this.x; this.prevPosY = this.y; this.prevPosZ = this.z; // fade and die on daytime or if old enough unless fireflies can spawn any time of day if ((!Config.doesFireflySpawnAlways() && !world.getDimension().hasFixedTime() && !Illuminations.isNightTime(world)) || this.age++ >= this.maxAge) { nextAlphaGoal = 0; if (colorAlpha < 0f) { this.markDead(); } } // blinking if (colorAlpha > nextAlphaGoal - BLINK_STEP && colorAlpha < nextAlphaGoal + BLINK_STEP) { nextAlphaGoal = random.nextFloat(); } else { if (nextAlphaGoal > colorAlpha) { colorAlpha = Math.min(colorAlpha + BLINK_STEP, 1f); } else if (nextAlphaGoal < colorAlpha) { colorAlpha = Math.max(colorAlpha - BLINK_STEP, 0f); } } this.targetChangeCooldown -= (new Vec3d(x, y, z).squaredDistanceTo(prevPosX, prevPosY, prevPosZ) < 0.0125) ? 10 : 1; if ((this.world.getTime() % 20 == 0) && ((xTarget == 0 && yTarget == 0 && zTarget == 0) || new Vec3d(x, y, z).squaredDistanceTo(xTarget, yTarget, zTarget) < 9 || targetChangeCooldown <= 0)) { selectBlockTarget(); } Vec3d targetVector = new Vec3d(this.xTarget - this.x, this.yTarget - this.y, this.zTarget - this.z); double length = targetVector.length(); targetVector = targetVector.multiply(0.1 / length); if (!this.world.getBlockState(new BlockPos(this.x, this.y - 0.1, this.z)).getBlock().canMobSpawnInside()) { velocityX = (0.9) * velocityX + (0.1) * targetVector.x; velocityY = 0.05; velocityZ = (0.9) * velocityZ + (0.1) * targetVector.z; } else { velocityX = (0.9) * velocityX + (0.1) * targetVector.x; velocityY = (0.9) * velocityY + (0.1) * targetVector.y; velocityZ = (0.9) * velocityZ + (0.1) * targetVector.z; } if (!new BlockPos(x, y, z).equals(this.getTargetPosition())) { this.move(velocityX, velocityY, velocityZ); } } private void selectBlockTarget() { if (this.lightTarget == null) { // Behaviour double groundLevel = 0; for (int i = 0; i < 20; i++) { BlockState checkedBlock = this.world.getBlockState(new BlockPos(this.x, this.y - i, this.z)); if (!checkedBlock.getBlock().canMobSpawnInside()) { groundLevel = this.y - i; } if (groundLevel != 0) break; } this.xTarget = this.x + random.nextGaussian() * 10; this.yTarget = Math.min(Math.max(this.y + random.nextGaussian() * 2, groundLevel), groundLevel + maxHeight); this.zTarget = this.z + random.nextGaussian() * 10; BlockPos targetPos = new BlockPos(this.xTarget, this.yTarget, this.zTarget); if (this.world.getBlockState(targetPos).isFullCube(world, targetPos) && this.world.getBlockState(targetPos).isSolidBlock(world, targetPos)) { this.yTarget += 1; } if (this.isAttractedByLight) { this.lightTarget = getMostLitBlockAround(); } } else { this.xTarget = this.lightTarget.getX() + random.nextGaussian(); this.yTarget = this.lightTarget.getY() + random.nextGaussian(); this.zTarget = this.lightTarget.getZ() + random.nextGaussian(); this.x = this.lightTarget.getX(); this.y = this.lightTarget.getY() + 1; this.z = this.lightTarget.getZ(); if (this.world.getLightLevel(LightType.BLOCK, new BlockPos(x, y, z)) > 0 && !this.world.isDay()) { this.lightTarget = getMostLitBlockAround(); } else { this.lightTarget = null; } } targetChangeCooldown = random.nextInt() % 100; } public BlockPos getTargetPosition() { return new BlockPos(this.xTarget, this.yTarget + 0.5, this.zTarget); } private BlockPos getMostLitBlockAround() { HashMap randBlocks = new HashMap<>(); // get blocks adjacent to the fly for (int x = -1; x <= 1; x++) { for (int y = -1; y <= 1; y++) { for (int z = -1; z <= 1; z++) { BlockPos bp = new BlockPos(this.x + x, this.y + y, this.z + z); randBlocks.put(bp, this.world.getLightLevel(LightType.BLOCK, bp)); } } } // get other random blocks to find a different light source for (int i = 0; i < 15; i++) { BlockPos randBP = new BlockPos(this.x + random.nextGaussian() * 10, this.y + random.nextGaussian() * 10, this.z + random.nextGaussian() * 10); randBlocks.put(randBP, this.world.getLightLevel(LightType.BLOCK, randBP)); } return randBlocks.entrySet().stream().max((entry1, entry2) -> entry1.getValue() > entry2.getValue() ? 1 : -1).get().getKey(); } @Environment(EnvType.CLIENT) public static class DefaultFactory implements ParticleFactory { private final SpriteProvider spriteProvider; public DefaultFactory(SpriteProvider spriteProvider) { this.spriteProvider = spriteProvider; } public Particle createParticle(DefaultParticleType defaultParticleType, ClientWorld clientWorld, double d, double e, double f, double g, double h, double i) { return new FireflyParticle(clientWorld, d, e, f, g, h, i, this.spriteProvider); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/GlowwormParticle.java ================================================ package ladysnake.illuminations.client.particle; import ladysnake.illuminations.client.config.Config; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.particle.*; import net.minecraft.client.render.Camera; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.world.ClientWorld; import net.minecraft.particle.DefaultParticleType; import net.minecraft.util.math.*; import java.util.Random; import java.util.concurrent.ThreadLocalRandom; public class GlowwormParticle extends SpriteBillboardParticle { private static final float BLINK_STEP = 0.01f; private static final Random RANDOM = new Random(); private final SpriteProvider spriteProvider; protected float nextAlphaGoal = 0f; boolean onCeiling; private BlockPos lightTarget; private double xTarget; private double yTarget; private double zTarget; private int targetChangeCooldown = 0; private boolean isAttractedByLight = false; private int maxHeight; private GlowwormParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) { super(world, x, y, z, velocityX, velocityY, velocityZ); this.spriteProvider = spriteProvider; this.scale *= 0.25f + new Random().nextFloat() * 0.50f; this.maxAge = ThreadLocalRandom.current().nextInt(1200, 3601); // live between one and three minutes this.maxHeight = 255; this.collidesWithWorld = true; this.setSpriteForAge(spriteProvider); this.colorRed = 0f; this.colorGreen = 0.75f + new Random().nextFloat() * 0.25f; this.colorBlue = 1f; this.colorAlpha = 0f; this.velocityX = 0; this.velocityY = 0; this.velocityZ = 0; this.initOnCeiling(); } public ParticleTextureSheet getType() { return ParticleTextureSheet.PARTICLE_SHEET_TRANSLUCENT; } @Override public void buildGeometry(VertexConsumer vertexConsumer, Camera camera, float tickDelta) { Vec3d vec3d = camera.getPos(); float f = (float) (MathHelper.lerp((double) tickDelta, this.prevPosX, this.x) - vec3d.getX()); float g = (float) (MathHelper.lerp((double) tickDelta, this.prevPosY, this.y) - vec3d.getY()); float h = (float) (MathHelper.lerp((double) tickDelta, this.prevPosZ, this.z) - vec3d.getZ()); Quaternion quaternion2; if (this.angle == 0.0F) { quaternion2 = camera.getRotation(); } else { quaternion2 = new Quaternion(camera.getRotation()); float i = MathHelper.lerp(tickDelta, this.prevAngle, this.angle); quaternion2.hamiltonProduct(Vec3f.POSITIVE_Z.getRadialQuaternion(i)); } Vec3f Vec3f = new Vec3f(-1.0F, -1.0F, 0.0F); Vec3f.rotate(quaternion2); Vec3f[] Vec3fs = new Vec3f[]{new Vec3f(-1.0F, -1.0F, 0.0F), new Vec3f(-1.0F, 1.0F, 0.0F), new Vec3f(1.0F, 1.0F, 0.0F), new Vec3f(1.0F, -1.0F, 0.0F)}; float j = this.getSize(tickDelta); for (int k = 0; k < 4; ++k) { Vec3f Vec3f2 = Vec3fs[k]; Vec3f2.rotate(quaternion2); Vec3f2.scale(j); Vec3f2.add(f, g, h); } float minU = this.getMinU(); float maxU = this.getMaxU(); float minV = this.getMinV(); float maxV = this.getMaxV(); int l = 15728880; float a = Math.min(1f, Math.max(0f, this.colorAlpha)); // colored layer vertexConsumer.vertex(Vec3fs[0].getX(), Vec3fs[0].getY(), Vec3fs[0].getZ()).texture(maxU, minV + (maxV - minV) / 2.0F).color(this.colorRed, this.colorGreen, this.colorBlue, a).light(l).next(); vertexConsumer.vertex(Vec3fs[1].getX(), Vec3fs[1].getY(), Vec3fs[1].getZ()).texture(maxU, minV).color(this.colorRed, this.colorGreen, this.colorBlue, a).light(l).next(); vertexConsumer.vertex(Vec3fs[2].getX(), Vec3fs[2].getY(), Vec3fs[2].getZ()).texture(minU, minV).color(this.colorRed, this.colorGreen, this.colorBlue, a).light(l).next(); vertexConsumer.vertex(Vec3fs[3].getX(), Vec3fs[3].getY(), Vec3fs[3].getZ()).texture(minU, minV + (maxV - minV) / 2.0F).color(this.colorRed, this.colorGreen, this.colorBlue, a).light(l).next(); // white center vertexConsumer.vertex(Vec3fs[0].getX(), Vec3fs[0].getY(), Vec3fs[0].getZ()).texture(maxU, maxV).color(1f, 1f, 1f, (a * Config.getFireflyWhiteAlpha()) / 100f).light(l).next(); vertexConsumer.vertex(Vec3fs[1].getX(), Vec3fs[1].getY(), Vec3fs[1].getZ()).texture(maxU, minV + (maxV - minV) / 2.0F).color(1f, 1f, 1f, (a * Config.getFireflyWhiteAlpha()) / 100f).light(l).next(); vertexConsumer.vertex(Vec3fs[2].getX(), Vec3fs[2].getY(), Vec3fs[2].getZ()).texture(minU, minV + (maxV - minV) / 2.0F).color(1f, 1f, 1f, (a * Config.getFireflyWhiteAlpha()) / 100f).light(l).next(); vertexConsumer.vertex(Vec3fs[3].getX(), Vec3fs[3].getY(), Vec3fs[3].getZ()).texture(minU, maxV).color(1f, 1f, 1f, (a * Config.getFireflyWhiteAlpha()) / 100f).light(l).next(); } public void tick() { this.prevPosX = this.x; this.prevPosY = this.y; this.prevPosZ = this.z; // if old enough, fade and die if (this.age++ >= this.maxAge) { nextAlphaGoal = -BLINK_STEP; if (colorAlpha < 0f) { this.markDead(); } } // if above block is no longer here, tag no longer on ceiling if (this.world.getBlockState(new BlockPos(this.x, this.y + 0.5, this.z)).isAir()) { this.onCeiling = false; } // if no longer on ceiling and no block under, fall, fade and die if (!this.onCeiling) { this.velocityY -= 0.1; this.maxAge = 0; } // blinking if (colorAlpha > nextAlphaGoal - BLINK_STEP && colorAlpha < nextAlphaGoal + BLINK_STEP) { nextAlphaGoal = new Random().nextFloat(); } else { if (nextAlphaGoal > colorAlpha) { colorAlpha += BLINK_STEP; } else if (nextAlphaGoal < colorAlpha) { colorAlpha -= BLINK_STEP; } } this.targetChangeCooldown -= (new Vec3d(x, y, z).squaredDistanceTo(prevPosX, prevPosY, prevPosZ) < 0.0125) ? 10 : 1; if ((this.world.getTime() % 20 == 0) && ((xTarget == 0 && yTarget == 0 && zTarget == 0) || new Vec3d(x, y, z).squaredDistanceTo(xTarget, yTarget, zTarget) < 9 || targetChangeCooldown <= 0)) { selectBlockTarget(); } Vec3d targetVector = new Vec3d(this.xTarget - this.x, this.yTarget - this.y, this.zTarget - this.z); double length = targetVector.length(); targetVector = targetVector.multiply(0.1 / length); if (!this.world.getBlockState(new BlockPos(this.x, this.y - 0.1, this.z)).getBlock().canMobSpawnInside()) { velocityX = (0.9) * velocityX + (0.1) * targetVector.x; velocityZ = (0.9) * velocityZ + (0.1) * targetVector.z; } else { velocityX = (0.9) * velocityX + (0.1) * targetVector.x; velocityZ = (0.9) * velocityZ + (0.1) * targetVector.z; } if (!new BlockPos(x, y, z).equals(this.getTargetPosition())) { this.move(velocityX, velocityY, velocityZ); } } private void selectBlockTarget() { // Behaviour this.xTarget = this.x + random.nextGaussian(); this.zTarget = this.z + random.nextGaussian(); BlockPos targetPos = new BlockPos(this.xTarget, this.y, this.zTarget); targetChangeCooldown = random.nextInt() % 100; } private void initOnCeiling() { this.onCeiling = true; this.y = (float) Math.ceil(this.y) - 0.025; this.colorAlpha = 0f; while (this.world.getBlockState(new BlockPos(this.x, this.y + 1, this.z)).isAir()) { if (this.y++ > 255) { this.markDead(); break; } } this.setPos(this.x, this.y, this.z); } public BlockPos getTargetPosition() { return new BlockPos(this.xTarget, this.yTarget + 0.95, this.zTarget); } @Environment(EnvType.CLIENT) public static class DefaultFactory implements ParticleFactory { private final SpriteProvider spriteProvider; public DefaultFactory(SpriteProvider spriteProvider) { this.spriteProvider = spriteProvider; } public Particle createParticle(DefaultParticleType defaultParticleType, ClientWorld clientWorld, double d, double e, double f, double g, double h, double i) { return new GlowwormParticle(clientWorld, d, e, f, g, h, i, this.spriteProvider); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/PlanktonParticle.java ================================================ package ladysnake.illuminations.client.particle; import ladysnake.illuminations.client.config.Config; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.block.BlockState; import net.minecraft.client.particle.*; import net.minecraft.client.render.Camera; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.world.ClientWorld; import net.minecraft.particle.DefaultParticleType; import net.minecraft.tag.FluidTags; import net.minecraft.util.math.*; import java.util.Random; import java.util.concurrent.ThreadLocalRandom; public class PlanktonParticle extends SpriteBillboardParticle { private static final float BLINK_STEP = 0.01f; private static final Random RANDOM = new Random(); private final SpriteProvider spriteProvider; protected float nextAlphaGoal = 0f; private BlockPos lightTarget; private double xTarget; private double yTarget; private double zTarget; private int targetChangeCooldown = 0; private PlanktonParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) { super(world, x, y, z, velocityX, velocityY, velocityZ); this.spriteProvider = spriteProvider; this.scale *= 0.05f + new Random().nextFloat() * 0.05f; this.maxAge = ThreadLocalRandom.current().nextInt(400, 1201); // live between 20 seconds and one minute this.collidesWithWorld = true; this.setSpriteForAge(spriteProvider); this.colorRed = 0f; this.colorGreen = 0.25f + new Random().nextFloat() * 0.25f; this.colorBlue = 1f; this.colorAlpha = 0f; } public ParticleTextureSheet getType() { return ParticleTextureSheet.PARTICLE_SHEET_TRANSLUCENT; } @Override public void buildGeometry(VertexConsumer vertexConsumer, Camera camera, float tickDelta) { Vec3d vec3d = camera.getPos(); float f = (float) (MathHelper.lerp(tickDelta, this.prevPosX, this.x) - vec3d.getX()); float g = (float) (MathHelper.lerp(tickDelta, this.prevPosY, this.y) - vec3d.getY()); float h = (float) (MathHelper.lerp(tickDelta, this.prevPosZ, this.z) - vec3d.getZ()); Quaternion quaternion2; if (this.angle == 0.0F) { quaternion2 = camera.getRotation(); } else { quaternion2 = new Quaternion(camera.getRotation()); float i = MathHelper.lerp(tickDelta, this.prevAngle, this.angle); quaternion2.hamiltonProduct(Vec3f.POSITIVE_Z.getRadialQuaternion(i)); } Vec3f Vec3f = new Vec3f(-1.0F, -1.0F, 0.0F); Vec3f.rotate(quaternion2); Vec3f[] Vec3fs = new Vec3f[]{new Vec3f(-1.0F, -1.0F, 0.0F), new Vec3f(-1.0F, 1.0F, 0.0F), new Vec3f(1.0F, 1.0F, 0.0F), new Vec3f(1.0F, -1.0F, 0.0F)}; float j = this.getSize(tickDelta); for (int k = 0; k < 4; ++k) { Vec3f Vec3f2 = Vec3fs[k]; Vec3f2.rotate(quaternion2); Vec3f2.scale(j); Vec3f2.add(f, g, h); } float minU = this.getMinU(); float maxU = this.getMaxU(); float minV = this.getMinV(); float maxV = this.getMaxV(); int l = 15728880; float a = Math.min(1f, Math.max(0f, this.colorAlpha)); // colored layer vertexConsumer.vertex(Vec3fs[0].getX(), Vec3fs[0].getY(), Vec3fs[0].getZ()).texture(maxU, minV + (maxV - minV) / 2.0F).color(this.colorRed, this.colorGreen, this.colorBlue, a).light(l).next(); vertexConsumer.vertex(Vec3fs[1].getX(), Vec3fs[1].getY(), Vec3fs[1].getZ()).texture(maxU, minV).color(this.colorRed, this.colorGreen, this.colorBlue, a).light(l).next(); vertexConsumer.vertex(Vec3fs[2].getX(), Vec3fs[2].getY(), Vec3fs[2].getZ()).texture(minU, minV).color(this.colorRed, this.colorGreen, this.colorBlue, a).light(l).next(); vertexConsumer.vertex(Vec3fs[3].getX(), Vec3fs[3].getY(), Vec3fs[3].getZ()).texture(minU, minV + (maxV - minV) / 2.0F).color(this.colorRed, this.colorGreen, this.colorBlue, a).light(l).next(); // white center vertexConsumer.vertex(Vec3fs[0].getX(), Vec3fs[0].getY(), Vec3fs[0].getZ()).texture(maxU, maxV).color(1f, 1f, 1f, (a * Config.getFireflyWhiteAlpha()) / 100f).light(l).next(); vertexConsumer.vertex(Vec3fs[1].getX(), Vec3fs[1].getY(), Vec3fs[1].getZ()).texture(maxU, minV + (maxV - minV) / 2.0F).color(1f, 1f, 1f, (a * Config.getFireflyWhiteAlpha()) / 100f).light(l).next(); vertexConsumer.vertex(Vec3fs[2].getX(), Vec3fs[2].getY(), Vec3fs[2].getZ()).texture(minU, minV + (maxV - minV) / 2.0F).color(1f, 1f, 1f, (a * Config.getFireflyWhiteAlpha()) / 100f).light(l).next(); vertexConsumer.vertex(Vec3fs[3].getX(), Vec3fs[3].getY(), Vec3fs[3].getZ()).texture(minU, maxV).color(1f, 1f, 1f, (a * Config.getFireflyWhiteAlpha()) / 100f).light(l).next(); } public void tick() { this.prevPosX = this.x; this.prevPosY = this.y; this.prevPosZ = this.z; // fade if old enough if (this.age++ >= this.maxAge) { nextAlphaGoal = -BLINK_STEP; if (colorAlpha < 0f) { this.markDead(); } } // blinking if (colorAlpha > nextAlphaGoal - BLINK_STEP && colorAlpha < nextAlphaGoal + BLINK_STEP) { nextAlphaGoal = new Random().nextFloat(); } else { if (nextAlphaGoal > colorAlpha) { colorAlpha += BLINK_STEP; } else if (nextAlphaGoal < colorAlpha) { colorAlpha -= BLINK_STEP; } } this.targetChangeCooldown -= (new Vec3d(x, y, z).squaredDistanceTo(prevPosX, prevPosY, prevPosZ) < 0.0125) ? 10 : 1; if ((this.world.getTime() % 20 == 0) && ((xTarget == 0 && yTarget == 0 && zTarget == 0) || new Vec3d(x, y, z).squaredDistanceTo(xTarget, yTarget, zTarget) < 9 || targetChangeCooldown <= 0)) { selectBlockTarget(); } Vec3d targetVector = new Vec3d(this.xTarget - this.x, this.yTarget - this.y, this.zTarget - this.z); double length = targetVector.length(); targetVector = targetVector.multiply(0.001 / length); if (!this.world.getBlockState(new BlockPos(this.x, this.y - 0.1, this.z)).getFluidState().isIn(FluidTags.WATER)) { velocityX = (0.9) * velocityX + (0.1) * targetVector.x; velocityY = 0.05; velocityZ = (0.9) * velocityZ + (0.1) * targetVector.z; } else { velocityX = (0.9) * velocityX + (0.1) * targetVector.x; velocityY = (0.9) * velocityY + (0.1) * targetVector.y; velocityZ = (0.9) * velocityZ + (0.1) * targetVector.z; } if (!new BlockPos(x, y, z).equals(this.getTargetPosition())) { this.move(velocityX, velocityY, velocityZ); } } private void selectBlockTarget() { // Behaviour double groundLevel = 0; for (int i = 0; i < 20; i++) { BlockState checkedBlock = this.world.getBlockState(new BlockPos(this.x, this.y - i, this.z)); if (checkedBlock.getFluidState().isIn(FluidTags.WATER)) { groundLevel = this.y - i; } if (groundLevel != 0) break; } this.xTarget = this.x + random.nextGaussian() * 10; this.yTarget = Math.max(this.y + random.nextGaussian() * 2, groundLevel); this.zTarget = this.z + random.nextGaussian() * 10; BlockPos targetPos = new BlockPos(this.xTarget, this.yTarget, this.zTarget); if (this.world.getBlockState(targetPos).isFullCube(world, targetPos) && this.world.getBlockState(targetPos).isSolidBlock(world, targetPos)) { this.yTarget += 1; } targetChangeCooldown = random.nextInt() % 100; } public BlockPos getTargetPosition() { return new BlockPos(this.xTarget, this.yTarget + 0.5, this.zTarget); } @Environment(EnvType.CLIENT) public static class DefaultFactory implements ParticleFactory { private final SpriteProvider spriteProvider; public DefaultFactory(SpriteProvider spriteProvider) { this.spriteProvider = spriteProvider; } public Particle createParticle(DefaultParticleType defaultParticleType, ClientWorld clientWorld, double d, double e, double f, double g, double h, double i) { return new PlanktonParticle(clientWorld, d, e, f, g, h, i, this.spriteProvider); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/PoltergeistParticle.java ================================================ package ladysnake.illuminations.client.particle; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.block.Blocks; import net.minecraft.client.MinecraftClient; import net.minecraft.client.particle.Particle; import net.minecraft.client.particle.ParticleFactory; import net.minecraft.client.particle.ParticleTextureSheet; import net.minecraft.client.particle.SpriteProvider; import net.minecraft.client.render.Camera; import net.minecraft.client.render.OverlayTexture; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.render.VertexConsumerProvider; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.world.ClientWorld; import net.minecraft.entity.Entity; import net.minecraft.particle.BlockStateParticleEffect; import net.minecraft.particle.DefaultParticleType; import net.minecraft.particle.ParticleTypes; import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvents; import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3f; import org.jetbrains.annotations.Nullable; import java.util.List; public class PoltergeistParticle extends WillOWispParticle { protected PoltergeistParticle(ClientWorld world, double x, double y, double z, Identifier texture, float red, float green, float blue, float redEvolution, float greenEvolution, float blueEvolution) { super(world, x, y, z, texture, red, green, blue, redEvolution, greenEvolution, blueEvolution); } @Override public ParticleTextureSheet getType() { return ParticleTextureSheet.CUSTOM; } @Override public void buildGeometry(VertexConsumer vertexConsumer, Camera camera, float tickDelta) { Vec3d vec3d = camera.getPos(); float f = (float) (MathHelper.lerp(tickDelta, this.prevPosX, this.x) - vec3d.getX()); float g = (float) (MathHelper.lerp(tickDelta, this.prevPosY, this.y) - vec3d.getY()); float h = (float) (MathHelper.lerp(tickDelta, this.prevPosZ, this.z) - vec3d.getZ()); MatrixStack matrixStack = new MatrixStack(); matrixStack.translate(f, g, h); matrixStack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(MathHelper.lerp(g, this.prevYaw, this.yaw) - 180)); matrixStack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(MathHelper.lerp(g, this.prevPitch, this.pitch))); matrixStack.scale(0.5F, -0.5F, 0.5F); matrixStack.translate(0, -1, 0); VertexConsumerProvider.Immediate immediate = MinecraftClient.getInstance().getBufferBuilders().getEntityVertexConsumers(); VertexConsumer vertexConsumer2 = immediate.getBuffer(this.layer); if (colorAlpha > 0) { this.model.render(matrixStack, vertexConsumer2, 15728880, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 0.5f); } immediate.draw(); } @Override public void tick() { if (this.prevPosX == this.x && this.prevPosY == this.y && this.prevPosZ == this.z) { this.selectBlockTarget(); } if (this.age < 5) { for (int i = 0; i < 25; i++) { this.world.addParticle(new WispTrailParticleEffect(this.colorRed, this.colorGreen, this.colorBlue, this.redEvolution, this.greenEvolution, this.blueEvolution), this.x + random.nextGaussian() / 15, this.y + random.nextGaussian() / 15, this.z + random.nextGaussian() / 15, 0, 0, 0); } } this.prevPosX = this.x; this.prevPosY = this.y; this.prevPosZ = this.z; if (this.age++ >= this.maxAge) { for (int i = 0; i < 25; i++) { this.world.addParticle(new WispTrailParticleEffect(this.colorRed, this.colorGreen, this.colorBlue, this.redEvolution, this.greenEvolution, this.blueEvolution), this.x + random.nextGaussian() / 15, this.y + random.nextGaussian() / 15, this.z + random.nextGaussian() / 15, 0, 0, 0); this.world.addParticle(new BlockStateParticleEffect(ParticleTypes.BLOCK, Blocks.SKELETON_SKULL.getDefaultState()), this.x + random.nextGaussian() / 10, this.y + random.nextGaussian() / 10, this.z + random.nextGaussian() / 10, random.nextGaussian() / 20, random.nextGaussian() / 20, random.nextGaussian() / 20); } this.world.playSound(new BlockPos(this.x, this.y, this.z), SoundEvents.ENTITY_VEX_DEATH, SoundCategory.AMBIENT, 1.0f, 0.8f, true); this.world.playSound(new BlockPos(this.x, this.y, this.z), SoundEvents.ENTITY_SKELETON_DEATH, SoundCategory.AMBIENT, 1.0f, 1.0f, true); this.markDead(); } this.targetChangeCooldown -= (new Vec3d(x, y, z).squaredDistanceTo(prevPosX, prevPosY, prevPosZ) < 0.0125) ? 10 : 1; if ((this.world.getTime() % 100 == 0) && ((xTarget == 0 && yTarget == 0 && zTarget == 0) || new Vec3d(x, y, z).squaredDistanceTo(xTarget, yTarget, zTarget) < 9 || targetChangeCooldown <= 0)) { selectBlockTarget(); } Vec3d targetVector = new Vec3d(this.xTarget - this.x, this.yTarget - this.y, this.zTarget - this.z); double length = targetVector.length(); targetVector = targetVector.multiply(speedModifier / length); velocityX = (0.9) * velocityX + (0.1) * targetVector.x; velocityY = (0.9) * velocityY + (0.1) * targetVector.y; velocityZ = (0.9) * velocityZ + (0.1) * targetVector.z; this.prevYaw = this.yaw; this.prevPitch = this.pitch; Vec3d vec3d = new Vec3d(velocityX, velocityY, velocityZ); float f = (float) Math.sqrt(vec3d.x * vec3d.x + vec3d.z * vec3d.z); this.yaw = (float) (MathHelper.atan2(vec3d.x, vec3d.z) * 57.2957763671875D); this.pitch = (float) (MathHelper.atan2(vec3d.y, f) * 57.2957763671875D); this.world.addParticle(new WispTrailParticleEffect(this.colorRed, this.colorGreen, this.colorBlue, this.redEvolution, this.greenEvolution, this.blueEvolution), this.x + random.nextGaussian() / 15, this.y + random.nextGaussian() / 15, this.z + random.nextGaussian() / 15, 0, 0, 0); if (!new BlockPos(x, y, z).equals(this.getTargetPosition())) { this.move(velocityX, velocityY, velocityZ); } if (random.nextInt(20) == 0) { this.world.playSound(new BlockPos(this.x, this.y, this.z), SoundEvents.ENTITY_VEX_AMBIENT, SoundCategory.AMBIENT, 1.0f, 0.8f, true); } BlockPos pos = new BlockPos(this.x, this.y, this.z); if (!this.world.getBlockState(pos).isAir()) { if (timeInSolid > -1) { timeInSolid += 1; } } else { timeInSolid = 0; } if (timeInSolid > 25) { this.markDead(); } } @Override public void move(double dx, double dy, double dz) { double d = dx; double e = dy; if (this.collidesWithWorld && (dx != 0.0D || dy != 0.0D || dz != 0.0D)) { Vec3d vec3d = Entity.adjustMovementForCollisions(null, new Vec3d(dx, dy, dz), this.getBoundingBox(), this.world, List.of()); dx = vec3d.x; dy = vec3d.y; dz = vec3d.z; } if (dx != 0.0D || dy != 0.0D || dz != 0.0D) { this.setBoundingBox(this.getBoundingBox().offset(dx, dy, dz)); this.repositionFromBoundingBox(); } this.onGround = dy != dy && e < 0.0D; if (d != dx) { this.velocityX = 0.0D; } if (dz != dz) { this.velocityZ = 0.0D; } } public BlockPos getTargetPosition() { return new BlockPos(this.xTarget, this.yTarget + 0.5, this.zTarget); } private void selectBlockTarget() { // Behaviour this.xTarget = this.x + random.nextGaussian() * 10; this.yTarget = this.y + random.nextGaussian() * 10; this.zTarget = this.z + random.nextGaussian() * 10; BlockPos targetPos = new BlockPos(this.xTarget, this.yTarget, this.zTarget); if (this.world.getBlockState(targetPos).isFullCube(world, targetPos)) { targetChangeCooldown = 0; return; } speedModifier = 0.1f + Math.max(0, random.nextFloat() - 0.1f); targetChangeCooldown = random.nextInt() % (int) (100 / this.speedModifier); } @Environment(EnvType.CLIENT) public static class DefaultFactory implements ParticleFactory { private final Identifier texture; private final float red; private final float green; private final float blue; private final float redEvolution; private final float greenEvolution; private final float blueEvolution; public DefaultFactory(SpriteProvider spriteProvider, Identifier texture, float red, float green, float blue, float redEvolution, float greenEvolution, float blueEvolution) { this.texture = texture; this.red = red; this.green = green; this.blue = blue; this.redEvolution = redEvolution; this.greenEvolution = greenEvolution; this.blueEvolution = blueEvolution; } @Nullable @Override public Particle createParticle(DefaultParticleType parameters, ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ) { return new PoltergeistParticle(world, x, y, z, this.texture, this.red, this.green, this.blue, this.redEvolution, this.greenEvolution, this.blueEvolution); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/PrismarineCrystalParticle.java ================================================ package ladysnake.illuminations.client.particle; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.particle.*; import net.minecraft.client.render.Camera; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.world.ClientWorld; import net.minecraft.particle.DefaultParticleType; import net.minecraft.tag.FluidTags; import net.minecraft.util.math.*; import java.util.Random; import java.util.concurrent.ThreadLocalRandom; public class PrismarineCrystalParticle extends SpriteBillboardParticle { private static final Random RANDOM = new Random(); protected final float rotationFactor; private final int variant = RANDOM.nextInt(3); private final SpriteProvider spriteProvider; private final float groundOffset; public PrismarineCrystalParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) { super(world, x, y, z, velocityX, velocityY, velocityZ); this.spriteProvider = spriteProvider; this.scale *= 1f + RANDOM.nextFloat(); this.maxAge = ThreadLocalRandom.current().nextInt(400, 1201); // live between 20 seconds and one minute this.collidesWithWorld = true; this.setSprite(spriteProvider.getSprite(variant, 2)); if (velocityY == 0f && velocityX == 0f && velocityZ == 0f) { this.colorAlpha = 0f; } this.velocityX = random.nextFloat() * 0.01d; this.velocityY = -random.nextFloat() * 0.01d; this.velocityZ = random.nextFloat() * 0.01d; this.groundOffset = RANDOM.nextFloat() / 100f + 0.001f; this.rotationFactor = ((float) Math.random() - 0.5F) * 0.01F; this.angle = random.nextFloat() * 360f; } @Override public void buildGeometry(VertexConsumer vertexConsumer, Camera camera, float tickDelta) { Vec3d vec3d = camera.getPos(); float f = (float) (MathHelper.lerp(tickDelta, this.prevPosX, this.x) - vec3d.getX()); float g = (float) (MathHelper.lerp(tickDelta, this.prevPosY, this.y) - vec3d.getY()); float h = (float) (MathHelper.lerp(tickDelta, this.prevPosZ, this.z) - vec3d.getZ()); Quaternion quaternion2; if (this.angle == 0.0F) { quaternion2 = camera.getRotation(); } else { quaternion2 = new Quaternion(camera.getRotation()); float i = MathHelper.lerp(tickDelta, this.prevAngle, this.angle); quaternion2.hamiltonProduct(Vec3f.POSITIVE_Z.getDegreesQuaternion(i)); } Vec3f Vec3f = new Vec3f(-1.0F, -1.0F, 0.0F); Vec3f.rotate(quaternion2); Vec3f[] Vec3fs = new Vec3f[]{new Vec3f(-1.0F, -1.0F, 0.0F), new Vec3f(-1.0F, 1.0F, 0.0F), new Vec3f(1.0F, 1.0F, 0.0F), new Vec3f(1.0F, -1.0F, 0.0F)}; float j = this.getSize(tickDelta); for (int k = 0; k < 4; ++k) { Vec3f Vec3f2 = Vec3fs[k]; if (this.onGround) { Vec3f2.rotate(new Quaternion(90f, 0f, quaternion2.getZ(), true)); } else { Vec3f2.rotate(quaternion2); } Vec3f2.scale(j); Vec3f2.add(f, g + this.groundOffset, h); } float minU = this.getMinU(); float maxU = this.getMaxU(); float minV = this.getMinV(); float maxV = this.getMaxV(); int l = 15728880; vertexConsumer.vertex(Vec3fs[0].getX(), Vec3fs[0].getY(), Vec3fs[0].getZ()).texture(maxU, maxV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); vertexConsumer.vertex(Vec3fs[1].getX(), Vec3fs[1].getY(), Vec3fs[1].getZ()).texture(maxU, minV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); vertexConsumer.vertex(Vec3fs[2].getX(), Vec3fs[2].getY(), Vec3fs[2].getZ()).texture(minU, minV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); vertexConsumer.vertex(Vec3fs[3].getX(), Vec3fs[3].getY(), Vec3fs[3].getZ()).texture(minU, maxV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); } public ParticleTextureSheet getType() { return ParticleTextureSheet.PARTICLE_SHEET_TRANSLUCENT; } public void tick() { if (this.age++ < this.maxAge) { this.colorAlpha = Math.min(1f, this.colorAlpha + 0.01f); } this.prevPosX = this.x; this.prevPosY = this.y; this.prevPosZ = this.z; if (this.world.getFluidState(new BlockPos(this.x, this.y, this.z)).isIn(FluidTags.WATER)) { this.move(this.velocityX, this.velocityY, this.velocityZ); } else { this.move(this.velocityX, this.velocityY, this.velocityZ); this.velocityX *= 0.9D; this.velocityY = -0.9D; this.velocityZ *= 0.9D; } if (this.age >= this.maxAge) { this.colorAlpha = Math.max(0f, this.colorAlpha - 0.01f); if (this.colorAlpha <= 0f) { this.markDead(); } } this.colorRed = 0.8f + (float) Math.sin(this.age / 100f) * 0.2f; // this.colorBlue = 0.9f + (float) Math.cos(this.age/100f) * 0.1f; this.prevAngle = this.angle; if (this.onGround) { this.velocityX = 0; this.velocityY = 0; this.velocityZ = 0; } if (this.velocityY != 0) { this.angle += Math.PI * Math.sin(rotationFactor * this.age) / 2; } } @Environment(EnvType.CLIENT) public static class DefaultFactory implements ParticleFactory { private final SpriteProvider spriteProvider; public DefaultFactory(SpriteProvider spriteProvider) { this.spriteProvider = spriteProvider; } public Particle createParticle(DefaultParticleType defaultParticleType, ClientWorld clientWorld, double d, double e, double f, double g, double h, double i) { return new PrismarineCrystalParticle(clientWorld, d, e, f, g, h, i, this.spriteProvider); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/PumpkinSpiritParticle.java ================================================ package ladysnake.illuminations.client.particle; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.block.Blocks; import net.minecraft.client.particle.Particle; import net.minecraft.client.particle.ParticleFactory; import net.minecraft.client.particle.SpriteProvider; import net.minecraft.client.world.ClientWorld; import net.minecraft.entity.Entity; import net.minecraft.particle.BlockStateParticleEffect; import net.minecraft.particle.DefaultParticleType; import net.minecraft.particle.ParticleTypes; import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvents; import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; import org.jetbrains.annotations.Nullable; import java.util.List; public class PumpkinSpiritParticle extends WillOWispParticle { protected PumpkinSpiritParticle(ClientWorld world, double x, double y, double z, Identifier texture, float red, float green, float blue, float redEvolution, float greenEvolution, float blueEvolution) { super(world, x, y, z, texture, red, green, blue, redEvolution, greenEvolution, blueEvolution); } @Override public void tick() { if (this.prevPosX == this.x && this.prevPosY == this.y && this.prevPosZ == this.z) { this.selectBlockTarget(); } if (this.age < 5) { for (int i = 0; i < 25; i++) { this.world.addParticle(new WispTrailParticleEffect(this.colorRed, this.colorGreen, this.colorBlue, this.redEvolution, this.greenEvolution, this.blueEvolution), this.x + random.nextGaussian() / 15, this.y + random.nextGaussian() / 15, this.z + random.nextGaussian() / 15, 0, 0, 0); } } this.prevPosX = this.x; this.prevPosY = this.y; this.prevPosZ = this.z; if (this.age++ >= this.maxAge) { for (int i = 0; i < 25; i++) { this.world.addParticle(new WispTrailParticleEffect(this.colorRed, this.colorGreen, this.colorBlue, this.redEvolution, this.greenEvolution, this.blueEvolution), this.x + random.nextGaussian() / 15, this.y + random.nextGaussian() / 15, this.z + random.nextGaussian() / 15, 0, 0, 0); this.world.addParticle(new BlockStateParticleEffect(ParticleTypes.BLOCK, Blocks.JACK_O_LANTERN.getDefaultState()), this.x + random.nextGaussian() / 10, this.y + random.nextGaussian() / 10, this.z + random.nextGaussian() / 10, random.nextGaussian() / 20, random.nextGaussian() / 20, random.nextGaussian() / 20); } this.world.playSound(new BlockPos(this.x, this.y, this.z), SoundEvents.ENTITY_VEX_DEATH, SoundCategory.AMBIENT, 1.0f, 0.8f, true); this.world.playSound(new BlockPos(this.x, this.y, this.z), SoundEvents.BLOCK_WOOD_BREAK, SoundCategory.AMBIENT, 1.0f, 1.0f, true); this.markDead(); } this.targetChangeCooldown -= (new Vec3d(x, y, z).squaredDistanceTo(prevPosX, prevPosY, prevPosZ) < 0.0125) ? 10 : 1; if ((this.world.getTime() % 100 == 0) && ((xTarget == 0 && yTarget == 0 && zTarget == 0) || new Vec3d(x, y, z).squaredDistanceTo(xTarget, yTarget, zTarget) < 9 || targetChangeCooldown <= 0)) { selectBlockTarget(); } Vec3d targetVector = new Vec3d(this.xTarget - this.x, this.yTarget - this.y, this.zTarget - this.z); double length = targetVector.length(); targetVector = targetVector.multiply(speedModifier / length); velocityX = (0.9) * velocityX + (0.1) * targetVector.x; velocityY = (0.9) * velocityY + (0.1) * targetVector.y; velocityZ = (0.9) * velocityZ + (0.1) * targetVector.z; this.prevYaw = this.yaw; this.prevPitch = this.pitch; Vec3d vec3d = new Vec3d(velocityX, velocityY, velocityZ); float f = (float) Math.sqrt(vec3d.x * vec3d.x + vec3d.z * vec3d.z); this.yaw = (float) (MathHelper.atan2(vec3d.x, vec3d.z) * 57.2957763671875D); this.pitch = (float) (MathHelper.atan2(vec3d.y, f) * 57.2957763671875D); for (int i = 0; i < 10 * this.speedModifier; i++) { this.world.addParticle(new WispTrailParticleEffect(this.colorRed, this.colorGreen, this.colorBlue, this.redEvolution, this.greenEvolution, this.blueEvolution), this.x + random.nextGaussian() / 15, this.y + random.nextGaussian() / 15, this.z + random.nextGaussian() / 15, 0, 0, 0); } if (!new BlockPos(x, y, z).equals(this.getTargetPosition())) { this.move(velocityX, velocityY, velocityZ); } if (random.nextInt(100) == 0) { this.world.playSound(new BlockPos(this.x, this.y, this.z), SoundEvents.ENTITY_VEX_AMBIENT, SoundCategory.AMBIENT, 1.0f, 0.8f, true); } BlockPos pos = new BlockPos(this.x, this.y, this.z); if (!this.world.getBlockState(pos).isAir()) { if (timeInSolid > -1) { timeInSolid += 1; } } else { timeInSolid = 0; } if (timeInSolid > 25) { this.markDead(); } } @Override public void move(double dx, double dy, double dz) { double d = dx; double e = dy; if (this.collidesWithWorld && (dx != 0.0D || dy != 0.0D || dz != 0.0D)) { Vec3d vec3d = Entity.adjustMovementForCollisions(null, new Vec3d(dx, dy, dz), this.getBoundingBox(), this.world, List.of()); dx = vec3d.x; dy = vec3d.y; dz = vec3d.z; } if (dx != 0.0D || dy != 0.0D || dz != 0.0D) { this.setBoundingBox(this.getBoundingBox().offset(dx, dy, dz)); this.repositionFromBoundingBox(); } this.onGround = dy != dy && e < 0.0D; if (d != dx) { this.velocityX = 0.0D; } if (dz != dz) { this.velocityZ = 0.0D; } } public BlockPos getTargetPosition() { return new BlockPos(this.xTarget, this.yTarget + 0.5, this.zTarget); } private void selectBlockTarget() { // Behaviour this.xTarget = this.x + random.nextGaussian() * 10; this.yTarget = this.y + random.nextGaussian() * 10; this.zTarget = this.z + random.nextGaussian() * 10; BlockPos targetPos = new BlockPos(this.xTarget, this.yTarget, this.zTarget); if (this.world.getBlockState(targetPos).isFullCube(world, targetPos)) { targetChangeCooldown = 0; return; } speedModifier = 0.1f + Math.max(0, random.nextFloat() - 0.1f); targetChangeCooldown = random.nextInt() % (int) (100 / this.speedModifier); } @Environment(EnvType.CLIENT) public static class DefaultFactory implements ParticleFactory { private final Identifier texture; private final float red; private final float green; private final float blue; private final float redEvolution; private final float greenEvolution; private final float blueEvolution; public DefaultFactory(SpriteProvider spriteProvider, Identifier texture, float red, float green, float blue, float redEvolution, float greenEvolution, float blueEvolution) { this.texture = texture; this.red = red; this.green = green; this.blue = blue; this.redEvolution = redEvolution; this.greenEvolution = greenEvolution; this.blueEvolution = blueEvolution; } @Nullable @Override public Particle createParticle(DefaultParticleType parameters, ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ) { return new PumpkinSpiritParticle(world, x, y, z, this.texture, this.red, this.green, this.blue, this.redEvolution, this.greenEvolution, this.blueEvolution); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/WillOWispParticle.java ================================================ package ladysnake.illuminations.client.particle; import ladysnake.illuminations.client.render.GlowyRenderLayer; import ladysnake.illuminations.client.render.entity.model.pet.WillOWispModel; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.block.Blocks; import net.minecraft.client.MinecraftClient; import net.minecraft.client.model.Model; import net.minecraft.client.particle.Particle; import net.minecraft.client.particle.ParticleFactory; import net.minecraft.client.particle.ParticleTextureSheet; import net.minecraft.client.particle.SpriteProvider; import net.minecraft.client.render.*; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.world.ClientWorld; import net.minecraft.entity.Entity; import net.minecraft.particle.BlockStateParticleEffect; import net.minecraft.particle.DefaultParticleType; import net.minecraft.particle.ParticleTypes; import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvents; import net.minecraft.tag.BlockTags; import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3f; import org.jetbrains.annotations.Nullable; import java.util.List; public class WillOWispParticle extends Particle { public final Identifier texture; protected final float redEvolution; protected final float greenEvolution; protected final float blueEvolution; final Model model; final RenderLayer layer; public float yaw; public float pitch; public float prevYaw; public float prevPitch; public float speedModifier; protected double xTarget; protected double yTarget; protected double zTarget; protected int targetChangeCooldown = 0; protected int timeInSolid = -1; protected WillOWispParticle(ClientWorld world, double x, double y, double z, Identifier texture, float red, float green, float blue, float redEvolution, float greenEvolution, float blueEvolution) { super(world, x, y, z); this.texture = texture; this.model = new WillOWispModel(MinecraftClient.getInstance().getEntityModelLoader().getModelPart(WillOWispModel.MODEL_LAYER)); this.layer = RenderLayer.getEntityTranslucent(texture); this.gravityStrength = 0.0F; this.maxAge = 600 + random.nextInt(600); speedModifier = 0.1f + Math.max(0, random.nextFloat() - 0.1f); this.colorRed = red; this.colorGreen = green; this.colorBlue = blue; this.redEvolution = redEvolution; this.blueEvolution = blueEvolution; this.greenEvolution = greenEvolution; } @Override public ParticleTextureSheet getType() { return ParticleTextureSheet.CUSTOM; } @Override public void buildGeometry(VertexConsumer vertexConsumer, Camera camera, float tickDelta) { Vec3d vec3d = camera.getPos(); float f = (float) (MathHelper.lerp(tickDelta, this.prevPosX, this.x) - vec3d.getX()); float g = (float) (MathHelper.lerp(tickDelta, this.prevPosY, this.y) - vec3d.getY()); float h = (float) (MathHelper.lerp(tickDelta, this.prevPosZ, this.z) - vec3d.getZ()); MatrixStack matrixStack = new MatrixStack(); matrixStack.translate(f, g, h); matrixStack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(MathHelper.lerp(g, this.prevYaw, this.yaw) - 180)); matrixStack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(MathHelper.lerp(g, this.prevPitch, this.pitch))); matrixStack.scale(0.5F, -0.5F, 0.5F); matrixStack.translate(0, -1, 0); VertexConsumerProvider.Immediate immediate = MinecraftClient.getInstance().getBufferBuilders().getEntityVertexConsumers(); VertexConsumer vertexConsumer2 = immediate.getBuffer(GlowyRenderLayer.get(texture)); if (colorAlpha > 0) { this.model.render(matrixStack, vertexConsumer2, 15728880, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0f); } immediate.draw(); } @Override public void tick() { if (this.prevPosX == this.x && this.prevPosY == this.y && this.prevPosZ == this.z) { this.selectBlockTarget(); } this.prevPosX = this.x; this.prevPosY = this.y; this.prevPosZ = this.z; if (this.age++ >= this.maxAge) { for (int i = 0; i < 25; i++) { this.world.addParticle(new WispTrailParticleEffect(this.colorRed, this.colorGreen, this.colorBlue, this.redEvolution, this.greenEvolution, this.blueEvolution), this.x + random.nextGaussian() / 15, this.y + random.nextGaussian() / 15, this.z + random.nextGaussian() / 15, 0, 0, 0); this.world.addParticle(new BlockStateParticleEffect(ParticleTypes.BLOCK, Blocks.SOUL_SAND.getDefaultState()), this.x + random.nextGaussian() / 10, this.y + random.nextGaussian() / 10, this.z + random.nextGaussian() / 10, random.nextGaussian() / 20, random.nextGaussian() / 20, random.nextGaussian() / 20); } this.world.playSound(new BlockPos(this.x, this.y, this.z), SoundEvents.PARTICLE_SOUL_ESCAPE, SoundCategory.AMBIENT, 1.0f, 1.5f, true); this.world.playSound(new BlockPos(this.x, this.y, this.z), SoundEvents.BLOCK_SOUL_SAND_BREAK, SoundCategory.AMBIENT, 1.0f, 1.0f, true); this.markDead(); } this.targetChangeCooldown -= (new Vec3d(x, y, z).squaredDistanceTo(prevPosX, prevPosY, prevPosZ) < 0.0125) ? 10 : 1; if ((this.world.getTime() % 20 == 0) && ((xTarget == 0 && yTarget == 0 && zTarget == 0) || new Vec3d(x, y, z).squaredDistanceTo(xTarget, yTarget, zTarget) < 9 || targetChangeCooldown <= 0)) { selectBlockTarget(); } Vec3d targetVector = new Vec3d(this.xTarget - this.x, this.yTarget - this.y, this.zTarget - this.z); double length = targetVector.length(); targetVector = targetVector.multiply(speedModifier / length); velocityX = (0.9) * velocityX + (0.1) * targetVector.x; velocityY = (0.9) * velocityY + (0.1) * targetVector.y; velocityZ = (0.9) * velocityZ + (0.1) * targetVector.z; this.prevYaw = this.yaw; this.prevPitch = this.pitch; Vec3d vec3d = new Vec3d(velocityX, velocityY, velocityZ); float f = (float) Math.sqrt(vec3d.x * vec3d.x + vec3d.z * vec3d.z); this.yaw = (float) (MathHelper.atan2(vec3d.x, vec3d.z) * 57.2957763671875D); this.pitch = (float) (MathHelper.atan2(vec3d.y, f) * 57.2957763671875D); for (int i = 0; i < 10 * this.speedModifier; i++) { if (this.world.getBlockState(new BlockPos(this.x, this.y, this.z)).isIn(BlockTags.SOUL_FIRE_BASE_BLOCKS)) { this.world.addParticle(ParticleTypes.SOUL, this.x + random.nextGaussian() / 10, this.y + random.nextGaussian() / 10, this.z + random.nextGaussian() / 10, random.nextGaussian() / 20, random.nextGaussian() / 20, random.nextGaussian() / 20); } else { this.world.addParticle(new WispTrailParticleEffect(this.colorRed, this.colorGreen, this.colorBlue, this.redEvolution, this.greenEvolution, this.blueEvolution), this.x + random.nextGaussian() / 15, this.y + random.nextGaussian() / 15, this.z + random.nextGaussian() / 15, 0, 0, 0); } } if (!new BlockPos(x, y, z).equals(this.getTargetPosition())) { this.move(velocityX, velocityY, velocityZ); } if (random.nextInt(20) == 0) { this.world.playSound(new BlockPos(this.x, this.y, this.z), SoundEvents.PARTICLE_SOUL_ESCAPE, SoundCategory.AMBIENT, 1.0f, 1.5f, true); } BlockPos pos = new BlockPos(this.x, this.y, this.z); if (!this.world.getBlockState(pos).isAir()) { if (timeInSolid > -1) { timeInSolid += 1; } } else { timeInSolid = 0; } if (timeInSolid > 25) { this.markDead(); } } @Override public void move(double dx, double dy, double dz) { double d = dx; double e = dy; if (this.collidesWithWorld && !this.world.getBlockState(new BlockPos(this.x + dx, this.y + dy, this.z + dz)).isIn(BlockTags.SOUL_FIRE_BASE_BLOCKS) && (dx != 0.0D || dy != 0.0D || dz != 0.0D)) { Vec3d vec3d = Entity.adjustMovementForCollisions(null, new Vec3d(dx, dy, dz), this.getBoundingBox(), this.world, List.of()); dx = vec3d.x; dy = vec3d.y; dz = vec3d.z; } if (dx != 0.0D || dy != 0.0D || dz != 0.0D) { this.setBoundingBox(this.getBoundingBox().offset(dx, dy, dz)); this.repositionFromBoundingBox(); } this.onGround = dy != dy && e < 0.0D && !this.world.getBlockState(new BlockPos(this.x, this.y, this.z)).isIn(BlockTags.SOUL_FIRE_BASE_BLOCKS); if (d != dx) { this.velocityX = 0.0D; } if (dz != dz) { this.velocityZ = 0.0D; } } public BlockPos getTargetPosition() { return new BlockPos(this.xTarget, this.yTarget + 0.5, this.zTarget); } private void selectBlockTarget() { // Behaviour this.xTarget = this.x + random.nextGaussian() * 10; this.yTarget = this.y + random.nextGaussian() * 10; this.zTarget = this.z + random.nextGaussian() * 10; BlockPos targetPos = new BlockPos(this.xTarget, this.yTarget, this.zTarget); if (this.world.getBlockState(targetPos).isFullCube(world, targetPos) && !this.world.getBlockState(targetPos).isIn(BlockTags.SOUL_FIRE_BASE_BLOCKS)) { targetChangeCooldown = 0; return; } speedModifier = 0.1f + Math.max(0, random.nextFloat() - 0.1f); targetChangeCooldown = random.nextInt() % (int) (100 / this.speedModifier); } @Environment(EnvType.CLIENT) public static class DefaultFactory implements ParticleFactory { private final Identifier texture; private final float red; private final float green; private final float blue; private final float redEvolution; private final float greenEvolution; private final float blueEvolution; public DefaultFactory(SpriteProvider spriteProvider, Identifier texture, float red, float green, float blue, float redEvolution, float greenEvolution, float blueEvolution) { this.texture = texture; this.red = red; this.green = green; this.blue = blue; this.redEvolution = redEvolution; this.greenEvolution = greenEvolution; this.blueEvolution = blueEvolution; } @Nullable @Override public Particle createParticle(DefaultParticleType parameters, ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ) { return new WillOWispParticle(world, x, y, z, this.texture, this.red, this.green, this.blue, this.redEvolution, this.greenEvolution, this.blueEvolution); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/WispTrailParticle.java ================================================ package ladysnake.illuminations.client.particle; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.particle.*; import net.minecraft.client.render.Camera; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.world.ClientWorld; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Quaternion; import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3f; import java.util.Random; public class WispTrailParticle extends SpriteBillboardParticle { private final SpriteProvider spriteProvider; private final float redEvolution; private final float greenEvolution; private final float blueEvolution; private WispTrailParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, WispTrailParticleEffect wispTrailParticleEffect, SpriteProvider spriteProvider) { super(world, x, y, z, velocityX, velocityY, velocityZ); this.spriteProvider = spriteProvider; this.colorRed = wispTrailParticleEffect.getRed(); this.colorGreen = wispTrailParticleEffect.getGreen(); this.colorBlue = wispTrailParticleEffect.getBlue(); this.redEvolution = wispTrailParticleEffect.getRedEvolution(); this.greenEvolution = wispTrailParticleEffect.getGreenEvolution(); this.blueEvolution = wispTrailParticleEffect.getBlueEvolution(); this.maxAge = 10 + this.random.nextInt(10); this.scale *= 0.25f + new Random().nextFloat() * 0.50f; this.setSpriteForAge(spriteProvider); this.velocityY = 0.1; } public ParticleTextureSheet getType() { return ParticleTextureSheet.PARTICLE_SHEET_TRANSLUCENT; } @Override public void tick() { this.prevPosX = this.x; this.prevPosY = this.y; this.prevPosZ = this.z; // fade and die if (this.age++ >= this.maxAge) { colorAlpha -= 0.05f; } if (colorAlpha < 0f || this.scale <= 0f) { this.markDead(); } // float redEv = -0.03f; // float greenEv = 0.0f; // float blueEv = -0.01f; // colorRed = MathHelper.clamp(colorRed+redEv, 0, 1); // colorGreen = MathHelper.clamp(colorGreen+greenEv, 0, 1); // colorBlue = MathHelper.clamp(colorBlue+blueEv, 0, 1); colorRed = MathHelper.clamp(colorRed + redEvolution, 0, 1); colorGreen = MathHelper.clamp(colorGreen + greenEvolution, 0, 1); colorBlue = MathHelper.clamp(colorBlue + blueEvolution, 0, 1); this.velocityY -= 0.001; this.velocityX = 0; this.velocityZ = 0; this.scale = Math.max(0, this.scale - 0.005f); this.move(velocityX, velocityY, velocityZ); } @Override public void buildGeometry(VertexConsumer vertexConsumer, Camera camera, float tickDelta) { Vec3d vec3d = camera.getPos(); float f = (float) (MathHelper.lerp(tickDelta, this.prevPosX, this.x) - vec3d.getX()); float g = (float) (MathHelper.lerp(tickDelta, this.prevPosY, this.y) - vec3d.getY()); float h = (float) (MathHelper.lerp(tickDelta, this.prevPosZ, this.z) - vec3d.getZ()); Quaternion quaternion2; if (this.angle == 0.0F) { quaternion2 = camera.getRotation(); } else { quaternion2 = new Quaternion(camera.getRotation()); float i = MathHelper.lerp(tickDelta, this.prevAngle, this.angle); quaternion2.hamiltonProduct(Vec3f.POSITIVE_Z.getRadialQuaternion(i)); } Vec3f Vec3f = new Vec3f(-1.0F, -1.0F, 0.0F); Vec3f.rotate(quaternion2); Vec3f[] Vec3fs = new Vec3f[]{new Vec3f(-1.0F, -1.0F, 0.0F), new Vec3f(-1.0F, 1.0F, 0.0F), new Vec3f(1.0F, 1.0F, 0.0F), new Vec3f(1.0F, -1.0F, 0.0F)}; float j = this.getSize(tickDelta); for (int k = 0; k < 4; ++k) { Vec3f Vec3f2 = Vec3fs[k]; Vec3f2.rotate(quaternion2); Vec3f2.scale(j); Vec3f2.add(f, g, h); } float minU = this.getMinU(); float maxU = this.getMaxU(); float minV = this.getMinV(); float maxV = this.getMaxV(); int l = 15728880; vertexConsumer.vertex(Vec3fs[0].getX(), Vec3fs[0].getY(), Vec3fs[0].getZ()).texture(maxU, maxV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); vertexConsumer.vertex(Vec3fs[1].getX(), Vec3fs[1].getY(), Vec3fs[1].getZ()).texture(maxU, minV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); vertexConsumer.vertex(Vec3fs[2].getX(), Vec3fs[2].getY(), Vec3fs[2].getZ()).texture(minU, minV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); vertexConsumer.vertex(Vec3fs[3].getX(), Vec3fs[3].getY(), Vec3fs[3].getZ()).texture(minU, maxV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); } @Environment(EnvType.CLIENT) public static class Factory implements ParticleFactory { private final SpriteProvider spriteProvider; public Factory(SpriteProvider spriteProvider) { this.spriteProvider = spriteProvider; } public Particle createParticle(WispTrailParticleEffect wispTrailParticleEffect, ClientWorld clientWorld, double x, double y, double z, double velocityX, double velocityY, double velocityZ) { return new WispTrailParticle(clientWorld, x, y, z, velocityX, velocityY, velocityZ, wispTrailParticleEffect, this.spriteProvider); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/WispTrailParticleEffect.java ================================================ package ladysnake.illuminations.client.particle; import com.mojang.brigadier.StringReader; import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import ladysnake.illuminations.client.Illuminations; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.network.PacketByteBuf; import net.minecraft.particle.ParticleEffect; import net.minecraft.particle.ParticleType; import net.minecraft.util.registry.Registry; import java.util.Locale; public class WispTrailParticleEffect implements ParticleEffect { public static final Codec CODEC = RecordCodecBuilder.create((instance) -> { return instance.group(Codec.FLOAT.fieldOf("r").forGetter((wispTrailParticleEffect) -> { return wispTrailParticleEffect.red; }), Codec.FLOAT.fieldOf("g").forGetter((wispTrailParticleEffect) -> { return wispTrailParticleEffect.green; }), Codec.FLOAT.fieldOf("b").forGetter((wispTrailParticleEffect) -> { return wispTrailParticleEffect.blue; }), Codec.FLOAT.fieldOf("re").forGetter((wispTrailParticleEffect) -> { return wispTrailParticleEffect.redEvolution; }), Codec.FLOAT.fieldOf("ge").forGetter((wispTrailParticleEffect) -> { return wispTrailParticleEffect.greenEvolution; }), Codec.FLOAT.fieldOf("be").forGetter((wispTrailParticleEffect) -> { return wispTrailParticleEffect.blueEvolution; })).apply(instance, WispTrailParticleEffect::new); }); public static final ParticleEffect.Factory PARAMETERS_FACTORY = new ParticleEffect.Factory() { public WispTrailParticleEffect read(ParticleType particleType, StringReader stringReader) throws CommandSyntaxException { stringReader.expect(' '); float r = (float) stringReader.readDouble(); stringReader.expect(' '); float g = (float) stringReader.readDouble(); stringReader.expect(' '); float b = (float) stringReader.readDouble(); stringReader.expect(' '); float re = (float) stringReader.readDouble(); stringReader.expect(' '); float ge = (float) stringReader.readDouble(); stringReader.expect(' '); float be = (float) stringReader.readDouble(); return new WispTrailParticleEffect(r, g, b, re, ge, be); } public WispTrailParticleEffect read(ParticleType particleType, PacketByteBuf packetByteBuf) { return new WispTrailParticleEffect(packetByteBuf.readFloat(), packetByteBuf.readFloat(), packetByteBuf.readFloat(), packetByteBuf.readFloat(), packetByteBuf.readFloat(), packetByteBuf.readFloat()); } }; private final float red; private final float green; private final float blue; private final float redEvolution; private final float greenEvolution; private final float blueEvolution; public WispTrailParticleEffect(float red, float green, float blue, float redEvolution, float greenEvolution, float blueEvolution) { this.red = red; this.green = green; this.blue = blue; this.redEvolution = redEvolution; this.greenEvolution = greenEvolution; this.blueEvolution = blueEvolution; } public void write(PacketByteBuf buf) { buf.writeFloat(this.red); buf.writeFloat(this.green); buf.writeFloat(this.blue); buf.writeFloat(this.redEvolution); buf.writeFloat(this.greenEvolution); buf.writeFloat(this.blueEvolution); } public String asString() { return String.format(Locale.ROOT, "%s %.2f %.2f %.2f %.2f %.2f %.2f", Registry.PARTICLE_TYPE.getId(this.getType()), this.red, this.green, this.blue, this.redEvolution, this.greenEvolution, this.blueEvolution); } public ParticleType getType() { return Illuminations.WISP_TRAIL; } @Environment(EnvType.CLIENT) public float getRed() { return this.red; } @Environment(EnvType.CLIENT) public float getGreen() { return this.green; } @Environment(EnvType.CLIENT) public float getBlue() { return this.blue; } @Environment(EnvType.CLIENT) public float getRedEvolution() { return redEvolution; } @Environment(EnvType.CLIENT) public float getGreenEvolution() { return greenEvolution; } @Environment(EnvType.CLIENT) public float getBlueEvolution() { return blueEvolution; } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/aura/AutumnLeavesParticle.java ================================================ package ladysnake.illuminations.client.particle.aura; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.particle.*; import net.minecraft.client.render.Camera; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.world.ClientWorld; import net.minecraft.particle.DefaultParticleType; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Quaternion; import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3f; import java.util.Random; public class AutumnLeavesParticle extends SpriteBillboardParticle { private static final Random RANDOM = new Random(); private final int variant = RANDOM.nextInt(6); private final SpriteProvider spriteProvider; private final double beginX; private final double beginY; private final double beginZ; public AutumnLeavesParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) { super(world, x, y + 0.05F, z, velocityX, velocityY, velocityZ); this.spriteProvider = spriteProvider; this.scale *= 0.5F + RANDOM.nextFloat() / 2.0F; this.maxAge = 30 + RANDOM.nextInt(60); this.collidesWithWorld = true; this.setSprite(spriteProvider.getSprite(this.variant % 3, 2)); this.colorGreen = RANDOM.nextFloat() / 2f + 0.5f; this.colorBlue = 0f; beginX = x; beginY = y; beginZ = z; this.angle = random.nextFloat() * 360f; } @Override public void buildGeometry(VertexConsumer vertexConsumer, Camera camera, float tickDelta) { Vec3d vec3d = camera.getPos(); float f = (float) (MathHelper.lerp(tickDelta, this.prevPosX, this.x) - vec3d.getX()); float g = (float) (MathHelper.lerp(tickDelta, this.prevPosY, this.y) - vec3d.getY()); float h = (float) (MathHelper.lerp(tickDelta, this.prevPosZ, this.z) - vec3d.getZ()); Quaternion quaternion2; if (this.angle == 0.0F) { quaternion2 = camera.getRotation(); } else { quaternion2 = new Quaternion(camera.getRotation()); float i = this.angle; quaternion2.hamiltonProduct(Vec3f.POSITIVE_Z.getDegreesQuaternion(i)); } Vec3f Vec3f = new Vec3f(-1.0F, -1.0F, 0.0F); Vec3f.rotate(quaternion2); Vec3f[] Vec3fs = new Vec3f[]{new Vec3f(-1.0F, -1.0F, 0.0F), new Vec3f(-1.0F, 1.0F, 0.0F), new Vec3f(1.0F, 1.0F, 0.0F), new Vec3f(1.0F, -1.0F, 0.0F)}; float j = this.getSize(tickDelta); for (int k = 0; k < 4; ++k) { Vec3f Vec3f2 = Vec3fs[k]; Vec3f2.rotate(quaternion2); Vec3f2.scale(j); Vec3f2.add(f, g, h); } float minU = this.getMinU(); float maxU = this.getMaxU(); float minV = this.getMinV(); float maxV = this.getMaxV(); int l = 15728880; vertexConsumer.vertex(Vec3fs[0].getX(), Vec3fs[0].getY(), Vec3fs[0].getZ()).texture(maxU, maxV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); vertexConsumer.vertex(Vec3fs[1].getX(), Vec3fs[1].getY(), Vec3fs[1].getZ()).texture(maxU, minV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); vertexConsumer.vertex(Vec3fs[2].getX(), Vec3fs[2].getY(), Vec3fs[2].getZ()).texture(minU, minV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); vertexConsumer.vertex(Vec3fs[3].getX(), Vec3fs[3].getY(), Vec3fs[3].getZ()).texture(minU, maxV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); } public ParticleTextureSheet getType() { return ParticleTextureSheet.PARTICLE_SHEET_TRANSLUCENT; } public void tick() { if (this.age++ < this.maxAge - 10) { this.colorAlpha = Math.min(1f, this.colorAlpha + 0.1f); } this.prevPosX = this.x; this.prevPosY = this.y; this.prevPosZ = this.z; this.colorGreen *= 0.98; float fraction = this.age / (float) this.maxAge; this.x = MathHelper.cos(this.age / 15.0F + 1.0471973f * (variant + 0.5f)) * fraction + beginX; this.z = MathHelper.sin(this.age / 15.0F + 1.0471973f * (variant + 0.5f)) * fraction + beginZ; this.y = this.age / 34.0F + beginY + 0.05F; if (this.age >= this.maxAge - 10) { this.colorAlpha = Math.max(0f, this.colorAlpha - 0.1f); if (this.colorAlpha <= 0f) { this.markDead(); } } } @Environment(EnvType.CLIENT) public static class DefaultFactory implements ParticleFactory { private final SpriteProvider spriteProvider; public DefaultFactory(SpriteProvider spriteProvider) { this.spriteProvider = spriteProvider; } public Particle createParticle(DefaultParticleType defaultParticleType, ClientWorld clientWorld, double d, double e, double f, double g, double h, double i) { return new AutumnLeavesParticle(clientWorld, d, e, f, g, h, i, this.spriteProvider); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/aura/ChorusAuraParticle.java ================================================ package ladysnake.illuminations.client.particle.aura; import ladysnake.illuminations.client.particle.ChorusPetalParticle; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.particle.Particle; import net.minecraft.client.particle.ParticleFactory; import net.minecraft.client.particle.SpriteProvider; import net.minecraft.client.world.ClientWorld; import net.minecraft.particle.DefaultParticleType; import net.minecraft.tag.FluidTags; import net.minecraft.util.math.BlockPos; public class ChorusAuraParticle extends ChorusPetalParticle { public ChorusAuraParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) { super(world, x, y, z, velocityX, velocityY, velocityZ, spriteProvider); this.velocityY = -0.01 - random.nextFloat() / 10; this.velocityX = random.nextGaussian() / 50; this.velocityZ = random.nextGaussian() / 50; this.setPos(this.x + TwilightFireflyParticle.getWanderingDistance(this.random), this.y + random.nextFloat() * 2d, this.z + TwilightFireflyParticle.getWanderingDistance(this.random)); } public void tick() { if (this.age++ < this.maxAge) { this.colorAlpha = Math.min(1f, this.colorAlpha + 0.1f); } this.prevPosX = this.x; this.prevPosY = this.y; this.prevPosZ = this.z; this.move(this.velocityX, this.velocityY, this.velocityZ); this.velocityX *= 0.99D; this.velocityY *= 0.99D; this.velocityZ *= 0.99D; this.colorRed *= 0.99; this.colorGreen *= 0.98; if (this.age >= this.maxAge) { // this.colorRed *= 0.9; // this.colorGreen *= 0.8; this.colorAlpha = Math.max(0f, this.colorAlpha - 0.1f); if (this.colorAlpha <= 0f) { this.markDead(); } } this.prevAngle = this.angle; if (this.onGround || this.world.getFluidState(new BlockPos(this.x, this.y, this.z)).isIn(FluidTags.WATER)) { this.velocityX = 0; this.velocityY = 0; this.velocityZ = 0; } if (this.velocityY != 0) { this.angle += Math.PI * Math.sin(rotationFactor * this.age) / 2; } } @Environment(EnvType.CLIENT) public static class DefaultFactory implements ParticleFactory { private final SpriteProvider spriteProvider; public DefaultFactory(SpriteProvider spriteProvider) { this.spriteProvider = spriteProvider; } public Particle createParticle(DefaultParticleType defaultParticleType, ClientWorld clientWorld, double d, double e, double f, double g, double h, double i) { return new ChorusAuraParticle(clientWorld, d, e, f, g, h, i, this.spriteProvider); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/aura/ConfettiParticle.java ================================================ package ladysnake.illuminations.client.particle.aura; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.particle.*; import net.minecraft.client.render.Camera; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.world.ClientWorld; import net.minecraft.particle.DefaultParticleType; import net.minecraft.tag.FluidTags; import net.minecraft.util.math.*; import java.util.Random; import java.util.concurrent.ThreadLocalRandom; public class ConfettiParticle extends SpriteBillboardParticle { private static final Random RANDOM = new Random(); private final double rotationXmod; private final double rotationYmod; private final double rotationZmod; private final float groundOffset; private float rotationX; private float rotationY; private float rotationZ; public ConfettiParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) { super(world, x, y, z, velocityX, velocityY, velocityZ); this.scale *= 0.1f + new Random().nextFloat() * 0.5f; this.collidesWithWorld = true; this.setSpriteForAge(spriteProvider); this.colorAlpha = 1f; this.maxAge = ThreadLocalRandom.current().nextInt(400, 420); // live approx 20s this.colorRed = RANDOM.nextFloat(); this.colorBlue = RANDOM.nextFloat(); this.colorGreen = RANDOM.nextFloat(); this.gravityStrength = 0.1f; this.velocityX = velocityX * 10f; this.velocityY = velocityY * 10f; this.velocityZ = velocityZ * 10f; this.velocityMultiplier = 0.5f; this.rotationX = RANDOM.nextFloat() * 360f; this.rotationY = RANDOM.nextFloat() * 360f; this.rotationZ = RANDOM.nextFloat() * 360f; this.rotationXmod = RANDOM.nextFloat() * 10f * (random.nextBoolean() ? -1 : 1); this.rotationYmod = RANDOM.nextFloat() * 10f * (random.nextBoolean() ? -1 : 1); this.rotationZmod = RANDOM.nextFloat() * 10f * (random.nextBoolean() ? -1 : 1); this.groundOffset = RANDOM.nextFloat() / 100f + 0.001f; this.setPos(this.x + TwilightFireflyParticle.getWanderingDistance(this.random), this.y + random.nextFloat() * 2d, this.z + TwilightFireflyParticle.getWanderingDistance(this.random)); } public ParticleTextureSheet getType() { return ParticleTextureSheet.PARTICLE_SHEET_TRANSLUCENT; } @Override public void buildGeometry(VertexConsumer vertexConsumer, Camera camera, float tickDelta) { Vec3d vec3d = camera.getPos(); float f = (float) (MathHelper.lerp(tickDelta, this.prevPosX, this.x) - vec3d.getX()); float g = (float) (MathHelper.lerp(tickDelta, this.prevPosY, this.y) - vec3d.getY()); float h = (float) (MathHelper.lerp(tickDelta, this.prevPosZ, this.z) - vec3d.getZ()); Vec3f[] Vec3fs = new Vec3f[]{new Vec3f(-1.0F, -1.0F, 0.0F), new Vec3f(-1.0F, 1.0F, 0.0F), new Vec3f(1.0F, 1.0F, 0.0F), new Vec3f(1.0F, -1.0F, 0.0F)}; float j = this.getSize(tickDelta); if (!this.onGround) { rotationX += rotationXmod; rotationY += rotationYmod; rotationZ += rotationZmod; for (int k = 0; k < 4; ++k) { Vec3f Vec3f2 = Vec3fs[k]; Vec3f2.rotate(new Quaternion(rotationX, rotationY, rotationZ, true)); Vec3f2.scale(j); Vec3f2.add(f, g, h); } } else { rotationX = 90f; rotationY = 0; for (int k = 0; k < 4; ++k) { Vec3f Vec3f2 = Vec3fs[k]; Vec3f2.rotate(new Quaternion(rotationX, rotationY, rotationZ, true)); Vec3f2.scale(j); Vec3f2.add(f, g + this.groundOffset, h); } } float minU = this.getMinU(); float maxU = this.getMaxU(); float minV = this.getMinV(); float maxV = this.getMaxV(); int l = 15728880; vertexConsumer.vertex(Vec3fs[0].getX(), Vec3fs[0].getY(), Vec3fs[0].getZ()).texture(maxU, maxV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); vertexConsumer.vertex(Vec3fs[1].getX(), Vec3fs[1].getY(), Vec3fs[1].getZ()).texture(maxU, minV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); vertexConsumer.vertex(Vec3fs[2].getX(), Vec3fs[2].getY(), Vec3fs[2].getZ()).texture(minU, minV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); vertexConsumer.vertex(Vec3fs[3].getX(), Vec3fs[3].getY(), Vec3fs[3].getZ()).texture(minU, maxV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); vertexConsumer.vertex(Vec3fs[0].getX(), Vec3fs[0].getY(), Vec3fs[0].getZ()).texture(maxU, maxV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); vertexConsumer.vertex(Vec3fs[3].getX(), Vec3fs[3].getY(), Vec3fs[3].getZ()).texture(maxU, minV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); vertexConsumer.vertex(Vec3fs[2].getX(), Vec3fs[2].getY(), Vec3fs[2].getZ()).texture(minU, minV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); vertexConsumer.vertex(Vec3fs[1].getX(), Vec3fs[1].getY(), Vec3fs[1].getZ()).texture(minU, maxV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); } public void tick() { this.prevPosX = this.x; this.prevPosY = this.y; this.prevPosZ = this.z; if (this.age++ >= this.maxAge) { this.markDead(); } else { if (this.world.getFluidState(new BlockPos(this.x, this.y + 0.2, this.z)).isEmpty()) { if (this.world.getFluidState(new BlockPos(this.x, this.y - 0.01, this.z)).isIn(FluidTags.WATER)) { this.onGround = true; this.velocityY = 0; } else { this.velocityY -= 0.04D * (double) this.gravityStrength; this.move(this.velocityX, this.velocityY, this.velocityZ); if (this.field_28787 && this.y == this.prevPosY) { this.velocityX *= 1.1D; this.velocityZ *= 1.1D; } this.velocityX *= this.velocityMultiplier; this.velocityY *= this.velocityMultiplier; this.velocityZ *= this.velocityMultiplier; this.velocityMultiplier = Math.min(0.98f, this.velocityMultiplier * 1.15f); if (this.onGround) { this.velocityX *= 0.699999988079071D; this.velocityZ *= 0.699999988079071D; } } } else { this.markDead(); } } } @Environment(EnvType.CLIENT) public static class DefaultFactory implements ParticleFactory { private final SpriteProvider spriteProvider; public DefaultFactory(SpriteProvider spriteProvider) { this.spriteProvider = spriteProvider; } public Particle createParticle(DefaultParticleType defaultParticleType, ClientWorld clientWorld, double d, double e, double f, double g, double h, double i) { return new ConfettiParticle(clientWorld, d, e, f, g, h, i, this.spriteProvider); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/aura/GhostlyAuraParticle.java ================================================ package ladysnake.illuminations.client.particle.aura; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.particle.*; import net.minecraft.client.render.Camera; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.world.ClientWorld; import net.minecraft.entity.ai.TargetPredicate; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.particle.DefaultParticleType; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Quaternion; import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3f; import java.util.Random; public class GhostlyAuraParticle extends SpriteBillboardParticle { private static final Random RANDOM = new Random(); private final float MAXIMUM_ALPHA = 0.02f; private final PlayerEntity owner; private final int variant = RANDOM.nextInt(4); private final SpriteProvider spriteProvider; protected float alpha = 0f; protected float offsetX = RANDOM.nextFloat() * .7f - 0.35f; protected float offsetZ = RANDOM.nextFloat() * .7f - 0.35f; protected float offsetY = 0; public GhostlyAuraParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) { super(world, x, y, z, velocityX, velocityY, velocityZ); this.spriteProvider = spriteProvider; this.owner = world.getClosestPlayer((TargetPredicate.createNonAttackable()).setBaseMaxDistance(1D), this.x, this.y, this.z); this.scale *= 1f + RANDOM.nextFloat(); this.maxAge = RANDOM.nextInt(5) + 8; this.collidesWithWorld = true; this.setSprite(spriteProvider.getSprite(variant, 3)); if (this.owner != null) { this.colorRed = 1f; this.colorGreen = 1f; this.colorBlue = 1f; this.setPos(owner.getX() + offsetX, owner.getY() + offsetY, owner.getZ() + offsetZ); } else { this.markDead(); } } @Override public void buildGeometry(VertexConsumer vertexConsumer, Camera camera, float tickDelta) { Vec3d vec3d = camera.getPos(); float f = (float) (MathHelper.lerp(tickDelta, this.prevPosX, this.x) - vec3d.getX()); float g = (float) (MathHelper.lerp(tickDelta, this.prevPosY, this.y) - vec3d.getY()); float h = (float) (MathHelper.lerp(tickDelta, this.prevPosZ, this.z) - vec3d.getZ()); Quaternion quaternion2; if (this.angle == 0.0F) { quaternion2 = camera.getRotation(); } else { quaternion2 = new Quaternion(camera.getRotation()); float i = MathHelper.lerp(tickDelta, this.prevAngle, this.angle); quaternion2.hamiltonProduct(Vec3f.POSITIVE_Z.getRadialQuaternion(i)); } Vec3f Vec3f = new Vec3f(-1.0F, -1.0F, 0.0F); Vec3f.rotate(quaternion2); Vec3f[] Vec3fs = new Vec3f[]{new Vec3f(-1.0F, -1.0F, 0.0F), new Vec3f(-1.0F, 1.0F, 0.0F), new Vec3f(1.0F, 1.0F, 0.0F), new Vec3f(1.0F, -1.0F, 0.0F)}; float j = this.getSize(tickDelta); for (int k = 0; k < 4; ++k) { Vec3f Vec3f2 = Vec3fs[k]; float tmpY = Vec3f2.getY(); Vec3f2.set(Vec3f2.getX(), 0, Vec3f2.getZ()); // rotate so it always faces the player Vec3f2.rotate(quaternion2); Vec3f2.set(Vec3f2.getX() / (1 + offsetY * offsetY), tmpY * offsetY, Vec3f2.getZ() / (1 + offsetY * offsetY)); Vec3f2.scale(j); Vec3f2.add(f, g, h); } float minU = this.getMinU(); float maxU = this.getMaxU(); float minV = this.getMinV(); float maxV = this.getMaxV(); int l = 15728880; // float a = MathHelper.clamp(this.alpha, 0.0F, MAXIMUM_ALPHA); vertexConsumer.vertex(Vec3fs[0].getX(), Vec3fs[0].getY(), Vec3fs[0].getZ()).texture(maxU, maxV).color(colorRed, colorGreen, colorBlue, alpha).light(l).next(); vertexConsumer.vertex(Vec3fs[1].getX(), Vec3fs[1].getY(), Vec3fs[1].getZ()).texture(maxU, minV).color(colorRed, colorGreen, colorBlue, alpha).light(l).next(); vertexConsumer.vertex(Vec3fs[2].getX(), Vec3fs[2].getY(), Vec3fs[2].getZ()).texture(minU, minV).color(colorRed, colorGreen, colorBlue, alpha).light(l).next(); vertexConsumer.vertex(Vec3fs[3].getX(), Vec3fs[3].getY(), Vec3fs[3].getZ()).texture(minU, maxV).color(colorRed, colorGreen, colorBlue, alpha).light(l).next(); } public ParticleTextureSheet getType() { return ParticleTextureSheet.PARTICLE_SHEET_TRANSLUCENT; } public void tick() { if (owner != null) { this.prevPosX = this.x; this.prevPosY = this.y; this.prevPosZ = this.z; if (age++ < maxAge) { alpha += 0.01; } else { alpha -= 0.01; if (alpha <= 0) { this.markDead(); } } offsetY += 0.1; this.setPos(owner.getX() + offsetX, owner.getY() + offsetY, owner.getZ() + offsetZ); } else { this.markDead(); } } @Environment(EnvType.CLIENT) public static class DefaultFactory implements ParticleFactory { private final SpriteProvider spriteProvider; public DefaultFactory(SpriteProvider spriteProvider) { this.spriteProvider = spriteProvider; } public Particle createParticle(DefaultParticleType defaultParticleType, ClientWorld clientWorld, double d, double e, double f, double g, double h, double i) { return new GhostlyAuraParticle(clientWorld, d, e, f, g, h, i, this.spriteProvider); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/aura/GoldenrodAuraParticle.java ================================================ package ladysnake.illuminations.client.particle.aura; import ladysnake.illuminations.client.particle.ChorusPetalParticle; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.particle.Particle; import net.minecraft.client.particle.ParticleFactory; import net.minecraft.client.particle.SpriteProvider; import net.minecraft.client.world.ClientWorld; import net.minecraft.particle.DefaultParticleType; import net.minecraft.tag.FluidTags; import net.minecraft.util.math.BlockPos; public class GoldenrodAuraParticle extends ChorusPetalParticle { private int elevation = 0; public GoldenrodAuraParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) { super(world, x, y, z, velocityX, velocityY, velocityZ, spriteProvider); this.velocityY = 0; this.velocityX = 0; this.velocityZ = 0; this.scale = 0.9f; this.setPos(this.x + get_rando(), this.y + random.nextFloat() + 0.5 * 1.5d, this.z + get_rando()); } public double get_rando() { double rando = (random.nextFloat() - 0.5) * 1.4; if (rando < 0.3 && rando > 0) { rando += 0.3; } else if (rando < 0 && rando > -0.3) { rando -= 0.3; } return rando; } public void tick() { this.age += 2; if (this.age < this.maxAge) { this.colorAlpha = Math.min(1f, this.colorAlpha + 0.1f); } this.scale *= 0.9; this.prevPosX = this.x; this.prevPosY = this.y; this.prevPosZ = this.z; this.move(this.velocityX, this.velocityY, this.velocityZ); if (this.velocityY == 0) { int temp_rand = random.nextInt(15); if (temp_rand == 0 && elevation < 1) { this.velocityY = 0.3; elevation += 1; } else if (temp_rand == 1 && elevation > -2) { this.velocityY = -0.3; elevation -= 1; } } else if (Math.abs(this.velocityY) > 0.08) { this.velocityY *= 0.5; } else { this.velocityY = 0; } this.colorBlue *= 0.96; this.colorGreen *= 0.98; if (this.age >= this.maxAge) { this.colorAlpha = Math.max(0f, this.colorAlpha - 0.1f); if (this.colorAlpha <= 0f) { this.markDead(); } } this.prevAngle = this.angle; if (this.onGround || this.world.getFluidState(new BlockPos(this.x, this.y, this.z)).isIn(FluidTags.WATER)) { this.velocityX = 0; this.velocityY = 0; this.velocityZ = 0; } this.angle = 0; } @Environment(EnvType.CLIENT) public static class DefaultFactory implements ParticleFactory { private final SpriteProvider spriteProvider; public DefaultFactory(SpriteProvider spriteProvider) { this.spriteProvider = spriteProvider; } public Particle createParticle(DefaultParticleType defaultParticleType, ClientWorld clientWorld, double d, double e, double f, double g, double h, double i) { return new GoldenrodAuraParticle(clientWorld, d, e, f, g, h, i, this.spriteProvider); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/aura/PrismarineAuraParticle.java ================================================ package ladysnake.illuminations.client.particle.aura; import ladysnake.illuminations.client.particle.PrismarineCrystalParticle; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.particle.Particle; import net.minecraft.client.particle.ParticleFactory; import net.minecraft.client.particle.SpriteProvider; import net.minecraft.client.world.ClientWorld; import net.minecraft.particle.DefaultParticleType; import java.util.concurrent.ThreadLocalRandom; public class PrismarineAuraParticle extends PrismarineCrystalParticle { public PrismarineAuraParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) { super(world, x, y, z, velocityX, velocityY, velocityZ, spriteProvider); this.setPos(this.x + TwilightFireflyParticle.getWanderingDistance(this.random), this.y + random.nextFloat() * 2d, this.z + TwilightFireflyParticle.getWanderingDistance(this.random)); this.maxAge = ThreadLocalRandom.current().nextInt(100, 400); } public void tick() { if (this.age++ < this.maxAge) { this.colorAlpha = Math.min(1f, this.colorAlpha + 0.1f); } this.prevPosX = this.x; this.prevPosY = this.y; this.prevPosZ = this.z; this.move(this.velocityX, this.velocityY, this.velocityZ); if (this.age >= this.maxAge) { this.colorAlpha = Math.max(0f, this.colorAlpha - 0.1f); if (this.colorAlpha <= 0f) { this.markDead(); } } this.colorRed = 0.8f + (float) Math.sin(this.age / 10f) * 0.2f; // this.colorBlue = 0.9f + (float) Math.cos(this.age/10f) * 0.1f; this.prevAngle = this.angle; if (this.onGround) { this.velocityX = 0; this.velocityY = 0; this.velocityZ = 0; } if (this.velocityY != 0) { this.angle += Math.PI * Math.sin(rotationFactor * this.age) / 2; } } @Environment(EnvType.CLIENT) public static class DefaultFactory implements ParticleFactory { private final SpriteProvider spriteProvider; public DefaultFactory(SpriteProvider spriteProvider) { this.spriteProvider = spriteProvider; } public Particle createParticle(DefaultParticleType defaultParticleType, ClientWorld clientWorld, double d, double e, double f, double g, double h, double i) { return new PrismarineAuraParticle(clientWorld, d, e, f, g, h, i, this.spriteProvider); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/aura/PrismaticConfettiParticle.java ================================================ package ladysnake.illuminations.client.particle.aura; import ladysnake.illuminations.client.Illuminations; import ladysnake.illuminations.client.data.PlayerCosmeticData; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.particle.Particle; import net.minecraft.client.particle.ParticleFactory; import net.minecraft.client.particle.SpriteProvider; import net.minecraft.client.world.ClientWorld; import net.minecraft.entity.ai.TargetPredicate; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.particle.DefaultParticleType; import java.util.Objects; public class PrismaticConfettiParticle extends ConfettiParticle { public PrismaticConfettiParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) { super(world, x, y, z, velocityX, velocityY, velocityZ, spriteProvider); PlayerEntity owner = world.getClosestPlayer(TargetPredicate.createNonAttackable().setBaseMaxDistance(1D), this.x, this.y, this.z); if (owner != null && owner.getUuid() != null && Illuminations.getCosmeticData(owner) != null) { PlayerCosmeticData data = Objects.requireNonNull(Illuminations.getCosmeticData(owner)); this.colorRed = data.getColorRed() / 255f; this.colorGreen = data.getColorGreen() / 255f; this.colorBlue = data.getColorBlue() / 255f; } else { this.markDead(); } } @Environment(EnvType.CLIENT) public static class DefaultFactory implements ParticleFactory { private final SpriteProvider spriteProvider; public DefaultFactory(SpriteProvider spriteProvider) { this.spriteProvider = spriteProvider; } public Particle createParticle(DefaultParticleType defaultParticleType, ClientWorld clientWorld, double d, double e, double f, double g, double h, double i) { return new PrismaticConfettiParticle(clientWorld, d, e, f, g, h, i, this.spriteProvider); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/aura/SculkTendrilParticle.java ================================================ package ladysnake.illuminations.client.particle.aura; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.particle.*; import net.minecraft.client.render.Camera; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.world.ClientWorld; import net.minecraft.particle.DefaultParticleType; import net.minecraft.util.math.*; import java.util.Random; public class SculkTendrilParticle extends SpriteBillboardParticle { private static final Random RANDOM = new Random(); private final SpriteProvider provider; private boolean wasOnGround = false; public SculkTendrilParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) { super(world, x + (RANDOM.nextFloat() * 2f - 1.0f), y, z + (RANDOM.nextFloat() * 2f - 1.0f), velocityX, velocityY, velocityZ); this.setSprite(spriteProvider.getSprite(0, 1)); provider = spriteProvider; this.maxAge = 100; this.angle = RANDOM.nextFloat() * 180f; this.scale = 0f; this.collidesWithWorld = true; } @Override public void buildGeometry(VertexConsumer vertexConsumer, Camera camera, float tickDelta) { Vec3d vec3d = camera.getPos(); float f = (float) (MathHelper.lerp(tickDelta, this.prevPosX, this.x) - vec3d.getX()); float g = (float) (MathHelper.lerp(tickDelta, this.prevPosY, this.y) - vec3d.getY()); float h = (float) (MathHelper.lerp(tickDelta, this.prevPosZ, this.z) - vec3d.getZ()); Vec3f[] Vec3fs = new Vec3f[]{new Vec3f(-1.0F, -1.0F, 0.0F), new Vec3f(-1.0F, 1.0F, 0.0F), new Vec3f(1.0F, 1.0F, 0.0F), new Vec3f(1.0F, -1.0F, 0.0F)}; float j = this.getSize(tickDelta); for (int k = 0; k < 4; ++k) { Vec3f Vec3f2 = Vec3fs[k]; Vec3f2.rotate(new Quaternion(0f, angle, 0f, true)); Vec3f2.scale(j); Vec3f2.add(f, g, h); } float minU = this.getMinU(); float maxU = this.getMaxU(); float minV = this.getMinV(); float maxV = this.getMaxV(); int l = 15728880; vertexConsumer.vertex(Vec3fs[0].getX(), Vec3fs[0].getY(), Vec3fs[0].getZ()).texture(maxU, maxV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); vertexConsumer.vertex(Vec3fs[1].getX(), Vec3fs[1].getY(), Vec3fs[1].getZ()).texture(maxU, minV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); vertexConsumer.vertex(Vec3fs[2].getX(), Vec3fs[2].getY(), Vec3fs[2].getZ()).texture(minU, minV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); vertexConsumer.vertex(Vec3fs[3].getX(), Vec3fs[3].getY(), Vec3fs[3].getZ()).texture(minU, maxV).color(colorRed, colorGreen, colorBlue, colorAlpha).light(l).next(); } @Override public void tick() { if (!this.onGround) { this.move(0, -1D, 0); wasOnGround = false; return; } if (!wasOnGround) { this.repositionFromBoundingBox(); wasOnGround = true; } if (this.age++ < this.maxAge) { if (this.scale == 0f) { this.y -= 0.4f; } if (this.scale < 0.4f) { this.scale = Math.min(0.4f, this.scale + 0.05f); this.y += 0.05f; } if (this.age == 75) { this.setSprite(provider.getSprite(1, 1)); } } this.setBoundingBox(this.getBoundingBox().expand(0, 1, 0)); this.prevPosX = this.x; this.prevPosY = this.y; this.prevPosZ = this.z; this.prevAngle = this.angle; if (this.age >= this.maxAge) { this.scale = Math.max(0f, this.scale - 0.05f); this.y -= 0.05f; if (this.scale <= 0f) { this.markDead(); } } } @Override protected void repositionFromBoundingBox() { Box box = this.getBoundingBox(); this.x = (box.minX + box.maxX) / 2.0D; this.y = box.minY + 0.4D; this.z = (box.minZ + box.maxZ) / 2.0D; } public ParticleTextureSheet getType() { return ParticleTextureSheet.PARTICLE_SHEET_TRANSLUCENT; } @Environment(EnvType.CLIENT) public static class DefaultFactory implements ParticleFactory { private final SpriteProvider spriteProvider; public DefaultFactory(SpriteProvider spriteProvider) { this.spriteProvider = spriteProvider; } public Particle createParticle(DefaultParticleType defaultParticleType, ClientWorld clientWorld, double d, double e, double f, double g, double h, double i) { return new SculkTendrilParticle(clientWorld, d, e, f, g, h, i, this.spriteProvider); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/aura/ShadowbringerParticle.java ================================================ package ladysnake.illuminations.client.particle.aura; import ladysnake.illuminations.client.particle.ChorusPetalParticle; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.particle.Particle; import net.minecraft.client.particle.ParticleFactory; import net.minecraft.client.particle.SpriteProvider; import net.minecraft.client.world.ClientWorld; import net.minecraft.fluid.Fluids; import net.minecraft.particle.DefaultParticleType; import net.minecraft.util.math.BlockPos; public class ShadowbringerParticle extends ChorusPetalParticle { private final SpriteProvider spriteProvider; private final float randEffect = random.nextFloat() + 0.5F; boolean negateX = random.nextBoolean(), negateZ = random.nextBoolean(); public ShadowbringerParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) { super(world, x, y, z, velocityX, velocityY, velocityZ, spriteProvider); this.maxAge = 40 + random.nextInt(40); this.velocityY = (0.2 + random.nextFloat()) / 10; this.velocityX = negateX ? -random.nextGaussian() / 50 : random.nextGaussian() / 50; this.velocityZ = negateZ ? -random.nextGaussian() / 50 : random.nextGaussian() / 50; this.scale = (float) (scale + (random.nextGaussian() / 12.0)); this.spriteProvider = spriteProvider; this.setSprite(spriteProvider.getSprite(0, 3)); colorAlpha = 0; this.setPos(this.x + TwilightFireflyParticle.getWanderingDistance(this.random), this.y + random.nextFloat() * 1.5, this.z + TwilightFireflyParticle.getWanderingDistance(this.random)); } public void tick() { if (this.age++ < this.maxAge) { this.colorAlpha = Math.min(1f, this.colorAlpha + 0.045f); } this.prevPosX = this.x; this.prevPosY = this.y; this.prevPosZ = this.z; velocityX = velocityX * 0.85 + (negateX ? -(Math.sin(age / (2.0 + randEffect)) / 20.0) : Math.sin(age / 3.0) / 20.0); velocityZ = velocityZ * 0.85 + (negateZ ? -(Math.sin(age / (2.0 + randEffect)) / 20.0) : Math.sin(age / 3.0) / 20.0); this.move(this.velocityX, this.velocityY, this.velocityZ); if (age > 0 && maxAge > 0) { float agePercent = (float) ((float) age / maxAge * 1.5); this.setSprite(spriteProvider.getSprite(Math.min(3, (int) (agePercent * 4)), 3)); } if (this.age >= this.maxAge) { this.colorAlpha = Math.max(0f, this.colorAlpha - 0.015f); if (this.colorAlpha <= 0f) { this.markDead(); } } this.prevAngle = this.angle; if (this.onGround || this.world.getFluidState(new BlockPos(this.x, this.y, this.z)).getFluid() != Fluids.EMPTY) { this.velocityY *= 0.95; } if (this.velocityY != 0) { this.angle += Math.PI * Math.sin(rotationFactor * this.age) / 2; } } @Environment(EnvType.CLIENT) public static class DefaultFactory implements ParticleFactory { private final SpriteProvider spriteProvider; public DefaultFactory(SpriteProvider spriteProvider) { this.spriteProvider = spriteProvider; } public Particle createParticle(DefaultParticleType defaultParticleType, ClientWorld clientWorld, double d, double e, double f, double g, double h, double i) { return new ShadowbringerParticle(clientWorld, d, e, f, g, h, i, this.spriteProvider); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/aura/TwilightFireflyParticle.java ================================================ package ladysnake.illuminations.client.particle.aura; import ladysnake.illuminations.client.Illuminations; import ladysnake.illuminations.client.config.Config; import ladysnake.illuminations.client.particle.FireflyParticle; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.block.BlockState; import net.minecraft.client.particle.Particle; import net.minecraft.client.particle.ParticleFactory; import net.minecraft.client.particle.SpriteProvider; import net.minecraft.client.render.Camera; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.world.ClientWorld; import net.minecraft.entity.ai.TargetPredicate; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.particle.DefaultParticleType; import net.minecraft.util.math.*; import java.util.Optional; import java.util.Random; public class TwilightFireflyParticle extends FireflyParticle { private final PlayerEntity owner; public TwilightFireflyParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) { super(world, x, y, z, velocityX, velocityY, velocityZ, spriteProvider); this.maxAge = 20; this.owner = world.getClosestPlayer(TargetPredicate.createNonAttackable().setBaseMaxDistance(1D), this.x, this.y, this.z); this.maxHeight = 2; Optional.ofNullable(owner).map(Illuminations::getCosmeticData).ifPresentOrElse( data -> { this.colorRed = data.getColorRed() / 255f; this.colorGreen = data.getColorGreen() / 255f; this.colorBlue = data.getColorBlue() / 255f; this.nextAlphaGoal = 1f; }, this::markDead ); this.setPos(this.x + TwilightFireflyParticle.getWanderingDistance(this.random), this.y + random.nextFloat() * 2d, this.z + TwilightFireflyParticle.getWanderingDistance(this.random)); } public static double getWanderingDistance(Random random) { return random.nextGaussian() / 5d; } @Override public void buildGeometry(VertexConsumer vertexConsumer, Camera camera, float tickDelta) { Vec3d vec3d = camera.getPos(); float f = (float) (MathHelper.lerp(tickDelta, this.prevPosX, this.x) - vec3d.getX()); float g = (float) (MathHelper.lerp(tickDelta, this.prevPosY, this.y) - vec3d.getY()); float h = (float) (MathHelper.lerp(tickDelta, this.prevPosZ, this.z) - vec3d.getZ()); Quaternion quaternion2; if (this.angle == 0.0F) { quaternion2 = camera.getRotation(); } else { quaternion2 = new Quaternion(camera.getRotation()); float i = MathHelper.lerp(tickDelta, this.prevAngle, this.angle); quaternion2.hamiltonProduct(Vec3f.POSITIVE_Z.getRadialQuaternion(i)); } Vec3f Vec3f = new Vec3f(-1.0F, -1.0F, 0.0F); Vec3f.rotate(quaternion2); Vec3f[] Vec3fs = new Vec3f[]{new Vec3f(-1.0F, -1.0F, 0.0F), new Vec3f(-1.0F, 1.0F, 0.0F), new Vec3f(1.0F, 1.0F, 0.0F), new Vec3f(1.0F, -1.0F, 0.0F)}; float j = this.getSize(tickDelta); for (int k = 0; k < 4; ++k) { Vec3f Vec3f2 = Vec3fs[k]; Vec3f2.rotate(quaternion2); Vec3f2.scale(j); Vec3f2.add(f, g, h); } float minU = this.getMinU(); float maxU = this.getMaxU(); float minV = this.getMinV(); float maxV = this.getMaxV(); int l = 15728880; float a = Math.min(1f, Math.max(0f, this.colorAlpha)); // colored layer vertexConsumer.vertex(Vec3fs[0].getX(), Vec3fs[0].getY(), Vec3fs[0].getZ()).texture(maxU, minV + (maxV - minV) / 2.0F).color(this.colorRed, this.colorGreen, this.colorBlue, a).light(l).next(); vertexConsumer.vertex(Vec3fs[1].getX(), Vec3fs[1].getY(), Vec3fs[1].getZ()).texture(maxU, minV).color(this.colorRed, this.colorGreen, this.colorBlue, a).light(l).next(); vertexConsumer.vertex(Vec3fs[2].getX(), Vec3fs[2].getY(), Vec3fs[2].getZ()).texture(minU, minV).color(this.colorRed, this.colorGreen, this.colorBlue, a).light(l).next(); vertexConsumer.vertex(Vec3fs[3].getX(), Vec3fs[3].getY(), Vec3fs[3].getZ()).texture(minU, minV + (maxV - minV) / 2.0F).color(this.colorRed, this.colorGreen, this.colorBlue, a).light(l).next(); // white center vertexConsumer.vertex(Vec3fs[0].getX(), Vec3fs[0].getY(), Vec3fs[0].getZ()).texture(maxU, maxV).color(1f, 1f, 1f, (a * Config.getFireflyWhiteAlpha()) / 100f).light(l).next(); vertexConsumer.vertex(Vec3fs[1].getX(), Vec3fs[1].getY(), Vec3fs[1].getZ()).texture(maxU, minV + (maxV - minV) / 2.0F).color(1f, 1f, 1f, (a * Config.getFireflyWhiteAlpha()) / 100f).light(l).next(); vertexConsumer.vertex(Vec3fs[2].getX(), Vec3fs[2].getY(), Vec3fs[2].getZ()).texture(minU, minV + (maxV - minV) / 2.0F).color(1f, 1f, 1f, (a * Config.getFireflyWhiteAlpha()) / 100f).light(l).next(); vertexConsumer.vertex(Vec3fs[3].getX(), Vec3fs[3].getY(), Vec3fs[3].getZ()).texture(minU, maxV).color(1f, 1f, 1f, (a * Config.getFireflyWhiteAlpha()) / 100f).light(l).next(); } @Override public void tick() { if (owner != null) { this.prevPosX = this.x; this.prevPosY = this.y; this.prevPosZ = this.z; // fade and die on daytime or if old enough if (this.age++ >= this.maxAge) { nextAlphaGoal = -BLINK_STEP; if (colorAlpha < 0f) { this.markDead(); } } // blinking if (colorAlpha > nextAlphaGoal - BLINK_STEP && colorAlpha < nextAlphaGoal + BLINK_STEP) { nextAlphaGoal = new Random().nextFloat(); } else { if (nextAlphaGoal > colorAlpha) { colorAlpha = Math.min(colorAlpha + BLINK_STEP, 1f); } else if (nextAlphaGoal < colorAlpha) { colorAlpha = Math.max(colorAlpha - BLINK_STEP, 0f); } } this.targetChangeCooldown -= (new Vec3d(x, y, z).squaredDistanceTo(prevPosX, prevPosY, prevPosZ) < 0.0125) ? 10 : 1; if ((this.world.getTime() % 20 == 0) && ((xTarget == 0 && yTarget == 0 && zTarget == 0) || new Vec3d(x, y, z).squaredDistanceTo(xTarget, yTarget, zTarget) < 9 || targetChangeCooldown <= 0)) { selectBlockTarget(); } Vec3d targetVector = new Vec3d(this.xTarget - this.x, this.yTarget - this.y, this.zTarget - this.z); double length = targetVector.length(); targetVector = targetVector.multiply(0.025 / length); if (!this.world.getBlockState(new BlockPos(this.x, this.y - 0.1, this.z)).getBlock().canMobSpawnInside()) { velocityX = (0.9) * velocityX + (0.1) * targetVector.x; velocityY = 0.05; velocityZ = (0.9) * velocityZ + (0.1) * targetVector.z; } else { velocityX = (0.9) * velocityX + (0.1) * targetVector.x; velocityY = (0.2) * velocityY + (0.1) * targetVector.y; velocityZ = (0.9) * velocityZ + (0.1) * targetVector.z; } if (!new BlockPos(x, y, z).equals(this.getTargetPosition())) { this.move(velocityX, velocityY, velocityZ); } } else { this.markDead(); } } private void selectBlockTarget() { // Behaviour double groundLevel = 0; for (int i = 0; i < 20; i++) { BlockState checkedBlock = this.world.getBlockState(new BlockPos(this.x, this.y - i, this.z)); if (!checkedBlock.getBlock().canMobSpawnInside()) { groundLevel = this.y - i; } if (groundLevel != 0) break; } this.xTarget = owner.getX() + random.nextGaussian(); this.yTarget = Math.min(Math.max(owner.getY() + random.nextGaussian(), groundLevel), groundLevel + maxHeight); this.zTarget = owner.getZ() + random.nextGaussian(); BlockPos targetPos = new BlockPos(this.xTarget, this.yTarget, this.zTarget); if (this.world.getBlockState(targetPos).isFullCube(world, targetPos) && this.world.getBlockState(targetPos).isSolidBlock(world, targetPos)) { this.yTarget += 1; } targetChangeCooldown = random.nextInt() % 100; } @Environment(EnvType.CLIENT) public static class DefaultFactory implements ParticleFactory { private final SpriteProvider spriteProvider; public DefaultFactory(SpriteProvider spriteProvider) { this.spriteProvider = spriteProvider; } public Particle createParticle(DefaultParticleType defaultParticleType, ClientWorld clientWorld, double d, double e, double f, double g, double h, double i) { return new TwilightFireflyParticle(clientWorld, d, e, f, g, h, i, this.spriteProvider); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/pet/JackoParticle.java ================================================ package ladysnake.illuminations.client.particle.pet; import ladysnake.illuminations.client.Illuminations; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.particle.Particle; import net.minecraft.client.particle.ParticleFactory; import net.minecraft.client.particle.SpriteProvider; import net.minecraft.client.render.Camera; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.world.ClientWorld; import net.minecraft.particle.DefaultParticleType; import net.minecraft.util.math.*; public class JackoParticle extends PetParticle { private float glow; public JackoParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) { super(world, x, y, z, velocityX, velocityY, velocityZ, spriteProvider); this.glow = 0; } @Override public void buildGeometry(VertexConsumer vertexConsumer, Camera camera, float tickDelta) { Vec3d vec3d = camera.getPos(); float f = (float) (MathHelper.lerp(tickDelta, this.prevPosX, this.x) - vec3d.getX()); float g = (float) (MathHelper.lerp(tickDelta, this.prevPosY, this.y) - vec3d.getY()); float h = (float) (MathHelper.lerp(tickDelta, this.prevPosZ, this.z) - vec3d.getZ()); Quaternion quaternion2; if (this.angle == 0.0F) { quaternion2 = camera.getRotation(); } else { quaternion2 = new Quaternion(camera.getRotation()); float i = MathHelper.lerp(tickDelta, this.prevAngle, this.angle); quaternion2.hamiltonProduct(Vec3f.POSITIVE_Z.getRadialQuaternion(i)); } Vec3f Vec3f = new Vec3f(-1.0F, -1.0F, 0.0F); Vec3f.rotate(quaternion2); Vec3f[] Vec3fs = new Vec3f[]{new Vec3f(-1.0F, -1.0F, 0.0F), new Vec3f(-1.0F, 1.0F, 0.0F), new Vec3f(1.0F, 1.0F, 0.0F), new Vec3f(1.0F, -1.0F, 0.0F)}; float j = this.getSize(tickDelta); for (int k = 0; k < 4; ++k) { Vec3f Vec3f2 = Vec3fs[k]; Vec3f2.rotate(quaternion2); Vec3f2.scale(j); Vec3f2.add(f, g, h); } float minU = this.getMinU(); float maxU = this.getMaxU(); float minV = this.getMinV(); float maxV = this.getMaxV(); int p = this.getBrightness(tickDelta); int l = 15728880; float a = Math.min(1f, Math.max(0f, this.alpha)); float gl = Math.min(1f, Math.max(0f, this.glow)); // pumpkin vertexConsumer.vertex(Vec3fs[0].getX(), Vec3fs[0].getY(), Vec3fs[0].getZ()).texture(maxU, minV + (maxV - minV) / 2.0F).color(1f, 1f, 1f, a).light(p).next(); vertexConsumer.vertex(Vec3fs[1].getX(), Vec3fs[1].getY(), Vec3fs[1].getZ()).texture(maxU, minV).color(1f, 1f, 1f, a).light(p).next(); vertexConsumer.vertex(Vec3fs[2].getX(), Vec3fs[2].getY(), Vec3fs[2].getZ()).texture(minU, minV).color(1f, 1f, 1f, a).light(p).next(); vertexConsumer.vertex(Vec3fs[3].getX(), Vec3fs[3].getY(), Vec3fs[3].getZ()).texture(minU, minV + (maxV - minV) / 2.0F).color(1f, 1f, 1f, a).light(p).next(); // pumpkin glow vertexConsumer.vertex(Vec3fs[0].getX(), Vec3fs[0].getY(), Vec3fs[0].getZ()).texture(maxU, maxV).color(1f, 1f, 1f, gl).light(l).next(); vertexConsumer.vertex(Vec3fs[1].getX(), Vec3fs[1].getY(), Vec3fs[1].getZ()).texture(maxU, minV + (maxV - minV) / 2.0F).color(1f, 1f, 1f, gl).light(l).next(); vertexConsumer.vertex(Vec3fs[2].getX(), Vec3fs[2].getY(), Vec3fs[2].getZ()).texture(minU, minV + (maxV - minV) / 2.0F).color(1f, 1f, 1f, gl).light(l).next(); vertexConsumer.vertex(Vec3fs[3].getX(), Vec3fs[3].getY(), Vec3fs[3].getZ()).texture(minU, maxV).color(1f, 1f, 1f, gl).light(l).next(); } @Override public void tick() { super.tick(); if (owner != null) { // if night or dark enough if (Illuminations.isNightTime(world) || (this.world.getLightLevel(new BlockPos(this.x, this.y, this.z)) < 10)) { glow = 1; } else { glow = 0; } } } @Environment(EnvType.CLIENT) public static class DefaultFactory implements ParticleFactory { private final SpriteProvider spriteProvider; public DefaultFactory(SpriteProvider spriteProvider) { this.spriteProvider = spriteProvider; } public Particle createParticle(DefaultParticleType defaultParticleType, ClientWorld clientWorld, double d, double e, double f, double g, double h, double i) { return new JackoParticle(clientWorld, d, e, f, g, h, i, this.spriteProvider); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/pet/PetParticle.java ================================================ package ladysnake.illuminations.client.particle.pet; import ladysnake.illuminations.client.particle.FireflyParticle; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.particle.Particle; import net.minecraft.client.particle.ParticleFactory; import net.minecraft.client.particle.ParticleTextureSheet; import net.minecraft.client.particle.SpriteProvider; import net.minecraft.client.render.Camera; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.world.ClientWorld; import net.minecraft.entity.ai.TargetPredicate; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.particle.DefaultParticleType; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Quaternion; import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3f; import java.util.Random; public class PetParticle extends FireflyParticle { private static final Random RANDOM = new Random(); protected final PlayerEntity owner; private final SpriteProvider spriteProvider; protected float alpha = 0f; public PetParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) { super(world, x, y, z, velocityX, velocityY, velocityZ, spriteProvider); this.spriteProvider = spriteProvider; this.setSpriteForAge(spriteProvider); this.alpha = 0; this.maxAge = 40; this.owner = world.getClosestPlayer(TargetPredicate.createNonAttackable().setBaseMaxDistance(1D), this.x, this.y, this.z); this.scale = 0.2f; if (this.owner == null) { this.markDead(); } } @Override public void buildGeometry(VertexConsumer vertexConsumer, Camera camera, float tickDelta) { Vec3d vec3d = camera.getPos(); float f = (float) (MathHelper.lerp((double) tickDelta, this.prevPosX, this.x) - vec3d.getX()); float g = (float) (MathHelper.lerp((double) tickDelta, this.prevPosY, this.y) - vec3d.getY()); float h = (float) (MathHelper.lerp((double) tickDelta, this.prevPosZ, this.z) - vec3d.getZ()); Quaternion quaternion2; if (this.angle == 0.0F) { quaternion2 = camera.getRotation(); } else { quaternion2 = new Quaternion(camera.getRotation()); float i = MathHelper.lerp(tickDelta, this.prevAngle, this.angle); quaternion2.hamiltonProduct(Vec3f.POSITIVE_Z.getRadialQuaternion(i)); } Vec3f Vec3f = new Vec3f(-1.0F, -1.0F, 0.0F); Vec3f.rotate(quaternion2); Vec3f[] Vec3fs = new Vec3f[]{new Vec3f(-1.0F, -1.0F, 0.0F), new Vec3f(-1.0F, 1.0F, 0.0F), new Vec3f(1.0F, 1.0F, 0.0F), new Vec3f(1.0F, -1.0F, 0.0F)}; float j = this.getSize(tickDelta); for (int k = 0; k < 4; ++k) { Vec3f Vec3f2 = Vec3fs[k]; Vec3f2.rotate(quaternion2); Vec3f2.scale(j); Vec3f2.add(f, g, h); } float minU = this.getMinU(); float maxU = this.getMaxU(); float minV = this.getMinV(); float maxV = this.getMaxV(); int l = 15728880; vertexConsumer.vertex((double) Vec3fs[0].getX(), (double) Vec3fs[0].getY(), (double) Vec3fs[0].getZ()).texture(maxU, maxV).color(1f, 1f, 1f, alpha).light(l).next(); vertexConsumer.vertex((double) Vec3fs[1].getX(), (double) Vec3fs[1].getY(), (double) Vec3fs[1].getZ()).texture(maxU, minV).color(1f, 1f, 1f, alpha).light(l).next(); vertexConsumer.vertex((double) Vec3fs[2].getX(), (double) Vec3fs[2].getY(), (double) Vec3fs[2].getZ()).texture(minU, minV).color(1f, 1f, 1f, alpha).light(l).next(); vertexConsumer.vertex((double) Vec3fs[3].getX(), (double) Vec3fs[3].getY(), (double) Vec3fs[3].getZ()).texture(minU, maxV).color(1f, 1f, 1f, alpha).light(l).next(); } public ParticleTextureSheet getType() { return ParticleTextureSheet.PARTICLE_SHEET_TRANSLUCENT; } @Override public void tick() { if (this.age > 10) { alpha = 1; } else { alpha = 0; } if (owner != null) { this.prevPosX = this.x; this.prevPosY = this.y; this.prevPosZ = this.z; // die if old enough if (this.age++ >= this.maxAge) { this.markDead(); } this.setPos(owner.getX() + Math.cos(owner.bodyYaw / 50) * 0.5, owner.getY() + owner.getHeight() + 0.5f + Math.sin(owner.age / 12f) / 12f, owner.getZ() - Math.cos(owner.bodyYaw / 50) * 0.5); } else { this.markDead(); } } @Environment(EnvType.CLIENT) public static class DefaultFactory implements ParticleFactory { private final SpriteProvider spriteProvider; public DefaultFactory(SpriteProvider spriteProvider) { this.spriteProvider = spriteProvider; } public Particle createParticle(DefaultParticleType defaultParticleType, ClientWorld clientWorld, double d, double e, double f, double g, double h, double i) { return new PetParticle(clientWorld, d, e, f, g, h, i, this.spriteProvider); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/pet/PlayerLanternParticle.java ================================================ package ladysnake.illuminations.client.particle.pet; import ladysnake.illuminations.client.render.GlowyRenderLayer; import ladysnake.illuminations.client.render.entity.model.pet.LanternModel; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.MinecraftClient; import net.minecraft.client.model.Model; import net.minecraft.client.particle.Particle; import net.minecraft.client.particle.ParticleFactory; import net.minecraft.client.particle.ParticleTextureSheet; import net.minecraft.client.particle.SpriteProvider; import net.minecraft.client.render.*; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.world.ClientWorld; import net.minecraft.entity.ai.TargetPredicate; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.particle.DefaultParticleType; import net.minecraft.util.Identifier; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3f; import org.jetbrains.annotations.Nullable; public class PlayerLanternParticle extends Particle { public final Identifier texture; final RenderLayer layer; public float yaw; public float pitch; public float prevYaw; public float prevPitch; protected PlayerEntity owner; Model model; protected PlayerLanternParticle(ClientWorld world, double x, double y, double z, Identifier texture, float red, float green, float blue) { super(world, x, y, z); this.texture = texture; this.model = new LanternModel(MinecraftClient.getInstance().getEntityModelLoader().getModelPart(LanternModel.MODEL_LAYER)); this.layer = RenderLayer.getEntityTranslucent(texture); this.gravityStrength = 0.0F; this.maxAge = 35; this.owner = world.getClosestPlayer((TargetPredicate.createNonAttackable()).setBaseMaxDistance(1D), this.x, this.y, this.z); if (this.owner == null) { this.markDead(); } this.colorRed = red; this.colorGreen = green; this.colorBlue = blue; this.colorAlpha = 0; } @Override public ParticleTextureSheet getType() { return ParticleTextureSheet.CUSTOM; } @Override public void buildGeometry(VertexConsumer vertexConsumer, Camera camera, float tickDelta) { Vec3d vec3d = camera.getPos(); float f = (float) (MathHelper.lerp(tickDelta, this.prevPosX, this.x) - vec3d.getX()); float g = (float) (MathHelper.lerp(tickDelta, this.prevPosY, this.y) - vec3d.getY()); float h = (float) (MathHelper.lerp(tickDelta, this.prevPosZ, this.z) - vec3d.getZ()); MatrixStack matrixStack = new MatrixStack(); matrixStack.translate(f, g, h); matrixStack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(MathHelper.lerp(g, this.prevYaw, this.yaw) - 180)); matrixStack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(MathHelper.lerp(g, this.prevPitch, this.pitch))); matrixStack.scale(0.5F, -0.5F, 0.5F); matrixStack.translate(0, -1, 0); VertexConsumerProvider.Immediate immediate = MinecraftClient.getInstance().getBufferBuilders().getEntityVertexConsumers(); VertexConsumer vertexConsumer2 = immediate.getBuffer(GlowyRenderLayer.get(texture)); if (colorAlpha > 0) { this.model.render(matrixStack, vertexConsumer2, 15728880, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0f); } immediate.draw(); } @Override public void tick() { if (this.age > 10) { this.colorAlpha = 1f; } else { this.colorAlpha = 0; } if (owner != null) { this.prevPosX = this.x; this.prevPosY = this.y; this.prevPosZ = this.z; // die if old enough if (this.age++ >= this.maxAge) { this.markDead(); } this.setPos(owner.getX() + Math.cos(owner.bodyYaw / 50) * 0.5, owner.getY() + owner.getHeight() + 0.5f + Math.sin(owner.age / 12f) / 12f, owner.getZ() - Math.cos(owner.bodyYaw / 50) * 0.5); this.prevYaw = this.yaw; this.yaw = owner.age * 2; } else { this.markDead(); } } @Environment(EnvType.CLIENT) public static class DefaultFactory implements ParticleFactory { private final Identifier texture; private final float red; private final float green; private final float blue; public DefaultFactory(SpriteProvider spriteProvider, Identifier texture, float red, float green, float blue) { this.texture = texture; this.red = red; this.green = green; this.blue = blue; } @Nullable @Override public Particle createParticle(DefaultParticleType parameters, ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ) { return new PlayerLanternParticle(world, x, y, z, this.texture, this.red, this.green, this.blue); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/pet/PlayerWispParticle.java ================================================ package ladysnake.illuminations.client.particle.pet; import ladysnake.illuminations.client.particle.WillOWispParticle; import ladysnake.illuminations.client.particle.WispTrailParticleEffect; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.particle.Particle; import net.minecraft.client.particle.ParticleFactory; import net.minecraft.client.particle.SpriteProvider; import net.minecraft.client.world.ClientWorld; import net.minecraft.entity.ai.TargetPredicate; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.particle.DefaultParticleType; import net.minecraft.util.Identifier; import org.jetbrains.annotations.Nullable; public class PlayerWispParticle extends WillOWispParticle { protected PlayerEntity owner; protected PlayerWispParticle(ClientWorld world, double x, double y, double z, Identifier texture, float red, float green, float blue, float redEvolution, float greenEvolution, float blueEvolution) { super(world, x, y, z, texture, red, green, blue, redEvolution, greenEvolution, blueEvolution); this.maxAge = 35; this.owner = world.getClosestPlayer((TargetPredicate.createNonAttackable()).setBaseMaxDistance(1D), this.x, this.y, this.z); if (this.owner == null) { this.markDead(); } this.colorRed = red; this.colorGreen = green; this.colorBlue = blue; this.colorAlpha = 0; } @Override public void tick() { if (this.age > 10) { this.colorAlpha = 1f; for (int i = 0; i < 1; i++) { this.world.addParticle(new WispTrailParticleEffect(this.colorRed, this.colorGreen, this.colorBlue, this.redEvolution, this.greenEvolution, this.blueEvolution), this.x + random.nextGaussian() / 15, this.y + random.nextGaussian() / 15, this.z + random.nextGaussian() / 15, 0, 0, 0); } } else { this.colorAlpha = 0; } if (owner != null) { this.prevPosX = this.x; this.prevPosY = this.y; this.prevPosZ = this.z; // die if old enough if (this.age++ >= this.maxAge) { this.markDead(); } this.setPos(owner.getX() + Math.cos(owner.bodyYaw / 50) * 0.5, owner.getY() + owner.getHeight() + 0.5f + Math.sin(owner.age / 12f) / 12f, owner.getZ() - Math.cos(owner.bodyYaw / 50) * 0.5); this.pitch = -owner.getPitch(); this.prevPitch = -owner.prevPitch; this.yaw = -owner.getYaw(); this.prevYaw = -owner.prevYaw; } else { this.markDead(); } } @Environment(EnvType.CLIENT) public static class DefaultFactory implements ParticleFactory { private final Identifier texture; private final float red; private final float green; private final float blue; private final float redEvolution; private final float greenEvolution; private final float blueEvolution; public DefaultFactory(SpriteProvider spriteProvider, Identifier texture, float red, float green, float blue, float redEvolution, float greenEvolution, float blueEvolution) { this.texture = texture; this.red = red; this.green = green; this.blue = blue; this.redEvolution = redEvolution; this.greenEvolution = greenEvolution; this.blueEvolution = blueEvolution; } @Nullable @Override public Particle createParticle(DefaultParticleType parameters, ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ) { return new PlayerWispParticle(world, x, y, z, this.texture, this.red, this.green, this.blue, this.redEvolution, this.greenEvolution, this.blueEvolution); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/particle/pet/PrideHeartParticle.java ================================================ package ladysnake.illuminations.client.particle.pet; import ladysnake.illuminations.client.render.entity.model.pet.PrideHeartModel; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.MinecraftClient; import net.minecraft.client.particle.Particle; import net.minecraft.client.particle.ParticleFactory; import net.minecraft.client.particle.SpriteProvider; import net.minecraft.client.world.ClientWorld; import net.minecraft.particle.DefaultParticleType; import net.minecraft.util.Identifier; import org.jetbrains.annotations.Nullable; public class PrideHeartParticle extends PlayerLanternParticle { protected PrideHeartParticle(ClientWorld world, double x, double y, double z, Identifier texture, float red, float green, float blue) { super(world, x, y, z, texture, red, green, blue); this.model = new PrideHeartModel(MinecraftClient.getInstance().getEntityModelLoader().getModelPart(PrideHeartModel.MODEL_LAYER)); } @Override public void tick() { super.tick(); } @Environment(EnvType.CLIENT) public static class DefaultFactory implements ParticleFactory { private final Identifier texture; private final float red; private final float green; private final float blue; public DefaultFactory(SpriteProvider spriteProvider, Identifier texture, float red, float green, float blue) { this.texture = texture; this.red = red; this.green = green; this.blue = blue; } @Nullable @Override public Particle createParticle(DefaultParticleType parameters, ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ) { return new PrideHeartParticle(world, x, y, z, this.texture, this.red, this.green, this.blue); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/render/GlowyRenderLayer.java ================================================ package ladysnake.illuminations.client.render; import ladysnake.illuminations.mixin.RenderLayerAccessor; import net.minecraft.client.render.RenderLayer; import net.minecraft.client.render.RenderPhase; import net.minecraft.client.render.VertexFormat; import net.minecraft.client.render.VertexFormats; import net.minecraft.util.Identifier; public class GlowyRenderLayer extends RenderLayer { public GlowyRenderLayer(String name, VertexFormat vertexFormat, VertexFormat.DrawMode drawMode, int expectedBufferSize, boolean hasCrumbling, boolean translucent, Runnable startAction, Runnable endAction) { super(name, vertexFormat, drawMode, expectedBufferSize, hasCrumbling, translucent, startAction, endAction); } public static RenderLayer get(Identifier texture) { RenderLayer.MultiPhaseParameters multiPhaseParameters = RenderLayer.MultiPhaseParameters.builder().texture(new RenderPhase.Texture(texture, false, false)).transparency(Transparency.TRANSLUCENT_TRANSPARENCY).cull(DISABLE_CULLING).lightmap(ENABLE_LIGHTMAP).overlay(DISABLE_OVERLAY_COLOR).layering(VIEW_OFFSET_Z_LAYERING).shader(ENERGY_SWIRL_SHADER).build(true); return RenderLayerAccessor.invokeOf("crown", VertexFormats.POSITION_COLOR_TEXTURE_OVERLAY_LIGHT_NORMAL, VertexFormat.DrawMode.QUADS, 256, false, false, multiPhaseParameters); } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/render/entity/feature/OverheadFeatureRenderer.java ================================================ package ladysnake.illuminations.client.render.entity.feature; import ladysnake.illuminations.client.Illuminations; import ladysnake.illuminations.client.data.PlayerCosmeticData; import ladysnake.illuminations.client.render.GlowyRenderLayer; import ladysnake.illuminations.client.render.entity.model.hat.OverheadModel; import net.minecraft.client.network.AbstractClientPlayerEntity; import net.minecraft.client.render.OverlayTexture; import net.minecraft.client.render.VertexConsumerProvider; import net.minecraft.client.render.entity.EntityRendererFactory; import net.minecraft.client.render.entity.feature.FeatureRenderer; import net.minecraft.client.render.entity.feature.FeatureRendererContext; import net.minecraft.client.render.entity.model.PlayerEntityModel; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.Identifier; import java.util.Map; import java.util.stream.Collectors; public class OverheadFeatureRenderer extends FeatureRenderer> { private final Map models; public OverheadFeatureRenderer(FeatureRendererContext> featureRendererContext, EntityRendererFactory.Context loader) { super(featureRendererContext); this.models = Illuminations.OVERHEADS_DATA.entrySet().stream() .collect(Collectors.toMap(Map.Entry::getKey, data -> new ResolvedOverheadData(data.getValue().getTexture(), data.getValue().createModel(loader)))); } @Override public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, AbstractClientPlayerEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) { PlayerCosmeticData cosmeticData = Illuminations.getCosmeticData(entity); if (cosmeticData != null && !entity.isInvisible()) { String playerOverhead = cosmeticData.getOverhead(); if (playerOverhead != null) { ResolvedOverheadData resolvedOverheadData = this.models.get(playerOverhead); if (resolvedOverheadData != null) { Identifier texture = resolvedOverheadData.texture(); OverheadModel model = resolvedOverheadData.model(); model.head.pivotX = this.getContextModel().head.pivotX; model.head.pivotY = this.getContextModel().head.pivotY; model.head.pitch = this.getContextModel().head.pitch; model.head.yaw = this.getContextModel().head.yaw; model.render(matrices, vertexConsumers.getBuffer(GlowyRenderLayer.get(texture)), 15728880, OverlayTexture.DEFAULT_UV, 1f, 1f, 1f, 1f); } } } } private record ResolvedOverheadData(Identifier texture, OverheadModel model) { } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/render/entity/model/hat/CrownModel.java ================================================ package ladysnake.illuminations.client.render.entity.model.hat; import ladysnake.illuminations.client.Illuminations; import net.minecraft.client.model.*; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.render.entity.EntityRendererFactory; import net.minecraft.client.render.entity.model.EntityModelLayer; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.Identifier; public class CrownModel extends OverheadModel { public static final EntityModelLayer MODEL_LAYER = new EntityModelLayer(new Identifier(Illuminations.MODID, "crown"), "main"); public CrownModel(EntityRendererFactory.Context ctx) { super(ctx, MODEL_LAYER); ModelPart crown = this.head.getChild("crown"); ModelPart south_r1 = crown.getChild("south_r1"); ModelPart east_r1 = crown.getChild("east_r1"); ModelPart north_r1 = crown.getChild("north_r1"); ModelPart west_r1 = crown.getChild("west_r1"); setRotationAngle(east_r1, -0.2618F, 1.5708F, 0.0F); setRotationAngle(north_r1, -0.2618F, 3.1416F, 0.0F); setRotationAngle(west_r1, -0.2618F, -1.5708F, 0.0F); setRotationAngle(south_r1, -0.2618F, 0.0F, 0.0F); } public static TexturedModelData getTexturedModelData() { ModelData modelData = new ModelData(); ModelPartData modelPartData = modelData.getRoot(); ModelPartData modelPartData1 = modelPartData.addChild("head", ModelPartBuilder.create().uv(0, 7).cuboid(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, new Dilation(-4.0f)), ModelTransform.pivot(0.0F, 0.0F, 0.0F)); ModelPartData modelPartData2 = modelPartData1.addChild("crown", ModelPartBuilder.create().uv(0, 0).cuboid(-4.0F, -13.0F, -4.0F, 8.0F, 8.0F, 8.0F, new Dilation(-0.5f)), ModelTransform.pivot(0.0F, -4.0F, 0.0F)); modelPartData2.addChild("west_r1", ModelPartBuilder.create().uv(7, 39).cuboid(-4.0F, -8.0F, 3.0F, 8.0F, 8.0F, 1.0F, new Dilation(-0.5F)), ModelTransform.pivot(0.0F, -7.0F, 0.0F)); modelPartData2.addChild("north_r1", ModelPartBuilder.create().uv(7, 15).cuboid(-4.0F, -8.0F, 3.0F, 8.0F, 8.0F, 1.0F, new Dilation(-0.5F)), ModelTransform.pivot(0.0F, -7.0F, 0.0F)); modelPartData2.addChild("east_r1", ModelPartBuilder.create().uv(7, 23).cuboid(-4.0F, -8.0F, 3.0F, 8.0F, 8.0F, 1.0F, new Dilation(-0.5F)), ModelTransform.pivot(0.0F, -7.0F, 0.0F)); modelPartData2.addChild("south_r1", ModelPartBuilder.create().uv(7, 31).cuboid(-4.0F, -8.0F, 3.0F, 8.0F, 8.0F, 1.0F, new Dilation(-0.5F)), ModelTransform.pivot(0.0F, -7.0F, 0.0F)); return TexturedModelData.of(modelData, 32, 48); } @Override public void render(MatrixStack matrixStack, VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { head.render(matrixStack, buffer, packedLight, packedOverlay); } public void setRotationAngle(ModelPart bone, float x, float y, float z) { bone.pitch = x; bone.yaw = y; bone.roll = z; } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/render/entity/model/hat/HaloModel.java ================================================ package ladysnake.illuminations.client.render.entity.model.hat; import ladysnake.illuminations.client.Illuminations; import net.minecraft.client.model.*; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.render.entity.EntityRendererFactory; import net.minecraft.client.render.entity.model.EntityModelLayer; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.Identifier; public class HaloModel extends OverheadModel { public static final EntityModelLayer MODEL_LAYER = new EntityModelLayer(new Identifier(Illuminations.MODID, "halo"), "main"); public HaloModel(EntityRendererFactory.Context ctx) { super(ctx, MODEL_LAYER); } public static TexturedModelData getTexturedModelData() { ModelData modelData = new ModelData(); ModelPartData modelPartData = modelData.getRoot(); ModelPartData modelPartData1 = modelPartData.addChild("head", ModelPartBuilder.create().uv(0, 7).cuboid(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, new Dilation(-4.0f)), ModelTransform.pivot(0.0F, 0.0F, 0.0F)); modelPartData1.addChild("halo", ModelPartBuilder.create().uv(0, 0).cuboid(-8.0F, -11.0F, 5.0F, 16.0F, 16.0F, 0.0F), ModelTransform.pivot(0.0F, -4.0F, 0.0F)); return TexturedModelData.of(modelData, 32, 48); } @Override public void render(MatrixStack matrixStack, VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { head.render(matrixStack, buffer, packedLight, packedOverlay); } public void setRotationAngle(ModelPart bone, float x, float y, float z) { bone.pitch = x; bone.yaw = y; bone.roll = z; } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/render/entity/model/hat/HornsModel.java ================================================ package ladysnake.illuminations.client.render.entity.model.hat; import ladysnake.illuminations.client.Illuminations; import net.minecraft.client.model.*; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.render.entity.EntityRendererFactory; import net.minecraft.client.render.entity.model.EntityModelLayer; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.Identifier; public class HornsModel extends OverheadModel { public static final EntityModelLayer MODEL_LAYER = new EntityModelLayer(new Identifier(Illuminations.MODID, "horns"), "main"); public HornsModel(EntityRendererFactory.Context ctx) { super(ctx, MODEL_LAYER); ModelPart horns = this.head.getChild("horns"); ModelPart south_r1 = horns.getChild("south_r1"); ModelPart east_r1 = horns.getChild("east_r1"); ModelPart west_r1 = horns.getChild("west_r1"); setRotationAngle(west_r1, 0.0F, 2.5307F, 0.0F); setRotationAngle(east_r1, 0.0F, -2.5307F, 0.0F); setRotationAngle(south_r1, -0.2618F, 0.0F, 0.0F); } public static TexturedModelData getTexturedModelData() { ModelData modelData = new ModelData(); ModelPartData modelPartData = modelData.getRoot(); ModelPartData modelPartData1 = modelPartData.addChild("head", ModelPartBuilder.create().uv(0, 7).cuboid(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, new Dilation(-4.0f)), ModelTransform.pivot(0.0F, 0.0F, 0.0F)); ModelPartData modelPartData2 = modelPartData1.addChild("horns", ModelPartBuilder.create(), ModelTransform.pivot(0.0F, -4.0F, 0.0F)); modelPartData2.addChild("west_r1", ModelPartBuilder.create().uv(0, 39).cuboid(-11.0F, -9.0F, 3.0F, 16.0F, 9.0F, 0.0F), ModelTransform.pivot(6.0F, 2.0F, 3.0F)); modelPartData2.addChild("east_r1", ModelPartBuilder.create().uv(0, 22).cuboid(-5.0F, -9.0F, 3.0F, 16.0F, 9.0F, 0.0F), ModelTransform.pivot(-6.0F, 2.0F, 3.0F)); modelPartData2.addChild("south_r1", ModelPartBuilder.create().uv(7, 30).cuboid(-4.0F, -8.0F, 3.0F, 8.0F, 8.0F, 1.0F, new Dilation(-0.5F)), ModelTransform.pivot(0.0F, -4.0F, 0.0F)); return TexturedModelData.of(modelData, 32, 48); } @Override public void render(MatrixStack matrixStack, VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { head.render(matrixStack, buffer, packedLight, packedOverlay); } public void setRotationAngle(ModelPart bone, float x, float y, float z) { bone.pitch = x; bone.yaw = y; bone.roll = z; } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/render/entity/model/hat/OverheadModel.java ================================================ package ladysnake.illuminations.client.render.entity.model.hat; import ladysnake.illuminations.client.render.GlowyRenderLayer; import net.minecraft.client.model.Model; import net.minecraft.client.model.ModelPart; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.render.entity.EntityRendererFactory; import net.minecraft.client.render.entity.model.EntityModelLayer; import net.minecraft.client.util.math.MatrixStack; public abstract class OverheadModel extends Model { public final ModelPart head; public OverheadModel(EntityRendererFactory.Context ctx, EntityModelLayer entityModelLayer) { super(GlowyRenderLayer::get); this.head = ctx.getPart(entityModelLayer).getChild("head"); } @Override public void render(MatrixStack matrixStack, VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { this.head.render(matrixStack, buffer, packedLight, packedOverlay); } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/render/entity/model/hat/TiaraModel.java ================================================ package ladysnake.illuminations.client.render.entity.model.hat; import ladysnake.illuminations.client.Illuminations; import net.minecraft.client.model.*; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.render.entity.EntityRendererFactory; import net.minecraft.client.render.entity.model.EntityModelLayer; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.Identifier; public class TiaraModel extends OverheadModel { public static final EntityModelLayer MODEL_LAYER = new EntityModelLayer(new Identifier(Illuminations.MODID, "tiara"), "main"); public TiaraModel(EntityRendererFactory.Context ctx) { super(ctx, MODEL_LAYER); ModelPart tiara = this.head.getChild("tiara"); ModelPart south_r1 = tiara.getChild("south_r1"); ModelPart east_r1 = tiara.getChild("east_r1"); ModelPart north_r1 = tiara.getChild("north_r1"); ModelPart west_r1 = tiara.getChild("west_r1"); setRotationAngle(east_r1, -0.0436F, 1.5708F, 0.0F); setRotationAngle(north_r1, -0.0873F, 3.1416F, 0.0F); setRotationAngle(west_r1, -0.0436F, -1.5708F, 0.0F); setRotationAngle(south_r1, -0.0873F, 0.0F, 0.0F); } public static TexturedModelData getTexturedModelData() { ModelData modelData = new ModelData(); ModelPartData modelPartData = modelData.getRoot(); ModelPartData modelPartData1 = modelPartData.addChild("head", ModelPartBuilder.create().uv(0, 7).cuboid(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, new Dilation(-4.0f)), ModelTransform.pivot(0.0F, 0.0F, 0.0F)); ModelPartData modelPartData2 = modelPartData1.addChild("tiara", ModelPartBuilder.create().uv(0, 4).cuboid(-4.0F, -8.0F, -4.0F, 8.0F, 4.0F, 8.0F, new Dilation(-0.5F)).uv(0, 0), ModelTransform.pivot(0.0F, -4.0F, 0.0F)); modelPartData2.addChild("west_r1", ModelPartBuilder.create().uv(6, 39).cuboid(-5.1F, -6.1F, 3.03F, 10.0F, 8.0F, 1.0F, new Dilation(-0.5F)), ModelTransform.pivot(0.0F, -6.0F, 0.0F)); modelPartData2.addChild("north_r1", ModelPartBuilder.create().uv(8, 17).cuboid(0.0F, -4.3F, 3.2F, 6.0F, 6.0F, 1.0F, new Dilation(-0.5F)), ModelTransform.pivot(3.0F, -6.0F, 0.0F)); modelPartData2.addChild("east_r1", ModelPartBuilder.create().uv(6, 23).cuboid(-4.9F, -6.1F, 3.03F, 10.0F, 8.0F, 1.0F, new Dilation(-0.5F)), ModelTransform.pivot(0.0F, -6.0F, 0.0F)); modelPartData2.addChild("south_r1", ModelPartBuilder.create().uv(7, 32).cuboid(-4.0F, -6.3F, 3.2F, 8.0F, 8.0F, 1.0F, new Dilation(-0.75f)), ModelTransform.pivot(0.0F, -6.0F, 0.0F)); return TexturedModelData.of(modelData, 32, 48); } @Override public void render(MatrixStack matrixStack, VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { head.render(matrixStack, buffer, packedLight, packedOverlay); } public void setRotationAngle(ModelPart bone, float x, float y, float z) { bone.pitch = x; bone.yaw = y; bone.roll = z; } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/render/entity/model/hat/VoidheartTiaraModel.java ================================================ package ladysnake.illuminations.client.render.entity.model.hat; import ladysnake.illuminations.client.Illuminations; import net.minecraft.client.model.*; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.render.entity.EntityRendererFactory; import net.minecraft.client.render.entity.model.EntityModelLayer; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.Identifier; public class VoidheartTiaraModel extends OverheadModel { public static final EntityModelLayer MODEL_LAYER = new EntityModelLayer(new Identifier(Illuminations.MODID, "voidheart_tiara"), "main"); public VoidheartTiaraModel(EntityRendererFactory.Context ctx) { super(ctx, MODEL_LAYER); ModelPart crown = this.head.getChild("crown"); ModelPart south_r1 = crown.getChild("south_r1"); ModelPart east_r1 = crown.getChild("east_r1"); ModelPart north_r1 = crown.getChild("north_r1"); ModelPart west_r1 = crown.getChild("west_r1"); setRotationAngle(east_r1, -0.2618F, 1.5708F, 0.0F); setRotationAngle(north_r1, -0.2618F, 3.1416F, 0.0F); setRotationAngle(west_r1, -0.2618F, -1.5708F, 0.0F); setRotationAngle(south_r1, -0.2618F, 0.0F, 0.0F); } public static TexturedModelData getTexturedModelData() { ModelData modelData = new ModelData(); ModelPartData modelPartData = modelData.getRoot(); ModelPartData modelPartData1 = modelPartData.addChild("head", ModelPartBuilder.create().uv(0, 7).cuboid(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, new Dilation(-4.0f)), ModelTransform.pivot(0.0F, 0.0F, 0.0F)); ModelPartData modelPartData2 = modelPartData1.addChild("crown", ModelPartBuilder.create().uv(0, 0).cuboid(-4.0F, -13.0F, -4.0F, 8.0F, 8.0F, 8.0F, new Dilation(-0.5F)), ModelTransform.pivot(0.0F, -4.0F, 0.0F)); modelPartData2.addChild("west_r1", ModelPartBuilder.create().uv(0, 36).cuboid(-7.0F, -11.0F, 3.0F, 11.0F, 11.0F, 1.0F, new Dilation(-0.5F)), ModelTransform.pivot(0.0F, -7.0F, 0.0F)); modelPartData2.addChild("north_r1", ModelPartBuilder.create().uv(0, 16).cuboid(-4.0F, -8.0F, 3.0F, 9.0F, 8.0F, 1.0F, new Dilation(-0.5F)), ModelTransform.pivot(0.5F, -7.0F, 0.0F)); modelPartData2.addChild("east_r1", ModelPartBuilder.create().uv(0, 25).cuboid(-5.0F, -11.0F, 3.0F, 10.0F, 11.0F, 1.0F, new Dilation(-0.5F)), ModelTransform.pivot(0.0F, -6.0F, 1.0F)); modelPartData2.addChild("south_r1", ModelPartBuilder.create().uv(12, 39).cuboid(-5.0F, -8.0F, 3.0F, 9.0F, 8.0F, 1.0F, new Dilation(-0.5F)), ModelTransform.pivot(0.5F, -7.0F, 0.0F)); return TexturedModelData.of(modelData, 48, 48); } @Override public void render(MatrixStack matrixStack, VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { head.render(matrixStack, buffer, packedLight, packedOverlay); } public void setRotationAngle(ModelPart bone, float x, float y, float z) { bone.pitch = x; bone.yaw = y; bone.roll = z; } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/render/entity/model/hat/WreathModel.java ================================================ package ladysnake.illuminations.client.render.entity.model.hat; import ladysnake.illuminations.client.Illuminations; import net.minecraft.client.model.*; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.render.entity.EntityRendererFactory; import net.minecraft.client.render.entity.model.EntityModelLayer; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.Identifier; public class WreathModel extends OverheadModel { public static final EntityModelLayer MODEL_LAYER = new EntityModelLayer(new Identifier(Illuminations.MODID, "wreath"), "main"); public WreathModel(EntityRendererFactory.Context ctx) { super(ctx, MODEL_LAYER); } public static TexturedModelData getTexturedModelData() { ModelData modelData = new ModelData(); ModelPartData modelPartData = modelData.getRoot(); ModelPartData modelPartData1 = modelPartData.addChild("head", ModelPartBuilder.create().uv(0, 7).cuboid(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, new Dilation(-4.0f)), ModelTransform.pivot(0.0F, 0.0F, 0.0F)); modelPartData1.addChild("wreath", ModelPartBuilder.create().uv(0, 0).cuboid(-5.0F, -34.5F, -5.0F, 10.0F, 5.0F, 8.0F, new Dilation(0.5f)), ModelTransform.pivot(0.0F, 24.0F, 0.0F)); return TexturedModelData.of(modelData, 48, 16); } @Override public void render(MatrixStack matrixStack, VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { head.render(matrixStack, buffer, packedLight, packedOverlay); } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/render/entity/model/pet/LanternModel.java ================================================ /// Made with Model Converter by Globox_Z /// Generate all required imports /// Made with Blockbench 3.8.4 /// Exported for Minecraft version 1.15 /// Paste this class into your mod and generate all required imports package ladysnake.illuminations.client.render.entity.model.pet; import ladysnake.illuminations.client.Illuminations; import ladysnake.illuminations.client.render.GlowyRenderLayer; import net.minecraft.client.model.*; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.render.entity.model.EntityModelLayer; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.Identifier; public class LanternModel extends Model { public static final EntityModelLayer MODEL_LAYER = new EntityModelLayer(new Identifier(Illuminations.MODID, "lantern"), "main"); private final ModelPart lantern; public LanternModel(ModelPart root) { super(GlowyRenderLayer::get); this.lantern = root.getChild("lantern"); } public static TexturedModelData getTexturedModelData() { ModelData modelData = new ModelData(); ModelPartData modelPartData = modelData.getRoot(); modelPartData.addChild("lantern", ModelPartBuilder.create() .uv(0, 0) .cuboid(-3.0F, -3.0F, -3.0F, 6.0F, 7.0F, 6.0F) .uv(0, 13) .cuboid(-2.0F, -5.0F, -2.0F, 4.0F, 2.0F, 4.0F) .uv(16, 13) .cuboid(-2.5F, -8.0F, 0.0F, 5.0F, 4.0F, 0.0F), ModelTransform.pivot(0.0F, 16.0F, 0.0F) ); return TexturedModelData.of(modelData, 32, 32); } @Override public void render(MatrixStack matrixStack, VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { lantern.render(matrixStack, buffer, packedLight, packedOverlay); } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/render/entity/model/pet/PrideHeartModel.java ================================================ /// Made with Model Converter by Globox_Z /// Generate all required imports /// Made with Blockbench 3.8.4 /// Exported for Minecraft version 1.15 /// Paste this class into your mod and generate all required imports package ladysnake.illuminations.client.render.entity.model.pet; import ladysnake.illuminations.client.Illuminations; import ladysnake.illuminations.client.render.GlowyRenderLayer; import net.minecraft.client.model.*; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.render.entity.model.EntityModelLayer; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.Identifier; public class PrideHeartModel extends Model { public static final EntityModelLayer MODEL_LAYER = new EntityModelLayer(new Identifier(Illuminations.MODID, "pride_heart"), "main"); private final ModelPart heart; public PrideHeartModel(ModelPart root) { super(GlowyRenderLayer::get); this.heart = root.getChild("heart"); } public static TexturedModelData getTexturedModelData() { ModelData modelData = new ModelData(); ModelPartData modelPartData = modelData.getRoot(); modelPartData.addChild("heart", ModelPartBuilder.create(), ModelTransform.pivot(0.0F, 16.0F, 0.0F) ); modelPartData.getChild("heart").addChild("cube1", ModelPartBuilder.create() .uv(22, 0) .cuboid(1.0F, -4.0F, -1.5F, 0.0F, 3.0F, 3.0F), ModelTransform.rotation(0.0F, 0.0F, -0.7854F)); modelPartData.getChild("heart").addChild("cube2", ModelPartBuilder.create() .uv(22, 0) .cuboid(-1.0F, -4.0F, -1.5F, 0.0F, 3.0F, 3.0F) .uv(0, 0) .cuboid(-4.0F, -4.0F, -1.5F, 8.0F, 8.0F, 3.0F), ModelTransform.rotation(0.0F, 0.0F, 0.7854F)); return TexturedModelData.of(modelData, 32, 32); } @Override public void render(MatrixStack matrixStack, VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { heart.render(matrixStack, buffer, packedLight, packedOverlay); } } ================================================ FILE: src/main/java/ladysnake/illuminations/client/render/entity/model/pet/WillOWispModel.java ================================================ /// Made with Model Converter by Globox_Z /// Generate all required imports /// Made with Blockbench 3.8.4 /// Exported for Minecraft version 1.15 /// Paste this class into your mod and generate all required imports package ladysnake.illuminations.client.render.entity.model.pet; import ladysnake.illuminations.client.Illuminations; import ladysnake.illuminations.client.render.GlowyRenderLayer; import net.minecraft.client.model.*; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.render.entity.model.EntityModelLayer; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.Identifier; public class WillOWispModel extends Model { public static final EntityModelLayer MODEL_LAYER = new EntityModelLayer(new Identifier(Illuminations.MODID, "will_o_wisp"), "main"); private final ModelPart skull; public WillOWispModel(ModelPart root) { super(GlowyRenderLayer::get); this.skull = root.getChild("skull"); } public static TexturedModelData getTexturedModelData() { ModelData modelData = new ModelData(); ModelPartData modelPartData = modelData.getRoot(); modelPartData.addChild("skull", ModelPartBuilder.create() .uv(0, 0) .cuboid(-3.0F, -3.0F, -3.0F, 6.0F, 6.0F, 6.0F) .uv(0, 16) .cuboid(-3.0F, -3.0F, -3.0F, 6.0F, 7.0F, 6.0F, new Dilation(0.25F)), ModelTransform.pivot(0.0F, 16.0F, 0.0F) ); return TexturedModelData.of(modelData, 32, 32); } @Override public void render(MatrixStack matrixStack, VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { skull.render(matrixStack, buffer, packedLight, packedOverlay); } } ================================================ FILE: src/main/java/ladysnake/illuminations/mixin/BlockMixin.java ================================================ package ladysnake.illuminations.mixin; import ladysnake.illuminations.client.Illuminations; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import java.util.Random; @Mixin(Block.class) public abstract class BlockMixin { @Shadow public abstract BlockState getDefaultState(); @Inject(method = "randomDisplayTick", at = @At("RETURN")) protected void illuminations$randomDisplayTick(BlockState state, World world, BlockPos pos, Random random, CallbackInfo ci) { if (this.getDefaultState().getBlock() == Blocks.SEA_LANTERN) { for (int i = 0; i < 10; i++) { BlockPos blockPos = new BlockPos(pos.getX() + 0.5 + random.nextGaussian() * 15, pos.getY() + 0.5 + random.nextGaussian() * 15, pos.getZ() + 0.5 + random.nextGaussian() * 15); if (world.getBlockState(blockPos).getBlock() == Blocks.WATER && random.nextInt(1 + world.getLightLevel(blockPos)) == 0) { world.addParticle(Illuminations.PRISMARINE_CRYSTAL, true, blockPos.getX(), blockPos.getY(), blockPos.getZ(), 0f, 0f, 0f); } } } } } ================================================ FILE: src/main/java/ladysnake/illuminations/mixin/CarvedPumpkinBlockMixin.java ================================================ package ladysnake.illuminations.mixin; import ladysnake.illuminations.client.Illuminations; import ladysnake.illuminations.client.config.Config; import ladysnake.illuminations.client.enums.HalloweenFeatures; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.CarvedPumpkinBlock; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import java.time.LocalDate; import java.time.Month; import java.util.Random; @Mixin(CarvedPumpkinBlock.class) public abstract class CarvedPumpkinBlockMixin extends BlockMixin { @Override protected void illuminations$randomDisplayTick(BlockState state, World world, BlockPos pos, Random random, CallbackInfo ci) { if (state.getBlock() == Blocks.JACK_O_LANTERN && Illuminations.isNightTime(world) && random.nextInt(100) == 0 && ((Config.getHalloweenFeatures() == HalloweenFeatures.ENABLE && LocalDate.now().getMonth() == Month.OCTOBER) || Config.getHalloweenFeatures() == HalloweenFeatures.ALWAYS)) { world.addParticle(Illuminations.PUMPKIN_SPIRIT, true, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, 0f, 0f, 0f); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/mixin/ChorusFlowerBlockMixin.java ================================================ package ladysnake.illuminations.mixin; import ladysnake.illuminations.client.Illuminations; import ladysnake.illuminations.client.config.Config; import net.minecraft.block.BlockState; import net.minecraft.block.ChorusFlowerBlock; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import java.util.Random; @Mixin(ChorusFlowerBlock.class) public abstract class ChorusFlowerBlockMixin extends BlockMixin { @Override protected void illuminations$randomDisplayTick(BlockState state, World world, BlockPos pos, Random random, CallbackInfo ci) { for (int i = 0; i < (6 - state.get(ChorusFlowerBlock.AGE)) * Config.getChorusPetalsSpawnMultiplier(); i++) { world.addParticle(Illuminations.CHORUS_PETAL, true, pos.getX() + 0.5 + random.nextGaussian() * 5, pos.getY() + 0.5 + random.nextGaussian() * 5, pos.getZ() + 0.5 + random.nextGaussian() * 5, 0f, 0f, 0f); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/mixin/ClientWorldMixin.java ================================================ package ladysnake.illuminations.mixin; import com.google.common.collect.ImmutableSet; import ladysnake.illuminations.client.Illuminations; import ladysnake.illuminations.client.config.Config; import ladysnake.illuminations.client.data.IlluminationData; import ladysnake.illuminations.client.enums.BiomeCategory; import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.AbstractClientPlayerEntity; import net.minecraft.client.world.ClientWorld; import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; import net.minecraft.util.profiler.Profiler; import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.RegistryKey; import net.minecraft.world.MutableWorldProperties; import net.minecraft.world.World; import net.minecraft.world.biome.Biome; import net.minecraft.world.dimension.DimensionType; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Coerce; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Slice; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import java.util.Random; import java.util.function.Supplier; @Mixin(ClientWorld.class) public abstract class ClientWorldMixin extends World { @Shadow @Final private MinecraftClient client; protected ClientWorldMixin(MutableWorldProperties properties, RegistryKey registryKey, DimensionType dimensionType, Supplier supplier, boolean bl, boolean bl2, long l) { super(properties, registryKey, dimensionType, supplier, bl, bl2, l); } @SuppressWarnings("InvalidInjectorMethodSignature") @Inject(method = "randomBlockDisplayTick", slice = @Slice(from = @At(value = "INVOKE", target = "Lnet/minecraft/world/biome/Biome;getParticleConfig()Ljava/util/Optional;")), at = @At(value = "INVOKE", target = "Ljava/util/Optional;ifPresent(Ljava/util/function/Consumer;)V", ordinal = 0, shift = At.Shift.AFTER)) private void randomBlockDisplayTick(int centerX, int centerY, int centerZ, int radius, Random random, @Coerce Object blockParticle, BlockPos.Mutable blockPos, CallbackInfo ci) { BlockPos.Mutable pos = blockPos.add(this.random.nextGaussian() * 50, this.random.nextGaussian() * 25, this.random.nextGaussian() * 50).mutableCopy(); Biome b = this.getBiome(pos); Identifier biome = this.getRegistryManager().get(Registry.BIOME_KEY).getId(b); // Main biome settings BiomeCategory biomeCategory = BiomeCategory.find(biome, b.getCategory()); // Returns OTHER if no association for this biome was found. spawnParticles(pos, Illuminations.ILLUMINATIONS_BIOME_CATEGORIES.get(biomeCategory)); // Other miscellaneous biome settings if (Illuminations.ILLUMINATIONS_BIOMES.containsKey(biome)) { ImmutableSet illuminationDataSet = Illuminations.ILLUMINATIONS_BIOMES.get(biome); spawnParticles(pos, illuminationDataSet); } // spooky eyes if (Illuminations.EYES_LOCATION_PREDICATE.test(this, pos) && random.nextFloat() <= Config.getEyesInTheDarkSpawnRate().spawnRate) { this.addParticle(Illuminations.EYES, (double) pos.getX() + 0.5, (double) pos.getY() + 0.5, (double) pos.getZ() + 0.5, 0.0D, 0.0D, 0.0D); } } private void spawnParticles(BlockPos.Mutable pos, ImmutableSet illuminationDataSet) { for (IlluminationData illuminationData : illuminationDataSet) { if (illuminationData.locationSpawnPredicate().test(this, pos) && illuminationData.shouldAddParticle(this.random)) { this.addParticle(illuminationData.illuminationType(), (double) pos.getX(), (double) pos.getY(), (double) pos.getZ(), 0.0D, 0.0D, 0.0D); } } } @Inject(method = "addPlayer", at = @At(value = "RETURN")) public void addPlayer(int id, AbstractClientPlayerEntity player, CallbackInfo ci) { Illuminations.loadPlayerCosmetics(); } } ================================================ FILE: src/main/java/ladysnake/illuminations/mixin/LanternBlockMixin.java ================================================ package ladysnake.illuminations.mixin; import ladysnake.illuminations.client.Illuminations; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.LanternBlock; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import java.util.Random; @Mixin(LanternBlock.class) public abstract class LanternBlockMixin extends BlockMixin { @Override protected void illuminations$randomDisplayTick(BlockState state, World world, BlockPos pos, Random random, CallbackInfo ci) { if (state.getBlock() == Blocks.SOUL_LANTERN && random.nextInt(100) == 0) { world.addParticle(Illuminations.WILL_O_WISP, true, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, 0f, 0f, 0f); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/mixin/LivingEntityMixin.java ================================================ package ladysnake.illuminations.mixin; import ladysnake.illuminations.client.Illuminations; import ladysnake.illuminations.client.config.Config; import ladysnake.illuminations.client.enums.HalloweenFeatures; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.damage.DamageSource; import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvents; import net.minecraft.world.World; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import java.time.LocalDate; import java.time.Month; @Mixin(LivingEntity.class) public abstract class LivingEntityMixin extends Entity { public LivingEntityMixin(EntityType type, World world) { super(type, world); } @Shadow public abstract boolean isUndead(); @Inject(method = "onDeath", at = @At("RETURN")) public void onDeath(DamageSource source, CallbackInfo callbackInfo) { if (this.isUndead() && random.nextInt(5) == 0 && Illuminations.isNightTime(world) && ((Config.getHalloweenFeatures() == HalloweenFeatures.ENABLE && LocalDate.now().getMonth() == Month.OCTOBER) || Config.getHalloweenFeatures() == HalloweenFeatures.ALWAYS)) { this.world.playSound(null, this.getBlockPos(), SoundEvents.ENTITY_VEX_CHARGE, SoundCategory.AMBIENT, 1.0f, 0.8f); world.addParticle(Illuminations.POLTERGEIST, true, this.getX() + 0.5, this.getEyeY(), this.getZ(), 0f, 0f, 0f); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/mixin/ParticleManagerMixin.java ================================================ package ladysnake.illuminations.mixin; import ladysnake.illuminations.client.Illuminations; import ladysnake.illuminations.client.config.Config; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.ChorusFlowerBlock; import net.minecraft.client.particle.Particle; import net.minecraft.client.particle.ParticleManager; import net.minecraft.client.world.ClientWorld; import net.minecraft.particle.ParticleEffect; import net.minecraft.util.math.BlockPos; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import java.util.Random; @Mixin(ParticleManager.class) public abstract class ParticleManagerMixin { @Shadow protected ClientWorld world; @Shadow @Final private Random random; @Shadow public abstract Particle addParticle(ParticleEffect parameters, double x, double y, double z, double velocityX, double velocityY, double velocityZ); @Inject(method = "addBlockBreakParticles", at = @At(value = "RETURN")) public void addBlockBreakParticles(BlockPos pos, BlockState state, CallbackInfo ci) { if (state.getBlock() == Blocks.CHORUS_FLOWER) { for (int i = 0; i < (6 - state.get(ChorusFlowerBlock.AGE)) * 10 * Config.getChorusPetalsSpawnMultiplier(); i++) { this.addParticle(Illuminations.CHORUS_PETAL, (double) pos.getX() + 0.5, (double) pos.getY() + 0.5, (double) pos.getZ() + 0.5, random.nextGaussian() / 10f, random.nextGaussian() / 10f, random.nextGaussian() / 10f); } } } } ================================================ FILE: src/main/java/ladysnake/illuminations/mixin/PlayerEntityMixin.java ================================================ package ladysnake.illuminations.mixin; import ladysnake.illuminations.client.Illuminations; import ladysnake.illuminations.client.config.Config; import ladysnake.illuminations.client.data.AuraData; import ladysnake.illuminations.client.data.PlayerCosmeticData; import net.minecraft.client.MinecraftClient; import net.minecraft.entity.EntityType; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.particle.DefaultParticleType; import net.minecraft.world.World; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(PlayerEntity.class) public abstract class PlayerEntityMixin extends LivingEntity { protected PlayerEntityMixin(EntityType entityType, World world) { super(entityType, world); } @Inject(method = "tick", at = @At("RETURN")) public void tick(CallbackInfo callbackInfo) { PlayerCosmeticData cosmeticData = Illuminations.getCosmeticData((PlayerEntity) (Object) this); // if player has cosmetics if (cosmeticData != null) { // player aura String playerAura = cosmeticData.getAura(); if (playerAura != null && Illuminations.AURAS_DATA.containsKey(playerAura)) { // do not render in first person or if the player is invisible // noinspection ConstantConditions if (((Config.getViewAurasFP() || MinecraftClient.getInstance().gameRenderer.getCamera().isThirdPerson()) || MinecraftClient.getInstance().player != (Object) this) && !this.isInvisible()) { if (Illuminations.AURAS_DATA.containsKey(playerAura)) { AuraData aura = Illuminations.AURAS_DATA.get(playerAura); if (Illuminations.AURAS_DATA.get(playerAura).shouldAddParticle(this.random, this.age)) { world.addParticle(aura.particle(), this.getX(), this.getY(), this.getZ(), 0, 0, 0); } } } } // player pet String playerPet = cosmeticData.getPet(); if (playerPet != null && Illuminations.PETS_DATA.containsKey(playerPet)) { // do not render in first person or if the player is invisible //noinspection ConstantConditions if (((Config.getViewAurasFP() || MinecraftClient.getInstance().gameRenderer.getCamera().isThirdPerson()) || MinecraftClient.getInstance().player != (Object) this) && !this.isInvisible()) { if (Illuminations.PETS_DATA.containsKey(playerPet)) { DefaultParticleType overhead = Illuminations.PETS_DATA.get(playerPet); if (this.age % 20 == 0) { world.addParticle(overhead, this.getX() + Math.cos(this.bodyYaw / 50) * 0.5, this.getY() + this.getHeight() + 0.5f + Math.sin(this.age / 12f) / 12f, this.getZ() - Math.cos(this.bodyYaw / 50) * 0.5, 0, 0, 0); } } } } } } } ================================================ FILE: src/main/java/ladysnake/illuminations/mixin/RenderLayerAccessor.java ================================================ package ladysnake.illuminations.mixin; import net.minecraft.client.render.RenderLayer; import net.minecraft.client.render.VertexFormat; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Invoker; @Mixin(RenderLayer.class) public interface RenderLayerAccessor { @Invoker static RenderLayer.MultiPhase invokeOf(String name, VertexFormat vertexFormat, VertexFormat.DrawMode drawMode, int expectedBufferSize, boolean hasCrumbling, boolean translucent, RenderLayer.MultiPhaseParameters phases) { throw new IllegalStateException(" yo wtf i'm drunk "); } } ================================================ FILE: src/main/java/ladysnake/illuminations/mixin/SkullBlockMixin.java ================================================ package ladysnake.illuminations.mixin; import ladysnake.illuminations.client.Illuminations; import ladysnake.illuminations.client.config.Config; import ladysnake.illuminations.client.enums.HalloweenFeatures; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.SkullBlock; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import java.time.LocalDate; import java.time.Month; import java.util.Random; @Mixin(SkullBlock.class) public abstract class SkullBlockMixin extends BlockMixin { @Override protected void illuminations$randomDisplayTick(BlockState state, World world, BlockPos pos, Random random, CallbackInfo ci) { if ((state.getBlock() == Blocks.SKELETON_SKULL || state.getBlock() == Blocks.SKELETON_WALL_SKULL) && Illuminations.isNightTime(world) && random.nextInt(100) == 0 && ((Config.getHalloweenFeatures() == HalloweenFeatures.ENABLE && LocalDate.now().getMonth() == Month.OCTOBER) || Config.getHalloweenFeatures() == HalloweenFeatures.ALWAYS)) { world.addParticle(Illuminations.POLTERGEIST, true, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, 0f, 0f, 0f); } } } ================================================ FILE: src/main/java/ladysnake/illuminations/mixin/TitleScreenMixin.java ================================================ package ladysnake.illuminations.mixin; import ladysnake.illuminations.client.Illuminations; import ladysnake.illuminations.client.config.Config; import ladysnake.illuminations.client.data.PlayerCosmeticData; import ladysnake.illuminations.client.gui.AutoUpdateGreetingScreen; import ladysnake.illuminations.client.gui.DonateToast; import ladysnake.illuminations.client.gui.UpdateToast; import ladysnake.illuminations.updater.IlluminationsUpdater; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.TitleScreen; import net.minecraft.client.util.math.MatrixStack; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(TitleScreen.class) public abstract class TitleScreenMixin { @Inject(at = @At(value = "RETURN"), method = "render") protected void render(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo ci) { if (Config.isDisplayGreetingScreen()) { MinecraftClient.getInstance().setScreen(new AutoUpdateGreetingScreen((TitleScreen) (Object) this)); } else { if (IlluminationsUpdater.NEW_UPDATE) { UpdateToast.add(); } else { PlayerCosmeticData playerCosmeticData = Illuminations.getCosmeticData(MinecraftClient.getInstance().getSession().getProfile().getId()); if (Config.isDisplayDonationToast() && (playerCosmeticData == null || playerCosmeticData.getAura() == null || playerCosmeticData.getOverhead() == null || playerCosmeticData.getPet() == null)) { DonateToast.add(); } } } } } ================================================ FILE: src/main/java/ladysnake/illuminations/mixin/jeb/FeatureRendererMixin.java ================================================ package ladysnake.illuminations.mixin.jeb; import ladysnake.illuminations.client.Rainbowlluminations; import net.minecraft.client.render.RenderLayer; import net.minecraft.client.render.VertexConsumerProvider; import net.minecraft.client.render.entity.feature.FeatureRenderer; import net.minecraft.client.render.entity.model.EntityModel; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.passive.SheepEntity; import net.minecraft.util.Identifier; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.ModifyArg; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(FeatureRenderer.class) public abstract class FeatureRendererMixin { @Unique private static boolean isRgb; @Inject(method = "renderModel", at = @At("HEAD")) private static void captureEntity(EntityModel model, Identifier texture, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, T entity, float red, float green, float blue, CallbackInfo ci) { isRgb = !(entity instanceof SheepEntity) && entity.hasCustomName() && "jeb_".equals(entity.getName().asString()); } @ModifyArg(method = "renderModel", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/VertexConsumerProvider;getBuffer(Lnet/minecraft/client/render/RenderLayer;)Lnet/minecraft/client/render/VertexConsumer;")) private static RenderLayer replaceRenderLayer(RenderLayer base) { if (isRgb) { return Rainbowlluminations.RAINBOW_SHADER.getRenderLayer(base); } return base; } } ================================================ FILE: src/main/java/ladysnake/illuminations/mixin/jeb/LivingEntityRendererMixin.java ================================================ package ladysnake.illuminations.mixin.jeb; import ladysnake.illuminations.client.Rainbowlluminations; import net.minecraft.client.render.RenderLayer; import net.minecraft.client.render.entity.LivingEntityRenderer; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.passive.SheepEntity; import org.jetbrains.annotations.Nullable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(LivingEntityRenderer.class) public class LivingEntityRendererMixin { @Nullable @Inject(method = "getRenderLayer", at = @At("RETURN"), cancellable = true) protected void getRenderLayer(LivingEntity entity, boolean showBody, boolean translucent, boolean showOutline, CallbackInfoReturnable cir) { if (!(entity instanceof SheepEntity)) { RenderLayer baseLayer = cir.getReturnValue(); if (entity.hasCustomName() && "jeb_".equals(entity.getName().asString())) { cir.setReturnValue(baseLayer == null ? null : Rainbowlluminations.RAINBOW_SHADER.getRenderLayer(baseLayer)); } } } } ================================================ FILE: src/main/java/ladysnake/illuminations/updater/IlluminationsUpdater.java ================================================ package ladysnake.illuminations.updater; import com.google.gson.JsonElement; import com.google.gson.JsonParser; import ladysnake.illuminations.client.Illuminations; import ladysnake.illuminations.client.config.Config; import net.fabricmc.loader.api.FabricLoader; import net.fabricmc.loader.api.ModContainer; import net.fabricmc.loader.api.SemanticVersion; import net.fabricmc.loader.api.VersionParsingException; import net.minecraft.SharedConstants; import net.minecraft.client.MinecraftClient; import org.apache.logging.log4j.Level; import java.io.*; import java.net.*; import java.nio.channels.Channels; import java.nio.channels.ReadableByteChannel; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import java.util.ArrayList; import java.util.concurrent.CompletableFuture; import java.util.regex.Pattern; public class IlluminationsUpdater { static final ArrayList UNINSTALLER_PARAMS = new ArrayList<>(); private static final String UPDATES_URL = "https://illuminations.uuid.gg/latest?version="; private static final String UNINSTALLER = "illuminations-uninstaller.jar"; public static boolean NEW_UPDATE = false; public static void init() { // delete uninstaller if (Files.exists(Paths.get("mods/" + UNINSTALLER))) { try { Files.delete(Paths.get("mods/" + UNINSTALLER)); } catch (IOException e) { Illuminations.logger.log(Level.WARN, "Could not remove uninstaller because of I/O Error: " + e.getMessage()); } } if (Config.isAutoUpdate()) { // .future file Pattern pattern = Pattern.compile("^illuminations.+\\.future$"); try { Files.list(Path.of("mods")).filter(mod -> pattern.matcher(mod.getFileName().toString()).find()).forEach(path -> { try { Files.delete(path); } catch (IOException e) { Illuminations.logger.error("Failed to delete old mod file {}", path, e); } }); } catch (IOException e) { Illuminations.logger.error("Failed to delete old mod files", e); } if (!FabricLoader.getInstance().isDevelopmentEnvironment()) { Illuminations.logger.info("Looking for updates for Illuminations"); String minecraftVersion = SharedConstants.getGameVersion().getName(); String modVersion = FabricLoader.getInstance().getModContainer(Illuminations.MODID).orElseThrow().getMetadata().getVersion().getFriendlyString(); CompletableFuture.supplyAsync(() -> { try (Reader reader = new InputStreamReader(new URL(UPDATES_URL + minecraftVersion).openStream())) { JsonParser jp = new JsonParser(); JsonElement jsonElement = jp.parse(reader); return jsonElement.getAsJsonObject(); } catch (MalformedURLException e) { Illuminations.logger.error("Could not get update information because of malformed URL", e); } catch (IOException e) { Illuminations.logger.error("Could not get update information because of I/O Error", e); } return null; }).thenAcceptAsync(latestVersionJson -> { if (latestVersionJson != null) { String latestVersion = latestVersionJson.get("version").getAsString(); String latestFileName = latestVersionJson.get("filename").getAsString() + ".future"; // if not the latest version, update toast try { if (SemanticVersion.parse(latestVersion).compareTo(SemanticVersion.parse(modVersion)) > 0) { Illuminations.logger.log(Level.INFO, "Currently present version of Illuminations is " + modVersion + " while the latest version is " + latestVersion + "; downloading update"); try { // download new jar URL website = new URL(latestVersionJson.get("download").getAsString()); ReadableByteChannel rbc = Channels.newChannel(website.openStream()); FileOutputStream fos = new FileOutputStream("mods/" + latestFileName); fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); Illuminations.logger.log(Level.INFO, latestFileName + " downloaded"); ModContainer mod = FabricLoader.getInstance().getModContainer(Illuminations.MODID).orElseThrow(); URL rootUrl = mod.getRootPath().toUri().toURL(); URLConnection connection = rootUrl.openConnection(); if (connection instanceof JarURLConnection) { URI uri = ((JarURLConnection) connection).getJarFileURL().toURI(); if (uri.getScheme().equals("file")) { // add the old jar to uninstaller params String oldFilePath = Paths.get(uri).toString(); String oldFile = Paths.get(oldFilePath).getFileName().toString(); UNINSTALLER_PARAMS.add(oldFile); // add the new jar to uninstaller params UNINSTALLER_PARAMS.add(latestFileName); NEW_UPDATE = true; } } } catch (MalformedURLException e) { Illuminations.logger.log(Level.ERROR, "Could not download update because of malformed URL: " + e.getMessage()); } catch (IOException e) { Illuminations.logger.log(Level.ERROR, "Could not download update because of I/O Error: " + e.getMessage()); } catch (URISyntaxException e) { Illuminations.logger.log(Level.ERROR, "Could not download update because of URI Syntax Error: " + e.getMessage()); } } } catch (VersionParsingException e) { e.printStackTrace(); } } else { Illuminations.logger.log(Level.WARN, "Update information could not be retrieved, auto-update will not be available"); } }, MinecraftClient.getInstance()); } Illuminations.logger.log(Level.INFO, "Adding shutdown hook for uninstaller to update Illuminations"); // extract the uninstaller and add a shutdown hook to uninstall old files and install new ones InputStream in = Illuminations.class.getResourceAsStream("/" + UNINSTALLER); try { Files.copy(in, Paths.get("mods/" + UNINSTALLER), StandardCopyOption.REPLACE_EXISTING); } catch (IOException e) { e.printStackTrace(); } Runtime.getRuntime().addShutdownHook(new Thread(() -> { try { Illuminations.logger.log(Level.INFO, "Minecraft instance shutting down, starting the Illuminations uninstaller"); StringBuilder commandParams = new StringBuilder(); for (String uninstallerParam : UNINSTALLER_PARAMS) { commandParams.append(" ").append(uninstallerParam); } Runtime.getRuntime().exec("java -jar mods/" + UNINSTALLER + commandParams); } catch (IOException e) { Illuminations.logger.log(Level.ERROR, "Could not run uninstaller"); e.printStackTrace(); } })); } } } ================================================ FILE: src/main/resources/assets/illuminations/lang/de_de.json ================================================ { "title.illuminations.config": "Illuminations Config", "title.illuminations.autoUpdater": "Illuminations Auto-Updater", "description.illuminations.autoUpdater1": "Illuminations besitzt einen Auto-Updater, welcher dir es ermöglicht", "description.illuminations.autoUpdater2": "Illuminations ohne jegliche Sorgen auf dem neusten Stand zu halten.", "description.illuminations.autoUpdater3": "Er ist gerade deaktiviert, jedoch kannst du ihn hier aktivieren.", "description.illuminations.autoUpdater4": "Berücksichtige dies bitte, da es den Mod-Autor unterstützt", "description.illuminations.autoUpdater5": "und gleichzeitig deinen Mod immer automatisch updatet.", "description.illuminations.autoUpdater6": "Diese Nachricht wird nur ein Mal erscheinen und dich danach nicht mehr stören.", "description.illuminations.autoUpdater7": "Wenn du den Auto-Updater danach aktivieren oder deaktivieren möchtest", "description.illuminations.autoUpdater8": "kannst du dies jederzeit tun, indem du die Illuminations Config bearbeitest.", "option.illuminations.enable": "Aktivieren", "option.illuminations.disable": "Deaktiviert lassen", "category.illuminations.general": "Generell", "option.illuminations.eyesInTheDark": "Augen im Dunkeln", "option.tooltip.illuminations.eyesInTheDark": "Gruselige glühende Augen sind in dunklen Umgebungen zu finden.", "option.tooltip.illuminations.eyesInTheDark.default": "Standard auf ENABLE gesetzt.", "option.tooltip.illuminations.eyesInTheDark.enable": "ENABLE: Augen sind im Oktober zu sehen", "option.tooltip.illuminations.eyesInTheDark.disable": "DISABLE: Augen sind nie zu sehen", "option.tooltip.illuminations.eyesInTheDark.always": "ALWAYS: Augen sind immer zu sehen", "option.illuminations.density": "Spawn Dichte", "option.tooltip.illuminations.density": "Der Spawnraten-Multiplikator. Beeinflusst nicht die Augen im Dunkeln.", "option.tooltip.illuminations.density.lowest": "0%: Deaktiviert Beleuchtungen", "option.tooltip.illuminations.density.highest": "1000%: Multipliziert die Anzahl der Beleuchtungen mit 10", "option.illuminations.autoUpdate": "Auto-Update", "option.tooltip.illuminations.autoUpdate": "Lade und installiere automatisch neue Versionen direkt nach ihrem Release.", "option.illuminations.fireflyWhiteAlpha": "Glühwürmchen Weiß Alpha", "option.tooltip.illuminations.fireflyWhiteAlpha": "Der Alpha-Wert des glühenden Lichts der Glühwürmchen in Prozent", "option.illuminations.viewAurasFP": "Mache die Cosmetics in First-Person sichtbar", "option.tooltip.illuminations.viewAurasFP": "Ob deine eigenen Auras und Pets in First-Person gerendert werden sollen." } ================================================ FILE: src/main/resources/assets/illuminations/lang/en_us.json ================================================ { "title.illuminations.config": "Illuminations Config", "title.illuminations.autoUpdater": "Illuminations Auto-Updater", "description.illuminations.autoUpdater1": "Illuminations possess an auto-updater that can allow you to always keep", "description.illuminations.autoUpdater2": "Illuminations up-to-date without needing you to worry about anything.", "description.illuminations.autoUpdater3": "It is disabled by default, but you can choose to enable it right here.", "description.illuminations.autoUpdater4": "Please consider it as it helps support the mod author", "description.illuminations.autoUpdater5": "as well as always keeping you up to date with the latest update.", "description.illuminations.autoUpdater6": "This screen will only appear once and won't bother you again.", "description.illuminations.autoUpdater7": "If you wish to enable or disable the auto-updater after that point,", "description.illuminations.autoUpdater8": "you can do that at any time by modifying the Illuminations config.", "option.illuminations.enable": "Enable", "option.illuminations.disable": "Keep disabled", "category.illuminations.general": "General", "category.illuminations.general.description": "General settings", "category.illuminations.overworld": "Overworld", "category.illuminations.overworld.description": "Settings for overworld biomes", "category.illuminations.theNether": "The Nether", "category.illuminations.theNether.description": "Settings for nether biomes", "category.illuminations.theEnd": "The End", "category.illuminations.theEnd.description": "Settings for end biomes", "category.illuminations.other": "Other", "category.illuminations.other.description": "Settings for all other biomes not defined in other settings", "category.illuminations.auraSettings": "Aura Settings", "option.illuminations.halloweenFeatures": "Halloween Features", "option.tooltip.illuminations.halloweenFeatures": "Halloween features like spooky glowing eyes, pumpkin spirits and poltergeists.", "option.tooltip.illuminations.halloweenFeatures.default": "Set on ENABLE by default.", "option.tooltip.illuminations.halloweenFeatures.enable": "ENABLE: Halloween features will appear during October", "option.tooltip.illuminations.halloweenFeatures.disable": "DISABLE: Halloween features will never appear", "option.tooltip.illuminations.halloweenFeatures.always": "ALWAYS: Halloween features will appear no matter the date", "option.illuminations.eyesInTheDarkSpawnRate": "Eyes in the Dark Spawn Rate", "option.tooltip.illuminations.eyesInTheDarkSpawnRate": "The spawn rate of eyes in the dark.", "option.tooltip.illuminations.eyesInTheDarkSpawnRate.default": "Set on MEDIUM by default.", "option.tooltip.illuminations.eyesInTheDarkSpawnRate.low": "LOW: Eyes will appear in low quantities", "option.tooltip.illuminations.eyesInTheDarkSpawnRate.medium": "MEDIUM: Eyes will appear in medium quantities", "option.tooltip.illuminations.eyesInTheDarkSpawnRate.high": "HIGH: Eyes will appear in high quantities", "option.illuminations.willOWispsSpawnRate": "Will O' Wisps Spawn Rate", "option.tooltip.illuminations.willOWispsSpawnRate": "The spawn rate of will o' wisps.", "option.tooltip.illuminations.willOWispsSpawnRate.default": "Set on MEDIUM by default.", "option.tooltip.illuminations.willOWispsSpawnRate.disable": "DISABLE: Will O' Wisps don't appear", "option.tooltip.illuminations.willOWispsSpawnRate.low": "LOW: Will O' Wisps appear in low quantities", "option.tooltip.illuminations.willOWispsSpawnRate.medium": "MEDIUM: Will O' Wisps appear in medium quantities", "option.tooltip.illuminations.willOWispsSpawnRate.high": "HIGH: Will O' Wisps appear in high quantities", "option.illuminations.chorusPetalsSpawnMultiplier": "Chorus Petals Spawn Multiplier", "option.tooltip.illuminations.chorusPetalsSpawnMultiplier": "The spawn rate multiplier of chorus petals.", "option.tooltip.illuminations.chorusPetalsSpawnMultiplier.lowest": "0x: Disables chorus petals", "option.tooltip.illuminations.chorusPetalsSpawnMultiplier.highest": "10x: Multiplies the amount of chorus petals appearing by 10", "option.illuminations.density": "Spawn Density", "option.tooltip.illuminations.density": "The spawn rate percentage multiplier. Does not affect eyes in the dark.", "option.tooltip.illuminations.density.lowest": "0%: Disables illuminations", "option.tooltip.illuminations.density.highest": "1000%: Multiplies the amount of illuminations appearing by 10", "option.illuminations.fireflySpawnAlways": "Fireflies Spawn Always", "option.tooltip.illuminations.fireflySpawnAlways": "Fireflies spawn every time of day.", "option.illuminations.fireflySpawnUnderground": "Fireflies Spawn Underground", "option.tooltip.illuminations.fireflySpawnUnderground": "Fireflies spawn underground.", "option.illuminations.autoUpdate": "Auto-Update", "option.tooltip.illuminations.autoUpdate": "Automatically download and install new versions when they come out.", "option.illuminations.debugMode": "Log Debug Mode", "option.tooltip.illuminations.debugMode": "Enable debug mode logs to troubleshoot issues with cosmetics loading.", "option.illuminations.fireflyWhiteAlpha": "Firefly White Alpha", "option.tooltip.illuminations.fireflyWhiteAlpha": "The alpha value of the firefly center glow, in percentage.", "option.illuminations.fireflyRainbow": "Firefly §c§oR§6§oA§e§oI§a§oN§9§oB§b§oO§5§oW §rMode", "option.illuminations.viewAurasFP": "See Cosmetics in First Person", "option.tooltip.illuminations.viewAurasFP": "Whether your own auras and pets should render while in first person.", "option.illuminations.displayDonationToast": "Display donation toast", "option.tooltip.illuminations.displayDonationToast": "If you already donated or don't want to donate, set this option to false.", "option.illuminations.fireflySpawnRate": "Firefly Spawn Rate", "option.tooltip.illuminations.fireflySpawnRate": "The spawn rate of fireflies.", "option.tooltip.illuminations.fireflySpawnRate.disable": "DISABLE: Fireflies don't appear", "option.tooltip.illuminations.fireflySpawnRate.low": "LOW: Fireflies appear in low quantities", "option.tooltip.illuminations.fireflySpawnRate.medium": "MEDIUM: Fireflies appear in medium quantities", "option.tooltip.illuminations.fireflySpawnRate.high": "HIGH: Fireflies appear in high quantities", "option.illuminations.fireflyColor": "Firefly Color", "option.tooltip.illuminations.fireflyColor": "The color of fireflies.", "option.illuminations.glowwormSpawnRate": "Glowworm Spawn Rate", "option.tooltip.illuminations.glowwormSpawnRate.disable": "DISABLE: Glowworms don't appear", "option.tooltip.illuminations.glowwormSpawnRate.low": "LOW: Glowworms appear in low quantities", "option.tooltip.illuminations.glowwormSpawnRate.medium": "MEDIUM: Glowworms appear in medium quantities", "option.tooltip.illuminations.glowwormSpawnRate.high": "HIGH: Glowworms appear in high quantities", "option.tooltip.illuminations.glowwormSpawnRate": "The spawn rate of glowworms.", "option.illuminations.planktonSpawnRate": "Plankton Spawn Rate", "option.tooltip.illuminations.planktonSpawnRate": "The spawn rate of plankton.", "option.tooltip.illuminations.planktonSpawnRate.disable": "DISABLE: Plankton doesn't appear", "option.tooltip.illuminations.planktonSpawnRate.low": "LOW: Plankton appears in low quantities", "option.tooltip.illuminations.planktonSpawnRate.medium": "MEDIUM: Plankton appears in medium quantities", "option.tooltip.illuminations.planktonSpawnRate.high": "HIGH: Plankton appears in high quantities", "option.illuminations.biome.forest": "Forest", "option.illuminations.biome.taiga": "Taiga", "option.illuminations.biome.snowy": "Snowy", "option.illuminations.biome.plains": "Plains", "option.illuminations.biome.desert": "Desert", "option.illuminations.biome.savanna": "Savanna", "option.illuminations.biome.jungle": "Jungle", "option.illuminations.biome.beach": "Beach", "option.illuminations.biome.swamp": "Swamp", "option.illuminations.biome.river": "River", "option.illuminations.biome.ocean": "Ocean", "option.illuminations.biome.warmOcean": "Warm Ocean", "option.illuminations.biome.badlands": "Badlands", "option.illuminations.biome.mountains": "Mountains", "option.illuminations.biome.dripstoneCaves": "Dripstone Caves", "option.illuminations.biome.lushCaves": "Lush Caves", "option.illuminations.biome.mushroom": "Mushroom", "option.illuminations.biome.theVoid": "The Void", "option.illuminations.biome.netherWastes": "Nether Wastes", "option.illuminations.biome.crimsonForest": "Crimson Forest", "option.illuminations.biome.warpedForest": "Warped Forest", "option.illuminations.biome.soulSandValley": "Soul Sand Valley", "option.illuminations.biome.basaltDeltas": "Basalt Deltas", "option.illuminations.biome.theEnd": "The End", "option.illuminations.biome.smallEndIslands": "Small End Islands", "option.illuminations.biome.endMidlands": "End Midlands", "option.illuminations.biome.endHighlands": "End Highlands", "option.illuminations.biome.endBarrens": "End Barrens", "option.illuminations.biome.other": "Other", "option.tooltip.illuminations.biome": "Biomes in this category:" } ================================================ FILE: src/main/resources/assets/illuminations/lang/id_id.json ================================================ { "title.illuminations.config": "Konfigurasi Illuminations", "title.illuminations.autoUpdater": "Illuminations Pembaruan-Otomatis", "description.illuminations.autoUpdater1": "Illuminations memiliki pembaruan-otomatis yang memungkinkan versi kamu selalu terbaru", "description.illuminations.autoUpdater2": "Menjaga Illuminations tetap up-to-date tanpa perlu kamu khawatir.", "description.illuminations.autoUpdater3": "Saat ini nonaktif dari bawaan, tapi kamu bisa mengaktifkannya disini.", "description.illuminations.autoUpdater4": "Harap pertimbangkan karena ini dapat membantu mendukung pembuat mod", "description.illuminations.autoUpdater5": "serta selalu menjagamu tetap up-to-date dengan pembaruan terbaru.", "description.illuminations.autoUpdater6": "Layar ini hanya akan muncul sekali dan tidak akan mengganggumu lagi.", "description.illuminations.autoUpdater7": "Jika kamu ingin mengaktifkan atau menonaktifkan pembaruan-otomatis setelah point itu,", "description.illuminations.autoUpdater8": "kamu dapat melakukan itu kapan saja dengan mengubah konfigurasi Illuminations.", "option.illuminations.enable": "Aktifkan", "option.illuminations.disable": "Tetap nonaktifkan", "category.illuminations.general": "Umum", "option.illuminations.eyesInTheDark": "Mata dalam Kegelapan", "option.tooltip.illuminations.eyesInTheDark": "Mata bersinar yang seram muncul dalam lingkungan bercahaya redup.", "option.tooltip.illuminations.eyesInTheDark.default": "Setel diaktifkan dari bawaan.", "option.tooltip.illuminations.eyesInTheDark.enable": "AKTIFKAN: Mata akan muncul selama Oktober", "option.tooltip.illuminations.eyesInTheDark.disable": "NONAKTIFKAN: Mata tidak akan pernah muncul", "option.tooltip.illuminations.eyesInTheDark.always": "SELALU: Mata selalu bisa dilihat", "option.illuminations.density": "Kepadatan Muncul", "option.tooltip.illuminations.density": "Pengganda persentase tingkat kemunculan. Tidak mempengaruhi Mata dalam Kegelapan.", "option.tooltip.illuminations.density.lowest": "0%: Nonaktifkan illuminations", "option.tooltip.illuminations.density.highest": "1000%: Menggandakan 10x jumlah dari kemunculan illuminations", "option.illuminations.autoUpdate": "Pembaruan-Otomatis", "option.tooltip.illuminations.autoUpdate": "Otomatis unduh dan memasang versi terbaru ketika keluar.", "option.illuminations.fireflyWhiteAlpha": "Kunang-kunang Putih Alpha", "option.tooltip.illuminations.fireflyWhiteAlpha": "Jumlah alpha sinar ditengah kunang-kunang, dalam persentase.", "option.illuminations.viewAurasFP": "Lihat Cosmetics dalam First Person", "option.tooltip.illuminations.viewAurasFP": "Apakah aura dan peliharaan kamu harus ditampilkan ketika dalam first person" } ================================================ FILE: src/main/resources/assets/illuminations/lang/ru_ru.json ================================================ { "title.illuminations.config": "Настройки Illuminations", "title.illuminations.autoUpdater": "Автоматическое обновление Illuminations", "description.illuminations.autoUpdater1": "Illuminations имеет автоматическое обновление, которое позволяет поддерживать", "description.illuminations.autoUpdater2": "Illuminations актуальным, не беспокоя вас об этом.", "description.illuminations.autoUpdater3": "Оно отключено по умолчанию, но вы можете включить его здесь.", "description.illuminations.autoUpdater4": "Пожалуйста, примите это во внимание, так как это помогает поддержать автора мода,", "description.illuminations.autoUpdater5": "а также всегда держать вас в курсе последних обновлений.", "description.illuminations.autoUpdater6": "Этот экран появится только один раз и больше вас не побеспокоит.", "description.illuminations.autoUpdater7": "Если вы хотите включить или отключить автоматическое обновление после этого,", "description.illuminations.autoUpdater8": "вы можете сделать это в любое время, изменив конфигурацию Illuminations.", "option.illuminations.enable": "Включить", "option.illuminations.disable": "Оставить выключенным", "category.illuminations.general": "Основное", "category.illuminations.general.description": "Главные настройки", "category.illuminations.overworld": "Верхний мир", "category.illuminations.overworld.description": "Настройки для биомов верхнего мира", "category.illuminations.theNether": "Незер", "category.illuminations.theNether.description": "Настройки для биомов Незера", "category.illuminations.theEnd": "Энд", "category.illuminations.theEnd.description": "Настройки биомов энда", "category.illuminations.other": "Другое", "category.illuminations.other.description": "Настройки для биомов, не указанных в остальных настройках", "category.illuminations.auraSettings": "Настройки ауры", "option.illuminations.halloweenFeatures": "Хэллоуинские особенности", "option.tooltip.illuminations.halloweenFeatures": "Хэллоуинские особенности, такие как жуткие светящиеся глаза, духи тыкв и полтергейсты.", "option.tooltip.illuminations.halloweenFeatures.default": "Установить ВКЛЮЧЕНО по умолчанию.", "option.tooltip.illuminations.halloweenFeatures.enable": "ВКЛЮЧЕНО: Хэллоуинские особенности будут появляться в течение октября", "option.tooltip.illuminations.halloweenFeatures.disable": "ВЫКЛЮЧЕНО: Хэллоуинские особенности не будут появляться вообще", "option.tooltip.illuminations.halloweenFeatures.always": "ВСЕГДА: Хэллоуинские особенности будут появляться всегда", "option.illuminations.eyesInTheDarkSpawnRate": "Частота появления Глаз в темноте", "option.tooltip.illuminations.eyesInTheDarkSpawnRate": "Шанс появления Глаз в темноте.", "option.tooltip.illuminations.eyesInTheDarkSpawnRate.default": "Установить СРЕДНИЙ по умолчанию.", "option.tooltip.illuminations.eyesInTheDarkSpawnRate.low": "НИЗКИЙ: Глаза будут появляться крайне редко", "option.tooltip.illuminations.eyesInTheDarkSpawnRate.medium": "СРЕДНИЙ: Глаза будут появляться со средней частотой", "option.tooltip.illuminations.eyesInTheDarkSpawnRate.high": "ВЫСОКИЙ: Глаза будут появляться очень часто", "option.illuminations.willOWispsSpawnRate": "Частота появления блуждающих огоньков", "option.tooltip.illuminations.willOWispsSpawnRate": "Частота появления блуждающих огоньков", "option.tooltip.illuminations.willOWispsSpawnRate.default": "Установить СРЕДНИЙ по умолчанию.", "option.tooltip.illuminations.willOWispsSpawnRate.disable": "ОТКЛЮЧИТЬ: Блуждающие огоньки не будут появляться", "option.tooltip.illuminations.willOWispsSpawnRate.low": "НИЗКИЙ: Блуждающие огоньки будут появляться крайне редко", "option.tooltip.illuminations.willOWispsSpawnRate.medium": "СРЕДНИЙ: Блуждающие огоньки будут появляться со средней частотой", "option.tooltip.illuminations.willOWispsSpawnRate.high": "ВЫСОКИЙ: Блуждающие огоньки будут появляться очень часто", "option.illuminations.chorusPetalsSpawnMultiplier": "Количество лепестков хоруса", "option.tooltip.illuminations.chorusPetalsSpawnMultiplier": "Множитель частоты появления лепестков хоруса.", "option.tooltip.illuminations.chorusPetalsSpawnMultiplier.lowest": "0x: Отключить лепестки хоруса", "option.tooltip.illuminations.chorusPetalsSpawnMultiplier.highest": "10x: умножает частоту появления лепестков хоруса на 10", "option.illuminations.density": "Плотность появления", "option.tooltip.illuminations.density": "Множитель частоты появления. Не влияет на глаза во тьме.", "option.tooltip.illuminations.density.lowest": "0%: Отключить иллюминации", "option.tooltip.illuminations.density.highest": "1000%: Частота иллюминаций умножится на 10", "option.illuminations.fireflySpawnAlways": "Светлячки появляются всегда", "option.tooltip.illuminations.fireflySpawnAlways": "Светлячки появляются в любое время дня.", "option.illuminations.fireflySpawnUnderground": "Светлячки появляются под землей", "option.tooltip.illuminations.fireflySpawnUnderground": "Светлячки появляются под землей.", "option.illuminations.autoUpdate": "Авто-обновление", "option.tooltip.illuminations.autoUpdate": "Автоматически скачивать и устанавливать новые версии.", "option.illuminations.debugMode": "Режим отладки логов", "option.tooltip.illuminations.debugMode": "Включите журналы режима отладки для устранения проблем с загрузкой косметических средств..", "option.illuminations.fireflyWhiteAlpha": "Белая прозрачность светлячков", "option.tooltip.illuminations.fireflyWhiteAlpha": "Прозрачность центрального свечения светлячков.", "option.illuminations.fireflyRainbow": "§c§oР§6§oА§e§oД§a§oУ§9§oЖ§b§oН§5§oЫЙ §rРежим Светлячков", "option.illuminations.viewAurasFP": "Видеть косметику от первого лица", "option.tooltip.illuminations.viewAurasFP": "Должны ли ваши собственные ауры и питомцы отображаться от первого лица.", "option.illuminations.displayDonationToast": "Показать сообщение о пожертвовании", "option.tooltip.illuminations.displayDonationToast": "Если вы уже пожертвовали или не хотите пожертвовать, установите для этого параметра значение false..", "option.illuminations.fireflySpawnRate": "Частота появления светлячков", "option.tooltip.illuminations.fireflySpawnRate": "Частота появления светлячков.", "option.tooltip.illuminations.fireflySpawnRate.disable": "ОТКЛЮЧЕНА: Светлячки не появляются", "option.tooltip.illuminations.fireflySpawnRate.low": "НИЗКАЯ: Светлячки появляются крайне редко", "option.tooltip.illuminations.fireflySpawnRate.medium": "СРЕДНЯЯ: Светлячки появляются со средней частотой", "option.tooltip.illuminations.fireflySpawnRate.high": "ВЫСОКАЯ: Светлячки появляются очень часто", "option.illuminations.fireflyColor": "Цвет светлячков", "option.tooltip.illuminations.fireflyColor": "Цвет светлячков.", "option.illuminations.glowwormSpawnRate": "Частота появления светящихся червей.", "option.tooltip.illuminations.glowwormSpawnRate.disable": "ОТКЛЮЧЕНА: Светящиеся черви не появляются", "option.tooltip.illuminations.glowwormSpawnRate.low": "НИЗКАЯ: Светящиеся черви появляются крайне редко", "option.tooltip.illuminations.glowwormSpawnRate.medium": "СРЕДНЯЯ: Светящиеся черви появляются со средней частотой", "option.tooltip.illuminations.glowwormSpawnRate.high": "ВЫСОКАЯ: Светящиеся черви появляются очень часто", "option.tooltip.illuminations.glowwormSpawnRate": "Частота появления светящихся червей.", "option.illuminations.planktonSpawnRate": "Частота появления планктона", "option.tooltip.illuminations.planktonSpawnRate": "Частота появления планктона.", "option.tooltip.illuminations.planktonSpawnRate.disable": "ОТКЛЮЧЕНА: Планктон появляется", "option.tooltip.illuminations.planktonSpawnRate.low": "НИЗКАЯ: Планктон появляется крайне редко", "option.tooltip.illuminations.planktonSpawnRate.medium": "СРЕДНЯЯ: Планктон появляется со средней частотой", "option.tooltip.illuminations.planktonSpawnRate.high": "ВЫСОКАЯ: Планктон появляется очень часто", "option.illuminations.biome.forest": "Лес", "option.illuminations.biome.taiga": "Тайга", "option.illuminations.biome.snowy": "Снежный", "option.illuminations.biome.plains": "Равнины", "option.illuminations.biome.desert": "Пустыня", "option.illuminations.biome.savanna": "Саванна", "option.illuminations.biome.jungle": "Джунгли", "option.illuminations.biome.beach": "Пляж", "option.illuminations.biome.swamp": "Болота", "option.illuminations.biome.river": "Река", "option.illuminations.biome.ocean": "Океан", "option.illuminations.biome.warmOcean": "Тёплый океан", "option.illuminations.biome.badlands": "Меза", "option.illuminations.biome.mountains": "Горы", "option.illuminations.biome.dripstoneCaves": "Карстовые пещеры", "option.illuminations.biome.lushCaves": "Пышные пещеры", "option.illuminations.biome.mushroom": "Грибной остров", "option.illuminations.biome.theVoid": "Пустота", "option.illuminations.biome.netherWastes": "Nether Wastes", "option.illuminations.biome.crimsonForest": "Багровый лес", "option.illuminations.biome.warpedForest": "Искажённый лес", "option.illuminations.biome.soulSandValley": "Долины песка душ", "option.illuminations.biome.basaltDeltas": "Базальтовые дельты", "option.illuminations.biome.theEnd": "Энд", "option.illuminations.biome.smallEndIslands": "Маленькие острова Энда", "option.illuminations.biome.endMidlands": "End Midlands", "option.illuminations.biome.endHighlands": "Горы Энда", "option.illuminations.biome.endBarrens": "Степи Энда", "option.illuminations.biome.other": "Другой", "option.tooltip.illuminations.biome": "Биомы в этой категории:" } ================================================ FILE: src/main/resources/assets/illuminations/lang/zh_cn.json ================================================ { "title.illuminations.config": "Illuminations 配置", "category.illuminations.general": "通用", "option.illuminations.eyesInTheDark": "暗处的眼睛", "option.tooltip.illuminations.eyesInTheDark": "光照强度较低的环境中出现的可怖眼睛", "option.tooltip.illuminations.eyesInTheDark.default": "默认为 ENABLE。", "option.tooltip.illuminations.eyesInTheDark.enable": "ENABLE:仅在十月出现。", "option.tooltip.illuminations.eyesInTheDark.disable": "DISABLE:从不出现。", "option.tooltip.illuminations.eyesInTheDark.always": "ALWAYS:全年出现。", "option.illuminations.density": "生成密度", "option.tooltip.illuminations.density": "在等体积下的生成率(百分比)。不影响暗处的眼睛。", "option.tooltip.illuminations.density.lowest": "0%:禁用。", "option.tooltip.illuminations.density.highest": "1000%:十倍于默认值。", "option.illuminations.autoUpdate": "自动更新", "option.tooltip.illuminations.autoUpdate": "自动下载及安装新版本。", "option.illuminations.fireflyWhiteAlpha": "萤火虫透明度", "option.tooltip.illuminations.fireflyWhiteAlpha": "萤火虫中心的透明度(百分比)。" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/entity/will_o_wisp.json ================================================ { "material": "canvas:emissive_no_diffuse" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/particle/ace_pride_pet.json ================================================ { "material": "canvas:emissive_no_diffuse" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/particle/autumn_leaves.json ================================================ { "material": "canvas:emissive_no_diffuse" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/particle/bi_pride_pet.json ================================================ { "material": "canvas:emissive_no_diffuse" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/particle/chorus_aura.json ================================================ { "material": "canvas:emissive_no_diffuse" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/particle/chorus_petal.json ================================================ { "material": "canvas:emissive_no_diffuse" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/particle/confetti.json ================================================ { "material": "canvas:emissive_no_diffuse" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/particle/dissolution_wisp_pet.json ================================================ { "material": "canvas:emissive_no_diffuse" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/particle/eyes.json ================================================ { "material": "canvas:emissive_no_diffuse" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/particle/firefly.json ================================================ { "material": "canvas:emissive_no_diffuse" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/particle/ghostly_aura.json ================================================ { "material": "canvas:emissive_no_diffuse" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/particle/glowworm.json ================================================ { "material": "canvas:emissive_no_diffuse" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/particle/goldenrod_aura.json ================================================ { "material": "canvas:emissive_no_diffuse" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/particle/intersex_pride_pet.json ================================================ { "material": "canvas:emissive_no_diffuse" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/particle/jacko_pet.json ================================================ { "material": "canvas:emissive_no_diffuse" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/particle/lesbian_pride_pet.json ================================================ { "material": "canvas:emissive_no_diffuse" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/particle/nb_pride_pet.json ================================================ { "material": "canvas:emissive_no_diffuse" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/particle/plankton.json ================================================ { "material": "canvas:emissive_no_diffuse" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/particle/pride_pet.json ================================================ { "material": "canvas:emissive_no_diffuse" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/particle/prismarine_aura.json ================================================ { "material": "canvas:emissive_no_diffuse" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/particle/prismarine_crystal.json ================================================ { "material": "canvas:emissive_no_diffuse" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/particle/prismatic_confetti.json ================================================ { "material": "canvas:emissive_no_diffuse" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/particle/sculk_tendril.json ================================================ { "material": "canvas:emissive_transform" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/particle/shadowbringer_aura.json ================================================ { "material": "canvas:emissive_no_diffuse" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/particle/trans_pride_pet.json ================================================ { "material": "canvas:emissive_no_diffuse" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/particle/twilight_aura.json ================================================ { "material": "canvas:emissive_no_diffuse" } ================================================ FILE: src/main/resources/assets/illuminations/materialmaps/particle/wisp_trail.json ================================================ { "material": "canvas:emissive_no_diffuse" } ================================================ FILE: src/main/resources/assets/illuminations/particles/ace_pride_pet.json ================================================ { "textures": [ ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/agender_pride_pet.json ================================================ { "textures": [ ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/aro_pride_pet.json ================================================ { "textures": [ ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/autumn_leaves.json ================================================ { "textures": [ "illuminations:autumn_leaf_0", "illuminations:autumn_leaf_1", "illuminations:autumn_leaf_2" ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/bi_pride_pet.json ================================================ { "textures": [ ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/chorus_aura.json ================================================ { "textures": [ "illuminations:chorus_petal_0", "illuminations:chorus_petal_1", "illuminations:chorus_petal_2" ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/chorus_petal.json ================================================ { "textures": [ "illuminations:chorus_petal_0", "illuminations:chorus_petal_1", "illuminations:chorus_petal_2" ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/confetti.json ================================================ { "textures": [ "illuminations:confetti" ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/crying_lantern_pet.json ================================================ { "textures": [ ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/dissolution_wisp_pet.json ================================================ { "textures": [ "illuminations:dissolution_wisp" ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/ember.json ================================================ { "textures": [ "illuminations:ember" ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/ember_trail.json ================================================ { "textures": [ "illuminations:ember" ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/eyes.json ================================================ { "textures": [ "illuminations:eyes_0", "illuminations:eyes_1", "illuminations:eyes_2", "illuminations:eyes_3" ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/firefly.json ================================================ { "textures": [ "illuminations:firefly" ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/founding_skull_pet.json ================================================ { "textures": [ ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/gay_pride_pet.json ================================================ { "textures": [ ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/ghostly.json ================================================ { "textures": [ "illuminations:ghostly_0", "illuminations:ghostly_1", "illuminations:ghostly_2", "illuminations:ghostly_3" ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/ghostly_aura.json ================================================ { "textures": [ "illuminations:ghostly_0", "illuminations:ghostly_1", "illuminations:ghostly_2", "illuminations:ghostly_3" ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/glowworm.json ================================================ { "textures": [ "illuminations:firefly" ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/golden_will_pet.json ================================================ { "textures": [ ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/goldenrod_aura.json ================================================ { "textures": [ "illuminations:rune1", "illuminations:rune2", "illuminations:rune3", "illuminations:rune4" ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/intersex_pride_pet.json ================================================ { "textures": [ ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/jacko_pet.json ================================================ { "textures": [ "illuminations:jacko" ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/lantern_pet.json ================================================ { "textures": [ ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/lesbian_pride_pet.json ================================================ { "textures": [ ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/nb_pride_pet.json ================================================ { "textures": [ ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/pan_pride_pet.json ================================================ { "textures": [ ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/plankton.json ================================================ { "textures": [ "illuminations:firefly" ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/poltergeist.json ================================================ { "textures": [ ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/poltergeist_pet.json ================================================ { "textures": [ ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/pride_pet.json ================================================ { "textures": [ ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/prismarine_aura.json ================================================ { "textures": [ "illuminations:prismarine_crystal_0", "illuminations:prismarine_crystal_1", "illuminations:prismarine_crystal_2" ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/prismarine_crystal.json ================================================ { "textures": [ "illuminations:prismarine_crystal_0", "illuminations:prismarine_crystal_1", "illuminations:prismarine_crystal_2" ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/prismatic_confetti.json ================================================ { "textures": [ "illuminations:confetti" ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/pumpkin_spirit.json ================================================ { "textures": [ ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/pumpkin_spirit_pet.json ================================================ { "textures": [ ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/sculk_tendril.json ================================================ { "textures": [ "illuminations:tendril_active", "illuminations:tendril_inactive" ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/shadowbringer_aura.json ================================================ { "textures": [ "illuminations:shade_0", "illuminations:shade_1", "illuminations:shade_2", "illuminations:shade_3" ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/soothing_lantern_pet.json ================================================ { "textures": [ ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/soul_lantern_pet.json ================================================ { "textures": [ ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/trans_pride_pet.json ================================================ { "textures": [ ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/twilight_aura.json ================================================ { "textures": [ "illuminations:firefly" ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/will_o_wisp.json ================================================ { "textures": [ ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/will_o_wisp_pet.json ================================================ { "textures": [ ] } ================================================ FILE: src/main/resources/assets/illuminations/particles/wisp_trail.json ================================================ { "textures": [ "illuminations:wisp_trail" ] } ================================================ FILE: src/main/resources/assets/illuminations/shaders/core/jeb.fsh ================================================ #version 150 uniform sampler2D Sampler0; uniform sampler2D Sampler1; uniform sampler2D Sampler2; in vec4 vertexColor; in vec2 texCoord0; in vec2 texCoord1; in vec2 texCoord2; in vec4 normal; out vec4 fragColor; uniform float Time; uniform vec2 WobbleAmount; vec3 rgb2hsv(vec3 c) { vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy); vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx); float d = q.x - min(q.w, q.y); float e = 1.0e-10; return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); } vec3 hsv2rgb(vec3 c) { vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); } void main() { vec4 rgb = texture(Sampler0, texCoord0); if (rgb.a == 0) discard; vec3 hsv = rgb2hsv(rgb.rgb); hsv.x = fract(hsv.x + Time/5.0); fragColor = vec4(hsv2rgb(hsv), 1.0); } ================================================ FILE: src/main/resources/assets/illuminations/shaders/core/jeb.json ================================================ { "blend": { "func": "add", "srcrgb": "srcalpha", "dstrgb": "1-srcalpha" }, "vertex": "illuminations:jeb", "fragment": "illuminations:jeb", "attributes": [ "Position", "Color", "UV0", "UV1", "UV2", "Normal" ], "samplers": [ { "name": "Sampler0" }, { "name": "Sampler1" }, { "name": "Sampler2" } ], "uniforms": [ { "name": "ModelViewMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "Time", "type": "float", "count": 1, "values": [ 0.0 ] } ] } ================================================ FILE: src/main/resources/assets/illuminations/shaders/core/jeb.vsh ================================================ #version 150 in vec3 Position; in vec4 Color; in vec2 UV0; in vec2 UV1; in vec2 UV2; in vec3 Normal; uniform mat4 ModelViewMat; uniform mat4 ProjMat; out vec4 vertexColor; out vec2 texCoord0; out vec2 texCoord1; out vec2 texCoord2; out vec4 normal; void main() { gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0); vertexColor = Color; texCoord0 = UV0; texCoord1 = UV1; texCoord2 = UV2; normal = ProjMat * ModelViewMat * vec4(Normal, 0.0); } ================================================ FILE: src/main/resources/assets/illuminations/textures/particle/dissolution_wisp.png.mcmeta ================================================ { "animation": { "frametime": 1 } } ================================================ FILE: src/main/resources/assets/illuminations/textures/particle/tendril_active.png.mcmeta ================================================ { "animation": { "frametime": 1 } } ================================================ FILE: src/main/resources/assets/illuminations/textures/particle/tendril_inactive.png.mcmeta ================================================ { "animation": { "frametime": 2 } } ================================================ FILE: src/main/resources/assets/minecraft/materialmaps/entity/player.json ================================================ { "map": [ { "predicate": { "materialPredicate": { "texture": "illuminations:textures/entity/frost_crown.png" } }, "material": "canvas:emissive_transform" }, { "predicate": { "materialPredicate": { "texture": "illuminations:textures/entity/solar_crown.png" } }, "material": "canvas:emissive_transform" }, { "predicate": { "materialPredicate": { "texture": "illuminations:textures/entity/chorus_crown.png" } }, "material": "canvas:emissive_transform" }, { "predicate": { "materialPredicate": { "texture": "illuminations:textures/entity/bloodfiend_crown.png" } }, "material": "canvas:emissive_transform" }, { "predicate": { "materialPredicate": { "texture": "illuminations:textures/entity/dreadlich_crown.png" } }, "material": "canvas:emissive_transform" }, { "predicate": { "materialPredicate": { "texture": "illuminations:textures/entity/mooncult_crown.png" } }, "material": "canvas:emissive_transform" }, { "predicate": { "materialPredicate": { "texture": "illuminations:textures/entity/glowsquid_cult_crown.png" } }, "material": "canvas:emissive_transform" }, { "predicate": { "materialPredicate": { "texture": "illuminations:textures/entity/timeaspect_cult_crown.png" } }, "material": "canvas:emissive_transform" }, { "predicate": { "materialPredicate": { "texture": "illuminations:textures/entity/voidheart_tiara.png" } }, "material": "canvas:emissive_transform" }, { "predicate": { "materialPredicate": { "texture": "illuminations:textures/entity/summerbreeze_wreath.png" } }, "material": "canvas:emissive_transform" }, { "predicate": { "materialPredicate": { "texture": "illuminations:textures/entity/springfae_horns.png" } }, "material": "canvas:emissive_transform" }, { "predicate": { "materialPredicate": { "texture": "illuminations:textures/entity/deepsculk_horns.png" } }, "material": "canvas:emissive_transform" }, { "predicate": { "materialPredicate": { "texture": "illuminations:textures/entity/worldweaver_halo.png" } }, "material": "canvas:emissive_transform" }, { "predicate": { "materialPredicate": { "texture": "illuminations:textures/entity/drip_color.png" } }, "material": "canvas:emissive_transform" }, { "predicate": { "materialPredicate": { "texture": "illuminations:textures/entity/pyro_crown.png" } }, "material": "canvas:emissive_transform" } ] } ================================================ FILE: src/main/resources/assets/minecraft/shaders/core/particle.fsh ================================================ #version 150 #moj_import uniform sampler2D Sampler0; uniform vec4 ColorModulator; uniform float FogStart; uniform float FogEnd; uniform vec4 FogColor; in float vertexDistance; in vec2 texCoord0; in vec4 vertexColor; out vec4 fragColor; void main() { vec4 color = texture(Sampler0, texCoord0) * vertexColor * ColorModulator; // Mojang stole my fucking smooth fading. I opened my mod an no more fading. Can't have shit in Minecraft. if (color.a < 0.000001) { discard; } fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor); } ================================================ FILE: src/main/resources/fabric.mod.json ================================================ { "schemaVersion": 1, "id": "illuminations", "version": "${version}", "name": "Illuminations", "description": "Fireflies, other illuminations to make your world more enjoyable in darkness and player cosmetics.", "authors": [ "doctor4t" ], "contact": { "homepage": "https://illuminations.uuid.gg/", "sources": "https://github.com/Ladysnake/Illuminations", "issues": "https://github.com/Ladysnake/Illuminations/issues" }, "license": "Code: GNU GPLv3; Art: ARR", "icon": "assets/illuminations/illuminations.png", "environment": "client", "entrypoints": { "client": [ "ladysnake.illuminations.client.Illuminations" ], "modmenu": [ "ladysnake.illuminations.client.IlluminationsModMenuIntegration" ] }, "mixins": [ "illuminations.mixins.json" ], "accessWidener": "illuminations.accesswidener", "depends": { "fabricloader": ">=0.4.0", "fabric": "*" } } ================================================ FILE: src/main/resources/illuminations.accesswidener ================================================ accessWidener v1 named accessible class net/minecraft/client/render/RenderLayer$MultiPhase accessible class net/minecraft/client/render/RenderLayer$MultiPhaseParameters ================================================ FILE: src/main/resources/illuminations.mixins.json ================================================ { "required": true, "package": "ladysnake.illuminations.mixin", "compatibilityLevel": "JAVA_8", "client": [ "BlockMixin", "CarvedPumpkinBlockMixin", "ChorusFlowerBlockMixin", "ClientWorldMixin", "LanternBlockMixin", "LivingEntityMixin", "ParticleManagerMixin", "PlayerEntityMixin", "RenderLayerAccessor", "SkullBlockMixin", "TitleScreenMixin", "jeb.FeatureRendererMixin", "jeb.LivingEntityRendererMixin" ], "plugin": "ladysnake.illuminations.IlluminationsMixinConfigPlugin", "injectors": { "defaultRequire": 1 } } ================================================ FILE: src/main/resources/pack.mcmeta ================================================ { "pack": { "description": "Illuminations resources", "pack_format": 3, "_comment": "" } }