Skip to content

Commit

Permalink
Bump MaLiLib / FAPI & fix MixinClientPlayerEntity
Browse files Browse the repository at this point in the history
  • Loading branch information
sakura-ryoko committed Jan 29, 2025
1 parent 48af7f9 commit bed5061
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 33 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mod_file_name = tweakeroo-fabric
mod_version = 0.23.999-dev

# Required malilib version
malilib_version = 964fe72dc7
malilib_version = d41bb20e57

# Minecraft, Fabric Loader and API and mappings versions
minecraft_version_out = 25w05a
Expand All @@ -21,4 +21,4 @@ mappings_version = 25w05a+build.1

fabric_loader_version = 0.16.10
mod_menu_version = 13.0.1
# fabric_api_version = 0.115.1+1.21.5
# fabric_api_version = 0.115.2+1.21.5
2 changes: 0 additions & 2 deletions src/main/java/fi/dy/masa/tweakeroo/config/Configs.java
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ public static class Disable
public static final ConfigBooleanHotkeyed DISABLE_CREATIVE_INFESTED_BLOCKS= new ConfigBooleanHotkeyed("disableCreativeMenuInfestedBlocks", false, "").apply(DISABLE_KEY);
public static final ConfigBooleanHotkeyed DISABLE_DEAD_MOB_RENDERING = new ConfigBooleanHotkeyed("disableDeadMobRendering", false, "").apply(DISABLE_KEY);
public static final ConfigBooleanHotkeyed DISABLE_DEAD_MOB_TARGETING = new ConfigBooleanHotkeyed("disableDeadMobTargeting", false, "").apply(DISABLE_KEY);
public static final ConfigBooleanHotkeyed DISABLE_ELYTRA_SPRINT_CANCEL = new ConfigBooleanHotkeyed("disableElytraSprintCancel", false, "").apply(DISABLE_KEY);
public static final ConfigBooleanHotkeyed DISABLE_ENTITY_RENDERING = new ConfigBooleanHotkeyed("disableEntityRendering", false, "").apply(DISABLE_KEY);
public static final ConfigBooleanHotkeyed DISABLE_ENTITY_TICKING = new ConfigBooleanClient ("disableEntityTicking", false, "").apply(DISABLE_KEY);
public static final ConfigBooleanHotkeyed DISABLE_FALLING_BLOCK_RENDER = new ConfigBooleanHotkeyed("disableFallingBlockEntityRendering", false, "").apply(DISABLE_KEY);
Expand Down Expand Up @@ -372,7 +371,6 @@ public static class Disable
DISABLE_ENTITY_TICKING,
DISABLE_FALLING_BLOCK_RENDER,
DISABLE_FP_EFFECT_PARTICLES,
DISABLE_ELYTRA_SPRINT_CANCEL,
DISABLE_INVENTORY_EFFECTS,
DISABLE_ITEM_SWITCH_COOLDOWN,
DISABLE_MOB_SPAWNER_MOB_RENDER,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.Slice;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import com.mojang.authlib.GameProfile;
Expand Down Expand Up @@ -89,7 +88,6 @@ private void disableNauseaEffectPost(CallbackInfo ci)
private void overrideSprint(CallbackInfo ci)
{
if (FeatureToggle.TWEAK_PERMANENT_SPRINT.getBooleanValue() &&
//! this.isSprinting() && ! this.isUsingItem() && this.input.movementForward >= 0.8F &&
! this.isSprinting() && ! this.isUsingItem() && this.input.hasForwardMovement() &&
(this.getHungerManager().getFoodLevel() > 6.0F || this.getAbilities().allowFlying) &&
! this.hasStatusEffect(StatusEffects.BLINDNESS) && ! this.isTouchingWater())
Expand All @@ -98,8 +96,7 @@ private void overrideSprint(CallbackInfo ci)
}
}

