🔖 LambdaControls v1.0.0

This commit is contained in:
LambdAurora
2019-12-19 20:25:51 +01:00
parent 2e6b2f8434
commit 8ac0ee175f
7 changed files with 15 additions and 10 deletions

View File

@@ -21,6 +21,9 @@ repositories {
name = 'CottonMC' name = 'CottonMC'
url = 'http://server.bbkr.space:8081/artifactory/libs-snapshot' url = 'http://server.bbkr.space:8081/artifactory/libs-snapshot'
} }
repositories {
maven { url = "https://jitpack.io" }
}
} }
dependencies { dependencies {
@@ -30,7 +33,9 @@ dependencies {
modCompile "net.fabricmc:fabric-loader:${project.loader_version}" modCompile "net.fabricmc:fabric-loader:${project.loader_version}"
// Fabric API. This is technically optional, but you probably want it anyway. // Fabric API. This is technically optional, but you probably want it anyway.
modCompile "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" modApi "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modCompile "io.github.prospector:modmenu:1.8.0+build.16"
//modCompile "io.github.cottonmc:cotton-client-commands:0.4.2+1.14.3-SNAPSHOT" //modCompile "io.github.cottonmc:cotton-client-commands:0.4.2+1.14.3-SNAPSHOT"
implementation "org.jetbrains:annotations:17.0.0" implementation "org.jetbrains:annotations:17.0.0"

View File

@@ -4,15 +4,15 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/use # check these on https://fabricmc.net/use
minecraft_version=1.15 minecraft_version=1.15
yarn_mappings=1.15+build.1:v2 yarn_mappings=1.15+build.2:v2
loader_version=0.7.2+build.174 loader_version=0.7.2+build.174
# Mod Properties # Mod Properties
mod_version = 1.0.0-SNAPSHOT2 mod_version = 1.0.0
maven_group = me.lambdaurora maven_group = me.lambdaurora
archives_base_name = lambdacontrols archives_base_name = lambdacontrols
# Dependencies # Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.4.23+build.276-1.15 fabric_version=0.4.25+build.282-1.15

View File

@@ -467,7 +467,7 @@ public class LambdaInput
private void handle_rb_lb(@NotNull MinecraftClient client, boolean right) private void handle_rb_lb(@NotNull MinecraftClient client, boolean right)
{ {
// When ingame // When ingame
if (client.currentScreen == null) { if (client.currentScreen == null && client.player != null) {
if (right) if (right)
client.player.inventory.selectedSlot = client.player.inventory.selectedSlot == 8 ? 0 : client.player.inventory.selectedSlot + 1; client.player.inventory.selectedSlot = client.player.inventory.selectedSlot == 8 ? 0 : client.player.inventory.selectedSlot + 1;
else else
@@ -523,7 +523,8 @@ public class LambdaInput
{ {
Element focused = screen.getFocused(); Element focused = screen.getFocused();
if (focused != null) if (focused != null)
return this.handle_right_left_element(focused, right); if (this.handle_right_left_element(focused, right))
return this.change_focus(screen, right);
return true; return true;
} }

View File

@@ -16,6 +16,7 @@ import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.util.Window; import net.minecraft.client.util.Window;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
@@ -25,8 +26,9 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(MinecraftClient.class) @Mixin(MinecraftClient.class)
public abstract class MinecraftClientMixin public abstract class MinecraftClientMixin
{ {
@Final
@Shadow @Shadow
public Window window; private Window window;
@Shadow @Shadow
public boolean skipGameRender; public boolean skipGameRender;

View File

@@ -15,15 +15,12 @@ import net.minecraft.client.gui.screen.SettingsScreen;
import net.minecraft.client.gui.widget.AbstractButtonWidget; import net.minecraft.client.gui.widget.AbstractButtonWidget;
import net.minecraft.client.gui.widget.ButtonWidget; import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.options.GameOptions; import net.minecraft.client.options.GameOptions;
import net.minecraft.client.resource.language.I18n;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At; 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.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
/** /**
* Injects the new controls settings button. * Injects the new controls settings button.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB