Reconstructed configuration for Atomic Reconstructor and Lenses

This commit is contained in:
OneEyeMaker 2017-09-22 12:43:16 +03:00
parent 91685b3bc3
commit f8c7f3bbb2
15 changed files with 172 additions and 100 deletions

View file

@ -10,6 +10,8 @@
package de.ellpeck.actuallyadditions.mod.blocks; package de.ellpeck.actuallyadditions.mod.blocks;
import java.util.List;
import de.ellpeck.actuallyadditions.api.lens.ILensItem; import de.ellpeck.actuallyadditions.api.lens.ILensItem;
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase; import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase;
@ -47,8 +49,6 @@ import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.List;
public class BlockAtomicReconstructor extends BlockContainerBase implements IHudDisplay{ public class BlockAtomicReconstructor extends BlockContainerBase implements IHudDisplay{
public static final int NAME_FLAVOR_AMOUNTS_1 = 12; public static final int NAME_FLAVOR_AMOUNTS_1 = 12;
@ -209,7 +209,7 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud
tooltip.add(StringUtil.localize(base+"1."+this.toPick1)+" "+StringUtil.localize(base+"2."+this.toPick2)); tooltip.add(StringUtil.localize(base+"1."+this.toPick1)+" "+StringUtil.localize(base+"2."+this.toPick2));
} }
} }
@Override @Override
public boolean hasComparatorInputOverride(IBlockState state){ public boolean hasComparatorInputOverride(IBlockState state){
return true; return true;
@ -222,6 +222,6 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud
if (t instanceof TileEntityAtomicReconstructor) { if (t instanceof TileEntityAtomicReconstructor) {
i = ((TileEntityAtomicReconstructor) t).getEnergy(); i = ((TileEntityAtomicReconstructor) t).getEnergy();
} }
return MathHelper.clamp(i / 20000, 0, 15); return MathHelper.clamp(i / (ConfigIntValues.ATOMIC_RECONSTRUCTOR_ENERGY_CAPACITY.getValue() / 15), 0, 15);
} }
} }

View file

@ -10,6 +10,8 @@
package de.ellpeck.actuallyadditions.mod.booklet; package de.ellpeck.actuallyadditions.mod.booklet;
import java.util.*;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter; import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter;
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry; import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
@ -25,14 +27,13 @@ import de.ellpeck.actuallyadditions.mod.booklet.entry.BookletEntry;
import de.ellpeck.actuallyadditions.mod.booklet.entry.BookletEntryAllItems; import de.ellpeck.actuallyadditions.mod.booklet.entry.BookletEntryAllItems;
import de.ellpeck.actuallyadditions.mod.booklet.entry.BookletEntryTrials; import de.ellpeck.actuallyadditions.mod.booklet.entry.BookletEntryTrials;
import de.ellpeck.actuallyadditions.mod.booklet.page.*; import de.ellpeck.actuallyadditions.mod.booklet.page.*;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
import de.ellpeck.actuallyadditions.mod.crafting.*; import de.ellpeck.actuallyadditions.mod.crafting.*;
import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
import de.ellpeck.actuallyadditions.mod.gen.OreGen; import de.ellpeck.actuallyadditions.mod.gen.OreGen;
import de.ellpeck.actuallyadditions.mod.gen.WorldGenLushCaves; import de.ellpeck.actuallyadditions.mod.gen.WorldGenLushCaves;
import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.InitItems;
import de.ellpeck.actuallyadditions.mod.items.ItemWingsOfTheBats; import de.ellpeck.actuallyadditions.mod.items.ItemWingsOfTheBats;
import de.ellpeck.actuallyadditions.mod.items.lens.LensDisenchanting;
import de.ellpeck.actuallyadditions.mod.items.lens.LensMining;
import de.ellpeck.actuallyadditions.mod.items.lens.LensRecipeHandler; import de.ellpeck.actuallyadditions.mod.items.lens.LensRecipeHandler;
import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals;
import de.ellpeck.actuallyadditions.mod.items.metalists.TheFoods; import de.ellpeck.actuallyadditions.mod.items.metalists.TheFoods;
@ -49,7 +50,6 @@ import net.minecraft.item.crafting.IRecipe;
import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidUtil; import net.minecraftforge.fluids.FluidUtil;
import java.util.*;
public final class InitBooklet{ public final class InitBooklet{
@ -136,7 +136,7 @@ public final class InitBooklet{
chaptersIntroduction[1] = new BookletChapter("videoGuide", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.YOUTUBE_ICON.ordinal()), new PageLinkButton(1, "https://www.youtube.com/watch?v=fhjz0Ew56pM"), new PageLinkButton(2, "https://www.youtube.com/playlist?list=PLJeFZ64pT89MrTRZYzD_rtHFajPVlt6cF")).setImportant(); chaptersIntroduction[1] = new BookletChapter("videoGuide", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.YOUTUBE_ICON.ordinal()), new PageLinkButton(1, "https://www.youtube.com/watch?v=fhjz0Ew56pM"), new PageLinkButton(2, "https://www.youtube.com/playlist?list=PLJeFZ64pT89MrTRZYzD_rtHFajPVlt6cF")).setImportant();
new BookletChapter("intro", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemBooklet), new PageTextOnly(1), new PageTextOnly(2), new PageTextOnly(3)); new BookletChapter("intro", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemBooklet), new PageTextOnly(1), new PageTextOnly(2), new PageTextOnly(3));
ArrayList<BookletPage> crystalPages = new ArrayList<BookletPage>(); ArrayList<BookletPage> crystalPages = new ArrayList<BookletPage>();
crystalPages.addAll(Arrays.asList(new PageTextOnly(1).addTextReplacement("<rf>", TileEntityAtomicReconstructor.ENERGY_USE), new PageTextOnly(2), new PageTextOnly(3), new PagePicture(4, "page_atomic_reconstructor", 0).setNoText(), new PageTextOnly(5), new PageCrafting(6, BlockCrafting.recipeAtomicReconstructor).setWildcard())); crystalPages.addAll(Arrays.asList(new PageTextOnly(1).addTextReplacement("<rf>", ConfigIntValues.ATOMIC_RECONSTRUCTOR_ENERGY_USE.getValue()), new PageTextOnly(2), new PageTextOnly(3), new PagePicture(4, "page_atomic_reconstructor", 0).setNoText(), new PageTextOnly(5), new PageCrafting(6, BlockCrafting.recipeAtomicReconstructor).setWildcard()));
for(int i = 0; i < LensRecipeHandler.MAIN_PAGE_RECIPES.size(); i++){ for(int i = 0; i < LensRecipeHandler.MAIN_PAGE_RECIPES.size(); i++){
crystalPages.add(new PageReconstructor(7+i, LensRecipeHandler.MAIN_PAGE_RECIPES.get(i)).setNoText()); crystalPages.add(new PageReconstructor(7+i, LensRecipeHandler.MAIN_PAGE_RECIPES.get(i)).setNoText());
} }
@ -188,8 +188,8 @@ public final class InitBooklet{
new BookletChapter("lensDeath", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemDamageLens), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeDamageLens).setNoText()); new BookletChapter("lensDeath", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemDamageLens), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeDamageLens).setNoText());
new BookletChapter("lensMoreDeath", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemMoreDamageLens), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeLensMoreDeath).setNoText()); new BookletChapter("lensMoreDeath", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemMoreDamageLens), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeLensMoreDeath).setNoText());
new BookletChapter("lensDetonation", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemExplosionLens), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeExplosionLens).setNoText()); new BookletChapter("lensDetonation", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemExplosionLens), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeExplosionLens).setNoText());
new BookletChapter("lensDisenchanting", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemDisenchantingLens), new PageTextOnly(1).addTextReplacement("<energy>", LensDisenchanting.ENERGY_USE), new PageCrafting(2, ItemCrafting.recipeDisenchantingLens).setNoText()).setSpecial(); new BookletChapter("lensDisenchanting", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemDisenchantingLens), new PageTextOnly(1).addTextReplacement("<energy>", ConfigIntValues.LENS_DISENCHANTING_ENERGY_USE.getValue()), new PageCrafting(2, ItemCrafting.recipeDisenchantingLens).setNoText()).setSpecial();
new BookletChapter("lensMining", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemMiningLens), new PageTextOnly(1).addTextReplacement("<energy>", LensMining.ENERGY_USE), new PageCrafting(2, ItemCrafting.recipeMiningLens).setNoText()).setImportant(); new BookletChapter("lensMining", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemMiningLens), new PageTextOnly(1).addTextReplacement("<energy>", ConfigIntValues.LENS_MINER_ENERGY_USE.getValue()), new PageCrafting(2, ItemCrafting.recipeMiningLens).setNoText()).setImportant();
//Laser Relays //Laser Relays
chaptersIntroduction[8] = new BookletChapter("laserIntro", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitItems.itemLaserWrench), new PageTextOnly(1), new PageTextOnly(2).addTextReplacement("<range>", TileEntityLaserRelay.MAX_DISTANCE), new PageCrafting(3, ItemCrafting.recipeLaserWrench)).setImportant(); chaptersIntroduction[8] = new BookletChapter("laserIntro", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitItems.itemLaserWrench), new PageTextOnly(1), new PageTextOnly(2).addTextReplacement("<range>", TileEntityLaserRelay.MAX_DISTANCE), new PageCrafting(3, ItemCrafting.recipeLaserWrench)).setImportant();

