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

I managed to successfully implement an acid fluid, but every fluid afterwards has refused to properly accept its model, despite using entirely identical code.

AdHgcv5.png

Mod fluid registry:

public class VOFluids
{
	private static final List<Fluid> FLUIDS = new ArrayList<Fluid>();
	
	public static Fluid ACID;
	public static Fluid GREASE;
	
	public static Fluid PETRIFYING;
	
	public static void init()
	{
		ACID	= addFluid(new FluidAcid());
		GREASE	= addFluid(new FluidGrease());
		
		PETRIFYING	= addFluid(new GasPetrifying());
	}
	
	private static Fluid addFluid(Fluid fluidIn)
	{
		FLUIDS.add(fluidIn);
		FluidRegistry.registerFluid(fluidIn);
		return fluidIn;
	}
	
	public static void renderFluids()
	{
		((BlockFluidVO)VOBlocks.ACID).render();
		((BlockFluidVO)VOBlocks.GREASE).render();
		((BlockFluidVO)VOBlocks.PETRIFYING_GAS).render();
	}
}

All of the fluids extend out of Forge's Fluid class, with the exception of GasPetrifying which does a little bit of defaults for gaseous fluids and still experiences the same problem. init() is called by the CommonProxy, renderFluids() is called by the ClientProxy, both during pre-initialisation.

 

Mod fluid block class:

public abstract class BlockFluidVO extends BlockFluidClassic
{
	public BlockFluidVO(String nameIn, Fluid fluidIn)
	{
		this(nameIn, fluidIn, Material.WATER);
	}
	
	public BlockFluidVO(String nameIn, Fluid fluidIn, Material materialIn)
	{
		super(fluidIn, materialIn);
		setCreativeTab(CreativeTabVO.BLOCKS_TAB);
		setBlockDefaults(nameIn);
	}
	
	public void setBlockDefaults(String nameIn)
	{
		this.setCreativeTab(null);
		this.setRegistryName(Reference.ModInfo.MOD_ID, nameIn);
		this.setUnlocalizedName(getRegistryName().toString());
	}
	
	@SideOnly(Side.CLIENT)
	public void render()
	{
		ModelLoader.setCustomStateMapper(this, new StateMap.Builder().ignore(LEVEL).build());
	}
}

The only meaningful change I've managed to identify is that altering the order of model registration in renderFluids() changes which fluid works fine. All the fluids use essentially identical blockstate files, however only the first registered is accepted, the others complain about missing states for different fluid levels (despite explicitly being told to ignore them).

Fluid blockstate:

{
     "forge_marker": 1,
     "defaults":
     {
        "model": "forge:fluid",
        "transform": "forge:default-item"
     },
     "variants":
     {
         "normal":
         {
             "model": "forge:fluid", 
             "custom": { "fluid": "varodd:acid" }
         }
     }
}

I've checked for any documentation, tutorials, or other mods that incorporate multiple fluids and I haven't been able to find a reason for this error.

  • Author

Failing a solution to this bizarre bug, are there any tutorials or references for multi-fluid implementations that can be recommended?

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.