Skip to content

Commit

Permalink
Compat latest Jade (MC 1.19.3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hendrix-Shen committed Jan 13, 2023
1 parent ea094de commit 867af56
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ lombok_version=1.18.24
# Required Libraries
# MagicLib - 0.6.194
magiclib_dependency=0.6.194+3df5798-beta
magiclib_version=0.6.195+22fabd0-beta
magiclib_version=0.6.200+a47eb26-beta
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public class TweakMyClient implements ClientModInitializer {
private static final Minecraft minecraftClient = Minecraft.getInstance();

@Dependencies(
//#if MC >= 11900
//#if MC >= 11903
and = {
@Dependency(value = "jade", versionPredicate = ">=8.6.0", optional = true),
@Dependency(value = "jade", versionPredicate = ">=9.3.1", optional = true),
@Dependency(value = "wthit", versionPredicate = ">=5.10.0", optional = true)
}
//#elseif MC >= 11800
Expand Down
18 changes: 15 additions & 3 deletions src/main/java/top/hendrixshen/tweakmyclient/util/JadeUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ public static void tick() {

Accessor<?> originalAccessor = accessor;

for (JadeRayTraceCallback callback : WailaClientRegistration.INSTANCE.rayTraceCallbacks) {
//#if MC >= 11903
for (JadeRayTraceCallback callback : WailaClientRegistration.INSTANCE.rayTraceCallback.callbacks()) {
//#else
//$$ for (JadeRayTraceCallback callback : WailaClientRegistration.INSTANCE.rayTraceCallbacks) {
//#endif
accessor = callback.onRayTrace(traceWrapper.getBlockHitResult(), accessor, originalAccessor);
}

Expand Down Expand Up @@ -129,15 +133,23 @@ public static void tick() {
//$$ if (config.getDisplayMode() == IWailaConfig.DisplayMode.LITE && !showDetails) {
//#endif
Tooltip dummyTooltip = new Tooltip();
accessor._gatherComponents($ -> Math.abs(WailaCommonRegistration.INSTANCE.priorities.get($)) > 5000 ? tooltip : dummyTooltip);
//#if MC >= 11903
accessor._gatherComponents($ -> Math.abs(WailaCommonRegistration.INSTANCE.priorities.byValue($)) > 5000 ? tooltip : dummyTooltip);
//#else
//$$ accessor._gatherComponents($ -> Math.abs(WailaCommonRegistration.INSTANCE.priorities.get($)) > 5000 ? tooltip : dummyTooltip);
//#endif
if (!dummyTooltip.isEmpty()) {
tooltip.sneakyDetails = true;
}
} else {
accessor._gatherComponents($ -> tooltip);
}

for (JadeTooltipCollectedCallback callback : WailaClientRegistration.INSTANCE.tooltipCollectedCallbacks) {
//#if MC >= 11903
for (JadeTooltipCollectedCallback callback : WailaClientRegistration.INSTANCE.tooltipCollectedCallback.callbacks()) {
//#else
//$$ for (JadeTooltipCollectedCallback callback : WailaClientRegistration.INSTANCE.tooltipCollectedCallbacks) {
//#endif
callback.onTooltipCollected(tooltip, accessor);
}
JadeUtil.disableJadeRender = true;
Expand Down
4 changes: 2 additions & 2 deletions versions/1.19.3/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ minecraft_dependency = 1.19.x
# Compatible Libraries
# bad packets - 0.3.4
badpackets_version = 4162674
# Jade - 9.2.1
jade_version = 4160727
# Jade - 9.3.1
jade_version = 4328555
# Litematica - 0.13.0
litematica_version = 4162847
# Not Enough Crashes - 4.2.0
Expand Down

0 comments on commit 867af56

Please sign in to comment.