From 55827f10b32f5823a47fc6ac0b231b24eb1fe717 Mon Sep 17 00:00:00 2001 From: OneEyeMaker Date: Tue, 3 Oct 2017 08:03:37 +0300 Subject: [PATCH] Added yet another configuration option for Shock Absorber --- .../actuallyadditions/mod/blocks/BlockShockSuppressor.java | 3 ++- .../de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java | 4 ++-- .../actuallyadditions/mod/config/values/ConfigIntValues.java | 3 ++- .../actuallyadditions/mod/tile/TileEntityPlayerInterface.java | 2 +- .../actuallyadditions/mod/tile/TileEntityShockSuppressor.java | 2 -- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockShockSuppressor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockShockSuppressor.java index 9eb748937..8dd10ee7c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockShockSuppressor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockShockSuppressor.java @@ -48,7 +48,8 @@ public class BlockShockSuppressor extends BlockContainerBase{ List affectedBlocks = event.getAffectedBlocks(); List affectedEntities = event.getAffectedEntities(); - int rangeSq = TileEntityShockSuppressor.RANGE*TileEntityShockSuppressor.RANGE; + int range = ConfigIntValues.SHOCK_ABSORBER_WORK_RANGE.getValue(); + int rangeSq = range*range; int energyUse = ConfigIntValues.SHOCK_ABSORBER_ENERGY_USE.getValue(); for(TileEntityShockSuppressor suppressor : TileEntityShockSuppressor.SUPPRESSORS){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java index 7fc93f07b..4bb77560f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java @@ -231,9 +231,9 @@ public final class InitBooklet{ new BookletChapter("energizer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockEnergizer), new PageCrafting(1, BlockCrafting.recipeEnergizer), new PageCrafting(2, BlockCrafting.recipeEnervator)); new BookletChapter("repairer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockItemRepairer), new PageCrafting(1, BlockCrafting.recipeRepairer).addTextReplacement("", TileEntityItemRepairer.ENERGY_USE)); new BookletChapter("longRangeBreaker", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockDirectionalBreaker), new PageTextOnly(1).addTextReplacement("", TileEntityDirectionalBreaker.ENERGY_USE).addTextReplacement("", TileEntityDirectionalBreaker.RANGE), new PageCrafting(2, BlockCrafting.recipeDirectionalBreaker).setWildcard()); - new BookletChapter("playerInterface", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockPlayerInterface), new PageTextOnly(1).addTextReplacement("", ConfigIntValues.PLAYER_INTERFACE_DEFAULT_RANGE.getValue()), new PageCrafting(2, BlockCrafting.recipePlayerInterface).setNoText()).setSpecial(); + new BookletChapter("playerInterface", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockPlayerInterface), new PageTextOnly(1).addTextReplacement("", ConfigIntValues.PLAYER_INTERFACE_WORK_RANGE.getValue()), new PageCrafting(2, BlockCrafting.recipePlayerInterface).setNoText()).setSpecial(); new BookletChapter("displayStand", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockDisplayStand), new PageTextOnly(1), new PageTextOnly(2), new PageCrafting(3, BlockCrafting.recipeDisplayStand).setNoText()).setSpecial(); - new BookletChapter("shockSuppressor", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockShockSuppressor), new PageTextOnly(1).addTextReplacement("", TileEntityShockSuppressor.RANGE).addTextReplacement("", ConfigIntValues.SHOCK_ABSORBER_ENERGY_USE.getValue()), new PageCrafting(2, BlockCrafting.recipeShockSuppressor)); + new BookletChapter("shockSuppressor", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockShockSuppressor), new PageTextOnly(1).addTextReplacement("", ConfigIntValues.SHOCK_ABSORBER_WORK_RANGE.getValue()).addTextReplacement("", ConfigIntValues.SHOCK_ABSORBER_ENERGY_USE.getValue()), new PageCrafting(2, BlockCrafting.recipeShockSuppressor)); //RF Generating Blocks new BookletChapter("solarPanel", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockFurnaceSolar), new PageTextOnly(1).addTextReplacement("", TileEntityFurnaceSolar.PRODUCE), new PageCrafting(2, BlockCrafting.recipeSolar).setNoText()); 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 c61f34cd9..017378d57 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 @@ -95,9 +95,10 @@ public enum ConfigIntValues{ SHOCK_ABSORBER_ENERGY_CAPACITY("Shock Absorber: Energy Capacity", ConfigCategories.MACHINE_ENERGY_VALUES, 300000, 1000, 1000000000, "Amount of energy Shock Absorber can store."), SHOCK_ABSORBER_ENERGY_RECEIVE("Shock Absorber: Energy Receive Rate", ConfigCategories.MACHINE_ENERGY_VALUES, 400, 1, 1000000000, "Amount of energy Shock Absorber can receive per tick."), SHOCK_ABSORBER_ENERGY_USE("Shock Absorber: Energy Use", ConfigCategories.MACHINE_ENERGY_VALUES, 300, 1, 1000000000, "Amount of energy Shock Absorber uses to protect block or entity."), + SHOCK_ABSORBER_WORK_RANGE("Shock Absorber: Work Range", ConfigCategories.MACHINE_VALUES, 5, 1, 16, "Distance in block in which Shock Absorber protects blocks and entities."), PLAYER_INTERFACE_ENERGY_CAPACITY("Player Interface: Energy Capacity", ConfigCategories.MACHINE_ENERGY_VALUES, 30000, 1000, 1000000000, "Amount of energy Player Interface can store."), PLAYER_INTERFACE_ENERGY_RECEIVE("Player Interface: Energy Receive Rate", ConfigCategories.MACHINE_ENERGY_VALUES, 50, 1, 1000000000, "Amount of energy Player Interface can receive per tick.\nThis option defines rate of charging items in player's inventory."), - PLAYER_INTERFACE_DEFAULT_RANGE("Player Interface: Default Range", ConfigCategories.MACHINE_VALUES, 32, 1, 64, "Distance in block in which Player Interface works."); + PLAYER_INTERFACE_WORK_RANGE("Player Interface: Work Range", ConfigCategories.MACHINE_VALUES, 32, 1, 64, "Distance in block in which Player Interface works."); public final String name; public final String category; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java index 1d9e94834..c0c70fb26 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java @@ -71,7 +71,7 @@ public class TileEntityPlayerInterface extends TileEntityBase implements IEnergy if(!this.world.isRemote){ boolean changed = false; - this.range = TileEntityPhantomface.upgradeRange(ConfigIntValues.PLAYER_INTERFACE_DEFAULT_RANGE.getValue(), this.world, this.pos); + this.range = TileEntityPhantomface.upgradeRange(ConfigIntValues.PLAYER_INTERFACE_WORK_RANGE.getValue(), this.world, this.pos); EntityPlayer player = this.getPlayer(); if(player != null){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityShockSuppressor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityShockSuppressor.java index d94d91836..103e7f354 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityShockSuppressor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityShockSuppressor.java @@ -22,8 +22,6 @@ public class TileEntityShockSuppressor extends TileEntityBase implements IEnergy public static final List SUPPRESSORS = new ArrayList(); - public static final int RANGE = 5; - public final CustomEnergyStorage storage = new CustomEnergyStorage(ConfigIntValues.SHOCK_ABSORBER_ENERGY_CAPACITY.getValue(), ConfigIntValues.SHOCK_ABSORBER_ENERGY_RECEIVE.getValue(), 0); private int oldEnergy;