Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smooth AOTE #963

Merged
merged 46 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
b876d04
init commit
olim88 Aug 20, 2024
771e37c
add setting and base teleport time on ping
olim88 Aug 20, 2024
4656e0a
add settings for each wepon type and work with each of them
olim88 Aug 22, 2024
7e23484
add raycast
olim88 Aug 26, 2024
a77ff2a
cheak the players mana before assuming they can teleport
olim88 Aug 27, 2024
2303ee7
remove un needed setting
olim88 Aug 27, 2024
8a4450c
add java docs and 3rd person check
olim88 Aug 27, 2024
1b5fa2c
clean
olim88 Aug 28, 2024
0b631a0
fix 3rd person check
olim88 Aug 28, 2024
8f2ec20
apply suggested changes
olim88 Aug 29, 2024
8c48a44
do not allow when invalid location
olim88 Aug 29, 2024
bf1e7d6
fix etherwarp logic using wrong tp
olim88 Aug 29, 2024
a55b0d4
add tooltips to options
olim88 Aug 29, 2024
36d72b2
fix : click too fast cause the animation break
olim88 Aug 29, 2024
2f5cc8f
fix mixin
viciscat Aug 29, 2024
b4fe90d
add more disabled locations and fix for not coded disabled locations
olim88 Aug 29, 2024
5158fd6
improve raycast to be more like hypxiels
olim88 Aug 30, 2024
b4ee65a
add separate cameraStartPos to try and smooth combined animations
olim88 Aug 30, 2024
6d570c1
fix extra code
olim88 Aug 30, 2024
78f17c9
fix not working when clicking dirt with shovel
olim88 Aug 30, 2024
4c76d8c
more clean
olim88 Aug 30, 2024
98790c6
fix the init
olim88 Sep 4, 2024
2c91082
fix multiple teleports when looking at a block
olim88 Sep 12, 2024
f9f46a1
hopefully improve raycast and add allowed blocks
olim88 Sep 12, 2024
7f393b8
do bad client side mana calculation
olim88 Sep 12, 2024
baefb14
only don't check head pos on first block
olim88 Sep 12, 2024
0804944
improve head height test
olim88 Sep 13, 2024
d3079de
add close floor check
olim88 Sep 13, 2024
da27911
add can teleport though fire
olim88 Sep 13, 2024
9e45160
add checking for diagonals
olim88 Sep 13, 2024
40625c6
add new is floor check for the close floor check
olim88 Sep 13, 2024
edd0948
update allowed blocks and improve diagonal collision
olim88 Sep 13, 2024
6fa2c6c
diagonals only work if its floor block
olim88 Sep 13, 2024
2050b2e
java docs
olim88 Sep 13, 2024
ab59033
remove debug
olim88 Sep 13, 2024
e6ee1ee
can teleport though pots
olim88 Sep 13, 2024
b79fb44
Update SmoothAOTE.java
olim88 Sep 14, 2024
c8d30dd
Apply suggestions from code review
kevinthegreat1 Sep 15, 2024
6338f97
apply suggested changes
olim88 Sep 18, 2024
c502f25
add check to see if smoothing is enabled
olim88 Sep 29, 2024
3b311e7
fix rebase
olim88 Oct 30, 2024
357dbd4
make the setting off by default
olim88 Jan 11, 2025
55259bb
fix some glitchyness with changing ping
olim88 Jan 11, 2025
d17d92e
add option to smooth teleport more
olim88 Jan 11, 2025
6492415
Clean up ClientPlayNetworkHandlerMixin
kevinthegreat1 Jan 12, 2025
2e80c41
Fix camera flashing when animation finishes before server teleports p…
kevinthegreat1 Jan 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,61 @@ public static ConfigCategory create(SkyblockerConfig defaults, SkyblockerConfig
.build())
.build())

