Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made the size of fluid tanks config #855

Draft
wants to merge 2 commits into
base: dev/1.21.1
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"enderio_machines.configuration.alloySmelter": "Alloy Smelter",
"enderio_machines.configuration.aversion": "Aversion Obelisk",
"enderio_machines.configuration.aversionRangeColor": "Aversion Obelisk Range Color",
"enderio_machines.configuration.baseFluidTankCapacity": "Base",
"enderio_machines.configuration.baseLevelCost": "Base Level Cost",
"enderio_machines.configuration.basic": "Basic",
"enderio_machines.configuration.blocks": "Blocks",
Expand All @@ -51,6 +52,8 @@
"enderio_machines.configuration.energetic": "Energetic",
"enderio_machines.configuration.energy": "Energy",
"enderio_machines.configuration.energyCost": "Energy Cost (µI)",
"enderio_machines.configuration.fluid": "Fluid",
"enderio_machines.configuration.fluidTankCapacity": "Fluid tank capacity",
"enderio_machines.configuration.fuelEfficiencyBase": "Base Fuel Efficiency",
"enderio_machines.configuration.fuelEfficiencyStep": "Fuel Efficiency Step",
"enderio_machines.configuration.generation": "Generation Rate (µI/t)",
Expand All @@ -67,6 +70,7 @@
"enderio_machines.configuration.photovoltaicCellRates": "Photovoltaic Cell Rates",
"enderio_machines.configuration.poweredSpawner": "Powered Spawner",
"enderio_machines.configuration.poweredSpawnerRangeColor": "Powered Spawner Range Color",
"enderio_machines.configuration.pressurizedFluidTankCapacity": "Pressurised",
"enderio_machines.configuration.pulsating": "Pulsating",
"enderio_machines.configuration.relocator": "Relocator Obelisk",
"enderio_machines.configuration.relocatorRangeColor": "Relocator Obelisk Range Color",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import com.enderio.core.common.network.NetworkDataSlot;
import com.enderio.machines.common.attachment.FluidTankUser;
import com.enderio.machines.common.blockentity.base.MachineBlockEntity;
import com.enderio.machines.common.config.MachinesConfig;
import com.enderio.machines.common.config.common.MachinesCommonConfig;
import com.enderio.machines.common.init.MachineBlockEntities;
import com.enderio.machines.common.init.MachineRecipes;
import com.enderio.machines.common.io.fluid.FluidItemInteractive;
Expand Down Expand Up @@ -54,7 +56,7 @@
public abstract class FluidTankBlockEntity extends MachineBlockEntity implements FluidItemInteractive, FluidTankUser {

public static class Standard extends FluidTankBlockEntity {
public static final int CAPACITY = 16 * FluidType.BUCKET_VOLUME;
public static final int CAPACITY = MachinesConfig.COMMON.FLUID.FLUID_TANK_MAX_CAPACITY.get() * FluidType.BUCKET_VOLUME;

public Standard(BlockPos worldPosition, BlockState blockState) {
super(MachineBlockEntities.FLUID_TANK.get(), worldPosition, blockState);
Expand All @@ -67,7 +69,7 @@ public MachineTankLayout getTankLayout() {
}

public static class Enhanced extends FluidTankBlockEntity {
public static final int CAPACITY = 32 * FluidType.BUCKET_VOLUME;
public static final int CAPACITY = MachinesConfig.COMMON.FLUID.PRESSURIZED_FLUID_TANK_MAX_CAPACITY.get() * FluidType.BUCKET_VOLUME;

public Enhanced(BlockPos worldPosition, BlockState blockState) {
super(MachineBlockEntities.PRESSURIZED_FLUID_TANK.get(), worldPosition, blockState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ public static void register() {
addTranslation("aversion", "Aversion Obelisk");
addTranslation("relocator", "Relocator Obelisk");

// Fluid
addTranslation("fluid", "Fluid");
addTranslation("fluidTankCapacity", "Fluid tank capacity");
addTranslation("baseFluidTankCapacity", "Base");
addTranslation("pressurizedFluidTankCapacity", "Pressurised");

// Enchanter
addTranslation("enchanter", "Enchanter");
addTranslation("lapisCostFactor", "Lapis Cost Multiplier");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.enderio.machines.common.config.common;

import net.neoforged.neoforge.common.ModConfigSpec;
import net.neoforged.neoforge.fluids.FluidType;

public class FluidConfig {

public final ModConfigSpec.ConfigValue<Integer> FLUID_TANK_MAX_CAPACITY;
public final ModConfigSpec.ConfigValue<Integer> PRESSURIZED_FLUID_TANK_MAX_CAPACITY;

public FluidConfig(ModConfigSpec.Builder builder) {

builder.push("fluid");

builder.push("fluidTankCapacity");
FLUID_TANK_MAX_CAPACITY = builder
.comment("Maximum amount of fluid in buckets that the base fluid tank can hold")
.defineInRange("baseFluidTankCapacity", 16, 1, Integer.MAX_VALUE / FluidType.BUCKET_VOLUME);
PRESSURIZED_FLUID_TANK_MAX_CAPACITY = builder
.comment("Maximum amount of fluid in buckets that the pressurized fluid tank can hold")
.defineInRange("pressurizedFluidTankCapacity", 32, 1, Integer.MAX_VALUE / FluidType.BUCKET_VOLUME);
builder.pop();
builder.pop();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

public class MachinesCommonConfig {
public final EnergyConfig ENERGY;
public final FluidConfig FLUID;
public final ModConfigSpec.ConfigValue<Double> ENCHANTER_LAPIS_COST_FACTOR;
public final ModConfigSpec.ConfigValue<Double> ENCHANTER_LEVEL_COST_FACTOR;
public final ModConfigSpec.ConfigValue<Integer> ENCHANTER_BASE_LEVEL_COST;
Expand All @@ -15,6 +16,7 @@ public class MachinesCommonConfig {

public MachinesCommonConfig(ModConfigSpec.Builder builder) {
ENERGY = new EnergyConfig(builder);
FLUID = new FluidConfig(builder);

builder.push("enchanter");
ENCHANTER_LAPIS_COST_FACTOR = builder.comment("The lapis cost is enchant level multiplied by this value.").define("lapisCostFactor", 3.0d);
Expand Down
Loading