Move configs to one class

This commit is contained in:
modmuss50 2019-08-12 17:57:00 +01:00
parent 9db1978410
commit 77eee6f5b4
76 changed files with 731 additions and 5583 deletions

View file

@ -36,7 +36,6 @@ import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.crafting.ingredient.RebornIngredient;
import reborncore.common.crafting.RebornRecipe;
import reborncore.common.crafting.ingredient.StackIngredient;
import reborncore.common.registration.RebornRegister;
import reborncore.common.blockentity.MachineBaseBlockEntity;
import reborncore.common.util.RebornInventory;
import techreborn.TechReborn;
@ -46,7 +45,6 @@ import techreborn.init.TRBlockEntities;
import java.util.concurrent.atomic.AtomicInteger;
@RebornRegister(TechReborn.MOD_ID)
public class IronAlloyFurnaceBlockEntity extends MachineBaseBlockEntity
implements IToolDrop, InventoryProvider, IContainerProvider {

View file

@ -31,27 +31,21 @@ import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.RebornInventory;
import techreborn.TechReborn;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRBlockEntities;
import techreborn.blockentity.GenericMachineBlockEntity;
import techreborn.config.TechRebornConfig;
import techreborn.init.ModRecipes;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
@RebornRegister(TechReborn.MOD_ID)
public class DistillationTowerBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
@ConfigRegistry(config = "machines", category = "Distillation_tower", key = "DistillationTowerMaxInput", comment = "Distillation Tower Max Input (Value in EU)")
public static int maxInput = 128;
@ConfigRegistry(config = "machines", category = "Distillation_tower", key = "DistillationTowerMaxEnergy", comment = "Distillation Tower Max Energy (Value in EU)")
public static int maxEnergy = 10_000;
public MultiblockChecker multiblockChecker;
public DistillationTowerBlockEntity() {
super(TRBlockEntities.DISTILLATION_TOWER, "DistillationTower", maxInput, maxEnergy, TRContent.Machine.DISTILLATION_TOWER.block, 6);
super(TRBlockEntities.DISTILLATION_TOWER, "DistillationTower", TechRebornConfig.distillationTowerMaxInput, TechRebornConfig.distillationTowerMaxEnergy, TRContent.Machine.DISTILLATION_TOWER.block, 6);
final int[] inputs = new int[] { 0, 1 };
final int[] outputs = new int[] { 2, 3, 4, 5 };
this.inventory = new RebornInventory<>(7, "DistillationTowerBlockEntity", 64, this);

View file

@ -31,12 +31,10 @@ import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.IInventoryAccess;
import reborncore.common.util.RebornInventory;
import reborncore.common.util.Tank;
import techreborn.TechReborn;
import techreborn.config.TechRebornConfig;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRBlockEntities;
@ -49,22 +47,15 @@ import javax.annotation.Nullable;
* @author drcrazy
*
*/
@RebornRegister(TechReborn.MOD_ID)
public class FluidReplicatorBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
@ConfigRegistry(config = "machines", category = "fluidreplicator", key = "FluidReplicatorMaxInput", comment = "Fluid Replicator Max Input (Value in EU)")
public static int maxInput = 256;
@ConfigRegistry(config = "machines", category = "fluidreplicator", key = "FluidReplicatorMaxEnergy", comment = "Fluid Replicator Max Energy (Value in EU)")
public static int maxEnergy = 400_000;
public MultiblockChecker multiblockChecker;
public static final int TANK_CAPACITY = 16_000;
public Tank tank;
int ticksSinceLastChange;
public FluidReplicatorBlockEntity() {
super(TRBlockEntities.FLUID_REPLICATOR, "FluidReplicator", maxInput, maxEnergy, TRContent.Machine.FLUID_REPLICATOR.block, 3);
super(TRBlockEntities.FLUID_REPLICATOR, "FluidReplicator", TechRebornConfig.fluidReplicatorMaxInput, TechRebornConfig.fluidReplicatorMaxEnergy, TRContent.Machine.FLUID_REPLICATOR.block, 3);
this.inventory = new RebornInventory<>(4, "FluidReplicatorBlockEntity", 64, this, getInventoryAccess());
this.crafter = new RecipeCrafter(ModRecipes.FLUID_REPLICATOR, this, 1, 0, this.inventory, new int[] {0}, null);
this.tank = new Tank("FluidReplicatorBlockEntity", FluidReplicatorBlockEntity.TANK_CAPACITY, this);

View file

@ -30,27 +30,19 @@ import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.RebornInventory;
import techreborn.TechReborn;
import techreborn.config.TechRebornConfig;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRBlockEntities;
import techreborn.blockentity.GenericMachineBlockEntity;
@RebornRegister(TechReborn.MOD_ID)
public class ImplosionCompressorBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
@ConfigRegistry(config = "machines", category = "implosion_compressor", key = "ImplosionCompressorMaxInput", comment = "Implosion Compressor Max Input (Value in EU)")
public static int maxInput = 64;
@ConfigRegistry(config = "machines", category = "implosion_compressor", key = "ImplosionCompressorMaxEnergy", comment = "Implosion Compressor Max Energy (Value in EU)")
public static int maxEnergy = 64_000;
public MultiblockChecker multiblockChecker;
public ImplosionCompressorBlockEntity() {
super(TRBlockEntities.IMPLOSION_COMPRESSOR, "ImplosionCompressor", maxInput, maxEnergy, TRContent.Machine.IMPLOSION_COMPRESSOR.block, 4);
super(TRBlockEntities.IMPLOSION_COMPRESSOR, "ImplosionCompressor", TechRebornConfig.implosionCompressorMaxInput, TechRebornConfig.implosionCompressorMaxEnergy, TRContent.Machine.IMPLOSION_COMPRESSOR.block, 4);
final int[] inputs = new int[] { 0, 1 };
final int[] outputs = new int[] { 2, 3 };
this.inventory = new RebornInventory<>(5, "ImplosionCompressorBlockEntity", 64, this);

View file

@ -34,11 +34,9 @@ import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.multiblock.IMultiblockPart;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.RebornInventory;
import techreborn.TechReborn;
import techreborn.blocks.BlockMachineCasing;
import techreborn.config.TechRebornConfig;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRBlockEntities;
@ -46,19 +44,13 @@ import techreborn.multiblocks.MultiBlockCasing;
import techreborn.blockentity.GenericMachineBlockEntity;
import techreborn.blockentity.MachineCasingBlockEntity;
@RebornRegister(TechReborn.MOD_ID)
public class IndustrialBlastFurnaceBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
@ConfigRegistry(config = "machines", category = "industrial_furnace", key = "IndustrialFurnaceMaxInput", comment = "Industrial Blast Furnace Max Input (Value in EU)")
public static int maxInput = 128;
@ConfigRegistry(config = "machines", category = "industrial_furnace", key = "IndustrialFurnaceMaxEnergy", comment = "Industrial Blast Furnace Max Energy (Value in EU)")
public static int maxEnergy = 40_000;
public MultiblockChecker multiblockChecker;
private int cachedHeat;
public IndustrialBlastFurnaceBlockEntity() {
super(TRBlockEntities.INDUSTRIAL_BLAST_FURNACE, "IndustrialBlastFurnace", maxInput, maxEnergy, TRContent.Machine.INDUSTRIAL_BLAST_FURNACE.block, 4);
super(TRBlockEntities.INDUSTRIAL_BLAST_FURNACE, "IndustrialBlastFurnace", TechRebornConfig.industrialBlastFurnaceMaxInput, TechRebornConfig.industrialBlastFurnaceMaxEnergy, TRContent.Machine.INDUSTRIAL_BLAST_FURNACE.block, 4);
final int[] inputs = new int[] { 0, 1 };
final int[] outputs = new int[] { 2, 3 };
this.inventory = new RebornInventory<>(5, "IndustrialBlastFurnaceBlockEntity", 64, this);

View file

@ -34,12 +34,10 @@ import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.IInventoryAccess;
import reborncore.common.util.RebornInventory;
import reborncore.common.util.Tank;
import techreborn.TechReborn;
import techreborn.config.TechRebornConfig;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRBlockEntities;
@ -48,21 +46,15 @@ import techreborn.utils.FluidUtils;
import javax.annotation.Nullable;
@RebornRegister(TechReborn.MOD_ID)
public class IndustrialGrinderBlockEntity extends GenericMachineBlockEntity implements IContainerProvider{
@ConfigRegistry(config = "machines", category = "industrial_grinder", key = "IndustrialGrinderMaxInput", comment = "Industrial Grinder Max Input (Value in EU)")
public static int maxInput = 128;
@ConfigRegistry(config = "machines", category = "industrial_grinder", key = "IndustrialGrinderMaxEnergy", comment = "Industrial Grinder Max Energy (Value in EU)")
public static int maxEnergy = 10_000;
public static final int TANK_CAPACITY = 16_000;
public Tank tank;
public MultiblockChecker multiblockChecker;
int ticksSinceLastChange;
public IndustrialGrinderBlockEntity() {
super(TRBlockEntities.INDUSTRIAL_GRINDER, "IndustrialGrinder", maxInput, maxEnergy, TRContent.Machine.INDUSTRIAL_GRINDER.block, 7);
super(TRBlockEntities.INDUSTRIAL_GRINDER, "IndustrialGrinder", TechRebornConfig.industrialGrinderMaxInput, TechRebornConfig.industrialGrinderMaxEnergy, TRContent.Machine.INDUSTRIAL_GRINDER.block, 7);
final int[] inputs = new int[] { 0, 1 };
final int[] outputs = new int[] {2, 3, 4, 5};
this.inventory = new RebornInventory<>(8, "IndustrialGrinderBlockEntity", 64, this);

View file

@ -34,12 +34,10 @@ import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.IInventoryAccess;
import reborncore.common.util.RebornInventory;
import reborncore.common.util.Tank;
import techreborn.TechReborn;
import techreborn.config.TechRebornConfig;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRBlockEntities;
@ -48,21 +46,15 @@ import techreborn.utils.FluidUtils;
import javax.annotation.Nullable;
@RebornRegister(TechReborn.MOD_ID)
public class IndustrialSawmillBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
@ConfigRegistry(config = "machines", category = "industrial_sawmill", key = "IndustrialSawmillMaxInput", comment = "Industrial Sawmill Max Input (Value in EU)")
public static int maxInput = 128;
@ConfigRegistry(config = "machines", category = "industrial_sawmill", key = "IndustrialSawmillMaxEnergy", comment = "Industrial Sawmill Max Energy (Value in EU)")
public static int maxEnergy = 10_000;
public static final int TANK_CAPACITY = 16_000;
public Tank tank;
public MultiblockChecker multiblockChecker;
int ticksSinceLastChange;
public IndustrialSawmillBlockEntity() {
super(TRBlockEntities.INDUSTRIAL_SAWMILL, "IndustrialSawmill", maxInput, maxEnergy, TRContent.Machine.INDUSTRIAL_SAWMILL.block, 6);
super(TRBlockEntities.INDUSTRIAL_SAWMILL, "IndustrialSawmill", TechRebornConfig.industrialSawmillMaxInput, TechRebornConfig.industrialSawmillMaxEnergy, TRContent.Machine.INDUSTRIAL_SAWMILL.block, 6);
final int[] inputs = new int[] { 0, 1 };
final int[] outputs = new int[] { 2, 3, 4 };
this.inventory = new RebornInventory<>(7, "SawmillBlockEntity", 64, this, getInventoryAccess());

View file

@ -30,27 +30,19 @@ import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.RebornInventory;
import techreborn.TechReborn;
import techreborn.config.TechRebornConfig;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRBlockEntities;
import techreborn.blockentity.GenericMachineBlockEntity;
@RebornRegister(TechReborn.MOD_ID)
public class VacuumFreezerBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
@ConfigRegistry(config = "machines", category = "vacuumfreezer", key = "VacuumFreezerInput", comment = "Vacuum Freezer Max Input (Value in EU)")
public static int maxInput = 64;
@ConfigRegistry(config = "machines", category = "vacuumfreezer", key = "VacuumFreezerMaxEnergy", comment = "Vacuum Freezer Max Energy (Value in EU)")
public static int maxEnergy = 64_000;
public MultiblockChecker multiblockChecker;
public VacuumFreezerBlockEntity() {
super(TRBlockEntities.VACUUM_FREEZER, "VacuumFreezer", maxInput, maxEnergy, TRContent.Machine.VACUUM_FREEZER.block, 2);
super(TRBlockEntities.VACUUM_FREEZER, "VacuumFreezer", TechRebornConfig.vacuumFreezerMaxInput, TechRebornConfig.vacuumFreezerMaxEnergy, TRContent.Machine.VACUUM_FREEZER.block, 2);
final int[] inputs = new int[] { 0 };
final int[] outputs = new int[] { 1 };
this.inventory = new RebornInventory<>(3, "VacuumFreezerBlockEntity", 64, this);

View file

@ -29,25 +29,17 @@ import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.RebornInventory;
import techreborn.TechReborn;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRBlockEntities;
import techreborn.blockentity.GenericMachineBlockEntity;
import techreborn.config.TechRebornConfig;
import techreborn.init.ModRecipes;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
@RebornRegister(TechReborn.MOD_ID)
public class AlloySmelterBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
@ConfigRegistry(config = "machines", category = "alloy_smelter", key = "AlloySmelterMaxInput", comment = "Alloy Smelter Max Input (Value in EU)")
public static int maxInput = 32;
@ConfigRegistry(config = "machines", category = "alloy_smelter", key = "AlloySmelterMaxEnergy", comment = "Alloy Smelter Max Energy (Value in EU)")
public static int maxEnergy = 1_000;
public AlloySmelterBlockEntity() {
super(TRBlockEntities.ALLOY_SMELTER, "AlloySmelter", maxInput, maxEnergy, TRContent.Machine.ALLOY_SMELTER.block, 3);
super(TRBlockEntities.ALLOY_SMELTER, "AlloySmelter", TechRebornConfig.alloySmelterMaxInput, TechRebornConfig.alloySmelterMaxEnergy, TRContent.Machine.ALLOY_SMELTER.block, 3);
final int[] inputs = new int[] { 0, 1 };
final int[] outputs = new int[] { 2 };
this.inventory = new RebornInventory<>(4, "AlloySmelterBlockEntity", 64, this);

View file

@ -29,25 +29,17 @@ import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.RebornInventory;
import techreborn.TechReborn;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRBlockEntities;
import techreborn.blockentity.GenericMachineBlockEntity;
import techreborn.config.TechRebornConfig;
import techreborn.init.ModRecipes;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
@RebornRegister(TechReborn.MOD_ID)
public class AssemblingMachineBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
@ConfigRegistry(config = "machines", category = "assembling_machine", key = "AssemblingMachineMaxInput", comment = "Assembling Machine Max Input (Value in EU)")
public static int maxInput = 128;
@ConfigRegistry(config = "machines", category = "assembling_machine", key = "AssemblingMachineMaxEnergy", comment = "Assembling Machine Max Energy (Value in EU)")
public static int maxEnergy = 10_000;
public AssemblingMachineBlockEntity() {
super(TRBlockEntities.ASSEMBLY_MACHINE, "AssemblingMachine", maxInput, maxEnergy, TRContent.Machine.ASSEMBLY_MACHINE.block, 3);
super(TRBlockEntities.ASSEMBLY_MACHINE, "AssemblingMachine", TechRebornConfig.assemblingMachineMaxInput, TechRebornConfig.assemblingMachineMaxEnergy, TRContent.Machine.ASSEMBLY_MACHINE.block, 3);
final int[] inputs = new int[] { 0, 1 };
final int[] outputs = new int[] { 2 };
this.inventory = new RebornInventory<>(4, "AssemblingMachineBlockEntity", 64, this);

View file

@ -42,12 +42,10 @@ import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.IInventoryAccess;
import reborncore.common.util.RebornInventory;
import reborncore.common.util.ItemUtils;
import techreborn.TechReborn;
import techreborn.config.TechRebornConfig;
import techreborn.init.ModSounds;
import techreborn.init.TRContent;
import techreborn.utils.RecipeUtils;
@ -60,15 +58,9 @@ import java.util.List;
/**
* Created by modmuss50 on 20/06/2017.
*/
@RebornRegister(TechReborn.MOD_ID)
public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity
implements IToolDrop, InventoryProvider, IContainerProvider {
@ConfigRegistry(config = "machines", category = "autocrafter", key = "AutoCrafterInput", comment = "AutoCrafting Table Max Input (Value in EU)")
public static int maxInput = 32;
@ConfigRegistry(config = "machines", category = "autocrafter", key = "AutoCrafterMaxEnergy", comment = "AutoCrafting Table Max Energy (Value in EU)")
public static int maxEnergy = 10_000;
public RebornInventory<AutoCraftingTableBlockEntity> inventory = new RebornInventory<>(11, "AutoCraftingTableBlockEntity", 64, this, getInventoryAccess());
public int progress;
public int maxProgress = 120;
@ -359,7 +351,7 @@ public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity
@Override
public double getBaseMaxPower() {
return maxEnergy;
return TechRebornConfig.autoCraftingTableMaxEnergy;
}
@Override
@ -369,7 +361,7 @@ public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity
@Override
public double getBaseMaxInput() {
return maxInput;
return TechRebornConfig.autoCraftingTableMaxInput;
}
@Override

View file

@ -29,25 +29,17 @@ import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.RebornInventory;
import techreborn.TechReborn;
import techreborn.config.TechRebornConfig;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRBlockEntities;
import techreborn.blockentity.GenericMachineBlockEntity;
@RebornRegister(TechReborn.MOD_ID)
public class ChemicalReactorBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
@ConfigRegistry(config = "machines", category = "chemical_reactor", key = "ChemicalReactorMaxInput", comment = "Chemical Reactor Max Input (Value in EU)")
public static int maxInput = 128;
@ConfigRegistry(config = "machines", category = "chemical_reactor", key = "ChemicalReactorMaxEnergy", comment = "Chemical Reactor Max Energy (Value in EU)")
public static int maxEnergy = 10_000;
public ChemicalReactorBlockEntity() {
super(TRBlockEntities.CHEMICAL_REACTOR, "ChemicalReactor", maxInput, maxEnergy, TRContent.Machine.CHEMICAL_REACTOR.block, 3);
super(TRBlockEntities.CHEMICAL_REACTOR, "ChemicalReactor", TechRebornConfig.chemicalReactorMaxInput, TechRebornConfig.chemicalReactorMaxEnergy, TRContent.Machine.CHEMICAL_REACTOR.block, 3);
final int[] inputs = new int[] { 0, 1 };
final int[] outputs = new int[] { 2 };
this.inventory = new RebornInventory<>(4, "ChemicalReactorBlockEntity", 64, this);

View file

@ -29,25 +29,17 @@ import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.RebornInventory;
import techreborn.TechReborn;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRBlockEntities;
import techreborn.blockentity.GenericMachineBlockEntity;
import techreborn.config.TechRebornConfig;
import techreborn.init.ModRecipes;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
@RebornRegister(TechReborn.MOD_ID)
public class CompressorBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
@ConfigRegistry(config = "machines", category = "compressor", key = "CompressorInput", comment = "Compressor Max Input (Value in EU)")
public static int maxInput = 32;
@ConfigRegistry(config = "machines", category = "compressor", key = "CompressorMaxEnergy", comment = "Compressor Max Energy (Value in EU)")
public static int maxEnergy = 1000;
public CompressorBlockEntity() {
super(TRBlockEntities.COMPRESSOR, "Compressor", maxInput, maxEnergy, TRContent.Machine.COMPRESSOR.block, 2);
super(TRBlockEntities.COMPRESSOR, "Compressor", TechRebornConfig.compressorMaxInput, TechRebornConfig.compressorMaxEnergy, TRContent.Machine.COMPRESSOR.block, 2);
final int[] inputs = new int[] { 0 };
final int[] outputs = new int[] { 1 };
this.inventory = new RebornInventory<>(3, "CompressorBlockEntity", 64, this);

View file

@ -36,23 +36,15 @@ import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.RebornInventory;
import techreborn.TechReborn;
import techreborn.config.TechRebornConfig;
import techreborn.init.TRContent;
import techreborn.utils.RecipeUtils;
import techreborn.init.TRBlockEntities;
@RebornRegister(TechReborn.MOD_ID)
public class ElectricFurnaceBlockEntity extends PowerAcceptorBlockEntity
implements IToolDrop, InventoryProvider, IContainerProvider {
@ConfigRegistry(config = "machines", category = "electric_furnace", key = "ElectricFurnaceInput", comment = "Electric Furnace Max Input (Value in EU)")
public static int maxInput = 32;
@ConfigRegistry(config = "machines", category = "electric_furnace", key = "ElectricFurnaceMaxEnergy", comment = "Electric Furnace Max Energy (Value in EU)")
public static int maxEnergy = 1000;
public RebornInventory<ElectricFurnaceBlockEntity> inventory = new RebornInventory<>(3, "ElectricFurnaceBlockEntity", 64, this);
public int progress;
public int fuelScale = 100;
@ -179,7 +171,7 @@ public class ElectricFurnaceBlockEntity extends PowerAcceptorBlockEntity
@Override
public double getBaseMaxPower() {
return maxEnergy;
return TechRebornConfig.electricFurnaceMaxEnergy;
}
@Override
@ -199,7 +191,7 @@ public class ElectricFurnaceBlockEntity extends PowerAcceptorBlockEntity
@Override
public double getBaseMaxInput() {
return maxInput;
return TechRebornConfig.electricFurnaceMaxInput;
}
// IToolDrop

View file

@ -29,25 +29,17 @@ import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.RebornInventory;
import techreborn.TechReborn;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRBlockEntities;
import techreborn.blockentity.GenericMachineBlockEntity;
import techreborn.config.TechRebornConfig;
import techreborn.init.ModRecipes;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
@RebornRegister(TechReborn.MOD_ID)
public class ExtractorBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
@ConfigRegistry(config = "machines", category = "extractor", key = "ExtractorInput", comment = "Extractor Max Input (Value in EU)")
public static int maxInput = 32;
@ConfigRegistry(config = "machines", category = "extractor", key = "ExtractorMaxEnergy", comment = "Extractor Max Energy (Value in EU)")
public static int maxEnergy = 1_000;
public ExtractorBlockEntity() {
super(TRBlockEntities.EXTRACTOR, "Extractor", maxInput, maxEnergy, TRContent.Machine.EXTRACTOR.block, 2);
super(TRBlockEntities.EXTRACTOR, "Extractor", TechRebornConfig.extractorMaxInput, TechRebornConfig.extractorMaxEnergy, TRContent.Machine.EXTRACTOR.block, 2);
final int[] inputs = new int[] { 0 };
final int[] outputs = new int[] { 1 };
this.inventory = new RebornInventory<>(3, "ExtractorBlockEntity", 64, this);

View file

@ -29,25 +29,17 @@ import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.RebornInventory;
import techreborn.TechReborn;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRBlockEntities;
import techreborn.blockentity.GenericMachineBlockEntity;
import techreborn.config.TechRebornConfig;
import techreborn.init.ModRecipes;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
@RebornRegister(TechReborn.MOD_ID)
public class GrinderBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
@ConfigRegistry(config = "machines", category = "grinder", key = "GrinderInput", comment = "Grinder Max Input (Value in EU)")
public static int maxInput = 32;
@ConfigRegistry(config = "machines", category = "grinder", key = "GrinderMaxEnergy", comment = "Grinder Max Energy (Value in EU)")
public static int maxEnergy = 1_000;
public GrinderBlockEntity() {
super(TRBlockEntities.GRINDER, "Grinder", maxInput, maxEnergy, TRContent.Machine.GRINDER.block, 2);
super(TRBlockEntities.GRINDER, "Grinder", TechRebornConfig.grinderMaxInput, TechRebornConfig.grinderMaxEnergy, TRContent.Machine.GRINDER.block, 2);
final int[] inputs = new int[] { 0 };
final int[] outputs = new int[] { 1 };
this.inventory = new RebornInventory<>(3, "GrinderBlockEntity", 64, this);

View file

@ -29,27 +29,19 @@ import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.RebornInventory;
import reborncore.common.util.ItemUtils;
import techreborn.TechReborn;
import techreborn.config.TechRebornConfig;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRBlockEntities;
import techreborn.items.ItemDynamicCell;
import techreborn.blockentity.GenericMachineBlockEntity;
@RebornRegister(TechReborn.MOD_ID)
public class IndustrialElectrolyzerBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
@ConfigRegistry(config = "machines", category = "industrial_electrolyzer", key = "IndustrialElectrolyzerMaxInput", comment = "Industrial Electrolyzer Max Input (Value in EU)")
public static int maxInput = 128;
@ConfigRegistry(config = "machines", category = "industrial_electrolyzer", key = "IndustrialElectrolyzerMaxEnergy", comment = "Industrial Electrolyzer Max Energy (Value in EU)")
public static int maxEnergy = 10_000;
public IndustrialElectrolyzerBlockEntity() {
super(TRBlockEntities.INDUSTRIAL_ELECTROLYZER, "IndustrialElectrolyzer", maxInput, maxEnergy, TRContent.Machine.INDUSTRIAL_ELECTROLYZER.block, 6);
super(TRBlockEntities.INDUSTRIAL_ELECTROLYZER, "IndustrialElectrolyzer", TechRebornConfig.industrialElectrolyzerMaxInput, TechRebornConfig.industrialElectrolyzerMaxEnergy, TRContent.Machine.INDUSTRIAL_ELECTROLYZER.block, 6);
final int[] inputs = new int[] { 0, 1 };
final int[] outputs = new int[] { 2, 3, 4, 5 };
this.inventory = new RebornInventory<>(7, "IndustrialElectrolyzerBlockEntity", 64, this);

View file

@ -30,24 +30,17 @@ import net.minecraft.nbt.CompoundTag;
import net.minecraft.util.math.Direction;
import reborncore.api.IToolDrop;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.config.Config;
import reborncore.common.util.WorldUtils;
import techreborn.TechReborn;
import techreborn.blocks.tier1.BlockPlayerDetector;
import techreborn.blocks.tier1.BlockPlayerDetector.PlayerDetectorType;
import techreborn.config.TechRebornConfig;
import techreborn.init.TRContent;
import techreborn.init.TRBlockEntities;
@RebornRegister(TechReborn.MOD_ID)
public class PlayerDectectorBlockEntity extends PowerAcceptorBlockEntity implements IToolDrop {
@ConfigRegistry(config = "machines", category = "player_detector", key = "PlayerDetectorMaxInput", comment = "Player Detector Max Input (Value in EU)")
public static int maxInput = 32;
@ConfigRegistry(config = "machines", category = "player_detector", key = "PlayerDetectorMaxEnergy", comment = "Player Detector Max Energy (Value in EU)")
public static int maxEnergy = 10000;
@ConfigRegistry(config = "machines", category = "player_detector", key = "PlayerDetectorEUPerSecond", comment = "Player Detector Energy Consumption per second (Value in EU)")
public static int euPerTick = 10;
public String owenerUdid = "";
boolean redstone = false;
@ -67,7 +60,7 @@ public class PlayerDectectorBlockEntity extends PowerAcceptorBlockEntity impleme
if (!world.isClient && world.getTime() % 20 == 0) {
boolean lastRedstone = redstone;
redstone = false;
if (canUseEnergy(euPerTick)) {
if (canUseEnergy(TechRebornConfig.playerDetectorEuPerTick)) {
for(PlayerEntity player : world.getPlayers()){
if (player.distanceTo(player) <= 256.0D) {
PlayerDetectorType type = world.getBlockState(pos).get(BlockPlayerDetector.TYPE);
@ -84,7 +77,7 @@ public class PlayerDectectorBlockEntity extends PowerAcceptorBlockEntity impleme
}
}
}
useEnergy(euPerTick);
useEnergy(TechRebornConfig.playerDetectorEuPerTick);
}
if (lastRedstone != redstone) {
WorldUtils.updateBlock(world, pos);
@ -95,7 +88,7 @@ public class PlayerDectectorBlockEntity extends PowerAcceptorBlockEntity impleme
@Override
public double getBaseMaxPower() {
return maxEnergy;
return TechRebornConfig.playerDetectorMaxEnergy;
}
@Override
@ -115,7 +108,7 @@ public class PlayerDectectorBlockEntity extends PowerAcceptorBlockEntity impleme
@Override
public double getBaseMaxInput() {
return maxInput;
return TechRebornConfig.playerDetectorMaxInput;
}
@Override

View file

@ -36,23 +36,13 @@ import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.RebornInventory;
import techreborn.TechReborn;
import techreborn.config.TechRebornConfig;
import techreborn.init.TRContent;
import techreborn.init.TRBlockEntities;
@RebornRegister(TechReborn.MOD_ID)
public class RecyclerBlockEntity extends PowerAcceptorBlockEntity
implements IToolDrop, InventoryProvider, IContainerProvider {
@ConfigRegistry(config = "machines", category = "recycler", key = "RecyclerInput", comment = "Recycler Max Input (Value in EU)")
public static int maxInput = 32;
@ConfigRegistry(config = "machines", category = "recycler", key = "RecyclerMaxEnergy", comment = "Recycler Max Energy (Value in EU)")
public static int maxEnergy = 1000;
@ConfigRegistry(config = "machines", category = "recycler", key = "produceIC2Scrap", comment = "When enabled and when ic2 is installed the recycler will make ic2 scrap")
public static boolean produceIC2Scrap = false;
private final RebornInventory<RecyclerBlockEntity> inventory = new RebornInventory<>(3, "RecyclerBlockEntity", 64, this);
private final int cost = 2;
@ -159,7 +149,7 @@ public class RecyclerBlockEntity extends PowerAcceptorBlockEntity
@Override
public double getBaseMaxPower() {
return maxEnergy;
return TechRebornConfig.recyclerMaxEnergy;
}
@Override
@ -179,7 +169,7 @@ public class RecyclerBlockEntity extends PowerAcceptorBlockEntity
@Override
public double getBaseMaxInput() {
return maxInput;
return TechRebornConfig.recyclerMaxInput;
}
// TileMachineBase

View file

@ -40,17 +40,14 @@ import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.crafting.RecipeManager;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.RebornInventory;
import reborncore.common.util.ItemUtils;
import techreborn.TechReborn;
import reborncore.common.util.RebornInventory;
import techreborn.api.recipe.recipes.RollingMachineRecipe;
import techreborn.config.TechRebornConfig;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
import javax.annotation.Nonnull;
import java.util.ArrayList;
@ -61,19 +58,9 @@ import java.util.stream.Collectors;
//TODO add tick and power bars.
@RebornRegister(TechReborn.MOD_ID)
public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity
implements IToolDrop, InventoryProvider, IContainerProvider {
@ConfigRegistry(config = "machines", category = "rolling_machine", key = "RollingMachineMaxInput", comment = "Rolling Machine Max Input (Value in EU)")
public static int maxInput = 32;
@ConfigRegistry(config = "machines", category = "rolling_machine", key = "RollingMachineEnergyPerTick", comment = "Rolling Machine Energy Per Tick (Value in EU)")
public static int energyPerTick = 5;
@ConfigRegistry(config = "machines", category = "rolling_machine", key = "RollingMachineEnergyRunTime", comment = "Rolling Machine Run Time")
public static int runTime = 250;
@ConfigRegistry(config = "machines", category = "rolling_machine", key = "RollingMachineMaxEnergy", comment = "Rolling Machine Max Energy (Value in EU)")
public static int maxEnergy = 10000;
public int[] craftingSlots = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
private CraftingInventory craftCache;
public RebornInventory<RollingMachineBlockEntity> inventory = new RebornInventory<>(12, "RollingMachineBlockEntity", 64, this);
@ -93,7 +80,7 @@ public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity
@Override
public double getBaseMaxPower() {
return maxEnergy;
return TechRebornConfig.rollingMachineMaxEnergy;
}
@Override
@ -113,7 +100,7 @@ public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity
@Override
public double getBaseMaxInput() {
return maxInput;
return TechRebornConfig.rollingMachineMaxInput;
}
@Override
@ -140,7 +127,7 @@ public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity
}
if (!currentRecipeOutput.isEmpty() && canMake(craftMatrix)) {
if (tickTime >= Math.max((int) (runTime * (1.0 - getSpeedMultiplier())), 1)) {
if (tickTime >= Math.max((int) (TechRebornConfig.rollingMachineRunTime * (1.0 - getSpeedMultiplier())), 1)) {
currentRecipeOutput = findMatchingRecipeOutput(craftMatrix, world);
if (!currentRecipeOutput.isEmpty()) {
boolean hasCrafted = false;
@ -173,10 +160,10 @@ public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity
tickTime = 0;
}
if (!currentRecipeOutput.isEmpty()) {
if (canUseEnergy(getEuPerTick(energyPerTick))
&& tickTime < Math.max((int) (runTime * (1.0 - getSpeedMultiplier())), 1)
if (canUseEnergy(getEuPerTick(TechRebornConfig.rollingMachineEnergyPerTick))
&& tickTime < Math.max((int) (TechRebornConfig.rollingMachineRunTime * (1.0 - getSpeedMultiplier())), 1)
&& canMake(craftMatrix)) {
useEnergy(getEuPerTick(energyPerTick));
useEnergy(getEuPerTick(TechRebornConfig.rollingMachineEnergyPerTick));
tickTime++;
} else {
setIsActive(false);
@ -392,10 +379,10 @@ public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity
}
public int getBurnTimeRemainingScaled(final int scale) {
if (tickTime == 0 || Math.max((int) (runTime* (1.0 - getSpeedMultiplier())), 1) == 0) {
if (tickTime == 0 || Math.max((int) (TechRebornConfig.rollingMachineRunTime* (1.0 - getSpeedMultiplier())), 1) == 0) {
return 0;
}
return tickTime * scale / Math.max((int) (runTime* (1.0 - getSpeedMultiplier())), 1);
return tickTime * scale / Math.max((int) (TechRebornConfig.rollingMachineRunTime* (1.0 - getSpeedMultiplier())), 1);
}
@Override
@ -422,8 +409,8 @@ public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity
}
public int getProgressScaled(final int scale) {
if (tickTime != 0 && Math.max((int) (runTime* (1.0 - getSpeedMultiplier())), 1) != 0) {
return tickTime * scale / Math.max((int) (runTime* (1.0 - getSpeedMultiplier())), 1);
if (tickTime != 0 && Math.max((int) (TechRebornConfig.rollingMachineRunTime* (1.0 - getSpeedMultiplier())), 1) != 0) {
return tickTime * scale / Math.max((int) (TechRebornConfig.rollingMachineRunTime* (1.0 - getSpeedMultiplier())), 1);
}
return 0;
}

View file

@ -28,25 +28,17 @@ import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.RebornInventory;
import techreborn.TechReborn;
import techreborn.api.recipe.ScrapboxRecipeCrafter;
import techreborn.config.TechRebornConfig;
import techreborn.init.TRContent;
import techreborn.init.TRBlockEntities;
import techreborn.blockentity.GenericMachineBlockEntity;
@RebornRegister(TechReborn.MOD_ID)
public class ScrapboxinatorBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
@ConfigRegistry(config = "machines", category = "scrapboxinator", key = "ScrapboxinatorMaxInput", comment = "Scrapboxinator Max Input (Value in EU)")
public static int maxInput = 32;
@ConfigRegistry(config = "machines", category = "scrapboxinator", key = "ScrapboxinatorMaxEnergy", comment = "Scrapboxinator Max Energy (Value in EU)")
public static int maxEnergy = 1_000;
public ScrapboxinatorBlockEntity() {
super(TRBlockEntities.SCRAPBOXINATOR, "Scrapboxinator", maxInput, maxEnergy, TRContent.Machine.SCRAPBOXINATOR.block, 2);
super(TRBlockEntities.SCRAPBOXINATOR, "Scrapboxinator", TechRebornConfig.scrapboxinatorMaxInput, TechRebornConfig.scrapboxinatorMaxEnergy, TRContent.Machine.SCRAPBOXINATOR.block, 2);
final int[] inputs = new int[] { 0 };
final int[] outputs = new int[] { 1 };
this.inventory = new RebornInventory<>(3, "ScrapboxinatorBlockEntity", 64, this);

View file

@ -33,28 +33,15 @@ import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.RebornInventory;
import techreborn.TechReborn;
import techreborn.init.TRContent;
import techreborn.config.TechRebornConfig;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
@RebornRegister(TechReborn.MOD_ID)
public class ChunkLoaderBlockEntity extends PowerAcceptorBlockEntity implements IToolDrop, InventoryProvider, IContainerProvider {
@ConfigRegistry(config = "machines", category = "chunk_loader", key = "ChunkLoaderMaxInput", comment = "Chunk Loader Max Input (Value in EU)")
public static int maxInput = 32;
@ConfigRegistry(config = "machines", category = "chunk_loader", key = "ChunkLoaderMaxEnergy", comment = "Chunk Loader Max Energy (Value in EU)")
public static int maxEnergy = 10_000;
// @ConfigRegistry(config = "machines", category = "chunk_loader", key = "ChunkLoaderWrenchDropRate", comment = "Chunk Loader Wrench Drop Rate")
public static float wrenchDropRate = 1.0F;
public RebornInventory<ChunkLoaderBlockEntity> inventory = new RebornInventory<>(1, "ChunkLoaderBlockEntity", 64, this);
public boolean isRunning;
public int tickTime;
public ChunkLoaderBlockEntity() {
super(TRBlockEntities.CHUNK_LOADER );
}
@ -64,13 +51,9 @@ public class ChunkLoaderBlockEntity extends PowerAcceptorBlockEntity implements
return TRContent.Machine.CHUNK_LOADER.getStack();
}
public boolean isComplete() {
return false;
}
@Override
public double getBaseMaxPower() {
return maxEnergy;
return TechRebornConfig.chunkLoaderMaxEnergy;
}
@Override
@ -90,7 +73,7 @@ public class ChunkLoaderBlockEntity extends PowerAcceptorBlockEntity implements
@Override
public double getBaseMaxInput() {
return maxInput;
return TechRebornConfig.chunkLoaderMaxInput;
}
@Override

View file

@ -33,27 +33,17 @@ import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.config.Config;
import reborncore.common.util.RebornInventory;
import reborncore.common.util.ItemUtils;
import techreborn.TechReborn;
import techreborn.config.TechRebornConfig;
import techreborn.init.TRContent;
import techreborn.init.TRBlockEntities;
@RebornRegister(TechReborn.MOD_ID)
public class MatterFabricatorBlockEntity extends PowerAcceptorBlockEntity
implements IToolDrop, InventoryProvider, IContainerProvider {
@ConfigRegistry(config = "machines", category = "matter_fabricator", key = "MatterFabricatorMaxInput", comment = "Matter Fabricator Max Input (Value in EU)")
public static int maxInput = 8192;
@ConfigRegistry(config = "machines", category = "matter_fabricator", key = "MatterFabricatorMaxEnergy", comment = "Matter Fabricator Max Energy (Value in EU)")
public static int maxEnergy = 10_000_000;
@ConfigRegistry(config = "machines", category = "matter_fabricator", key = "MatterFabricatorFabricationRate", comment = "Matter Fabricator Fabrication Rate, amount of amplifier units per UUM")
public static int fabricationRate = 6_000;
@ConfigRegistry(config = "machines", category = "matter_fabricator", key = "MatterFabricatorEnergyPerAmp", comment = "Matter Fabricator EU per amplifier unit, multiply this with the rate for total EU")
public static int energyPerAmp = 5;
public RebornInventory<MatterFabricatorBlockEntity> inventory = new RebornInventory<>(12, "MatterFabricatorBlockEntity", 64, this);
private int amplifier = 0;
@ -127,7 +117,7 @@ public class MatterFabricatorBlockEntity extends PowerAcceptorBlockEntity
public int getProgressScaled(int scale) {
if (amplifier != 0) {
return Math.min(amplifier * scale / fabricationRate, 100);
return Math.min(amplifier * scale / TechRebornConfig.matterFabricatorFabricationRate, 100);
}
return 0;
}
@ -146,7 +136,7 @@ public class MatterFabricatorBlockEntity extends PowerAcceptorBlockEntity
final ItemStack stack = inventory.getInvStack(i);
if (!stack.isEmpty() && spaceForOutput()) {
final int amp = getValue(stack);
final int euNeeded = amp * energyPerAmp;
final int euNeeded = amp * TechRebornConfig.matterFabricatorEnergyPerAmp;
if (amp != 0 && this.canUseEnergy(euNeeded)) {
useEnergy(euNeeded);
amplifier += amp;
@ -155,17 +145,17 @@ public class MatterFabricatorBlockEntity extends PowerAcceptorBlockEntity
}
}
if (amplifier >= fabricationRate) {
if (amplifier >= TechRebornConfig.matterFabricatorFabricationRate) {
if (spaceForOutput()) {
addOutputProducts();
amplifier -= fabricationRate;
amplifier -= TechRebornConfig.matterFabricatorFabricationRate;
}
}
}
@Override
public double getBaseMaxPower() {
return maxEnergy;
return TechRebornConfig.matterFabricatorMaxEnergy;
}
@Override
@ -185,7 +175,7 @@ public class MatterFabricatorBlockEntity extends PowerAcceptorBlockEntity
@Override
public double getBaseMaxInput() {
return maxInput;
return TechRebornConfig.matterFabricatorMaxInput;
}
// TileMachineBase

View file

@ -29,24 +29,18 @@ import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import techreborn.TechReborn;
import techreborn.init.TRBlockEntities;
import techreborn.blockentity.TechStorageBaseBlockEntity;
import techreborn.config.TechRebornConfig;
import techreborn.init.TRBlockEntities;
@RebornRegister(TechReborn.MOD_ID)
public class QuantumChestBlockEntity extends TechStorageBaseBlockEntity implements IContainerProvider {
@ConfigRegistry(config = "machines", category = "quantum_chest", key = "QuantumChestMaxStorage", comment = "Maximum amount of items a Quantum Chest can store")
public static int maxStorage = Integer.MAX_VALUE;
public QuantumChestBlockEntity() {
this(TRBlockEntities.QUANTUM_CHEST);
}
public QuantumChestBlockEntity(BlockEntityType<?> blockEntityType) {
super(blockEntityType, "QuantumChestBlockEntity", maxStorage);
super(blockEntityType, "QuantumChestBlockEntity", TechRebornConfig.quantumChestMaxStorage);
}
@Override

View file

@ -36,12 +36,10 @@ import reborncore.api.blockentity.InventoryProvider;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.blockentity.MachineBaseBlockEntity;
import reborncore.common.util.RebornInventory;
import reborncore.common.util.Tank;
import techreborn.TechReborn;
import techreborn.config.TechRebornConfig;
import techreborn.init.TRContent;
import techreborn.init.TRBlockEntities;
import techreborn.utils.FluidUtils;
@ -49,14 +47,10 @@ import techreborn.utils.FluidUtils;
import javax.annotation.Nullable;
import java.util.List;
@RebornRegister(TechReborn.MOD_ID)
public class QuantumTankBlockEntity extends MachineBaseBlockEntity
implements InventoryProvider, IToolDrop, IListInfoProvider, IContainerProvider {
@ConfigRegistry(config = "machines", category = "quantum_tank", key = "QuantumTankMaxStorage", comment = "Maximum amount of millibuckets a Quantum Tank can store")
public static int maxStorage = Integer.MAX_VALUE;
public Tank tank = new Tank("QuantumTankBlockEntity", maxStorage, this);
public Tank tank = new Tank("QuantumTankBlockEntity", TechRebornConfig.quantumTankMaxStorage, this);
public RebornInventory<QuantumTankBlockEntity> inventory = new RebornInventory<>(3, "QuantumTankBlockEntity", 64, this);
public QuantumTankBlockEntity(){