mirror of
https://github.com/chylex/Better-Controls.git
synced 2025-04-22 09:15:46 +02:00
Release 1.2.4 for Minecraft 1.19.4+
This commit is contained in:
parent
5ce4f2a975
commit
2b15c5836c
gradle.properties
src/main/java/chylex/bettercontrols
@ -9,15 +9,15 @@ modSourcesURL=https://github.com/chylex/Better-Controls
|
||||
modIssuesURL=https://github.com/chylex/Better-Controls/issues
|
||||
|
||||
# Dependencies
|
||||
minecraftVersion=1.19.3
|
||||
forgeVersion=44.0.11
|
||||
fabricVersion=0.14.11
|
||||
minecraftVersion=1.19.4
|
||||
forgeVersion=45.0.6
|
||||
fabricVersion=0.14.17
|
||||
loomVersion=0.12
|
||||
mixinVersion=0.8.5
|
||||
|
||||
# Constraints
|
||||
minimumMinecraftVersion=1.19.3
|
||||
minimumForgeVersion=44.0.0
|
||||
minimumMinecraftVersion=1.19.4
|
||||
minimumForgeVersion=45.0.0
|
||||
minimumFabricVersion=0.7.4
|
||||
|
||||
# Gradle
|
||||
|
@ -57,6 +57,14 @@ public final class TextWidget extends GuiComponent implements OptionWidget {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFocused(final boolean focused) {}
|
||||
|
||||
@Override
|
||||
public boolean isFocused() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(final @NotNull PoseStack matrices, final int mouseX, final int mouseY, final float delta) {
|
||||
final Font textRenderer = Minecraft.getInstance().font;
|
||||
|
@ -16,9 +16,12 @@ public abstract class HookPlayerFlightSpeed extends LivingEntity {
|
||||
}
|
||||
|
||||
@Redirect(
|
||||
method = "travel",
|
||||
method = "getFlyingSpeed",
|
||||
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/player/Player;isSprinting()Z"),
|
||||
slice = @Slice(from = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/player/Abilities;getFlyingSpeed()F"))
|
||||
slice = @Slice(
|
||||
from = @At(value = "FIELD", target = "Lnet/minecraft/world/entity/player/Abilities;flying:Z"),
|
||||
to = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/player/Abilities;getFlyingSpeed()F")
|
||||
)
|
||||
)
|
||||
private boolean disableVanillaSprintBoost(final Player player) {
|
||||
return false;
|
||||
|
@ -7,16 +7,17 @@ import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@Mixin(OptionInstance.class)
|
||||
public abstract class HookToggleOptionButtons {
|
||||
@Inject(method = "createButton", at = @At("RETURN"))
|
||||
private void disableToggleOptions(final Options options, final int x, final int y, final int width, final CallbackInfoReturnable<AbstractWidget> ci) {
|
||||
@Inject(method = "createButton(Lnet/minecraft/client/Options;IIILjava/util/function/Consumer;)Lnet/minecraft/client/gui/components/AbstractWidget;", at = @At("RETURN"))
|
||||
private <T> void disableToggleOptions(final Options options, final int x, final int y, final int width, final Consumer<T> callback, final CallbackInfoReturnable<AbstractWidget> cir) {
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
final OptionInstance<?> me = (OptionInstance<?>)(Object)this;
|
||||
|
||||
if (me == options.toggleCrouch() || me == options.toggleSprint()) {
|
||||
ci.getReturnValue().active = false;
|
||||
cir.getReturnValue().active = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user