better universal upgrade system, rebalanced upgrades, yay

This commit is contained in:
Boblet 2021-08-12 14:42:04 +02:00
parent 41034075fd
commit a0237c9a40
12 changed files with 233 additions and 254 deletions

View File

@ -102,6 +102,7 @@ public class AnvilRecipes {
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack("dustEmerald"), new AnvilOutput(new ItemStack(Items.emerald))).setTier(3)); constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack("dustEmerald"), new AnvilOutput(new ItemStack(Items.emerald))).setTier(3));
registerConstructionAmmo(); registerConstructionAmmo();
registerConstructionUpgrades();
registerConstructionRecycling(); registerConstructionRecycling();
} }
@ -283,6 +284,34 @@ public class AnvilRecipes {
} }
} }
public static void registerConstructionUpgrades() {
pullFromAssembler(new ComparableStack(ModItems.upgrade_template), 2);
pullFromAssembler(new ComparableStack(ModItems.upgrade_speed_1), 2);
pullFromAssembler(new ComparableStack(ModItems.upgrade_speed_2), 3);
pullFromAssembler(new ComparableStack(ModItems.upgrade_speed_3), 4);
pullFromAssembler(new ComparableStack(ModItems.upgrade_power_1), 2);
pullFromAssembler(new ComparableStack(ModItems.upgrade_power_2), 3);
pullFromAssembler(new ComparableStack(ModItems.upgrade_power_3), 4);
pullFromAssembler(new ComparableStack(ModItems.upgrade_effect_1), 2);
pullFromAssembler(new ComparableStack(ModItems.upgrade_effect_2), 3);
pullFromAssembler(new ComparableStack(ModItems.upgrade_effect_3), 4);
pullFromAssembler(new ComparableStack(ModItems.upgrade_fortune_1), 2);
pullFromAssembler(new ComparableStack(ModItems.upgrade_fortune_2), 3);
pullFromAssembler(new ComparableStack(ModItems.upgrade_fortune_3), 4);
pullFromAssembler(new ComparableStack(ModItems.upgrade_afterburn_1), 2);
pullFromAssembler(new ComparableStack(ModItems.upgrade_afterburn_2), 3);
pullFromAssembler(new ComparableStack(ModItems.upgrade_afterburn_3), 4);
pullFromAssembler(new ComparableStack(ModItems.upgrade_radius), 4);
pullFromAssembler(new ComparableStack(ModItems.upgrade_health), 4);
pullFromAssembler(new ComparableStack(ModItems.upgrade_smelter), 4);
pullFromAssembler(new ComparableStack(ModItems.upgrade_shredder), 4);
pullFromAssembler(new ComparableStack(ModItems.upgrade_centrifuge), 4);
pullFromAssembler(new ComparableStack(ModItems.upgrade_crystallizer), 4);
pullFromAssembler(new ComparableStack(ModItems.upgrade_nullifier), 4);
pullFromAssembler(new ComparableStack(ModItems.upgrade_screm), 4);
}
public static void registerConstructionRecycling() { public static void registerConstructionRecycling() {
constructionRecipes.add(new AnvilConstructionRecipe( constructionRecipes.add(new AnvilConstructionRecipe(
new ComparableStack(ModBlocks.barrel_tcalloy), new ComparableStack(ModBlocks.barrel_tcalloy),
@ -396,6 +425,15 @@ public class AnvilRecipes {
).setTier(4)); ).setTier(4));
} }
public static void pullFromAssembler(ComparableStack result, int tier) {
AStack[] ingredients = AssemblerRecipes.recipes.get(result);
if(ingredients != null) {
constructionRecipes.add(new AnvilConstructionRecipe(ingredients, new AnvilOutput(result.toStack())).setTier(tier));
}
}
public static List<AnvilSmithingRecipe> getSmithing() { public static List<AnvilSmithingRecipe> getSmithing() {
return smithingRecipes; return smithingRecipes;
} }

View File

@ -11,7 +11,7 @@ import net.minecraft.nbt.NBTTagCompound;
public class AnvilSmithingCyanideRecipe extends AnvilSmithingRecipe { public class AnvilSmithingCyanideRecipe extends AnvilSmithingRecipe {
public AnvilSmithingCyanideRecipe() { public AnvilSmithingCyanideRecipe() {
super(0, new ItemStack(Items.bread), new ComparableStack(Items.bread), new ComparableStack(ModItems.plan_c)); super(1, new ItemStack(Items.bread), new ComparableStack(Items.bread), new ComparableStack(ModItems.plan_c));
if(!this.output.hasTagCompound()) if(!this.output.hasTagCompound())
this.output.stackTagCompound = new NBTTagCompound(); this.output.stackTagCompound = new NBTTagCompound();

View File

@ -9,7 +9,7 @@ import net.minecraft.nbt.NBTTagCompound;
public class AnvilSmithingRenameRecipe extends AnvilSmithingRecipe { public class AnvilSmithingRenameRecipe extends AnvilSmithingRecipe {
public AnvilSmithingRenameRecipe() { public AnvilSmithingRenameRecipe() {
super(0, new ItemStack(Items.iron_sword), new ComparableStack(Items.iron_sword), new ComparableStack(Items.name_tag, 0)); super(1, new ItemStack(Items.iron_sword), new ComparableStack(Items.iron_sword), new ComparableStack(Items.name_tag, 0));
} }
@Override @Override

View File

@ -237,9 +237,9 @@ public class AssemblerRecipes {
makeRecipe(new ComparableStack(ModItems.upgrade_afterburn_3, 1), new AStack[] {new ComparableStack(ModItems.upgrade_afterburn_2, 1), new ComparableStack(ModItems.powder_polymer, 2), new OreDictStack("dustTungsten", 6), new OreDictStack("ingotDesh", 4), },500); makeRecipe(new ComparableStack(ModItems.upgrade_afterburn_3, 1), new AStack[] {new ComparableStack(ModItems.upgrade_afterburn_2, 1), new ComparableStack(ModItems.powder_polymer, 2), new OreDictStack("dustTungsten", 6), new OreDictStack("ingotDesh", 4), },500);
makeRecipe(new ComparableStack(ModItems.upgrade_radius, 1), new AStack[] {new ComparableStack(ModItems.upgrade_template, 1), new ComparableStack(Items.glowstone_dust, 6), new OreDictStack("dustDiamond", 4), },500); makeRecipe(new ComparableStack(ModItems.upgrade_radius, 1), new AStack[] {new ComparableStack(ModItems.upgrade_template, 1), new ComparableStack(Items.glowstone_dust, 6), new OreDictStack("dustDiamond", 4), },500);
makeRecipe(new ComparableStack(ModItems.upgrade_health, 1), new AStack[] {new ComparableStack(ModItems.upgrade_template, 1), new ComparableStack(Items.glowstone_dust, 6), new OreDictStack("dustTitanium", 4), },500); makeRecipe(new ComparableStack(ModItems.upgrade_health, 1), new AStack[] {new ComparableStack(ModItems.upgrade_template, 1), new ComparableStack(Items.glowstone_dust, 6), new OreDictStack("dustTitanium", 4), },500);
makeRecipe(new ComparableStack(ModItems.upgrade_overdrive_1, 1), new AStack[] {new ComparableStack(ModItems.upgrade_speed_3, 4), new ComparableStack(ModItems.upgrade_effect_3, 2), new OreDictStack("ingotDesh", 8), new ComparableStack(ModItems.powder_power, 16), new ComparableStack(ModItems.crystal_lithium, 4), new ComparableStack(ModItems.circuit_schrabidium, 4), },200); makeRecipe(new ComparableStack(ModItems.upgrade_overdrive_1, 1), new AStack[] {new ComparableStack(ModItems.upgrade_speed_3, 1), new ComparableStack(ModItems.upgrade_effect_3, 1), new OreDictStack("ingotDesh", 8), new ComparableStack(ModItems.powder_power, 16), new ComparableStack(ModItems.crystal_lithium, 4), new ComparableStack(ModItems.circuit_schrabidium, 1), }, 200);
makeRecipe(new ComparableStack(ModItems.upgrade_overdrive_2, 1), new AStack[] {new ComparableStack(ModItems.upgrade_overdrive_1, 1), new ComparableStack(ModItems.upgrade_afterburn_1, 1), new ComparableStack(ModItems.upgrade_speed_3, 2), new ComparableStack(ModItems.upgrade_effect_3, 2), new ComparableStack(ModItems.ingot_saturnite, 12), new ComparableStack(ModItems.powder_nitan_mix, 16), new ComparableStack(ModItems.crystal_starmetal, 6), new ComparableStack(ModItems.circuit_schrabidium, 6), },300); makeRecipe(new ComparableStack(ModItems.upgrade_overdrive_2, 1), new AStack[] {new ComparableStack(ModItems.upgrade_overdrive_1, 1), new ComparableStack(ModItems.upgrade_afterburn_1, 1), new ComparableStack(ModItems.upgrade_speed_3, 1), new ComparableStack(ModItems.upgrade_effect_3, 1), new ComparableStack(ModItems.crystal_lithium, 8), new ComparableStack(ModItems.circuit_tantalium, 16), }, 300);
makeRecipe(new ComparableStack(ModItems.upgrade_overdrive_3, 1), new AStack[] {new ComparableStack(ModItems.upgrade_overdrive_2, 1), new ComparableStack(ModItems.upgrade_afterburn_1, 1), new ComparableStack(ModItems.upgrade_speed_3, 2), new ComparableStack(ModItems.upgrade_effect_3, 2), new OreDictStack("ingotDesh", 8), new ComparableStack(ModItems.powder_power, 16), new ComparableStack(ModItems.crystal_lithium, 4), new ComparableStack(ModItems.circuit_schrabidium, 4), },500); makeRecipe(new ComparableStack(ModItems.upgrade_overdrive_3, 1), new AStack[] {new ComparableStack(ModItems.upgrade_overdrive_2, 1), new ComparableStack(ModItems.upgrade_afterburn_1, 1), new ComparableStack(ModItems.upgrade_speed_3, 1), new ComparableStack(ModItems.upgrade_effect_3, 1), new ComparableStack(ModItems.crystal_lithium, 16), new ComparableStack(ModItems.circuit_bismuth, 1), }, 500);
makeRecipe(new ComparableStack(ModItems.fuse, 1), new AStack[] {new OreDictStack("plateSteel", 2), new ComparableStack(Blocks.glass_pane, 1), new ComparableStack(ModItems.wire_aluminium, 1), },100); makeRecipe(new ComparableStack(ModItems.fuse, 1), new AStack[] {new OreDictStack("plateSteel", 2), new ComparableStack(Blocks.glass_pane, 1), new ComparableStack(ModItems.wire_aluminium, 1), },100);
makeRecipe(new ComparableStack(ModItems.redcoil_capacitor, 1), new AStack[] {new OreDictStack("plateGold", 3), new ComparableStack(ModItems.fuse, 1), new ComparableStack(ModItems.wire_advanced_alloy, 4), new ComparableStack(ModItems.coil_advanced_alloy, 6), new ComparableStack(Blocks.redstone_block, 2), },200); makeRecipe(new ComparableStack(ModItems.redcoil_capacitor, 1), new AStack[] {new OreDictStack("plateGold", 3), new ComparableStack(ModItems.fuse, 1), new ComparableStack(ModItems.wire_advanced_alloy, 4), new ComparableStack(ModItems.coil_advanced_alloy, 6), new ComparableStack(Blocks.redstone_block, 2), },200);
makeRecipe(new ComparableStack(ModItems.titanium_filter, 1), new AStack[] {new OreDictStack("plateLead", 3), new ComparableStack(ModItems.fuse, 1), new ComparableStack(ModItems.wire_tungsten, 4), new OreDictStack("plateTitanium", 6), new ComparableStack(ModItems.ingot_u238, 2), },200); makeRecipe(new ComparableStack(ModItems.titanium_filter, 1), new AStack[] {new OreDictStack("plateLead", 3), new ComparableStack(ModItems.fuse, 1), new ComparableStack(ModItems.wire_tungsten, 4), new OreDictStack("plateTitanium", 6), new ComparableStack(ModItems.ingot_u238, 2), },200);

View File

@ -278,6 +278,7 @@ public class OreDictManager {
OreDictionary.registerOre("blockZirconium", ModBlocks.block_zirconium); OreDictionary.registerOre("blockZirconium", ModBlocks.block_zirconium);
OreDictionary.registerOre("blockBoron", ModBlocks.block_boron); OreDictionary.registerOre("blockBoron", ModBlocks.block_boron);
OreDictionary.registerOre("blockColtan", ModBlocks.block_coltan); OreDictionary.registerOre("blockColtan", ModBlocks.block_coltan);
OreDictionary.registerOre("blockLithium", ModBlocks.block_lithium);
OreDictionary.registerOre("blockThorium", ModBlocks.block_thorium); OreDictionary.registerOre("blockThorium", ModBlocks.block_thorium);
OreDictionary.registerOre("blockThorium232", ModBlocks.block_thorium); OreDictionary.registerOre("blockThorium232", ModBlocks.block_thorium);

View File

@ -0,0 +1,50 @@
package com.hbm.inventory;
import java.util.HashMap;
import com.hbm.interfaces.Untested;
import com.hbm.items.machine.ItemMachineUpgrade;
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
import net.minecraft.item.ItemStack;
public class UpgradeManager {
private static HashMap<UpgradeType, Integer> upgrades = new HashMap();
private static UpgradeType mutexType = null;
@Untested
public static void eval(ItemStack[] slots, int start, int end) {
upgrades.clear();
for(int i = start; i <= end; i++) {
if(slots[i] != null && slots[i].getItem() instanceof ItemMachineUpgrade) {
ItemMachineUpgrade item = (ItemMachineUpgrade) slots[i].getItem();
if(item.type.mutex) {
if(mutexType == null || mutexType.ordinal() < item.type.ordinal()) {
mutexType = item.type;
}
} else {
Integer up = upgrades.get(item.type);
int upgrade = (up == null ? 0 : up);
upgrade += item.tier;
upgrades.put(item.type, upgrade);
}
}
}
}
public static int getLevel(UpgradeType type) {
Integer up = upgrades.get(type);
return up == null ? 0 : up;
}
public static UpgradeType getMinerMutex() {
return mutexType;
}
}

View File

@ -11,6 +11,7 @@ import com.hbm.items.armor.*;
import com.hbm.items.bomb.*; import com.hbm.items.bomb.*;
import com.hbm.items.food.*; import com.hbm.items.food.*;
import com.hbm.items.machine.*; import com.hbm.items.machine.*;
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
import com.hbm.items.machine.ItemRBMKRod.EnumBurnFunc; import com.hbm.items.machine.ItemRBMKRod.EnumBurnFunc;
import com.hbm.items.special.*; import com.hbm.items.special.*;
import com.hbm.items.tool.*; import com.hbm.items.tool.*;
@ -4346,33 +4347,33 @@ public class ModItems {
fusion_shield_chlorophyte = new ItemFusionShield(60 * 60 * 60 * 15, 9000).setUnlocalizedName("fusion_shield_chlorophyte").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":fusion_shield_chlorophyte"); fusion_shield_chlorophyte = new ItemFusionShield(60 * 60 * 60 * 15, 9000).setUnlocalizedName("fusion_shield_chlorophyte").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":fusion_shield_chlorophyte");
fusion_shield_vaporwave = new ItemFusionShield(60 * 60 * 60 * 10, 1916169).setUnlocalizedName("fusion_shield_vaporwave").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":fusion_shield_vaporwave"); fusion_shield_vaporwave = new ItemFusionShield(60 * 60 * 60 * 10, 1916169).setUnlocalizedName("fusion_shield_vaporwave").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":fusion_shield_vaporwave");
upgrade_template = new ItemCustomLore().setUnlocalizedName("upgrade_template").setMaxStackSize(1).setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":upgrade_template"); upgrade_template = new ItemCustomLore().setUnlocalizedName("upgrade_template").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":upgrade_template");
upgrade_speed_1 = new ItemMachineUpgrade().setUnlocalizedName("upgrade_speed_1").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_speed_1"); upgrade_speed_1 = new ItemMachineUpgrade(UpgradeType.SPEED, 1).setUnlocalizedName("upgrade_speed_1").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_speed_1");
upgrade_speed_2 = new ItemMachineUpgrade().setUnlocalizedName("upgrade_speed_2").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_speed_2"); upgrade_speed_2 = new ItemMachineUpgrade(UpgradeType.SPEED, 2).setUnlocalizedName("upgrade_speed_2").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_speed_2");
upgrade_speed_3 = new ItemMachineUpgrade().setUnlocalizedName("upgrade_speed_3").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_speed_3"); upgrade_speed_3 = new ItemMachineUpgrade(UpgradeType.SPEED, 3).setUnlocalizedName("upgrade_speed_3").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_speed_3");
upgrade_effect_1 = new ItemMachineUpgrade().setUnlocalizedName("upgrade_effect_1").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_effect_1"); upgrade_effect_1 = new ItemMachineUpgrade(UpgradeType.EFFECT, 1).setUnlocalizedName("upgrade_effect_1").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_effect_1");
upgrade_effect_2 = new ItemMachineUpgrade().setUnlocalizedName("upgrade_effect_2").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_effect_2"); upgrade_effect_2 = new ItemMachineUpgrade(UpgradeType.EFFECT, 2).setUnlocalizedName("upgrade_effect_2").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_effect_2");
upgrade_effect_3 = new ItemMachineUpgrade().setUnlocalizedName("upgrade_effect_3").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_effect_3"); upgrade_effect_3 = new ItemMachineUpgrade(UpgradeType.EFFECT, 3).setUnlocalizedName("upgrade_effect_3").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_effect_3");
upgrade_power_1 = new ItemMachineUpgrade().setUnlocalizedName("upgrade_power_1").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_power_1"); upgrade_power_1 = new ItemMachineUpgrade(UpgradeType.POWER, 1).setUnlocalizedName("upgrade_power_1").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_power_1");
upgrade_power_2 = new ItemMachineUpgrade().setUnlocalizedName("upgrade_power_2").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_power_2"); upgrade_power_2 = new ItemMachineUpgrade(UpgradeType.POWER, 2).setUnlocalizedName("upgrade_power_2").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_power_2");
upgrade_power_3 = new ItemMachineUpgrade().setUnlocalizedName("upgrade_power_3").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_power_3"); upgrade_power_3 = new ItemMachineUpgrade(UpgradeType.POWER, 3).setUnlocalizedName("upgrade_power_3").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_power_3");
upgrade_fortune_1 = new ItemMachineUpgrade().setUnlocalizedName("upgrade_fortune_1").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_fortune_1"); upgrade_fortune_1 = new ItemMachineUpgrade(UpgradeType.FORTUNE, 1).setUnlocalizedName("upgrade_fortune_1").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_fortune_1");
upgrade_fortune_2 = new ItemMachineUpgrade().setUnlocalizedName("upgrade_fortune_2").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_fortune_2"); upgrade_fortune_2 = new ItemMachineUpgrade(UpgradeType.FORTUNE, 2).setUnlocalizedName("upgrade_fortune_2").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_fortune_2");
upgrade_fortune_3 = new ItemMachineUpgrade().setUnlocalizedName("upgrade_fortune_3").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_fortune_3"); upgrade_fortune_3 = new ItemMachineUpgrade(UpgradeType.FORTUNE, 3).setUnlocalizedName("upgrade_fortune_3").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_fortune_3");
upgrade_afterburn_1 = new ItemMachineUpgrade().setUnlocalizedName("upgrade_afterburn_1").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_afterburn_1"); upgrade_afterburn_1 = new ItemMachineUpgrade(UpgradeType.AFTERBURN, 1).setUnlocalizedName("upgrade_afterburn_1").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_afterburn_1");
upgrade_afterburn_2 = new ItemMachineUpgrade().setUnlocalizedName("upgrade_afterburn_2").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_afterburn_2"); upgrade_afterburn_2 = new ItemMachineUpgrade(UpgradeType.AFTERBURN, 2).setUnlocalizedName("upgrade_afterburn_2").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_afterburn_2");
upgrade_afterburn_3 = new ItemMachineUpgrade().setUnlocalizedName("upgrade_afterburn_3").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_afterburn_3"); upgrade_afterburn_3 = new ItemMachineUpgrade(UpgradeType.AFTERBURN, 3).setUnlocalizedName("upgrade_afterburn_3").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_afterburn_3");
upgrade_overdrive_1 = new ItemMachineUpgrade().setUnlocalizedName("upgrade_overdrive_1").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_overdrive_1"); upgrade_overdrive_1 = new ItemMachineUpgrade(UpgradeType.OVERDRIVE, 1).setUnlocalizedName("upgrade_overdrive_1").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_overdrive_1");
upgrade_overdrive_2 = new ItemMachineUpgrade().setUnlocalizedName("upgrade_overdrive_2").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_overdrive_2"); upgrade_overdrive_2 = new ItemMachineUpgrade(UpgradeType.OVERDRIVE, 2).setUnlocalizedName("upgrade_overdrive_2").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_overdrive_2");
upgrade_overdrive_3 = new ItemMachineUpgrade().setUnlocalizedName("upgrade_overdrive_3").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_overdrive_3"); upgrade_overdrive_3 = new ItemMachineUpgrade(UpgradeType.OVERDRIVE, 3).setUnlocalizedName("upgrade_overdrive_3").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_overdrive_3");
upgrade_radius = new ItemMachineUpgrade().setUnlocalizedName("upgrade_radius").setMaxStackSize(16).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_radius"); upgrade_radius = new ItemMachineUpgrade().setUnlocalizedName("upgrade_radius").setMaxStackSize(16).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_radius");
upgrade_health = new ItemMachineUpgrade().setUnlocalizedName("upgrade_health").setMaxStackSize(16).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_health"); upgrade_health = new ItemMachineUpgrade().setUnlocalizedName("upgrade_health").setMaxStackSize(16).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_health");
upgrade_smelter = new ItemMachineUpgrade().setUnlocalizedName("upgrade_smelter").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_smelter"); upgrade_smelter = new ItemMachineUpgrade().setUnlocalizedName("upgrade_smelter").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_smelter");
upgrade_shredder = new ItemMachineUpgrade().setUnlocalizedName("upgrade_shredder").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_shredder"); upgrade_shredder = new ItemMachineUpgrade().setUnlocalizedName("upgrade_shredder").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_shredder");
upgrade_centrifuge = new ItemMachineUpgrade().setUnlocalizedName("upgrade_centrifuge").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_centrifuge"); upgrade_centrifuge = new ItemMachineUpgrade().setUnlocalizedName("upgrade_centrifuge").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_centrifuge");
upgrade_crystallizer = new ItemMachineUpgrade().setUnlocalizedName("upgrade_crystallizer").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_crystallizer"); upgrade_crystallizer = new ItemMachineUpgrade().setUnlocalizedName("upgrade_crystallizer").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_crystallizer");
upgrade_nullifier = new ItemMachineUpgrade().setUnlocalizedName("upgrade_nullifier").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_nullifier"); upgrade_nullifier = new ItemMachineUpgrade().setUnlocalizedName("upgrade_nullifier").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_nullifier");
upgrade_screm = new ItemMachineUpgrade().setUnlocalizedName("upgrade_screm").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_screm"); upgrade_screm = new ItemMachineUpgrade().setUnlocalizedName("upgrade_screm").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_screm");
wand = new ItemWand().setUnlocalizedName("wand_k").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setFull3D().setTextureName(RefStrings.MODID + ":wand"); wand = new ItemWand().setUnlocalizedName("wand_k").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setFull3D().setTextureName(RefStrings.MODID + ":wand");
wand_s = new ItemWandS().setUnlocalizedName("wand_s").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setFull3D().setTextureName(RefStrings.MODID + ":wand_s"); wand_s = new ItemWandS().setUnlocalizedName("wand_s").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setFull3D().setTextureName(RefStrings.MODID + ":wand_s");

View File

@ -10,172 +10,80 @@ import net.minecraft.item.ItemStack;
public class ItemMachineUpgrade extends Item { public class ItemMachineUpgrade extends Item {
public UpgradeType type;
public int tier = 0;
public ItemMachineUpgrade() {
this.setMaxStackSize(1);
this.type = UpgradeType.SPECIAL;
}
public ItemMachineUpgrade(UpgradeType type) {
this.setMaxStackSize(1);
this.type = type;
}
public ItemMachineUpgrade(UpgradeType type, int tier) {
this(type);
this.tier = tier;
}
@Override @Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) { public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
if(this == ModItems.upgrade_speed_1) if(this.type == UpgradeType.SPEED) {
{
list.add("Mining Drill:"); list.add("Mining Drill:");
list.add("Delay -15 / Consumption +300"); list.add("Delay -" + (15 * this.tier) + "% / Consumption +" + (300 * this.tier) + "HE/t");
list.add("");
list.add("Laser Miner:");
list.add("Delay ÷" + (1 + this.tier) + " / Consumption +" + (625 * this.tier) + "HE/t");
list.add(""); list.add("");
list.add("Assembly Machine:"); list.add("Assembly Machine:");
list.add("Delay -25 / Consumption +300"); list.add("Delay -" + (25 * this.tier) + "% / Consumption +" + (300 * this.tier) + "HE/t");
list.add(""); list.add("");
list.add("Chemical Plant:"); list.add("Chemical Plant:");
list.add("Delay -25 / Consumption +300"); list.add("Delay -" + (25 * this.tier) + "% / Consumption +" + (300 * this.tier) + "HE/t");
list.add(""); list.add("");
list.add("Crystallizer:"); list.add("Crystallizer:");
list.add("Delay -10% / Consumption +1000"); list.add("Delay -" + (20 * this.tier) + "% / Consumption +" + (1000 * this.tier) + "HE/t");
list.add(""); list.add("");
list.add("Cyclotron:"); list.add("Cyclotron:");
list.add("Speed x2"); list.add("Speed x" + (1 + this.tier));
list.add(""); list.add("");
list.add("Maxwell:"); list.add("Maxwell:");
list.add("Damage +0.25/t"); list.add("Damage +" + (0.25 * (double)this.tier) + "/t");
} }
if(this == ModItems.upgrade_speed_2) if(this.type == UpgradeType.EFFECT) {
{
list.add("Mining Drill:"); list.add("Mining Drill:");
list.add("Delay -30 / Consumption +600"); list.add("Radius +" + this.tier + "m / Consumption +" + (80 * this.tier) + "HE/t");
list.add("");
list.add("Assembly Machine:");
list.add("Delay -50 / Consumption +600");
list.add("");
list.add("Chemical Plant:");
list.add("Delay -50 / Consumption +600");
list.add(""); list.add("");
list.add("Crystallizer:"); list.add("Crystallizer:");
list.add("Delay -20% / Consumption +2000"); list.add("+" + (5 * this.tier) + "% chance of not consuming an item / Acid consumption +" + (1000 * this.tier) + "mB");
list.add(""); list.add("");
list.add("Cyclotron:"); list.add("Cyclotron:");
list.add("Speed x3"); list.add("-" + (100 - 100 / this.tier) + "% chance of incrementing overheat counter");
list.add(""); list.add("");
list.add("Maxwell:"); list.add("Maxwell:");
list.add("Damage +0.5/t"); list.add("Range +" + (3 * this.tier) + "m");
} }
if(this == ModItems.upgrade_speed_3) if(this.type == UpgradeType.POWER) {
{
list.add("Mining Drill:"); list.add("Mining Drill:");
list.add("Delay -45 / Consumption +900"); list.add("Consumption -" + (30 * this.tier) + "HE/t / Delay +" + (5 * this.tier) + "%");
list.add(""); list.add("");
list.add("Assembly Machine:"); list.add("Assembly Machine:");
list.add("Delay -75 / Consumption +900"); list.add("Consumption -" + (30 * this.tier) + "HE/t / Delay +" + (5 * this.tier) + "%");
list.add(""); list.add("");
list.add("Chemical Plant:"); list.add("Chemical Plant:");
list.add("Delay -75 / Consumption +900"); list.add("Consumption -" + (30 * this.tier) + "HE/t / Delay +" + (5 * this.tier) + "%");
list.add("");
list.add("Crystallizer");
list.add("Speed Delay -30% / Consumption +3000");
list.add("");
list.add("Cyclotron");
list.add("Speed x4");
list.add("");
list.add("Maxwell:");
list.add("Damage +0.75/t");
}
if(this == ModItems.upgrade_effect_1)
{
list.add("Mining Drill:");
list.add("Radius +1 / Consumption +80");
list.add("");
list.add("Crystallizer:");
list.add("+5% chance of not consuming an item / Acid consumption +1000mB");
list.add(""); list.add("");
list.add("Cyclotron:"); list.add("Cyclotron:");
list.add("-50% chance of incrementing overheat counter"); list.add("Consumption -" + (100 * this.tier) + "kHE/t");
list.add(""); list.add("");
list.add("Maxwell:"); list.add("Maxwell:");
list.add("Range +3m"); list.add("Consumption -" + (150 * this.tier) + "HE/t");
} list.add("Consumption when firing -" + (1500 * this.tier) + "HE/t");
if(this == ModItems.upgrade_effect_2)
{
list.add("Mining Drill:");
list.add("Radius +2 / Consumption +160");
list.add("");
list.add("Crystallizer:");
list.add("+10% chance of not consuming an item / Acid consumption +2000mB");
list.add("");
list.add("Cyclotron:");
list.add("-66% chance of incrementing overheat counter");
list.add("");
list.add("Maxwell:");
list.add("Range +6m");
}
if(this == ModItems.upgrade_effect_3)
{
list.add("Mining Drill:");
list.add("Radius +3 / Consumption +240");
list.add("");
list.add("Crystallizer:");
list.add("+15% chance of not consuming an item / Acid consumption +3000mB");
list.add("");
list.add("Cyclotron:");
list.add("-75% chance of incrementing overheat counter");
list.add("");
list.add("Maxwell:");
list.add("Range +9m");
}
if(this == ModItems.upgrade_power_1)
{
list.add("Mining Drill:");
list.add("Consumption -30 / Delay +5");
list.add("");
list.add("Assembly Machine:");
list.add("Consumption -30 / Delay +5");
list.add("");
list.add("Chemical Plant:");
list.add("Consumption -30 / Delay +5");
list.add("");
list.add("Cyclotron:");
list.add("Consumption -100k");
list.add("");
list.add("Maxwell:");
list.add("Consumption -150");
list.add("Consumption when firing -1500");
}
if(this == ModItems.upgrade_power_2)
{
list.add("Mining Drill:");
list.add("Consumption -60 / Delay +10");
list.add("");
list.add("Assembly Machine:");
list.add("Consumption -60 / Delay +10");
list.add("");
list.add("Chemical Plant:");
list.add("Consumption -60 / Delay +10");
list.add("");
list.add("Cyclotron:");
list.add("Consumption -200k");
list.add("");
list.add("Maxwell:");
list.add("Consumption -300");
list.add("Consumption when firing -3000");
}
if(this == ModItems.upgrade_power_3)
{
list.add("Mining Drill:");
list.add("Consumption -90 / Delay +15");
list.add("");
list.add("Assembly Machine:");
list.add("Consumption -90 / Delay +15");
list.add("");
list.add("Chemical Plant:");
list.add("Consumption -90 / Delay +15");
list.add("");
list.add("Cyclotron:");
list.add("Consumption -300k");
list.add("");
list.add("Maxwell:");
list.add("Consumption -450");
list.add("Consumption when firing -4500");
} }
if(this == ModItems.upgrade_fortune_1) if(this == ModItems.upgrade_fortune_1)
@ -239,44 +147,62 @@ public class ItemMachineUpgrade extends Item {
list.add("Stacks to 16"); list.add("Stacks to 16");
} }
if(this == ModItems.upgrade_smelter) if(this == ModItems.upgrade_smelter) {
{
list.add("Mining Laser Upgrade"); list.add("Mining Laser Upgrade");
list.add("Smelts blocks. Easy enough."); list.add("Smelts blocks. Easy enough.");
} }
if(this == ModItems.upgrade_shredder) if(this == ModItems.upgrade_shredder) {
{
list.add("Mining Laser Upgrade"); list.add("Mining Laser Upgrade");
list.add("Crunches ores"); list.add("Crunches ores");
} }
if(this == ModItems.upgrade_centrifuge) if(this == ModItems.upgrade_centrifuge) {
{
list.add("Mining Laser Upgrade"); list.add("Mining Laser Upgrade");
list.add("Hopefully self-explanatory"); list.add("Hopefully self-explanatory");
} }
if(this == ModItems.upgrade_crystallizer) if(this == ModItems.upgrade_crystallizer) {
{
list.add("Mining Laser Upgrade"); list.add("Mining Laser Upgrade");
list.add("Your new best friend"); list.add("Your new best friend");
} }
if(this == ModItems.upgrade_screm) if(this == ModItems.upgrade_screm) {
{
list.add("Mining Laser Upgrade"); list.add("Mining Laser Upgrade");
list.add("It's like in Super Mario where all blocks are"); list.add("It's like in Super Mario where all blocks are");
list.add("actually Toads, but here it's Half-Life scientists"); list.add("actually Toads, but here it's Half-Life scientists");
list.add("and they scream. A lot."); list.add("and they scream. A lot.");
} }
if(this == ModItems.upgrade_nullifier) if(this == ModItems.upgrade_nullifier) {
{
list.add("Mining Laser Upgrade"); list.add("Mining Laser Upgrade");
list.add("50% chance to override worthless items with /dev/zero"); list.add("50% chance to override worthless items with /dev/zero");
list.add("50% chance to move worthless items to /dev/null"); list.add("50% chance to move worthless items to /dev/null");
} }
} }
public static enum UpgradeType {
SPEED,
EFFECT,
POWER,
FORTUNE,
AFTERBURN,
OVERDRIVE,
SPECIAL,
LM_DESROYER,
LM_SCREM,
LM_SMELTER(true),
LM_SHREDDER(true),
LM_CENTRIFUGE(true),
LM_CRYSTALLIZER(true);
public boolean mutex = false;
private UpgradeType() { }
private UpgradeType(boolean mutex) {
this.mutex = mutex;
}
}
} }

View File

@ -8,8 +8,10 @@ import com.hbm.blocks.ModBlocks;
import com.hbm.interfaces.IConsumer; import com.hbm.interfaces.IConsumer;
import com.hbm.inventory.AssemblerRecipes; import com.hbm.inventory.AssemblerRecipes;
import com.hbm.inventory.RecipesCommon.AStack; import com.hbm.inventory.RecipesCommon.AStack;
import com.hbm.inventory.UpgradeManager;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemAssemblyTemplate; import com.hbm.items.machine.ItemAssemblyTemplate;
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
import com.hbm.lib.Library; import com.hbm.lib.Library;
import com.hbm.main.MainRegistry; import com.hbm.main.MainRegistry;
import com.hbm.packet.AuxElectricityPacket; import com.hbm.packet.AuxElectricityPacket;
@ -126,41 +128,18 @@ public class TileEntityMachineAssembler extends TileEntityMachineBase implements
this.consumption = 100; this.consumption = 100;
this.speed = 100; this.speed = 100;
for(int i = 1; i < 4; i++) { UpgradeManager.eval(slots, 1, 3);
ItemStack stack = slots[i];
if(stack != null) { int speedLevel = Math.min(UpgradeManager.getLevel(UpgradeType.SPEED), 3);
if(stack.getItem() == ModItems.upgrade_speed_1) { int powerLevel = Math.min(UpgradeManager.getLevel(UpgradeType.POWER), 3);
this.speed -= 25; int overLevel = UpgradeManager.getLevel(UpgradeType.OVERDRIVE);
this.consumption += 300;
}
if(stack.getItem() == ModItems.upgrade_speed_2) {
this.speed -= 50;
this.consumption += 600;
}
if(stack.getItem() == ModItems.upgrade_speed_3) {
this.speed -= 75;
this.consumption += 900;
}
if(stack.getItem() == ModItems.upgrade_power_1) {
this.consumption -= 30;
this.speed += 5;
}
if(stack.getItem() == ModItems.upgrade_power_2) {
this.consumption -= 60;
this.speed += 10;
}
if(stack.getItem() == ModItems.upgrade_power_3) {
this.consumption -= 90;
this.speed += 15;
}
}
}
if(speed < 25) speed -= speedLevel * 25;
speed = 25; consumption += speedLevel * 300;
if(consumption < 10) speed += powerLevel * 5;
consumption = 10; consumption -= powerLevel * 30;
speed /= (overLevel + 1);
consumption *= (overLevel + 1);
isProgressing = false; isProgressing = false;
power = Library.chargeTEFromItems(slots, 0, power, maxPower); power = Library.chargeTEFromItems(slots, 0, power, maxPower);

