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

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
f0feb8b
init commit
olim88 Aug 20, 2024
188a62c
add setting and base teleport time on ping
olim88 Aug 20, 2024
1d8eaf7
add settings for each wepon type and work with each of them
olim88 Aug 22, 2024
d3ae3fa
add raycast
olim88 Aug 26, 2024
1f1163d
cheak the players mana before assuming they can teleport
olim88 Aug 27, 2024
aa37c16
remove un needed setting
olim88 Aug 27, 2024
624cead
add java docs and 3rd person check
olim88 Aug 27, 2024
4325aa3
clean
olim88 Aug 28, 2024
0a8f18d
fix 3rd person check
olim88 Aug 28, 2024
9ca11ac
apply suggested changes
olim88 Aug 29, 2024
8ccc907
do not allow when invalid location
olim88 Aug 29, 2024
9f60637
fix etherwarp logic using wrong tp
olim88 Aug 29, 2024
7cc8085
add tooltips to options
olim88 Aug 29, 2024
d3f0da3
fix : click too fast cause the animation break
olim88 Aug 29, 2024
1d39287
fix mixin
viciscat Aug 29, 2024
bf77bed
add more disabled locations and fix for not coded disabled locations
olim88 Aug 29, 2024
36f9fe5
improve raycast to be more like hypxiels
olim88 Aug 30, 2024
661c9e1
add separate cameraStartPos to try and smooth combined animations
olim88 Aug 30, 2024
d82f02a
fix extra code
olim88 Aug 30, 2024
0b3e64d
fix not working when clicking dirt with shovel
olim88 Aug 30, 2024
9cf2317
more clean
olim88 Aug 30, 2024
1076a32
fix the init
olim88 Sep 4, 2024
fafe6c2
fix multiple teleports when looking at a block
olim88 Sep 12, 2024
95e6984
hopefully improve raycast and add allowed blocks
olim88 Sep 12, 2024
7ead10f
do bad client side mana calculation
olim88 Sep 12, 2024
7f157ce
only don't check head pos on first block
olim88 Sep 12, 2024
4784404
improve head height test
olim88 Sep 13, 2024
3bebe3e
add close floor check
olim88 Sep 13, 2024
fb67c47
add can teleport though fire
olim88 Sep 13, 2024
65c25df
add checking for diagonals
olim88 Sep 13, 2024
a2a67bb
add new is floor check for the close floor check
olim88 Sep 13, 2024
b2819b7
update allowed blocks and improve diagonal collision
olim88 Sep 13, 2024
dd0481e
diagonals only work if its floor block
olim88 Sep 13, 2024
0c60f71
java docs
olim88 Sep 13, 2024
cbb31ab
remove debug
olim88 Sep 13, 2024
d20a1b7
can teleport though pots
olim88 Sep 13, 2024
aaae4dc
Update SmoothAOTE.java
olim88 Sep 14, 2024
7fec399
Apply suggestions from code review
kevinthegreat1 Sep 15, 2024
3c543c9
apply suggested changes
olim88 Sep 18, 2024
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 @@ -296,6 +296,53 @@ 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())
.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 @@ -55,6 +55,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 @@ -223,6 +226,24 @@ public static class TeleportOverlay {
public boolean enableWitherImpact = true;
}

public static class SmoothAOTE {

@SerialEntry
public boolean enableWeirdTransmission = true;

@SerialEntry
public boolean enableInstantTransmission = true;

@SerialEntry
public boolean enableEtherTransmission = true;

@SerialEntry
public boolean enableSinrecallTransmission = true;

@SerialEntry
public boolean enableWitherImpact = true;
}

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 @@ -2,18 +2,21 @@

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.llamalad7.mixinextras.sugar.Local;
import de.hysky.skyblocker.config.SkyblockerConfigManager;
import de.hysky.skyblocker.config.configs.SlayersConfig;
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.crimson.slayer.FirePillarAnnouncer;
import de.hysky.skyblocker.skyblock.dungeon.DungeonScore;
import de.hysky.skyblocker.skyblock.dungeon.secrets.DungeonManager;
import de.hysky.skyblocker.skyblock.dwarven.WishingCompassSolver;
import de.hysky.skyblocker.skyblock.dwarven.CrystalsChestHighlighter;
import de.hysky.skyblocker.skyblock.dwarven.WishingCompassSolver;
import de.hysky.skyblocker.skyblock.end.BeaconHighlighter;
import de.hysky.skyblocker.skyblock.end.EnderNodes;
import de.hysky.skyblocker.skyblock.end.TheEnd;
Expand All @@ -22,6 +25,7 @@
import de.hysky.skyblocker.utils.SlayerUtils;
import de.hysky.skyblocker.utils.Utils;
import net.minecraft.block.Blocks;
import net.minecraft.client.gui.hud.DebugHud;
import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.Entity;
Expand Down Expand Up @@ -134,7 +138,8 @@ public abstract class ClientPlayNetworkHandlerMixin {
}
}

if (SkyblockerConfigManager.get().slayers.blazeSlayer.firePillarCountdown != SlayersConfig.BlazeSlayer.FirePillar.OFF) FirePillarAnnouncer.checkFirePillar(entity);
if (SkyblockerConfigManager.get().slayers.blazeSlayer.firePillarCountdown != SlayersConfig.BlazeSlayer.FirePillar.OFF)
FirePillarAnnouncer.checkFirePillar(entity);

EggFinder.checkIfEgg(armorStandEntity);
try { //Prevent packet handling fails if something goes wrong so that entity trackers still update, just without compact damage numbers
Expand All @@ -148,4 +153,21 @@ public abstract class ClientPlayNetworkHandlerMixin {
private void skyblocker$onEntityEquip(EntityEquipmentUpdateS2CPacket packet, CallbackInfo ci, @Local Entity entity) {
EggFinder.checkIfEgg(entity);
}

@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();
}

@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
if (Utils.isOnSkyblock()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also check for smoothing being enabled

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