Added configuration for Vertical Digger

This commit is contained in:
OneEyeMaker 2017-10-03 08:55:58 +03:00
parent 789bd76e0a
commit 06ab7c817a
3 changed files with 13 additions and 9 deletions

View file

@ -223,7 +223,7 @@ public final class InitBooklet{
new BookletChapter("fireworkBox", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockFireworkBox), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityFireworkBox.USE_PER_SHOT), new PageCrafting(2, BlockCrafting.recipeFireworkBox)).setSpecial();
new BookletChapter("batteryBox", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockBatteryBox), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeBatteryBox).setNoText()).setSpecial();
new BookletChapter("farmer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockFarmer), new PageTextOnly(1), new PagePicture(2, "page_farmer_crops", 95).addItemsToPage(new ItemStack(Items.WHEAT_SEEDS)).addItemsToPage(new ItemStack(InitItems.itemCanolaSeed)), new PagePicture(3, "page_farmer_cactus", 105).addItemsToPage(new ItemStack(Blocks.CACTUS)), new PagePicture(4, "page_farmer_wart", 95).addItemsToPage(new ItemStack(Items.NETHER_WART)), new PagePicture(5, "page_farmer_reeds", 105).addItemsToPage(new ItemStack(Items.REEDS)), new PagePicture(6, "page_farmer_melons", 105).addItemsToPage(new ItemStack(Items.MELON), new ItemStack(Blocks.PUMPKIN), new ItemStack(Blocks.MELON_BLOCK)), new PagePicture(7, "page_farmer_enderlilly", 105), new PagePicture(8, "page_farmer_redorchid", 105), new PageCrafting(4, BlockCrafting.recipeFarmer).setWildcard().setNoText()).setImportant();
new BookletChapter("miner", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockMiner), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityMiner.ENERGY_USE_PER_BLOCK).addTextReplacement("<range>", TileEntityMiner.DEFAULT_RANGE), new PageCrafting(2, BlockCrafting.recipeMiner)).setSpecial();
new BookletChapter("miner", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockMiner), new PageTextOnly(1).addTextReplacement("<rf>", ConfigIntValues.VERTICAL_DIGGER_ENERGY_USE_PER_BLOCK.getValue()).addTextReplacement("<range>", ConfigIntValues.VERTICAL_DIGGER_WORK_RANGE.getValue()), new PageCrafting(2, BlockCrafting.recipeMiner)).setSpecial();
new BookletChapterCoffee("coffeeMachine", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockCoffeeMachine), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemCoffeeBean)).addTextReplacement("<rf>", TileEntityCoffeeMachine.ENERGY_USED).addTextReplacement("<coffee>", TileEntityCoffeeMachine.CACHE_USE).addTextReplacement("<water>", TileEntityCoffeeMachine.WATER_USE), new PageTextOnly(2).addItemsToPage(new ItemStack(InitItems.itemCoffee)), new PagePicture(3, "page_coffee_machine", 115), new PageCrafting(4, BlockCrafting.recipeCoffeeMachine).setWildcard().setNoText(), new PageCrafting(5, ItemCrafting.recipeCup).setNoText()).setImportant();
new BookletChapterCrusher("crusher", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockGrinderDouble), new PageTextOnly(1).addTextReplacement("<rf>", ConfigIntListValues.CRUSHER_ENERGY_USE.getValue()[0]), new PageCrafting(2, BlockCrafting.recipeCrusher).setWildcard().setNoText(), new PageCrafting(3, BlockCrafting.recipeDoubleCrusher).setWildcard().setNoText(), new PageCrusherRecipe(4, CrusherCrafting.recipeIronHorseArmor).setNoText(), new PageCrusherRecipe(5, CrusherCrafting.recipeGoldHorseArmor).setNoText(), new PageCrusherRecipe(6, CrusherCrafting.recipeDiamondHorseArmor).setNoText());
new BookletChapter("furnaceDouble", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockFurnaceDouble), new PageCrafting(1, BlockCrafting.recipeFurnace).setWildcard().addTextReplacement("<rf>", ConfigIntValues.POWERED_FURNACE_ENERGY_USE.getValue()));

View file

