Started redoing config

This commit is contained in:
Prospector 2017-06-08 11:45:30 -07:00
parent 2eac072a92
commit ad36dfcddb
7 changed files with 116 additions and 83 deletions

View file

@ -67,7 +67,7 @@ public class Reference {
return ArmorMaterial.LEATHER;
}
public static String alloySmelteRecipe = I18n.translateToLocal("techreborn.recipe.alloysmelter");
public static String alloySmelterRecipe = I18n.translateToLocal("techreborn.recipe.alloysmelter");
public static String assemblingMachineRecipe = I18n.translateToLocal("techreborn.recipe.assemblingmachine");
public static String blastFurnaceRecipe = I18n.translateToLocal("techreborn.recipe.blastfurnace");
public static String centrifugeRecipe = I18n.translateToLocal("techreborn.recipe.centrifuge");

View file

@ -31,7 +31,7 @@ import techreborn.api.recipe.BaseRecipe;
public class AlloySmelterRecipe extends BaseRecipe {
public AlloySmelterRecipe(ItemStack input1, ItemStack input2, ItemStack output1, int tickTime, int euPerTick) {
super(Reference.alloySmelteRecipe, tickTime, euPerTick);
super(Reference.alloySmelterRecipe, tickTime, euPerTick);
if (input1 != null)
addInput(input1);
if (input2 != null)

View file

@ -61,6 +61,6 @@ public class CTAlloySmelter extends CTGeneric {
}
public static String getMachineName() {
return Reference.alloySmelteRecipe;
return Reference.alloySmelterRecipe;
}
}

View file

@ -31,14 +31,27 @@ import net.minecraft.util.EnumFacing;
import reborncore.api.power.EnumPowerTier;
import reborncore.common.IWrenchable;
import reborncore.common.powerSystem.TilePowerAcceptor;
import reborncore.common.registration.RebornRegistry;
import reborncore.common.registration.impl.ConfigRegistry;
import reborncore.common.util.Inventory;
import techreborn.config.ConfigTechReborn;
import techreborn.init.ModBlocks;
import techreborn.lib.ModInfo;
@RebornRegistry(modID = ModInfo.MOD_ID)
public class TileAesu extends TilePowerAcceptor implements IWrenchable {
public static final int MAX_OUTPUT = ConfigTechReborn.AesuMaxOutput;
public static final int MAX_STORAGE = ConfigTechReborn.AesuMaxStorage;
@ConfigRegistry(config = "machines", category = "aesu", key = "AesuMaxInput", comment = "AESU Max Input (Value in EU)")
public static int MAX_INPUT = 8192;
@ConfigRegistry(config = "machines", category = "aesu", key = "AesuMaxOutput", comment = "AESU Max Output (Value in EU)")
public static int MAX_OUTPUT = 8192;
@ConfigRegistry(config = "machines", category = "aesu", key = "AesuMaxStorage", comment = "AESU Max Storage (Value in EU)")
public static int MAX_STORAGE = 100000000;
@ConfigRegistry(config = "machines", category = "aesu", key = "AesuTier", comment = "AESU Tier")
public static int TIER = 5;
// @ConfigRegistry(config = "machines", category = "aesu", key = "AesuWrenchDropRate", comment = "AESU Wrench Drop Rate")
public static float WRENCH_DROP_RATE = 1.0F;
public Inventory inventory = new Inventory(4, "TileAesu", 64, this);
private int OUTPUT = 64; // The current output
private double euLastTick = 0;
@ -46,7 +59,7 @@ public class TileAesu extends TilePowerAcceptor implements IWrenchable {
private int ticks;
public TileAesu() {
super(5);
super(TIER);
}
@Override
@ -84,7 +97,7 @@ public class TileAesu extends TilePowerAcceptor implements IWrenchable {
@Override
public float getWrenchDropRate() {
return 1.0F;
return WRENCH_DROP_RATE;
}
@Override
@ -152,7 +165,7 @@ public class TileAesu extends TilePowerAcceptor implements IWrenchable {
@Override
public double getBaseMaxPower() {
return TileAesu.MAX_STORAGE;
return MAX_STORAGE;
}
@Override
@ -172,11 +185,11 @@ public class TileAesu extends TilePowerAcceptor implements IWrenchable {
@Override
public double getBaseMaxInput() {
return 4096 * 2;
return MAX_INPUT;
}
@Override
public EnumPowerTier getBaseTier() {
return EnumPowerTier.EXTREME;
return EnumPowerTier.INSANE;
}
}

View file

@ -32,26 +32,31 @@ import net.minecraft.init.Items;
import net.minecraft.item.*;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.fml.common.registry.GameRegistry;
import reborncore.api.recipe.IBaseRecipeType;
import reborncore.api.recipe.RecipeHandler;
import reborncore.api.tile.IInventoryProvider;
import reborncore.common.IWrenchable;
import reborncore.common.recipes.RecipeTranslator;
import reborncore.common.registration.RebornRegistry;
import reborncore.common.registration.impl.ConfigRegistry;
import reborncore.common.tile.TileLegacyMachineBase;
import reborncore.common.util.Inventory;
import reborncore.common.util.ItemUtils;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.AlloySmelterRecipe;
import techreborn.client.container.IContainerProvider;
import techreborn.client.container.builder.BuiltContainer;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.init.ModBlocks;
import techreborn.lib.ModInfo;
@RebornRegistry(modID = ModInfo.MOD_ID)
public class TileAlloyFurnace extends TileLegacyMachineBase
implements IWrenchable, IInventoryProvider, IContainerProvider {
// @ConfigRegistry(config = "machines", category = "alloy_furnace", key = "AlloyFurnaceWrenchDropRate", comment = "Alloy Furnace Wrench Drop Rate")
public static float WRENCH_DROP_RATE = 1.0F;
public int tickTime;
public Inventory inventory = new Inventory(4, "TileAlloyFurnace", 64, this);
public int burnTime;
@ -180,7 +185,7 @@ implements IWrenchable, IInventoryProvider, IContainerProvider {
return false;
} else {
ItemStack itemstack = null;
for (final IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.alloySmelteRecipe)) {
for (final IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.alloySmelterRecipe)) {
if (this.hasAllInputs(recipeType)) {
itemstack = recipeType.getOutput(0);
break;
@ -212,7 +217,7 @@ implements IWrenchable, IInventoryProvider, IContainerProvider {
public void smeltItem() {
if (this.canSmelt()) {
ItemStack itemstack = ItemStack.EMPTY;
for (final IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.alloySmelteRecipe)) {
for (final IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.alloySmelterRecipe)) {
if (this.hasAllInputs(recipeType)) {
itemstack = recipeType.getOutput(0);
break;
@ -228,7 +233,7 @@ implements IWrenchable, IInventoryProvider, IContainerProvider {
this.decrStackSize(this.output, -itemstack.getCount());
}
for (final IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.alloySmelteRecipe)) {
for (final IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.alloySmelterRecipe)) {
boolean hasAllRecipes = true;
if (this.hasAllInputs(recipeType)) {
@ -292,7 +297,7 @@ implements IWrenchable, IInventoryProvider, IContainerProvider {
@Override
public float getWrenchDropRate() {
return 1.0F;
return WRENCH_DROP_RATE;
}
@Override
@ -324,33 +329,27 @@ implements IWrenchable, IInventoryProvider, IContainerProvider {
return index == 2;
}
public int getBurnTime()
{
public int getBurnTime() {
return this.burnTime;
}
public void setBurnTime(final int burnTime)
{
public void setBurnTime(final int burnTime) {
this.burnTime = burnTime;
}
public int getCurrentItemBurnTime()
{
public int getCurrentItemBurnTime() {
return this.currentItemBurnTime;
}
public void setCurrentItemBurnTime(final int currentItemBurnTime)
{
public void setCurrentItemBurnTime(final int currentItemBurnTime) {
this.currentItemBurnTime = currentItemBurnTime;
}
public int getCookTime()
{
public int getCookTime() {
return this.cookTime;
}
public void setCookTime(final int cookTime)
{
public void setCookTime(final int cookTime) {
this.cookTime = cookTime;
}

View file

@ -29,7 +29,6 @@ import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import reborncore.api.power.EnumPowerTier;
import reborncore.api.recipe.IRecipeCrafterProvider;
import reborncore.api.recipe.RecipeHandler;
@ -37,33 +36,44 @@ import reborncore.api.tile.IInventoryProvider;
import reborncore.common.IWrenchable;
import reborncore.common.powerSystem.TilePowerAcceptor;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.registration.RebornRegistry;
import reborncore.common.registration.impl.ConfigRegistry;
import reborncore.common.util.Inventory;
import reborncore.common.util.ItemUtils;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.AlloySmelterRecipe;
import techreborn.client.container.IContainerProvider;
import techreborn.client.container.builder.BuiltContainer;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.init.ModBlocks;
import techreborn.lib.ModInfo;
@RebornRegistry(modID = ModInfo.MOD_ID)
public class TileAlloySmelter extends TilePowerAcceptor
implements IWrenchable, IInventoryProvider, ISidedInventory, IRecipeCrafterProvider, IContainerProvider {
@ConfigRegistry(config = "machines", category = "alloy_smelter", key = "AlloySmelterMaxInput", comment = "Alloy Smelter Max Input (Value in EU)")
public static int MAX_INPUT = 32;
@ConfigRegistry(config = "machines", category = "alloy_smelter", key = "AlloySmelterMaxStorage", comment = "Alloy Smelter Max Storage (Value in EU)")
public static int MAX_STORAGE = 1000;
@ConfigRegistry(config = "machines", category = "alloy_smelter", key = "AlloySmelterTier", comment = "Alloy Smelter Tier")
public static int TIER = 1;
// @ConfigRegistry(config = "machines", category = "alloy_smelter", key = "AlloySmelterWrenchDropRate", comment = "Alloy Smelter Wrench Drop Rate")
public static float WRENCH_DROP_RATE = 1.0F;
public int tickTime;
public Inventory inventory = new Inventory(8, "TileAlloySmelter", 64, this);
public RecipeCrafter crafter;
public int capacity = 1000;
public TileAlloySmelter() {
super(1);
super(TIER);
// Input slots
final int[] inputs = new int[2];
inputs[0] = 0;
inputs[1] = 1;
final int[] outputs = new int[1];
outputs[0] = 2;
this.crafter = new RecipeCrafter(Reference.alloySmelteRecipe, this, 2, 1, this.inventory, inputs, outputs);
this.crafter = new RecipeCrafter(Reference.alloySmelterRecipe, this, 2, 1, this.inventory, inputs, outputs);
}
@Override
@ -153,7 +163,7 @@ public class TileAlloySmelter extends TilePowerAcceptor
@Override
public double getBaseMaxPower() {
return this.capacity;
return MAX_STORAGE;
}
@Override
@ -173,7 +183,7 @@ public class TileAlloySmelter extends TilePowerAcceptor
@Override
public double getBaseMaxInput() {
return 32;
return MAX_INPUT;
}
@Override

View file

@ -28,30 +28,41 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import reborncore.api.power.EnumPowerTier;
import reborncore.api.recipe.IRecipeCrafterProvider;
import reborncore.api.tile.IInventoryProvider;
import reborncore.common.IWrenchable;
import reborncore.common.powerSystem.TilePowerAcceptor;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.registration.RebornRegistry;
import reborncore.common.registration.impl.ConfigRegistry;
import reborncore.common.util.Inventory;
import techreborn.api.Reference;
import techreborn.client.container.IContainerProvider;
import techreborn.client.container.builder.BuiltContainer;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.init.ModBlocks;
import techreborn.lib.ModInfo;
@RebornRegistry(modID = ModInfo.MOD_ID)
public class TileAssemblingMachine extends TilePowerAcceptor
implements IWrenchable, ISidedInventory, IInventoryProvider, IRecipeCrafterProvider, IContainerProvider {
@ConfigRegistry(config = "machines", category = "assembling_machine", key = "AssemblingMachineMaxInput", comment = "Assembling Machine Max Input (Value in EU)")
public static int MAX_INPUT = 128;
@ConfigRegistry(config = "machines", category = "assembling_machine", key = "AssemblingMachineMaxStorage", comment = "Assembling Machine Max Storage (Value in EU)")
public static int MAX_STORAGE = 10000;
@ConfigRegistry(config = "machines", category = "assembling_machine", key = "AssemblingMachineTier", comment = "Assembling Machine Tier")
public static int TIER = 2;
// @ConfigRegistry(config = "machines", category = "assembling_machine", key = "AssemblingMachineWrenchDropRate", comment = "Assembling Machine Wrench Drop Rate")
public static float WRENCH_DROP_RATE = 1.0F;
public int tickTime;
public Inventory inventory = new Inventory(8, "TileAssemblingMachine", 64, this);
public RecipeCrafter crafter;
public TileAssemblingMachine() {
super(2);
super(TIER);
// Input slots
final int[] inputs = new int[2];
inputs[0] = 0;
@ -84,7 +95,7 @@ implements IWrenchable, ISidedInventory, IInventoryProvider, IRecipeCrafterProvi
@Override
public float getWrenchDropRate() {
return 1.0F;
return WRENCH_DROP_RATE;
}
@Override
@ -115,7 +126,7 @@ implements IWrenchable, ISidedInventory, IInventoryProvider, IRecipeCrafterProvi
@Override
public double getBaseMaxPower() {
return 10000;
return MAX_STORAGE;
}
@Override
@ -135,7 +146,7 @@ implements IWrenchable, ISidedInventory, IInventoryProvider, IRecipeCrafterProvi
@Override
public double getBaseMaxInput() {
return 128;
return MAX_INPUT;
}
@Override