diff --git a/build.gradle b/build.gradle index 6c119de8a..ce3772547 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ buildscript { apply plugin: 'forge' apply plugin: 'maven' -version = "1.7.10-0.0.5.4" +version = "1.7.10-0.0.5.5" group = "ellpeck.actuallyadditions" archivesBaseName = "ActuallyAdditions" diff --git a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java index bb671f483..f5b9fab72 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java +++ b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java @@ -82,9 +82,9 @@ public enum ConfigIntValues{ LAVA_FACTORY_ENERGY_USED("Lava Factory: Energy Used", ConfigCategories.MACHINE_VALUES, 150000, 10, 3000000, "The amount of Energy used by the Lava Factory per Bucket of Lava produced"), LAVA_FACTORY_TIME("Lava Factory: Production Time", ConfigCategories.MACHINE_VALUES, 200, 5, 10000, "The amount of time it takes for the Lava Factory to produce one Bucket"), - COFFEE_MACHINE_ENERGY_USED("Coffee Machine: Energy Used", ConfigCategories.MACHINE_VALUES, 150, 10, 3000, "The amount of Energy used by the Coffee Machine per Tick"), - COFFEE_CACHE_ADDED_PER_ITEM("Coffee Machine: Coffee added per Item", ConfigCategories.MACHINE_VALUES, 1, 1, 300, "The amount of Coffee added by one Coffee Item in the Coffee Machine"), - COFFEE_CACHE_USED_PER_ITEM("Coffee Machine: Coffee used per Item", ConfigCategories.MACHINE_VALUES, 10, 1, 300, "The amount of Coffee used to brew one Coffee in the Coffee Machine"), + COFFEE_MACHINE_ENERGY_USED("Coffee Machine: Energy Use", ConfigCategories.MACHINE_VALUES, 150, 10, 3000, "The amount of Energy used by the Coffee Machine per Tick"), + COFFEE_CACHE_ADDED_PER_ITEM("Coffee Machine: Coffee added per Cup", ConfigCategories.MACHINE_VALUES, 1, 1, 300, "The amount of Coffee added by one Coffee Item in the Coffee Machine"), + COFFEE_CACHE_USED_PER_ITEM("Coffee Machine: Coffee used per Cup", ConfigCategories.MACHINE_VALUES, 10, 1, 300, "The amount of Coffee used to brew one Coffee in the Coffee Machine"), COFFEE_MACHINE_TIME_USED("Coffee Machine: Time to Brew", ConfigCategories.MACHINE_VALUES, 500, 10, 10000, "The amount of time the Coffee Machine takes to brew a Coffee"), COFFEE_DRINK_AMOUNT("Coffee: Drink Amount", ConfigCategories.OTHER, 4, 1, 100, "How often a Coffee can be drunk from"); diff --git a/src/main/java/ellpeck/actuallyadditions/crafting/MiscCrafting.java b/src/main/java/ellpeck/actuallyadditions/crafting/MiscCrafting.java index 0ae0905ce..bcfcebe14 100644 --- a/src/main/java/ellpeck/actuallyadditions/crafting/MiscCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/crafting/MiscCrafting.java @@ -39,7 +39,7 @@ public class MiscCrafting{ //Knife Blade if(ConfigCrafting.KNIFE_BLADE.isEnabled()) GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.KNIFE_BLADE.ordinal()), - "KF", + "K", "F", 'K', "ingotIron", 'F', new ItemStack(Items.flint))); } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemCoffee.java b/src/main/java/ellpeck/actuallyadditions/items/ItemCoffee.java index 222ac2470..17c36aaf2 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemCoffee.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemCoffee.java @@ -30,14 +30,14 @@ public class ItemCoffee extends ItemFood implements INameableItem{ public static ArrayList ingredients = new ArrayList(); public static void initIngredients(){ - registerIngredient(new Ingredient(new ItemStack(Items.milk_bucket), null){ + registerIngredient(new Ingredient(new ItemStack(Items.milk_bucket), null, 0){ @Override - public void effect(ItemStack stack){ + public boolean effect(ItemStack stack){ PotionEffect[] effects = getEffectsFromStack(stack); ArrayList effectsNew = new ArrayList(); if(effects != null && effects.length > 0){ for(PotionEffect effect : effects){ - if(effect.getAmplifier() > 0) effectsNew.add(new PotionEffect(effect.getPotionID(), effect.getDuration()+150, effect.getAmplifier()-1)); + if(effect.getAmplifier() > 0) effectsNew.add(new PotionEffect(effect.getPotionID(), effect.getDuration()+120, effect.getAmplifier()-1)); } stack.setTagCompound(new NBTTagCompound()); if(effectsNew.size() > 0){ @@ -46,19 +46,20 @@ public class ItemCoffee extends ItemFood implements INameableItem{ } } this.effects = null; + return true; } @Override public String getExtraText(){ return StatCollector.translateToLocal("container.nei." + ModUtil.MOD_ID_LOWER + ".coffee.extra.milk"); } }); - registerIngredient(new Ingredient(new ItemStack(Items.sugar), new PotionEffect[]{new PotionEffect(Potion.moveSpeed.getId(), 30, 0)})); - registerIngredient(new Ingredient(new ItemStack(Items.magma_cream), new PotionEffect[]{new PotionEffect(Potion.fireResistance.getId(), 10, 0)})); - registerIngredient(new Ingredient(new ItemStack(Items.fish, 1, 3), new PotionEffect[]{new PotionEffect(Potion.waterBreathing.getId(), 15, 0)})); - registerIngredient(new Ingredient(new ItemStack(Items.golden_carrot), new PotionEffect[]{new PotionEffect(Potion.nightVision.getId(), 60, 0)})); - registerIngredient(new Ingredient(new ItemStack(Items.ghast_tear), new PotionEffect[]{new PotionEffect(Potion.regeneration.getId(), 10, 0)})); - registerIngredient(new Ingredient(new ItemStack(Items.blaze_powder), new PotionEffect[]{new PotionEffect(Potion.damageBoost.getId(), 15, 0)})); - registerIngredient(new Ingredient(new ItemStack(Items.fermented_spider_eye), new PotionEffect[]{new PotionEffect(Potion.invisibility.getId(), 25, 0)})); + registerIngredient(new Ingredient(new ItemStack(Items.sugar), new PotionEffect[]{new PotionEffect(Potion.moveSpeed.getId(), 30, 0)}, 4)); + registerIngredient(new Ingredient(new ItemStack(Items.magma_cream), new PotionEffect[]{new PotionEffect(Potion.fireResistance.getId(), 20, 0)}, 1)); + registerIngredient(new Ingredient(new ItemStack(Items.fish, 1, 3), new PotionEffect[]{new PotionEffect(Potion.waterBreathing.getId(), 10, 0)}, 1)); + registerIngredient(new Ingredient(new ItemStack(Items.golden_carrot), new PotionEffect[]{new PotionEffect(Potion.nightVision.getId(), 30, 0)}, 1)); + registerIngredient(new Ingredient(new ItemStack(Items.ghast_tear), new PotionEffect[]{new PotionEffect(Potion.regeneration.getId(), 5, 0)}, 3)); + registerIngredient(new Ingredient(new ItemStack(Items.blaze_powder), new PotionEffect[]{new PotionEffect(Potion.damageBoost.getId(), 15, 0)}, 4)); + registerIngredient(new Ingredient(new ItemStack(Items.fermented_spider_eye), new PotionEffect[]{new PotionEffect(Potion.invisibility.getId(), 25, 0)}, 1)); } public ItemCoffee(){ @@ -104,16 +105,27 @@ public class ItemCoffee extends ItemFood implements INameableItem{ stack.setTagCompound(tag); } - public static void addEffectToStack(ItemStack stack, Ingredient ingredient){ + public static boolean addEffectToStack(ItemStack stack, Ingredient ingredient){ + boolean worked = false; if(ingredient != null){ PotionEffect[] effects = ingredient.getEffects(); if(effects != null && effects.length > 0){ for(PotionEffect effect : effects){ - if(hasEffect(stack, effect)) addEffectProperties(stack, effect, false, true); - else addEffectToStack(stack, effect); + PotionEffect effectHas = getSameEffectFromStack(stack, effect); + if(effectHas != null){ + if(effectHas.getAmplifier() < ingredient.maxAmplifier-1){ + addEffectProperties(stack, effect, false, true); + worked = true; + } + } + else{ + addEffectToStack(stack, effect); + worked = true; + } } } } + return worked; } public static PotionEffect[] getEffectsFromStack(ItemStack stack){ @@ -133,14 +145,14 @@ public class ItemCoffee extends ItemFood implements INameableItem{ return effects.size() > 0 ? effects.toArray(new PotionEffect[effects.size()]) : null; } - public static boolean hasEffect(ItemStack stack, PotionEffect effect){ + public static PotionEffect getSameEffectFromStack(ItemStack stack, PotionEffect effect){ PotionEffect[] effectsStack = getEffectsFromStack(stack); if(effectsStack != null && effectsStack.length > 0){ for(PotionEffect effectStack : effectsStack){ - if(effect.getPotionID() == effectStack.getPotionID()) return true; + if(effect.getPotionID() == effectStack.getPotionID()) return effectStack; } } - return false; + return null; } public static void applyPotionEffectsFromStack(ItemStack stack, EntityPlayer player){ @@ -233,10 +245,12 @@ public class ItemCoffee extends ItemFood implements INameableItem{ public final ItemStack ingredient; protected PotionEffect[] effects; + public final int maxAmplifier; - public Ingredient(ItemStack ingredient, PotionEffect[] effects){ + public Ingredient(ItemStack ingredient, PotionEffect[] effects, int maxAmplifier){ this.ingredient = ingredient.copy(); this.effects = effects; + this.maxAmplifier = maxAmplifier; } public String getExtraText(){ @@ -247,8 +261,8 @@ public class ItemCoffee extends ItemFood implements INameableItem{ return this.effects; } - public void effect(ItemStack stack){ - ItemCoffee.addEffectToStack(stack, this); + public boolean effect(ItemStack stack){ + return ItemCoffee.addEffectToStack(stack, this); } } } \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/nei/CoffeeMachineRecipeHandler.java b/src/main/java/ellpeck/actuallyadditions/nei/CoffeeMachineRecipeHandler.java index cd1cf50b6..1d134e88e 100644 --- a/src/main/java/ellpeck/actuallyadditions/nei/CoffeeMachineRecipeHandler.java +++ b/src/main/java/ellpeck/actuallyadditions/nei/CoffeeMachineRecipeHandler.java @@ -37,6 +37,7 @@ public class CoffeeMachineRecipeHandler extends TemplateRecipeHandler{ public PositionedStack result; public PositionedStack ingredientStack; public String extraText; + public int maxAmp; public CachedCoffee(ItemCoffee.Ingredient ingredient){ this.cup = new PositionedStack(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CUP.ordinal()), 45, 39); @@ -44,6 +45,7 @@ public class CoffeeMachineRecipeHandler extends TemplateRecipeHandler{ this.ingredientStack = new PositionedStack(ingredient.ingredient.copy(), 90, 21); this.setupResult(ingredient); this.extraText = ingredient.getExtraText(); + this.maxAmp = ingredient.maxAmplifier; } public void setupResult(ItemCoffee.Ingredient ingredient){ @@ -139,10 +141,14 @@ public class CoffeeMachineRecipeHandler extends TemplateRecipeHandler{ CachedCoffee cache = (CachedCoffee)this.arecipes.get(recipe); if(cache.extraText != null){ - GuiDraw.drawString(StatCollector.translateToLocal("container.nei." + ModUtil.MOD_ID_LOWER + ".coffee.special"), 2, 6, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); - GuiDraw.drawString(cache.extraText, 2, 18, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); + GuiDraw.drawString(StatCollector.translateToLocal("container.nei." + ModUtil.MOD_ID_LOWER + ".coffee.special") + ":", 2, 4, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); + GuiDraw.drawString(cache.extraText, 2, 16, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); + } + GuiDraw.drawString(StatCollector.translateToLocal("container.nei." + ModUtil.MOD_ID_LOWER + ".coffee.shift"), 1, 75, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); + + if(cache.maxAmp > 0){ + GuiDraw.drawString(StatCollector.translateToLocal("container.nei." + ModUtil.MOD_ID_LOWER + ".coffee.maxAmount") + ": " + cache.maxAmp, 2, 28, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); } - GuiDraw.drawString("[SHIFT]!", 1, 75, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCoffeeMachine.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCoffeeMachine.java index 64de879ad..75a9950e6 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCoffeeMachine.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCoffeeMachine.java @@ -67,13 +67,14 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements this.brewTime = 0; ItemStack output = new ItemStack(InitItems.itemCoffee); for(int i = 3; i < this.slots.length; i++){ - if(this.slots[i] != null && ItemCoffee.getIngredientFromStack((this.slots[i])) != null){ + if(this.slots[i] != null){ ItemCoffee.Ingredient ingredient = ItemCoffee.getIngredientFromStack(this.slots[i]); if(ingredient != null){ - ingredient.effect(output); + if(ingredient.effect(output)){ + this.slots[i].stackSize--; + if(this.slots[i].stackSize <= 0) this.slots[i] = this.slots[i].getItem().getContainerItem(this.slots[i]); + } } - this.slots[i].stackSize--; - if(this.slots[i].stackSize <= 0) this.slots[i] = this.slots[i].getItem().getContainerItem(this.slots[i]); } } this.slots[SLOT_OUTPUT] = output.copy(); diff --git a/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java b/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java index 77b97f7b0..886a6a91e 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java +++ b/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java @@ -5,7 +5,7 @@ import org.apache.logging.log4j.Logger; public class ModUtil{ - public static final String VERSION = "1.7.10-0.0.5.4"; + public static final String VERSION = "1.7.10-0.0.5.5"; public static final String MOD_ID = "ActuallyAdditions"; public static final String NAME = "Actually Additions"; diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index 12c6a1558..308f4baf9 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -456,8 +456,10 @@ container.nei.actuallyadditions.ballOfHair.name=Ball Of Hair Usage container.nei.actuallyadditions.compost.name=Compost container.nei.actuallyadditions.coffee.name=Coffee Machine -container.nei.actuallyadditions.coffee.special=Special Feature: -container.nei.actuallyadditions.coffee.extra.milk=+02:30, -1 Level +container.nei.actuallyadditions.coffee.special=Special Feature +container.nei.actuallyadditions.coffee.maxAmount=Max Amount +container.nei.actuallyadditions.coffee.shift=[SHIFT]! +container.nei.actuallyadditions.coffee.extra.milk=+01:00, -1 Level info.actuallyadditions.update.generic.desc=[{"text":"There is an "},{"text":"Update ","bold":"true"},{"text":"for ","bold":"false"},{"text":"Actually Additions ","color":"dark_green","bold":"true"},{"text":"available!","color":"none","bold":"false"}] info.actuallyadditions.update.versionComp.desc=[{"text":"You have Version "},{"text":"%s","color":"dark_red","italic":"false"},{"text":", the newest one is ","color":"none","italic":"false"},{"text":"%s","color":"dark_green","underlined":"false"},{"text":"!","color":"none","underlined":"false"}] diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 29582c687..c3fd7d4bb 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,7 +3,7 @@ "modid": "ActuallyAdditions", "name": "Actually Additions", "description": "Actually Additions is a Mod that offers a bunch of things from Machines for Automation and tons of food to advanced Hopper Mechanisms and Effect Rings!", - "version": "0.0.5.4", + "version": "0.0.5.5", "mcversion": "1.7.10", "url": "https://github.com/Ellpeck/ActuallyAdditions", "updateUrl": "", diff --git a/update/changelog.txt b/update/changelog.txt index 202f6eb82..5af4fe492 100644 --- a/update/changelog.txt +++ b/update/changelog.txt @@ -1 +1 @@ -Phantom Boosters, Coffee, a Lava Factory and Flax \ No newline at end of file +Made the Coffee Machine less OP :P \ No newline at end of file diff --git a/update/newestVersion.txt b/update/newestVersion.txt index e7fde1fa6..c931343ef 100644 --- a/update/newestVersion.txt +++ b/update/newestVersion.txt @@ -1 +1 @@ -1.7.10-0.0.5.4 \ No newline at end of file +1.7.10-0.0.5.5 \ No newline at end of file