Jump to content

Stopping Splash Particles? [Forge 1.7.10]


Mr_Rockers

Recommended Posts

Hello!

I'm creating a custom liquid and everything has *mostly* been setup. I have a custom item for picking it up and custom splash particles that work quite well. However, I have a problem stopping the splash particles that are created by... Well that's the problem. I can't find where the particles are being generated and there doesn't seem to be an event for the creation of particles or effects. I can't stop them or override their creation. Even overriding randomDisplayTick with my particle code doesn't do anything within that regard.

 

I thought about using Minecraft.getMinecraft().effectRenderer.clearEffects(); but that clears all of the effects in all of the fxLayers and this isn't what I want at all.

 

So now, all that happens is that the water splash particles spawn and then my particles spawn (but I don't want the default splash particles because my liquid is red and I don't want any "bubbles".) I'm thinking it's got something to do with Material.water but I can't be certain.

 

Here is my code:


package com.lyesdoesmods.fluids;

import...

public class MortalBloodFluidBlock extends BlockFluidClassic{

@SideOnly(Side.CLIENT)
protected IIcon stillIcon;
@SideOnly(Side.CLIENT)
protected IIcon flowingIcon;

public MortalBloodFluidBlock(Fluid fluid, Material material) {
	super(fluid, material);
}

@Override
public IIcon getIcon(int side, int meta) {
	return (side == 0 || side == 1)? stillIcon : flowingIcon;
}

@SideOnly(Side.CLIENT)
@Override
public void registerBlockIcons(IIconRegister iReg) {
	stillIcon = iReg.registerIcon(ReferenceVariables.MODID + ":mortalBloodStill");
	flowingIcon = iReg.registerIcon(ReferenceVariables.MODID + ":mortalBloodFlowing");
}

@Override
public boolean canDisplace(IBlockAccess world, int x, int y, int z) {
	if(world.getBlock(x, y, z).getMaterial().isLiquid()) return false;
	return super.canDisplace(world, x, y, z);
}

ArrayList<EntityPlayer> players = new ArrayList<EntityPlayer>();
@Override
public void onEntityCollidedWithBlock(World world, int x, int y, int z,	Entity entity) 
{
	if(entity instanceof EntityPlayer)
	{
		if(!players.contains((EntityPlayer)entity))
		{
			if(entity.motionX != 0 || entity.motionZ != 0 || entity.motionY != 0)
			players.add((EntityPlayer)entity);
		}
	}
}

int tickB;
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random rand)
{
	tickB++;
	if(players != null && tickB > 5)
	{
		for(int i = 0; i < players.size(); i++)
		{
			double x1 = rand.nextGaussian() * 0.2D + players.get(i).posX;
			double z1 = rand.nextGaussian() * 0.2D + players.get(i).posZ;
			Minecraft.getMinecraft().effectRenderer.addEffect(new EntityBloodSplashFX(world, x1, players.get(i).posY - 1, z1));
		}
		players.clear();
		tickB = 0;
	}
}

@Override
public MapColor getMapColor(int p_149728_1_) {
	return MapColor.redColor;
}


}

 

Any help is appreciated!

Took a year long hiatus in modding and have forgotten *everything*. (yay)

 

Now not working on a mod that supports satanism.

Now working on another mod, "Trinkets and Sabres"

Link to comment
Share on other sites

Im not sure, but the particle(EntityFX) class extends the Entity class right? Maybe you can use tbe onEntityJoin event, but than only on the client side. (No idea if its going to work!)

 

Otherwise you could try to find how the particles are disabled through the vanilla configurations. (And Im sure you can find good examples in optifine's sourceCodes as wel)

Projects:

Discontinued:

- N2ConfigAPI

- Meachanical Crafting Table

 

Latest:

- CollectionUtils

 

Coöperations:

- InGameConfigManager

Link to comment
Share on other sites

Join the conversation

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

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

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

×   Your previous content has been restored.   Clear editor

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

Announcements



×
×
  • Create New...

Important Information

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