-
Notifications
You must be signed in to change notification settings - Fork 1
Fluid
Surreal edited this page Jul 10, 2022
·
2 revisions
Before starting don't forget to add #loader preinit at the start of your script
You might want to import the package
import contentcreator.fluid.Fluid;
// Don't forget to load it in preinit, nothing will happen if you don't set it.
#loader preinit
/*
* stillLocation = can be empty, location for texture when it stays still. Also used in bucket texture
* flowingLocation = can be empty, location for texture when it flows.
* overlay = can be empty, overlay for fluid. You can add blending layer to making it look more interesting.
*/
var exampleFluid as Fluid = Fluid.create("example_fluid"); // create(String registryName, @Optional String stillLocation, @Optional String flowingLocation, @Optional String overlay)
// makes fluid placeable in world, you should choose lava or water material if you don't want to encounter issues
// You can get IMaterial with bracket handler support this mod adds (e.g. <material:wood>) or like [this](https://docs.blamejared.com/1.12/en/Vanilla/Blocks/IMaterial).
exampleFluid.addBlock(<blockmaterial:lava>); // addBlock(crafttweaker.block.IMaterial material);
// Adds bucket for fluid
exampleFluid.addBucket();
// sets unlocalized name to "fluid.myliquid"
exampleFluid.setUnlocalizedName("my_liquid"); // setUnlocalizedName(String unlocName)
// Sets fluids brightness
exampleFluid.setLuminosity(6); // setLuminosity(int value)
// Sets walk speed in fluid
exampleFluid.setDensity(4000); // setDensity(int value) default value: 3000
// Sets fluids temperature, can be used to make it work with hot or not or mods like that.
exampleFluid.setTemperature(1000); // setTemperature(int value)
// Sets fluids flowing speed
exampleFluid.setViscosity(5000); // setViscosity(int value) default value: 6000
// Fluid flows upwards
exampleFluid.setGaseous();
// Sets fluids names color, Allowed values: common, uncommon, rare, epic
exampleFluid.setRarity("epic");
// Sets sound it makes when it fills a bucket
exampleFluid.setFillSound(); // setFillSound(CTSoundEvent soundevent)
// Sets sound it makes when it gets spilled from bucket
exampleFluid.setEmptySound(); // setEmptySound(CTSoundEvent soundevent)
// Sets liquids color
exampleFluid.setColor(0x000000); // setColor(int color)
// You don't need to register it, it registers itself