1
0
mirror of https://github.com/chylex/Better-Controls.git synced 2025-04-22 09:15:46 +02:00

Unify with Forge codebase

This commit is contained in:
chylex 2021-10-02 15:30:44 +02:00
parent f0214983e5
commit a875ae2255
Signed by: chylex
GPG Key ID: 4DE42C8F19A80548
7 changed files with 8 additions and 4 deletions

View File

@ -14,6 +14,7 @@ dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
mappings minecraft.officialMojangMappings()
compileOnly "com.google.code.findbugs:jsr305:3.0.2"
}
processResources {

View File

@ -20,8 +20,8 @@ import net.minecraft.client.gui.screens.Screen;
import net.minecraft.network.chat.CommonComponents;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.TextComponent;
import org.jetbrains.annotations.Nullable;
import org.lwjgl.glfw.GLFW;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

View File

@ -3,7 +3,7 @@ import com.mojang.blaze3d.platform.InputConstants.Type;
import net.minecraft.client.KeyMapping;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.TranslatableComponent;
import org.jetbrains.annotations.Nullable;
import javax.annotation.Nullable;
public class KeyBindingWithModifier extends KeyMapping {
public static final String CATEGORY = "key.categories.bettercontrols";

View File

@ -9,6 +9,7 @@ import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.Slice;
import static chylex.bettercontrols.util.Statics.MINECRAFT;
@SuppressWarnings("MethodMayBeStatic")
@Mixin(AbstractClientPlayer.class)
public abstract class HookClientPlayerFOV {
@Redirect(
@ -19,7 +20,7 @@ public abstract class HookClientPlayerFOV {
to = @At(value = "INVOKE", target = "Ljava/lang/Float;isInfinite(F)Z")
)
)
private boolean resetFOV(float movementSpeed) {
private boolean resetFOV(final float movementSpeed) {
final LocalPlayer player = MINECRAFT.player;
return (player != null && PlayerTicker.get(player).shouldResetFOV(player)) || Float.isNaN(movementSpeed);
}

View File

@ -10,6 +10,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import static chylex.bettercontrols.util.Statics.MINECRAFT;
@SuppressWarnings("MethodMayBeStatic")
@Mixin(value = Minecraft.class, priority = 100)
public abstract class HookOpenScreen {
@Inject(method = "setScreen", at = @At("TAIL"))

View File

@ -8,6 +8,7 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.Slice;
@SuppressWarnings("MethodMayBeStatic")
@Mixin(Player.class)
public abstract class HookPlayerFlightSpeed extends LivingEntity {
protected HookPlayerFlightSpeed(final EntityType<? extends LivingEntity> type, final Level world) {

View File

@ -3,7 +3,7 @@
"minVersion": "0.8",
"package": "chylex.bettercontrols.mixin",
"compatibilityLevel": "JAVA_16",
"mixins": [
"client": [
"AccessCameraFields",
"AccessClientPlayerFields",
"AccessControlsListCategory",