diff --git a/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/api/client/gui/stats/widget/ItemStatWidget.java b/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/api/client/gui/stats/widget/ItemStatWidget.java index e93c2335..5a2b783b 100644 --- a/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/api/client/gui/stats/widget/ItemStatWidget.java +++ b/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/api/client/gui/stats/widget/ItemStatWidget.java @@ -2,11 +2,11 @@ import static io.github.thecsdev.tcdcommons.api.util.TextUtils.fLiteral; import static io.github.thecsdev.tcdcommons.api.util.TextUtils.literal; -import static io.github.thecsdev.tcdcommons.api.util.TextUtils.translatable; import org.jetbrains.annotations.Nullable; import io.github.thecsdev.betterstats.api.registry.BSRegistries; +import io.github.thecsdev.betterstats.api.util.enumerations.ItemStatType; import io.github.thecsdev.betterstats.api.util.stats.SUItemStat; import io.github.thecsdev.tcdcommons.api.client.gui.util.GuiUtils; import io.github.thecsdev.tcdcommons.api.client.gui.util.TDrawContext; @@ -23,12 +23,12 @@ // ================================================== public static final int SIZE = 21; // - public static final Text TEXT_STAT_MINED = translatable("stat_type.minecraft.mined"); - public static final Text TEXT_STAT_CRAFTED = translatable("stat_type.minecraft.crafted"); - public static final Text TEXT_STAT_PICKED_UP = translatable("stat_type.minecraft.picked_up"); - public static final Text TEXT_STAT_DROPPED = translatable("stat_type.minecraft.dropped"); - public static final Text TEXT_STAT_USED = translatable("stat_type.minecraft.used"); - public static final Text TEXT_STAT_BROKEN = translatable("stat_type.minecraft.broken"); + public static final Text TEXT_STAT_MINED = ItemStatType.MINED.getText(); + public static final Text TEXT_STAT_CRAFTED = ItemStatType.CRAFTED.getText(); + public static final Text TEXT_STAT_PICKED_UP = ItemStatType.PICKED_UP.getText(); + public static final Text TEXT_STAT_DROPPED = ItemStatType.DROPPED.getText(); + public static final Text TEXT_STAT_USED = ItemStatType.USED.getText(); + public static final Text TEXT_STAT_BROKEN = ItemStatType.BROKEN.getText(); // -------------------------------------------------- protected final ItemStack itemStack; protected final Tooltip defaultTooltip; diff --git a/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/api/client/gui/stats/widget/MobStatWidget.java b/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/api/client/gui/stats/widget/MobStatWidget.java index 7e17c0c3..6dc04a52 100644 --- a/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/api/client/gui/stats/widget/MobStatWidget.java +++ b/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/api/client/gui/stats/widget/MobStatWidget.java @@ -9,6 +9,7 @@ import io.github.thecsdev.betterstats.BetterStats; import io.github.thecsdev.betterstats.BetterStatsConfig; import io.github.thecsdev.betterstats.api.registry.BSRegistries; +import io.github.thecsdev.betterstats.api.util.enumerations.MobStatType; import io.github.thecsdev.betterstats.api.util.stats.SUMobStat; import io.github.thecsdev.tcdcommons.api.client.gui.other.TEntityRendererElement; import io.github.thecsdev.tcdcommons.api.client.gui.util.GuiUtils; @@ -26,8 +27,8 @@ // -------------------------------------------------- public static final int SIZE = 55; // - public static final Text TEXT_STAT_KILLS = translatable("betterstats.api.client.gui.stats.widget.mobstatwidget.kills"); - public static final Text TEXT_STAT_DEATHS = translatable("betterstats.api.client.gui.stats.widget.mobstatwidget.deaths"); + public static final Text TEXT_STAT_KILLS = MobStatType.KILLED.getText(); + public static final Text TEXT_STAT_DEATHS = MobStatType.KILLED_BY.getText(); // -------------------------------------------------- protected final EntityType entityType; protected final TEntityRendererElement entityRenderer; diff --git a/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/api/util/enumerations/FilterSortItemsBy.java b/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/api/util/enumerations/FilterSortItemsBy.java index af0b2a3a..e0460120 100644 --- a/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/api/util/enumerations/FilterSortItemsBy.java +++ b/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/api/util/enumerations/FilterSortItemsBy.java @@ -7,7 +7,6 @@ import java.util.Map; import java.util.Objects; -import io.github.thecsdev.betterstats.api.client.gui.stats.widget.ItemStatWidget; import io.github.thecsdev.betterstats.api.util.stats.SUItemStat; import io.github.thecsdev.tcdcommons.api.util.interfaces.ITextProvider; import net.minecraft.text.Text; @@ -20,12 +19,12 @@ public enum FilterSortItemsBy implements ITextProvider { // ================================================== DEFAULT(translatable("betterstats.api.util.enumerations.filtergroupby.default")), - MINED(ItemStatWidget.TEXT_STAT_MINED), - CRAFTED(ItemStatWidget.TEXT_STAT_CRAFTED), - USED(ItemStatWidget.TEXT_STAT_USED), - BROKEN(ItemStatWidget.TEXT_STAT_BROKEN), - PICKED_UP(ItemStatWidget.TEXT_STAT_PICKED_UP), - DROPPED(ItemStatWidget.TEXT_STAT_DROPPED); + MINED(ItemStatType.MINED.getText()), + CRAFTED(ItemStatType.CRAFTED.getText()), + USED(ItemStatType.USED.getText()), + BROKEN(ItemStatType.BROKEN.getText()), + PICKED_UP(ItemStatType.PICKED_UP.getText()), + DROPPED(ItemStatType.DROPPED.getText()); // ================================================== private final Text text; // -------------------------------------------------- diff --git a/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/api/util/enumerations/FilterSortMobsBy.java b/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/api/util/enumerations/FilterSortMobsBy.java index 0ea17cc3..6a704b9e 100644 --- a/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/api/util/enumerations/FilterSortMobsBy.java +++ b/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/api/util/enumerations/FilterSortMobsBy.java @@ -7,7 +7,6 @@ import java.util.Map; import java.util.Objects; -import io.github.thecsdev.betterstats.api.client.gui.stats.widget.MobStatWidget; import io.github.thecsdev.betterstats.api.util.stats.SUMobStat; import io.github.thecsdev.tcdcommons.api.util.interfaces.ITextProvider; import net.minecraft.text.Text; @@ -20,8 +19,8 @@ public enum FilterSortMobsBy implements ITextProvider { // ================================================== DEFAULT(translatable("betterstats.api.util.enumerations.filtergroupby.default")), - KILLS(MobStatWidget.TEXT_STAT_KILLS), - DEATHS(MobStatWidget.TEXT_STAT_DEATHS); + KILLS(MobStatType.KILLED.getText()), + DEATHS(MobStatType.KILLED_BY.getText()); // ================================================== private final Text text; // -------------------------------------------------- diff --git a/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/api/util/enumerations/ItemStatType.java b/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/api/util/enumerations/ItemStatType.java index 118e26a7..7b1be82d 100644 --- a/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/api/util/enumerations/ItemStatType.java +++ b/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/api/util/enumerations/ItemStatType.java @@ -1,11 +1,6 @@ package io.github.thecsdev.betterstats.api.util.enumerations; -import static io.github.thecsdev.betterstats.api.client.gui.stats.widget.ItemStatWidget.TEXT_STAT_BROKEN; -import static io.github.thecsdev.betterstats.api.client.gui.stats.widget.ItemStatWidget.TEXT_STAT_CRAFTED; -import static io.github.thecsdev.betterstats.api.client.gui.stats.widget.ItemStatWidget.TEXT_STAT_DROPPED; -import static io.github.thecsdev.betterstats.api.client.gui.stats.widget.ItemStatWidget.TEXT_STAT_MINED; -import static io.github.thecsdev.betterstats.api.client.gui.stats.widget.ItemStatWidget.TEXT_STAT_PICKED_UP; -import static io.github.thecsdev.betterstats.api.client.gui.stats.widget.ItemStatWidget.TEXT_STAT_USED; +import static io.github.thecsdev.tcdcommons.api.util.TextUtils.translatable; import java.util.Objects; import java.util.function.Function; @@ -20,12 +15,12 @@ public enum ItemStatType implements ITextProvider { // ================================================== - MINED( Stats.MINED, TEXT_STAT_MINED, s -> s.mined), - CRAFTED( Stats.CRAFTED, TEXT_STAT_CRAFTED, s -> s.crafted), - PICKED_UP(Stats.PICKED_UP, TEXT_STAT_PICKED_UP, s -> s.pickedUp), - DROPPED( Stats.DROPPED, TEXT_STAT_DROPPED, s -> s.dropped), - USED( Stats.USED, TEXT_STAT_USED, s -> s.used), - BROKEN( Stats.BROKEN, TEXT_STAT_BROKEN, s -> s.broken); + MINED(Stats.MINED, translatable("stat_type.minecraft.mined"), s -> s.mined), + CRAFTED(Stats.CRAFTED, translatable("stat_type.minecraft.crafted"), s -> s.crafted), + PICKED_UP(Stats.PICKED_UP, translatable("stat_type.minecraft.picked_up"), s -> s.pickedUp), + DROPPED(Stats.DROPPED, translatable("stat_type.minecraft.dropped"), s -> s.dropped), + USED(Stats.USED, translatable("stat_type.minecraft.used"), s -> s.used), + BROKEN(Stats.BROKEN, translatable("stat_type.minecraft.broken"), s -> s.broken); // ================================================== private final StatType statType; private final Text text; diff --git a/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/api/util/enumerations/MobStatType.java b/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/api/util/enumerations/MobStatType.java index 211763c6..201fc80f 100644 --- a/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/api/util/enumerations/MobStatType.java +++ b/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/api/util/enumerations/MobStatType.java @@ -1,7 +1,6 @@ package io.github.thecsdev.betterstats.api.util.enumerations; -import static io.github.thecsdev.betterstats.api.client.gui.stats.widget.MobStatWidget.TEXT_STAT_DEATHS; -import static io.github.thecsdev.betterstats.api.client.gui.stats.widget.MobStatWidget.TEXT_STAT_KILLS; +import static io.github.thecsdev.tcdcommons.api.util.TextUtils.translatable; import java.util.Objects; import java.util.function.Function; @@ -16,8 +15,8 @@ public enum MobStatType implements ITextProvider { // ================================================== - KILLED( Stats.KILLED, TEXT_STAT_KILLS, s -> s.kills), - KILLED_BY(Stats.KILLED_BY, TEXT_STAT_DEATHS, s -> s.deaths); + KILLED(Stats.KILLED, translatable("betterstats.api.client.gui.stats.widget.mobstatwidget.kills"), s -> s.kills), + KILLED_BY(Stats.KILLED_BY, translatable("betterstats.api.client.gui.stats.widget.mobstatwidget.deaths"), s -> s.deaths); // ================================================== private final StatType statType; private final Text text; diff --git a/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/client/network/BetterStatsClientNetworkHandler.java b/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/client/network/BetterStatsClientNetworkHandler.java index fa261407..00f4df6f 100644 --- a/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/client/network/BetterStatsClientNetworkHandler.java +++ b/betterstats-3-fabric-1.20.2/src/main/java/io/github/thecsdev/betterstats/client/network/BetterStatsClientNetworkHandler.java @@ -77,7 +77,7 @@ public static final void c2s_liveStats(boolean receiveLiveUpdates) //construct and send final var data = new PacketByteBuf(Unpooled.buffer()); data.writeBoolean(receiveLiveUpdates); - new TCustomPayload(C2S_LIVE_STATS, data); + new TCustomPayload(C2S_LIVE_STATS, data).sendC2S(); } // ================================================== } \ No newline at end of file diff --git a/betterstats-3-fabric-1.20.2/src/main/resources/META-INF/jarjar/tcdcommons-3.1+fabric-1.20.2.jar b/betterstats-3-fabric-1.20.2/src/main/resources/META-INF/jarjar/tcdcommons-3.1+fabric-1.20.2.jar index 68eb859f..d6f3f496 100644 Binary files a/betterstats-3-fabric-1.20.2/src/main/resources/META-INF/jarjar/tcdcommons-3.1+fabric-1.20.2.jar and b/betterstats-3-fabric-1.20.2/src/main/resources/META-INF/jarjar/tcdcommons-3.1+fabric-1.20.2.jar differ