-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
easy etherwarp #95
base: main
Are you sure you want to change the base?
easy etherwarp #95
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't copy paste random stuff into this mod
Use Odin's built in utilities
private val etherOnShift: Boolean by BooleanSetting("On Sneak", false, description = "Etherwarps on sneak.") | ||
|
||
@SubscribeEvent | ||
fun onMouseEvent(event: MouseEvent) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Odin's Input event
|
||
@SubscribeEvent | ||
fun onMouseEvent(event: MouseEvent) { | ||
if (etherOnLC && event.button == 0 && event.buttonstate) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge if statement
if (etherOnLC && event.button == 0 && event.buttonstate) { | ||
if (isHolding("ASPECT_OF_THE_VOID")) { | ||
if (!etherOnShift) { | ||
performEtherwarp(withSneak = true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline the if statement
} | ||
|
||
@SubscribeEvent | ||
fun onKeyInput(event: KeyInputEvent) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Odin's input events
|
||
@SubscribeEvent | ||
fun onKeyInput(event: KeyInputEvent) { | ||
if (etherOnShift && mc.gameSettings.keyBindSneak.isKeyDown) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merge if statements
mc.thePlayer.isSneaking = true | ||
} | ||
|
||
Timer().schedule(500) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Odin's runin function
private fun performEtherwarp(withSneak: Boolean) { | ||
if (withSneak) { | ||
KeyBinding.setKeyBindState(mc.gameSettings.keyBindSneak.keyCode, true) | ||
mc.thePlayer.isSneaking = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mc.thePlayer is nullable handle that
@@ -1,22 +1,22 @@ | |||
pluginManagement { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't touch this file
Also merge this into the Etherwarp Helper module no point making it seperate modules |
allows you to etherwarp on sneak/on left click with aotv