View file

@ -19,6 +19,8 @@ public enum ConfigCategories{
MOB_DROPS("Mob Drops", "Everything regarding Item drops from mobs"), MOB_DROPS("Mob Drops", "Everything regarding Item drops from mobs"),
WORLD_GEN("World Gen", "Everything regarding World Generation"), WORLD_GEN("World Gen", "Everything regarding World Generation"),
TOOL_ENERGY_VALUES("Tool Energy Values", "Energy values for various tools"), TOOL_ENERGY_VALUES("Tool Energy Values", "Energy values for various tools"),
MACHINE_ENERGY_VALUES("Machine Energy Values", "Energy values for various machines"),
MACHINE_RECIPE_COSTS("Machine Energy Values.Machine Recipe Costs", "Energy cost of various machine recipes"),
OTHER("Other", "Everything else"); OTHER("Other", "Everything else");
public final String name; public final String name;

View file

@ -69,7 +69,40 @@ public enum ConfigIntValues{
LIQUID_BANNING_RING_ENERGY_CAPACITY("Ring of Liquid Banning: Energy Capacity", ConfigCategories.TOOL_ENERGY_VALUES, 800000, 1000, 1000000000, "Amount of energy Ring of Liquid Banning can store"), LIQUID_BANNING_RING_ENERGY_CAPACITY("Ring of Liquid Banning: Energy Capacity", ConfigCategories.TOOL_ENERGY_VALUES, 800000, 1000, 1000000000, "Amount of energy Ring of Liquid Banning can store"),
LIQUID_BANNING_RING_ENERGY_TRANSFER("Ring of Liquid Banning: Energy Transfer Rate", ConfigCategories.TOOL_ENERGY_VALUES, 1000, 1, 1000000000, "Amount of energy Ring of Liquid Banning can receive per tick"), LIQUID_BANNING_RING_ENERGY_TRANSFER("Ring of Liquid Banning: Energy Transfer Rate", ConfigCategories.TOOL_ENERGY_VALUES, 1000, 1, 1000000000, "Amount of energy Ring of Liquid Banning can receive per tick"),
LIQUID_BANNING_RING_ENERGY_USE("Ring of Liquid Banning: Energy Use", ConfigCategories.TOOL_ENERGY_VALUES, 150, 1, 1000000000, "Base amount of energy used by Ring of Liquid Banning to remove liquid block"); LIQUID_BANNING_RING_ENERGY_USE("Ring of Liquid Banning: Energy Use", ConfigCategories.TOOL_ENERGY_VALUES, 150, 1, 1000000000, "Base amount of energy used by Ring of Liquid Banning to remove liquid block"),
ATOMIC_RECONSTRUCTOR_ENERGY_CAPACITY("Atomic Reconstructor: Energy Capacity", ConfigCategories.MACHINE_ENERGY_VALUES, 300000, 1000, 1000000000, "Amount of energy Atomic Reconstructor can store"),
ATOMIC_RECONSTRUCTOR_ENERGY_RECEIVE("Atomic Reconstructor: Energy Receive Rate", ConfigCategories.MACHINE_ENERGY_VALUES, 5000, 1, 1000000000, "Amount of energy Atomic Reconstructor can receive per tick"),
ATOMIC_RECONSTRUCTOR_ENERGY_USE("Atomic Reconstructor: Energy Use", ConfigCategories.MACHINE_ENERGY_VALUES, 1000, 1, 1000000000, "Base amount of energy used by Atomic Reconstructor to perform action"),
ATOMIC_RECONSTRUCTOR_RESTONIA_CRYSTAL_COST("Atomic Reconstructor: Restonia Crystal Creation Cost", ConfigCategories.MACHINE_RECIPE_COSTS, 40, 1, 1000000, "Amount of energy used by Atomic Reconstructor to create Restonia Crystal"),
ATOMIC_RECONSTRUCTOR_PALIS_CRYSTAL_COST("Atomic Reconstructor: Palis Crystal Creation Cost", ConfigCategories.MACHINE_RECIPE_COSTS, 40, 1, 1000000, "Amount of energy used by Atomic Reconstructor to create Palis Crystal"),
ATOMIC_RECONSTRUCTOR_DIAMATINE_CRYSTAL_COST("Atomic Reconstructor: Diamatine Crystal Creation Cost", ConfigCategories.MACHINE_RECIPE_COSTS, 60, 1, 1000000, "Amount of energy used by Atomic Reconstructor to create Diamatine Crystal"),
ATOMIC_RECONSTRUCTOR_EMERADIC_CRYSTAL_COST("Atomic Reconstructor: Emeradic Crystal Creation Cost", ConfigCategories.MACHINE_RECIPE_COSTS, 100, 1, 1000000, "Amount of energy used by Atomic Reconstructor to create Emeradic Crystal"),
ATOMIC_RECONSTRUCTOR_VOID_CRYSTAL_COST("Atomic Reconstructor: Void Crystal Creation Cost", ConfigCategories.MACHINE_RECIPE_COSTS, 60, 1, 1000000, "Amount of energy used by Atomic Reconstructor to create Void Crystal"),
ATOMIC_RECONSTRUCTOR_ENORI_CRYSTAL_COST("Atomic Reconstructor: Enori Crystal Creation Cost", ConfigCategories.MACHINE_RECIPE_COSTS, 80, 1, 1000000, "Amount of energy used by Atomic Reconstructor to create Enori Crystal"),
ATOMIC_RECONSTRUCTOR_RESTONIA_BLOCK_COST("Atomic Reconstructor: Restonia Crystal Block Creation Cost", ConfigCategories.MACHINE_RECIPE_COSTS, 400, 1, 10000000, "Amount of energy used by Atomic Reconstructor to create Restonia Crystal Block"),
ATOMIC_RECONSTRUCTOR_PALIS_BLOCK_COST("Atomic Reconstructor: Palis Crystal Block Creation Cost", ConfigCategories.MACHINE_RECIPE_COSTS, 400, 1, 10000000, "Amount of energy used by Atomic Reconstructor to create Palis Crystal Block"),
ATOMIC_RECONSTRUCTOR_DIAMATINE_BLOCK_COST("Atomic Reconstructor: Diamatine Crystal Block Creation Cost", ConfigCategories.MACHINE_RECIPE_COSTS, 600, 1, 10000000, "Amount of energy used by Atomic Reconstructor to create Diamatine Crystal Block"),
ATOMIC_RECONSTRUCTOR_EMERADIC_BLOCK_COST("Atomic Reconstructor: Emeradic Crystal Block Creation Cost", ConfigCategories.MACHINE_RECIPE_COSTS, 1000, 1, 10000000, "Amount of energy used by Atomic Reconstructor to create Emeradic Crystal Block"),
ATOMIC_RECONSTRUCTOR_VOID_BLOCK_COST("Atomic Reconstructor: Void Crystal Block Creation Cost", ConfigCategories.MACHINE_RECIPE_COSTS, 600, 1, 10000000, "Amount of energy used by Atomic Reconstructor to create Void Crystal Block"),
ATOMIC_RECONSTRUCTOR_ENORI_BLOCK_COST("Atomic Reconstructor: Enori Crystal Block Creation Cost", ConfigCategories.MACHINE_RECIPE_COSTS, 800, 1, 10000000, "Amount of energy used by Atomic Reconstructor to create Enori Crystal Block"),
ATOMIC_RECONSTRUCTOR_LENS_COST("Atomic Reconstructor: Lens Conversion Cost", ConfigCategories.MACHINE_RECIPE_COSTS, 5000, 1, 1000000, "Amount of energy used by Atomic Reconstructor to change type of Lens"),
ATOMIC_RECONSTRUCTOR_LASER_RELAY_COST("Atomic Reconstructor: Laser Relay Conversion Cost", ConfigCategories.MACHINE_RECIPE_COSTS, 2000, 1, 1000000, "Amount of energy used by Atomic Reconstructor to change type of Laser Relay"),
ATOMIC_RECONSTRUCTOR_SOUL_SAND_COST("Atomic Reconstructor: Soul Sand Creation Cost", ConfigCategories.MACHINE_RECIPE_COSTS, 20000, 1, 1000000, "Amount of energy used by Atomic Reconstructor to create Soul Sand"),
ATOMIC_RECONSTRUCTOR_LEATHER_COST("Atomic Reconstructor: Leather Creation Cost", ConfigCategories.MACHINE_RECIPE_COSTS, 8000, 1, 1000000, "Amount of energy used by Atomic Reconstructor to create Leather"),
ATOMIC_RECONSTRUCTOR_NETHER_WART_COST("Atomic Reconstructor: Nether Wart Creation Cost", ConfigCategories.MACHINE_RECIPE_COSTS, 150000, 1, 1000000, "Amount of energy used by Atomic Reconstructor to create Nether Wart"),
ATOMIC_RECONSTRUCTOR_PRISMARINE_COST("Atomic Reconstructor: Prismarine Shard Creation Cost", ConfigCategories.MACHINE_RECIPE_COSTS, 30000, 1, 1000000, "Amount of energy used by Atomic Reconstructor to create Prismarine Shard"),
ATOMIC_RECONSTRUCTOR_CRYSTALLIZED_CANOLA_COST("Atomic Reconstructor: Crystallized Canola Seed Creation Cost", ConfigCategories.MACHINE_RECIPE_COSTS, 2000, 1, 1000000, "Amount of energy used by Atomic Reconstructor to create Crystallized Canola Seed"),
ATOMIC_RECONSTRUCTOR_ETHETIC_QUARTZ_COST("Atomic Reconstructor: Ethetic Quartz Creation Cost", ConfigCategories.MACHINE_RECIPE_COSTS, 10, 1, 1000000, "Amount of energy used by Atomic Reconstructor to create Ethetic Quartz"),
ATOMIC_RECONSTRUCTOR_ETHETIC_GREEN_BLOCK_COST("Atomic Reconstructor: Ethetic Green Block Creation Cost", ConfigCategories.MACHINE_RECIPE_COSTS, 10, 1, 1000000, "Amount of energy used by Atomic Reconstructor to create Ethetic Green Block"),
LENS_COLOR_ENERGY_USE("Lens of Color: Energy Use", ConfigCategories.MACHINE_RECIPE_COSTS, 200, 1, 1000000000, "Amount of energy used by Atomic Reconstructor with Lens of Color to perform action"),
LENS_DEATH_ENERGY_USE("Lens of Certain Death: Energy Use", ConfigCategories.MACHINE_RECIPE_COSTS, 350, 1, 1000000000, "Amount of energy used by Atomic Reconstructor with Lens of Certain Death to perform action"),
LENS_DETONATION_ENERGY_USE("Lens of Detonation: Energy Use", ConfigCategories.MACHINE_RECIPE_COSTS, 250000, 1, 1000000000, "Amount of energy used by Atomic Reconstructor with Lens of Detonation to perform action"),
LENS_KILLER_ENERGY_USE("Lens of Killer: Energy Use", ConfigCategories.MACHINE_RECIPE_COSTS, 2500, 1, 1000000000, "Amount of energy used by Atomic Reconstructor with Lens of Killer to perform action"),
LENS_DISENCHANTING_ENERGY_USE("Lens of Disenchanting: Energy Use", ConfigCategories.MACHINE_RECIPE_COSTS, 250000, 1, 1000000000, "Amount of energy used by Atomic Reconstructor with Lens of Disenchanting to perform action"),
LENS_MINER_ENERGY_USE("Lens of Miner: Energy Use", ConfigCategories.MACHINE_RECIPE_COSTS, 60000, 1, 1000000000, "Amount of energy used by Atomic Reconstructor with Lens of Miner to mine ore"),
LENS_MINER_NETHER_ORES_ENERGY_USE("Lens of Miner: Energy Use For Nether Ores", ConfigCategories.MACHINE_RECIPE_COSTS, 70000, 1, 1000000000, "Amount of energy used by Atomic Reconstructor with Lens of Miner to mine nether ore"),
LENS_DISRUPTION_ENERGY_USE("Lens of Disruption: Energy Use", ConfigCategories.MACHINE_RECIPE_COSTS, 150000, 1, 1000000000, "What?!... Is it 11?");
public final String name; public final String name;
public final String category; public final String category;

View file

@ -11,10 +11,15 @@
package de.ellpeck.actuallyadditions.mod.items.lens; package de.ellpeck.actuallyadditions.mod.items.lens;
import java.util.ArrayList;
import java.util.Map;
import java.util.Random;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor;
import de.ellpeck.actuallyadditions.api.lens.Lens; import de.ellpeck.actuallyadditions.api.lens.Lens;
import de.ellpeck.actuallyadditions.api.recipe.IColorLensChanger; import de.ellpeck.actuallyadditions.api.recipe.IColorLensChanger;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
@ -29,10 +34,6 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.WorldServer; import net.minecraft.world.WorldServer;
import net.minecraftforge.common.util.FakePlayerFactory; import net.minecraftforge.common.util.FakePlayerFactory;
import java.util.ArrayList;
import java.util.Map;
import java.util.Random;
public class LensColor extends Lens{ public class LensColor extends Lens{
public static final int ENERGY_USE = 200; public static final int ENERGY_USE = 200;
@ -56,7 +57,8 @@ public class LensColor extends Lens{
@Override @Override
public boolean invoke(IBlockState hitState, BlockPos hitBlock, IAtomicReconstructor tile){ public boolean invoke(IBlockState hitState, BlockPos hitBlock, IAtomicReconstructor tile){
if(hitBlock != null){ if(hitBlock != null){
if(tile.getEnergy() >= ENERGY_USE){ int energyUse = ConfigIntValues.LENS_COLOR_ENERGY_USE.getValue();
if(tile.getEnergy() >= energyUse){
IBlockState state = tile.getWorldObject().getBlockState(hitBlock); IBlockState state = tile.getWorldObject().getBlockState(hitBlock);
Block block = state.getBlock(); Block block = state.getBlock();
int meta = block.getMetaFromState(state); int meta = block.getMetaFromState(state);
@ -65,13 +67,13 @@ public class LensColor extends Lens{
Block toPlace = Block.getBlockFromItem(returnStack.getItem()); Block toPlace = Block.getBlockFromItem(returnStack.getItem());
IBlockState state2Place = toPlace.getStateForPlacement(tile.getWorldObject(), hitBlock, EnumFacing.UP, 0, 0, 0, returnStack.getMetadata(), FakePlayerFactory.getMinecraft((WorldServer) tile.getWorldObject()), EnumHand.MAIN_HAND); IBlockState state2Place = toPlace.getStateForPlacement(tile.getWorldObject(), hitBlock, EnumFacing.UP, 0, 0, 0, returnStack.getMetadata(), FakePlayerFactory.getMinecraft((WorldServer) tile.getWorldObject()), EnumHand.MAIN_HAND);
tile.getWorldObject().setBlockState(hitBlock, state2Place, 2); tile.getWorldObject().setBlockState(hitBlock, state2Place, 2);
tile.extractEnergy(ENERGY_USE); tile.extractEnergy(energyUse);
} }
} }
ArrayList<EntityItem> items = (ArrayList<EntityItem>)tile.getWorldObject().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(hitBlock.getX(), hitBlock.getY(), hitBlock.getZ(), hitBlock.getX()+1, hitBlock.getY()+1, hitBlock.getZ()+1)); ArrayList<EntityItem> items = (ArrayList<EntityItem>)tile.getWorldObject().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(hitBlock.getX(), hitBlock.getY(), hitBlock.getZ(), hitBlock.getX()+1, hitBlock.getY()+1, hitBlock.getZ()+1));
for(EntityItem item : items){ for(EntityItem item : items){
if(!item.isDead && StackUtil.isValid(item.getItem()) && tile.getEnergy() >= ENERGY_USE){ if(!item.isDead && StackUtil.isValid(item.getItem()) && tile.getEnergy() >= energyUse){
ItemStack newStack = this.tryConvert(item.getItem(), hitState, hitBlock, tile); ItemStack newStack = this.tryConvert(item.getItem(), hitState, hitBlock, tile);
if(StackUtil.isValid(newStack)){ if(StackUtil.isValid(newStack)){
item.setDead(); item.setDead();
@ -79,7 +81,7 @@ public class LensColor extends Lens{
EntityItem newItem = new EntityItem(tile.getWorldObject(), item.posX, item.posY, item.posZ, newStack); EntityItem newItem = new EntityItem(tile.getWorldObject(), item.posX, item.posY, item.posZ, newStack);
tile.getWorldObject().spawnEntity(newItem); tile.getWorldObject().spawnEntity(newItem);
tile.extractEnergy(ENERGY_USE); tile.extractEnergy(energyUse);
} }
} }
} }
@ -90,11 +92,9 @@ public class LensColor extends Lens{
private ItemStack tryConvert(ItemStack stack, IBlockState hitState, BlockPos hitBlock, IAtomicReconstructor tile){ private ItemStack tryConvert(ItemStack stack, IBlockState hitState, BlockPos hitBlock, IAtomicReconstructor tile){
if(StackUtil.isValid(stack)){ if(StackUtil.isValid(stack)){
Item item = stack.getItem(); Item item = stack.getItem();
if(item != null){ for(Map.Entry<Item, IColorLensChanger> changer : ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_COLOR_CHANGERS.entrySet()){
for(Map.Entry<Item, IColorLensChanger> changer : ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_COLOR_CHANGERS.entrySet()){ if(item == changer.getKey()){
if(item == changer.getKey()){ return changer.getValue().modifyItem(stack, hitState, hitBlock, tile);
return changer.getValue().modifyItem(stack, hitState, hitBlock, tile);
}
} }
} }
} }
@ -115,6 +115,6 @@ public class LensColor extends Lens{
@Override @Override
public boolean canInvoke(IAtomicReconstructor tile, EnumFacing sideToShootTo, int energyUsePerShot){ public boolean canInvoke(IAtomicReconstructor tile, EnumFacing sideToShootTo, int energyUsePerShot){
return tile.getEnergy()-energyUsePerShot >= ENERGY_USE; return tile.getEnergy() - energyUsePerShot >= ConfigIntValues.LENS_COLOR_ENERGY_USE.getValue();
} }
} }

View file

@ -10,16 +10,17 @@
package de.ellpeck.actuallyadditions.mod.items.lens; package de.ellpeck.actuallyadditions.mod.items.lens;
import java.util.ArrayList;
import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor;
import de.ellpeck.actuallyadditions.api.lens.Lens; import de.ellpeck.actuallyadditions.api.lens.Lens;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
import de.ellpeck.actuallyadditions.mod.misc.DamageSources; import de.ellpeck.actuallyadditions.mod.misc.DamageSources;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import java.util.ArrayList;
public class LensDeath extends Lens{ public class LensDeath extends Lens{
@Override @Override
@ -42,7 +43,7 @@ public class LensDeath extends Lens{
} }
protected int getUsePerEntity(){ protected int getUsePerEntity(){
return 350; return ConfigIntValues.LENS_DEATH_ENERGY_USE.getValue();
} }
@Override @Override

View file

@ -12,20 +12,20 @@ package de.ellpeck.actuallyadditions.mod.items.lens;
import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor;
import de.ellpeck.actuallyadditions.api.lens.Lens; import de.ellpeck.actuallyadditions.api.lens.Lens;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
public class LensDetonation extends Lens{ public class LensDetonation extends Lens{
private static final int ENERGY_USE = 250000;
@Override @Override
public boolean invoke(IBlockState state, BlockPos hitBlock, IAtomicReconstructor tile){ public boolean invoke(IBlockState state, BlockPos hitBlock, IAtomicReconstructor tile){
if(hitBlock != null && !state.getBlock().isAir(state, tile.getWorldObject(), hitBlock)){ if(hitBlock != null && !state.getBlock().isAir(state, tile.getWorldObject(), hitBlock)){
if(tile.getEnergy() >= ENERGY_USE){ int energyUse = ConfigIntValues.LENS_DETONATION_ENERGY_USE.getValue();
if(tile.getEnergy() >= energyUse){
tile.getWorldObject().newExplosion(null, hitBlock.getX()+0.5, hitBlock.getY()+0.5, hitBlock.getZ()+0.5, 10F, true, true); tile.getWorldObject().newExplosion(null, hitBlock.getX()+0.5, hitBlock.getY()+0.5, hitBlock.getZ()+0.5, 10F, true, true);
tile.extractEnergy(ENERGY_USE); tile.extractEnergy(energyUse);
} }
return true; return true;
} }
@ -44,6 +44,6 @@ public class LensDetonation extends Lens{
@Override @Override
public boolean canInvoke(IAtomicReconstructor tile, EnumFacing sideToShootTo, int energyUsePerShot){ public boolean canInvoke(IAtomicReconstructor tile, EnumFacing sideToShootTo, int energyUsePerShot){
return tile.getEnergy()-energyUsePerShot >= ENERGY_USE; return tile.getEnergy()-energyUsePerShot >= ConfigIntValues.LENS_DETONATION_ENERGY_USE.getValue();
} }
} }

View file

@ -10,8 +10,12 @@
package de.ellpeck.actuallyadditions.mod.items.lens; package de.ellpeck.actuallyadditions.mod.items.lens;
import java.util.List;
import java.util.Map;
import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor;
import de.ellpeck.actuallyadditions.api.lens.Lens; import de.ellpeck.actuallyadditions.api.lens.Lens;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
@ -27,18 +31,14 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import java.util.List;
import java.util.Map;
public class LensDisenchanting extends Lens{ public class LensDisenchanting extends Lens{
public static final int ENERGY_USE = 250000;
@Override @Override
public boolean invoke(IBlockState hitState, BlockPos hitBlock, IAtomicReconstructor tile){ public boolean invoke(IBlockState hitState, BlockPos hitBlock, IAtomicReconstructor tile){
if(tile.getEnergy() >= ENERGY_USE){ int energyUse = ConfigIntValues.LENS_DISENCHANTING_ENERGY_USE.getValue();
if(tile.getEnergy() >= energyUse){
List<EntityItem> items = tile.getWorldObject().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(hitBlock.getX(), hitBlock.getY(), hitBlock.getZ(), hitBlock.getX()+1, hitBlock.getY()+1, hitBlock.getZ()+1)); List<EntityItem> items = tile.getWorldObject().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(hitBlock.getX(), hitBlock.getY(), hitBlock.getZ(), hitBlock.getX()+1, hitBlock.getY()+1, hitBlock.getZ()+1));
if(items != null && !items.isEmpty()){ if(!items.isEmpty()){
EntityItem book = null; EntityItem book = null;
EntityItem toDisenchant = null; EntityItem toDisenchant = null;
for(EntityItem item : items){ for(EntityItem item : items){
@ -97,7 +97,7 @@ public class LensDisenchanting extends Lens{
tile.getWorldObject().spawnEntity(newBook); tile.getWorldObject().spawnEntity(newBook);
tile.getWorldObject().spawnEntity(disenchanted); tile.getWorldObject().spawnEntity(disenchanted);
tile.extractEnergy(ENERGY_USE); tile.extractEnergy(energyUse);
return true; return true;
} }
@ -119,6 +119,6 @@ public class LensDisenchanting extends Lens{
@Override @Override
public boolean canInvoke(IAtomicReconstructor tile, EnumFacing sideToShootTo, int energyUsePerShot){ public boolean canInvoke(IAtomicReconstructor tile, EnumFacing sideToShootTo, int energyUsePerShot){
return tile.getEnergy()-energyUsePerShot >= ENERGY_USE; return tile.getEnergy()-energyUsePerShot >= ConfigIntValues.LENS_DISENCHANTING_ENERGY_USE.getValue();
} }
} }

View file

@ -10,6 +10,8 @@
package de.ellpeck.actuallyadditions.mod.items.lens; package de.ellpeck.actuallyadditions.mod.items.lens;
import java.util.ArrayList;
import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor;
import de.ellpeck.actuallyadditions.api.lens.Lens; import de.ellpeck.actuallyadditions.api.lens.Lens;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues; import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
@ -25,15 +27,12 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import java.util.ArrayList;
public class LensDisruption extends Lens{ public class LensDisruption extends Lens{
private static final int ENERGY_USE = 150000;
@Override @Override
public boolean invoke(IBlockState hitState, BlockPos hitBlock, IAtomicReconstructor tile){ public boolean invoke(IBlockState hitState, BlockPos hitBlock, IAtomicReconstructor tile){
if(ConfigIntValues.ELEVEN.getValue() == 11 && tile.getEnergy() >= ENERGY_USE && hitBlock != null && !hitState.getBlock().isAir(hitState, tile.getWorldObject(), hitBlock)){ int energyUse = ConfigIntValues.LENS_DISRUPTION_ENERGY_USE.getValue();
if(ConfigIntValues.ELEVEN.getValue() == 11 && tile.getEnergy() >= energyUse && hitBlock != null && !hitState.getBlock().isAir(hitState, tile.getWorldObject(), hitBlock)){
int range = 2; int range = 2;
ArrayList<EntityItem> items = (ArrayList<EntityItem>)tile.getWorldObject().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(hitBlock.getX()-range, hitBlock.getY()-range, hitBlock.getZ()-range, hitBlock.getX()+range, hitBlock.getY()+range, hitBlock.getZ()+range)); ArrayList<EntityItem> items = (ArrayList<EntityItem>)tile.getWorldObject().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(hitBlock.getX()-range, hitBlock.getY()-range, hitBlock.getZ()-range, hitBlock.getX()+range, hitBlock.getY()+range, hitBlock.getZ()+range));
for(EntityItem item : items){ for(EntityItem item : items){
@ -64,7 +63,7 @@ public class LensDisruption extends Lens{
EntityItem newItem = new EntityItem(tile.getWorldObject(), item.posX, item.posY, item.posZ, newStack); EntityItem newItem = new EntityItem(tile.getWorldObject(), item.posX, item.posY, item.posZ, newStack);
tile.getWorldObject().spawnEntity(newItem); tile.getWorldObject().spawnEntity(newItem);
tile.extractEnergy(ENERGY_USE); tile.extractEnergy(energyUse);
} }
} }
} }
@ -85,6 +84,6 @@ public class LensDisruption extends Lens{
@Override @Override
public boolean canInvoke(IAtomicReconstructor tile, EnumFacing sideToShootTo, int energyUsePerShot){ public boolean canInvoke(IAtomicReconstructor tile, EnumFacing sideToShootTo, int energyUsePerShot){
return tile.getEnergy()-energyUsePerShot >= ENERGY_USE; return tile.getEnergy()-energyUsePerShot >= ConfigIntValues.LENS_DISRUPTION_ENERGY_USE.getValue();
} }
} }

View file

@ -11,6 +11,7 @@
package de.ellpeck.actuallyadditions.mod.items.lens; package de.ellpeck.actuallyadditions.mod.items.lens;
import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.WorldServer; import net.minecraft.world.WorldServer;
@ -39,6 +40,6 @@ public class LensEvenMoarDeath extends LensDeath{
@Override @Override
protected int getUsePerEntity(){ protected int getUsePerEntity(){
return 2500; return ConfigIntValues.LENS_KILLER_ENERGY_USE.getValue();
} }
} }

View file

@ -10,10 +10,13 @@
package de.ellpeck.actuallyadditions.mod.items.lens; package de.ellpeck.actuallyadditions.mod.items.lens;
import java.util.List;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor;
import de.ellpeck.actuallyadditions.api.lens.Lens; import de.ellpeck.actuallyadditions.api.lens.Lens;
import de.ellpeck.actuallyadditions.api.recipe.WeightedOre; import de.ellpeck.actuallyadditions.api.recipe.WeightedOre;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigStringListValues; import de.ellpeck.actuallyadditions.mod.config.values.ConfigStringListValues;
import de.ellpeck.actuallyadditions.mod.recipe.CrusherRecipeRegistry; import de.ellpeck.actuallyadditions.mod.recipe.CrusherRecipeRegistry;
import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil;
@ -29,15 +32,13 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand; import net.minecraft.util.EnumHand;
import net.minecraft.util.WeightedRandom; import net.minecraft.util.WeightedRandom;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.WorldServer; import net.minecraft.world.WorldServer;
import net.minecraftforge.common.util.FakePlayerFactory; import net.minecraftforge.common.util.FakePlayerFactory;
import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary;
import java.util.List;
public class LensMining extends Lens{ public class LensMining extends Lens{
public static final int ENERGY_USE = 60000;
public static void init(){ public static void init(){
ActuallyAdditionsAPI.addMiningLensStoneOre("oreCoal", 5000); ActuallyAdditionsAPI.addMiningLensStoneOre("oreCoal", 5000);
@ -126,9 +127,8 @@ public class LensMining extends Lens{
@Override @Override
public boolean invoke(IBlockState hitState, BlockPos hitPos, IAtomicReconstructor tile){ public boolean invoke(IBlockState hitState, BlockPos hitPos, IAtomicReconstructor tile){
if(!tile.getWorldObject().isAirBlock(hitPos)){ if(!tile.getWorldObject().isAirBlock(hitPos)){
if(tile.getEnergy() >= ENERGY_USE){ if(tile.getEnergy() >= ConfigIntValues.LENS_MINER_ENERGY_USE.getValue()){
int adaptedUse = ENERGY_USE; int adaptedUse = ConfigIntValues.LENS_MINER_ENERGY_USE.getValue();
List<WeightedOre> ores = null; List<WeightedOre> ores = null;
Block hitBlock = hitState.getBlock(); Block hitBlock = hitState.getBlock();
if(hitBlock instanceof BlockStone){ if(hitBlock instanceof BlockStone){
@ -136,7 +136,7 @@ public class LensMining extends Lens{
} }
else if(hitBlock instanceof BlockNetherrack){ else if(hitBlock instanceof BlockNetherrack){
ores = ActuallyAdditionsAPI.NETHERRACK_ORES; ores = ActuallyAdditionsAPI.NETHERRACK_ORES;
adaptedUse += 10000; adaptedUse = ConfigIntValues.LENS_MINER_NETHER_ORES_ENERGY_USE.getValue();
} }
if(ores != null){ if(ores != null){
@ -151,7 +151,7 @@ public class LensMining extends Lens{
if(stacks != null && !stacks.isEmpty()){ if(stacks != null && !stacks.isEmpty()){
for(ItemStack aStack : stacks){ for(ItemStack aStack : stacks){
if(StackUtil.isValid(aStack) && !CrusherRecipeRegistry.hasBlacklistedOutput(aStack, ConfigStringListValues.MINING_LENS_BLACKLIST.getValue()) && aStack.getItem() instanceof ItemBlock){ if(StackUtil.isValid(aStack) && !CrusherRecipeRegistry.hasBlacklistedOutput(aStack, ConfigStringListValues.MINING_LENS_BLACKLIST.getValue()) && aStack.getItem() instanceof ItemBlock){
adaptedUse += (totalWeight-ore.itemWeight)%40000; adaptedUse += MathHelper.clamp(totalWeight - ore.itemWeight, 0, ConfigIntValues.LENS_MINER_ENERGY_USE.getValue());
stack = aStack; stack = aStack;
found = true; found = true;

View file

@ -10,11 +10,14 @@
package de.ellpeck.actuallyadditions.mod.items.lens; package de.ellpeck.actuallyadditions.mod.items.lens;
import java.util.ArrayList;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.recipe.ColorLensChangerByDyeMeta; import de.ellpeck.actuallyadditions.api.recipe.ColorLensChangerByDyeMeta;
import de.ellpeck.actuallyadditions.api.recipe.IColorLensChanger; import de.ellpeck.actuallyadditions.api.recipe.IColorLensChanger;
import de.ellpeck.actuallyadditions.api.recipe.LensConversionRecipe; import de.ellpeck.actuallyadditions.api.recipe.LensConversionRecipe;
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.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.InitItems;
import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals;
import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems;
@ -25,8 +28,6 @@ import net.minecraft.init.Items;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import java.util.ArrayList;
public final class LensRecipeHandler{ public final class LensRecipeHandler{
public static final ArrayList<LensConversionRecipe> MAIN_PAGE_RECIPES = new ArrayList<LensConversionRecipe>(); public static final ArrayList<LensConversionRecipe> MAIN_PAGE_RECIPES = new ArrayList<LensConversionRecipe>();
@ -45,65 +46,91 @@ public final class LensRecipeHandler{
public static void init(){ public static void init(){
//Crystal Blocks //Crystal Blocks
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.REDSTONE_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.REDSTONE.ordinal()), 400); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.REDSTONE_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.REDSTONE.ordinal()),
ConfigIntValues.ATOMIC_RECONSTRUCTOR_RESTONIA_BLOCK_COST.getValue());
MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe());
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.LAPIS_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.LAPIS.ordinal()), 400); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.LAPIS_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.LAPIS.ordinal()),
ConfigIntValues.ATOMIC_RECONSTRUCTOR_PALIS_BLOCK_COST.getValue());
MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe());
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.DIAMOND_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.DIAMOND.ordinal()), 600); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.DIAMOND_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.DIAMOND.ordinal()),
ConfigIntValues.ATOMIC_RECONSTRUCTOR_DIAMATINE_BLOCK_COST.getValue());
MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe());
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.EMERALD_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.EMERALD.ordinal()), 1000); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.EMERALD_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.EMERALD.ordinal()),
ConfigIntValues.ATOMIC_RECONSTRUCTOR_EMERADIC_BLOCK_COST.getValue());
MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe());
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.COAL_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.COAL.ordinal()), 600); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.COAL_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.COAL.ordinal()),
ConfigIntValues.ATOMIC_RECONSTRUCTOR_VOID_BLOCK_COST.getValue());
MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe());
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.IRON_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.IRON.ordinal()), 800); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.IRON_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.IRON.ordinal()),
ConfigIntValues.ATOMIC_RECONSTRUCTOR_ENORI_BLOCK_COST.getValue());
MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe());
//Crystal Items //Crystal Items
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.REDSTONE), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 40); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.REDSTONE), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()),
ConfigIntValues.ATOMIC_RECONSTRUCTOR_RESTONIA_CRYSTAL_COST.getValue());
MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe());
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.DYE, 1, 4), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), 40); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.DYE, 1, 4), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()),
ConfigIntValues.ATOMIC_RECONSTRUCTOR_PALIS_CRYSTAL_COST.getValue());
MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe());
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.DIAMOND), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 60); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.DIAMOND), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()),
ConfigIntValues.ATOMIC_RECONSTRUCTOR_DIAMATINE_CRYSTAL_COST.getValue());
MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe());
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.EMERALD), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), 100); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.EMERALD), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()),
ConfigIntValues.ATOMIC_RECONSTRUCTOR_EMERADIC_CRYSTAL_COST.getValue());
MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe());
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.COAL), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), 60); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.COAL), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()),
ConfigIntValues.ATOMIC_RECONSTRUCTOR_VOID_CRYSTAL_COST.getValue());
MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe());
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.IRON_INGOT), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 80); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.IRON_INGOT), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()),
ConfigIntValues.ATOMIC_RECONSTRUCTOR_ENORI_CRYSTAL_COST.getValue());
MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe());
//Lenses //Lenses
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal()), new ItemStack(InitItems.itemColorLens), 5000); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal()), new ItemStack(InitItems.itemColorLens),
ConfigIntValues.ATOMIC_RECONSTRUCTOR_LENS_COST.getValue());
recipeColorLens = RecipeUtil.lastReconstructorRecipe(); recipeColorLens = RecipeUtil.lastReconstructorRecipe();
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitItems.itemColorLens), new ItemStack(InitItems.itemExplosionLens), 5000); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitItems.itemColorLens), new ItemStack(InitItems.itemExplosionLens),
ConfigIntValues.ATOMIC_RECONSTRUCTOR_LENS_COST.getValue());
recipeExplosionLens = RecipeUtil.lastReconstructorRecipe(); recipeExplosionLens = RecipeUtil.lastReconstructorRecipe();
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitItems.itemExplosionLens), new ItemStack(InitItems.itemDamageLens), 5000); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitItems.itemExplosionLens), new ItemStack(InitItems.itemDamageLens),
ConfigIntValues.ATOMIC_RECONSTRUCTOR_LENS_COST.getValue());
recipeDamageLens = RecipeUtil.lastReconstructorRecipe(); recipeDamageLens = RecipeUtil.lastReconstructorRecipe();
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitItems.itemDamageLens), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal()), 5000); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitItems.itemDamageLens), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal()),
ConfigIntValues.ATOMIC_RECONSTRUCTOR_LENS_COST.getValue());
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitBlocks.blockLaserRelay), new ItemStack(InitBlocks.blockLaserRelayFluids), 2000); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitBlocks.blockLaserRelay), new ItemStack(InitBlocks.blockLaserRelayFluids),
ConfigIntValues.ATOMIC_RECONSTRUCTOR_LASER_RELAY_COST.getValue());
recipeFluidLaser = RecipeUtil.lastReconstructorRecipe(); recipeFluidLaser = RecipeUtil.lastReconstructorRecipe();
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitBlocks.blockLaserRelayFluids), new ItemStack(InitBlocks.blockLaserRelayItem), 2000); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitBlocks.blockLaserRelayFluids), new ItemStack(InitBlocks.blockLaserRelayItem),
ConfigIntValues.ATOMIC_RECONSTRUCTOR_LASER_RELAY_COST.getValue());
recipeItemLaser = RecipeUtil.lastReconstructorRecipe(); recipeItemLaser = RecipeUtil.lastReconstructorRecipe();
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitBlocks.blockLaserRelayItem), new ItemStack(InitBlocks.blockLaserRelay), 2000); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitBlocks.blockLaserRelayItem), new ItemStack(InitBlocks.blockLaserRelay),
ConfigIntValues.ATOMIC_RECONSTRUCTOR_LASER_RELAY_COST.getValue());
//Misc //Misc
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.SAND), new ItemStack(Blocks.SOUL_SAND), 20000); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.SAND), new ItemStack(Blocks.SOUL_SAND),
ConfigIntValues.ATOMIC_RECONSTRUCTOR_SOUL_SAND_COST.getValue());
recipeSoulSand = RecipeUtil.lastReconstructorRecipe(); recipeSoulSand = RecipeUtil.lastReconstructorRecipe();
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.ROTTEN_FLESH), new ItemStack(Items.LEATHER), 8000); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.ROTTEN_FLESH), new ItemStack(Items.LEATHER),
ConfigIntValues.ATOMIC_RECONSTRUCTOR_LEATHER_COST.getValue());
recipeLeather = RecipeUtil.lastReconstructorRecipe(); recipeLeather = RecipeUtil.lastReconstructorRecipe();
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.RED_MUSHROOM), new ItemStack(Items.NETHER_WART), 150000); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.RED_MUSHROOM), new ItemStack(Items.NETHER_WART),
ConfigIntValues.ATOMIC_RECONSTRUCTOR_NETHER_WART_COST.getValue());
recipeNetherWart = RecipeUtil.lastReconstructorRecipe(); recipeNetherWart = RecipeUtil.lastReconstructorRecipe();
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.QUARTZ), new ItemStack(Items.PRISMARINE_SHARD), 30000); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.QUARTZ), new ItemStack(Items.PRISMARINE_SHARD),
ConfigIntValues.ATOMIC_RECONSTRUCTOR_PRISMARINE_COST.getValue());
recipePrismarine = RecipeUtil.lastReconstructorRecipe(); recipePrismarine = RecipeUtil.lastReconstructorRecipe();
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitItems.itemCanolaSeed), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CRYSTALLIZED_CANOLA_SEED.ordinal()), 2000); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitItems.itemCanolaSeed), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CRYSTALLIZED_CANOLA_SEED.ordinal()),
ConfigIntValues.ATOMIC_RECONSTRUCTOR_CRYSTALLIZED_CANOLA_COST.getValue());
recipeCrystallizedCanolaSeed = RecipeUtil.lastReconstructorRecipe(); recipeCrystallizedCanolaSeed = RecipeUtil.lastReconstructorRecipe();
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.QUARTZ_BLOCK), new ItemStack(InitBlocks.blockTestifiBucksWhiteWall), 10); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.QUARTZ_BLOCK), new ItemStack(InitBlocks.blockTestifiBucksWhiteWall),
ConfigIntValues.ATOMIC_RECONSTRUCTOR_ETHETIC_QUARTZ_COST.getValue());
recipeWhiteWall = RecipeUtil.lastReconstructorRecipe(); recipeWhiteWall = RecipeUtil.lastReconstructorRecipe();
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.QUARTZ_BLOCK, 1, 1), new ItemStack(InitBlocks.blockTestifiBucksGreenWall), 10); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.QUARTZ_BLOCK, 1, 1), new ItemStack(InitBlocks.blockTestifiBucksGreenWall),
ConfigIntValues.ATOMIC_RECONSTRUCTOR_ETHETIC_GREEN_BLOCK_COST.getValue());
recipeGreenWall = RecipeUtil.lastReconstructorRecipe(); recipeGreenWall = RecipeUtil.lastReconstructorRecipe();
IColorLensChanger changer = new ColorLensChangerByDyeMeta(); IColorLensChanger changer = new ColorLensChangerByDyeMeta();

View file

@ -10,6 +10,9 @@
package de.ellpeck.actuallyadditions.mod.misc.apiimpl; package de.ellpeck.actuallyadditions.mod.misc.apiimpl;
import java.util.ArrayList;
import java.util.List;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter; import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter;
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry; import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
@ -25,6 +28,7 @@ import de.ellpeck.actuallyadditions.mod.booklet.page.PageCrafting;
import de.ellpeck.actuallyadditions.mod.booklet.page.PageFurnace; import de.ellpeck.actuallyadditions.mod.booklet.page.PageFurnace;
import de.ellpeck.actuallyadditions.mod.booklet.page.PagePicture; import de.ellpeck.actuallyadditions.mod.booklet.page.PagePicture;
import de.ellpeck.actuallyadditions.mod.booklet.page.PageTextOnly; import de.ellpeck.actuallyadditions.mod.booklet.page.PageTextOnly;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigStringListValues; import de.ellpeck.actuallyadditions.mod.config.values.ConfigStringListValues;
import de.ellpeck.actuallyadditions.mod.items.lens.LensRecipeHandler; import de.ellpeck.actuallyadditions.mod.items.lens.LensRecipeHandler;
import de.ellpeck.actuallyadditions.mod.recipe.CrusherRecipeRegistry; import de.ellpeck.actuallyadditions.mod.recipe.CrusherRecipeRegistry;
@ -47,9 +51,6 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.WorldServer; import net.minecraft.world.WorldServer;
import net.minecraftforge.common.util.FakePlayerFactory; import net.minecraftforge.common.util.FakePlayerFactory;
import java.util.ArrayList;
import java.util.List;
public class MethodHandler implements IMethodHandler{ public class MethodHandler implements IMethodHandler{
@Override @Override
@ -237,11 +238,12 @@ public class MethodHandler implements IMethodHandler{
@Override @Override
public boolean invokeReconstructor(IAtomicReconstructor tile){ public boolean invokeReconstructor(IAtomicReconstructor tile){
if(tile.getEnergy() >= TileEntityAtomicReconstructor.ENERGY_USE){ int energyUse = ConfigIntValues.ATOMIC_RECONSTRUCTOR_ENERGY_USE.getValue();
if(tile.getEnergy() >= energyUse){
EnumFacing sideToManipulate = tile.getOrientation(); EnumFacing sideToManipulate = tile.getOrientation();
Lens currentLens = tile.getLens(); Lens currentLens = tile.getLens();
if(currentLens.canInvoke(tile, sideToManipulate, TileEntityAtomicReconstructor.ENERGY_USE)){ if(currentLens.canInvoke(tile, sideToManipulate, energyUse)){
tile.extractEnergy(TileEntityAtomicReconstructor.ENERGY_USE); tile.extractEnergy(energyUse);
int distance = currentLens.getDistance(); int distance = currentLens.getDistance();
for(int i = 0; i < distance; i++){ for(int i = 0; i < distance; i++){
@ -290,7 +292,7 @@ public class MethodHandler implements IMethodHandler{
} }
return hasWorkedOnce; return hasWorkedOnce;
} }
@Override @Override
public boolean addCrusherRecipes(List<ItemStack> inputs, ItemStack outputOne, int outputOneAmount, ItemStack outputTwo, int outputTwoAmount, int outputTwoChance){ public boolean addCrusherRecipes(List<ItemStack> inputs, ItemStack outputOne, int outputOneAmount, ItemStack outputTwo, int outputTwoAmount, int outputTwoChance){
boolean hasWorkedOnce = false; boolean hasWorkedOnce = false;

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;
@ -30,14 +31,15 @@ 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 final CustomEnergyStorage storage;
public final CustomEnergyStorage storage = new CustomEnergyStorage(300000, 5000, 0);
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");
// Storage should be initialized after loading of config
this.storage = new CustomEnergyStorage(ConfigIntValues.ATOMIC_RECONSTRUCTOR_ENERGY_CAPACITY.getValue(), ConfigIntValues.ATOMIC_RECONSTRUCTOR_ENERGY_RECEIVE.getValue(), 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){

View file

@ -36,9 +36,14 @@ public final class StackUtil{
} }
public static boolean isValid(ItemStack stack){//Stacks are nonnull. If we are making null stacks we're stupid anyway. public static boolean isValid(ItemStack stack){//Stacks are nonnull. If we are making null stacks we're stupid anyway.
if(stack == null) AwfulUtil.callTheFuckinPolice("Oh yeah some idiot somewhere threw a null itemstack at us, might've been us, but whatever"); if(stack == null){
AwfulUtil.callTheFuckinPolice("Oh yeah some idiot somewhere threw a null itemstack at us, might've been us, but whatever");
return false;
}
Item i = stack.getItem(); Item i = stack.getItem();
if(i instanceof IDisableableItem) return !((IDisableableItem) i).isDisabled(); if(i instanceof IDisableableItem){
return !((IDisableableItem) i).isDisabled();
}
return !stack.isEmpty(); return !stack.isEmpty();
} }