11package com .charles445 .simpledifficulty .register ;
22
33import com .charles445 .simpledifficulty .SimpleDifficulty ;
4+ import com .charles445 .simpledifficulty .block .BlockFluidBasic ;
45import com .charles445 .simpledifficulty .block .BlockFluidBasicMixable ;
56import com .charles445 .simpledifficulty .block .BlockFluidSaltWater ;
67import com .charles445 .simpledifficulty .fluid .FluidBasic ;
7- import net .minecraft .world .level .block .LiquidBlock ;
8- import net .minecraft .world .level .material .Material ;
9- import net .minecraft .world .level .material .Fluid ;
10- import net .minecraft .world .level .material .FlowingFluid ;
11- import net .minecraft .world .item .BlockItem ;
12- import net .minecraft .world .item .Item ;
13- import net .minecraft .world .item .CreativeModeTab ;
8+ import net .minecraft .block .AbstractBlock ;
9+ import net .minecraft .block .FlowingFluidBlock ;
10+ import net .minecraft .block .material .Material ;
11+ import net .minecraft .fluid .FlowingFluid ;
12+ import net .minecraft .fluid .Fluid ;
13+ import net .minecraft .item .BlockItem ;
14+ import net .minecraft .item .Item ;
15+ import net .minecraft .item .ItemGroup ;
1416import net .minecraftforge .eventbus .api .IEventBus ;
17+ import net .minecraftforge .fluids .ForgeFlowingFluid ;
1518import net .minecraftforge .fml .RegistryObject ;
1619import net .minecraftforge .registries .DeferredRegister ;
1720import net .minecraftforge .registries .ForgeRegistries ;
18- import net .minecraftforge .fluids .ForgeFlowingFluid ;
1921
2022public class RegisterFluids {
2123 public static final DeferredRegister <Fluid > FLUIDS = DeferredRegister .create (ForgeRegistries .FLUIDS , SimpleDifficulty .MODID );
2224
23- public static ForgeFlowingFluid .Properties PURIFIED_WATER_PROPERTIES ;
25+ // Properties of Purified Water
26+ public static final ForgeFlowingFluid .Properties PURIFIED_WATER_PROPERTIES = new ForgeFlowingFluid .Properties (
27+ () -> PURIFIED_WATER_SOURCE .get (),
28+ () -> PURIFIED_WATER .get (),
29+ FluidBasic .createAttributes ("purified_water_still" , "purified_water_flow" )
30+ ).bucket (() -> PURIFIED_WATER_ITEM .get ()).block (() -> BLOCK_PURIFIED_WATER .get ());
2431
32+ // Properties for Salt Water
33+ public static final ForgeFlowingFluid .Properties SALT_WATER_PROPERTIES = new ForgeFlowingFluid .Properties (
34+ () -> SALT_WATER_SOURCE .get (),
35+ () -> SALT_WATER .get (),
36+ FluidBasic .createAttributes ("salt_water_still" , "salt_water_flow" )
37+ ).bucket (() -> SALT_WATER_ITEM .get ()).block (() -> BLOCK_SALT_WATER .get ());
38+
39+ // Fluids
2540 public static final RegistryObject <Fluid > PURIFIED_WATER_SOURCE = FLUIDS .register ("purified_water_source" ,
26- () -> new FluidBasic .Source (PURIFIED_WATER_PROPERTIES ));
41+ () -> new FluidBasic .Source (() -> PURIFIED_WATER_PROPERTIES ));
2742
2843 public static final RegistryObject <Fluid > PURIFIED_WATER = FLUIDS .register ("purified_water_flowing" ,
29- () -> new FluidBasic .Flowing (PURIFIED_WATER_PROPERTIES ));
30-
44+ () -> new FluidBasic .Flowing (() -> PURIFIED_WATER_PROPERTIES ));
45+
46+ public static final RegistryObject <Fluid > SALT_WATER_SOURCE = FLUIDS .register ("saltwater_source" ,
47+ () -> new FluidBasic .Source (() -> SALT_WATER_PROPERTIES ));
48+
3149 public static final RegistryObject <Fluid > SALT_WATER = FLUIDS .register ("saltwater" ,
32- () -> new FluidBasic .Flowing (PURIFIED_WATER_PROPERTIES )); // Cambiar propiedades si salada usa otras
50+ () -> new FluidBasic .Flowing (() -> SALT_WATER_PROPERTIES ));
3351
34- public static final RegistryObject <LiquidBlock > BLOCK_PURIFIED_WATER = RegisterBlocks .BLOCKS .register ("purifiedwater" ,
35- () -> new BlockFluidBasicMixable (PURIFIED_WATER , LiquidBlock .Properties .of (Material .WATER ).noCollission ().strength (100.0F ).noDrops ()));
36-
37- public static final RegistryObject <LiquidBlock > BLOCK_SALT_WATER = RegisterBlocks .BLOCKS .register ("saltwater" ,
38- () -> new BlockFluidSaltWater (SALT_WATER , LiquidBlock .Properties .of (Material .WATER ).noCollission ().strength (100.0F ).noDrops ()));
52+ // Fluid Blocks
53+ public static final RegistryObject <FlowingFluidBlock > BLOCK_PURIFIED_WATER = RegisterBlocks .BLOCKS .register ("purifiedwater" ,
54+ () -> new BlockFluidBasicMixable (() -> PURIFIED_WATER_SOURCE .get (),
55+ AbstractBlock .Properties .of (Material .WATER ).noCollission ().strength (100.0F ).noDrops (),
56+ "purifiedwater" ));
57+
58+ public static final RegistryObject <FlowingFluidBlock > BLOCK_SALT_WATER = RegisterBlocks .BLOCKS .register ("saltwater" ,
59+ () -> new BlockFluidSaltWater (() -> SALT_WATER_SOURCE .get (),
60+ AbstractBlock .Properties .of (Material .WATER ).noCollission ().strength (100.0F ).noDrops (),
61+ "saltwater" ));
3962
40- public static final RegistryObject <Item > PURIFIED_WATER_ITEM = RegisterItems .ITEMS .register ("purifiedwater" ,
41- () -> new BlockItem (BLOCK_PURIFIED_WATER .get (), new Item .Properties ().tab (CreativeModeTab .TAB_MISC )));
42-
43- public static final RegistryObject <Item > SALT_WATER_ITEM = RegisterItems .ITEMS .register ("saltwater" ,
44- () -> new BlockItem (BLOCK_SALT_WATER .get (), new Item .Properties ().tab (CreativeModeTab .TAB_MISC )));
63+ // Items (buckets)
64+ public static final RegistryObject <Item > PURIFIED_WATER_ITEM = RegisterItems .ITEMS .register ("purifiedwater_bucket" ,
65+ () -> new BlockItem (BLOCK_PURIFIED_WATER .get (), new Item .Properties ().tab (ItemGroup .TAB_MISC ).stacksTo (1 )));
66+
67+ public static final RegistryObject <Item > SALT_WATER_ITEM = RegisterItems .ITEMS .register ("saltwater_bucket" ,
68+ () -> new BlockItem (BLOCK_SALT_WATER .get (), new Item .Properties ().tab (ItemGroup .TAB_MISC ).stacksTo (1 )));
4569
4670 public static void register (IEventBus eventBus ) {
4771 FLUIDS .register (eventBus );
4872 }
49- }
73+ }
0 commit comments