Skip to content

Commit

Permalink
Updated TFC Dependency, also, fixed a bug in some interface changes (C…
Browse files Browse the repository at this point in the history
…loses #55).
  • Loading branch information
DisasterMoo committed May 12, 2020
1 parent 83a7c0c commit 24d298b
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 48 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main/java/tfctech/client/gui/GuiElectricForge.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, i
drawTexturedModalRect(guiLeft + 8, guiTop + 66 - temperaturePixels, 36, 54, 15, 5);

// Draw the energy bar
int energyPixels = 60 * tile.getField(1) / tile.getEnergyCapacity();
int energyPixels = Math.round(60 * tile.getField(1) / (float)tile.getEnergyCapacity());
int emptyPixels = 60 - energyPixels;
drawTexturedModalRect(guiLeft + 153, guiTop + 6, 0, 0, 18, emptyPixels);
drawTexturedModalRect(guiLeft + 153, guiTop + 6 + emptyPixels, 18, emptyPixels, 18, energyPixels);
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/tfctech/client/gui/GuiInductionCrucible.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package tfctech.client.gui;

import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;

import net.dries007.tfc.TerraFirmaCraft;
import net.dries007.tfc.client.gui.GuiCrucible;
import tfctech.client.TechGuiHandler;
import tfctech.objects.tileentities.TEInductionCrucible;
Expand All @@ -18,7 +21,6 @@ public GuiInductionCrucible(Container container, InventoryPlayer playerInv, TEIn
@Override
protected void renderHoveredToolTip(int mouseX, int mouseY)
{
super.renderHoveredToolTip(mouseX, mouseY);
if (mouseX >= guiLeft + 8 && mouseX <= guiLeft + 8 + 16 && mouseY >= guiTop + 79 && mouseY <= guiTop + 79 + 57)
{
int energy = tile.getField(1);
Expand All @@ -31,10 +33,10 @@ protected void renderHoveredToolTip(int mouseX, int mouseY)
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
{
super.drawGuiContainerBackgroundLayer(partialTicks, mouseX, mouseY);

GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
// Draw the energy bar
mc.getTextureManager().bindTexture(TechGuiHandler.GUI_ELEMENTS);
int energyPixels = 60 * tile.getField(1) / ((TEInductionCrucible) tile).getEnergyCapacity();
int energyPixels = Math.round(60 * tile.getField(1) / (float)((TEInductionCrucible) tile).getEnergyCapacity());
int emptyPixels = 60 - energyPixels;
drawTexturedModalRect(guiLeft + 7, guiTop + 78, 0, 0, 18, emptyPixels);
drawTexturedModalRect(guiLeft + 7, guiTop + 78 + emptyPixels, 18, emptyPixels, 18, energyPixels);
Expand Down
35 changes: 0 additions & 35 deletions src/main/java/tfctech/compat/waila/TOPPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,41 +59,6 @@ public void addProbeInfo(ProbeMode probeMode, IProbeInfo iProbeInfo, EntityPlaye
{
IProbeInfo horizontalPane = iProbeInfo.horizontal(iProbeInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER));
horizontalPane.text((new TextComponentTranslation("waila.tfctech.fridge.efficiency", (int) fridge.getEfficiency())).getFormattedText());
iProbeInfo.progress(fridge.getEnergyStored(), fridge.getEnergyCapacity(),
iProbeInfo.defaultProgressStyle()
.suffix("RF")
.filledColor(0xFF419099)
.alternateFilledColor(0xFF43748E)
.borderColor(0xFFFFFFFF)
.numberFormat(NumberFormat.COMPACT));
}
}
if (b instanceof BlockElectricForge)
{
TEElectricForge forge = Helpers.getTE(world, pos, TEElectricForge.class);
if (forge != null)
{
iProbeInfo.progress(forge.getEnergyStored(), forge.getEnergyCapacity(),
iProbeInfo.defaultProgressStyle()
.suffix("RF")
.filledColor(0xFF419099)
.alternateFilledColor(0xFF43748E)
.borderColor(0xFFFFFFFF)
.numberFormat(NumberFormat.COMPACT));
}
}
if (b instanceof BlockInductionCrucible)
{
TEInductionCrucible crucible = Helpers.getTE(world, pos, TEInductionCrucible.class);
if (crucible != null)
{
iProbeInfo.progress(crucible.getEnergyStored(), crucible.getEnergyCapacity(),
iProbeInfo.defaultProgressStyle()
.suffix("RF")
.filledColor(0xFF419099)
.alternateFilledColor(0xFF43748E)
.borderColor(0xFFFFFFFF)
.numberFormat(NumberFormat.COMPACT));
}
}
if (b instanceof BlockLatexExtractor)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void update()
if (targetTemperature > itemTemp && energyContainer.consumeEnergy(energy, false))
{
float heatSpeed = (float) TechConfig.DEVICES.electricForgeSpeed * 15.0F;
float temp = cap.getTemperature() + heatSpeed * cap.getHeatCapacity() * (float) ConfigTFC.GENERAL.temperatureModifierGlobal;
float temp = cap.getTemperature() + heatSpeed * cap.getHeatCapacity() * (float) ConfigTFC.Devices.TEMPERATURE.globalModifier;
cap.setTemperature(Math.min(temp, targetTemperature));
litTime = 15;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public void setField(int index, int value)
{
if (index == 0)
{
super.setField(index, value);
super.setField(0, value);
}
else if (index == 1)
{
Expand All @@ -229,7 +229,7 @@ public int getField(int index)
{
if (index == 0)
{
return super.getField(index);
return super.getField(0);
}
else if (index == 1)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ else if (temp <= 0 && state.getValue(LIT))
inventory.setStackInSlot(i, input.get(i));
}
tank.fillInternal(output, true);
temp -= ConfigTFC.GENERAL.temperatureModifierHeating * 150;
temp -= ConfigTFC.Devices.TEMPERATURE.heatingModifier * 150;
if (firebox != null)
{
firebox.setTemperature(temp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import net.dries007.tfc.api.capability.heat.CapabilityItemHeat;
import net.dries007.tfc.objects.te.ITileFields;
import net.dries007.tfc.objects.te.TEInventory;
import net.dries007.tfc.objects.te.TETickableInventory;
import net.dries007.tfc.util.calendar.CalendarTFC;
import net.dries007.tfc.util.calendar.ICalendarTickable;
import net.dries007.tfc.util.fuel.Fuel;
Expand All @@ -19,7 +20,7 @@

import static net.dries007.tfc.objects.blocks.property.ILightableBlock.LIT;

public class TESmelteryFirebox extends TEInventory implements ITickable, ICalendarTickable, ITileFields
public class TESmelteryFirebox extends TETickableInventory implements ITickable, ICalendarTickable, ITileFields
{
private float temperature;
private float burnTemperature;
Expand Down Expand Up @@ -76,7 +77,8 @@ public int getField(int index)
@Override
public void update()
{
ICalendarTickable.super.update();
super.update();
checkForCalendarUpdate();
if (!world.isRemote)
{
IBlockState state = world.getBlockState(pos);
Expand Down Expand Up @@ -112,7 +114,7 @@ public void update()
float targetTemperature = burnTemperature + airTicks;
if (temperature != targetTemperature)
{
float delta = (float) ConfigTFC.GENERAL.temperatureModifierHeating;
float delta = (float) ConfigTFC.Devices.TEMPERATURE.heatingModifier;
temperature = CapabilityItemHeat.adjustTempTowards(temperature, targetTemperature, delta * (airTicks > 0 ? 2 : 1));
}
}
Expand Down Expand Up @@ -153,14 +155,14 @@ public void onCalendarUpdate(long deltaPlayerTicks)
if (burnTicks > deltaPlayerTicks)
{
burnTicks -= deltaPlayerTicks;
float delta = (float) ConfigTFC.GENERAL.temperatureModifierHeating * deltaPlayerTicks;
float delta = (float) ConfigTFC.Devices.TEMPERATURE.heatingModifier * deltaPlayerTicks;
temperature = CapabilityItemHeat.adjustTempTowards(temperature, burnTemperature, delta, delta);
deltaPlayerTicks = 0;
}
else
{
deltaPlayerTicks -= burnTicks;
float delta = (float) ConfigTFC.GENERAL.temperatureModifierHeating * burnTicks;
float delta = (float) ConfigTFC.Devices.TEMPERATURE.heatingModifier * burnTicks;
temperature = CapabilityItemHeat.adjustTempTowards(temperature, burnTemperature, delta, delta);
consumeFuel();
}
Expand Down

0 comments on commit 24d298b

Please sign in to comment.