View File

@ -12,8 +12,10 @@ import com.hbm.interfaces.IFluidSource;
import com.hbm.inventory.FluidStack; import com.hbm.inventory.FluidStack;
import com.hbm.inventory.FluidTank; import com.hbm.inventory.FluidTank;
import com.hbm.inventory.MachineRecipes; import com.hbm.inventory.MachineRecipes;
import com.hbm.inventory.UpgradeManager;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemChemistryTemplate; import com.hbm.items.machine.ItemChemistryTemplate;
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
import com.hbm.lib.Library; import com.hbm.lib.Library;
import com.hbm.packet.AuxElectricityPacket; import com.hbm.packet.AuxElectricityPacket;
import com.hbm.packet.AuxParticlePacket; import com.hbm.packet.AuxParticlePacket;
@ -244,41 +246,18 @@ public class TileEntityMachineChemplant extends TileEntity implements ISidedInve
this.consumption = 100; this.consumption = 100;
this.speed = 100; this.speed = 100;
for(int i = 1; i < 4; i++) { UpgradeManager.eval(slots, 1, 3);
ItemStack stack = slots[i];
if(stack != null) { int speedLevel = Math.min(UpgradeManager.getLevel(UpgradeType.SPEED), 3);
if(stack.getItem() == ModItems.upgrade_speed_1) { int powerLevel = Math.min(UpgradeManager.getLevel(UpgradeType.POWER), 3);
this.speed -= 25; int overLevel = UpgradeManager.getLevel(UpgradeType.OVERDRIVE);
this.consumption += 300;
}
if(stack.getItem() == ModItems.upgrade_speed_2) {
this.speed -= 50;
this.consumption += 600;
}
if(stack.getItem() == ModItems.upgrade_speed_3) {
this.speed -= 75;
this.consumption += 900;
}
if(stack.getItem() == ModItems.upgrade_power_1) {
this.consumption -= 30;
this.speed += 5;
}
if(stack.getItem() == ModItems.upgrade_power_2) {
this.consumption -= 60;
this.speed += 10;
}
if(stack.getItem() == ModItems.upgrade_power_3) {
this.consumption -= 90;
this.speed += 15;
}
}
}
if(speed < 25) speed -= speedLevel * 25;
speed = 25; consumption += speedLevel * 300;
if(consumption < 10) speed += powerLevel * 5;
consumption = 10; consumption -= powerLevel * 30;
speed /= (overLevel + 1);
consumption *= (overLevel + 1);
if(!worldObj.isRemote) { if(!worldObj.isRemote) {

View File

@ -188,14 +188,14 @@ public class TileEntityMachineCrystallizer extends TileEntityMachineBase impleme
for(int i = 5; i <= 6; i++) { for(int i = 5; i <= 6; i++) {
if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_speed_1) if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_speed_1)
durationMod -= 0.1F; durationMod -= 0.25F;
if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_speed_2) if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_speed_2)
durationMod -= 0.2F; durationMod -= 0.50F;
if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_speed_3) if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_speed_3)
durationMod -= 0.3F; durationMod -= 0.75F;
} }
return (int) (duration * Math.max(durationMod, 0.7F)); return (int) (duration * Math.max(durationMod, 0.25F));
} }
public int getPowerRequired() { public int getPowerRequired() {
@ -222,11 +222,11 @@ public class TileEntityMachineCrystallizer extends TileEntityMachineBase impleme
for(int i = 5; i <= 6; i++) { for(int i = 5; i <= 6; i++) {
if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_overdrive_1) if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_overdrive_1)
cycles += 1;
if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_overdrive_2)
cycles += 2; cycles += 2;
if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_overdrive_2)
cycles += 4;
if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_overdrive_3) if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_overdrive_3)
cycles += 3; cycles += 6;
} }
return Math.min(cycles, 4); return Math.min(cycles, 4);

