diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 024b42beda..14163e1086 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -11,6 +11,11 @@ on: - '**.java' - 'gradle**' - 'build.gradle' + # Makes it possible to run this workflow manually from the Actions tab + workflow_dispatch: + +permissions: + contents: write jobs: build: @@ -21,10 +26,10 @@ jobs: uses: actions/checkout@v4 - name: Validate Gradle wrapper - uses: gradle/wrapper-validation-action@v1 + uses: gradle/actions/wrapper-validation@v3 - name: Set up Java 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '17' distribution: 'microsoft' @@ -33,7 +38,14 @@ jobs: run: chmod +x gradlew - name: Setup Gradle - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 + + - name: Generate and submit dependency graph + uses: gradle/actions/dependency-submission@v3 + with: + build-scan-publish: true + build-scan-terms-of-use-url: "https://gradle.com/help/legal-terms-of-use" + build-scan-terms-of-use-agree: "yes" - name: Check code style with Spotless id: spotless_check diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 6373e4bcc8..f3942d43d4 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -11,7 +11,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@main + - uses: actions/stale@v9 with: stale-issue-message: | This issue has been open for a while with no recent activity. If this issue is still important to you, please add a comment within the next 7 days to keep it open. Otherwise, the issue will be automatically closed to free up time for other tasks. @@ -31,7 +31,9 @@ jobs: - They have bugs or conflicts that won't be resolved days-before-stale: 60 days-before-close: 7 + exempt-issue-labels: "status:never-stale" + exempt-pr-labels: "status:never-stale" stale-issue-label: "status:stale" stale-pr-label: "status:stale" - operations-per-run: 50 + operations-per-run: 200 enable-statistics: true diff --git a/.gitignore b/.gitignore index e9b6731581..5eb7947162 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ bin/ run/ *.launch +remappedSrc/ # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000000..8bcce1cd82 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,96 @@ +# Security Policy + +## Supported Versions + +Generally, Wurst Client versions for the latest Minecraft release and for the latest Minecraft snapshot are supported. + +Older versions are decided on a case-by-case basis, depending on the severity of the exploit. + +## Reporting a Vulnerability + +You can report a vulnerability by sending an email to contact.wurstimperium@gmail.com. + +If you want to encrypt your email with PGP (you don't have to), then you can find my public key below: + +``` +-----BEGIN PGP PUBLIC KEY BLOCK----- + +xsFNBGFfchsBEACOinHGKb+lkWdZvQ2sPmlgPEpUG3uWUUOd4+64zFANbbZN +hw3lNbUty8TtXbjDIPSRU0mTZ51DxBRTnOVNCRvzDEPe0bR1iZ8URpzSVJZQ +x9ER7b8d9HkMI78x+bx1lcjzyzoSGzoN0+3QuBJ8iMkqT5dgfpklQ33DDWh5 +7h13dNNWDfg+UJXt3L04N3wfe78CRQnqmjp4d1blFv1q/LhKz7T6WWBjbk7r +VjlOJUVA811nNA7wiwpykGjIE7k1QI2ExZLIAUhWMqtnrEsz0vgEhGRnUJDw +q0jEz7Ano8SZPfOZeTmy/MC+h9VURCc39ULD5lhAj+t3cIIIsykXvB+YEfHH +tDpeSnVT8oe5n7UlKhPRktDZ1xdviwixyY60Lg5IPU18l4ypibqkFNtoqf82 +3afg2lLZ/sYmh5Wf4qbGewWkqiLbShE/KiFgobHnwP2KUhd7+uGFl+xFfwi9 +5ZNzWvCnONYnctzQeEq+wAN64nSUkymFp7ohJufFaegAA37sFOrZ/FeQEXOL +gMYMEZf7rEX1tuByNuaAgdT8TFkdhwkC/gmlqXIFZ7BlvyNMI3MOh0U8Skk0 +iL1PkYOWWVBg2eHGSnaFRz9JTaXFJxk7hpQc7ykXldjOg7Q3Zq61esLKFa+J +zJF27JiBN9W0kmU4mpGsFDbQe3nJbOMlK0dFlQARAQABzTBBbGV4YW5kZXIw +MTk5OCA8Y29udGFjdC53dXJzdGltcGVyaXVtQGdtYWlsLmNvbT7CwXUEEAEI +AB8FAmFfchsGCwkHCAMCBBUICgIDFgIBAhkBAhsDAh4BAAoJEN1/LAg9eYnj +X+UP/jmoBwCp+1V+LIYf8u06OPYaLfjtB3bOhU7NL+bNwdOJyGHWb23d8Ut7 +6G59ZIj/gLGw6Kwyp1qG6h8/KEVpb5dQofSZwwLrldX689p1s/FeFfQH/pb3 +XeiNi1xXqmbgnEiJ86em1pWvQoEbcGElSR443513OmGqDUldMhnvUM7Zk5yd +bYOYqW0g1naLequziiXwT/rqvy+lfp/N6+wgiQ7sdxIHpRFjgEu1z4XDDfvF +X9Fy4V/57W+B7xPaJeB3bK94h//nAY1+yV32SZ3nkgqDgJerhdRkVatGWU6i +12Cyz2J0zQgqiQV158EODHjgZIAzeDVwk0imidrFg7gk0dsjxCwTmEX5TaEa +7F0gZ3cyYyIbOIRCUnlQ9VpkqW7ulCVks5zW8DiZiKsnhfYh/Ddz1SBnbcK3 +4Hfi+GYQf+dDCRRAjgknyMNTzOjYe4pK7ZJFavSH1svwkyM2e2VxFExp+Z8x +4Lbq198JClwXjA4+VUp0xYNvJt4AHa2YpbwJr++uNZETWQkuQpcdO6cA2P54 +cztjsVRGmGklAFwoh+n7o4wkX32uWuCdN5Sp7TU2vFlGftBvXa2ssupcxuCk +PVGx3VtCqNf2HbTzX47IPrRCiCmhodkFKDL2wlADOaxGuJli6mPxXRnqvhF8 +rYO9yoWr3z5Mp9Tx9lIKoyE/wr1WwsF7BBABCAAlBQJjAB44BQkHRYHFBgsJ +BwgDAgQVCAoCAxYCAQIZAQIbAwIeAQAKCRDdfywIPXmJ46C3EACA3SvXuxp6 +3jb3CZsm4HCn2Ao2+WgLMxGUvIoPScEaeUw5o+14O0uRfg2PunB/ADgioLBF +bCwI6a23pSwNYlOvHjJmmA/f0qVhO2kCnOng0GappHFyL3l4mToNJu0z9ELe +4KikiTD3ce7K7WT8fYSeoVcQyRKcK4Zntr+K5+v9/qRDsYsV9fSqb/erUYPM +ywTLAGB7cVnagAQjw9CcOnpFrQ6cWBMLWE3KpmIhQtB0SoXL9WYkvFtNJL7h +UeAXPI0Ug1/DR2aHYBkUbus/Hq6A+BdBUMoD7eX/5dsiAgTI+WgvNxkfsgbH +2UztWK9tG3h7T1FeFgmkOj6EDHbOePoW0ZHONYcslKNcuAWtJ6EAFbZzvBeQ +Bn/Y29ZNAJy1parU7WgAc8138kq6bJIXNVKoxya248B5kN0o+necU+cCVZls +Uhc5zMp/98829FEOJ4BwUSTbVtulVUvozdX5P5kZOgemP0ITEG0y/0M+7rfL +wo9HG2wCd0t3xwpbzCpVAWTbm88WIr0z2UwmchGkHhRZV4lCB3VZm+rkvM5N +SM04KiqxfKYgLqQroA+RHjipGjdhlQgeY5Vgm+0Jyk1nhtSlhP9moO9G4GGf +HiI3zwOyAC9MsX4idRtpHzRVIC7zGrSChd0sdorBJgdj4jpkGn+hsIghICD9 +eb+Yn7nmCpwmtMLBkAQQAQgARAWCZh/xggWJEKzUxQQLCQcICZDdfywIPXmJ +4wMVCAoEFgACAQIZAQKbAwIeARYhBOaMq35XTFkJLk6qy91/LAg9eYnjAABo +bhAAgYUsby0c4u3cWT05y+6lgvWA17P1Ij5BFgUG+HSvT6VgdSx9XgYTjSEZ +TiAn2ckpBM3KCfhaRlhvjR+prCIpeGNbbwMD2DfYNsEVm6lv5DuQGTknmWt1 +6OUFfne4EKBlJb35Yqulu4i/8VIEISmCwOdA1pNmZhc0DNWuWtg1H0KkrWm1 +NOe4ydRlamXZFUtNGaxYFHXMYikkRIKr8xv6s0agTSwcrs+tHuw8w+BY4Man +ZDKuW9x0FwBwaJDOodEMuvwjbSMZuXdnuteEm3/kKLsjdzrhZ8WZ68vITIQh +9FASkBklmstxbcqkBtXKZKnT04tJmwrNQ6wS9tVIqkFlnuaN0e8MZ3Ixe6kR +GfPrgHASpzrDw3SmySZwbl6z5y/AnlaMNW76pkpMUDfsMmh4UmlZXBTlppf7 +kE19BzAtjc5WLzC/oX7quJZsaEylU8TzcVTTaL05DfLxDKZa8eZ/VdwPLtqa +Z5YJM6Q7FPToC3R8/eYvlG4eYsHqWB0Tqnb3p9SRMLKdVPH4sI7SbJ3jYOR+ +Xwjn+/tzHq+QN8HUWKPS2qY5z1IOxdIqnyUznzxFDKjJesIv+7lixZ+7daM5 +HhzhLHznrKSFk+/3P1IBA7LfpeOOP4HCa2ebN6buJ4NQCWsbzI14u9pMmb6q +h5FBIa3BhDeK/D5mlG5iEliR0b7OwU0EYV9yGwEQAPCXe9lYKoiKYLgPgMvo +AMtfqykIwyM/jG+u90Zekt8gm+sP/YrVuLwWT8Q8dH5KqZNK15YcyBQR3iUn +O+VpXFZAvA2toTjMB/1XzB7um1V2MY2I2rzOOS14lVNjvieRuk6YvjPEeiCR +rj/t8goe/gjsyiV9v6qtp7OEJ2DIiV33AYz2fJQHODWbY8IQqunCOxL3PNwX +igiMw4wk8WG6DYVwW87HiPJD8RmTJgTG48knxjxeyEitI0MdfqGaDz6nAPN8 +W0gIuGu0TiXuQxZ8FtpEhDrz5RKpjn1i/5PoEePf3gaZhQFh7aQ9gvuMgOeM +ObY7VxFPVLPQ7Y+vwYXVBtJrHw1S0i3VC9M5YsLIEFy9uIZFnVQpF3skul1r +VKz5irqmHZEj2Jlfri/rWUAsUnHAgJoQeydLIHTIZnJwKWpqkF46lncHMIan ++ouY4O84HBcvAGCmwXfiSeEOO4wkOm4OW7SnVD0D74MObEKVNOBYdftmIZ7H +4gLWd8LFyywyxMctoxqpHjWpMfRYR7u05B0MMbx4bdRWN3EA1mmNV/I/JEMe +agG1HQqkLGHNnVmbux10Tpux0kOokyMDZ0OaxgRACeDeNkHMZLgOxqPJGlbl +3kX8KV09yVIRIsL/zeV8QPeQGQM4lcR3m2aE3RqJxNPoQR2eV9guBwjNnE4J +7FERABEBAAHCwXwEGAEIADAFgmYf8YIFiRCs1MUJkN1/LAg9eYnjApsMFiEE +5oyrfldMWQkuTqrL3X8sCD15ieMAAHaoD/9AtPpXEmmBdK5gNnf+N9c41cSm +shKxmyYtf2HrDECVFstEbI7EWqOouoiuWkA8VajFBHAmCl6XAg2cOxoaWLds +txeAHXl+4VQ4Hh07tE0jEHfwo/AryJ4P+lYCZSfcWKukSnNsf2BPBiSPHJr2 +w6b6xqCS354doX9agT3zyukWQvBQMqN4kTEieTCokgytkDssyKqmcLAv2Owj +8BrpZkASEGvARoBFtY5nd0MC8zgCHIoXiX6s9ld2cP+MCeskULSQsmR0X76X +uFa42Z2a5qrmAr0KCP8RHnby6o1VvV5yOUAkskA9IqPKahLrsusP4owGac/Z +pRI8/T/HsO9Prg9SMQ5IbPjfO5Cc1zaFhVKZYjBTSAptqngE7S48ch9IatU7 +zH4ifR3KeMru8XVMI7t0OT1eQLx9U41gCUOCvXnQCJbsdaw3ggt8GW3eBaJU +fkzAMxAXaN1znBke63oDVuatz+XCuIiaWk9LA0k9gB/XGx43e6KfMnfc94Zx +Kkub06h5q2nQpbgDNyjMxZ98G3128HKSRJZx2SfQFOAZo48W9S8yUfsrb0u4 +ikTh0kY7gbmgbAFu/HaxCG/amTctx8yFUcwmJchCLs+Bos1MkklXAPD5FELj +uPuP631Zmcw4GdqstRazLV1+qnJWLUCx7sZ3goqe4rc8dC3s1Poyes7xpw== +=8sQI +-----END PGP PUBLIC KEY BLOCK----- +``` diff --git a/build.gradle b/build.gradle index 2613a25783..41e912b04c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,13 +1,13 @@ buildscript { dependencies { - classpath 'org.kohsuke:github-api:1.135' + classpath 'org.kohsuke:github-api:1.321' } } plugins { - id 'fabric-loom' version '1.5-SNAPSHOT' + id 'fabric-loom' version '1.6-SNAPSHOT' id 'maven-publish' - id 'com.diffplug.spotless' version '6.23.3' + id 'com.diffplug.spotless' version '6.25.0' } def ENV = System.getenv() @@ -88,7 +88,7 @@ spotless { // configure the maven publication publishing { publications { - mavenJava(MavenPublication) { + create("mavenJava", MavenPublication) { from components.java } } diff --git a/codestyle/cleanup.xml b/codestyle/cleanup.xml index 70a36773b5..a6aa8d3e52 100644 --- a/codestyle/cleanup.xml +++ b/codestyle/cleanup.xml @@ -1,144 +1,147 @@ - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - + + + + - - - - + - - + + + - - + + + + + + + + + - - - - - - + + + + - - + + + + + + + + - - - - + + + + + + + + + + + + + + + - - - - + - - - - - - - - - - - - - - + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + - - - - + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + - - - - - - + - - - + + + + + + + + + + + + + + + + + + + + diff --git a/codestyle/formatter.xml b/codestyle/formatter.xml index b44984ad7b..3c2ecb64ab 100644 --- a/codestyle/formatter.xml +++ b/codestyle/formatter.xml @@ -200,6 +200,7 @@ + @@ -280,6 +281,7 @@ + @@ -310,6 +312,7 @@ + diff --git a/gradle.properties b/gradle.properties index 9192d49c51..5f00458e8b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,13 +7,13 @@ org.gradle.parallel=true # https://www.curseforge.com/minecraft/mc-mods/fabric-api minecraft_version=1.20.4 yarn_mappings=1.20.4+build.3 -loader_version=0.15.7 +loader_version=0.15.10 #Fabric api -fabric_version=0.96.4+1.20.4 +fabric_version=0.97.0+1.20.4 # Mod Properties -mod_version = v7.41.1-MC1.20.4 +mod_version = v7.41.2-MC1.20.4 maven_group = net.wurstclient archives_base_name = Wurst-Client diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7f93135c49..d64cd49177 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1af9e0930b..b82aa23a4f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 31042a6773..1aa94a4269 100644 --- a/gradlew +++ b/gradlew @@ -246,4 +246,4 @@ eval "set -- $( tr '\n' ' ' )" '"$@"' -exec "$JAVACMD" "$@" \ No newline at end of file +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 6689b85bee..13ba5d3cb8 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -89,4 +89,4 @@ exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal -:omega +:omega \ No newline at end of file diff --git a/src/main/java/net/wurstclient/WurstClient.java b/src/main/java/net/wurstclient/WurstClient.java index 03a5337434..c1887b5b23 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -58,7 +58,7 @@ public enum WurstClient public static MinecraftClient MC; public static IMinecraftClient IMC; - public static final String VERSION = "7.41.1"; + public static final String VERSION = "7.41.2"; public static final String MC_VERSION = "1.20.4"; private WurstAnalytics analytics; diff --git a/src/main/java/net/wurstclient/commands/PotionCmd.java b/src/main/java/net/wurstclient/commands/PotionCmd.java index 9a478c36bc..a2c3d05655 100644 --- a/src/main/java/net/wurstclient/commands/PotionCmd.java +++ b/src/main/java/net/wurstclient/commands/PotionCmd.java @@ -7,15 +7,15 @@ */ package net.wurstclient.commands; -import java.util.List; +import java.util.ArrayList; import net.minecraft.entity.effect.StatusEffect; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.item.ItemStack; import net.minecraft.item.PotionItem; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.nbt.NbtList; +import net.minecraft.potion.Potion; import net.minecraft.potion.PotionUtil; +import net.minecraft.potion.Potions; import net.minecraft.registry.Registries; import net.minecraft.util.Identifier; import net.minecraft.util.InvalidIdentifierException; @@ -60,15 +60,18 @@ public void call(String[] args) throws CmdException throw new CmdSyntaxError(); // get effects to start with - NbtList effects; + ArrayList effects; + Potion potion; switch(args[0].toLowerCase()) { case "add": - effects = convertEffectsToNbt(stack); + effects = new ArrayList<>(PotionUtil.getCustomPotionEffects(stack)); + potion = PotionUtil.getPotion(stack); break; case "set": - effects = new NbtList(); + effects = new ArrayList<>(); + potion = Potions.EMPTY; break; default: @@ -78,97 +81,75 @@ public void call(String[] args) throws CmdException // add new effects for(int i = 0; i < (args.length - 1) / 3; i++) { - NbtCompound effect = new NbtCompound(); + StatusEffect effect = parseEffect(args[1 + i * 3]); + int amplifier = parseInt(args[2 + i * 3]) - 1; + int duration = parseInt(args[3 + i * 3]) * 20; - effect.putInt("id", parseEffectId(args[1 + i * 3])); - effect.putInt("amplifier", parseInt(args[2 + i * 3]) - 1); - effect.putInt("duration", parseInt(args[3 + i * 3]) * 20); - - effects.add(effect); + effects.add(new StatusEffectInstance(effect, duration, amplifier)); } - NbtCompound nbt = new NbtCompound(); - nbt.put("custom_potion_effects", effects); - stack.setNbt(nbt); + PotionUtil.setPotion(stack, potion); + setCustomPotionEffects(stack, effects); ChatUtils.message("Potion modified."); } - private NbtList convertEffectsToNbt(ItemStack stack) - { - NbtList nbt = new NbtList(); - List effects = - PotionUtil.getCustomPotionEffects(stack); - - for(StatusEffectInstance effect : effects) - { - NbtCompound tag = new NbtCompound(); - - int id = Registries.STATUS_EFFECT.getRawId(effect.getEffectType()); - tag.putInt("id", id); - tag.putInt("amplifier", effect.getAmplifier()); - tag.putInt("duration", effect.getDuration()); - - nbt.add(tag); - } - - return nbt; - } - private void remove(ItemStack stack, String[] args) throws CmdSyntaxError { if(args.length != 2) throw new CmdSyntaxError(); - int id = parseEffectId(args[1]); + StatusEffect targetEffect = parseEffect(args[1]); - List oldEffects = - PotionUtil.getCustomPotionEffects(stack); + Potion oldPotion = PotionUtil.getPotion(stack); + boolean mainPotionContainsTargetEffect = oldPotion.getEffects().stream() + .anyMatch(effect -> effect.getEffectType() == targetEffect); - NbtList newEffects = new NbtList(); - for(StatusEffectInstance oldEffect : oldEffects) - { - int oldId = - Registries.STATUS_EFFECT.getRawId(oldEffect.getEffectType()); - - if(oldId == id) - continue; - - NbtCompound effect = new NbtCompound(); - effect.putInt("id", oldId); - effect.putInt("amplifier", oldEffect.getAmplifier()); - effect.putInt("duration", oldEffect.getDuration()); - newEffects.add(effect); - } + ArrayList newEffects = new ArrayList<>(); + if(mainPotionContainsTargetEffect) + PotionUtil.getPotionEffects(stack).forEach(newEffects::add); + else + PotionUtil.getCustomPotionEffects(stack).forEach(newEffects::add); + newEffects.removeIf(effect -> effect.getEffectType() == targetEffect); + + Potion newPotion = + mainPotionContainsTargetEffect ? Potions.EMPTY : oldPotion; - NbtCompound nbt = new NbtCompound(); - nbt.put("custom_potion_effects", newEffects); - stack.setNbt(nbt); + PotionUtil.setPotion(stack, newPotion); + setCustomPotionEffects(stack, newEffects); ChatUtils.message("Effect removed."); } - private int parseEffectId(String input) throws CmdSyntaxError + private StatusEffect parseEffect(String input) throws CmdSyntaxError { - int id = 0; + StatusEffect effect; if(MathUtils.isInteger(input)) - id = Integer.parseInt(input); + effect = Registries.STATUS_EFFECT.get(Integer.parseInt(input)); else try { Identifier identifier = new Identifier(input); - StatusEffect effect = Registries.STATUS_EFFECT.get(identifier); - - id = Registries.STATUS_EFFECT.getRawId(effect); + effect = Registries.STATUS_EFFECT.get(identifier); }catch(InvalidIdentifierException e) { throw new CmdSyntaxError("Invalid effect: " + input); } - if(id < 1) - throw new CmdSyntaxError(); + if(effect == null) + throw new CmdSyntaxError("Invalid effect: " + input); - return id; + return Registries.STATUS_EFFECT.getEntry(effect).value(); + } + + private void setCustomPotionEffects(ItemStack stack, + ArrayList effects) + { + // PotionUtil doesn't remove effects when passing an empty list to it + if(effects.isEmpty()) + stack.removeSubNbt("custom_potion_effects"); + else + PotionUtil.setCustomPotionEffects(stack, effects); } private int parseInt(String s) throws CmdSyntaxError diff --git a/src/main/java/net/wurstclient/hacks/AirPlaceHack.java b/src/main/java/net/wurstclient/hacks/AirPlaceHack.java index d0b4e56414..a737559b5f 100644 --- a/src/main/java/net/wurstclient/hacks/AirPlaceHack.java +++ b/src/main/java/net/wurstclient/hacks/AirPlaceHack.java @@ -31,13 +31,13 @@ public AirPlaceHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(RightClickListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(RightClickListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/AnchorAuraHack.java b/src/main/java/net/wurstclient/hacks/AnchorAuraHack.java index edd616248b..27b3eb154d 100644 --- a/src/main/java/net/wurstclient/hacks/AnchorAuraHack.java +++ b/src/main/java/net/wurstclient/hacks/AnchorAuraHack.java @@ -91,13 +91,13 @@ public AnchorAuraHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/AntiAfkHack.java b/src/main/java/net/wurstclient/hacks/AntiAfkHack.java index d13341c3a7..8a24de863a 100644 --- a/src/main/java/net/wurstclient/hacks/AntiAfkHack.java +++ b/src/main/java/net/wurstclient/hacks/AntiAfkHack.java @@ -54,7 +54,7 @@ public AntiAfkHack() } @Override - public void onEnable() + protected void onEnable() { start = BlockPos.ofFloored(MC.player.getPos()); nextBlock = null; @@ -68,7 +68,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(RenderListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/AntiHungerHack.java b/src/main/java/net/wurstclient/hacks/AntiHungerHack.java index 2585f0596b..98a3f95709 100644 --- a/src/main/java/net/wurstclient/hacks/AntiHungerHack.java +++ b/src/main/java/net/wurstclient/hacks/AntiHungerHack.java @@ -24,13 +24,13 @@ public AntiHungerHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(PacketOutputListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(PacketOutputListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/AntiSpamHack.java b/src/main/java/net/wurstclient/hacks/AntiSpamHack.java index efae48f64a..6066e8b7ad 100644 --- a/src/main/java/net/wurstclient/hacks/AntiSpamHack.java +++ b/src/main/java/net/wurstclient/hacks/AntiSpamHack.java @@ -32,13 +32,13 @@ public AntiSpamHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(ChatInputListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(ChatInputListener.class, this); } @@ -135,7 +135,17 @@ public void onReceivedMessage(ChatInputEvent event) } if(spamCounter > 1) - event.setComponent(((MutableText)event.getComponent()) - .append(" [x" + spamCounter + "]")); + { + // Someone, somewhere, is creating a MutableText object with an + // immutable List siblings parameter, which causes the game to + // crash when calling append(). So we always have to create a new + // MutableText object to avoid that. + MutableText oldText = (MutableText)event.getComponent(); + MutableText newText = MutableText.of(oldText.getContent()); + newText.setStyle(oldText.getStyle()); + oldText.getSiblings().forEach(newText::append); + + event.setComponent(newText.append(" [x" + spamCounter + "]")); + } } } diff --git a/src/main/java/net/wurstclient/hacks/AutoArmorHack.java b/src/main/java/net/wurstclient/hacks/AutoArmorHack.java index 0e609ad26e..4a2ae1d80b 100644 --- a/src/main/java/net/wurstclient/hacks/AutoArmorHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoArmorHack.java @@ -63,7 +63,7 @@ public AutoArmorHack() } @Override - public void onEnable() + protected void onEnable() { timer = 0; EVENTS.add(UpdateListener.class, this); @@ -71,7 +71,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(PacketOutputListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/AutoBuildHack.java b/src/main/java/net/wurstclient/hacks/AutoBuildHack.java index 6139831a41..27c6fbc361 100644 --- a/src/main/java/net/wurstclient/hacks/AutoBuildHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoBuildHack.java @@ -117,7 +117,7 @@ public String getRenderName() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); EVENTS.add(RightClickListener.class, this); @@ -125,7 +125,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(RightClickListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/AutoCompleteHack.java b/src/main/java/net/wurstclient/hacks/AutoCompleteHack.java index 800a2e6d8e..98a7db80b5 100644 --- a/src/main/java/net/wurstclient/hacks/AutoCompleteHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoCompleteHack.java @@ -75,7 +75,7 @@ protected void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(ChatOutputListener.class, this); EVENTS.remove(UpdateListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/AutoDropHack.java b/src/main/java/net/wurstclient/hacks/AutoDropHack.java index 61bccfe3c5..9c2e6a0ff2 100644 --- a/src/main/java/net/wurstclient/hacks/AutoDropHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoDropHack.java @@ -49,13 +49,13 @@ public String getRenderName() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/AutoEatHack.java b/src/main/java/net/wurstclient/hacks/AutoEatHack.java index c038007f28..5a4c19d9f6 100644 --- a/src/main/java/net/wurstclient/hacks/AutoEatHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoEatHack.java @@ -108,13 +108,13 @@ public AutoEatHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/AutoFarmHack.java b/src/main/java/net/wurstclient/hacks/AutoFarmHack.java index 6a5dac5e3b..59707fc6cb 100644 --- a/src/main/java/net/wurstclient/hacks/AutoFarmHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoFarmHack.java @@ -79,7 +79,7 @@ public AutoFarmHack() } @Override - public void onEnable() + protected void onEnable() { plants.clear(); @@ -88,7 +88,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(RenderListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/AutoFishHack.java b/src/main/java/net/wurstclient/hacks/AutoFishHack.java index 1db80e85eb..c0f290589a 100644 --- a/src/main/java/net/wurstclient/hacks/AutoFishHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoFishHack.java @@ -89,7 +89,7 @@ public String getRenderName() } @Override - public void onEnable() + protected void onEnable() { castRodTimer = 0; reelInTimer = 0; @@ -108,7 +108,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(PacketInputListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java b/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java index 851477cbc7..80e0d71780 100644 --- a/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java @@ -58,13 +58,13 @@ public String getRenderName() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java b/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java index 0f1345bee3..dd5776d9f6 100644 --- a/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java @@ -102,13 +102,7 @@ public final class AutoLibrarianHack extends Hack private final SwingHandSetting swingHand = new SwingHandSetting("How to swing your hand when interacting with the" - + " villager and job site.\n\n" - + "\u00a7lOff\u00a7r - Don't swing your hand at all. Will be detected" - + " by anti-cheat plugins.\n\n" - + "\u00a7lServer-side\u00a7r - Swing your hand on the server-side," - + " without playing the animation on the client-side.\n\n" - + "\u00a7lClient-side\u00a7r - Swing your hand on the client-side." - + " This is the most legit option."); + + " villager and job site."); private final SliderSetting repairMode = new SliderSetting("Repair mode", "Prevents AutoLibrarian from using your axe when its durability reaches" @@ -297,7 +291,7 @@ private void breakJobSite() // damage block and swing hand if(MC.interactionManager.updateBlockBreakingProgress(jobSite, params.side())) - swingHand.getSelected().swing(Hand.MAIN_HAND); + swingHand.swing(Hand.MAIN_HAND); // update progress overlay.updateProgress(); @@ -359,7 +353,7 @@ private void placeJobSite() // swing hand if(result.isAccepted() && result.shouldSwingHand()) - swingHand.getSelected().swing(hand); + swingHand.swing(hand); // reset sneak ((IKeyBinding)MC.options.sneakKey).resetPressedState(); @@ -401,7 +395,7 @@ private void openTradeScreen() // swing hand if(actionResult.isAccepted() && actionResult.shouldSwingHand()) - swingHand.getSelected().swing(hand); + swingHand.swing(hand); // set cooldown MC.itemUseCooldown = 4; @@ -418,7 +412,7 @@ private BookOffer findEnchantedBookOffer(TradeOfferList tradeOffers) for(TradeOffer tradeOffer : tradeOffers) { ItemStack stack = tradeOffer.getSellItem(); - if(!(stack.getItem() instanceof EnchantedBookItem book)) + if(!(stack.getItem() instanceof EnchantedBookItem)) continue; NbtList enchantmentNbt = EnchantedBookItem.getEnchantmentNbt(stack); diff --git a/src/main/java/net/wurstclient/hacks/AutoMineHack.java b/src/main/java/net/wurstclient/hacks/AutoMineHack.java index 3fd8228e07..f86692396e 100644 --- a/src/main/java/net/wurstclient/hacks/AutoMineHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoMineHack.java @@ -30,7 +30,7 @@ public AutoMineHack() } @Override - public void onEnable() + protected void onEnable() { WURST.getHax().excavatorHack.setEnabled(false); WURST.getHax().nukerHack.setEnabled(false); @@ -42,7 +42,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); stopMiningAndResetProgress(); diff --git a/src/main/java/net/wurstclient/hacks/AutoPotionHack.java b/src/main/java/net/wurstclient/hacks/AutoPotionHack.java index 76bf0aa2be..cd9ba86a48 100644 --- a/src/main/java/net/wurstclient/hacks/AutoPotionHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoPotionHack.java @@ -40,13 +40,13 @@ public AutoPotionHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); timer = 0; diff --git a/src/main/java/net/wurstclient/hacks/AutoRespawnHack.java b/src/main/java/net/wurstclient/hacks/AutoRespawnHack.java index 794b73e3cd..35cd1a587e 100644 --- a/src/main/java/net/wurstclient/hacks/AutoRespawnHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoRespawnHack.java @@ -29,13 +29,13 @@ public AutoRespawnHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(DeathListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(DeathListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/AutoSignHack.java b/src/main/java/net/wurstclient/hacks/AutoSignHack.java index b7b1832c0f..f2389783cc 100644 --- a/src/main/java/net/wurstclient/hacks/AutoSignHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoSignHack.java @@ -25,7 +25,7 @@ public AutoSignHack() } @Override - public void onDisable() + protected void onDisable() { signText = null; } diff --git a/src/main/java/net/wurstclient/hacks/AutoSoupHack.java b/src/main/java/net/wurstclient/hacks/AutoSoupHack.java index 6aecf8491a..d49d10caec 100644 --- a/src/main/java/net/wurstclient/hacks/AutoSoupHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoSoupHack.java @@ -45,13 +45,13 @@ public AutoSoupHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); stopIfEating(); diff --git a/src/main/java/net/wurstclient/hacks/AutoSprintHack.java b/src/main/java/net/wurstclient/hacks/AutoSprintHack.java index 53f47e204f..21ca2243ba 100644 --- a/src/main/java/net/wurstclient/hacks/AutoSprintHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoSprintHack.java @@ -33,13 +33,13 @@ public AutoSprintHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/AutoSwimHack.java b/src/main/java/net/wurstclient/hacks/AutoSwimHack.java index 04b52b09a1..e373323738 100644 --- a/src/main/java/net/wurstclient/hacks/AutoSwimHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoSwimHack.java @@ -23,13 +23,13 @@ public AutoSwimHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/AutoSwitchHack.java b/src/main/java/net/wurstclient/hacks/AutoSwitchHack.java index 3efe3aa4bd..8a02b3c8a8 100644 --- a/src/main/java/net/wurstclient/hacks/AutoSwitchHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoSwitchHack.java @@ -23,13 +23,13 @@ public AutoSwitchHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/AutoSwordHack.java b/src/main/java/net/wurstclient/hacks/AutoSwordHack.java index fb28ccedc5..5bb9b29478 100644 --- a/src/main/java/net/wurstclient/hacks/AutoSwordHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoSwordHack.java @@ -62,14 +62,14 @@ public AutoSwordHack() } @Override - public void onEnable() + protected void onEnable() { oldSlot = -1; EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); resetSlot(); diff --git a/src/main/java/net/wurstclient/hacks/AutoToolHack.java b/src/main/java/net/wurstclient/hacks/AutoToolHack.java index e8f6f395a0..60d93745ad 100644 --- a/src/main/java/net/wurstclient/hacks/AutoToolHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoToolHack.java @@ -60,7 +60,7 @@ public AutoToolHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(BlockBreakingProgressListener.class, this); EVENTS.add(UpdateListener.class, this); @@ -68,7 +68,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(BlockBreakingProgressListener.class, this); EVENTS.remove(UpdateListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/AutoTotemHack.java b/src/main/java/net/wurstclient/hacks/AutoTotemHack.java index 474be648fd..03364709c5 100644 --- a/src/main/java/net/wurstclient/hacks/AutoTotemHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoTotemHack.java @@ -68,7 +68,7 @@ public String getRenderName() } @Override - public void onEnable() + protected void onEnable() { nextTickSlot = -1; totems = 0; @@ -78,7 +78,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/AutoWalkHack.java b/src/main/java/net/wurstclient/hacks/AutoWalkHack.java index ca9f2d4500..2004e586ed 100644 --- a/src/main/java/net/wurstclient/hacks/AutoWalkHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoWalkHack.java @@ -23,13 +23,13 @@ public AutoWalkHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); ((IKeyBinding)MC.options.forwardKey).resetPressedState(); diff --git a/src/main/java/net/wurstclient/hacks/BaseFinderHack.java b/src/main/java/net/wurstclient/hacks/BaseFinderHack.java index 16ea18ada7..1ccfad96b9 100644 --- a/src/main/java/net/wurstclient/hacks/BaseFinderHack.java +++ b/src/main/java/net/wurstclient/hacks/BaseFinderHack.java @@ -131,7 +131,7 @@ else if(counter == 0) } @Override - public void onEnable() + protected void onEnable() { // reset timer messageTimer = 0; @@ -142,7 +142,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(RenderListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/BlinkHack.java b/src/main/java/net/wurstclient/hacks/BlinkHack.java index 8ca84a62ea..d04f97de2b 100644 --- a/src/main/java/net/wurstclient/hacks/BlinkHack.java +++ b/src/main/java/net/wurstclient/hacks/BlinkHack.java @@ -50,7 +50,7 @@ public String getRenderName() } @Override - public void onEnable() + protected void onEnable() { fakePlayer = new FakePlayerEntity(); @@ -59,7 +59,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(PacketOutputListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/BoatFlyHack.java b/src/main/java/net/wurstclient/hacks/BoatFlyHack.java index 1fb15d8319..af80133f2d 100644 --- a/src/main/java/net/wurstclient/hacks/BoatFlyHack.java +++ b/src/main/java/net/wurstclient/hacks/BoatFlyHack.java @@ -42,13 +42,13 @@ public BoatFlyHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/BonemealAuraHack.java b/src/main/java/net/wurstclient/hacks/BonemealAuraHack.java index 1bbbea2853..fb2e577105 100644 --- a/src/main/java/net/wurstclient/hacks/BonemealAuraHack.java +++ b/src/main/java/net/wurstclient/hacks/BonemealAuraHack.java @@ -77,13 +77,13 @@ public BonemealAuraHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/BowAimbotHack.java b/src/main/java/net/wurstclient/hacks/BowAimbotHack.java index f0fe15f760..8d4ea37051 100644 --- a/src/main/java/net/wurstclient/hacks/BowAimbotHack.java +++ b/src/main/java/net/wurstclient/hacks/BowAimbotHack.java @@ -94,7 +94,7 @@ public BowAimbotHack() } @Override - public void onEnable() + protected void onEnable() { // disable conflicting hacks WURST.getHax().excavatorHack.setEnabled(false); @@ -106,7 +106,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(GUIRenderListener.class, this); EVENTS.remove(RenderListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/BuildRandomHack.java b/src/main/java/net/wurstclient/hacks/BuildRandomHack.java index a231b082e8..0629ab9e8b 100644 --- a/src/main/java/net/wurstclient/hacks/BuildRandomHack.java +++ b/src/main/java/net/wurstclient/hacks/BuildRandomHack.java @@ -75,13 +75,7 @@ public final class BuildRandomHack extends Hack + " can be VERY disorienting to look at."); private final SwingHandSetting swingHand = new SwingHandSetting( - "How BuildRandom should swing your hand when placing blocks.\n\n" - + "\u00a7lOff\u00a7r - Don't swing your hand at all. Will be detected" - + " by anti-cheat plugins.\n\n" - + "\u00a7lServer-side\u00a7r - Swing your hand on the server-side," - + " without playing the animation on the client-side.\n\n" - + "\u00a7lClient-side\u00a7r - Swing your hand on the client-side." - + " This is the most legit option."); + "How BuildRandom should swing your hand when placing blocks."); private final CheckboxSetting fastPlace = new CheckboxSetting("Always FastPlace", @@ -122,14 +116,14 @@ public BuildRandomHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); EVENTS.add(RenderListener.class, this); } @Override - public void onDisable() + protected void onDisable() { lastPos = null; EVENTS.remove(UpdateListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/BunnyHopHack.java b/src/main/java/net/wurstclient/hacks/BunnyHopHack.java index a81545a846..56650cc32d 100644 --- a/src/main/java/net/wurstclient/hacks/BunnyHopHack.java +++ b/src/main/java/net/wurstclient/hacks/BunnyHopHack.java @@ -36,13 +36,13 @@ public String getRenderName() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/CaveFinderHack.java b/src/main/java/net/wurstclient/hacks/CaveFinderHack.java index df43ea80d6..4a35d74b80 100644 --- a/src/main/java/net/wurstclient/hacks/CaveFinderHack.java +++ b/src/main/java/net/wurstclient/hacks/CaveFinderHack.java @@ -96,7 +96,7 @@ public CaveFinderHack() } @Override - public void onEnable() + protected void onEnable() { prevLimit = limit.getValueI(); notify = true; @@ -111,7 +111,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(PacketInputListener.class, coordinator); diff --git a/src/main/java/net/wurstclient/hacks/ChatTranslatorHack.java b/src/main/java/net/wurstclient/hacks/ChatTranslatorHack.java index a79831fe34..a827eed359 100644 --- a/src/main/java/net/wurstclient/hacks/ChatTranslatorHack.java +++ b/src/main/java/net/wurstclient/hacks/ChatTranslatorHack.java @@ -39,13 +39,13 @@ public ChatTranslatorHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(ChatInputListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(ChatInputListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/ClickAuraHack.java b/src/main/java/net/wurstclient/hacks/ClickAuraHack.java index 1987aeb8a1..d57e268902 100644 --- a/src/main/java/net/wurstclient/hacks/ClickAuraHack.java +++ b/src/main/java/net/wurstclient/hacks/ClickAuraHack.java @@ -65,7 +65,7 @@ public ClickAuraHack() } @Override - public void onEnable() + protected void onEnable() { // disable other killauras WURST.getHax().aimAssistHack.setEnabled(false); @@ -84,7 +84,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(LeftClickListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/ClickGuiHack.java b/src/main/java/net/wurstclient/hacks/ClickGuiHack.java index a377c4446c..2880384fa7 100644 --- a/src/main/java/net/wurstclient/hacks/ClickGuiHack.java +++ b/src/main/java/net/wurstclient/hacks/ClickGuiHack.java @@ -60,7 +60,7 @@ public ClickGuiHack() } @Override - public void onEnable() + protected void onEnable() { MC.setScreen(new ClickGuiScreen(WURST.getGui())); setEnabled(false); diff --git a/src/main/java/net/wurstclient/hacks/CrashChestHack.java b/src/main/java/net/wurstclient/hacks/CrashChestHack.java index e76ce26dc9..9c229838ce 100644 --- a/src/main/java/net/wurstclient/hacks/CrashChestHack.java +++ b/src/main/java/net/wurstclient/hacks/CrashChestHack.java @@ -28,7 +28,7 @@ public CrashChestHack() } @Override - public void onEnable() + protected void onEnable() { if(!MC.player.getAbilities().creativeMode) { diff --git a/src/main/java/net/wurstclient/hacks/CreativeFlightHack.java b/src/main/java/net/wurstclient/hacks/CreativeFlightHack.java index 407c11d35e..7966ff1895 100644 --- a/src/main/java/net/wurstclient/hacks/CreativeFlightHack.java +++ b/src/main/java/net/wurstclient/hacks/CreativeFlightHack.java @@ -52,7 +52,7 @@ public CreativeFlightHack() } @Override - public void onEnable() + protected void onEnable() { tickCounter = 0; @@ -63,7 +63,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/CriticalsHack.java b/src/main/java/net/wurstclient/hacks/CriticalsHack.java index c70165de97..abc848fe81 100644 --- a/src/main/java/net/wurstclient/hacks/CriticalsHack.java +++ b/src/main/java/net/wurstclient/hacks/CriticalsHack.java @@ -40,13 +40,13 @@ public String getRenderName() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(LeftClickListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(LeftClickListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/CrystalAuraHack.java b/src/main/java/net/wurstclient/hacks/CrystalAuraHack.java index 038794b3e4..aa0f5e7079 100644 --- a/src/main/java/net/wurstclient/hacks/CrystalAuraHack.java +++ b/src/main/java/net/wurstclient/hacks/CrystalAuraHack.java @@ -90,7 +90,7 @@ public CrystalAuraHack() } @Override - public void onEnable() + protected void onEnable() { // disable other killauras WURST.getHax().aimAssistHack.setEnabled(false); @@ -107,7 +107,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/DerpHack.java b/src/main/java/net/wurstclient/hacks/DerpHack.java index 30c989dc24..28b91793d1 100644 --- a/src/main/java/net/wurstclient/hacks/DerpHack.java +++ b/src/main/java/net/wurstclient/hacks/DerpHack.java @@ -27,7 +27,7 @@ public DerpHack() } @Override - public void onEnable() + protected void onEnable() { // disable incompatible derps WURST.getHax().headRollHack.setEnabled(false); @@ -37,7 +37,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/DolphinHack.java b/src/main/java/net/wurstclient/hacks/DolphinHack.java index 264fdc6d42..c5f3e8d837 100644 --- a/src/main/java/net/wurstclient/hacks/DolphinHack.java +++ b/src/main/java/net/wurstclient/hacks/DolphinHack.java @@ -24,14 +24,14 @@ public DolphinHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); WURST.getHax().fishHack.setEnabled(false); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/ExcavatorHack.java b/src/main/java/net/wurstclient/hacks/ExcavatorHack.java index 1ce7df0924..752428cf10 100644 --- a/src/main/java/net/wurstclient/hacks/ExcavatorHack.java +++ b/src/main/java/net/wurstclient/hacks/ExcavatorHack.java @@ -91,7 +91,7 @@ public String getRenderName() } @Override - public void onEnable() + protected void onEnable() { // disable conflicting hacks WURST.getHax().autoMineHack.setEnabled(false); @@ -110,7 +110,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(RenderListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/ExtraElytraHack.java b/src/main/java/net/wurstclient/hacks/ExtraElytraHack.java index b0d619e695..78dcba719f 100644 --- a/src/main/java/net/wurstclient/hacks/ExtraElytraHack.java +++ b/src/main/java/net/wurstclient/hacks/ExtraElytraHack.java @@ -53,14 +53,14 @@ public ExtraElytraHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); jumpTimer = 0; } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/FancyChatHack.java b/src/main/java/net/wurstclient/hacks/FancyChatHack.java index 8765357914..3939a43b3e 100644 --- a/src/main/java/net/wurstclient/hacks/FancyChatHack.java +++ b/src/main/java/net/wurstclient/hacks/FancyChatHack.java @@ -24,13 +24,13 @@ public FancyChatHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(ChatOutputListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(ChatOutputListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/FastLadderHack.java b/src/main/java/net/wurstclient/hacks/FastLadderHack.java index 0e70ea546f..0936b159b1 100644 --- a/src/main/java/net/wurstclient/hacks/FastLadderHack.java +++ b/src/main/java/net/wurstclient/hacks/FastLadderHack.java @@ -24,13 +24,13 @@ public FastLadderHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/FastPlaceHack.java b/src/main/java/net/wurstclient/hacks/FastPlaceHack.java index c1d037b14c..641cea7e77 100644 --- a/src/main/java/net/wurstclient/hacks/FastPlaceHack.java +++ b/src/main/java/net/wurstclient/hacks/FastPlaceHack.java @@ -22,13 +22,13 @@ public FastPlaceHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/FightBotHack.java b/src/main/java/net/wurstclient/hacks/FightBotHack.java index e8e27a73b7..d7353ffafe 100644 --- a/src/main/java/net/wurstclient/hacks/FightBotHack.java +++ b/src/main/java/net/wurstclient/hacks/FightBotHack.java @@ -81,7 +81,7 @@ public FightBotHack() } @Override - public void onEnable() + protected void onEnable() { // disable other killauras WURST.getHax().aimAssistHack.setEnabled(false); @@ -103,7 +103,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { // remove listener EVENTS.remove(UpdateListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/FishHack.java b/src/main/java/net/wurstclient/hacks/FishHack.java index e8c95740d1..dc51386b9e 100644 --- a/src/main/java/net/wurstclient/hacks/FishHack.java +++ b/src/main/java/net/wurstclient/hacks/FishHack.java @@ -24,14 +24,14 @@ public FishHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); WURST.getHax().dolphinHack.setEnabled(false); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/FlightHack.java b/src/main/java/net/wurstclient/hacks/FlightHack.java index 02f19253a0..91009a6de0 100644 --- a/src/main/java/net/wurstclient/hacks/FlightHack.java +++ b/src/main/java/net/wurstclient/hacks/FlightHack.java @@ -68,7 +68,7 @@ public FlightHack() } @Override - public void onEnable() + protected void onEnable() { tickCounter = 0; @@ -81,7 +81,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(IsPlayerInWaterListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/FollowHack.java b/src/main/java/net/wurstclient/hacks/FollowHack.java index 40a74497f9..2f1f4c9aa2 100644 --- a/src/main/java/net/wurstclient/hacks/FollowHack.java +++ b/src/main/java/net/wurstclient/hacks/FollowHack.java @@ -76,7 +76,7 @@ public String getRenderName() } @Override - public void onEnable() + protected void onEnable() { WURST.getHax().fightBotHack.setEnabled(false); WURST.getHax().protectHack.setEnabled(false); @@ -115,7 +115,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(RenderListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/ForceOpHack.java b/src/main/java/net/wurstclient/hacks/ForceOpHack.java index 97af13c7b5..f70b8306d1 100644 --- a/src/main/java/net/wurstclient/hacks/ForceOpHack.java +++ b/src/main/java/net/wurstclient/hacks/ForceOpHack.java @@ -52,7 +52,7 @@ public ForceOpHack() } @Override - public void onEnable() + protected void onEnable() { passwords = defaultList; gotWrongPwMsg = false; @@ -147,7 +147,7 @@ private void sendIndexToDialog() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(ChatInputListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/FreecamHack.java b/src/main/java/net/wurstclient/hacks/FreecamHack.java index fdfbaf251e..f6527745d0 100644 --- a/src/main/java/net/wurstclient/hacks/FreecamHack.java +++ b/src/main/java/net/wurstclient/hacks/FreecamHack.java @@ -69,7 +69,7 @@ public FreecamHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); EVENTS.add(PacketOutputListener.class, this); @@ -92,7 +92,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(PacketOutputListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/GlideHack.java b/src/main/java/net/wurstclient/hacks/GlideHack.java index eaa7f2764e..aef0facd4b 100644 --- a/src/main/java/net/wurstclient/hacks/GlideHack.java +++ b/src/main/java/net/wurstclient/hacks/GlideHack.java @@ -48,14 +48,14 @@ public GlideHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); EVENTS.add(AirStrafingSpeedListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(AirStrafingSpeedListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/HeadRollHack.java b/src/main/java/net/wurstclient/hacks/HeadRollHack.java index 133321f2f6..c0e436159c 100644 --- a/src/main/java/net/wurstclient/hacks/HeadRollHack.java +++ b/src/main/java/net/wurstclient/hacks/HeadRollHack.java @@ -24,7 +24,7 @@ public HeadRollHack() } @Override - public void onEnable() + protected void onEnable() { // disable incompatible derps WURST.getHax().derpHack.setEnabled(false); @@ -34,7 +34,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/InstantBunkerHack.java b/src/main/java/net/wurstclient/hacks/InstantBunkerHack.java index bded0324a5..4eda9fdad9 100644 --- a/src/main/java/net/wurstclient/hacks/InstantBunkerHack.java +++ b/src/main/java/net/wurstclient/hacks/InstantBunkerHack.java @@ -61,7 +61,7 @@ public InstantBunkerHack() } @Override - public void onEnable() + protected void onEnable() { WURST.getHax().tunnellerHack.setEnabled(false); @@ -111,7 +111,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(RenderListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/InvWalkHack.java b/src/main/java/net/wurstclient/hacks/InvWalkHack.java index 043102f563..95af300f79 100644 --- a/src/main/java/net/wurstclient/hacks/InvWalkHack.java +++ b/src/main/java/net/wurstclient/hacks/InvWalkHack.java @@ -58,13 +58,13 @@ public InvWalkHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/ItemEspHack.java b/src/main/java/net/wurstclient/hacks/ItemEspHack.java index 614c45aa7f..296f64e0f7 100644 --- a/src/main/java/net/wurstclient/hacks/ItemEspHack.java +++ b/src/main/java/net/wurstclient/hacks/ItemEspHack.java @@ -71,7 +71,7 @@ public ItemEspHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); EVENTS.add(CameraTransformViewBobbingListener.class, this); @@ -79,7 +79,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(CameraTransformViewBobbingListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/ItemGeneratorHack.java b/src/main/java/net/wurstclient/hacks/ItemGeneratorHack.java index 33dc6d6803..030e29db5b 100644 --- a/src/main/java/net/wurstclient/hacks/ItemGeneratorHack.java +++ b/src/main/java/net/wurstclient/hacks/ItemGeneratorHack.java @@ -47,7 +47,7 @@ public ItemGeneratorHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); @@ -59,7 +59,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/JesusHack.java b/src/main/java/net/wurstclient/hacks/JesusHack.java index 02ef86b3ab..f723cd8a82 100644 --- a/src/main/java/net/wurstclient/hacks/JesusHack.java +++ b/src/main/java/net/wurstclient/hacks/JesusHack.java @@ -46,14 +46,14 @@ public JesusHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); EVENTS.add(PacketOutputListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(PacketOutputListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/JetpackHack.java b/src/main/java/net/wurstclient/hacks/JetpackHack.java index 2cb7e6fffe..4a02e8cf4c 100644 --- a/src/main/java/net/wurstclient/hacks/JetpackHack.java +++ b/src/main/java/net/wurstclient/hacks/JetpackHack.java @@ -23,7 +23,7 @@ public JetpackHack() } @Override - public void onEnable() + protected void onEnable() { WURST.getHax().creativeFlightHack.setEnabled(false); WURST.getHax().flightHack.setEnabled(false); @@ -32,7 +32,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/KaboomHack.java b/src/main/java/net/wurstclient/hacks/KaboomHack.java index 17115e49ba..9646e43fa1 100644 --- a/src/main/java/net/wurstclient/hacks/KaboomHack.java +++ b/src/main/java/net/wurstclient/hacks/KaboomHack.java @@ -37,13 +37,13 @@ public KaboomHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/KillPotionHack.java b/src/main/java/net/wurstclient/hacks/KillPotionHack.java index 48a4322614..5fd392b248 100644 --- a/src/main/java/net/wurstclient/hacks/KillPotionHack.java +++ b/src/main/java/net/wurstclient/hacks/KillPotionHack.java @@ -37,7 +37,7 @@ public KillPotionHack() } @Override - public void onEnable() + protected void onEnable() { // check gamemode if(!MC.player.getAbilities().creativeMode) diff --git a/src/main/java/net/wurstclient/hacks/LsdHack.java b/src/main/java/net/wurstclient/hacks/LsdHack.java index f12687dd3c..6905c592e6 100644 --- a/src/main/java/net/wurstclient/hacks/LsdHack.java +++ b/src/main/java/net/wurstclient/hacks/LsdHack.java @@ -23,7 +23,7 @@ public LsdHack() } @Override - public void onEnable() + protected void onEnable() { if(!(MC.getCameraEntity() instanceof PlayerEntity)) { @@ -39,7 +39,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { if(MC.gameRenderer.getPostProcessor() != null) MC.gameRenderer.disablePostProcessor(); diff --git a/src/main/java/net/wurstclient/hacks/MassTpaHack.java b/src/main/java/net/wurstclient/hacks/MassTpaHack.java index c2c9a4b508..96c38b316d 100644 --- a/src/main/java/net/wurstclient/hacks/MassTpaHack.java +++ b/src/main/java/net/wurstclient/hacks/MassTpaHack.java @@ -75,7 +75,7 @@ public MassTpaHack() } @Override - public void onEnable() + protected void onEnable() { // reset state players.clear(); @@ -111,7 +111,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(ChatInputListener.class, this); EVENTS.remove(UpdateListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/MileyCyrusHack.java b/src/main/java/net/wurstclient/hacks/MileyCyrusHack.java index d39c6404b6..5a87395178 100644 --- a/src/main/java/net/wurstclient/hacks/MileyCyrusHack.java +++ b/src/main/java/net/wurstclient/hacks/MileyCyrusHack.java @@ -33,14 +33,14 @@ public MileyCyrusHack() } @Override - public void onEnable() + protected void onEnable() { timer = 0; EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); ((IKeyBinding)MC.options.sneakKey).resetPressedState(); diff --git a/src/main/java/net/wurstclient/hacks/MobEspHack.java b/src/main/java/net/wurstclient/hacks/MobEspHack.java index 3dd0392dfa..018739b329 100644 --- a/src/main/java/net/wurstclient/hacks/MobEspHack.java +++ b/src/main/java/net/wurstclient/hacks/MobEspHack.java @@ -144,7 +144,7 @@ public MobEspHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); EVENTS.add(CameraTransformViewBobbingListener.class, this); @@ -152,7 +152,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(CameraTransformViewBobbingListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/MobSpawnEspHack.java b/src/main/java/net/wurstclient/hacks/MobSpawnEspHack.java index d6de760d38..f4dba282cd 100644 --- a/src/main/java/net/wurstclient/hacks/MobSpawnEspHack.java +++ b/src/main/java/net/wurstclient/hacks/MobSpawnEspHack.java @@ -77,7 +77,7 @@ public MobSpawnEspHack() } @Override - public void onEnable() + protected void onEnable() { pool = MinPriorityThreadFactory.newFixedThreadPool(); @@ -87,7 +87,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(PacketInputListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/MultiAuraHack.java b/src/main/java/net/wurstclient/hacks/MultiAuraHack.java index c3d497b26b..e812a9a53a 100644 --- a/src/main/java/net/wurstclient/hacks/MultiAuraHack.java +++ b/src/main/java/net/wurstclient/hacks/MultiAuraHack.java @@ -58,7 +58,7 @@ public MultiAuraHack() } @Override - public void onEnable() + protected void onEnable() { // disable other killauras WURST.getHax().aimAssistHack.setEnabled(false); @@ -76,7 +76,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/NavigatorHack.java b/src/main/java/net/wurstclient/hacks/NavigatorHack.java index ff0c2515e4..efd7524112 100644 --- a/src/main/java/net/wurstclient/hacks/NavigatorHack.java +++ b/src/main/java/net/wurstclient/hacks/NavigatorHack.java @@ -25,7 +25,7 @@ public NavigatorHack() } @Override - public void onEnable() + protected void onEnable() { if(!(MC.currentScreen instanceof NavigatorMainScreen)) MC.setScreen(new NavigatorMainScreen()); diff --git a/src/main/java/net/wurstclient/hacks/NoClipHack.java b/src/main/java/net/wurstclient/hacks/NoClipHack.java index 749ea9dbbe..d8a29929ac 100644 --- a/src/main/java/net/wurstclient/hacks/NoClipHack.java +++ b/src/main/java/net/wurstclient/hacks/NoClipHack.java @@ -29,7 +29,7 @@ public NoClipHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); EVENTS.add(PlayerMoveListener.class, this); @@ -39,7 +39,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(PlayerMoveListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/NoFallHack.java b/src/main/java/net/wurstclient/hacks/NoFallHack.java index ca234c01e3..c93377baf6 100644 --- a/src/main/java/net/wurstclient/hacks/NoFallHack.java +++ b/src/main/java/net/wurstclient/hacks/NoFallHack.java @@ -49,13 +49,13 @@ public String getRenderName() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/NoWebHack.java b/src/main/java/net/wurstclient/hacks/NoWebHack.java index 2fcafe6d05..a63b56f045 100644 --- a/src/main/java/net/wurstclient/hacks/NoWebHack.java +++ b/src/main/java/net/wurstclient/hacks/NoWebHack.java @@ -21,13 +21,13 @@ public NoWebHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/NukerLegitHack.java b/src/main/java/net/wurstclient/hacks/NukerLegitHack.java index bd377080c3..1b027bf3b5 100644 --- a/src/main/java/net/wurstclient/hacks/NukerLegitHack.java +++ b/src/main/java/net/wurstclient/hacks/NukerLegitHack.java @@ -96,7 +96,7 @@ public String getRenderName() } @Override - public void onEnable() + protected void onEnable() { // disable other nukers WURST.getHax().autoMineHack.setEnabled(false); @@ -112,7 +112,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { // remove listeners EVENTS.remove(LeftClickListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/OpenWaterEspHack.java b/src/main/java/net/wurstclient/hacks/OpenWaterEspHack.java index 03b6a7a9d8..0dd051d387 100644 --- a/src/main/java/net/wurstclient/hacks/OpenWaterEspHack.java +++ b/src/main/java/net/wurstclient/hacks/OpenWaterEspHack.java @@ -43,13 +43,13 @@ public String getRenderName() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(RenderListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(RenderListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/OverlayHack.java b/src/main/java/net/wurstclient/hacks/OverlayHack.java index 1bf2c2dfe2..10dcb029d7 100644 --- a/src/main/java/net/wurstclient/hacks/OverlayHack.java +++ b/src/main/java/net/wurstclient/hacks/OverlayHack.java @@ -28,14 +28,14 @@ public OverlayHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); EVENTS.add(RenderListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(RenderListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/PanicHack.java b/src/main/java/net/wurstclient/hacks/PanicHack.java index 1b3f90d532..568603bdef 100644 --- a/src/main/java/net/wurstclient/hacks/PanicHack.java +++ b/src/main/java/net/wurstclient/hacks/PanicHack.java @@ -24,13 +24,13 @@ public PanicHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/ParkourHack.java b/src/main/java/net/wurstclient/hacks/ParkourHack.java index ef9ee13b5d..b9125da528 100644 --- a/src/main/java/net/wurstclient/hacks/ParkourHack.java +++ b/src/main/java/net/wurstclient/hacks/ParkourHack.java @@ -45,14 +45,14 @@ public ParkourHack() } @Override - public void onEnable() + protected void onEnable() { WURST.getHax().safeWalkHack.setEnabled(false); EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/PlayerEspHack.java b/src/main/java/net/wurstclient/hacks/PlayerEspHack.java index dd791065cf..ad590e425c 100644 --- a/src/main/java/net/wurstclient/hacks/PlayerEspHack.java +++ b/src/main/java/net/wurstclient/hacks/PlayerEspHack.java @@ -126,7 +126,7 @@ public PlayerEspHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); EVENTS.add(CameraTransformViewBobbingListener.class, this); @@ -134,7 +134,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(CameraTransformViewBobbingListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/PortalEspHack.java b/src/main/java/net/wurstclient/hacks/PortalEspHack.java index 3345669e54..c2ea81bead 100644 --- a/src/main/java/net/wurstclient/hacks/PortalEspHack.java +++ b/src/main/java/net/wurstclient/hacks/PortalEspHack.java @@ -101,7 +101,7 @@ public PortalEspHack() } @Override - public void onEnable() + protected void onEnable() { groupsUpToDate = false; @@ -114,7 +114,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(PacketInputListener.class, coordinator); diff --git a/src/main/java/net/wurstclient/hacks/ProphuntEspHack.java b/src/main/java/net/wurstclient/hacks/ProphuntEspHack.java index 37ce9ef5b7..ef778ee194 100644 --- a/src/main/java/net/wurstclient/hacks/ProphuntEspHack.java +++ b/src/main/java/net/wurstclient/hacks/ProphuntEspHack.java @@ -36,13 +36,13 @@ public ProphuntEspHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(RenderListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(RenderListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/ProtectHack.java b/src/main/java/net/wurstclient/hacks/ProtectHack.java index 7a18c099e6..87dc006208 100644 --- a/src/main/java/net/wurstclient/hacks/ProtectHack.java +++ b/src/main/java/net/wurstclient/hacks/ProtectHack.java @@ -109,7 +109,7 @@ public String getRenderName() } @Override - public void onEnable() + protected void onEnable() { WURST.getHax().followHack.setEnabled(false); WURST.getHax().tunnellerHack.setEnabled(false); @@ -149,7 +149,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(RenderListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/RadarHack.java b/src/main/java/net/wurstclient/hacks/RadarHack.java index 6b9f81184c..6fd43c5df6 100644 --- a/src/main/java/net/wurstclient/hacks/RadarHack.java +++ b/src/main/java/net/wurstclient/hacks/RadarHack.java @@ -67,14 +67,14 @@ public RadarHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); window.setInvisible(false); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); window.setInvisible(true); diff --git a/src/main/java/net/wurstclient/hacks/RemoteViewHack.java b/src/main/java/net/wurstclient/hacks/RemoteViewHack.java index 5550992c68..faf7d08e95 100644 --- a/src/main/java/net/wurstclient/hacks/RemoteViewHack.java +++ b/src/main/java/net/wurstclient/hacks/RemoteViewHack.java @@ -47,7 +47,7 @@ public RemoteViewHack() } @Override - public void onEnable() + protected void onEnable() { // find entity if not already set if(entity == null) @@ -94,7 +94,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { // remove listener EVENTS.remove(UpdateListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/RestockHack.java b/src/main/java/net/wurstclient/hacks/RestockHack.java index bd816d08fc..4460442084 100644 --- a/src/main/java/net/wurstclient/hacks/RestockHack.java +++ b/src/main/java/net/wurstclient/hacks/RestockHack.java @@ -65,13 +65,13 @@ public RestockHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/ScaffoldWalkHack.java b/src/main/java/net/wurstclient/hacks/ScaffoldWalkHack.java index 01f399d4f5..ff7699a9e4 100644 --- a/src/main/java/net/wurstclient/hacks/ScaffoldWalkHack.java +++ b/src/main/java/net/wurstclient/hacks/ScaffoldWalkHack.java @@ -37,13 +37,13 @@ public ScaffoldWalkHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/SearchHack.java b/src/main/java/net/wurstclient/hacks/SearchHack.java index 982d8fc2df..91bef2f68f 100644 --- a/src/main/java/net/wurstclient/hacks/SearchHack.java +++ b/src/main/java/net/wurstclient/hacks/SearchHack.java @@ -95,7 +95,7 @@ public String getRenderName() } @Override - public void onEnable() + protected void onEnable() { lastBlock = block.getBlock(); coordinator.setTargetBlock(lastBlock); @@ -112,7 +112,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(PacketInputListener.class, coordinator); diff --git a/src/main/java/net/wurstclient/hacks/SkinDerpHack.java b/src/main/java/net/wurstclient/hacks/SkinDerpHack.java index 06b734b606..6f80362cd8 100644 --- a/src/main/java/net/wurstclient/hacks/SkinDerpHack.java +++ b/src/main/java/net/wurstclient/hacks/SkinDerpHack.java @@ -27,13 +27,13 @@ public SkinDerpHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/SneakHack.java b/src/main/java/net/wurstclient/hacks/SneakHack.java index ebc48db986..5deb8cf1d7 100644 --- a/src/main/java/net/wurstclient/hacks/SneakHack.java +++ b/src/main/java/net/wurstclient/hacks/SneakHack.java @@ -52,14 +52,14 @@ public String getRenderName() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(PreMotionListener.class, this); EVENTS.add(PostMotionListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(PreMotionListener.class, this); EVENTS.remove(PostMotionListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/SpeedHackHack.java b/src/main/java/net/wurstclient/hacks/SpeedHackHack.java index 97a822bd3a..36c40c131a 100644 --- a/src/main/java/net/wurstclient/hacks/SpeedHackHack.java +++ b/src/main/java/net/wurstclient/hacks/SpeedHackHack.java @@ -23,13 +23,13 @@ public SpeedHackHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/SpeedNukerHack.java b/src/main/java/net/wurstclient/hacks/SpeedNukerHack.java index b4a3c84472..4d656a26b2 100644 --- a/src/main/java/net/wurstclient/hacks/SpeedNukerHack.java +++ b/src/main/java/net/wurstclient/hacks/SpeedNukerHack.java @@ -92,7 +92,7 @@ public String getRenderName() } @Override - public void onEnable() + protected void onEnable() { // disable other nukers WURST.getHax().autoMineHack.setEnabled(false); @@ -107,7 +107,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { // remove listeners EVENTS.remove(LeftClickListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/SpiderHack.java b/src/main/java/net/wurstclient/hacks/SpiderHack.java index 60c09244a2..12506c06e1 100644 --- a/src/main/java/net/wurstclient/hacks/SpiderHack.java +++ b/src/main/java/net/wurstclient/hacks/SpiderHack.java @@ -22,13 +22,13 @@ public SpiderHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/StepHack.java b/src/main/java/net/wurstclient/hacks/StepHack.java index 5ee5bf09e9..9adaccd414 100644 --- a/src/main/java/net/wurstclient/hacks/StepHack.java +++ b/src/main/java/net/wurstclient/hacks/StepHack.java @@ -39,13 +39,13 @@ public StepHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); MC.player.stepHeight = 0.5F; diff --git a/src/main/java/net/wurstclient/hacks/ThrowHack.java b/src/main/java/net/wurstclient/hacks/ThrowHack.java index b5c1fe7c94..3adf5b75d7 100644 --- a/src/main/java/net/wurstclient/hacks/ThrowHack.java +++ b/src/main/java/net/wurstclient/hacks/ThrowHack.java @@ -35,13 +35,13 @@ public String getRenderName() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(RightClickListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(RightClickListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/TillauraHack.java b/src/main/java/net/wurstclient/hacks/TillauraHack.java index d2cac5eed7..3586bbd3f6 100644 --- a/src/main/java/net/wurstclient/hacks/TillauraHack.java +++ b/src/main/java/net/wurstclient/hacks/TillauraHack.java @@ -65,13 +65,13 @@ public TillauraHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(UpdateListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/TiredHack.java b/src/main/java/net/wurstclient/hacks/TiredHack.java index 2518a7f0d8..efbcf9e7a3 100644 --- a/src/main/java/net/wurstclient/hacks/TiredHack.java +++ b/src/main/java/net/wurstclient/hacks/TiredHack.java @@ -21,7 +21,7 @@ public TiredHack() } @Override - public void onEnable() + protected void onEnable() { // disable incompatible derps WURST.getHax().derpHack.setEnabled(false); @@ -31,7 +31,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/TpAuraHack.java b/src/main/java/net/wurstclient/hacks/TpAuraHack.java index 8bb5db1dc2..a0a05655d3 100644 --- a/src/main/java/net/wurstclient/hacks/TpAuraHack.java +++ b/src/main/java/net/wurstclient/hacks/TpAuraHack.java @@ -67,7 +67,7 @@ public TpAuraHack() } @Override - public void onEnable() + protected void onEnable() { // disable other killauras WURST.getHax().aimAssistHack.setEnabled(false); @@ -85,7 +85,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/TrajectoriesHack.java b/src/main/java/net/wurstclient/hacks/TrajectoriesHack.java index f99dbca654..32d7a0752c 100644 --- a/src/main/java/net/wurstclient/hacks/TrajectoriesHack.java +++ b/src/main/java/net/wurstclient/hacks/TrajectoriesHack.java @@ -69,13 +69,13 @@ public TrajectoriesHack() } @Override - public void onEnable() + protected void onEnable() { EVENTS.add(RenderListener.class, this); } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(RenderListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/TreeBotHack.java b/src/main/java/net/wurstclient/hacks/TreeBotHack.java index 03e7afc69c..e198b585c1 100644 --- a/src/main/java/net/wurstclient/hacks/TreeBotHack.java +++ b/src/main/java/net/wurstclient/hacks/TreeBotHack.java @@ -66,13 +66,7 @@ public final class TreeBotHack extends Hack + " can be disorienting to look at."); private final SwingHandSetting swingHand = new SwingHandSetting( - "How TreeBot should swing your hand when breaking logs and leaves.\n\n" - + "\u00a7lOff\u00a7r - Don't swing your hand at all. Will be detected" - + " by anti-cheat plugins.\n\n" - + "\u00a7lServer-side\u00a7r - Swing your hand on the server-side," - + " without playing the animation on the client-side.\n\n" - + "\u00a7lClient-side\u00a7r - Swing your hand on the client-side." - + " This is the most legit option."); + "How TreeBot should swing your hand when breaking logs and leaves."); private TreeFinder treeFinder; private AngleFinder angleFinder; @@ -107,7 +101,7 @@ public String getRenderName() } @Override - public void onEnable() + protected void onEnable() { treeFinder = new TreeFinder(); @@ -116,7 +110,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(RenderListener.class, this); @@ -250,7 +244,7 @@ private boolean breakBlock(BlockPos pos) // damage block and swing hand if(MC.interactionManager.updateBlockBreakingProgress(pos, params.side())) - swingHand.getSelected().swing(Hand.MAIN_HAND); + swingHand.swing(Hand.MAIN_HAND); // update progress overlay.updateProgress(); diff --git a/src/main/java/net/wurstclient/hacks/TriggerBotHack.java b/src/main/java/net/wurstclient/hacks/TriggerBotHack.java index 3aa7ffa712..c3d67618ce 100644 --- a/src/main/java/net/wurstclient/hacks/TriggerBotHack.java +++ b/src/main/java/net/wurstclient/hacks/TriggerBotHack.java @@ -53,7 +53,7 @@ public TriggerBotHack() } @Override - public void onEnable() + protected void onEnable() { // disable other killauras WURST.getHax().clickAuraHack.setEnabled(false); @@ -70,7 +70,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { EVENTS.remove(UpdateListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/TrollPotionHack.java b/src/main/java/net/wurstclient/hacks/TrollPotionHack.java index 29a8e49944..89cc5aa87b 100644 --- a/src/main/java/net/wurstclient/hacks/TrollPotionHack.java +++ b/src/main/java/net/wurstclient/hacks/TrollPotionHack.java @@ -36,7 +36,7 @@ public TrollPotionHack() } @Override - public void onEnable() + protected void onEnable() { // check gamemode if(!MC.player.getAbilities().creativeMode) diff --git a/src/main/java/net/wurstclient/hacks/TunnellerHack.java b/src/main/java/net/wurstclient/hacks/TunnellerHack.java index 9273eb8bbd..133e267494 100644 --- a/src/main/java/net/wurstclient/hacks/TunnellerHack.java +++ b/src/main/java/net/wurstclient/hacks/TunnellerHack.java @@ -112,7 +112,7 @@ public String getRenderName() } @Override - public void onEnable() + protected void onEnable() { WURST.getHax().autoMineHack.setEnabled(false); WURST.getHax().excavatorHack.setEnabled(false); @@ -143,7 +143,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { // remove listeners EVENTS.remove(UpdateListener.class, this); diff --git a/src/main/java/net/wurstclient/hacks/XRayHack.java b/src/main/java/net/wurstclient/hacks/XRayHack.java index 24cc7cc4fc..3a01171a73 100644 --- a/src/main/java/net/wurstclient/hacks/XRayHack.java +++ b/src/main/java/net/wurstclient/hacks/XRayHack.java @@ -99,7 +99,7 @@ public String getRenderName() } @Override - public void onEnable() + protected void onEnable() { // cache block names in case the setting changes while X-Ray is enabled oreNamesCache = new ArrayList<>(ores.getBlockNames()); @@ -120,7 +120,7 @@ public void onEnable() } @Override - public void onDisable() + protected void onDisable() { // remove event listeners EVENTS.remove(UpdateListener.class, this); diff --git a/src/main/java/net/wurstclient/mixin/PlayerSkinProviderMixin.java b/src/main/java/net/wurstclient/mixin/PlayerSkinProviderMixin.java index 9af40e2bba..49456f0053 100644 --- a/src/main/java/net/wurstclient/mixin/PlayerSkinProviderMixin.java +++ b/src/main/java/net/wurstclient/mixin/PlayerSkinProviderMixin.java @@ -7,10 +7,11 @@ */ package net.wurstclient.mixin; -import java.io.InputStreamReader; -import java.net.URL; +import java.util.HashMap; +import java.util.Map.Entry; import java.util.UUID; import java.util.concurrent.CompletableFuture; +import java.util.regex.Pattern; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @@ -18,18 +19,19 @@ import org.spongepowered.asm.mixin.injection.ModifyVariable; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; import com.mojang.authlib.minecraft.MinecraftProfileTexture; import com.mojang.authlib.minecraft.MinecraftProfileTextures; import net.minecraft.client.texture.PlayerSkinProvider; import net.minecraft.client.util.SkinTextures; +import net.minecraft.util.Uuids; +import net.wurstclient.util.json.JsonUtils; +import net.wurstclient.util.json.WsonObject; @Mixin(PlayerSkinProvider.class) public abstract class PlayerSkinProviderMixin { - private static JsonObject capes; + private static HashMap capes; private MinecraftProfileTexture currentCape; @Inject(at = @At("HEAD"), @@ -45,9 +47,9 @@ private void onFetchSkinTextures(UUID uuid, if(capes == null) setupWurstCapes(); - if(capes.has(uuidString)) + if(capes.containsKey(uuidString)) { - String capeURL = capes.get(uuidString).getAsString(); + String capeURL = capes.get(uuidString); currentCape = new MinecraftProfileTexture(capeURL, null); }else @@ -81,12 +83,32 @@ private void setupWurstCapes() { try { - // TODO: download capes to file - URL url = new URL("https://www.wurstclient.net/api/v1/capes.json"); + // download cape list from wurstclient.net + WsonObject rawCapes = JsonUtils.parseURLToObject( + "https://www.wurstclient.net/api/v1/capes.json"); - capes = - JsonParser.parseReader(new InputStreamReader(url.openStream())) - .getAsJsonObject(); + Pattern uuidPattern = Pattern.compile( + "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"); + + // convert names to offline UUIDs + capes = new HashMap<>(); + for(Entry entry : rawCapes.getAllStrings() + .entrySet()) + { + String name = entry.getKey(); + String capeURL = entry.getValue(); + + // check if name is already a UUID + if(uuidPattern.matcher(name).matches()) + { + capes.put(name, capeURL); + continue; + } + + // convert name to offline UUID + String offlineUUID = "" + Uuids.getOfflinePlayerUuid(name); + capes.put(offlineUUID, capeURL); + } }catch(Exception e) { diff --git a/src/main/java/net/wurstclient/mixin/TitleScreenMixin.java b/src/main/java/net/wurstclient/mixin/TitleScreenMixin.java index 56c87ff676..cd15cfcaeb 100644 --- a/src/main/java/net/wurstclient/mixin/TitleScreenMixin.java +++ b/src/main/java/net/wurstclient/mixin/TitleScreenMixin.java @@ -34,8 +34,12 @@ private TitleScreenMixin(WurstClient wurst, Text title) super(title); } - @Inject(at = @At("RETURN"), method = "init()V") - private void onInitWidgetsNormal(CallbackInfo ci) + /** + * Adds the AltManager button to the title screen. This mixin must not + * run in demo mode, as the Realms button doesn't exist there. + */ + @Inject(at = @At("RETURN"), method = "initWidgetsNormal(II)V") + private void onInitWidgetsNormal(int y, int spacingY, CallbackInfo ci) { if(!WurstClient.INSTANCE.isEnabled()) return; diff --git a/src/main/java/net/wurstclient/settings/RoundingPrecisionSetting.java b/src/main/java/net/wurstclient/settings/RoundingPrecisionSetting.java new file mode 100644 index 0000000000..d8d27c48b9 --- /dev/null +++ b/src/main/java/net/wurstclient/settings/RoundingPrecisionSetting.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.settings; + +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.util.Locale; + +public final class RoundingPrecisionSetting extends SliderSetting +{ + private static final DecimalFormatSymbols SYMBOLS = + new DecimalFormatSymbols(Locale.ENGLISH); + + private final DecimalFormat[] FORMATS; + + public RoundingPrecisionSetting(String name, String description, int value, + int min, int max) + { + super(name, description, value, min, max, 1, + ValueDisplay.ROUNDING_PRECISION); + + if(min < 0) + throw new IllegalArgumentException( + "min must be greater than or equal to 0"); + + FORMATS = new DecimalFormat[max + 1]; + } + + public DecimalFormat getFormat() + { + int value = getValueI(); + + if(FORMATS[value] == null) + { + String pattern = "0"; + if(value > 0) + pattern += "." + "#".repeat(value); + + FORMATS[value] = new DecimalFormat(pattern, SYMBOLS); + } + + return FORMATS[value]; + } + + public String format(double value) + { + return getFormat().format(value); + } +} diff --git a/src/main/java/net/wurstclient/settings/SliderSetting.java b/src/main/java/net/wurstclient/settings/SliderSetting.java index fb190074cf..7eb231c872 100644 --- a/src/main/java/net/wurstclient/settings/SliderSetting.java +++ b/src/main/java/net/wurstclient/settings/SliderSetting.java @@ -323,6 +323,9 @@ public String getValueString(double v) public static final ValueDisplay DEGREES = INTEGER.withSuffix("\u00b0"); + public static final ValueDisplay ROUNDING_PRECISION = + v -> (int)v == 0 ? "1" : "0." + "0".repeat((int)v - 1) + "1"; + public static final ValueDisplay NONE = v -> ""; public String getValueString(double value); diff --git a/src/main/java/net/wurstclient/settings/SwingHandSetting.java b/src/main/java/net/wurstclient/settings/SwingHandSetting.java index da846eca8c..d45e37863c 100644 --- a/src/main/java/net/wurstclient/settings/SwingHandSetting.java +++ b/src/main/java/net/wurstclient/settings/SwingHandSetting.java @@ -18,38 +18,65 @@ public final class SwingHandSetting extends EnumSetting { private static final MinecraftClient MC = WurstClient.MC; + private static final String DESCRIPTION_SUFFIX = buildDescriptionSuffix(); public SwingHandSetting(String description) { - super("Swing hand", description, SwingHand.values(), SwingHand.SERVER); + this(description, SwingHand.SERVER); } public SwingHandSetting(String description, SwingHand selected) { - super("Swing hand", description, SwingHand.values(), selected); + this("Swing hand", description, selected); } public SwingHandSetting(String name, String description, SwingHand selected) { - super(name, description, SwingHand.values(), selected); + super(name, description + DESCRIPTION_SUFFIX, SwingHand.values(), + selected); + } + + public void swing(Hand hand) + { + getSelected().swing(hand); + } + + private static String buildDescriptionSuffix() + { + StringBuilder builder = new StringBuilder("\n\n"); + + for(SwingHand value : SwingHand.values()) + builder.append("\u00a7l").append(value.name).append("\u00a7r - ") + .append(value.description).append("\n\n"); + + return builder.toString(); } public enum SwingHand { - OFF("Off", hand -> {}), + OFF("Off", + "Don't swing your hand at all. Will be detected by anti-cheat" + + " plugins.", + hand -> {}), SERVER("Server-side", + "Swing your hand on the server-side, without playing the animation" + + " on the client-side.", hand -> MC.player.networkHandler .sendPacket(new HandSwingC2SPacket(hand))), - CLIENT("Client-side", hand -> MC.player.swingHand(hand)); + CLIENT("Client-side", + "Swing your hand on the client-side. This is the most legit option.", + hand -> MC.player.swingHand(hand)); - private String name; - private Consumer swing; + private final String name; + private final String description; + private final Consumer swing; - private SwingHand(String name, Consumer swing) + private SwingHand(String name, String description, Consumer swing) { this.name = name; + this.description = description; this.swing = swing; } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 827d585e69..e1e2d737db 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -29,7 +29,7 @@ "accessWidener" : "wurst.accesswidener", "depends": { - "fabricloader": ">=0.15.0", + "fabricloader": ">=0.15.9", "fabric-api": ">=0.91.1", "minecraft": "~1.20.3-beta.3", "java": ">=17"