Add atomic reconstructor battery config

as requested by @Darkosto
The recieve rate is always 0.0166 times the battery size.
This commit is contained in:
Shadows_of_Fire 2018-02-17 16:08:40 -05:00
parent 890de9e006
commit 76be3f4fc9
3 changed files with 10 additions and 4 deletions

View file

@ -23,9 +23,9 @@ if(hasProperty('buildnumber')){
} }
minecraft { minecraft {
version = "1.12.2-14.23.1.2566" version = "1.12.2-14.23.1.2599"
runDir = "run" runDir = "run"
mappings = "snapshot_20171215" mappings = "snapshot_20180119"
replaceIn "ModUtil.java" replaceIn "ModUtil.java"
replace "@VERSION@", project.version.toString() replace "@VERSION@", project.version.toString()
} }

View file

@ -30,7 +30,8 @@ public enum ConfigIntValues{
FONT_SIZE_LARGE("Booklet Large Font Size", ConfigCategories.OTHER, 0, 0, 500, "The size of the booklet's large font in percent. Set to 0 to use defaults from the lang file."), FONT_SIZE_LARGE("Booklet Large Font Size", ConfigCategories.OTHER, 0, 0, 500, "The size of the booklet's large font in percent. Set to 0 to use defaults from the lang file."),
ELEVEN("What is 11", ConfigCategories.OTHER, 11, 0, 12, "11?"), ELEVEN("What is 11", ConfigCategories.OTHER, 11, 0, 12, "11?"),
FUR_CHANCE("Fur Drop Chance", ConfigCategories.OTHER, 5000, 1, Integer.MAX_VALUE, "The 1/n drop chance, per tick, for a fur ball to be dropped."); FUR_CHANCE("Fur Drop Chance", ConfigCategories.OTHER, 5000, 1, Integer.MAX_VALUE, "The 1/n drop chance, per tick, for a fur ball to be dropped."),
RECONSTRUCTOR_POWER("Atomic Reconstructor Power", ConfigCategories.MACHINE_VALUES, 300000, 300000, Integer.MAX_VALUE, "The amount of power the atomic reconstructor can store.");
public final String name; public final String name;
public final String category; public final String category;

View file

@ -15,6 +15,7 @@ import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor;
import de.ellpeck.actuallyadditions.api.lens.ILensItem; import de.ellpeck.actuallyadditions.api.lens.ILensItem;
import de.ellpeck.actuallyadditions.api.lens.Lens; import de.ellpeck.actuallyadditions.api.lens.Lens;
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
import de.ellpeck.actuallyadditions.mod.misc.SoundHandler; import de.ellpeck.actuallyadditions.mod.misc.SoundHandler;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil;
@ -25,19 +26,23 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraft.util.SoundCategory; import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.energy.IEnergyStorage; import net.minecraftforge.energy.IEnergyStorage;
public class TileEntityAtomicReconstructor extends TileEntityInventoryBase implements IEnergyDisplay, IAtomicReconstructor{ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase implements IEnergyDisplay, IAtomicReconstructor{
public static final int ENERGY_USE = 1000; public static final int ENERGY_USE = 1000;
public final CustomEnergyStorage storage = new CustomEnergyStorage(300000, 5000, 0); public final CustomEnergyStorage storage;
public int counter; public int counter;
private int currentTime; private int currentTime;
private int oldEnergy; private int oldEnergy;
public TileEntityAtomicReconstructor(){ public TileEntityAtomicReconstructor(){
super(1, "reconstructor"); super(1, "reconstructor");
int power = ConfigIntValues.RECONSTRUCTOR_POWER.getValue();
int recieve = MathHelper.ceil(power * 0.016666F);
storage = new CustomEnergyStorage(power, recieve, 0);
} }
public static void shootLaser(World world, double startX, double startY, double startZ, double endX, double endY, double endZ, Lens currentLens){ public static void shootLaser(World world, double startX, double startY, double startZ, double endX, double endY, double endZ, Lens currentLens){