Added configuration for HandHeld Filler

This commit is contained in:
OneEyeMaker 2017-09-22 07:24:21 +03:00
parent 05a46dfa99
commit b86abff2f5
2 changed files with 11 additions and 6 deletions

View file

@ -46,7 +46,11 @@ public enum ConfigIntValues{
QUADRUPLE_BATTERY_ENERGY_CAPACITY("Quadruple Battery: Energy Capacity", ConfigCategories.TOOL_ENERGY_VALUES, 1000000, 1000, 1000000000, "Amount of energy Quadruple Battery can store"), QUADRUPLE_BATTERY_ENERGY_CAPACITY("Quadruple Battery: Energy Capacity", ConfigCategories.TOOL_ENERGY_VALUES, 1000000, 1000, 1000000000, "Amount of energy Quadruple Battery can store"),
QUADRUPLE_BATTERY_ENERGY_TRANSFER("Quadruple Battery: Energy Transfer Rate", ConfigCategories.TOOL_ENERGY_VALUES, 30000, 1, 1000000000, "Amount of energy Quadruple Battery can send or receive per tick"), QUADRUPLE_BATTERY_ENERGY_TRANSFER("Quadruple Battery: Energy Transfer Rate", ConfigCategories.TOOL_ENERGY_VALUES, 30000, 1, 1000000000, "Amount of energy Quadruple Battery can send or receive per tick"),
QUINTUPLE_BATTERY_ENERGY_CAPACITY("Quintuple Battery: Energy Capacity", ConfigCategories.TOOL_ENERGY_VALUES, 2000000, 1000, 1000000000, "Amount of energy Quintuple Battery can store"), QUINTUPLE_BATTERY_ENERGY_CAPACITY("Quintuple Battery: Energy Capacity", ConfigCategories.TOOL_ENERGY_VALUES, 2000000, 1000, 1000000000, "Amount of energy Quintuple Battery can store"),
QUINTUPLE_BATTERY_ENERGY_TRANSFER("Quintuple Battery: Energy Transfer Rate", ConfigCategories.TOOL_ENERGY_VALUES, 100000, 1, 1000000000, "Amount of energy Quintuple Battery can send or receive per tick"); QUINTUPLE_BATTERY_ENERGY_TRANSFER("Quintuple Battery: Energy Transfer Rate", ConfigCategories.TOOL_ENERGY_VALUES, 100000, 1, 1000000000, "Amount of energy Quintuple Battery can send or receive per tick"),
FILLER_ENERGY_CAPACITY("Handheld Filler: Energy Capacity", ConfigCategories.TOOL_ENERGY_VALUES, 500000, 1000, 1000000000, "Amount of energy Handheld Filler can store"),
FILLER_ENERGY_TRANSFER("Handheld Filler: Energy Transfer Rate", ConfigCategories.TOOL_ENERGY_VALUES, 1000, 1, 1000000000, "Amount of energy Handheld Filler can receive per tick"),
FILLER_ENERGY_USE("Handheld Filler: Energy Use", ConfigCategories.TOOL_ENERGY_VALUES, 1500, 1, 1000000000, "Amount of energy used by Handheld Filler to perform action");
public final String name; public final String name;
public final String category; public final String category;

View file

@ -10,6 +10,9 @@
package de.ellpeck.actuallyadditions.mod.items; package de.ellpeck.actuallyadditions.mod.items;
import java.util.List;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
import de.ellpeck.actuallyadditions.mod.items.base.ItemEnergy; import de.ellpeck.actuallyadditions.mod.items.base.ItemEnergy;
import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil;
@ -33,12 +36,10 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.World; import net.minecraft.world.World;
import java.util.List;
public class ItemFillingWand extends ItemEnergy{ public class ItemFillingWand extends ItemEnergy{
public ItemFillingWand(String name){ public ItemFillingWand(String name){
super(500000, 1000, name); super(ConfigIntValues.FILLER_ENERGY_CAPACITY.getValue(), ConfigIntValues.FILLER_ENERGY_TRANSFER.getValue(), name);
} }
private static boolean removeFittingItem(IBlockState state, EntityPlayer player){ private static boolean removeFittingItem(IBlockState state, EntityPlayer player){
@ -154,7 +155,7 @@ public class ItemFillingWand extends ItemEnergy{
BlockPos secondPos = new BlockPos(compound.getInteger("SecondX"), compound.getInteger("SecondY"), compound.getInteger("SecondZ")); BlockPos secondPos = new BlockPos(compound.getInteger("SecondX"), compound.getInteger("SecondY"), compound.getInteger("SecondZ"));
if(!BlockPos.ORIGIN.equals(firstPos) && !BlockPos.ORIGIN.equals(secondPos)){ if(!BlockPos.ORIGIN.equals(firstPos) && !BlockPos.ORIGIN.equals(secondPos)){
int energyUse = 1500; int energyUse = ConfigIntValues.FILLER_ENERGY_USE.getValue();
IBlockState replaceState = loadBlock(stack); IBlockState replaceState = loadBlock(stack);
if(replaceState != null && (creative || this.getEnergyStored(stack) >= energyUse)){ if(replaceState != null && (creative || this.getEnergyStored(stack) >= energyUse)){