mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 00:38:35 +01:00
Fixed some stuff regarding the Reconstructor
This commit is contained in:
parent
ba1858af69
commit
e5850ffb4e
5 changed files with 20 additions and 19 deletions
|
@ -59,7 +59,8 @@ public class PageReconstructor extends BookletPage{
|
|||
gui.mc.fontRenderer.drawString(strg, gui.guiLeft+gui.xSize/2-gui.mc.fontRenderer.getStringWidth(strg)/2, gui.guiTop+10, 0);
|
||||
|
||||
//Lens
|
||||
strg = this.getRecipeForOutput(this.result).type.name;
|
||||
ItemStack lens = this.getRecipeForOutput(this.result).type.lens;
|
||||
strg = lens == null ? StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".noLens") : lens.getItem().getItemStackDisplayName(lens);
|
||||
gui.mc.fontRenderer.drawString(strg, gui.guiLeft+gui.xSize/2-gui.mc.fontRenderer.getStringWidth(strg)/2, gui.guiTop+75, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ public class ItemLens extends Item implements IActAddItemOrBlock, IReconstructor
|
|||
public ItemLens(String name, ReconstructorRecipeHandler.LensType type){
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
this.type.setLens(this);
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ public class AtomicReconstructorRecipeHandler extends TemplateRecipeHandler impl
|
|||
if(outputId.equals(NAME) && getClass() == AtomicReconstructorRecipeHandler.class){
|
||||
ArrayList<ReconstructorRecipeHandler.Recipe> recipes = ReconstructorRecipeHandler.recipes;
|
||||
for(ReconstructorRecipeHandler.Recipe recipe : recipes){
|
||||
arecipes.add(new CachedReconstructorRecipe(recipe.input, recipe.output, recipe.type.name));
|
||||
arecipes.add(new CachedReconstructorRecipe(recipe.input, recipe.output, recipe.type.lens));
|
||||
}
|
||||
}
|
||||
else{
|
||||
|
@ -73,7 +73,7 @@ public class AtomicReconstructorRecipeHandler extends TemplateRecipeHandler impl
|
|||
ArrayList<ReconstructorRecipeHandler.Recipe> recipes = ReconstructorRecipeHandler.recipes;
|
||||
for(ReconstructorRecipeHandler.Recipe recipe : recipes){
|
||||
if(ItemUtil.contains(OreDictionary.getOres(recipe.output, false), result, true)){
|
||||
arecipes.add(new CachedReconstructorRecipe(recipe.input, recipe.output, recipe.type.name));
|
||||
arecipes.add(new CachedReconstructorRecipe(recipe.input, recipe.output, recipe.type.lens));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ public class AtomicReconstructorRecipeHandler extends TemplateRecipeHandler impl
|
|||
ArrayList<ReconstructorRecipeHandler.Recipe> recipes = ReconstructorRecipeHandler.recipes;
|
||||
for(ReconstructorRecipeHandler.Recipe recipe : recipes){
|
||||
if(ItemUtil.contains(OreDictionary.getOres(recipe.input, false), ingredient, true)){
|
||||
CachedReconstructorRecipe theRecipe = new CachedReconstructorRecipe(recipe.input, recipe.output, recipe.type.name);
|
||||
CachedReconstructorRecipe theRecipe = new CachedReconstructorRecipe(recipe.input, recipe.output, recipe.type.lens);
|
||||
theRecipe.setIngredientPermutation(Collections.singletonList(theRecipe.input), ingredient);
|
||||
arecipes.add(theRecipe);
|
||||
}
|
||||
|
@ -119,10 +119,7 @@ public class AtomicReconstructorRecipeHandler extends TemplateRecipeHandler impl
|
|||
}
|
||||
|
||||
CachedReconstructorRecipe cache = (CachedReconstructorRecipe)this.arecipes.get(recipe);
|
||||
if(cache != null && cache.lens != null){
|
||||
GuiDraw.drawString(cache.lens, 10, 45, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false);
|
||||
}
|
||||
|
||||
GuiDraw.drawString(cache.lens == null ? StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".noLens") : cache.lens.getItem().getItemStackDisplayName(cache.lens), 10, 45, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -134,9 +131,9 @@ public class AtomicReconstructorRecipeHandler extends TemplateRecipeHandler impl
|
|||
|
||||
public PositionedStack result;
|
||||
public PositionedStack input;
|
||||
public String lens;
|
||||
public ItemStack lens;
|
||||
|
||||
public CachedReconstructorRecipe(String input, String result, String lens){
|
||||
public CachedReconstructorRecipe(String input, String result, ItemStack lens){
|
||||
List<ItemStack> outputs = OreDictionary.getOres(result, false);
|
||||
for(ItemStack ore : outputs){
|
||||
ore.stackSize = 1;
|
||||
|
|
|
@ -14,6 +14,7 @@ import ellpeck.actuallyadditions.blocks.metalists.TheColoredLampColors;
|
|||
import ellpeck.actuallyadditions.config.values.ConfigCrafting;
|
||||
import ellpeck.actuallyadditions.util.AssetUtil;
|
||||
import ellpeck.actuallyadditions.util.Util;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
|
@ -55,9 +56,9 @@ public class ReconstructorRecipeHandler{
|
|||
|
||||
//Colors
|
||||
for(int i = 0; i < TheColoredLampColors.values().length-1; i++){
|
||||
addRecipe("dye"+TheColoredLampColors.values()[i].name, "dye"+TheColoredLampColors.values()[i+1].name, 2000);
|
||||
addRecipe("dye"+TheColoredLampColors.values()[i].name, "dye"+TheColoredLampColors.values()[i+1].name, 2000, LensType.COLOR);
|
||||
}
|
||||
addRecipe("dye"+TheColoredLampColors.values()[15].name, "dye"+TheColoredLampColors.values()[0].name, 2000);
|
||||
addRecipe("dye"+TheColoredLampColors.values()[15].name, "dye"+TheColoredLampColors.values()[0].name, 2000, LensType.COLOR);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -107,14 +108,10 @@ public class ReconstructorRecipeHandler{
|
|||
|
||||
public enum LensType{
|
||||
|
||||
NONE("No Lens"),
|
||||
COLOR("Color Lens");
|
||||
NONE,
|
||||
COLOR;
|
||||
|
||||
public String name;
|
||||
|
||||
LensType(String name){
|
||||
this.name = name;
|
||||
}
|
||||
public ItemStack lens;
|
||||
|
||||
public float[] getColor(){
|
||||
if(this == COLOR){
|
||||
|
@ -123,6 +120,10 @@ public class ReconstructorRecipeHandler{
|
|||
}
|
||||
return new float[]{27F/255F, 109F/255F, 1F};
|
||||
}
|
||||
|
||||
public void setLens(Item lens){
|
||||
this.lens = new ItemStack(lens);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -359,6 +359,7 @@ info.actuallyadditions.gui.the=the
|
|||
info.actuallyadditions.inputter.info.1=This is the first Slot in the connected Inventory to <p> at.
|
||||
info.actuallyadditions.inputter.info.2=This is the slot after the last Slot in the connected Inventory to <p> at. What that means: If you, for example, write 2 in the field to the left and 5 in this one, it will <p> at Slot 2, 3, and 4.
|
||||
info.actuallyadditions.inputter.whitelistInfo=This applies for this part of the white-/blacklist. The other side applies as well, so you can have some Items whitelisted and some blacklisted. Note that, if you have an empty blacklist or an item whitelisted on at least one side, it will always go through.
|
||||
info.actuallyadditions.noLens=No Lens
|
||||
|
||||
#Container Names
|
||||
container.actuallyadditions.inputter.name=ESD
|
||||
|
|
Loading…
Reference in a new issue