@ -100,7 +100,12 @@ public enum ConfigIntValues{
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_WORK_RANGE("Player Interface: Work Range", ConfigCategories.MACHINE_VALUES, 32, 1, 64, "Distance in block in which Player Interface works."),
PHANTOMFACE_WORK_RANGE("Phantomface: Work Range", ConfigCategories.MACHINE_VALUES, 16, 1, 32, "Distance in block in which Phantomface, Phantom Itemface, Phantom Liquidface, Phantom Energyface and Phantom Redstoneface work."),
PHANTOM_PLACER_WORK_RANGE("Phantom Breaker/Placer: Work Range", ConfigCategories.MACHINE_VALUES, 3, 1, 8, "Distance in block in which Phantom Breaker and Placer work.");
PHANTOM_PLACER_WORK_RANGE("Phantom Breaker/Placer: Work Range", ConfigCategories.MACHINE_VALUES, 3, 1, 8, "Distance in block in which Phantom Breaker and Placer work."),
VERTICAL_DIGGER_ENERGY_CAPACITY("Vertical Digger: Energy Capacity", ConfigCategories.MACHINE_ENERGY_VALUES, 200000, 1000, 1000000000, "Amount of energy Vertical Digger can store."),
VERTICAL_DIGGER_ENERGY_RECEIVE("Vertical Digger: Energy Receive Rate", ConfigCategories.MACHINE_ENERGY_VALUES, 2000, 1, 1000000000, "Amount of energy Vertical Digger can receive per tick."),
VERTICAL_DIGGER_ENERGY_USE_PER_BLOCK("Vertical Digger: Energy Use Per Block", ConfigCategories.MACHINE_ENERGY_VALUES, 650, 1, 1000000000, "Amount of energy Vertical Digger uses to mine block."),
VERTICAL_DIGGER_ENERGY_USE_PER_ORE("Vertical Digger: Energy Use Per Ore", ConfigCategories.MACHINE_ENERGY_VALUES, 1950, 1, 1000000000, "Amount of energy Vertical Digger uses to mine block in mode 'Only Ores'"),
VERTICAL_DIGGER_WORK_RANGE("Vertical Digger: Work Range", ConfigCategories.MACHINE_VALUES, 2, 1, 8, "Distance in blocks in which Vertical Digger can mine blocks.");
public final String name;
public final String category;

View file

@ -10,6 +10,7 @@
package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigStringListValues;
import de.ellpeck.actuallyadditions.mod.items.ItemDrill;
import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor;
@ -31,9 +32,7 @@ import net.minecraftforge.oredict.OreDictionary;
public class TileEntityMiner extends TileEntityInventoryBase implements IButtonReactor, IEnergyDisplay{
public static final int ENERGY_USE_PER_BLOCK = 650;
public static final int DEFAULT_RANGE = 2;
public final CustomEnergyStorage storage = new CustomEnergyStorage(200000, 2000, 0);
public final CustomEnergyStorage storage = new CustomEnergyStorage(ConfigIntValues.VERTICAL_DIGGER_ENERGY_CAPACITY.getValue(), ConfigIntValues.VERTICAL_DIGGER_ENERGY_RECEIVE.getValue(), 0);
public boolean onlyMineOres;
public int checkX;
@ -81,7 +80,7 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IButtonR
if(!this.isRedstonePowered && this.ticksElapsed%5 == 0){
if(this.checkY != 0){
int range = TileEntityPhantomface.upgradeRange(DEFAULT_RANGE, this.world, this.pos);
int range = TileEntityPhantomface.upgradeRange(ConfigIntValues.VERTICAL_DIGGER_WORK_RANGE.getValue(), this.world, this.pos);
if(this.checkY < 0){
this.checkY = this.pos.getY()-1;
this.checkX = -range;
@ -114,8 +113,8 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IButtonR
}
private boolean mine(){
int actualUse = ENERGY_USE_PER_BLOCK*(this.onlyMineOres ? 3 : 1);
if(this.storage.getEnergyStored() >= actualUse){
int energyUse = this.onlyMineOres ? ConfigIntValues.VERTICAL_DIGGER_ENERGY_USE_PER_ORE.getValue() : ConfigIntValues.VERTICAL_DIGGER_ENERGY_USE_PER_BLOCK.getValue();
if(this.storage.getEnergyStored() >= energyUse){
BlockPos pos = new BlockPos(this.pos.getX()+this.checkX, this.checkY, this.pos.getZ()+this.checkZ);
IBlockState state = this.world.getBlockState(pos);
@ -135,7 +134,7 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IButtonR
WorldUtil.addToInventory(this.slots, drops, true);
this.markDirty();
this.storage.extractEnergyInternal(actualUse, false);
this.storage.extractEnergyInternal(energyUse, false);
this.shootParticles(pos.getX(), pos.getY(), pos.getZ());
}
else{