Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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"

  • Author

Bump. (Not sure if I'm allowed to do this but I'm quite stuck..)

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"

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

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.