// FIXME (Do this later)
@Redirect(method = "tickMovement", at = @At(value = "FIELD",
@Redirect(method = "shouldStopSprinting", at = @At(value = "FIELD",
target = "Lnet/minecraft/client/network/ClientPlayerEntity;horizontalCollision:Z"))
private boolean overrideCollidedHorizontally(ClientPlayerEntity player)
{
Expand All @@ -111,11 +108,12 @@ private boolean overrideCollidedHorizontally(ClientPlayerEntity player)
return player.horizontalCollision;
}

// FIXME (Do this later)
@Inject(method = "tickMovement",
/*
slice = @Slice(from = @At(value = "FIELD",
target = "Lnet/minecraft/client/option/GameOptions;sprintKey:Lnet/minecraft/client/option/KeyBinding;")),
at = @At(value = "FIELD", opcode = Opcodes.PUTFIELD, ordinal = 0, shift = At.Shift.AFTER,
*/
at = @At(value = "FIELD", opcode = Opcodes.PUTFIELD, ordinal = 2, shift = At.Shift.AFTER,
target = "Lnet/minecraft/client/network/ClientPlayerEntity;ticksLeftToDoubleTapSprint:I"))
private void disableDoubleTapSprint(CallbackInfo ci)
{
Expand Down Expand Up @@ -149,20 +147,6 @@ private void onFallFlyingCheckChestSlot(CallbackInfo ci)
}
}

@Inject(method = "shouldStopSprinting", at = @At("RETURN"), cancellable = true)
private void tweakeroo_fixSprintCancelWhenFlying(CallbackInfoReturnable<Boolean> cir)
{
if (Configs.Disable.DISABLE_ELYTRA_SPRINT_CANCEL.getBooleanValue() &&
cir.getReturnValue() &&
!this.hasVehicle() &&
!this.isInFluid() &&
this.isGliding() &&
this.getEquippedStack(EquipmentSlot.CHEST).isOf(Items.ELYTRA))
{
cir.setReturnValue(false);
}
}

@Inject(method = "onTrackedDataSet", at = @At("RETURN"))
private void onStopFlying(TrackedData<?> data, CallbackInfo ci)
{
Expand Down
3 changes: 0 additions & 3 deletions src/main/resources/assets/tweakeroo/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"tweakeroo.config.disable.comment.disableDeadMobRendering": "Prevents rendering dead mobs (entities that are at 0 health)",
"tweakeroo.config.disable.comment.disableDeadMobTargeting": "Prevents targeting entities that are at 0 health.\nThis fixes for example hitting already dead mobs.",
"tweakeroo.config.disable.comment.disableDoubleTapSprint": "Disables the double-tap-forward-key sprinting",
"tweakeroo.config.disable.comment.disableElytraSprintCancel": "Disables a Vanilla mechanism from 1.21.2+ that removes\nyou from sprinting while using an Elytra.",
"tweakeroo.config.disable.comment.disableEntityRendering": "Disables ALL except player entity rendering.\nThis is mainly meant for situations where you need to be\nable to do stuff to fix excessive entity count related problems",
"tweakeroo.config.disable.comment.disableEntityTicking": "Prevent everything except player entities from getting ticked",
"tweakeroo.config.disable.comment.disableFallingBlockEntityRendering": "If enabled, then falling block entities won't be rendered at all",
Expand Down Expand Up @@ -61,7 +60,6 @@
"tweakeroo.config.disable.name.disableDeadMobRendering": "disableDeadMobRendering",
"tweakeroo.config.disable.name.disableDeadMobTargeting": "disableDeadMobTargeting",
"tweakeroo.config.disable.name.disableDoubleTapSprint": "disableDoubleTapSprint",
"tweakeroo.config.disable.name.disableElytraSprintCancel": "disableElytraSprintCancel",
"tweakeroo.config.disable.name.disableEntityRendering": "disableEntityRendering",
"tweakeroo.config.disable.name.disableEntityTicking": "disableEntityTicking",
"tweakeroo.config.disable.name.disableFallingBlockEntityRendering": "disableFallingBlockEntityRendering",
Expand Down Expand Up @@ -107,7 +105,6 @@
"tweakeroo.config.disable.prettyName.disableDeadMobRendering": "Disable Dead Mob Rendering",
"tweakeroo.config.disable.prettyName.disableDeadMobTargeting": "Disable Dead Mob Targeting",
"tweakeroo.config.disable.prettyName.disableDoubleTapSprint": "Disable Double Tap Sprint",
"tweakeroo.config.disable.prettyName.disableElytraSprintCancel": "Disable Elytra Sprint Cancel",
"tweakeroo.config.disable.prettyName.disableEntityRendering": "Disable Entity Rendering",
"tweakeroo.config.disable.prettyName.disableEntityTicking": "Disable Entity Ticking",
"tweakeroo.config.disable.prettyName.disableFallingBlockEntityRendering": "Disable Falling Block Entity Rendering",
Expand Down
3 changes: 0 additions & 3 deletions src/main/resources/assets/tweakeroo/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"tweakeroo.config.disable.comment.disableDeadMobRendering": "不渲染死亡的怪物(生命值为 0 的实体),但这并不影响你与尸体交互",
"tweakeroo.config.disable.comment.disableDeadMobTargeting": "防止锁定生命值处于 0 的实体,开启后你将不会打到已死亡的怪物身上。\n§4注意:该功能不属于原版 + TAS 可实现或公平的功能§f\n§4使用此功能前请询问服务器管理是否允许此功能的使用§f",
"tweakeroo.config.disable.comment.disableDoubleTapSprint": "禁用后双击前进键时不会触发疾跑",
"tweakeroo.config.disable.comment.disableElytraSprintCancel": "Disables a Vanilla mechanism from 1.21.2+ that removes\nyou from sprinting while using an Elytra.",
"tweakeroo.config.disable.comment.disableEntityRendering": "禁用客户端中除了玩家外所有实体的渲染。\n当你需要去处理实体过多环境下的情况时,使用这个可以降低客户端的渲染压力",
"tweakeroo.config.disable.comment.disableEntityTicking": "禁止除玩家以外的所有实体运算",
"tweakeroo.config.disable.comment.disableFallingBlockEntityRendering": "如果启用,则掉落的方块实体将不会被渲染",
Expand Down Expand Up @@ -61,7 +60,6 @@
"tweakeroo.config.disable.name.disableDeadMobRendering": "禁用怪物尸体渲染",
"tweakeroo.config.disable.name.disableDeadMobTargeting": "禁用怪物尸体交互",
"tweakeroo.config.disable.name.disableDoubleTapSprint": "禁用双击疾跑",
"tweakeroo.config.disable.name.disableElytraSprintCancel": "disableElytraSprintCancel",
"tweakeroo.config.disable.name.disableEntityRendering": "禁用实体渲染",
"tweakeroo.config.disable.name.disableEntityTicking": "禁用实体刻",
"tweakeroo.config.disable.name.disableFallingBlockEntityRendering": "禁用掉落方块渲染",
Expand Down Expand Up @@ -107,7 +105,6 @@
"tweakeroo.config.disable.prettyName.disableDeadMobRendering": "禁用怪物尸体渲染",
"tweakeroo.config.disable.prettyName.disableDeadMobTargeting": "禁用怪物尸体交互",
"tweakeroo.config.disable.prettyName.disableDoubleTapSprint": "禁用双击疾跑",
"tweakeroo.config.disable.prettyName.disableElytraSprintCancel": "Disable Elytra Sprint Cancel",
"tweakeroo.config.disable.prettyName.disableEntityRendering": "禁用实体渲染",
"tweakeroo.config.disable.prettyName.disableEntityTicking": "禁用实体刻",
"tweakeroo.config.disable.prettyName.disableFallingBlockEntityRendering": "禁用掉落方块渲染",
Expand Down
3 changes: 0 additions & 3 deletions src/main/resources/assets/tweakeroo/lang/zh_tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"tweakeroo.config.disable.comment.disableDeadMobRendering": "不繪製死亡的怪物(生命值為 0 的實體),但這並不影響你與屍體互動",
"tweakeroo.config.disable.comment.disableDeadMobTargeting": "防止鎖定生命值處於 0 的實體,開啟後你將不會打到已死亡的怪物身上。\n§4注意:該功能不屬於原版 + TAS 可實現或公平的功能§f\n§4使用此功能前請詢問伺服器管理是否允許此功能的使用§f",
"tweakeroo.config.disable.comment.disableDoubleTapSprint": "停用後雙擊前進鍵時不會觸發疾走",
"tweakeroo.config.disable.comment.disableElytraSprintCancel": "Disables a Vanilla mechanism from 1.21.2+ that removes\nyou from sprinting while using an Elytra.",
"tweakeroo.config.disable.comment.disableEntityRendering": "停用客戶端中除了玩家外所有實體的繪製。\n當你需要去處理實體過多環境下的情況時,使用這個可以降低客戶端的繪製壓力",
"tweakeroo.config.disable.comment.disableEntityTicking": "禁止除玩家以外的所有實體運算",
"tweakeroo.config.disable.comment.disableFallingBlockEntityRendering": "如果啟用,則掉落的方塊實體將不會被繪製",
Expand Down Expand Up @@ -61,7 +60,6 @@
"tweakeroo.config.disable.name.disableDeadMobRendering": "停用怪物屍體繪製",
"tweakeroo.config.disable.name.disableDeadMobTargeting": "停用怪物屍體互動",
"tweakeroo.config.disable.name.disableDoubleTapSprint": "停用雙擊疾走",
"tweakeroo.config.disable.name.disableElytraSprintCancel": "disableElytraSprintCancel",
"tweakeroo.config.disable.name.disableEntityRendering": "停用實體繪製",
"tweakeroo.config.disable.name.disableEntityTicking": "停用實體刻",
"tweakeroo.config.disable.name.disableFallingBlockEntityRendering": "停用掉落方塊繪製",
Expand Down Expand Up @@ -107,7 +105,6 @@
"tweakeroo.config.disable.prettyName.disableDeadMobRendering": "停用怪物屍體繪製",
"tweakeroo.config.disable.prettyName.disableDeadMobTargeting": "停用怪物屍體互動",
"tweakeroo.config.disable.prettyName.disableDoubleTapSprint": "停用雙擊疾走",
"tweakeroo.config.disable.prettyName.disableElytraSprintCancel": "Disable Elytra Sprint Cancel",
"tweakeroo.config.disable.prettyName.disableEntityRendering": "停用實體繪製",
"tweakeroo.config.disable.prettyName.disableEntityTicking": "停用實體刻",
"tweakeroo.config.disable.prettyName.disableFallingBlockEntityRendering": "停用掉落方塊繪製",
Expand Down

0 comments on commit bed5061

Please sign in to comment.