From b86abff2f5e5ef89a9b59cf5b80b950f6cb6dc61 Mon Sep 17 00:00:00 2001 From: OneEyeMaker Date: Fri, 22 Sep 2017 07:24:21 +0300 Subject: [PATCH] Added configuration for HandHeld Filler --- .../mod/config/values/ConfigIntValues.java | 6 +++++- .../actuallyadditions/mod/items/ItemFillingWand.java | 11 ++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigIntValues.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigIntValues.java index e93b542de..9d6a3c905 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigIntValues.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigIntValues.java @@ -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_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_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 category; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFillingWand.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFillingWand.java index 5210271f2..6205837af 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFillingWand.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFillingWand.java @@ -10,6 +10,9 @@ 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.util.ModUtil; 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.world.World; -import java.util.List; - public class ItemFillingWand extends ItemEnergy{ 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){ @@ -69,7 +70,7 @@ public class ItemFillingWand extends ItemEnergy{ stack.getTagCompound().setInteger("state", Block.getStateId(state)); } - + //I think changing these to state ID is a good idea, but it will break all currently in-use wands, but whatever. It'll have to be done in 1.13 anyway. private static IBlockState loadBlock(ItemStack stack){ @@ -154,7 +155,7 @@ public class ItemFillingWand extends ItemEnergy{ BlockPos secondPos = new BlockPos(compound.getInteger("SecondX"), compound.getInteger("SecondY"), compound.getInteger("SecondZ")); if(!BlockPos.ORIGIN.equals(firstPos) && !BlockPos.ORIGIN.equals(secondPos)){ - int energyUse = 1500; + int energyUse = ConfigIntValues.FILLER_ENERGY_USE.getValue(); IBlockState replaceState = loadBlock(stack); if(replaceState != null && (creative || this.getEnergyStored(stack) >= energyUse)){