-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
191ac4e
commit 5b88335
Showing
10 changed files
with
121 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
plugins { | ||
id("roundalib") version "0.3.6" | ||
} | ||
|
||
repositories { | ||
maven("https://jitpack.io") | ||
} | ||
|
||
dependencies { | ||
implementation("com.github.LlamaLad7:MixinExtras:0.1.1") | ||
annotationProcessor("com.github.LlamaLad7:MixinExtras:0.1.1") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/main/java/me/roundaround/armorstands/client/gui/screen/PassesEventsThrough.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package me.roundaround.armorstands.client.gui.screen; | ||
|
||
public interface PassesEventsThrough { | ||
boolean shouldPassEvents(); | ||
} |
11 changes: 5 additions & 6 deletions
11
src/main/java/me/roundaround/armorstands/mixin/InGameHudMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/main/java/me/roundaround/armorstands/mixin/KeyboardMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package me.roundaround.armorstands.mixin; | ||
|
||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue; | ||
import me.roundaround.armorstands.ArmorStandsMod; | ||
import me.roundaround.armorstands.client.gui.screen.AbstractArmorStandScreen; | ||
import me.roundaround.armorstands.client.gui.screen.PassesEventsThrough; | ||
import net.minecraft.client.Keyboard; | ||
import net.minecraft.client.gui.screen.Screen; | ||
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.CallbackInfo; | ||
|
||
@Mixin(Keyboard.class) | ||
public class KeyboardMixin { | ||
@ModifyExpressionValue( | ||
method = "onKey", | ||
at = @At( | ||
value = "FIELD", | ||
target = "Lnet/minecraft/client/MinecraftClient;currentScreen:Lnet/minecraft/client/gui/screen/Screen;", | ||
ordinal = 2 | ||
) | ||
) | ||
private Screen modifyCurrentScreen(Screen screen) { | ||
if (screen instanceof AbstractArmorStandScreen) { | ||
ArmorStandsMod.LOGGER.info("We're in the armor stand screen!"); | ||
} | ||
if (screen instanceof PassesEventsThrough && ((PassesEventsThrough) screen).shouldPassEvents()) { | ||
ArmorStandsMod.LOGGER.info("We're in a screen that passes events through!"); | ||
} | ||
return | ||
screen instanceof PassesEventsThrough && ((PassesEventsThrough) screen).shouldPassEvents() | ||
? null | ||
: screen; | ||
} | ||
|
||
@Inject(method = "onKey", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/InputUtil;fromKeyCode(II)Lnet/minecraft/client/util/InputUtil$Key;", shift = At.Shift.AFTER)) | ||
private void afterScreenCheck(long window, int key, int scancode, int action, int modifiers, CallbackInfo info) { | ||
ArmorStandsMod.LOGGER.info("We've made it!"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters