Skip to content

Commit

Permalink
Merge pull request #124 from Annijang/master
Browse files Browse the repository at this point in the history
Code duplication.
  • Loading branch information
CleverNucleus authored Jun 4, 2023
2 parents 57775bf + 9b4509d commit 0ee680d
Showing 1 changed file with 0 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
this.textRenderer.draw(matrices, Text.translatable("playerex.gui.page.combat.text.melee").formatted(Formatting.DARK_GRAY), (this.x + 21) / scaleX.get(), (this.y + 26) / scaleY.get(), 4210752);
this.textRenderer.draw(matrices, Text.translatable("playerex.gui.page.combat.text.defense").formatted(Formatting.DARK_GRAY), (this.x + 21) / scaleX.get(), (this.y + 92) / scaleY.get(), 4210752);
this.textRenderer.draw(matrices, Text.translatable("playerex.gui.page.combat.text.ranged").formatted(Formatting.DARK_GRAY), (this.x + 105) / scaleX.get(), (this.y + 26) / scaleY.get(), 4210752);
this.textRenderer.draw(matrices, (Text.translatable("playerex.gui.page.combat.text.melee")).formatted(Formatting.DARK_GRAY), (this.x + 21) / scaleX.get(), (this.y + 26) / scaleY.get(), 4210752);
this.textRenderer.draw(matrices, (Text.translatable("playerex.gui.page.combat.text.defense")).formatted(Formatting.DARK_GRAY), (this.x + 21) / scaleX.get(), (this.y + 92) / scaleY.get(), 4210752);
this.textRenderer.draw(matrices, (Text.translatable("playerex.gui.page.combat.text.ranged")).formatted(Formatting.DARK_GRAY), (this.x + 105) / scaleX.get(), (this.y + 26) / scaleY.get(), 4210752);

matrices.pop();

Expand Down Expand Up @@ -80,9 +77,6 @@ public void drawBackground(MatrixStack matrices, float delta, int mouseX, int mo
tooltip.add((Text.translatable("playerex.gui.page.combat.tooltip.attack_speed[0]")).formatted(Formatting.GRAY));
tooltip.add((Text.translatable("playerex.gui.page.combat.tooltip.attack_speed[1]")).formatted(Formatting.GRAY));

tooltip.add(Text.translatable("playerex.gui.page.combat.tooltip.attack_speed[0]").formatted(Formatting.GRAY));
tooltip.add(Text.translatable("playerex.gui.page.combat.tooltip.attack_speed[1]").formatted(Formatting.GRAY));

return tooltip;
}, 9, 37));
COMPONENTS.add(RenderComponent.of(() -> EntityAttributes.GENERIC_ATTACK_DAMAGE, value -> {
Expand All @@ -93,9 +87,6 @@ public void drawBackground(MatrixStack matrices, float delta, int mouseX, int mo
tooltip.add((Text.translatable("playerex.gui.page.combat.tooltip.attack_damage[0]")).formatted(Formatting.GRAY));
tooltip.add((Text.translatable("playerex.gui.page.combat.tooltip.attack_damage[1]")).formatted(Formatting.GRAY));

tooltip.add(Text.translatable("playerex.gui.page.combat.tooltip.attack_damage[0]").formatted(Formatting.GRAY));
tooltip.add(Text.translatable("playerex.gui.page.combat.tooltip.attack_damage[1]").formatted(Formatting.GRAY));

return tooltip;
}, 9, 48));
COMPONENTS.add(RenderComponent.of(ExAPI.MELEE_CRIT_DAMAGE, value -> {
Expand All @@ -107,9 +98,6 @@ public void drawBackground(MatrixStack matrices, float delta, int mouseX, int mo
tooltip.add((Text.translatable("playerex.gui.page.combat.tooltip.melee_crit_damage[0]")).formatted(Formatting.GRAY));
tooltip.add((Text.translatable("playerex.gui.page.combat.tooltip.melee_crit_damage[1]")).formatted(Formatting.GRAY));

tooltip.add(Text.translatable("playerex.gui.page.combat.tooltip.melee_crit_damage[0]").formatted(Formatting.GRAY));
tooltip.add(Text.translatable("playerex.gui.page.combat.tooltip.melee_crit_damage[1]").formatted(Formatting.GRAY));

return tooltip;
}, 9, 59));
COMPONENTS.add(RenderComponent.of(ExAPI.MELEE_CRIT_CHANCE, value -> {
Expand All @@ -121,9 +109,6 @@ public void drawBackground(MatrixStack matrices, float delta, int mouseX, int mo
tooltip.add((Text.translatable("playerex.gui.page.combat.tooltip.melee_crit_chance[0]")).formatted(Formatting.GRAY));
tooltip.add((Text.translatable("playerex.gui.page.combat.tooltip.melee_crit_chance[1]")).formatted(Formatting.GRAY));

tooltip.add(Text.translatable("playerex.gui.page.combat.tooltip.melee_crit_chance[0]").formatted(Formatting.GRAY));
tooltip.add(Text.translatable("playerex.gui.page.combat.tooltip.melee_crit_chance[1]").formatted(Formatting.GRAY));

return tooltip;
}, 9, 71));
COMPONENTS.add(RenderComponent.of(() -> EntityAttributes.GENERIC_ARMOR, value -> {
Expand All @@ -134,9 +119,6 @@ public void drawBackground(MatrixStack matrices, float delta, int mouseX, int mo
tooltip.add((Text.translatable("playerex.gui.page.combat.tooltip.armor[0]")).formatted(Formatting.GRAY));
tooltip.add((Text.translatable("playerex.gui.page.combat.tooltip.armor[1]")).formatted(Formatting.GRAY));

tooltip.add(Text.translatable("playerex.gui.page.combat.tooltip.armor[0]").formatted(Formatting.GRAY));
tooltip.add(Text.translatable("playerex.gui.page.combat.tooltip.armor[1]").formatted(Formatting.GRAY));

return tooltip;
}, 9, 103));
COMPONENTS.add(RenderComponent.of(() -> EntityAttributes.GENERIC_ARMOR_TOUGHNESS, value -> {
Expand All @@ -145,8 +127,6 @@ public void drawBackground(MatrixStack matrices, float delta, int mouseX, int mo
List<Text> tooltip = new ArrayList<Text>();
tooltip.add((Text.translatable("playerex.gui.page.combat.tooltip.armor_toughness[0]")).formatted(Formatting.GRAY));
tooltip.add((Text.translatable("playerex.gui.page.combat.tooltip.armor_toughness[1]")).formatted(Formatting.GRAY));
tooltip.add(Text.translatable("playerex.gui.page.combat.tooltip.armor_toughness[0]").formatted(Formatting.GRAY));
tooltip.add(Text.translatable("playerex.gui.page.combat.tooltip.armor_toughness[1]").formatted(Formatting.GRAY));

return tooltip;
}, 9, 114));
Expand All @@ -157,11 +137,8 @@ public void drawBackground(MatrixStack matrices, float delta, int mouseX, int mo
List<Text> tooltip = new ArrayList<Text>();
double disp = 100.0D * value;


tooltip.add((Text.translatable("playerex.gui.page.combat.tooltip.knockback_resistance", ClientUtil.FORMATTING_2.format(disp))).formatted(Formatting.GRAY));

tooltip.add(Text.translatable("playerex.gui.page.combat.tooltip.knockback_resistance", ClientUtil.FORMATTING_2.format(disp)).formatted(Formatting.GRAY));

return tooltip;
}, 9, 125));
COMPONENTS.add(RenderComponent.of(ExAPI.EVASION, value -> {
Expand All @@ -173,9 +150,6 @@ public void drawBackground(MatrixStack matrices, float delta, int mouseX, int mo
tooltip.add((Text.translatable("playerex.gui.page.combat.tooltip.evasion[0]")).formatted(Formatting.GRAY));
tooltip.add((Text.translatable("playerex.gui.page.combat.tooltip.evasion[1]")).formatted(Formatting.GRAY));

tooltip.add(Text.translatable("playerex.gui.page.combat.tooltip.evasion[0]").formatted(Formatting.GRAY));
tooltip.add(Text.translatable("playerex.gui.page.combat.tooltip.evasion[1]").formatted(Formatting.GRAY));

return tooltip;
}, 9, 136));
COMPONENTS.add(RenderComponent.of(ExAPI.RANGED_DAMAGE, value -> {
Expand All @@ -187,9 +161,6 @@ public void drawBackground(MatrixStack matrices, float delta, int mouseX, int mo
tooltip.add((Text.translatable("playerex.gui.page.combat.tooltip.ranged_damage[0]")).formatted(Formatting.GRAY));
tooltip.add((Text.translatable("playerex.gui.page.combat.tooltip.ranged_damage[1]")).formatted(Formatting.GRAY));

tooltip.add(Text.translatable("playerex.gui.page.combat.tooltip.ranged_damage[0]").formatted(Formatting.GRAY));
tooltip.add(Text.translatable("playerex.gui.page.combat.tooltip.ranged_damage[1]").formatted(Formatting.GRAY));

return tooltip;
}, 93, 37));
COMPONENTS.add(RenderComponent.of(ExAPI.RANGED_CRIT_DAMAGE, value -> {
Expand All @@ -201,9 +172,6 @@ public void drawBackground(MatrixStack matrices, float delta, int mouseX, int mo
tooltip.add((Text.translatable("playerex.gui.page.combat.tooltip.ranged_crit_damage[0]")).formatted(Formatting.GRAY));
tooltip.add((Text.translatable("playerex.gui.page.combat.tooltip.ranged_crit_damage[1]")).formatted(Formatting.GRAY));

tooltip.add(Text.translatable("playerex.gui.page.combat.tooltip.ranged_crit_damage[0]").formatted(Formatting.GRAY));
tooltip.add(Text.translatable("playerex.gui.page.combat.tooltip.ranged_crit_damage[1]").formatted(Formatting.GRAY));

return tooltip;
}, 93, 48));
COMPONENTS.add(RenderComponent.of(ExAPI.RANGED_CRIT_CHANCE, value -> {
Expand All @@ -215,9 +183,6 @@ public void drawBackground(MatrixStack matrices, float delta, int mouseX, int mo
tooltip.add((Text.translatable("playerex.gui.page.combat.tooltip.ranged_crit_chance[0]")).formatted(Formatting.GRAY));
tooltip.add((Text.translatable("playerex.gui.page.combat.tooltip.ranged_crit_chance[1]")).formatted(Formatting.GRAY));

tooltip.add(Text.translatable("playerex.gui.page.combat.tooltip.ranged_crit_chance[0]").formatted(Formatting.GRAY));
tooltip.add(Text.translatable("playerex.gui.page.combat.tooltip.ranged_crit_chance[1]").formatted(Formatting.GRAY));

return tooltip;
}, 93, 59));
COMPONENTS.add(RenderComponent.of(ExAPI.ATTACK_RANGE, value -> {
Expand All @@ -227,8 +192,6 @@ public void drawBackground(MatrixStack matrices, float delta, int mouseX, int mo

tooltip.add((Text.translatable("playerex.gui.page.combat.tooltip.attack_range", ClientUtil.FORMATTING_2.format(3.0F + value))).formatted(Formatting.GRAY));

tooltip.add(Text.translatable("playerex.gui.page.combat.tooltip.attack_range", ClientUtil.FORMATTING_2.format(3.0F + value)).formatted(Formatting.GRAY));

return tooltip;
}, 105, 81));
COMPONENTS.add(RenderComponent.of(ExAPI.LIFESTEAL, value -> {
Expand All @@ -240,9 +203,6 @@ public void drawBackground(MatrixStack matrices, float delta, int mouseX, int mo
tooltip.add((Text.translatable("playerex.gui.page.combat.tooltip.lifesteal[0]")).formatted(Formatting.GRAY));
tooltip.add((Text.translatable("playerex.gui.page.combat.tooltip.lifesteal[1]")).formatted(Formatting.GRAY));

tooltip.add(Text.translatable("playerex.gui.page.combat.tooltip.lifesteal[0]").formatted(Formatting.GRAY));
tooltip.add(Text.translatable("playerex.gui.page.combat.tooltip.lifesteal[1]").formatted(Formatting.GRAY));

return tooltip;
}, 105, 92));
}
Expand Down

0 comments on commit 0ee680d

Please sign in to comment.