ChloePrime / AAAParticles

Effekseer loader on Minecraft 1.18+ Windows and Linux are supported
MIT License
10 stars 3 forks source link

Adding a new Effekseer Particle: Guide #4

Open Mlodziak00 opened 3 months ago

Mlodziak00 commented 3 months ago

Hello, Going to keep it short, this is a guide on how to use the AAA Particles library.

This Guide works similarly for both Forge and Fabric, I'll be using Fabric for this

As an example, we'll use a Modified Sample Effekseer particle made by Pierre01: Herald,

https://github.com/ChloePrime/AAAParticles/assets/90759492/7874fe0b-906b-4e9b-9188-db3ec93b86e5

Get the Modified Particle Here: ExampleParticle.zip

Going to the Guide now (Fabric 1.20.1 Specifically):

  1. We'll be going into build.gradle attaching AAA Particle and Architecture API as dependencies and while using the Modrinth Maven repository (You can also use the Curseforge Maven)
repositories {
    maven {
        url = "https://api.modrinth.com/maven"
    }
}
dependencies{
    modImplementation "maven.modrinth:aaa-particles:mIOu49Wn"
    modImplementation "maven.modrinth:architectury-api:9.2.14+fabric"
}

Then Load The Gradlew Changes and that's how you implement it

  1. Now we add in a new Resource into our mods assets file called effeks like below and extract the contents of ExampleParticle.zip in there. image_2024-03-14_163352207

  2. Now we go and create a ClientModInitializer, and Registering a ReloadListenerRegistry, making sure the Identifier looks somewhat like this, but passing in your own ModID (First Value) image_2024-03-14_164125498

That's how you add in the particles and such, but spawning them in isn't like adding in Vanilla particles, to add them I'll make an Example Spawn Item, that spawn the particle on top of any given block

  1. We're going to add new static final ParticleEmitterInfo called HERALD, making sure we pass in a new Identifier with the ModID and the particles path (herald), then using AAALevel on the useOnBlock method, we add a new particle to the world, not forcing it and calling for HERALD.clone(), It can have parameters like .position, .scale, .rotation, but we want to always call .clone before any of those. In the image it is centered to the very top of the Blocks Position. image_2024-03-14_164842556

  2. Then we register the Item itself into the Main class and you should have an item that spawns a particle like this! NOTE, the particle isn't perfect because it's an example one, you can scale it down using .scale(0.5F).

https://github.com/ChloePrime/AAAParticles/assets/90759492/fa91e027-2a8b-4273-beb3-2a1447d3390a

Want to have it spawn like you do with Vanilla Particles? (Yes I figured it out)

  1. Create a Basic Particle like you usually would Here if you don't know how to, yes it still works with it's own class and registering them into the Client and Main.
    
    Client
        ParticleFactoryRegistry.getInstance().register(AAAParticleExample.HERALD, HeraldParticle.Factory::new);

Main public static final DefaultParticleType HERALD = FabricParticleTypes.simple(); @Override public void onInitialize() { Registry.register(Registries.PARTICLE_TYPE, new Identifier("aaa-particle-example", "herald"), HERALD); }


2. Inside of the Particle interduce a new `Integer` for example `timer` and inside of the `tick()` method, pass in

if (timer == 0){ timer++; AAALevel.addParticle(world, false, HERALD.clone().position(this.x, this.y, this.z)); /// This is the same as for the Item }


Were doing it on the 0th tick so it only spawns in 1 time.

3. if you did everything correctly, now the Particle should be inside of the `/particle` command and should summon without any issues! (Hopefully)

https://github.com/ChloePrime/AAAParticles/assets/90759492/a792cbda-7563-431b-b19b-88ddd0880d3f
kyber-6 commented 1 month ago

Thank you for this tutorial, friend. I have a question in regards to how you export other Effekseer particles, as I am unable to make this work with other sample particles.

Raia05 commented 4 weeks ago

is there a way to do it via resourse packs to replace existing particles?

Freddy1o1 commented 1 week ago

Do you know how you would go about implementing this into mcreator?

ZigyTheBird commented 1 day ago

@ChloePrime you should really just make a wiki for this repo and copy and paste this tutorial there