Large amount of fluid work

This commit is contained in:
modmuss50 2019-07-23 20:46:07 +01:00
parent 1e52477b9e
commit 83bf6add1e
20 changed files with 52 additions and 124 deletions

View file

@ -24,9 +24,14 @@
package techreborn.init;
import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.minecraft.block.Material;
import net.minecraft.item.Item;
import net.minecraft.util.Identifier;
import reborncore.fluid.Fluid;
import techreborn.blocks.fluid.BlockFluidTechReborn;
import net.minecraft.util.registry.Registry;
import reborncore.common.fluid.*;
import techreborn.TechReborn;
public enum ModFluids {
BERYLLIUM,
CALCIUM,
@ -63,24 +68,34 @@ public enum ModFluids {
COMPRESSED_AIR,
ELECTROLYZED_WATER;
public Fluid fluid;
public BlockFluidTechReborn block;
public String name;
private final RebornFluid fluid;
private RebornFluidBlock block;
private RebornBucketItem bucket;
private final Identifier identifier;
ModFluids() {
this.name = this.name().replace("_", "").toLowerCase(); //Is this ok?
fluid = new Fluid(name, new Identifier("techreborn", "fixme"), new Identifier("techrebonr", "alsofixme"));
this.identifier = new Identifier("techreborn", this.name().replace("_", "").toLowerCase());
fluid = new RebornFluid(FluidSettings.create(), () -> block, () -> bucket);
block = new RebornFluidBlock(fluid, FabricBlockSettings.of(Material.WATER).noCollision().hardness(100.0F).dropsNothing().build());
bucket = new RebornBucketItem(fluid, new Item.Settings().group(TechReborn.ITEMGROUP));
}
public void register() {
RebornFluidManager.register(fluid, identifier);
Registry.register(Registry.BLOCK, identifier, block);
Registry.register(Registry.ITEM, identifier, bucket);
}
@Deprecated //TODO this is bad!
public Fluid getFluid() {
return fluid;
return new Fluid();
}
public BlockFluidTechReborn getBlock() {
public RebornFluidBlock getBlock() {
return block;
}
public String getName() {
return name;
public Identifier getIdentifier() {
return identifier;
}
}

View file

@ -30,9 +30,9 @@ import reborncore.common.crafting.RebornRecipe;
import reborncore.common.crafting.RebornRecipeType;
import reborncore.common.crafting.RecipeManager;
import reborncore.common.registration.RebornRegister;
import reborncore.fluid.Fluid;
import reborncore.fluid.FluidStack;
import reborncore.fluid.FluidUtil;
import reborncore.common.fluid.Fluid;
import reborncore.common.fluid.FluidStack;
import reborncore.common.fluid.FluidUtil;
import techreborn.TechReborn;
import techreborn.api.recipe.recipes.BlastFurnaceRecipe;
import techreborn.api.recipe.recipes.IndustrialGrinderRecipe;

View file

@ -25,7 +25,7 @@
package techreborn.init.recipes;
import reborncore.fluid.Fluid;
import reborncore.common.fluid.Fluid;
import techreborn.api.generator.EFluidGenerator;
import techreborn.api.generator.GeneratorRecipeHelper;
import techreborn.init.ModFluids;