Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/main/java/tconstruct/client/TProxyClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import tconstruct.armor.ArmorProxyClient;
import tconstruct.armor.player.TPlayerStats;
import tconstruct.common.TProxyCommon;
import tconstruct.library.util.LocalizedColors;
import tconstruct.tools.items.ManualInfo;

public class TProxyClient extends TProxyCommon {
Expand All @@ -39,7 +38,6 @@ public class TProxyClient extends TProxyCommon {
public void initialize() {
registerRenderer();
readManuals();
LocalizedColors.reload();
}

/* Registers any rendering code. */
Expand Down
28 changes: 28 additions & 0 deletions src/main/java/tconstruct/library/util/ColorUtils.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package tconstruct.library.util;

import com.gtnewhorizon.gtnhlib.color.ColorResource;

public class ColorUtils {

private static final ColorResource.Factory color = new ColorResource.Factory("tinker");

public static final ColorResource
// spotless:off
materialName = color.rgb("materialName", "0x404040"),
materialDurability = color.rgb("materialDurability", "0x404040"),
materialHandleModifier1 = color.rgb("materialHandleModifier1", "0x404040"),
materialHandleModifier2 = color.rgb("materialHandleModifier2", "0x404040"),
materialMiningSpeed = color.rgb("materialMiningSpeed", "0x404040"),
materialHarvestLevel = color.rgb("materialHarvestLevel", "0x404040"),
materialAttack1 = color.rgb("materialAttack1", "0x404040"),
materialAttack2 = color.rgb("materialAttack2", "0x404040"),
materialReinforced = color.rgb("materialReinforced", "0x404040"),
materialStonebound = color.rgb("materialStonebound", "0x404040"),
materialAbility = color.rgb("materialAbility", "0x404040"),
materialBow = color.rgb("materialBow", "0x404040"),
materialBowDrawSpeed = color.rgb("materialBowDrawSpeed", "0x404040"),
materialBowFlightSpeedMax = color.rgb("materialBowFlightSpeedMax", "0x404040"),
materialArrowMass = color.rgb("materialArrowMass", "0x404040"),
materialArrowBreakChance = color.rgb("materialArrowBreakChance", "0x404040");
// spotless:on
}
63 changes: 0 additions & 63 deletions src/main/java/tconstruct/library/util/LocalizedColors.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,14 @@
import tconstruct.library.tools.BowMaterial;
import tconstruct.library.tools.DynamicToolPart;
import tconstruct.library.tools.ToolMaterial;
import tconstruct.library.util.ColorUtils;
import tconstruct.library.util.HarvestLevels;
import tconstruct.library.util.IToolPart;
import tconstruct.library.util.LocalizedColors;
import tconstruct.tools.items.ToolPart;
import tconstruct.util.config.PHConstruct;

public class RecipeHandlerToolMaterials extends RecipeHandlerBase {

private static final int DefaultTextColor = 0x404040;

public class CachedToolMaterialsRecipe extends CachedBaseRecipe {

public List<PositionedStack> toolParts;
Expand Down Expand Up @@ -106,39 +104,39 @@ public void drawExtras(int recipe) {
EnumChatFormatting.BOLD + crecipe.material.localizedName(),
35,
10,
LocalizedColors.MATERIAL_NAME,
ColorUtils.materialName.getColor(),
false);
GuiDraw.drawString(
StatCollector.translateToLocal("gui.partcrafter4") + crecipe.material.durability,
35,
20,
LocalizedColors.MATERIAL_DURABILITY,
ColorUtils.materialDurability.getColor(),
false);
GuiDraw.drawString(
StatCollector.translateToLocal("gui.partcrafter5") + crecipe.material.handleModifier + "x",
35,
30,
LocalizedColors.MATERIAL_HANDLE_MODIFIER1,
ColorUtils.materialHandleModifier1.getColor(),
false);
GuiDraw.drawString(
StatCollector.translateToLocal("gui.partcrafter11")
+ Math.round(crecipe.material.durability * crecipe.material.handleModifier),
35,
40,
LocalizedColors.MATERIAL_HANDLE_MODIFIER2,
ColorUtils.materialHandleModifier2.getColor(),
false);
GuiDraw.drawString(
StatCollector.translateToLocal("gui.partcrafter6") + crecipe.material.miningspeed / 100F,
35,
50,
LocalizedColors.MATERIAL_MINING_SPEED,
ColorUtils.materialMiningSpeed.getColor(),
false);
GuiDraw.drawString(
StatCollector.translateToLocal("gui.partcrafter7")
+ HarvestLevels.getHarvestLevelName(crecipe.material.harvestLevel),
35,
60,
LocalizedColors.MATERIAL_HARVEST_LEVEL,
ColorUtils.materialHarvestLevel.getColor(),
false);
String heart = crecipe.material.attack == 2 ? StatCollector.translateToLocal("gui.partcrafter8")
: StatCollector.translateToLocal("gui.partcrafter9");
Expand All @@ -147,14 +145,14 @@ public void drawExtras(int recipe) {
StatCollector.translateToLocal("gui.partcrafter10") + crecipe.material.attack / 2 + heart,
35,
70,
LocalizedColors.MATERIAL_ATTACK1,
ColorUtils.materialAttack1.getColor(),
false);
} else {
GuiDraw.drawString(
StatCollector.translateToLocal("gui.partcrafter10") + crecipe.material.attack / 2F + heart,
35,
70,
LocalizedColors.MATERIAL_ATTACK2,
ColorUtils.materialAttack2.getColor(),
false);
}
int abilityY = 85;
Expand All @@ -163,7 +161,7 @@ public void drawExtras(int recipe) {
getReinforcedString(crecipe.material.reinforced),
35,
85,
LocalizedColors.MATERIAL_REINFORCED,
ColorUtils.materialReinforced.getColor(),
false);
abilityY += 10;
}
Expand All @@ -174,10 +172,10 @@ public void drawExtras(int recipe) {
ability + " (" + Math.abs(crecipe.material.stonebound) + ")",
35,
abilityY,
LocalizedColors.MATERIAL_STONEBOUND,
ColorUtils.materialStonebound.getColor(),
false);
} else {
GuiDraw.drawString(ability, 35, abilityY, LocalizedColors.MATERIAL_ABILITY, false);
GuiDraw.drawString(ability, 35, abilityY, ColorUtils.materialAbility.getColor(), false);
}
}
}
Expand All @@ -188,20 +186,20 @@ public void drawExtras(int recipe) {
EnumChatFormatting.BOLD + StatCollector.translateToLocal("tconstruct.nei.projectilematerials"),
35,
10,
LocalizedColors.MATERIAL_BOW,
ColorUtils.materialBow.getColor(),
false);
GuiDraw.drawString(
StatCollector.translateToLocal("gui.toolstation6") + crecipe.bowMaterial.drawspeed,
x,
y,
LocalizedColors.MATERIAL_BOW_DRAW_SPEED,
ColorUtils.materialBowDrawSpeed.getColor(),
false);
y += 10;
GuiDraw.drawString(
StatCollector.translateToLocal("gui.toolstation7") + crecipe.bowMaterial.flightSpeedMax,
x,
y,
LocalizedColors.MATERIAL_BOW_FLIGHT_SPEED_MAX,
ColorUtils.materialBowFlightSpeedMax.getColor(),
false);
}
if (crecipe.arrowMaterial != null) {
Expand All @@ -211,14 +209,14 @@ public void drawExtras(int recipe) {
StatCollector.translateToLocal("gui.toolstation8") + crecipe.arrowMaterial.mass,
x,
y,
LocalizedColors.MATERIAL_ARROW_MASS,
ColorUtils.materialArrowMass.getColor(),
false);
y += 10;
GuiDraw.drawString(
StatCollector.translateToLocal("gui.toolstation22") + crecipe.arrowMaterial.breakChance,
x,
y,
LocalizedColors.MATERIAL_ARROW_BREAK_CHANCE,
ColorUtils.materialArrowBreakChance.getColor(),
false);
}
}
Expand Down
Loading