//Smooth AOTE
.group(OptionGroup.createBuilder()
.name(Text.translatable("skyblocker.config.uiAndVisuals.smoothAOTE"))
.description(OptionDescription.of(Text.translatable("skyblocker.config.uiAndVisuals.smoothAOTE.@Tooltip")))
.collapsed(true)
.option(Option.<Boolean>createBuilder()
.name(Text.translatable("skyblocker.config.uiAndVisuals.smoothAOTE.enableWeirdTransmission"))
.description(OptionDescription.of(Text.translatable("skyblocker.config.uiAndVisuals.smoothAOTE.enableWeirdTransmission.@Tooltip")))
.binding(defaults.uiAndVisuals.smoothAOTE.enableWeirdTransmission,
() -> config.uiAndVisuals.smoothAOTE.enableWeirdTransmission,
newValue -> config.uiAndVisuals.smoothAOTE.enableWeirdTransmission = newValue)
.controller(ConfigUtils::createBooleanController)
.build())
.option(Option.<Boolean>createBuilder()
.name(Text.translatable("skyblocker.config.uiAndVisuals.smoothAOTE.enableInstantTransmission"))
.description(OptionDescription.of(Text.translatable("skyblocker.config.uiAndVisuals.smoothAOTE.enableInstantTransmission.@Tooltip")))
.binding(defaults.uiAndVisuals.smoothAOTE.enableInstantTransmission,
() -> config.uiAndVisuals.smoothAOTE.enableInstantTransmission,
newValue -> config.uiAndVisuals.smoothAOTE.enableInstantTransmission = newValue)
.controller(ConfigUtils::createBooleanController)
.build())
.option(Option.<Boolean>createBuilder()
.name(Text.translatable("skyblocker.config.uiAndVisuals.smoothAOTE.enableEtherTransmission"))
.description(OptionDescription.of(Text.translatable("skyblocker.config.uiAndVisuals.smoothAOTE.enableEtherTransmission.@Tooltip")))
.binding(defaults.uiAndVisuals.smoothAOTE.enableEtherTransmission,
() -> config.uiAndVisuals.smoothAOTE.enableEtherTransmission,
newValue -> config.uiAndVisuals.smoothAOTE.enableEtherTransmission = newValue)
.controller(ConfigUtils::createBooleanController)
.build())
.option(Option.<Boolean>createBuilder()
.name(Text.translatable("skyblocker.config.uiAndVisuals.smoothAOTE.enableSinrecallTransmission"))
.description(OptionDescription.of(Text.translatable("skyblocker.config.uiAndVisuals.smoothAOTE.enableSinrecallTransmission.@Tooltip")))
.binding(defaults.uiAndVisuals.smoothAOTE.enableSinrecallTransmission,
() -> config.uiAndVisuals.smoothAOTE.enableSinrecallTransmission,
newValue -> config.uiAndVisuals.smoothAOTE.enableSinrecallTransmission = newValue)
.controller(ConfigUtils::createBooleanController)
.build())
.option(Option.<Boolean>createBuilder()
.name(Text.translatable("skyblocker.config.uiAndVisuals.smoothAOTE.enableWitherImpact"))
.description(OptionDescription.of(Text.translatable("skyblocker.config.uiAndVisuals.smoothAOTE.enableWitherImpact.@Tooltip")))
.binding(defaults.uiAndVisuals.smoothAOTE.enableWitherImpact,
() -> config.uiAndVisuals.smoothAOTE.enableWitherImpact,
newValue -> config.uiAndVisuals.smoothAOTE.enableWitherImpact = newValue)
.controller(ConfigUtils::createBooleanController)
.build())
.option(Option.<Integer>createBuilder()
.name(Text.translatable("skyblocker.config.uiAndVisuals.smoothAOTE.maximumAddedLag"))
.description(OptionDescription.of(Text.translatable("skyblocker.config.uiAndVisuals.smoothAOTE.maximumAddedLag.@Tooltip")))
.binding(defaults.uiAndVisuals.smoothAOTE.maximumAddedLag,
() -> config.uiAndVisuals.smoothAOTE.maximumAddedLag,
newValue -> config.uiAndVisuals.smoothAOTE.maximumAddedLag = newValue)
.controller(opt -> IntegerSliderControllerBuilder.create(opt).range(0, 500).step(1))
.build())
.build())

//Search overlay
.group(OptionGroup.createBuilder()
.name(Text.translatable("skyblocker.config.uiAndVisuals.searchOverlay"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ public class UIAndVisualsConfig {
@SerialEntry
public TeleportOverlay teleportOverlay = new TeleportOverlay();

@SerialEntry
public SmoothAOTE smoothAOTE = new SmoothAOTE();

@SerialEntry
public SearchOverlay searchOverlay = new SearchOverlay();

Expand Down Expand Up @@ -328,6 +331,27 @@ public static class TeleportOverlay {
public boolean enableWitherImpact = true;
}

public static class SmoothAOTE {
olim88 marked this conversation as resolved.
Show resolved Hide resolved

@SerialEntry
public boolean enableWeirdTransmission = false;

@SerialEntry
public boolean enableInstantTransmission = false;

@SerialEntry
public boolean enableEtherTransmission = false;

@SerialEntry
public boolean enableSinrecallTransmission = false;

@SerialEntry
public boolean enableWitherImpact = false;

@SerialEntry
public int maximumAddedLag = 100;
}

public static class SearchOverlay {
@SerialEntry
public boolean enableBazaar = true;
Expand Down
22 changes: 22 additions & 0 deletions src/main/java/de/hysky/skyblocker/mixins/CameraMixin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package de.hysky.skyblocker.mixins;

import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import de.hysky.skyblocker.skyblock.SmoothAOTE;
import net.minecraft.client.render.Camera;
import net.minecraft.util.math.Vec3d;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

@Mixin(Camera.class)
public class CameraMixin {

@ModifyReturnValue(method = "getPos", at = @At("RETURN"))
private Vec3d skyblocker$onCameraUpdate(Vec3d original) {
Vec3d pos = SmoothAOTE.getInterpolatedPos();
if (pos != null) {
return pos;
}

return original;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
import com.llamalad7.mixinextras.sugar.Local;
import de.hysky.skyblocker.config.SkyblockerConfigManager;
import de.hysky.skyblocker.config.configs.SlayersConfig;
import de.hysky.skyblocker.config.configs.UIAndVisualsConfig;
import de.hysky.skyblocker.skyblock.CompactDamage;
import de.hysky.skyblocker.skyblock.FishingHelper;
import de.hysky.skyblocker.skyblock.SmoothAOTE;
import de.hysky.skyblocker.skyblock.chocolatefactory.EggFinder;
import de.hysky.skyblocker.skyblock.crimson.dojo.DojoManager;
import de.hysky.skyblocker.skyblock.dungeon.DungeonScore;
Expand Down Expand Up @@ -40,6 +42,9 @@
import org.spongepowered.asm.mixin.injection.ModifyVariable;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

/**
* All mixins in this file should be arranged in the order of the methods they inject into.
*/
@Mixin(ClientPlayNetworkHandler.class)
public abstract class ClientPlayNetworkHandlerMixin {
@Shadow
Expand Down Expand Up @@ -73,6 +78,12 @@ public abstract class ClientPlayNetworkHandlerMixin {
}
}

@Inject(method = "onPlayerPositionLook", at = @At("TAIL"))
private void onPlayerTeleported(PlayerPositionLookS2CPacket packet, CallbackInfo ci) {
//player has been teleported by the server tell the smooth AOTE this
SmoothAOTE.playerTeleported();
}

@ModifyVariable(method = "onItemPickupAnimation", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/world/ClientWorld;removeEntity(ILnet/minecraft/entity/Entity$RemovalReason;)V", ordinal = 0))
private ItemEntity skyblocker$onItemPickup(ItemEntity itemEntity) {
DungeonManager.onItemPickup(itemEntity);
Expand Down Expand Up @@ -150,4 +161,15 @@ public abstract class ClientPlayNetworkHandlerMixin {
EnderNodes.onParticle(packet);
WishingCompassSolver.onParticle(packet);
}

@ModifyExpressionValue(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/DebugHud;shouldShowPacketSizeAndPingCharts()Z"))
private boolean shouldShowPacketSizeAndPingCharts(boolean original) {
//make the f3+3 screen always send ping packets even when closed
//this is needed to make smooth AOTE work so check if its enabled
UIAndVisualsConfig.SmoothAOTE options = SkyblockerConfigManager.get().uiAndVisuals.smoothAOTE;
if (Utils.isOnSkyblock() && !SmoothAOTE.teleportDisabled && (options.enableWeirdTransmission || options.enableEtherTransmission || options.enableInstantTransmission || options.enableSinrecallTransmission || options.enableWitherImpact)) {
return true;
}
return original;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.hysky.skyblocker.mixins;

import de.hysky.skyblocker.skyblock.SmoothAOTE;
import de.hysky.skyblocker.skyblock.crimson.dojo.DojoManager;
import de.hysky.skyblocker.utils.Utils;
import net.minecraft.client.network.PingMeasurer;
Expand All @@ -15,6 +16,7 @@ public class PingMeasurerMixin {
if (Utils.isInCrimson()) {
DojoManager.onPingResult(ping);
}
SmoothAOTE.updatePing(ping);

return ping;
}
Expand Down
Loading
Loading