Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.khalid.learning.fluid;
- import net.khalid.learning.Learning;
- import net.khalid.learning.block.ModBlocks;
- import net.khalid.learning.item.ModItems;
- import net.minecraft.world.level.material.FlowingFluid;
- import net.minecraft.world.level.material.Fluid;
- import net.minecraftforge.eventbus.api.IEventBus;
- import net.minecraftforge.fluids.ForgeFlowingFluid;
- import net.minecraftforge.registries.DeferredRegister;
- import net.minecraftforge.registries.ForgeRegistries;
- import net.minecraftforge.registries.RegistryObject;
- public class ModFluids {
- //Deferred Register for fluids
- public static final DeferredRegister<Fluid> FLUIDS = DeferredRegister.create(ForgeRegistries.FLUIDS, Learning.MOD_ID);
- //Vitality Medicine
- public static final RegistryObject<FlowingFluid> SOURCE_VITALITY_MEDICINE = FLUIDS.register("vitality_medicine_fluid",
- () -> new ForgeFlowingFluid.Source(ModFluids.VITALITY_MEDICINE_PROPERTIES));
- public static final RegistryObject<FlowingFluid> FLOWING_VITALITY_MEDICINE = FLUIDS.register("flowing_vitality_medicine_fluid",
- () -> new ForgeFlowingFluid.Flowing(ModFluids.VITALITY_MEDICINE_PROPERTIES));
- //Fluid Properties
- public static final ForgeFlowingFluid.Properties VITALITY_MEDICINE_PROPERTIES = new ForgeFlowingFluid.Properties(
- ModFluidTypes.VITALITY_MEDICINE_FLUID_TYPE, SOURCE_VITALITY_MEDICINE, FLOWING_VITALITY_MEDICINE).slopeFindDistance(7).levelDecreasePerBlock(1)
- .block(ModBlocks.VITALITY_MEDICINE_BLOCK).bucket(ModItems.CALABASH_COATED_FILLED);
- //Register method
- public static void register(IEventBus eventBus){
- FLUIDS.register(eventBus);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement