Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Commit

Permalink
update to 1.19.2
Browse files Browse the repository at this point in the history
  • Loading branch information
deirn committed Aug 31, 2022
1 parent 912a28c commit a24cc69
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 23 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions java/squeek/wthitharvestability/TooltipHandler.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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));
}
}

Expand Down
10 changes: 4 additions & 6 deletions java/squeek/wthitharvestability/WailaHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -92,7 +90,7 @@ public void getHarvestability(List<Component> 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;
}
Expand Down Expand Up @@ -136,7 +134,7 @@ public void getHarvestability(List<Component> 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();
Expand All @@ -146,7 +144,7 @@ public void getHarvestability(List<Component> 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 = "";
Expand All @@ -161,7 +159,7 @@ public void getHarvestability(List<Component> 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));
}
}
}
Expand Down
8 changes: 3 additions & 5 deletions java/squeek/wthitharvestability/WailaHarvestability.java
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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());
// }
}

}
3 changes: 1 addition & 2 deletions java/squeek/wthitharvestability/helpers/StringHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -36,7 +35,7 @@ public static Component concatenateStringList(List<Component> 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) {
Expand Down
2 changes: 1 addition & 1 deletion resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ license="The Unlicense"
[[dependencies.wthitharvestability]]
modId="wthit"
mandatory=true
versionRange="[4.13,)"
versionRange="[5.11,)"
ordering="AFTER"
side="BOTH"

Expand Down

0 comments on commit a24cc69

Please sign in to comment.