public override void Update() { if (fuel == null) { fuel = new FuelCore(maxFuel); } if (currentRecipe == null && checkTimer <= 0) { FurnaceRecipe recipe = inputItem.IsAir ? null : FurnaceRecipeManager.Instance.IsValid(inputItem) ? FurnaceRecipeManager.Instance.Recipe : null; if (recipe != null && (outputItem.IsAir || outputItem.type == recipe.GetResult().type)) { currentRecipe = recipe; } checkTimer = 2; } if (currentRecipe != null) { UpdateItem(); progression++; } checkTimer--; }
public FuelSlot(Ref <Item> boundSlot, Texture2D slotTexture, FuelCore energyCore) : base(boundSlot, slotTexture) { this._energyCore = energyCore; CalculatedStyle s = GetInnerDimensions(); currentSlotVector = new Vector2(s.X, s.Y); }
public BaseFurnaceEntity() { SetValue(ref maxFuel, ref cookTimer, ref furnaceName); _inputItem = new Ref <Item>(new Item()); _outputItem = new Ref <Item>(new Item()); _fuelItem = new Ref <Item>(new Item()); inputItem.TurnToAir(); outputItem.TurnToAir(); fuelItem.TurnToAir(); fuel = new FuelCore(maxFuel); }
public FurnaceUI(Ref <Item> input, Ref <Item> output, Ref <Item> fuel, FuelCore energyCore, string furnaceName) { this._input = new InputOutputSlot(input, Main.inventoryBack10Texture); this._output = new InputOutputSlot(output, Main.inventoryBack10Texture); if (energyCore != null) { _energyBar = new UIEnergyBar(energyCore); } this._fuel = new FuelSlot(fuel, Main.inventoryBack10Texture, energyCore); this._furnaceName = furnaceName; }
public sealed override void Load(TagCompound tag) { SetValue(ref maxFuel, ref cookTimer, ref furnaceName); maxFuel = 50000; fuel = new FuelCore(maxFuel); Item temporaryInputItem = tag.Get <Item>("inputSlot"); Item temporaryOutputItem = tag.Get <Item>("outputSlot"); Item temporaryFuelItem = tag.Get <Item>("fuelSlot"); SetAir(ref temporaryInputItem); SetAir(ref temporaryOutputItem); SetAir(ref temporaryFuelItem); _inputItem.Value = temporaryInputItem; _outputItem.Value = temporaryOutputItem; _fuelItem.Value = temporaryFuelItem; }