diff --git a/build.gradle b/build.gradle index bfffaae..52145e5 100644 --- a/build.gradle +++ b/build.gradle @@ -66,8 +66,8 @@ dependencies { runtimeOnly fg.deobf("mcp.mobius.waila:wthit:forge-${wthit_version}") runtimeOnly fg.deobf("lol.bai:badpackets:forge-${badpackets_version}") - compileOnly fg.deobf("slimeknights.mantle:Mantle:${mantle_version}") - compileOnly fg.deobf("slimeknights.tconstruct:TConstruct:${tconstruct_version}") +// compileOnly fg.deobf("slimeknights.mantle:Mantle:${mantle_version}") +// compileOnly fg.deobf("slimeknights.tconstruct:TConstruct:${tconstruct_version}") } jar { diff --git a/gradle.properties b/gradle.properties index 35c130d..ba29ae1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,9 +1,9 @@ -mod_version=2.0.0 -minecraft_version=1.18.2 -forge_version=40.1.73 +mod_version=2.1.0 +minecraft_version=1.19.2 +forge_version= 43.1.3 mappings_version=20200723-1.16.1 -wthit_version=4.13.3 -badpackets_version=0.1.2 +wthit_version=5.11.3 +badpackets_version=0.2.0 mantle_version=1.18.2-1.9.28 tconstruct_version=1.18.2-3.5.1.35 diff --git a/java/squeek/wthitharvestability/TooltipHandler.java b/java/squeek/wthitharvestability/TooltipHandler.java index 72fd7b9..a080a42 100644 --- a/java/squeek/wthitharvestability/TooltipHandler.java +++ b/java/squeek/wthitharvestability/TooltipHandler.java @@ -1,6 +1,6 @@ package squeek.wthitharvestability; -import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.network.chat.Component; import net.minecraft.world.item.DiggerItem; import net.minecraft.world.item.Item; import net.minecraftforge.api.distmarker.Dist; @@ -19,7 +19,7 @@ public static void tooltipEvent(ItemTooltipEvent event) { Item item = event.getItemStack().getItem(); if (item instanceof DiggerItem && enableHarvestTooltip) { String harvestName = StringHelper.getHarvestLevelName(((DiggerItem) item).getTier()); - event.getToolTip().add(new TranslatableComponent("waila.h12y.harvestlevel").append(" " + harvestName)); + event.getToolTip().add(Component.translatable("waila.h12y.harvestlevel").append(" " + harvestName)); } } diff --git a/java/squeek/wthitharvestability/WailaHandler.java b/java/squeek/wthitharvestability/WailaHandler.java index a53a73f..4a66ef1 100644 --- a/java/squeek/wthitharvestability/WailaHandler.java +++ b/java/squeek/wthitharvestability/WailaHandler.java @@ -15,8 +15,6 @@ import net.minecraft.client.resources.language.I18n; import net.minecraft.core.BlockPos; import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.TextComponent; -import net.minecraft.network.chat.TranslatableComponent; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; @@ -92,7 +90,7 @@ public void getHarvestability(List stringList, Player player, BlockSt } if (BlockHelper.isAdventureModeAndBlockIsUnbreakable(player, pos) || BlockHelper.isBlockUnbreakable(player.level, pos, state)) { - Component unbreakableString = new TextComponent(ColorHelper.getBooleanColor(false)).append(config.getString(HARVESTABLE_FALSE_STRING)).append(" ").append(!minimalLayout ? new TranslatableComponent("waila.h12y.harvestable").withStyle(ChatFormatting.RESET) : new TextComponent("")); + Component unbreakableString = Component.literal(ColorHelper.getBooleanColor(false)).append(config.getString(HARVESTABLE_FALSE_STRING)).append(" ").append(!minimalLayout ? Component.translatable("waila.h12y.harvestable").withStyle(ChatFormatting.RESET) : Component.literal("")); stringList.add(unbreakableString); return; } @@ -136,7 +134,7 @@ public void getHarvestability(List stringList, Player player, BlockSt if (!currentlyHarvestable.isEmpty() || !shearability.isEmpty()) { String separator = (!shearability.isEmpty() ? " " : ""); - stringList.add(new TextComponent(currentlyHarvestable + separator + shearability)); + stringList.add(Component.literal(currentlyHarvestable + separator + shearability)); } if (harvestTier != null && showEffectiveTool) { String effectiveToolClass = effectiveTool.toolClass(); @@ -146,7 +144,7 @@ public void getHarvestability(List stringList, Player player, BlockSt } else { effectiveToolString = effectiveToolClass.substring(0, 1).toUpperCase() + effectiveToolClass.substring(1); } - stringList.add(new TranslatableComponent(!minimalLayout ? "waila.h12y.effectivetool" : "").append(" ").append(ColorHelper.getBooleanColor(isEffective && (!isHoldingTinkersTool || canHarvest), isHoldingTinkersTool && isEffective && !canHarvest) + effectiveToolString)); + stringList.add(Component.translatable(!minimalLayout ? "waila.h12y.effectivetool" : "").append(" ").append(ColorHelper.getBooleanColor(isEffective && (!isHoldingTinkersTool || canHarvest), isHoldingTinkersTool && isEffective && !canHarvest) + effectiveToolString)); } if (harvestTier != null && (showHarvestLevel || showHarvestLevelNum)) { String harvestLevelString = ""; @@ -161,7 +159,7 @@ public void getHarvestability(List stringList, Player player, BlockSt else if (showHarvestLevelNum) harvestLevelString = harvestLevelNum; - stringList.add(new TranslatableComponent(!minimalLayout ? "waila.h12y.harvestlevel" : "").append(" ").append(ColorHelper.getBooleanColor(isAboveMinHarvestLevel && canHarvest) + harvestLevelString)); + stringList.add(Component.translatable(!minimalLayout ? "waila.h12y.harvestlevel" : "").append(" ").append(ColorHelper.getBooleanColor(isAboveMinHarvestLevel && canHarvest) + harvestLevelString)); } } } diff --git a/java/squeek/wthitharvestability/WailaHarvestability.java b/java/squeek/wthitharvestability/WailaHarvestability.java index b8dee72..a78eddf 100644 --- a/java/squeek/wthitharvestability/WailaHarvestability.java +++ b/java/squeek/wthitharvestability/WailaHarvestability.java @@ -1,10 +1,8 @@ package squeek.wthitharvestability; import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.fml.ModList; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; -import squeek.wthitharvestability.proxy.TConstructProxy; @Mod(value = WailaHarvestability.MOD_ID) public class WailaHarvestability { @@ -15,9 +13,9 @@ public class WailaHarvestability { public WailaHarvestability() { final IEventBus modBus = FMLJavaModLoadingContext.get().getModEventBus(); - if (ModList.get().isLoaded(TCONSTRUCT)) { - modBus.addListener(new TConstructProxy()); - } +// if (ModList.get().isLoaded(TCONSTRUCT)) { +// modBus.addListener(new TConstructProxy()); +// } } } \ No newline at end of file diff --git a/java/squeek/wthitharvestability/helpers/StringHelper.java b/java/squeek/wthitharvestability/helpers/StringHelper.java index eddf203..c85d0e3 100644 --- a/java/squeek/wthitharvestability/helpers/StringHelper.java +++ b/java/squeek/wthitharvestability/helpers/StringHelper.java @@ -7,7 +7,6 @@ import net.minecraft.Util; import net.minecraft.client.resources.language.I18n; import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.TextComponent; import net.minecraft.world.item.Tier; import net.minecraftforge.common.TierSortingRegistry; @@ -36,7 +35,7 @@ public static Component concatenateStringList(List textComponents, St sb.append(sep).append(s.getString()); sep = separator; } - return new TextComponent(sb.toString()); + return Component.literal(sb.toString()); } public static String stripFormatting(String str) { diff --git a/java/squeek/wthitharvestability/proxy/TConstructProxy.java b/java/squeek/wthitharvestability/proxy/TConstructProxy.java.excluded similarity index 100% rename from java/squeek/wthitharvestability/proxy/TConstructProxy.java rename to java/squeek/wthitharvestability/proxy/TConstructProxy.java.excluded diff --git a/resources/META-INF/mods.toml b/resources/META-INF/mods.toml index 3c500e5..05691e1 100644 --- a/resources/META-INF/mods.toml +++ b/resources/META-INF/mods.toml @@ -17,7 +17,7 @@ license="The Unlicense" [[dependencies.wthitharvestability]] modId="wthit" mandatory=true - versionRange="[4.13,)" + versionRange="[5.11,)" ordering="AFTER" side="BOTH"