Advertisement
TZR-Redstonemaniac

ModFluids

Mar 23rd, 2023 (edited)
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.67 KB | None | 0 0
  1. package net.khalid.learning.fluid;
  2.  
  3. import net.khalid.learning.Learning;
  4. import net.khalid.learning.block.ModBlocks;
  5. import net.khalid.learning.item.ModItems;
  6. import net.minecraft.world.level.material.FlowingFluid;
  7. import net.minecraft.world.level.material.Fluid;
  8. import net.minecraftforge.eventbus.api.IEventBus;
  9. import net.minecraftforge.fluids.ForgeFlowingFluid;
  10. import net.minecraftforge.registries.DeferredRegister;
  11. import net.minecraftforge.registries.ForgeRegistries;
  12. import net.minecraftforge.registries.RegistryObject;
  13.  
  14. public class ModFluids {
  15.     //Deferred Register for fluids
  16.     public static final DeferredRegister<Fluid> FLUIDS = DeferredRegister.create(ForgeRegistries.FLUIDS, Learning.MOD_ID);
  17.  
  18.     //Vitality Medicine
  19.     public static final RegistryObject<FlowingFluid> SOURCE_VITALITY_MEDICINE = FLUIDS.register("vitality_medicine_fluid",
  20.             () -> new ForgeFlowingFluid.Source(ModFluids.VITALITY_MEDICINE_PROPERTIES));
  21.     public static final RegistryObject<FlowingFluid> FLOWING_VITALITY_MEDICINE = FLUIDS.register("flowing_vitality_medicine_fluid",
  22.             () -> new ForgeFlowingFluid.Flowing(ModFluids.VITALITY_MEDICINE_PROPERTIES));
  23.  
  24.     //Fluid Properties
  25.     public static final ForgeFlowingFluid.Properties VITALITY_MEDICINE_PROPERTIES = new ForgeFlowingFluid.Properties(
  26.             ModFluidTypes.VITALITY_MEDICINE_FLUID_TYPE, SOURCE_VITALITY_MEDICINE, FLOWING_VITALITY_MEDICINE).slopeFindDistance(7).levelDecreasePerBlock(1)
  27.             .block(ModBlocks.VITALITY_MEDICINE_BLOCK).bucket(ModItems.CALABASH_COATED_FILLED);
  28.  
  29.     //Register method
  30.     public static void register(IEventBus eventBus){
  31.         FLUIDS.register(eventBus);
  32.     }
  33. }
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement