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

Prevent swimming on Skyblock #1143

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -57,6 +57,14 @@ public static ConfigCategory create(SkyblockerConfig defaults, SkyblockerConfig
newValue -> config.general.acceptReparty = newValue)
.controller(ConfigUtils::createBooleanController)
.build())
.option(Option.<Boolean>createBuilder()
.name(Text.translatable("skyblocker.config.general.preventSwimming"))
.description(OptionDescription.of(Text.translatable("skyblocker.config.general.preventSwimming.@Tooltip")))
.binding(defaults.general.preventSwimming,
() -> config.general.preventSwimming,
newValue -> config.general.preventSwimming = newValue)
.controller(ConfigUtils::createBooleanController)
.build())

.group(OptionGroup.createBuilder()
.name(Text.translatable("skyblocker.config.general.speedPresets"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ public class GeneralConfig {
@SerialEntry
public boolean acceptReparty = true;

@SerialEntry
public boolean preventSwimming = true;

@SerialEntry
public SpeedPresets speedPresets = new SpeedPresets();

Expand Down
7 changes: 7 additions & 0 deletions src/main/java/de/hysky/skyblocker/mixins/EntityMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,11 @@ private void onTick(CallbackInfo ci) {
}
}
}

@Inject(method = "setSwimming", at = @At("HEAD"), cancellable = true)
private void preventSwimming(boolean swimming, CallbackInfo ci) {
if (Utils.isOnSkyblock() && SkyblockerConfigManager.get().general.preventSwimming) {
ci.cancel();
}
}
}
3 changes: 3 additions & 0 deletions src/main/resources/assets/skyblocker/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@

"skyblocker.config.general.acceptReparty": "Auto accept Reparty",

"skyblocker.config.general.preventSwimming": "Prevent swimming on Skyblock",
"skyblocker.config.general.preventSwimming.@Tooltip": "Prevent players and NPCs from entering swimming state that does not exist in legacy servers. This may fix lag backs when in water.",

"skyblocker.config.general.hitbox": "Hitboxes",
"skyblocker.config.general.hitbox.oldFarmlandHitbox": "Enable 1.8 farmland hitbox",
"skyblocker.config.general.hitbox.oldLeverHitbox": "Enable 1.8 lever hitbox",
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/skyblocker/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@
"skyblocker.config.helpers.experiments.enableChronomatronSolver": "启用序列记忆实验助手",
"skyblocker.config.helpers.experiments.enableUltrasequencerSolver": "启用超级序列实验助手",
"skyblocker.config.general.acceptReparty": "自动接受重新组队",
"skyblocker.config.general.preventSwimming": "阻止在 Skyblock 中游泳",
"skyblocker.config.general.preventSwimming.@Tooltip": "防止玩家和 NPC 进入旧版服务器中不存在的游泳状态。这可能会修复在水中时回弹的问题。",
"skyblocker.config.helpers.fairySouls": "仙女之魂助手",
"skyblocker.config.helpers.fairySouls.enableFairySoulsHelper": "启用仙女之魂助手",
"skyblocker.fairySouls.markAllFound": "§r将当前岛屿上的全部仙女之魂标记为已发现",
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/skyblocker/lang/zh_tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
"skyblocker.config.general.itemTooltip.enableBazaarPrice": "顯示集市購買/賣出價格",
"skyblocker.tips.clickNextTip": "§a[點擊看下一則提示]",
"skyblocker.config.general.acceptReparty": "自動接受重新組隊",
"skyblocker.config.general.preventSwimming": "阻止在 Skyblock 中游泳",
"skyblocker.config.general.preventSwimming.@Tooltip": "防止玩家和 NPC 進入舊版伺服器中不存在的游泳狀態。這可能會修復在水中時回彈的問題。",
"skyblocker.config.helpers.fairySouls": "仙女之魂助手",
"skyblocker.config.uiAndVisuals.tabHud.tabHudScale.@Tooltip": "相對於原版GUI的百分比大小",
"skyblocker.config.general.shortcuts.enableShortcuts": "啟用快捷指令",
Expand Down
Loading