View File

@ -14,8 +14,10 @@ import com.hbm.inventory.CentrifugeRecipes;
import com.hbm.inventory.CrystallizerRecipes; import com.hbm.inventory.CrystallizerRecipes;
import com.hbm.inventory.FluidTank; import com.hbm.inventory.FluidTank;
import com.hbm.inventory.ShredderRecipes; import com.hbm.inventory.ShredderRecipes;
import com.hbm.inventory.UpgradeManager;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemMachineUpgrade; import com.hbm.items.machine.ItemMachineUpgrade;
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
import com.hbm.lib.Library; import com.hbm.lib.Library;
import com.hbm.tileentity.TileEntityMachineBase; import com.hbm.tileentity.TileEntityMachineBase;
import com.hbm.util.InventoryUtil; import com.hbm.util.InventoryUtil;
@ -100,11 +102,14 @@ public class TileEntityMachineMiningLaser extends TileEntityMachineBase implemen
if(isOn) { if(isOn) {
int cycles = getOverdrive(); UpgradeManager.eval(slots, 1, 8);
int speed = getSpeed(); int cycles = 1 + UpgradeManager.getLevel(UpgradeType.OVERDRIVE);
int range = getRange(); int speed = 1 + Math.min(UpgradeManager.getLevel(UpgradeType.SPEED), 12);
int fortune = getFortune(); int range = 1 + Math.min(UpgradeManager.getLevel(UpgradeType.EFFECT) * 2, 24);
int consumption = getConsumption() * speed; int fortune = Math.min(UpgradeManager.getLevel(UpgradeType.FORTUNE), 3);
int consumption = this.consumption
- (this.consumption * Math.min(UpgradeManager.getLevel(UpgradeType.POWER), 12) / 16)
+ (this.consumption * Math.min(UpgradeManager.getLevel(UpgradeType.SPEED), 12) / 16);
for(int i = 0; i < cycles; i++) { for(int i = 0; i < cycles; i++) {