Move configs to one class
This commit is contained in:
parent
9db1978410
commit
77eee6f5b4
76 changed files with 731 additions and 5583 deletions
|
@ -35,23 +35,12 @@ import net.minecraft.world.Heightmap;
|
|||
import reborncore.api.IToolDrop;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.registration.RebornRegister;
|
||||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
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 LightningRodBlockEntity extends PowerAcceptorBlockEntity implements IToolDrop {
|
||||
|
||||
@ConfigRegistry(config = "generators", category = "lightning_rod", key = "LightningRodMaxOutput", comment = "Lightning Rod Max Output (Value in EU)")
|
||||
public static int maxOutput = 2048;
|
||||
@ConfigRegistry(config = "generators", category = "lightning_rod", key = "LightningRodMaxEnergy", comment = "Lightning Rod Max Energy (Value in EU)")
|
||||
public static int maxEnergy = 100_000_000;
|
||||
@ConfigRegistry(config = "generators", category = "lightning_rod", key = "LightningRodChanceOfStrike", comment = "Chance of lightning striking a rod (Range: 0-70)")
|
||||
public static int chanceOfStrike = 24;
|
||||
@ConfigRegistry(config = "generators", category = "lightning_rod", key = "LightningRodBaseStrikeEnergy", comment = "Base amount of energy per strike (Value in EU)")
|
||||
public static int baseEnergyStrike = 262_144;
|
||||
|
||||
private int onStatusHoldTicks = -1;
|
||||
|
||||
|
@ -80,7 +69,7 @@ public class LightningRodBlockEntity extends PowerAcceptorBlockEntity implements
|
|||
final float weatherStrength = world.getThunderGradient(1.0F);
|
||||
if (weatherStrength > 0.2F) {
|
||||
//lightStrikeChance = (MAX - (CHANCE * WEATHER_STRENGTH)
|
||||
final float lightStrikeChance = (100F - chanceOfStrike) * 20F;
|
||||
final float lightStrikeChance = (100F - TechRebornConfig.lightningRodChanceOfStrike) * 20F;
|
||||
final float totalChance = lightStrikeChance * getLightningStrikeMultiplier() * (1.1F - weatherStrength);
|
||||
if (world.random.nextInt((int) Math.floor(totalChance)) == 0) {
|
||||
if (!isValidIronFence(pos.up().getY())) {
|
||||
|
@ -94,7 +83,7 @@ public class LightningRodBlockEntity extends PowerAcceptorBlockEntity implements
|
|||
if (!world.isClient) {
|
||||
((ServerWorld) world).addLightning(lightningBolt);
|
||||
}
|
||||
addEnergy(baseEnergyStrike * (0.3F + weatherStrength));
|
||||
addEnergy(TechRebornConfig.lightningRodBaseEnergyStrike * (0.3F + weatherStrength));
|
||||
machineBaseBlock.setActive(true, world, pos);
|
||||
onStatusHoldTicks = 400;
|
||||
}
|
||||
|
@ -127,7 +116,7 @@ public class LightningRodBlockEntity extends PowerAcceptorBlockEntity implements
|
|||
|
||||
@Override
|
||||
public double getBaseMaxPower() {
|
||||
return maxEnergy;
|
||||
return TechRebornConfig.lightningRodMaxEnergy;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -142,7 +131,7 @@ public class LightningRodBlockEntity extends PowerAcceptorBlockEntity implements
|
|||
|
||||
@Override
|
||||
public double getBaseMaxOutput() {
|
||||
return maxOutput;
|
||||
return TechRebornConfig.lightningRodMaxOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -29,27 +29,15 @@ import net.minecraft.item.ItemStack;
|
|||
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.api.generator.EFluidGenerator;
|
||||
import techreborn.config.TechRebornConfig;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class PlasmaGeneratorBlockEntity extends BaseFluidGeneratorBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "generators", category = "plasma_generator", key = "PlasmaGeneratorMaxOutput", comment = "Plasma Generator Max Output (Value in EU)")
|
||||
public static int maxOutput = 2048;
|
||||
@ConfigRegistry(config = "generators", category = "plasma_generator", key = "PlasmaGeneratorMaxEnergy", comment = "Plasma Generator Max Energy (Value in EU)")
|
||||
public static double maxEnergy = 500_000_000;
|
||||
@ConfigRegistry(config = "generators", category = "plasma_generator", key = "PlasmaGeneratorTankCapacity", comment = "Plasma Generator Tank Capacity")
|
||||
public static int tankCapacity = 10_000;
|
||||
@ConfigRegistry(config = "generators", category = "plasma_generator", key = "PlasmaGeneratorEnergyPerTick", comment = "Plasma Generator Energy Per Tick (Value in EU)")
|
||||
public static int energyPerTick = 400;
|
||||
|
||||
public PlasmaGeneratorBlockEntity() {
|
||||
super(TRBlockEntities.PLASMA_GENERATOR, EFluidGenerator.PLASMA, "PlasmaGeneratorBlockEntity", tankCapacity, energyPerTick);
|
||||
super(TRBlockEntities.PLASMA_GENERATOR, EFluidGenerator.PLASMA, "PlasmaGeneratorBlockEntity", TechRebornConfig.plasmaGeneratorTankCapacity, TechRebornConfig.plasmaGeneratorEnergyPerTick);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -59,12 +47,12 @@ public class PlasmaGeneratorBlockEntity extends BaseFluidGeneratorBlockEntity im
|
|||
|
||||
@Override
|
||||
public double getBaseMaxPower() {
|
||||
return maxEnergy;
|
||||
return TechRebornConfig.plasmaGeneratorMaxEnergy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getBaseMaxOutput() {
|
||||
return maxOutput;
|
||||
return TechRebornConfig.plasmaGeneratorMaxOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -29,28 +29,16 @@ import net.minecraft.item.ItemStack;
|
|||
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.api.generator.EFluidGenerator;
|
||||
import techreborn.config.TechRebornConfig;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.blockentity.generator.BaseFluidGeneratorBlockEntity;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class DieselGeneratorBlockEntity extends BaseFluidGeneratorBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "generators", category = "diesel_generator", key = "DieselGeneratorMaxOutput", comment = "Diesel Generator Max Output (Value in EU)")
|
||||
public static int maxOutput = 128;
|
||||
@ConfigRegistry(config = "generators", category = "diesel_generator", key = "DieselGeneratorMaxEnergy", comment = "Diesel Generator Max Energy (Value in EU)")
|
||||
public static int maxEnergy = 1_000_000;
|
||||
@ConfigRegistry(config = "generators", category = "diesel_generator", key = "DieselGeneratorTankCapacity", comment = "Diesel Generator Tank Capacity")
|
||||
public static int tankCapacity = 10_000;
|
||||
@ConfigRegistry(config = "generators", category = "diesel_generator", key = "DieselGeneratorEnergyPerTick", comment = "Diesel Generator Energy Per Tick (Value in EU)")
|
||||
public static int energyPerTick = 20;
|
||||
|
||||
public DieselGeneratorBlockEntity() {
|
||||
super(TRBlockEntities.DIESEL_GENERATOR, EFluidGenerator.DIESEL, "DieselGeneratorBlockEntity", tankCapacity, energyPerTick);
|
||||
super(TRBlockEntities.DIESEL_GENERATOR, EFluidGenerator.DIESEL, "DieselGeneratorBlockEntity", TechRebornConfig.dieselGeneratorTankCapacity, TechRebornConfig.dieselGeneratorEnergyPerTick);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -60,12 +48,12 @@ public class DieselGeneratorBlockEntity extends BaseFluidGeneratorBlockEntity im
|
|||
|
||||
@Override
|
||||
public double getBaseMaxPower() {
|
||||
return maxEnergy;
|
||||
return TechRebornConfig.dieselGeneratorMaxEnergy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getBaseMaxOutput() {
|
||||
return maxOutput;
|
||||
return TechRebornConfig.dieselGeneratorMaxOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -33,24 +33,14 @@ import reborncore.api.IToolDrop;
|
|||
import reborncore.api.blockentity.InventoryProvider;
|
||||
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 DragonEggSyphonBlockEntity extends PowerAcceptorBlockEntity
|
||||
implements IToolDrop, InventoryProvider {
|
||||
|
||||
@ConfigRegistry(config = "generators", category = "dragon_egg_siphoner", key = "DragonEggSiphonerMaxOutput", comment = "Dragon Egg Siphoner Max Output (Value in EU)")
|
||||
public static int maxOutput = 128;
|
||||
@ConfigRegistry(config = "generators", category = "dragon_egg_siphoner", key = "DragonEggSiphonerMaxEnergy", comment = "Dragon Egg Siphoner Max Energy (Value in EU)")
|
||||
public static int maxEnergy = 1000;
|
||||
@ConfigRegistry(config = "generators", category = "dragon_egg_siphoner", key = "DragonEggSiphonerEnergyPerTick", comment = "Dragon Egg Siphoner Energy Per Tick (Value in EU)")
|
||||
public static int energyPerTick = 4;
|
||||
|
||||
public RebornInventory<DragonEggSyphonBlockEntity> inventory = new RebornInventory<>(3, "DragonEggSyphonBlockEntity", 64, this);
|
||||
private long lastOutput = 0;
|
||||
|
||||
|
@ -77,7 +67,7 @@ public class DragonEggSyphonBlockEntity extends PowerAcceptorBlockEntity
|
|||
if (!world.isClient) {
|
||||
if (world.getBlockState(new BlockPos(pos.getX(), pos.getY() + 1, pos.getZ()))
|
||||
.getBlock() == Blocks.DRAGON_EGG) {
|
||||
if (tryAddingEnergy(energyPerTick))
|
||||
if (tryAddingEnergy(TechRebornConfig.dragonEggSyphonEnergyPerTick))
|
||||
lastOutput = world.getTime();
|
||||
}
|
||||
|
||||
|
@ -91,7 +81,7 @@ public class DragonEggSyphonBlockEntity extends PowerAcceptorBlockEntity
|
|||
|
||||
@Override
|
||||
public double getBaseMaxPower() {
|
||||
return maxEnergy;
|
||||
return TechRebornConfig.dragonEggSyphonMaxEnergy;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -106,7 +96,7 @@ public class DragonEggSyphonBlockEntity extends PowerAcceptorBlockEntity
|
|||
|
||||
@Override
|
||||
public double getBaseMaxOutput() {
|
||||
return maxOutput;
|
||||
return TechRebornConfig.dragonEggSyphonMaxOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -29,28 +29,16 @@ import net.minecraft.item.ItemStack;
|
|||
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.api.generator.EFluidGenerator;
|
||||
import techreborn.config.TechRebornConfig;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.blockentity.generator.BaseFluidGeneratorBlockEntity;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class GasTurbineBlockEntity extends BaseFluidGeneratorBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "generators", category = "gas_generator", key = "GasGeneratorMaxOutput", comment = "Gas Generator Max Output (Value in EU)")
|
||||
public static int maxOutput = 128;
|
||||
@ConfigRegistry(config = "generators", category = "gas_generator", key = "GasGeneratorMaxEnergy", comment = "Gas Generator Max Energy (Value in EU)")
|
||||
public static int maxEnergy = 1000000;
|
||||
@ConfigRegistry(config = "generators", category = "gas_generator", key = "GasGeneratorTankCapacity", comment = "Gas Generator Tank Capacity")
|
||||
public static int tankCapacity = 10000;
|
||||
@ConfigRegistry(config = "generators", category = "gas_generator", key = "GasGeneratorEnergyPerTick", comment = "Gas Generator Energy Per Tick (Value in EU)")
|
||||
public static int energyPerTick = 16;
|
||||
|
||||
public GasTurbineBlockEntity() {
|
||||
super(TRBlockEntities.GAS_TURBINE, EFluidGenerator.GAS, "GasTurbineBlockEntity", tankCapacity, energyPerTick);
|
||||
super(TRBlockEntities.GAS_TURBINE, EFluidGenerator.GAS, "GasTurbineBlockEntity", TechRebornConfig.gasTurbineTankCapacity, TechRebornConfig.gasTurbineEnergyPerTick);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -60,12 +48,12 @@ public class GasTurbineBlockEntity extends BaseFluidGeneratorBlockEntity impleme
|
|||
|
||||
@Override
|
||||
public double getBaseMaxPower() {
|
||||
return maxEnergy;
|
||||
return TechRebornConfig.gasTurbineMaxEnergy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getBaseMaxOutput() {
|
||||
return maxOutput;
|
||||
return TechRebornConfig.gasTurbineMaxOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -29,28 +29,16 @@ import net.minecraft.item.ItemStack;
|
|||
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.api.generator.EFluidGenerator;
|
||||
import techreborn.config.TechRebornConfig;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.blockentity.generator.BaseFluidGeneratorBlockEntity;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class SemiFluidGeneratorBlockEntity extends BaseFluidGeneratorBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "generators", category = "semifluid_generator", key = "SemifluidGeneratorMaxOutput", comment = "Semifluid Generator Max Output (Value in EU)")
|
||||
public static int maxOutput = 128;
|
||||
@ConfigRegistry(config = "generators", category = "semifluid_generator", key = "SemifluidGeneratorMaxEnergy", comment = "Semifluid Generator Max Energy (Value in EU)")
|
||||
public static int maxEnergy = 1000000;
|
||||
@ConfigRegistry(config = "generators", category = "semifluid_generator", key = "SemifluidGeneratorTankCapacity", comment = "Semifluid Generator Tank Capacity")
|
||||
public static int tankCapacity = 10000;
|
||||
@ConfigRegistry(config = "generators", category = "semifluid_generator", key = "SemifluidGeneratorEnergyPerTick", comment = "Semifluid Generator Energy Per Tick (Value in EU)")
|
||||
public static int energyPerTick = 8;
|
||||
|
||||
public SemiFluidGeneratorBlockEntity() {
|
||||
super(TRBlockEntities.SEMI_FLUID_GENERATOR, EFluidGenerator.SEMIFLUID, "SemiFluidGeneratorBlockEntity", tankCapacity, energyPerTick);
|
||||
super(TRBlockEntities.SEMI_FLUID_GENERATOR, EFluidGenerator.SEMIFLUID, "SemiFluidGeneratorBlockEntity", TechRebornConfig.semiFluidGeneratorTankCapacity, TechRebornConfig.semiFluidGeneratorEnergyPerTick);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -60,12 +48,12 @@ public class SemiFluidGeneratorBlockEntity extends BaseFluidGeneratorBlockEntity
|
|||
|
||||
@Override
|
||||
public double getBaseMaxPower() {
|
||||
return maxEnergy;
|
||||
return TechRebornConfig.semiFluidGeneratorMaxEnergy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getBaseMaxOutput() {
|
||||
return maxOutput;
|
||||
return TechRebornConfig.semiFluidGeneratorMaxOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -29,28 +29,16 @@ import net.minecraft.item.ItemStack;
|
|||
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.api.generator.EFluidGenerator;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.blockentity.generator.BaseFluidGeneratorBlockEntity;
|
||||
import techreborn.config.TechRebornConfig;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.init.TRContent;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class ThermalGeneratorBlockEntity extends BaseFluidGeneratorBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "generators", category = "thermal_generator", key = "ThermalGeneratorMaxOutput", comment = "Thermal Generator Max Output (Value in EU)")
|
||||
public static int maxOutput = 128;
|
||||
@ConfigRegistry(config = "generators", category = "thermal_generator", key = "ThermalGeneratorMaxEnergy", comment = "Thermal Generator Max Energy (Value in EU)")
|
||||
public static int maxEnergy = 1_000_000;
|
||||
@ConfigRegistry(config = "generators", category = "thermal_generator", key = "ThermalGeneratorTankCapacity", comment = "Thermal Generator Tank Capacity")
|
||||
public static int tankCapacity = 10_000;
|
||||
@ConfigRegistry(config = "generators", category = "thermal_generator", key = "ThermalGeneratorEnergyPerTick", comment = "Thermal Generator Energy Per Tick (Value in EU)")
|
||||
public static int energyPerTick = 16;
|
||||
|
||||
public ThermalGeneratorBlockEntity() {
|
||||
super(TRBlockEntities.THERMAL_GEN, EFluidGenerator.THERMAL, "ThermalGeneratorBlockEntity", tankCapacity, energyPerTick);
|
||||
super(TRBlockEntities.THERMAL_GEN, EFluidGenerator.THERMAL, "ThermalGeneratorBlockEntity", TechRebornConfig.thermalGeneratorTankCapacity, TechRebornConfig.thermalGeneratorEnergyPerTick);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -60,12 +48,12 @@ public class ThermalGeneratorBlockEntity extends BaseFluidGeneratorBlockEntity i
|
|||
|
||||
@Override
|
||||
public double getBaseMaxPower() {
|
||||
return maxEnergy;
|
||||
return TechRebornConfig.thermalGeneratorMaxEnergy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getBaseMaxOutput() {
|
||||
return maxOutput;
|
||||
return TechRebornConfig.thermalGeneratorMaxOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -40,25 +40,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.init.TRBlockEntities;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class SolidFuelGeneratorBlockEntity extends PowerAcceptorBlockEntity implements IToolDrop, InventoryProvider, IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "generators", category = "generator", key = "GeneratorMaxOutput", comment = "Solid Fuel Generator Max Output (Value in EU)")
|
||||
public static int maxOutput = 32;
|
||||
@ConfigRegistry(config = "generators", category = "generator", key = "GeneratorMaxEnergy", comment = "Solid Fuel Generator Max Energy (Value in EU)")
|
||||
public static int maxEnergy = 10_000;
|
||||
@ConfigRegistry(config = "generators", category = "generator", key = "GeneratorEnergyOutput", comment = "Solid Fuel Generator Energy Output Amount (Value in EU)")
|
||||
public static int outputAmount = 10;
|
||||
|
||||
public RebornInventory<SolidFuelGeneratorBlockEntity> inventory = new RebornInventory<>(2, "SolidFuelGeneratorBlockEntity", 64, this);
|
||||
public int fuelSlot = 0;
|
||||
public int burnTime;
|
||||
|
@ -90,7 +80,7 @@ public class SolidFuelGeneratorBlockEntity extends PowerAcceptorBlockEntity impl
|
|||
if (getEnergy() < getMaxPower()) {
|
||||
if (burnTime > 0) {
|
||||
burnTime--;
|
||||
addEnergy(SolidFuelGeneratorBlockEntity.outputAmount);
|
||||
addEnergy(TechRebornConfig.solidFuelGeneratorOutputAmount);
|
||||
isBurning = true;
|
||||
}
|
||||
} else {
|
||||
|
@ -131,7 +121,7 @@ public class SolidFuelGeneratorBlockEntity extends PowerAcceptorBlockEntity impl
|
|||
|
||||
@Override
|
||||
public double getBaseMaxPower() {
|
||||
return maxEnergy;
|
||||
return TechRebornConfig.solidFuelGeneratorMaxEnergy;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -146,7 +136,7 @@ public class SolidFuelGeneratorBlockEntity extends PowerAcceptorBlockEntity impl
|
|||
|
||||
@Override
|
||||
public double getBaseMaxOutput() {
|
||||
return maxOutput;
|
||||
return TechRebornConfig.solidFuelGeneratorMaxOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -31,26 +31,16 @@ import net.minecraft.util.math.Direction;
|
|||
import reborncore.api.IToolDrop;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.registration.RebornRegister;
|
||||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import techreborn.TechReborn;
|
||||
|
||||
import techreborn.config.TechRebornConfig;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 25/02/2016.
|
||||
*/
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class WaterMillBlockEntity extends PowerAcceptorBlockEntity implements IToolDrop {
|
||||
|
||||
@ConfigRegistry(config = "generators", category = "water_mill", key = "WaterMillMaxOutput", comment = "Water Mill Max Output (Value in EU)")
|
||||
public static int maxOutput = 32;
|
||||
@ConfigRegistry(config = "generators", category = "water_mill", key = "WaterMillMaxEnergy", comment = "Water Mill Max Energy (Value in EU)")
|
||||
public static int maxEnergy = 1000;
|
||||
@ConfigRegistry(config = "generators", category = "water_mill", key = "WaterMillEnergyPerTick", comment = "Water Mill Energy Multiplier")
|
||||
public static double energyMultiplier = 0.1;
|
||||
|
||||
int waterblocks = 0;
|
||||
|
||||
public WaterMillBlockEntity() {
|
||||
|
@ -64,7 +54,7 @@ public class WaterMillBlockEntity extends PowerAcceptorBlockEntity implements IT
|
|||
checkForWater();
|
||||
}
|
||||
if (waterblocks > 0) {
|
||||
addEnergy(waterblocks * energyMultiplier);
|
||||
addEnergy(waterblocks * TechRebornConfig.waterMillEnergyMultiplier);
|
||||
world.setBlockState(pos, world.getBlockState(pos).with(BlockMachineBase.ACTIVE, true));
|
||||
}
|
||||
else {
|
||||
|
@ -83,7 +73,7 @@ public class WaterMillBlockEntity extends PowerAcceptorBlockEntity implements IT
|
|||
|
||||
@Override
|
||||
public double getBaseMaxPower() {
|
||||
return maxEnergy;
|
||||
return TechRebornConfig.waterMillMaxEnergy;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -98,7 +88,7 @@ public class WaterMillBlockEntity extends PowerAcceptorBlockEntity implements IT
|
|||
|
||||
@Override
|
||||
public double getBaseMaxOutput() {
|
||||
return maxOutput;
|
||||
return TechRebornConfig.waterMillMaxOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -29,9 +29,7 @@ import net.minecraft.item.ItemStack;
|
|||
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 techreborn.TechReborn;
|
||||
import techreborn.config.TechRebornConfig;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
|
@ -39,18 +37,8 @@ import techreborn.init.TRBlockEntities;
|
|||
* Created by modmuss50 on 25/02/2016.
|
||||
*/
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class WindMillBlockEntity extends PowerAcceptorBlockEntity implements IToolDrop {
|
||||
|
||||
@ConfigRegistry(config = "generators", category = "wind_mill", key = "WindMillMaxOutput", comment = "Wind Mill Max Output (Value in EU)")
|
||||
public static int maxOutput = 128;
|
||||
@ConfigRegistry(config = "generators", category = "wind_mill", key = "WindMillMaxEnergy", comment = "Wind Mill Max Energy (Value in EU)")
|
||||
public static int maxEnergy = 10_000;
|
||||
@ConfigRegistry(config = "generators", category = "wind_mill", key = "WindMillEnergyPerTick", comment = "Wind Mill Energy Per Tick (Value in EU)")
|
||||
public static int baseEnergy = 2;
|
||||
@ConfigRegistry(config = "generators", category = "wind_mill", key = "WindMillThunderMultiplier", comment = "Wind Mill Thunder Multiplier")
|
||||
public static double thunderMultiplier = 1.25;
|
||||
|
||||
public WindMillBlockEntity() {
|
||||
super(TRBlockEntities.WIND_MILL);
|
||||
}
|
||||
|
@ -59,9 +47,9 @@ public class WindMillBlockEntity extends PowerAcceptorBlockEntity implements ITo
|
|||
public void tick() {
|
||||
super.tick();
|
||||
if (pos.getY() > 64) {
|
||||
int actualPower = baseEnergy;
|
||||
int actualPower = TechRebornConfig.windMillBaseEnergy;
|
||||
if (world.isThundering()) {
|
||||
actualPower *= thunderMultiplier;
|
||||
actualPower *= TechRebornConfig.windMillThunderMultiplier;
|
||||
}
|
||||
addEnergy(actualPower); // Value taken from
|
||||
// http://wiki.industrial-craft.net/?title=Wind_Mill
|
||||
|
@ -71,7 +59,7 @@ public class WindMillBlockEntity extends PowerAcceptorBlockEntity implements ITo
|
|||
|
||||
@Override
|
||||
public double getBaseMaxPower() {
|
||||
return maxEnergy;
|
||||
return TechRebornConfig.windMillMaxEnergy;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -86,7 +74,7 @@ public class WindMillBlockEntity extends PowerAcceptorBlockEntity implements ITo
|
|||
|
||||
@Override
|
||||
public double getBaseMaxOutput() {
|
||||
return maxOutput;
|
||||
return TechRebornConfig.windMillMaxOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue