Made the Color Lens use energy & Added NEI Recipes for the color conversion recipes & Changed booklet pages a bit

This commit is contained in:
Ellpeck 2015-12-04 12:59:37 +01:00
parent a7fe955e6f
commit 40191b840a
4 changed files with 50 additions and 8 deletions

View file

@ -40,12 +40,15 @@ public class LensColor extends Lens{
{86F, 51F, 28F}, //Brown {86F, 51F, 28F}, //Brown
}; };
private static final Object[] CONVERTABLE_BLOCKS = new Object[]{ public static final int ENERGY_USE = 200;
public static final Object[] CONVERTABLE_BLOCKS = new Object[]{
Items.dye, Items.dye,
Blocks.wool, Blocks.wool,
Blocks.stained_glass, Blocks.stained_glass,
Blocks.stained_glass_pane, Blocks.stained_glass_pane,
Blocks.stained_hardened_clay, Blocks.stained_hardened_clay,
Blocks.carpet,
InitBlocks.blockColoredLamp, InitBlocks.blockColoredLamp,
InitBlocks.blockColoredLampOn InitBlocks.blockColoredLampOn
}; };
@ -54,7 +57,7 @@ public class LensColor extends Lens{
@Override @Override
public boolean invoke(WorldPos hitBlock, TileEntityAtomicReconstructor tile){ public boolean invoke(WorldPos hitBlock, TileEntityAtomicReconstructor tile){
if(hitBlock != null){ if(hitBlock != null){
if(Util.arrayContains(CONVERTABLE_BLOCKS, hitBlock.getBlock()) >= 0){ if(Util.arrayContains(CONVERTABLE_BLOCKS, hitBlock.getBlock()) >= 0 && tile.storage.getEnergyStored() >= ENERGY_USE){
int meta = hitBlock.getMetadata(); int meta = hitBlock.getMetadata();
if(meta >= 15){ if(meta >= 15){
hitBlock.setMetadata(0, 2); hitBlock.setMetadata(0, 2);
@ -62,11 +65,12 @@ public class LensColor extends Lens{
else{ else{
hitBlock.setMetadata(meta+1, 2); hitBlock.setMetadata(meta+1, 2);
} }
tile.storage.extractEnergy(ENERGY_USE, false);
} }
ArrayList<EntityItem> items = (ArrayList<EntityItem>)tile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(hitBlock.getX(), hitBlock.getY(), hitBlock.getZ(), hitBlock.getX()+1, hitBlock.getY()+1, hitBlock.getZ()+1)); ArrayList<EntityItem> items = (ArrayList<EntityItem>)tile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(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.getEntityItem() != null){ if(item.getEntityItem() != null && tile.storage.getEnergyStored() >= ENERGY_USE){
if(Util.arrayContains(CONVERTABLE_BLOCKS, item.getEntityItem().getItem()) >= 0 || Util.arrayContains(CONVERTABLE_BLOCKS, Block.getBlockFromItem(item.getEntityItem().getItem())) >= 0){ if(Util.arrayContains(CONVERTABLE_BLOCKS, item.getEntityItem().getItem()) >= 0 || Util.arrayContains(CONVERTABLE_BLOCKS, Block.getBlockFromItem(item.getEntityItem().getItem())) >= 0){
int meta = item.getEntityItem().getItemDamage(); int meta = item.getEntityItem().getItemDamage();
if(meta >= 15){ if(meta >= 15){
@ -75,6 +79,7 @@ public class LensColor extends Lens{
else{ else{
item.getEntityItem().setItemDamage(meta+1); item.getEntityItem().setItemDamage(meta+1);
} }
tile.storage.extractEnergy(ENERGY_USE, false);
} }
} }
} }

View file

@ -17,12 +17,16 @@ import codechicken.nei.recipe.TemplateRecipeHandler;
import ellpeck.actuallyadditions.blocks.InitBlocks; import ellpeck.actuallyadditions.blocks.InitBlocks;
import ellpeck.actuallyadditions.booklet.BookletUtils; import ellpeck.actuallyadditions.booklet.BookletUtils;
import ellpeck.actuallyadditions.booklet.page.BookletPage; import ellpeck.actuallyadditions.booklet.page.BookletPage;
import ellpeck.actuallyadditions.items.lens.LensColor;
import ellpeck.actuallyadditions.items.lens.LensNoneRecipeHandler; import ellpeck.actuallyadditions.items.lens.LensNoneRecipeHandler;
import ellpeck.actuallyadditions.util.ItemUtil; import ellpeck.actuallyadditions.util.ItemUtil;
import ellpeck.actuallyadditions.util.ModUtil; import ellpeck.actuallyadditions.util.ModUtil;
import ellpeck.actuallyadditions.util.StringUtil; import ellpeck.actuallyadditions.util.StringUtil;
import ellpeck.actuallyadditions.util.Util;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
@ -58,10 +62,27 @@ public class NEIReconstructorRecipe extends TemplateRecipeHandler implements INE
@Override @Override
public void loadCraftingRecipes(String outputId, Object... results){ public void loadCraftingRecipes(String outputId, Object... results){
if(outputId.equals(NAME) && getClass() == NEIReconstructorRecipe.class){ if(outputId.equals(NAME) && getClass() == NEIReconstructorRecipe.class){
//Default Recipes
ArrayList<LensNoneRecipeHandler.Recipe> recipes = LensNoneRecipeHandler.recipes; ArrayList<LensNoneRecipeHandler.Recipe> recipes = LensNoneRecipeHandler.recipes;
for(LensNoneRecipeHandler.Recipe recipe : recipes){ for(LensNoneRecipeHandler.Recipe recipe : recipes){
arecipes.add(new CachedReconstructorRecipe(recipe)); arecipes.add(new CachedReconstructorRecipe(recipe));
} }
//Color Recipes
for(Object o : LensColor.CONVERTABLE_BLOCKS){
ItemStack stack;
if(o instanceof Block){
stack = new ItemStack((Block)o);
}
else{
stack = new ItemStack((Item)o);
}
for(int i = 0; i < 16; i++){
ItemStack stackCopy = stack.copy();
stackCopy.setItemDamage(i >= 15 ? 0 : i+1);
stack.setItemDamage(i);
arecipes.add(new CachedReconstructorRecipe(new LensNoneRecipeHandler.Recipe(stack, stackCopy, LensColor.ENERGY_USE)));
}
}
} }
else{ else{
super.loadCraftingRecipes(outputId, results); super.loadCraftingRecipes(outputId, results);
@ -71,16 +92,25 @@ public class NEIReconstructorRecipe extends TemplateRecipeHandler implements INE
@Override @Override
public void loadCraftingRecipes(ItemStack result){ public void loadCraftingRecipes(ItemStack result){
ArrayList<LensNoneRecipeHandler.Recipe> recipes = LensNoneRecipeHandler.recipes; ArrayList<LensNoneRecipeHandler.Recipe> recipes = LensNoneRecipeHandler.recipes;
//Default Recipes
for(LensNoneRecipeHandler.Recipe recipe : recipes){ for(LensNoneRecipeHandler.Recipe recipe : recipes){
if(ItemUtil.contains(recipe.getOutputs(), result, true)){ if(ItemUtil.contains(recipe.getOutputs(), result, true)){
arecipes.add(new CachedReconstructorRecipe(recipe)); arecipes.add(new CachedReconstructorRecipe(recipe));
} }
} }
//Color Recipes
if(result.getItem() != null && (Util.arrayContains(LensColor.CONVERTABLE_BLOCKS, result.getItem()) >= 0 || Util.arrayContains(LensColor.CONVERTABLE_BLOCKS, Block.getBlockFromItem(result.getItem())) >= 0)){
int meta = result.getItemDamage();
ItemStack input = result.copy();
input.setItemDamage(meta <= 0 ? 15 : meta-1);
arecipes.add(new CachedReconstructorRecipe(new LensNoneRecipeHandler.Recipe(input, result, LensColor.ENERGY_USE)));
}
} }
@Override @Override
public void loadUsageRecipes(ItemStack ingredient){ public void loadUsageRecipes(ItemStack ingredient){
ArrayList<LensNoneRecipeHandler.Recipe> recipes = LensNoneRecipeHandler.recipes; ArrayList<LensNoneRecipeHandler.Recipe> recipes = LensNoneRecipeHandler.recipes;
//Default Recipes
for(LensNoneRecipeHandler.Recipe recipe : recipes){ for(LensNoneRecipeHandler.Recipe recipe : recipes){
if(ItemUtil.contains(recipe.getInputs(), ingredient, true)){ if(ItemUtil.contains(recipe.getInputs(), ingredient, true)){
CachedReconstructorRecipe theRecipe = new CachedReconstructorRecipe(recipe); CachedReconstructorRecipe theRecipe = new CachedReconstructorRecipe(recipe);
@ -88,6 +118,13 @@ public class NEIReconstructorRecipe extends TemplateRecipeHandler implements INE
arecipes.add(theRecipe); arecipes.add(theRecipe);
} }
} }
//Color Recipes
if(ingredient.getItem() != null && (Util.arrayContains(LensColor.CONVERTABLE_BLOCKS, ingredient.getItem()) >= 0 || Util.arrayContains(LensColor.CONVERTABLE_BLOCKS, Block.getBlockFromItem(ingredient.getItem())) >= 0)){
int meta = ingredient.getItemDamage();
ItemStack output = ingredient.copy();
output.setItemDamage(meta >= 15 ? 0 : meta+1);
arecipes.add(new CachedReconstructorRecipe(new LensNoneRecipeHandler.Recipe(ingredient, output, LensColor.ENERGY_USE)));
}
} }
@Override @Override

View file

@ -605,7 +605,7 @@ booklet.actuallyadditions.chapter.blackLotus.text.2=<i>No, not that one, Vaz
booklet.actuallyadditions.chapter.crystals.name=Crystals and Reconstructor booklet.actuallyadditions.chapter.crystals.name=Crystals and Reconstructor
booklet.actuallyadditions.chapter.crystals.text.1=The <item>Atomic Reconstructor<r> is used to craft <item>Crystals<r>, which are the main crafting ingredient in most items from <imp>Actually Additions<r>. <n>Upon being supplied with power, it shoots out a Laser. When the Laser hits a block, it will convert all surrounding items and blocks, provided they can be converted. <n>When shooting a laser, it uses <imp><rf> RF<r>, but additional rates vary depending on the conversion. booklet.actuallyadditions.chapter.crystals.text.1=The <item>Atomic Reconstructor<r> is used to craft <item>Crystals<r>, which are the main crafting ingredient in most items from <imp>Actually Additions<r>. <n>Upon being supplied with power, it shoots out a Laser. When the Laser hits a block, it will convert all surrounding items and blocks, provided they can be converted. <n>When shooting a laser, it uses <imp><rf> RF<r>, but additional rates vary depending on the conversion.
booklet.actuallyadditions.chapter.crystals.text.2=The Reconstructor can be <imp>upgraded<r>, however, by the use of <item>Lenses<r>. They can be applied to the Reconstructor by <imp>right-clicking with one in hand<r>, and taken out again when right-clicking with an empty hand. <n>When looking at Recipes, the Lens needed for the operation will also be shown. <n>The Crafting Recipes for the Lenses can also be found on the following pages. <n><item>Lenses<imp> are also attachable. See the booklet's Miscellaneous section for more information. booklet.actuallyadditions.chapter.crystals.text.2=There are various <item>Lenses<r> that can be attached to the Reconstructor that don't all follow the default behavior of the Reconstructor and are able to do some neat things. <n>See the <imp>"Reconstructor Lenses & Misc"<r> chapter in the booklet's Miscellaneous section <imp>for more information<r>.
booklet.actuallyadditions.chapter.crystals.text.4=When you have crafted a couple of items, you might want to find a way to <imp>automate this<r>. <n>There is a very simple way to do accomplish this: <n>Place the <item>Atomic Reconstructor<r> down facing into a <item>Precision Dropper<r> (to find it, look it up in the <imp>All Items and Search<r> Entry!). <n>Next, place a <item>Ranged Collector<r> in the area that has the converted items set as a whitelist. <n>Now you can just chuck your raw materials into the Dropper to convert them! booklet.actuallyadditions.chapter.crystals.text.4=When you have crafted a couple of items, you might want to find a way to <imp>automate this<r>. <n>There is a very simple way to do accomplish this: <n>Place the <item>Atomic Reconstructor<r> down facing into a <item>Precision Dropper<r> (to find it, look it up in the <imp>All Items and Search<r> Entry!). <n>Next, place a <item>Ranged Collector<r> in the area that has the converted items set as a whitelist. <n>Now you can just chuck your raw materials into the Dropper to convert them!
booklet.actuallyadditions.chapter.bookTutorial.name=Intro to the Manual booklet.actuallyadditions.chapter.bookTutorial.name=Intro to the Manual
@ -618,10 +618,10 @@ booklet.actuallyadditions.chapter.bookStand.text.1=The <item>Manual Stand<r> is
booklet.actuallyadditions.chapter.bookStand.text.2=<n><n><n><i>Stand on it booklet.actuallyadditions.chapter.bookStand.text.2=<n><n><n><i>Stand on it
booklet.actuallyadditions.chapter.reconstructorLenses.name=Reconstructor Lenses & Misc booklet.actuallyadditions.chapter.reconstructorLenses.name=Reconstructor Lenses & Misc
booklet.actuallyadditions.chapter.reconstructorLenses.text.1=The <item>Atomic Reconstructor<r>, by default, can only convert some blocks. <n>This can be changed, however, with <item>Lenses<r>. They can be, once crafted, attached to the Reconstructor via <imp>right-clicking<r> the Reconstructor with them in hand. To remove them, right-click it with an empty hand. <n><item>Lenses<r> have lots of different features and uses, as you can see on <imp>the following pages<r>. <n>However, there is also some other useful recipes to be found there too. booklet.actuallyadditions.chapter.reconstructorLenses.text.1=The <item>Atomic Reconstructor<r>, by default, can only convert some blocks. <n>This can be changed, however, with <item>Lenses<r>. They can be, once crafted, attached to the Reconstructor via <imp>right-clicking<r> the Reconstructor with them in hand. To remove them, right-click it with an empty hand. <n><item>Lenses<r> have lots of different features and uses, as you can see on <imp>the following pages<r>. <n>However, there is also some <imp>other useful recipes<r> to be found there too.
booklet.actuallyadditions.chapter.reconstructorLenses.text.3=The <item>Lens of Color<r> can mainly be used to change the colors of <item>Wool<r>, <item>Stained Clay<r>, <item>Stained Glass<r> and <item>Dye<r>, as you can see on the following pages. <n>It has some other uses, too, though. booklet.actuallyadditions.chapter.reconstructorLenses.text.3=The <item>Lens of Color<r> changes the color of <imp>Stained Glass and Panes, Stained Clay, Carpetet, Dye, Lamps, Wool<r> in its sight. <n>Contrary to using no lens, it goes <imp>through blocks<r> and only converts blocks it touches.
booklet.actuallyadditions.chapter.reconstructorLenses.text.5=The <item>Lens of Detonation<r> will create a firey explosion <imp>around the block the laser hits<r>. <n>Be careful with this. Seriously. <n>(With this lens, the laser also goes 3 times as far!) booklet.actuallyadditions.chapter.reconstructorLenses.text.4=The <item>Lens of Detonation<r> will create a firey explosion <imp>around the block the laser hits<r>. <n>Be careful with this. Seriously. <n>(With this lens, the laser also goes 3 times as far!)
booklet.actuallyadditions.chapter.reconstructorLenses.text.6=The <item>Lens of Certain Death<r> will, instead of converting or exploding blocks, do nothing to the environment, but <imp>deal lots of damage<r>, enough, in fact, to kill a player <imp>in a single hit<r>. booklet.actuallyadditions.chapter.reconstructorLenses.text.5=The <item>Lens of Certain Death<r> will, <imp>deal lots of damage<r> to whatever steps into it, enough, in fact, to kill a player <imp>in a single hit<r>.
booklet.actuallyadditions.chapter.miscDecorStuffsAndThings.name=Some Decor booklet.actuallyadditions.chapter.miscDecorStuffsAndThings.name=Some Decor
booklet.actuallyadditions.chapter.miscDecorStuffsAndThings.text.1=Sometimes, when you build, you notice there is just <imp>not enough decor blocks<r>. Well, we present to you: <item>Ethetic Blocks<r>! <n>These are some quartz-like decor blocks with lovely patterns that can also be <imp>converted<r> into <imp>Stairs<r>, <imp>Slabs<r> and <imp>Walls<r> using the usual, well-known recipe patterns. booklet.actuallyadditions.chapter.miscDecorStuffsAndThings.text.1=Sometimes, when you build, you notice there is just <imp>not enough decor blocks<r>. Well, we present to you: <item>Ethetic Blocks<r>! <n>These are some quartz-like decor blocks with lovely patterns that can also be <imp>converted<r> into <imp>Stairs<r>, <imp>Slabs<r> and <imp>Walls<r> using the usual, well-known recipe patterns.