Jump to content

Recommended Posts

Posted

Hi Everyone,

 

I was wondering if anyone could explain how the vanilla particles are registered to a string. I want to try and set up a system where I can use my custom particle sheet in tandem with the vanilla particle sheet that contains their textures, to add more particles to the game. I like their spawning of particles using the string but I have been looking at this and I dont really understand how it works. (the string part - how exactly does vanilla associate the "snowshovel" string with the particle class that is the EntityFX for snowshovel particle)

 

 public void spawnParticle(String particleName, double xCoord, double yCoord, double zCoord, double velX, double velY, double velZ)

 

if the particle name is snowshovel I know how to spawn it but lets say I wanted to add a particle with name dustydesert how would I map this name to that particle EntityFX so that I can spawn it the same way vanilla does it.

 

This is currently how I spawn vanilla particles - nothing fancy but I want to be able to create my own custom particle with custom parameters such as (particleMaxAge, Scale,...etc etc) so that I can give it custom motion and all of that good stuff. Then register it in such a way so that I can spawn it the same way vanilla does it. Is this even possible

 

@Override
public void spawnParticles(World world, double xCoord, double yCoord, double zCoord, float radius, Vec3 lookVector)
{

	yCoord += 1.62D;
	for (float f = 0; f < radius; f += 0.5F) {
		xCoord += lookVector.xCoord;
		yCoord += lookVector.yCoord;
		zCoord += lookVector.zCoord;
		for (int numberOfParticles = 0; numberOfParticles < maxNumberOfPrticles; ++numberOfParticles) {
			world.spawnParticle("snowshovel",
					xCoord + 0.5F - world.rand.nextFloat(),
					yCoord + 0.5F - world.rand.nextFloat(),
					zCoord + 0.5F - world.rand.nextFloat(),
					lookVector.xCoord * (0.5F * world.rand.nextFloat()),
					lookVector.yCoord * (0.5F * world.rand.nextFloat()),
					lookVector.zCoord * (0.5F * world.rand.nextFloat()));
		}
	}
}

Posted

After some major digging around I have found the function that seems to do the "registering of particles" but I dont think there is an easy way to register new ones...

 

Located in public class RenderGlobal

public EntityFX doSpawnParticle(String p_72726_1_, double p_72726_2_, double p_72726_4_, double p_72726_6_, double p_72726_8_, double p_72726_10_, double p_72726_12_){
}

 

it seems to be called by the following method located in public class RenderGlobal

public void spawnParticle(String p_72708_1_, final double p_72708_2_, final double p_72708_4_, final double p_72708_6_, double p_72708_8_, double p_72708_10_, double p_72708_12_){}  

 

which is called by the following method located in public abstract class World

public void spawnParticle(String p_72869_1_, double p_72869_2_, double p_72869_4_, double p_72869_6_, double p_72869_8_, double p_72869_10_, double p_72869_12_){}

 

which is called by everything that spawns particles in vanilla... Does anyone have any idea how to access this in a smart way to allow registration of new particles in the same way vanilla does it?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I tried do download the essential mod to my mod pack but i didnt work. I paly on 1.21 and it should work. I use neoforge for my modding. The weird things is my friend somehow added the mod to his modpack and many others that I somehow can´t. Is there anything i can do? 
    • Thanks, I've now installed a slightly newer version and the server is at least starting up now.
    • i have the same issue. Found 1 Create mod class dependency(ies) in createdeco-1.3.3-1.19.2.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Found 11 Create mod class dependency(ies) in createaddition-fabric+1.19.2-20230723a.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Detailed walkthrough of mods which rely on missing Create mod classes: Mod: createaddition-fabric+1.19.2-20230723a.jar Missing classes of create: com/simibubi/create/compat/jei/category/sequencedAssembly/JeiSequencedAssemblySubCategory com/simibubi/create/compat/recipeViewerCommon/SequencedAssemblySubCategoryType com/simibubi/create/compat/rei/CreateREI com/simibubi/create/compat/rei/EmptyBackground com/simibubi/create/compat/rei/ItemIcon com/simibubi/create/compat/rei/category/CreateRecipeCategory com/simibubi/create/compat/rei/category/WidgetUtil com/simibubi/create/compat/rei/category/animations/AnimatedBlazeBurner com/simibubi/create/compat/rei/category/animations/AnimatedKinetics com/simibubi/create/compat/rei/category/sequencedAssembly/ReiSequencedAssemblySubCategory com/simibubi/create/compat/rei/display/CreateDisplay Mod: createdeco-1.3.3-1.19.2.jar Missing classes of create: com/simibubi/create/content/kinetics/fan/SplashingRecipe
    • The crash points to moonlight lib - try other builds or make a test without this mod and the mods requiring it
    • Do you have shaders enabled? There is an issue with the mod simpleclouds - remove this mod or disable shaders, if enabled  
  • Topics

×
×
  • Create New...

Important Information

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