Skip to content
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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

easy etherwarp #95

wants to merge 14 commits into from

Conversation

x45k
Copy link
Contributor

@x45k x45k commented Aug 22, 2024

allows you to etherwarp on sneak/on left click with aotv

Copy link
Owner

@odtheking odtheking left a 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) {
Copy link
Owner

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) {
Copy link
Owner

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)
Copy link
Owner

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) {
Copy link
Owner

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) {
Copy link
Owner

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) {
Copy link
Owner

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
Copy link
Owner

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 {
Copy link
Owner

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

@odtheking
Copy link
Owner

Also merge this into the Etherwarp Helper module no point making it seperate modules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants