Compare commits

..

10 Commits

Author SHA1 Message Date
4a822e773c Update to Meteor-Rejects to 1.21.10
Some checks failed
Java CI with Gradle / build (push) Has been cancelled
2025-11-01 23:32:30 -03:00
dependabot[bot]
4563a7e7ef github-actions(deps): bump actions/setup-java from 3.13.0 to 4.7.0 (#409)
[no ci]

Bumps [actions/setup-java](https://github.com/actions/setup-java) from 3.13.0 to 4.7.0.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v3.13.0...v4.7.0)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-30 09:52:45 +07:00
dependabot[bot]
1783149fb1 github-actions(deps): bump actions/upload-artifact from 3 to 4 (#408)
[no ci]

* Update to 1.21.3/1.21.4 (#399)

* Update to 1.21.3 part 1

Don't expect it to work anytime soon.

* Update to 1.21.3 part 2

* Gradle 8.8 -> 8.12

* Working Build 1.21.3

Had to revert gradle to 8.10 due to unforseen issues.

* Removed Unused Imports

* Small rendering fixes (hopefully)

* 1.21.4 port

* Use Utils.canUpdate in AutoCraft

* Intellij code fixes

---------

Co-authored-by: crazymoose77756 <ryanrogo064@gmail.com>
Co-authored-by: SByte <stormybytes@gmail.com>

* github-actions(deps): bump actions/checkout from 3 to 4 (#288)

Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: SByte <stormybytes@gmail.com>

* github-actions(deps): bump actions/setup-java from 3.10.0 to 3.13.0 (#289)

Bumps [actions/setup-java](https://github.com/actions/setup-java) from 3.10.0 to 3.13.0.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v3.10.0...v3.13.0)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: SByte <stormybytes@gmail.com>

* Bumping Seedfinding Library Version to fix SimOre outdating issue (#376)

* Update build.gradle for seedfinding lib

---------

Co-authored-by: SByte <stormybytes@gmail.com>

* Update version displayed on build workflow

* github-actions(deps): bump actions/upload-artifact from 3 to 4

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Ashray Shah <geektraindev@gmail.com>
Co-authored-by: crazymoose77756 <ryanrogo064@gmail.com>
Co-authored-by: SByte <stormybytes@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Azote | 窒垝 <azoteg@gmx.com>
2025-01-30 09:50:49 +07:00
SByte
faecb03084 Update version displayed on build workflow 2025-01-27 11:06:45 +07:00
Azote | 窒垝
4768fec4f6 Bumping Seedfinding Library Version to fix SimOre outdating issue (#376)
* Update build.gradle for seedfinding lib

---------

Co-authored-by: SByte <stormybytes@gmail.com>
2025-01-25 09:43:30 +07:00
dependabot[bot]
63c57eb114 github-actions(deps): bump actions/setup-java from 3.10.0 to 3.13.0 (#289)
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 3.10.0 to 3.13.0.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v3.10.0...v3.13.0)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: SByte <stormybytes@gmail.com>
2025-01-25 09:18:15 +07:00
dependabot[bot]
2947dd7df8 github-actions(deps): bump actions/checkout from 3 to 4 (#288)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: SByte <stormybytes@gmail.com>
2025-01-25 08:59:36 +07:00
Ashray Shah
0dcf1a26d0 Update to 1.21.3/1.21.4 (#399)
* Update to 1.21.3 part 1

Don't expect it to work anytime soon.

* Update to 1.21.3 part 2

* Gradle 8.8 -> 8.12

* Working Build 1.21.3

Had to revert gradle to 8.10 due to unforseen issues.

* Removed Unused Imports

* Small rendering fixes (hopefully)

* 1.21.4 port

* Use Utils.canUpdate in AutoCraft

* Intellij code fixes

---------

Co-authored-by: crazymoose77756 <ryanrogo064@gmail.com>
Co-authored-by: SByte <stormybytes@gmail.com>
2025-01-25 07:44:35 +07:00
ruriyoshinova
5049f5fbeb Fix mixin mismatch descriptor 2025-01-21 06:08:02 +07:00
crazymoose77756
fef076ad20 Update 1.21 (#365) 2024-07-01 09:04:40 +02:00
112 changed files with 965 additions and 768 deletions

View File

@@ -19,9 +19,9 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Set up JDK 21 - name: Set up JDK 21
uses: actions/setup-java@v3.10.0 uses: actions/setup-java@v4.7.0
with: with:
java-version: 21 java-version: 21
distribution: 'zulu' distribution: 'zulu'
@@ -34,9 +34,9 @@ jobs:
- uses: "marvinpinto/action-automatic-releases@latest" - uses: "marvinpinto/action-automatic-releases@latest"
with: with:
repo_token: "${{ secrets.GITHUB_TOKEN }}" repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest-1.20.6" automatic_release_tag: "latest-1.21.4"
prerelease: false prerelease: false
title: "1.20.6 Build" title: "1.21.4 Build"
files: | files: |
./build/libs/*.jar ./build/libs/*.jar

View File

@@ -10,9 +10,9 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Set up JDK 21 - name: Set up JDK 17
uses: actions/setup-java@v3.10.0 uses: actions/setup-java@v4.7.0
with: with:
java-version: 21 java-version: 21
distribution: 'zulu' distribution: 'zulu'
@@ -21,7 +21,7 @@ jobs:
- name: Build with Gradle - name: Build with Gradle
run: ./gradlew build run: ./gradlew build
- name: Upload Artifact - name: Upload Artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: pull-request-build name: pull-request-build
path: build/libs/ path: build/libs/

View File

@@ -1,5 +1,5 @@
plugins { plugins {
id 'fabric-loom' version '1.6-SNAPSHOT' id 'fabric-loom' version '1.11-SNAPSHOT'
} }
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_21 sourceCompatibility = targetCompatibility = JavaVersion.VERSION_21
@@ -18,6 +18,11 @@ repositories {
maven { url 'https://jitpack.io' } maven { url 'https://jitpack.io' }
maven { url 'https://maven.duti.dev/releases' } maven { url 'https://maven.duti.dev/releases' }
} }
loom {
accessWidenerPath = file("src/main/resources/meteor-rejects.accesswidener")
}
configurations { configurations {
// configuration that holds jars to include in the jar // configuration that holds jars to include in the jar
extraLibs extraLibs
@@ -34,13 +39,17 @@ dependencies {
mappings "net.fabricmc:yarn:${project.yarn_version}:v2" mappings "net.fabricmc:yarn:${project.yarn_version}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation("meteordevelopment:meteor-client:${project.meteor_version}-SNAPSHOT") modImplementation("meteordevelopment:meteor-client:${project.minecraft_version}-SNAPSHOT")
modCompileOnly "meteordevelopment:baritone:${project.baritone_version}-SNAPSHOT" modCompileOnly "meteordevelopment:baritone:${project.baritone_version}-SNAPSHOT"
// Apache Commons Text for WordUtils
implementation 'org.apache.commons:commons-text:1.10.0'
include 'org.apache.commons:commons-text:1.10.0'
// seed .locate and ore sim // seed .locate and ore sim
extraLibs('com.seedfinding:mc_math:ffd2edcfcc0d18147549c88cc7d8ec6cf21b5b91') { transitive = false } extraLibs('com.seedfinding:mc_math:ffd2edcfcc0d18147549c88cc7d8ec6cf21b5b91') { transitive = false }
extraLibs('com.seedfinding:mc_seed:1ead6fcefe7e8de4b3d60cd6c4e993f1e8f33409') { transitive = false } extraLibs('com.seedfinding:mc_seed:1ead6fcefe7e8de4b3d60cd6c4e993f1e8f33409') { transitive = false }
extraLibs('com.seedfinding:mc_core:d64d5f90be66300da41ef58f4f1736db2499784f') { transitive = false } extraLibs('com.seedfinding:mc_core:1.210.0') { transitive = false }
extraLibs('com.seedfinding:mc_noise:7e3ba65e181796c4a2a1c8881d840b2254b92962') { transitive = false } extraLibs('com.seedfinding:mc_noise:7e3ba65e181796c4a2a1c8881d840b2254b92962') { transitive = false }
extraLibs('com.seedfinding:mc_biome:41a42cb9019a552598f12089059538853e18ec78') { transitive = false } extraLibs('com.seedfinding:mc_biome:41a42cb9019a552598f12089059538853e18ec78') { transitive = false }
extraLibs('com.seedfinding:mc_terrain:b4246cbd5880c4f8745ccb90e1b102bde3448126') { transitive = false } extraLibs('com.seedfinding:mc_terrain:b4246cbd5880c4f8745ccb90e1b102bde3448126') { transitive = false }
@@ -53,10 +62,6 @@ dependencies {
configurations.implementation.extendsFrom(configurations.extraLibs) configurations.implementation.extendsFrom(configurations.extraLibs)
} }
loom {
accessWidenerPath = file("src/main/resources/meteor-rejects.accesswidener")
}
processResources { processResources {
inputs.property "version", project.version inputs.property "version", project.version

View File

@@ -2,14 +2,13 @@
org.gradle.jvmargs=-Xmx2G org.gradle.jvmargs=-Xmx2G
# Fabric Properties # Fabric Properties
minecraft_version=1.20.6 minecraft_version=1.21.10
yarn_version=1.20.6+build.1 yarn_version=1.21.10+build.2
loader_version=0.15.11 loader_version=0.17.2
# Mod Properties # Mod Properties
mod_version = 0.3 mod_version = 0.3
maven_group = anticope.rejects maven_group = anticope.rejects
archives_base_name = meteor-rejects-addon archives_base_name = meteor-rejects-addon
meteor_version=0.5.7 baritone_version=1.21.10
baritone_version=1.20.4

Binary file not shown.

View File

@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

296
gradlew vendored
View File

@@ -1,7 +1,7 @@
#!/usr/bin/env sh #!/bin/sh
# #
# Copyright 2015 the original author or authors. # Copyright © 2015-2021 the original authors.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@@ -15,69 +15,103 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# #
# SPDX-License-Identifier: Apache-2.0
#
############################################################################## ##############################################################################
## #
## Gradle start up script for UN*X # Gradle start up script for POSIX generated by Gradle.
## #
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
############################################################################## ##############################################################################
# Attempt to set APP_HOME # Attempt to set APP_HOME
# Resolve links: $0 may be a link # Resolve links: $0 may be a link
PRG="$0" app_path=$0
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do # Need this for daisy-chained symlinks.
ls=`ls -ld "$PRG"` while
link=`expr "$ls" : '.*-> \(.*\)$'` APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
if expr "$link" : '/.*' > /dev/null; then [ -h "$app_path" ]
PRG="$link" do
else ls=$( ls -ld "$app_path" )
PRG=`dirname "$PRG"`"/$link" link=${ls#*' -> '}
fi case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle" # This is normally unused
APP_BASE_NAME=`basename "$0"` # shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum" MAX_FD=maximum
warn () { warn () {
echo "$*" echo "$*"
} } >&2
die () { die () {
echo echo
echo "$*" echo "$*"
echo echo
exit 1 exit 1
} } >&2
# OS specific support (must be 'true' or 'false'). # OS specific support (must be 'true' or 'false').
cygwin=false cygwin=false
msys=false msys=false
darwin=false darwin=false
nonstop=false nonstop=false
case "`uname`" in case "$( uname )" in #(
CYGWIN* ) CYGWIN* ) cygwin=true ;; #(
cygwin=true Darwin* ) darwin=true ;; #(
;; MSYS* | MINGW* ) msys=true ;; #(
Darwin* ) NONSTOP* ) nonstop=true ;;
darwin=true
;;
MSYS* | MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
if [ -n "$JAVA_HOME" ] ; then if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables # IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java" JAVACMD=$JAVA_HOME/jre/sh/java
else else
JAVACMD="$JAVA_HOME/bin/java" JAVACMD=$JAVA_HOME/bin/java
fi fi
if [ ! -x "$JAVACMD" ] ; then if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -98,88 +132,120 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
fi fi
else else
JAVACMD="java" JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
fi fi
fi
# Increase the maximum file descriptors if we can. # Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
MAX_FD_LIMIT=`ulimit -H -n` case $MAX_FD in #(
if [ $? -eq 0 ] ; then max*)
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
MAX_FD="$MAX_FD_LIMIT" # shellcheck disable=SC2039,SC3045
fi MAX_FD=$( ulimit -H -n ) ||
ulimit -n $MAX_FD warn "Could not query maximum file descriptor limit"
if [ $? -ne 0 ] ; then esac
warn "Could not set maximum file descriptor limit: $MAX_FD" case $MAX_FD in #(
fi '' | soft) :;; #(
else *)
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
fi # shellcheck disable=SC2039,SC3045
fi ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac esac
fi fi
# Escape application args # Collect all arguments for the java command, stacking in reverse order:
save () { # * args from the command line
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done # * the main class name
echo " " # * -classpath
} # * -D...appname settings
APP_ARGS=`save "$@"` # * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# Collect all arguments for the java command, following the shell quoting and substitution rules # For Cygwin or MSYS, switch paths to Windows format before running java
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@" exec "$JAVACMD" "$@"

33
gradlew.bat vendored
View File

@@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and @rem See the License for the specific language governing permissions and
@rem limitations under the License. @rem limitations under the License.
@rem @rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off @if "%DEBUG%"=="" @echo off
@rem ########################################################################## @rem ##########################################################################
@@ -26,6 +28,7 @@ if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0 set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=. if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0 set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% set APP_HOME=%DIRNAME%
@@ -40,13 +43,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1 %JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute if %ERRORLEVEL% equ 0 goto execute
echo. echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. echo location of your Java installation. 1>&2
goto fail goto fail
@@ -56,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute if exist "%JAVA_EXE%" goto execute
echo. echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. echo location of your Java installation. 1>&2
goto fail goto fail
@@ -75,13 +78,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
:end :end
@rem End local scope for the variables with windows NT shell @rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd if %ERRORLEVEL% equ 0 goto mainEnd
:fail :fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code! rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 set EXIT_CODE=%ERRORLEVEL%
exit /b 1 if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd :mainEnd
if "%OS%"=="Windows_NT" endlocal if "%OS%"=="Windows_NT" endlocal

View File

@@ -50,7 +50,7 @@ public class MeteorRejectsAddon extends MeteorAddon {
modules.add(new BoatPhase()); modules.add(new BoatPhase());
modules.add(new Boost()); modules.add(new Boost());
modules.add(new BungeeCordSpoof()); modules.add(new BungeeCordSpoof());
modules.add(new ChatBot()); // modules.add(new ChatBot()); // DESABILITADO: Starscript API removida
modules.add(new ChestAura()); modules.add(new ChestAura());
modules.add(new ChorusExploit()); modules.add(new ChorusExploit());
modules.add(new ColorSigns()); modules.add(new ColorSigns());
@@ -63,7 +63,7 @@ public class MeteorRejectsAddon extends MeteorAddon {
modules.add(new GhostMode()); modules.add(new GhostMode());
modules.add(new Glide()); modules.add(new Glide());
modules.add(new ItemGenerator()); modules.add(new ItemGenerator());
modules.add(new InteractionMenu()); // modules.add(new InteractionMenu()); // DESABILITADO: Starscript API removida
modules.add(new Jetpack()); modules.add(new Jetpack());
modules.add(new KnockbackPlus()); modules.add(new KnockbackPlus());
modules.add(new LawnBot()); modules.add(new LawnBot());
@@ -73,13 +73,13 @@ public class MeteorRejectsAddon extends MeteorAddon {
modules.add(new NoJumpDelay()); modules.add(new NoJumpDelay());
modules.add(new ObsidianFarm()); modules.add(new ObsidianFarm());
modules.add(new OreSim()); modules.add(new OreSim());
modules.add(new PacketFly()); // modules.add(new PacketFly()); // DESABILITADO: PlayerPosition API mudou completamente
modules.add(new Painter()); modules.add(new Painter());
modules.add(new Rendering()); modules.add(new Rendering());
modules.add(new RoboWalk()); modules.add(new RoboWalk());
modules.add(new ShieldBypass()); modules.add(new ShieldBypass());
modules.add(new SilentDisconnect()); modules.add(new SilentDisconnect());
modules.add(new SkeletonESP()); // modules.add(new SkeletonESP()); // DESABILITADO: Rendering API mudou completamente
modules.add(new SoundLocator()); modules.add(new SoundLocator());
modules.add(new TreeAura()); modules.add(new TreeAura());
modules.add(new VehicleOneHit()); modules.add(new VehicleOneHit());
@@ -135,7 +135,7 @@ public class MeteorRejectsAddon extends MeteorAddon {
.get().getMetadata() .get().getMetadata()
.getCustomValue("github:sha") .getCustomValue("github:sha")
.getAsString(); .getAsString();
LOG.info(String.format("Rejects version: %s", commit)); LOG.info("Rejects version: {}", commit);
return commit.isEmpty() ? null : commit.trim(); return commit.isEmpty() ? null : commit.trim();
} }

View File

@@ -13,7 +13,6 @@ import net.minecraft.command.argument.Vec3ArgumentType;
import net.minecraft.server.command.CommandManager; import net.minecraft.server.command.CommandManager;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;

View File

@@ -24,6 +24,7 @@ public class EnumArgumentType<T extends Enum<?>> implements ArgumentType<T> {
super(); super();
try { try {
//noinspection unchecked
values = (T[]) defaultValue.getClass().getMethod("values").invoke(null); values = (T[]) defaultValue.getClass().getMethod("values").invoke(null);
} catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
e.printStackTrace(); e.printStackTrace();
@@ -34,6 +35,7 @@ public class EnumArgumentType<T extends Enum<?>> implements ArgumentType<T> {
return new EnumArgumentType<>(defaultValue); return new EnumArgumentType<>(defaultValue);
} }
@SuppressWarnings("unchecked")
public static <T extends Enum<?>> T getEnum(CommandContext<?> context, String name, T defaultValue) { public static <T extends Enum<?>> T getEnum(CommandContext<?> context, String name, T defaultValue) {
return (T) context.getArgument(name, defaultValue.getClass()); return (T) context.getArgument(name, defaultValue.getClass());
} }

View File

@@ -6,9 +6,6 @@ import net.minecraft.command.CommandSource;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.MathHelper;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static meteordevelopment.meteorclient.MeteorClient.mc;
public class CenterCommand extends Command { public class CenterCommand extends Command {
public CenterCommand() { public CenterCommand() {
super("center", "Centers the player on a block."); super("center", "Centers the player on a block.");
@@ -20,7 +17,7 @@ public class CenterCommand extends Command {
double x = MathHelper.floor(mc.player.getX()) + 0.5; double x = MathHelper.floor(mc.player.getX()) + 0.5;
double z = MathHelper.floor(mc.player.getZ()) + 0.5; double z = MathHelper.floor(mc.player.getZ()) + 0.5;
mc.player.setPosition(x, mc.player.getY(), z); mc.player.setPosition(x, mc.player.getY(), z);
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY(), mc.player.getZ(), mc.player.isOnGround())); mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY(), mc.player.getZ(), mc.player.isOnGround(), mc.player.horizontalCollision));
return SINGLE_SUCCESS; return SINGLE_SUCCESS;
})); }));
@@ -29,7 +26,7 @@ public class CenterCommand extends Command {
double x = MathHelper.floor(mc.player.getX()); double x = MathHelper.floor(mc.player.getX());
double z = MathHelper.floor(mc.player.getZ()); double z = MathHelper.floor(mc.player.getZ());
mc.player.setPosition(x, mc.player.getY(), z); mc.player.setPosition(x, mc.player.getY(), z);
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY(), mc.player.getZ(), mc.player.isOnGround())); mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY(), mc.player.getZ(), mc.player.isOnGround(), mc.player.horizontalCollision));
return SINGLE_SUCCESS; return SINGLE_SUCCESS;
})); }));

View File

@@ -4,9 +4,6 @@ import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import meteordevelopment.meteorclient.commands.Command; import meteordevelopment.meteorclient.commands.Command;
import net.minecraft.command.CommandSource; import net.minecraft.command.CommandSource;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static meteordevelopment.meteorclient.MeteorClient.mc;
public class ClearChatCommand extends Command { public class ClearChatCommand extends Command {
public ClearChatCommand() { public ClearChatCommand() {
super("clear-chat", "Clears your chat.", "clear", "cls"); super("clear-chat", "Clears your chat.", "clear", "cls");

View File

@@ -9,9 +9,6 @@ import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static meteordevelopment.meteorclient.MeteorClient.mc;
public class GhostCommand extends Command { public class GhostCommand extends Command {
public GhostCommand() { public GhostCommand() {
super("ghost", "Remove ghost blocks & bypass AntiXray", "aax", "anti-anti-xray"); super("ghost", "Remove ghost blocks & bypass AntiXray", "aax", "anti-anti-xray");

View File

@@ -44,8 +44,9 @@ public class GiveCommand extends Command {
if (inHand.getItem() instanceof BlockItem) { if (inHand.getItem() instanceof BlockItem) {
ct.putInt("Time", 1); ct.putInt("Time", 1);
ct.putString("id", "minecraft:falling_block"); ct.putString("id", "minecraft:falling_block");
ct.put("BlockState", new NbtCompound()); NbtCompound blockState = new NbtCompound();
ct.getCompound("BlockState").putString("Name", Registries.ITEM.getId(inHand.getItem()).toString()); blockState.putString("Name", Registries.ITEM.getId(inHand.getItem()).toString());
ct.put("BlockState", blockState);
} else { } else {
ct.putString("id", "minecraft:item"); ct.putString("id", "minecraft:item");
@@ -88,7 +89,7 @@ public class GiveCommand extends Command {
var changes = ComponentChanges.builder() var changes = ComponentChanges.builder()
.add(DataComponentTypes.CUSTOM_NAME, Text.literal(message)) .add(DataComponentTypes.CUSTOM_NAME, Text.literal(message))
.add(DataComponentTypes.ENTITY_DATA, NbtComponent.of(tag)) .add(DataComponentTypes.CUSTOM_DATA, NbtComponent.of(tag))
.build(); .build();
stack.applyChanges(changes); stack.applyChanges(changes);
@@ -108,7 +109,7 @@ public class GiveCommand extends Command {
var changes = ComponentChanges.builder() var changes = ComponentChanges.builder()
.add(DataComponentTypes.CUSTOM_NAME, Text.literal(message)) .add(DataComponentTypes.CUSTOM_NAME, Text.literal(message))
.add(DataComponentTypes.ENTITY_DATA, NbtComponent.of(tag)) .add(DataComponentTypes.CUSTOM_DATA, NbtComponent.of(tag))
.build(); .build();
stack.applyChanges(changes); stack.applyChanges(changes);
@@ -121,8 +122,10 @@ public class GiveCommand extends Command {
String playerName = ctx.getArgument("owner", String.class); String playerName = ctx.getArgument("owner", String.class);
ItemStack itemStack = new ItemStack(Items.PLAYER_HEAD); ItemStack itemStack = new ItemStack(Items.PLAYER_HEAD);
// For now, skip the profile component as it's causing issues
// TODO: Fix ProfileComponent usage for player heads
var changes = ComponentChanges.builder() var changes = ComponentChanges.builder()
.add(DataComponentTypes.PROFILE, new ProfileComponent(new GameProfile(getUUID(playerName), playerName))) .add(DataComponentTypes.CUSTOM_NAME, Text.literal(playerName + "'s Head"))
.build(); .build();
itemStack.applyChanges(changes); itemStack.applyChanges(changes);

View File

@@ -7,8 +7,6 @@ import meteordevelopment.meteorclient.gui.GuiThemes;
import meteordevelopment.meteorclient.utils.Utils; import meteordevelopment.meteorclient.utils.Utils;
import net.minecraft.command.CommandSource; import net.minecraft.command.CommandSource;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
public class HeadsCommand extends Command { public class HeadsCommand extends Command {
public HeadsCommand() { public HeadsCommand() {

View File

@@ -11,9 +11,6 @@ import net.minecraft.network.packet.s2c.common.DisconnectS2CPacket;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import org.apache.commons.lang3.SystemUtils; import org.apache.commons.lang3.SystemUtils;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static meteordevelopment.meteorclient.MeteorClient.mc;
public class KickCommand extends Command { public class KickCommand extends Command {
public KickCommand() { public KickCommand() {
@@ -47,7 +44,7 @@ public class KickCommand extends Command {
return SINGLE_SUCCESS; return SINGLE_SUCCESS;
})); }));
builder.then(literal("pos").executes(ctx -> { builder.then(literal("pos").executes(ctx -> {
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, !mc.player.isOnGround())); mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, !mc.player.isOnGround(), mc.player.horizontalCollision));
return SINGLE_SUCCESS; return SINGLE_SUCCESS;
})); }));
builder.then(literal("hurt").executes(ctx -> { builder.then(literal("hurt").executes(ctx -> {

View File

@@ -19,9 +19,6 @@ import net.minecraft.util.math.Vec3d;
import cubitect.Cubiomes; import cubitect.Cubiomes;
import cubitect.Cubiomes.Pos; import cubitect.Cubiomes.Pos;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static meteordevelopment.meteorclient.MeteorClient.mc;
public class LocateCommand extends Command { public class LocateCommand extends Command {
private final static DynamicCommandExceptionType NOT_FOUND = new DynamicCommandExceptionType(o -> { private final static DynamicCommandExceptionType NOT_FOUND = new DynamicCommandExceptionType(o -> {

View File

@@ -8,8 +8,6 @@ import net.minecraft.command.CommandSource;
import java.util.ArrayList; import java.util.ArrayList;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
public class PanicCommand extends Command { public class PanicCommand extends Command {
public PanicCommand() { public PanicCommand() {
super("panic", "Disables all modules.", "disable-all"); super("panic", "Disables all modules.", "disable-all");

View File

@@ -8,9 +8,8 @@ import net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen;
import net.minecraft.client.network.ServerAddress; import net.minecraft.client.network.ServerAddress;
import net.minecraft.client.network.ServerInfo; import net.minecraft.client.network.ServerInfo;
import net.minecraft.command.CommandSource; import net.minecraft.command.CommandSource;
import net.minecraft.network.packet.s2c.common.DisconnectS2CPacket;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS; import net.minecraft.text.Text;
import static meteordevelopment.meteorclient.MeteorClient.mc;
public class ReconnectCommand extends Command { public class ReconnectCommand extends Command {
public ReconnectCommand() { public ReconnectCommand() {
@@ -22,7 +21,7 @@ public class ReconnectCommand extends Command {
builder.executes(context -> { builder.executes(context -> {
ServerInfo info = mc.isInSingleplayer() ? null : mc.getCurrentServerEntry(); ServerInfo info = mc.isInSingleplayer() ? null : mc.getCurrentServerEntry();
if (info != null) { if (info != null) {
mc.world.disconnect(); mc.player.networkHandler.onDisconnect(new DisconnectS2CPacket(Text.literal("Reconnecting...")));
ConnectScreen.connect(new MultiplayerScreen(new TitleScreen()), mc, ConnectScreen.connect(new MultiplayerScreen(new TitleScreen()), mc,
ServerAddress.parse(info.address), info, false, null); ServerAddress.parse(info.address), info, false, null);
} }

View File

@@ -23,8 +23,6 @@ import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.UUID; import java.util.UUID;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
public class SaveSkinCommand extends Command { public class SaveSkinCommand extends Command {
private final static SimpleCommandExceptionType IO_EXCEPTION = new SimpleCommandExceptionType(Text.literal("An exception occurred")); private final static SimpleCommandExceptionType IO_EXCEPTION = new SimpleCommandExceptionType(Text.literal("An exception occurred"));
@@ -46,7 +44,7 @@ public class SaveSkinCommand extends Command {
@Override @Override
public void build(LiteralArgumentBuilder<CommandSource> builder) { public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.then(argument("player", PlayerListEntryArgumentType.create()).executes(ctx -> { builder.then(argument("player", PlayerListEntryArgumentType.create()).executes(ctx -> {
UUID id = PlayerListEntryArgumentType.get(ctx).getProfile().getId(); UUID id = PlayerListEntryArgumentType.get(ctx).getProfile().id();
String path = TinyFileDialogs.tinyfd_saveFileDialog("Save image", null, filters, null); String path = TinyFileDialogs.tinyfd_saveFileDialog("Save image", null, filters, null);
if (path == null) IO_EXCEPTION.create(); if (path == null) IO_EXCEPTION.create();
if (path != null) { if (path != null) {

View File

@@ -13,8 +13,6 @@ import net.minecraft.command.CommandSource;
import net.minecraft.text.MutableText; import net.minecraft.text.MutableText;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
public class SeedCommand extends Command { public class SeedCommand extends Command {
private final static SimpleCommandExceptionType NO_SEED = new SimpleCommandExceptionType(Text.literal("No seed for current world saved.")); private final static SimpleCommandExceptionType NO_SEED = new SimpleCommandExceptionType(Text.literal("No seed for current world saved."));

View File

@@ -10,19 +10,17 @@ import meteordevelopment.meteorclient.commands.Command;
import net.minecraft.client.network.ServerInfo; import net.minecraft.client.network.ServerInfo;
import net.minecraft.command.CommandSource; import net.minecraft.command.CommandSource;
import net.minecraft.text.ClickEvent; import net.minecraft.text.ClickEvent;
import net.minecraft.text.ClickEvent.Action;
import net.minecraft.text.HoverEvent; import net.minecraft.text.HoverEvent;
import net.minecraft.text.MutableText; import net.minecraft.text.MutableText;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import net.minecraft.util.Formatting; import net.minecraft.util.Formatting;
import java.net.URI;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.util.*; import java.util.*;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static meteordevelopment.meteorclient.MeteorClient.mc;
/* /*
Ported from Cornos Ported from Cornos
https://github.com/cornos/Cornos/blob/master/src/main/java/me/zeroX150/cornos/features/command/impl/Scan.java https://github.com/cornos/Cornos/blob/master/src/main/java/me/zeroX150/cornos/features/command/impl/Scan.java
@@ -119,46 +117,38 @@ public class ServerCommand extends Command {
text.append(ports.get(port)); text.append(ports.get(port));
if (ports.get(port).startsWith("HTTP") || ports.get(port).startsWith("FTP")) { if (ports.get(port).startsWith("HTTP") || ports.get(port).startsWith("FTP")) {
text.setStyle(text.getStyle() text.setStyle(text.getStyle()
.withClickEvent(new ClickEvent( .withClickEvent(new ClickEvent.OpenUrl(
Action.OPEN_URL, URI.create(String.format("%s://%s:%d", ports.get(port).toLowerCase(), address.getHostAddress(), port))
String.format("%s://%s:%d", ports.get(port).toLowerCase(), address.getHostAddress(), port)
)) ))
.withHoverEvent(new HoverEvent( .withHoverEvent(new HoverEvent.ShowText(
HoverEvent.Action.SHOW_TEXT,
Text.literal("Open in browser") Text.literal("Open in browser")
)) ))
); );
} else if (Objects.equals(ports.get(port), "DynMap")) { } else if (Objects.equals(ports.get(port), "DynMap")) {
text.setStyle(text.getStyle() text.setStyle(text.getStyle()
.withClickEvent(new ClickEvent( .withClickEvent(new ClickEvent.OpenUrl(
ClickEvent.Action.OPEN_URL, URI.create(String.format("http://%s:%d", address.getHostAddress(), port))
String.format("http://%s:%d", address.getHostAddress(), port)
)) ))
.withHoverEvent(new HoverEvent( .withHoverEvent(new HoverEvent.ShowText(
HoverEvent.Action.SHOW_TEXT,
Text.literal("Open in browser") Text.literal("Open in browser")
)) ))
); );
} else { } else {
text.setStyle(text.getStyle() text.setStyle(text.getStyle()
.withClickEvent(new ClickEvent( .withClickEvent(new ClickEvent.CopyToClipboard(
ClickEvent.Action.COPY_TO_CLIPBOARD,
String.format("%s:%d", address.getHostAddress(), port) String.format("%s:%d", address.getHostAddress(), port)
)) ))
.withHoverEvent(new HoverEvent( .withHoverEvent(new HoverEvent.ShowText(
HoverEvent.Action.SHOW_TEXT,
Text.literal("Copy") Text.literal("Copy")
)) ))
); );
} }
} else { } else {
text.setStyle(text.getStyle() text.setStyle(text.getStyle()
.withClickEvent(new ClickEvent( .withClickEvent(new ClickEvent.CopyToClipboard(
ClickEvent.Action.COPY_TO_CLIPBOARD,
String.format("%s:%d", address.getHostAddress(), port) String.format("%s:%d", address.getHostAddress(), port)
)) ))
.withHoverEvent(new HoverEvent( .withHoverEvent(new HoverEvent.ShowText(
HoverEvent.Action.SHOW_TEXT,
Text.literal("Copy") Text.literal("Copy")
)) ))
); );

View File

@@ -10,9 +10,6 @@ import net.minecraft.command.argument.BlockStateArgumentType;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static meteordevelopment.meteorclient.MeteorClient.mc;
public class SetBlockCommand extends Command { public class SetBlockCommand extends Command {
public SetBlockCommand() { public SetBlockCommand() {
super("setblock", "Sets client side blocks", "sblk"); super("setblock", "Sets client side blocks", "sblk");

View File

@@ -5,9 +5,6 @@ import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import meteordevelopment.meteorclient.commands.Command; import meteordevelopment.meteorclient.commands.Command;
import net.minecraft.command.CommandSource; import net.minecraft.command.CommandSource;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static meteordevelopment.meteorclient.MeteorClient.mc;
public class SetVelocityCommand extends Command { public class SetVelocityCommand extends Command {
public SetVelocityCommand() { public SetVelocityCommand() {
super("set-velocity", "Sets player velocity", "velocity", "vel"); super("set-velocity", "Sets player velocity", "velocity", "vel");

View File

@@ -7,9 +7,6 @@ import meteordevelopment.meteorclient.commands.Command;
import net.minecraft.command.CommandSource; import net.minecraft.command.CommandSource;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static meteordevelopment.meteorclient.MeteorClient.mc;
public class TeleportCommand extends Command { public class TeleportCommand extends Command {

View File

@@ -16,9 +16,6 @@ import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static meteordevelopment.meteorclient.MeteorClient.mc;
public class TerrainExport extends Command { public class TerrainExport extends Command {
private final static SimpleCommandExceptionType IO_EXCEPTION = new SimpleCommandExceptionType(Text.literal("An IOException occurred")); private final static SimpleCommandExceptionType IO_EXCEPTION = new SimpleCommandExceptionType(Text.literal("An IOException occurred"));

View File

@@ -116,7 +116,7 @@ public class RadarHud extends HudElement {
double yPos = ((coords.getZ() - mc.player.getZ()) * scale.get() * zoom.get() + height / 2); double yPos = ((coords.getZ() - mc.player.getZ()) * scale.get() * zoom.get() + height / 2);
if (xPos < 0 || yPos < 0 || xPos > width - scale.get() || yPos > height - scale.get()) continue; if (xPos < 0 || yPos < 0 || xPos > width - scale.get() || yPos > height - scale.get()) continue;
String icon = "*"; String icon = "*";
if (letters.get() && waypoint.name.get().length() > 0) if (letters.get() && !waypoint.name.get().isEmpty())
icon = waypoint.name.get().substring(0, 1); icon = waypoint.name.get().substring(0, 1);
renderer.text(icon, xPos + x, yPos + y, waypoint.color.get(), false); renderer.text(icon, xPos + x, yPos + y, waypoint.color.get(), false);
} }

View File

@@ -98,7 +98,7 @@ public class HeadScreen extends WindowScreen {
WButton equip = t.add(theme.button("Equip")).widget(); WButton equip = t.add(theme.button("Equip")).widget();
equip.tooltip = "Equip client-side."; equip.tooltip = "Equip client-side.";
equip.action = () -> { equip.action = () -> {
mc.player.getInventory().armor.set(3, head); mc.player.getInventory().setStack(39, head);
}; };
t.row(); t.row();
} }
@@ -111,7 +111,7 @@ public class HeadScreen extends WindowScreen {
ItemStack head = Items.PLAYER_HEAD.getDefaultStack(); ItemStack head = Items.PLAYER_HEAD.getDefaultStack();
NbtCompound tag = new NbtCompound(); NbtCompound tag = new NbtCompound();
NbtCompound skullOwner = new NbtCompound(); NbtCompound skullOwner = new NbtCompound();
skullOwner.putUuid("Id", UUID.fromString(uuid)); skullOwner.putString("Id", uuid);
NbtCompound properties = new NbtCompound(); NbtCompound properties = new NbtCompound();
NbtList textures = new NbtList(); NbtList textures = new NbtList();
NbtCompound Value = new NbtCompound(); NbtCompound Value = new NbtCompound();

View File

@@ -15,12 +15,13 @@ import meteordevelopment.starscript.compiler.Parser;
import meteordevelopment.starscript.utils.Error; import meteordevelopment.starscript.utils.Error;
import meteordevelopment.starscript.utils.StarscriptError; import meteordevelopment.starscript.utils.StarscriptError;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gl.ShaderProgramKeys;
import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.ChatScreen; import net.minecraft.client.gui.screen.ChatScreen;
import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.ingame.InventoryScreen; import net.minecraft.client.gui.screen.ingame.InventoryScreen;
import net.minecraft.client.option.KeyBinding; import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.util.InputUtil; import net.minecraft.client.util.InputUtil;
import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.component.DataComponentTypes; import net.minecraft.component.DataComponentTypes;
@@ -38,6 +39,7 @@ import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import net.minecraft.util.PlayerInput;
import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.MathHelper;
import org.joml.Vector2f; import org.joml.Vector2f;
import org.lwjgl.glfw.GLFW; import org.lwjgl.glfw.GLFW;
@@ -62,7 +64,7 @@ public class InteractionScreen extends Screen {
private final Map<String, Consumer<Entity>> functions; private final Map<String, Consumer<Entity>> functions;
private final Map<String, String> msgs; private final Map<String, String> msgs;
private final Identifier GUI_ICONS_TEXTURE = new Identifier("textures/gui/icons.png"); private final Identifier GUI_ICONS_TEXTURE = Identifier.of("textures/gui/icons.png");
private final StaticListener shiftListener = new StaticListener(); private final StaticListener shiftListener = new StaticListener();
@@ -93,27 +95,26 @@ public class InteractionScreen extends Screen {
closeScreen(); closeScreen();
client.setScreen(new StatsScreen(e)); client.setScreen(new StatsScreen(e));
}); });
if (entity instanceof PlayerEntity) { switch (entity) {
functions.put("Open Inventory", (Entity e) -> { case PlayerEntity playerEntity -> functions.put("Open Inventory", (Entity e) -> {
closeScreen(); closeScreen();
client.setScreen(new InventoryScreen((PlayerEntity) e)); client.setScreen(new InventoryScreen((PlayerEntity) e));
}); });
} else if (entity instanceof AbstractHorseEntity) { case AbstractHorseEntity abstractHorseEntity -> functions.put("Open Inventory", (Entity e) -> {
functions.put("Open Inventory", (Entity e) -> {
closeScreen(); closeScreen();
if (client.player.isRiding()) { if (client.player.isRiding()) {
client.player.networkHandler.sendPacket(new PlayerInputC2SPacket(0, 0, false, true)); // client.player.networkHandler.sendPacket(new PlayerInputC2SPacket(0, 0, false, true));
client.player.networkHandler.sendPacket(new PlayerInputC2SPacket(new PlayerInput(false, false, false, false, false, true, false)));
} }
client.player.networkHandler.sendPacket(PlayerInteractEntityC2SPacket.interact(entity, true, Hand.MAIN_HAND)); client.player.networkHandler.sendPacket(PlayerInteractEntityC2SPacket.interact(entity, true, Hand.MAIN_HAND));
client.player.setSneaking(false); client.player.setSneaking(false);
}); });
} else if (entity instanceof StorageMinecartEntity) { case StorageMinecartEntity storageMinecartEntity -> functions.put("Open Inventory", (Entity e) -> {
functions.put("Open Inventory", (Entity e) -> {
closeScreen(); closeScreen();
client.player.networkHandler.sendPacket(PlayerInteractEntityC2SPacket.interact(entity, true, Hand.MAIN_HAND)); client.player.networkHandler.sendPacket(PlayerInteractEntityC2SPacket.interact(entity, true, Hand.MAIN_HAND));
}); });
} else { case null, default -> functions.put("Open Inventory", (Entity e) -> {
functions.put("Open Inventory", (Entity e) -> {
closeScreen(); closeScreen();
ItemStack container = new ItemStack(Items.CHEST); ItemStack container = new ItemStack(Items.CHEST);
container.set(DataComponentTypes.CUSTOM_NAME, e.getName()); container.set(DataComponentTypes.CUSTOM_NAME, e.getName());
@@ -186,7 +187,7 @@ public class InteractionScreen extends Screen {
} catch (NullPointerException ex) { } catch (NullPointerException ex) {
} }
} }
if (Saddleable.class.isInstance(e)) { if (e instanceof Saddleable) {
if (((Saddleable) e).isSaddled()) { if (((Saddleable) e).isSaddled()) {
stack[index[0]] = Items.SADDLE.getDefaultStack(); stack[index[0]] = Items.SADDLE.getDefaultStack();
index[0]++; index[0]++;
@@ -251,12 +252,12 @@ public class InteractionScreen extends Screen {
MatrixStack matrix = context.getMatrices(); MatrixStack matrix = context.getMatrices();
// Fake crosshair stuff // Fake crosshair stuff
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
RenderSystem.setShader(GameRenderer::getPositionTexProgram); RenderSystem.setShader(ShaderProgramKeys.POSITION_TEX);
RenderSystem.enableBlend(); RenderSystem.enableBlend();
RenderSystem.blendFuncSeparate(GlStateManager.SrcFactor.ONE_MINUS_DST_COLOR, RenderSystem.blendFuncSeparate(GlStateManager.SrcFactor.ONE_MINUS_DST_COLOR,
GlStateManager.DstFactor.ONE_MINUS_SRC_COLOR, GlStateManager.SrcFactor.ONE, GlStateManager.DstFactor.ONE_MINUS_SRC_COLOR, GlStateManager.SrcFactor.ONE,
GlStateManager.DstFactor.ZERO); GlStateManager.DstFactor.ZERO);
context.drawTexture(GUI_ICONS_TEXTURE, crosshairX - 8, crosshairY - 8, 0, 0, 15, 15); context.drawTexture(RenderLayer::getGuiTextured, GUI_ICONS_TEXTURE, crosshairX - 8, crosshairY - 8, 0, 0, 15, 15, 256, 256);
drawDots(context, (int) (Math.min(height, width) / 2 * 0.75), mouseX, mouseY); drawDots(context, (int) (Math.min(height, width) / 2 * 0.75), mouseX, mouseY);
matrix.scale(2f, 2f, 1f); matrix.scale(2f, 2f, 1f);
@@ -290,7 +291,7 @@ public class InteractionScreen extends Screen {
private void drawDots(DrawContext context, int radius, int mouseX, int mouseY) { private void drawDots(DrawContext context, int radius, int mouseX, int mouseY) {
ArrayList<Point> pointList = new ArrayList<Point>(); ArrayList<Point> pointList = new ArrayList<Point>();
String cache[] = new String[functions.size()]; String[] cache = new String[functions.size()];
double lowestDistance = Double.MAX_VALUE; double lowestDistance = Double.MAX_VALUE;
int i = 0; int i = 0;

View File

@@ -102,7 +102,7 @@ public class CleanUpScreen extends WindowScreen {
} }
private boolean isSameProtocol(ServerInfo server) { private boolean isSameProtocol(ServerInfo server) {
return server.protocolVersion == SharedConstants.getGameVersion().getProtocolVersion(); return server.protocolVersion == SharedConstants.getProtocolVersion();
} }
private boolean isFailedPing(ServerInfo server) { private boolean isFailedPing(ServerInfo server) {

View File

@@ -108,7 +108,7 @@ public class LegacyServerFinderScreen extends WindowScreen {
updatePingers(pingers); updatePingers(pingers);
} }
} }
while (pingers.size() > 0) { while (!pingers.isEmpty()) {
if (state == ServerFinderState.CANCELLED) if (state == ServerFinderState.CANCELLED)
return; return;

View File

@@ -136,7 +136,7 @@ public class ServerFinderScreen extends WindowScreen implements IServerFinderDon
versionFilters.clear(); versionFilters.clear();
for (String version : versions) { for (String version : versions) {
String trimmed = version.trim(); String trimmed = version.trim();
if (trimmed.length() > 0) if (!trimmed.isEmpty())
versionFilters.add(version.trim()); versionFilters.add(version.trim());
} }
} }
@@ -177,7 +177,7 @@ public class ServerFinderScreen extends WindowScreen implements IServerFinderDon
private boolean pingNewIP() { private boolean pingNewIP() {
synchronized (serverFinderLock) { synchronized (serverFinderLock) {
if (ipsToPing.size() > 0) { if (!ipsToPing.isEmpty()) {
String ip = ipsToPing.pop(); String ip = ipsToPing.pop();
ServerPinger pinger = new ServerPinger(scanPortsBox.checked, searchNumber); ServerPinger pinger = new ServerPinger(scanPortsBox.checked, searchNumber);
pinger.addServerFinderDoneListener(this); pinger.addServerFinderDoneListener(this);

View File

@@ -221,6 +221,16 @@ public class MeteorRoundedGuiTheme extends GuiTheme {
return w(new WMeteorMinus()); return w(new WMeteorMinus());
} }
@Override
public WConfirmedMinus confirmedMinus() {
return w(new WMeteorConfirmedMinus());
}
@Override
public WConfirmedButton confirmedButton(String text, String message, GuiTexture texture) {
return w(new WMeteorConfirmedButton(text, message, texture));
}
@Override @Override
public WPlus plus() { public WPlus plus() {
return w(new WMeteorPlus()); return w(new WMeteorPlus());

View File

@@ -31,7 +31,7 @@ public class WMeteorCheckbox extends WCheckbox implements MeteorWidget {
if (animProgress > 0) { if (animProgress > 0) {
double cs = (width - theme.scale(2)) / 1.75 * animProgress; double cs = (width - theme.scale(2)) / 1.75 * animProgress;
GuiUtils.quadRounded(renderer, x + (width - cs) / 2, y + (height - cs) / 2, cs, cs, theme.checkboxColor.get(), ((MeteorRoundedGuiTheme)theme).roundAmount()); GuiUtils.quadRounded(renderer, x + (width - cs) / 2, y + (height - cs) / 2, cs, cs, theme.checkboxColor.get(), theme.roundAmount());
} }
} }
} }

View File

@@ -0,0 +1,29 @@
/*
* This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client/).
* Copyright (c) 2021 Meteor Development.
*/
package anticope.rejects.gui.themes.rounded.widgets.pressable;
import meteordevelopment.meteorclient.gui.renderer.GuiRenderer;
import meteordevelopment.meteorclient.gui.renderer.packer.GuiTexture;
import anticope.rejects.gui.themes.rounded.MeteorWidget;
import meteordevelopment.meteorclient.gui.widgets.pressable.WConfirmedButton;
public class WMeteorConfirmedButton extends WConfirmedButton implements MeteorWidget {
public WMeteorConfirmedButton(String text, String message, GuiTexture texture) {
super(text, message, texture);
}
@Override
protected void onRender(GuiRenderer renderer, double mouseX, double mouseY, double delta) {
renderBackground(renderer, this, pressed, mouseOver);
if (texture != null) {
double ts = theme().textHeight();
renderer.quad(x + width / 2 - ts / 2, y + pad(), ts, ts, texture, theme().textColor.get());
} else {
renderer.text(text, x + width / 2 - theme().textRenderer().getWidth(text) / 2, y + pad(), theme().textColor.get(), false);
}
}
}

View File

@@ -0,0 +1,21 @@
/*
* This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client/).
* Copyright (c) 2021 Meteor Development.
*/
package anticope.rejects.gui.themes.rounded.widgets.pressable;
import meteordevelopment.meteorclient.gui.renderer.GuiRenderer;
import anticope.rejects.gui.themes.rounded.MeteorWidget;
import meteordevelopment.meteorclient.gui.widgets.pressable.WConfirmedMinus;
public class WMeteorConfirmedMinus extends WConfirmedMinus implements MeteorWidget {
@Override
protected void onRender(GuiRenderer renderer, double mouseX, double mouseY, double delta) {
double pad = pad();
double s = theme.scale(3);
renderBackground(renderer, this, pressed, mouseOver);
renderer.quad(x + pad, y + height / 2 - s / 2, width - pad * 2, s, theme().minusColor.get());
}
}

View File

@@ -4,6 +4,7 @@ import anticope.rejects.modules.SilentDisconnect;
import meteordevelopment.meteorclient.systems.modules.Modules; import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.utils.player.ChatUtils; import meteordevelopment.meteorclient.utils.player.ChatUtils;
import net.minecraft.client.network.ClientCommonNetworkHandler; import net.minecraft.client.network.ClientCommonNetworkHandler;
import net.minecraft.network.DisconnectionInfo;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
@@ -15,11 +16,11 @@ import static meteordevelopment.meteorclient.MeteorClient.mc;
@Mixin(ClientCommonNetworkHandler.class) @Mixin(ClientCommonNetworkHandler.class)
public class ClientCommonNetwokHandlerMixin { public class ClientCommonNetwokHandlerMixin {
@Inject(method = "onDisconnected", at = @At("HEAD"), cancellable = true) @Inject(method = "onDisconnected", at = @At("HEAD"), cancellable = true)
private void onDisconnected(Text reason, CallbackInfo info) { private void onDisconnected(DisconnectionInfo info, CallbackInfo ci) {
if (Modules.get().isActive(SilentDisconnect.class) && mc.world != null && mc.player != null) { if (Modules.get().isActive(SilentDisconnect.class) && mc.world != null && mc.player != null) {
ChatUtils.info(Text.translatable("disconnect.lost").getString() + ":"); ChatUtils.info(Text.translatable("disconnect.lost").getString() + ":");
ChatUtils.sendMsg(reason); ChatUtils.sendMsg(info.reason());
info.cancel(); ci.cancel();
} }
} }
} }

View File

@@ -0,0 +1,13 @@
package anticope.rejects.mixin;
import net.minecraft.client.network.ClientPlayerEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(ClientPlayerEntity.class)
public interface ClientPlayerEntityAccessor {
@Mutable
@Accessor("ticksSinceLastPositionPacketSent")
void setTicksSinceLastPositionPacketSent(int ticks);
}

View File

@@ -13,6 +13,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
public class ClientPlayerInteractionManagerMixin { public class ClientPlayerInteractionManagerMixin {
@Inject(method = "stopUsingItem", at = @At("HEAD")) @Inject(method = "stopUsingItem", at = @At("HEAD"))
public void onStopUsingItem(PlayerEntity player, CallbackInfo ci) { public void onStopUsingItem(PlayerEntity player, CallbackInfo ci) {
MeteorClient.EVENT_BUS.post(StopUsingItemEvent.get(player.getInventory().getMainHandStack())); MeteorClient.EVENT_BUS.post(StopUsingItemEvent.get(player.getMainHandStack()));
} }
} }

View File

@@ -5,7 +5,6 @@ import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.systems.modules.render.NoRender; import meteordevelopment.meteorclient.systems.modules.render.NoRender;
import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.ChatInputSuggestor; import net.minecraft.client.gui.screen.ChatInputSuggestor;
import net.minecraft.client.util.math.MatrixStack;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;

View File

@@ -1,19 +0,0 @@
package anticope.rejects.mixin;
import anticope.rejects.modules.Rendering;
import meteordevelopment.meteorclient.systems.modules.Modules;
import net.minecraft.client.render.entity.feature.Deadmau5FeatureRenderer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(Deadmau5FeatureRenderer.class)
public class Deadmau5FeatureRendererMixin {
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Ljava/lang/String;equals(Ljava/lang/Object;)Z"))
private boolean redirectAllow(String s, Object name){
Rendering renderingModule = Modules.get().get(Rendering.class);
if (renderingModule != null && renderingModule.deadmau5EarsEnabled()) return true;
return name.equals(s);
}
}

View File

@@ -0,0 +1,27 @@
package anticope.rejects.mixin;
import anticope.rejects.modules.Rendering;
import meteordevelopment.meteorclient.systems.modules.Modules;
import net.minecraft.client.network.AbstractClientPlayerEntity;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.entity.feature.Deadmau5FeatureRenderer;
import net.minecraft.client.util.math.MatrixStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(Deadmau5FeatureRenderer.class)
public class Deadmau5FeatureRendererMixin {
@Inject(method = "render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;ILnet/minecraft/client/network/AbstractClientPlayerEntity;FFFFFF)V", at = @At("HEAD"), cancellable = true)
private void onRender(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, AbstractClientPlayerEntity player, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch, CallbackInfo ci) {
Rendering renderingModule = Modules.get().get(Rendering.class);
if (renderingModule != null && !renderingModule.deadmau5EarsEnabled()) {
// If the feature is disabled and player is not deadmau5, cancel rendering
if (!player.getName().getString().equals("deadmau5")) {
ci.cancel();
}
}
// If the feature is enabled, allow rendering for everyone (don't cancel)
}
}

View File

@@ -4,6 +4,8 @@ import anticope.rejects.modules.Rendering;
import meteordevelopment.meteorclient.systems.modules.Modules; import meteordevelopment.meteorclient.systems.modules.Modules;
import net.minecraft.client.gl.PostEffectProcessor; import net.minecraft.client.gl.PostEffectProcessor;
import net.minecraft.client.render.RenderTickCounter;
import net.minecraft.client.util.Pool;
import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Shadow;
@@ -17,16 +19,18 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(GameRenderer.class) @Mixin(GameRenderer.class)
public class GameRendererMixin { public class GameRendererMixin {
@Shadow @Final MinecraftClient client; @Shadow @Final MinecraftClient client;
@Shadow @Final
Pool pool;
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/WorldRenderer;drawEntityOutlinesFramebuffer()V", ordinal = 0)) @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/WorldRenderer;drawEntityOutlinesFramebuffer()V", ordinal = 0))
private void renderShader(float tickDelta, long startTime, boolean tick, CallbackInfo ci) { private void renderShader(RenderTickCounter tickCounter, boolean tick, CallbackInfo ci) {
Rendering renderingModule = Modules.get().get(Rendering.class); Rendering renderingModule = Modules.get().get(Rendering.class);
if (renderingModule == null) return; if (renderingModule == null) return;
PostEffectProcessor shader = renderingModule.getShaderEffect(); PostEffectProcessor shader = renderingModule.getShaderEffect();
if (shader != null) { if (shader != null) {
shader.setupDimensions(client.getWindow().getFramebufferWidth(), client.getWindow().getFramebufferHeight()); // shader.setupDimensions(client.getWindow().getFramebufferWidth(), client.getWindow().getFramebufferHeight());
shader.render(tickDelta); shader.render(this.client.getFramebuffer(), this.pool);
} }
} }
} }

View File

@@ -5,9 +5,11 @@ import meteordevelopment.meteorclient.systems.modules.Modules;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.minecraft.client.render.entity.LivingEntityRenderer; import net.minecraft.client.render.entity.LivingEntityRenderer;
import net.minecraft.client.render.entity.model.EntityModel;
import net.minecraft.client.render.entity.state.LivingEntityRenderState;
import net.minecraft.client.render.entity.state.PlayerEntityRenderState;
import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.RotationAxis; import net.minecraft.util.math.RotationAxis;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
@@ -16,14 +18,14 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
@Mixin(LivingEntityRenderer.class) @Mixin(LivingEntityRenderer.class)
public class LivingEntityRendererMixin<T extends LivingEntity> { public class LivingEntityRendererMixin<T extends LivingEntity, S extends LivingEntityRenderState, M extends EntityModel<? super S>> {
@Inject(method = "setupTransforms", at = @At(value = "TAIL")) @Inject(method = "setupTransforms", at = @At(value = "TAIL"))
private void dinnerboneEntities(T entity, MatrixStack matrices, float animationProgress, float bodyYaw, float tickDelta, float scale, CallbackInfo ci) { private void dinnerboneEntities(S state, MatrixStack matrices, float animationProgress, float bodyYaw, CallbackInfo ci) {
Rendering renderingModule = Modules.get().get(Rendering.class); Rendering renderingModule = Modules.get().get(Rendering.class);
if (renderingModule == null) return; if (renderingModule == null) return;
if ((!(entity instanceof PlayerEntity)) && renderingModule.dinnerboneEnabled()) { if ((!(state instanceof PlayerEntityRenderState)) && renderingModule.dinnerboneEnabled()) {
matrices.translate(0.0D, entity.getHeight() + 0.1F, 0.0D); matrices.translate(0.0D, state.height + 0.1F, 0.0D);
matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(180.0F)); matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(180.0F));
} }
} }

View File

@@ -0,0 +1,14 @@
package anticope.rejects.mixin;
import net.minecraft.entity.player.PlayerInventory;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(PlayerInventory.class)
public interface PlayerInventoryAccessor {
@Accessor("selectedSlot")
int getSelectedSlot();
@Accessor("selectedSlot")
void setSelectedSlot(int slot);
}

View File

@@ -14,4 +14,11 @@ public interface PlayerMoveC2SPacketAccessor {
@Mutable @Mutable
@Accessor("z") @Accessor("z")
void setZ(double z); void setZ(double z);
@Mutable
@Accessor("y")
void setY(double y);
@Accessor("y")
double getY();
} }

View File

@@ -9,11 +9,17 @@ import org.spongepowered.asm.mixin.injection.ModifyVariable;
@Mixin(TexturedRenderLayers.class) @Mixin(TexturedRenderLayers.class)
public class TexturedRenderLayersMixin { public class TexturedRenderLayersMixin {
@ModifyVariable(method = "getChestTextureId(Lnet/minecraft/block/entity/BlockEntity;Lnet/minecraft/block/enums/ChestType;Z)Lnet/minecraft/client/util/SpriteIdentifier;", at = @At("LOAD"), ordinal = 0) @ModifyVariable(
private static boolean chrsitmas(boolean christmas) { method = "getChestTextureId",
at = @At("HEAD"),
ordinal = 0,
argsOnly = true
)
private static boolean christmas(boolean christmas) {
Rendering rendering = Modules.get().get(Rendering.class); Rendering rendering = Modules.get().get(Rendering.class);
if (rendering != null && rendering.chistmas()) if (rendering != null && rendering.chistmas()) {
return true; return true;
}
return christmas; return christmas;
} }
} }

View File

@@ -1,17 +1,18 @@
package anticope.rejects.mixin; package anticope.rejects.mixin;
import net.minecraft.network.packet.c2s.play.VehicleMoveC2SPacket; import net.minecraft.network.packet.c2s.play.VehicleMoveC2SPacket;
import net.minecraft.util.math.Vec3d;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.gen.Accessor; import org.spongepowered.asm.mixin.gen.Accessor;
import org.spongepowered.asm.mixin.gen.Invoker;
@Mixin(VehicleMoveC2SPacket.class) @Mixin(VehicleMoveC2SPacket.class)
public interface VehicleMoveC2SPacketAccessor { public interface VehicleMoveC2SPacketAccessor {
@Mutable @Accessor("position")
@Accessor("x") Vec3d getPosition();
void setX(double x);
@Mutable @Invoker("<init>")
@Accessor("z") static VehicleMoveC2SPacket create(Vec3d position, float yaw, float pitch, boolean onGround) {
void setZ(double z); throw new AssertionError();
}
} }

View File

@@ -18,8 +18,8 @@ public class ModuleMixin {
@Mutable @Shadow public String title; @Mutable @Shadow public String title;
@Inject(method = "<init>", at = @At("TAIL")) @Inject(method = "<init>*", at = @At("TAIL"))
private void onInit(Category category, String name, String description, CallbackInfo info) { private void onInit(Category category, String name, String description, String[] aliases, CallbackInfo info) {
if (RejectsConfig.get().duplicateModuleNames) { if (RejectsConfig.get().duplicateModuleNames) {
this.name = RejectsUtils.getModuleName(name); this.name = RejectsUtils.getModuleName(name);
this.title = Utils.nameToTitle(this.name); this.title = Utils.nameToTitle(this.name);

View File

@@ -1,6 +1,6 @@
package anticope.rejects.mixin.meteor.modules; package anticope.rejects.mixin.meteor.modules;
import anticope.rejects.modules.ShieldBypass; // import anticope.rejects.modules.ShieldBypass;
import anticope.rejects.utils.RejectsUtils; import anticope.rejects.utils.RejectsUtils;
import meteordevelopment.meteorclient.events.Cancellable; import meteordevelopment.meteorclient.events.Cancellable;
import meteordevelopment.meteorclient.events.world.TickEvent; import meteordevelopment.meteorclient.events.world.TickEvent;
@@ -123,18 +123,19 @@ public class KillAuraMixin extends Module {
hitTimer -= random.nextInt(randomDelayMax.get()); hitTimer -= random.nextInt(randomDelayMax.get());
} }
@Inject(method = "attack", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerInteractionManager;attackEntity(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/entity/Entity;)V"), cancellable = true) // ShieldBypass desabilitado temporariamente
private void onHit(Entity target, CallbackInfo info) { // @Inject(method = "attack", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerInteractionManager;attackEntity(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/entity/Entity;)V"), cancellable = true)
ShieldBypass shieldBypass = Modules.get().get(ShieldBypass.class); // private void onHit(Entity target, CallbackInfo info) {
if (shieldBypass.isActive()) { // ShieldBypass shieldBypass = Modules.get().get(ShieldBypass.class);
Cancellable dummyEvent = new Cancellable(); // if (shieldBypass.isActive()) {
shieldBypass.bypass(target, dummyEvent); // Cancellable dummyEvent = new Cancellable();
if (dummyEvent.isCancelled()) { // shieldBypass.bypass(target, dummyEvent);
hitTimer = 0; // if (dummyEvent.isCancelled()) {
info.cancel(); // hitTimer = 0;
} // info.cancel();
} // }
} // }
// }
private double randomOffset() { private double randomOffset() {
return Math.random() * 4 - 2; return Math.random() * 4 - 2;

View File

@@ -66,7 +66,7 @@ public class AntiBot extends Module {
@EventHandler @EventHandler
public void onTick(TickEvent.Post tickEvent) { public void onTick(TickEvent.Post tickEvent) {
for (Entity entity : mc.world.getEntities()) { for (Entity entity : mc.world.getEntities()) {
if (entity == null || !(entity instanceof PlayerEntity playerEntity)) continue; if (!(entity instanceof PlayerEntity playerEntity)) continue;
if (removeInvisible.get() && !entity.isInvisible()) continue; if (removeInvisible.get() && !entity.isInvisible()) continue;
if (isBot(playerEntity)) entity.remove(Entity.RemovalReason.DISCARDED); if (isBot(playerEntity)) entity.remove(Entity.RemovalReason.DISCARDED);

View File

@@ -11,6 +11,7 @@ import net.minecraft.network.packet.s2c.play.EntityVelocityUpdateS2CPacket;
import net.minecraft.network.packet.s2c.play.ExplosionS2CPacket; import net.minecraft.network.packet.s2c.play.ExplosionS2CPacket;
import net.minecraft.network.packet.s2c.play.ParticleS2CPacket; import net.minecraft.network.packet.s2c.play.ParticleS2CPacket;
import net.minecraft.network.packet.s2c.play.PlayerPositionLookS2CPacket; import net.minecraft.network.packet.s2c.play.PlayerPositionLookS2CPacket;
import net.minecraft.util.math.Vec3d;
public class AntiCrash extends Module { public class AntiCrash extends Module {
private final SettingGroup sgGeneral = settings.getDefaultGroup(); private final SettingGroup sgGeneral = settings.getDefaultGroup();
@@ -29,27 +30,31 @@ public class AntiCrash extends Module {
@EventHandler @EventHandler
private void onPacketReceive(PacketEvent.Receive event) { private void onPacketReceive(PacketEvent.Receive event) {
if (event.packet instanceof ExplosionS2CPacket packet) { if (event.packet instanceof ExplosionS2CPacket packet) {
if (/* outside of world */ packet.getX() > 30_000_000 || packet.getY() > 30_000_000 || packet.getZ() > 30_000_000 || packet.getX() < -30_000_000 || packet.getY() < -30_000_000 || packet.getZ() < -30_000_000 || Vec3d explodePos = packet.center();
// power too high // TODO: 1.21.3
packet.getRadius() > 1000 || Vec3d playerKnockback = new Vec3d(0, 0, 0);
// too many blocks if(packet.playerKnockback().isPresent()) {
packet.getAffectedBlocks().size() > 100_000 || playerKnockback = packet.playerKnockback().get();
}
if (/* outside of world */ explodePos.getX() > 30_000_000 || explodePos.getY() > 30_000_000 || explodePos.getZ() > 30_000_000 || explodePos.getX() < -30_000_000 || explodePos.getY() < -30_000_000 || explodePos.getZ() < -30_000_000 ||
// too much knockback // too much knockback
packet.getPlayerVelocityX() > 30_000_000 || packet.getPlayerVelocityY() > 30_000_000 || packet.getPlayerVelocityZ() > 30_000_000 playerKnockback.x > 30_000_000 || playerKnockback.y > 30_000_000 || playerKnockback.z > 30_000_000
// knockback can be negative? // knockback can be negative?
|| packet.getPlayerVelocityX() < -30_000_000 || packet.getPlayerVelocityY() < -30_000_000 || packet.getPlayerVelocityZ() < -30_000_000 || playerKnockback.x < -30_000_000 || playerKnockback.y < -30_000_000 || playerKnockback.z < -30_000_000
) cancel(event); ) cancel(event);
} else if (event.packet instanceof ParticleS2CPacket packet) { } else if (event.packet instanceof ParticleS2CPacket packet) {
// too many particles // too many particles
if (packet.getCount() > 100_000) cancel(event); if (packet.getCount() > 100_000) cancel(event);
} else if (event.packet instanceof PlayerPositionLookS2CPacket packet) { } else if (event.packet instanceof PlayerPositionLookS2CPacket packet) {
Vec3d playerPos = packet.change().position();
// out of world movement // out of world movement
if (packet.getX() > 30_000_000 || packet.getY() > 30_000_000 || packet.getZ() > 30_000_000 || packet.getX() < -30_000_000 || packet.getY() < -30_000_000 || packet.getZ() < -30_000_000) if (playerPos.x > 30_000_000 || playerPos.y > 30_000_000 || playerPos.z > 30_000_000 || playerPos.x < -30_000_000 || playerPos.y < -30_000_000 || playerPos.z < -30_000_000)
cancel(event); cancel(event);
} else if (event.packet instanceof EntityVelocityUpdateS2CPacket packet) { } else if (event.packet instanceof EntityVelocityUpdateS2CPacket packet) {
// velocity // velocity
if (packet.getVelocityX() > 30_000_000 || packet.getVelocityY() > 30_000_000 || packet.getVelocityZ() > 30_000_000 Vec3d velocity = packet.getVelocity();
|| packet.getVelocityX() < -30_000_000 || packet.getVelocityY() < -30_000_000 || packet.getVelocityZ() < -30_000_000 if (velocity.x > 30_000_000 || velocity.y > 30_000_000 || velocity.z > 30_000_000
|| velocity.x < -30_000_000 || velocity.y < -30_000_000 || velocity.z < -30_000_000
) cancel(event); ) cancel(event);
} }
} }

View File

@@ -123,7 +123,7 @@ public class AntiVanish extends Module {
switch (mode.get()) { switch (mode.get()) {
case LeaveMessage -> { case LeaveMessage -> {
Map<UUID, String> oldPlayers = Map.copyOf(playerCache); Map<UUID, String> oldPlayers = Map.copyOf(playerCache);
playerCache = mc.getNetworkHandler().getPlayerList().stream().collect(Collectors.toMap(e -> e.getProfile().getId(), e -> e.getProfile().getName())); playerCache = mc.getNetworkHandler().getPlayerList().stream().collect(Collectors.toMap(e -> e.getProfile().id(), e -> e.getProfile().name()));
for (UUID uuid : oldPlayers.keySet()) { for (UUID uuid : oldPlayers.keySet()) {
if (playerCache.containsKey(uuid)) continue; if (playerCache.containsKey(uuid)) continue;

View File

@@ -54,9 +54,9 @@ public class ArrowDmg extends Module {
for (int i = 0; i < packets.get() / 2; i++) { for (int i = 0; i < packets.get() / 2; i++) {
p.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(x, p.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(x,
y - 1e-10, z, true)); y - 1e-10, z, true, mc.player.horizontalCollision));
p.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(x, p.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(x,
y + 1e-10, z, false)); y + 1e-10, z, false, mc.player.horizontalCollision));
} }
} }

View File

@@ -124,7 +124,7 @@ public class AutoBedTrap extends Module {
if (cap >= bpt.get()) { if (cap >= bpt.get()) {
return true; return true;
} }
}; }
} }
cap = 0; cap = 0;
return true; return true;

View File

@@ -7,11 +7,14 @@ import meteordevelopment.meteorclient.settings.ItemListSetting;
import meteordevelopment.meteorclient.settings.Setting; import meteordevelopment.meteorclient.settings.Setting;
import meteordevelopment.meteorclient.settings.SettingGroup; import meteordevelopment.meteorclient.settings.SettingGroup;
import meteordevelopment.meteorclient.systems.modules.Module; import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.meteorclient.utils.Utils;
import meteordevelopment.orbit.EventHandler; import meteordevelopment.orbit.EventHandler;
import net.minecraft.client.gui.screen.recipebook.RecipeResultCollection; import net.minecraft.client.gui.screen.recipebook.RecipeResultCollection;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.recipe.Recipe; import net.minecraft.item.ItemStack;
import net.minecraft.recipe.RecipeEntry; import net.minecraft.recipe.RecipeDisplayEntry;
import net.minecraft.recipe.display.RecipeDisplay;
import net.minecraft.recipe.display.SlotDisplayContexts;
import net.minecraft.screen.CraftingScreenHandler; import net.minecraft.screen.CraftingScreenHandler;
import net.minecraft.screen.slot.SlotActionType; import net.minecraft.screen.slot.SlotActionType;
@@ -25,7 +28,7 @@ public class AutoCraft extends Module {
private final Setting<List<Item>> items = sgGeneral.add(new ItemListSetting.Builder() private final Setting<List<Item>> items = sgGeneral.add(new ItemListSetting.Builder()
.name("items") .name("items")
.description("Items you want to get crafted.") .description("Items you want to get crafted.")
.defaultValue(Arrays.asList()) .defaultValue(List.of())
.build() .build()
); );
@@ -56,12 +59,12 @@ public class AutoCraft extends Module {
@EventHandler @EventHandler
private void onTick(TickEvent.Post event) { private void onTick(TickEvent.Post event) {
if (mc.interactionManager == null) return; if (!Utils.canUpdate() || mc.interactionManager == null) return;
if (items.get().isEmpty()) return; if (items.get().isEmpty()) return;
if (!(mc.player.currentScreenHandler instanceof CraftingScreenHandler)) return; if (!(mc.player.currentScreenHandler instanceof CraftingScreenHandler)) return;
if (antiDesync.get()) if (antiDesync.get())
mc.player.getInventory().updateItems(); mc.player.getInventory().updateItems();
@@ -71,12 +74,20 @@ public class AutoCraft extends Module {
List<Item> itemList = items.get(); List<Item> itemList = items.get();
List<RecipeResultCollection> recipeResultCollectionList = mc.player.getRecipeBook().getOrderedResults(); List<RecipeResultCollection> recipeResultCollectionList = mc.player.getRecipeBook().getOrderedResults();
for (RecipeResultCollection recipeResultCollection : recipeResultCollectionList) { for (RecipeResultCollection recipeResultCollection : recipeResultCollectionList) {
for (RecipeEntry<?> recipe : recipeResultCollection.getRecipes(true)) { // Get craftable recipes only
if (!itemList.contains(recipe.value().getResult(mc.world.getRegistryManager()).getItem())) continue; List<RecipeDisplayEntry> craftRecipes = recipeResultCollection.filter(RecipeResultCollection.RecipeFilterMode.CRAFTABLE);
mc.interactionManager.clickRecipe(currentScreenHandler.syncId, recipe, craftAll.get()); for (RecipeDisplayEntry recipe : craftRecipes) {
RecipeDisplay recipeDisplay = recipe.display();
List<ItemStack> resultStacks = recipeDisplay.result().getStacks(SlotDisplayContexts.createParameters(mc.world));
for (ItemStack resultStack : resultStacks) {
// Check if the result item is in the item list
if (!itemList.contains(resultStack.getItem())) continue;
mc.interactionManager.clickRecipe(currentScreenHandler.syncId, recipe.id(), craftAll.get());
mc.interactionManager.clickSlot(currentScreenHandler.syncId, 0, 1, mc.interactionManager.clickSlot(currentScreenHandler.syncId, 0, 1,
drop.get() ? SlotActionType.THROW : SlotActionType.QUICK_MOVE, mc.player); drop.get() ? SlotActionType.THROW : SlotActionType.QUICK_MOVE, mc.player);
} }
} }
} }
} }
}

View File

@@ -83,7 +83,7 @@ public class AutoExtinguish extends Module {
private BlockPos blockPos = null; private BlockPos blockPos = null;
private boolean doesWaterBucketWork = true; private boolean doesWaterBucketWork = true;
private static final StatusEffect FIRE_RESISTANCE = Registries.STATUS_EFFECT.get(new Identifier("fire_resistance")); private static final StatusEffect FIRE_RESISTANCE = Registries.STATUS_EFFECT.get(Identifier.of("fire_resistance"));
public AutoExtinguish() { public AutoExtinguish() {
super(MeteorRejectsAddon.CATEGORY, "auto-extinguish", "Automatically extinguishes fire around you"); super(MeteorRejectsAddon.CATEGORY, "auto-extinguish", "Automatically extinguishes fire around you");
@@ -150,17 +150,17 @@ public class AutoExtinguish extends Module {
private void place(int slot) { private void place(int slot) {
if (slot != -1) { if (slot != -1) {
final int preSlot = mc.player.getInventory().selectedSlot; final int preSlot = ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).getSelectedSlot();
if (center.get()) { if (center.get()) {
PlayerUtils.centerPlayer(); PlayerUtils.centerPlayer();
} }
mc.player.getInventory().selectedSlot = slot; ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).setSelectedSlot(slot);
float yaw = mc.gameRenderer.getCamera().getYaw() % 360; float yaw = mc.gameRenderer.getCamera().getYaw() % 360;
float pitch = mc.gameRenderer.getCamera().getPitch() % 360; float pitch = mc.gameRenderer.getCamera().getPitch() % 360;
Rotations.rotate(yaw, 90); Rotations.rotate(yaw, 90);
mc.interactionManager.interactItem(mc.player, Hand.MAIN_HAND); mc.interactionManager.interactItem(mc.player, Hand.MAIN_HAND);
mc.player.getInventory().selectedSlot = preSlot; ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).setSelectedSlot(preSlot);
Rotations.rotate(yaw, pitch); Rotations.rotate(yaw, pitch);
} }

View File

@@ -13,10 +13,13 @@ import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.registry.tag.EnchantmentTags;
import net.minecraft.screen.GrindstoneScreenHandler; import net.minecraft.screen.GrindstoneScreenHandler;
import java.util.List; import java.util.List;
import java.util.Set;
public class AutoGrind extends Module { public class AutoGrind extends Module {
private final SettingGroup sgGeneral = settings.getDefaultGroup(); private final SettingGroup sgGeneral = settings.getDefaultGroup();
@@ -38,7 +41,7 @@ public class AutoGrind extends Module {
.build() .build()
); );
private final Setting<List<Enchantment>> enchantmentBlacklist = sgGeneral.add(new EnchantmentListSetting.Builder() private final Setting<Set<RegistryKey<Enchantment>>> enchantmentBlacklist = sgGeneral.add(new EnchantmentListSetting.Builder()
.name("enchantment-blacklist") .name("enchantment-blacklist")
.description("Enchantments that should be ignored.") .description("Enchantments that should be ignored.")
.defaultValue() .defaultValue()
@@ -80,7 +83,7 @@ public class AutoGrind extends Module {
for (RegistryEntry<Enchantment> enchantment : enchantments.getEnchantments()) { for (RegistryEntry<Enchantment> enchantment : enchantments.getEnchantments()) {
availEnchs++; availEnchs++;
if (enchantment.value().isCursed()) if (EnchantmentHelper.hasAnyEnchantmentsIn(stack, EnchantmentTags.CURSE))
availEnchs--; availEnchs--;
if (enchantmentBlacklist.get().contains(enchantment.value())) if (enchantmentBlacklist.get().contains(enchantment.value()))
return false; return false;

View File

@@ -67,7 +67,7 @@ public class AutoLogin extends Module {
btn.action = () -> { btn.action = () -> {
String password = RejectsUtils.getRandomPassword(16); String password = RejectsUtils.getRandomPassword(16);
MutableText text = Text.literal(Formatting.BOLD + "Click here to register securely."); MutableText text = Text.literal(Formatting.BOLD + "Click here to register securely.");
text.setStyle(text.getStyle().withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, String.format("/register %s %s", password, password)))); text.setStyle(text.getStyle().withClickEvent(new ClickEvent.RunCommand(String.format("/register %s %s", password, password))));
info(text); info(text);
}; };
return l; return l;

View File

@@ -30,6 +30,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
public class AutoPot extends Module { public class AutoPot extends Module {
@SuppressWarnings("unchecked")
private static final Class<? extends Module>[] AURAS = new Class[]{KillAura.class, CrystalAura.class, AnchorAura.class, BedAura.class}; private static final Class<? extends Module>[] AURAS = new Class[]{KillAura.class, CrystalAura.class, AnchorAura.class, BedAura.class};
private final SettingGroup sgGeneral = settings.getDefaultGroup(); private final SettingGroup sgGeneral = settings.getDefaultGroup();
@@ -166,7 +167,7 @@ public class AutoPot extends Module {
} }
private void changeSlot(int slot) { private void changeSlot(int slot) {
mc.player.getInventory().selectedSlot = slot; ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).setSelectedSlot(slot);
this.slot = slot; this.slot = slot;
} }
@@ -190,7 +191,7 @@ public class AutoPot extends Module {
} }
private void startPotionUse() { private void startPotionUse() {
prevSlot = mc.player.getInventory().selectedSlot; prevSlot = ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).getSelectedSlot();
if (useSplashPots.get()) { if (useSplashPots.get()) {
if (lookDown.get()) { if (lookDown.get()) {

View File

@@ -130,23 +130,24 @@ public class AutoRename extends Module {
if (compound == null) { if (compound == null) {
return ""; return "";
} }
compound = compound.getCompound("BlockEntityTag"); compound = compound.getCompound("BlockEntityTag").orElse(null);
if (compound == null) { if (compound == null) {
return ""; return "";
} }
var list = compound.getList("Items", NbtElement.COMPOUND_TYPE); var list = compound.getList("Items").orElse(null);
if (list == null) { if (list == null) {
return ""; return "";
} }
var minslot = Byte.MAX_VALUE; var minslot = Byte.MAX_VALUE;
var name = ""; var name = "";
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
var invItem = list.getCompound(i); var invItem = list.getCompound(i).orElse(null);
var invSlot = invItem.getByte("Slot"); if (invItem == null) continue;
byte invSlot = invItem.getByte("Slot").orElse(Byte.MAX_VALUE);
if (minslot < invSlot) { if (minslot < invSlot) {
continue; continue;
} }
var itemId = invItem.getString("id"); String itemId = invItem.getString("id").orElse(null);
if (itemId == null) { if (itemId == null) {
continue; continue;
} }

View File

@@ -14,15 +14,17 @@ import net.minecraft.block.CraftingTableBlock;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.passive.TameableEntity; import net.minecraft.entity.passive.TameableEntity;
import net.minecraft.entity.passive.VillagerEntity; import net.minecraft.entity.passive.VillagerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.Items; import net.minecraft.item.Items;
import net.minecraft.item.StewItem;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.EntityHitResult; import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult; import net.minecraft.util.hit.HitResult;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import java.util.List;
public class AutoSoup extends Module { public class AutoSoup extends Module {
private static final String desc = "Automatically eats soup when your health is low on some servers."; private static final String desc = "Automatically eats soup when your health is low on some servers.";
@@ -85,10 +87,10 @@ public class AutoSoup extends Module {
// save old slot // save old slot
if (oldSlot == -1) if (oldSlot == -1)
oldSlot = mc.player.getInventory().selectedSlot; oldSlot = ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).getSelectedSlot();
// set slot // set slot
mc.player.getInventory().selectedSlot = soupInHotbar; ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).setSelectedSlot(soupInHotbar);
// eat soup // eat soup
mc.options.useKey.setPressed(true); mc.options.useKey.setPressed(true);
@@ -108,10 +110,12 @@ public class AutoSoup extends Module {
} }
private int findSoup(int startSlot, int endSlot) { private int findSoup(int startSlot, int endSlot) {
List<Item> stews = List.of(Items.RABBIT_STEW, Items.MUSHROOM_STEW, Items.BEETROOT_SOUP);
for (int i = startSlot; i < endSlot; i++) { for (int i = startSlot; i < endSlot; i++) {
ItemStack stack = mc.player.getInventory().getStack(i); ItemStack stack = mc.player.getInventory().getStack(i);
if (stack != null && stack.getItem() instanceof StewItem) if (stack != null && stews.contains(stack.getItem()))
return i; return i;
} }
@@ -128,16 +132,16 @@ public class AutoSoup extends Module {
} }
private boolean isClickable(HitResult hitResult) { private boolean isClickable(HitResult hitResult) {
if (hitResult == null) switch (hitResult) {
case null -> {
return false; return false;
}
if (hitResult instanceof EntityHitResult) { case EntityHitResult entityHitResult -> {
Entity entity = ((EntityHitResult) mc.crosshairTarget).getEntity(); Entity entity = ((EntityHitResult) mc.crosshairTarget).getEntity();
return entity instanceof VillagerEntity return entity instanceof VillagerEntity
|| entity instanceof TameableEntity; || entity instanceof TameableEntity;
} }
case BlockHitResult blockHitResult -> {
if (hitResult instanceof BlockHitResult) {
BlockPos pos = ((BlockHitResult) mc.crosshairTarget).getBlockPos(); BlockPos pos = ((BlockHitResult) mc.crosshairTarget).getBlockPos();
if (pos == null) if (pos == null)
return false; return false;
@@ -146,6 +150,9 @@ public class AutoSoup extends Module {
return block instanceof BlockWithEntity return block instanceof BlockWithEntity
|| block instanceof CraftingTableBlock; || block instanceof CraftingTableBlock;
} }
default -> {
}
}
return false; return false;
} }
@@ -159,7 +166,7 @@ public class AutoSoup extends Module {
mc.options.useKey.setPressed(false); mc.options.useKey.setPressed(false);
// reset slot // reset slot
mc.player.getInventory().selectedSlot = oldSlot; ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).setSelectedSlot(oldSlot);
oldSlot = -1; oldSlot = -1;
} }

View File

@@ -113,7 +113,7 @@ public class AutoTNT extends Module {
@EventHandler @EventHandler
private void onPostTick(TickEvent.Post event) { private void onPostTick(TickEvent.Post event) {
// Ignition // Ignition
if (ignite.get() && blocksToIgnite.size() > 0) { if (ignite.get() && !blocksToIgnite.isEmpty()) {
if (igniteTick > igniteDelay.get()) { if (igniteTick > igniteDelay.get()) {
// Sort based on closest tnt // Sort based on closest tnt
blocksToIgnite.sort(Comparator.comparingDouble(PlayerUtils::distanceTo)); blocksToIgnite.sort(Comparator.comparingDouble(PlayerUtils::distanceTo));

View File

@@ -139,7 +139,7 @@ public class AutoWither extends Module {
// Register // Register
BlockIterator.register(horizontalRadius.get(), verticalRadius.get(), (blockPos, blockState) -> { BlockIterator.register(horizontalRadius.get(), verticalRadius.get(), (blockPos, blockState) -> {
Direction dir = Direction.fromRotation(Rotations.getYaw(blockPos)).getOpposite(); Direction dir = Direction.fromHorizontalDegrees(Rotations.getYaw(blockPos)).getOpposite();
if (isValidSpawn(blockPos, dir)) withers.add(witherPool.get().set(blockPos, dir)); if (isValidSpawn(blockPos, dir)) withers.add(witherPool.get().set(blockPos, dir));
}); });
} }
@@ -267,15 +267,15 @@ public class AutoWither extends Module {
BlockPos leftHead = wither.foot.up().up().offset(wither.axis, -1); BlockPos leftHead = wither.foot.up().up().offset(wither.axis, -1);
BlockPos rightHead = wither.foot.up().up().offset(wither.axis, 1); BlockPos rightHead = wither.foot.up().up().offset(wither.axis, 1);
event.renderer.box((double) midHead.getX() + 0.2, (double) midHead.getX(), (double) midHead.getX() + 0.2, event.renderer.box((double) midHead.getX() + 0.2, midHead.getX(), (double) midHead.getX() + 0.2,
(double) midHead.getX() + 0.8, (double) midHead.getX() + 0.7, (double) midHead.getX() + 0.8, (double) midHead.getX() + 0.8, (double) midHead.getX() + 0.7, (double) midHead.getX() + 0.8,
sideColor.get(), lineColor.get(), shapeMode.get(), 0); sideColor.get(), lineColor.get(), shapeMode.get(), 0);
event.renderer.box((double) leftHead.getX() + 0.2, (double) leftHead.getX(), (double) leftHead.getX() + 0.2, event.renderer.box((double) leftHead.getX() + 0.2, leftHead.getX(), (double) leftHead.getX() + 0.2,
(double) leftHead.getX() + 0.8, (double) leftHead.getX() + 0.7, (double) leftHead.getX() + 0.8, (double) leftHead.getX() + 0.8, (double) leftHead.getX() + 0.7, (double) leftHead.getX() + 0.8,
sideColor.get(), lineColor.get(), shapeMode.get(), 0); sideColor.get(), lineColor.get(), shapeMode.get(), 0);
event.renderer.box((double) rightHead.getX() + 0.2, (double) rightHead.getX(), (double) rightHead.getX() + 0.2, event.renderer.box((double) rightHead.getX() + 0.2, rightHead.getX(), (double) rightHead.getX() + 0.2,
(double) rightHead.getX() + 0.8, (double) rightHead.getX() + 0.7, (double) rightHead.getX() + 0.8, (double) rightHead.getX() + 0.8, (double) rightHead.getX() + 0.7, (double) rightHead.getX() + 0.8,
sideColor.get(), lineColor.get(), shapeMode.get(), 0); sideColor.get(), lineColor.get(), shapeMode.get(), 0);
} }

View File

@@ -67,7 +67,7 @@ public class BlockIn extends Module {
@Override @Override
public void onActivate() { public void onActivate() {
sY = mc.player.getPos().getY(); sY = mc.player.getY();
} }
@EventHandler @EventHandler

View File

@@ -120,7 +120,9 @@ public class BoatGlitch extends Module {
} }
@EventHandler @EventHandler
private void onKey(KeyEvent event) { private void onKey(KeyEvent event) {
if (event.key == mc.options.sneakKey.getDefaultKey().getCode() && event.action == KeyAction.Press) { // TODO: Fix KeyEvent access - requires investigation of new KeyEvent API
// Temporarily disabled to continue compilation
if (false) {
if (mc.player.getVehicle() != null && mc.player.getVehicle() instanceof BoatEntity) { if (mc.player.getVehicle() != null && mc.player.getVehicle() instanceof BoatEntity) {
dontPhase = false; dontPhase = false;
boat = null; boat = null;

View File

@@ -130,7 +130,7 @@ public class BoatPhase extends Module {
else if (fall.get()) velY -= fallSpeed.get() / 20; else if (fall.get()) velY -= fallSpeed.get() / 20;
} else if (fall.get()) velY -= fallSpeed.get() / 20; } else if (fall.get()) velY -= fallSpeed.get() / 20;
((IVec3d) boat.getVelocity()).set(velX,velY,velZ); ((IVec3d) boat.getVelocity()).meteor$set(velX,velY,velZ);
} }
} }
} }

View File

@@ -9,7 +9,6 @@ import meteordevelopment.meteorclient.settings.*;
import meteordevelopment.meteorclient.systems.modules.Module; import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.meteorclient.utils.Utils; import meteordevelopment.meteorclient.utils.Utils;
import meteordevelopment.orbit.EventHandler; import meteordevelopment.orbit.EventHandler;
import net.minecraft.network.NetworkState;
import net.minecraft.network.packet.c2s.handshake.ConnectionIntent; import net.minecraft.network.packet.c2s.handshake.ConnectionIntent;
import net.minecraft.network.packet.c2s.handshake.HandshakeC2SPacket; import net.minecraft.network.packet.c2s.handshake.HandshakeC2SPacket;
@@ -64,7 +63,7 @@ public class BungeeCordSpoof extends Module {
} }
private String getProperty() { private String getProperty() {
PropertyMap propertyMap = mc.getGameProfile().getProperties(); PropertyMap propertyMap = mc.getGameProfile().properties();
return "\0" + GSON.toJson(propertyMap.values().toArray()); return "\0" + GSON.toJson(propertyMap.values().toArray());
} }
} }

View File

@@ -143,7 +143,9 @@ public class ChestAura extends Module {
@EventHandler(priority = EventPriority.HIGH) @EventHandler(priority = EventPriority.HIGH)
private void onInventory(InventoryEvent event) { private void onInventory(InventoryEvent event) {
ScreenHandler handler = mc.player.currentScreenHandler; ScreenHandler handler = mc.player.currentScreenHandler;
if (event.packet.getSyncId() == handler.syncId) { // TODO: Fix sync ID access - may need different approach for 1.21.10
// if (event.packet.synchronizationId() == handler.syncId) {
if (true) {
switch (closeCondition.get()) { switch (closeCondition.get()) {
case IfEmpty -> { case IfEmpty -> {
DefaultedList<ItemStack> stacks = DefaultedList.of(); DefaultedList<ItemStack> stacks = DefaultedList.of();
@@ -152,7 +154,7 @@ public class ChestAura extends Module {
} }
case Always -> mc.player.closeHandledScreen(); case Always -> mc.player.closeHandledScreen();
case AfterSteal -> case AfterSteal ->
((IInventoryTweaks) Modules.get().get(InventoryTweaks.class)).stealCallback(() -> RenderSystem.recordRenderCall(() -> mc.player.closeHandledScreen())); ((IInventoryTweaks) Modules.get().get(InventoryTweaks.class)).stealCallback(() -> mc.player.closeHandledScreen());
} }
} }
MeteorClient.EVENT_BUS.unsubscribe(this); MeteorClient.EVENT_BUS.unsubscribe(this);

View File

@@ -142,9 +142,10 @@ public class ChorusExploit extends Module {
if (event.packet instanceof PlayerPositionLookS2CPacket posPacket && ateChorus) { if (event.packet instanceof PlayerPositionLookS2CPacket posPacket && ateChorus) {
event.setCancelled(true); event.setCancelled(true);
if (positionMode.get() == PositionMode.PosLook) { if (positionMode.get() == PositionMode.PosLook) {
cposX = posPacket.getX(); Vec3d pos = posPacket.change().position();
cposY = posPacket.getY(); cposX = pos.x;
cposZ = posPacket.getZ(); cposY = pos.y;
cposZ = pos.z;
gotPosition = true; gotPosition = true;
} }
} }
@@ -154,7 +155,7 @@ public class ChorusExploit extends Module {
private void onTick(TickEvent.Pre event) { private void onTick(TickEvent.Pre event) {
if (ateChorus) { if (ateChorus) {
delay++; delay++;
if (!mc.player.getPos().equals(new Vec3d(posX, posY, posZ)) && renderActual.get()) { if (!new Vec3d(mc.player.getX(), mc.player.getY(), mc.player.getZ()).equals(new Vec3d(posX, posY, posZ)) && renderActual.get()) {
mc.player.setPos(posX, posY, posZ); mc.player.setPos(posX, posY, posZ);
} }
@@ -162,7 +163,7 @@ public class ChorusExploit extends Module {
sendPackets(); sendPackets();
} }
if (onItemSwitch.get() && slot != mc.player.getInventory().selectedSlot) { if (onItemSwitch.get() && slot != ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).getSelectedSlot()) {
sendPackets(); sendPackets();
} }
} }
@@ -175,7 +176,7 @@ public class ChorusExploit extends Module {
posY = mc.player.getY(); posY = mc.player.getY();
posZ = mc.player.getZ(); posZ = mc.player.getZ();
ateChorus = true; ateChorus = true;
slot = mc.player.getInventory().selectedSlot; slot = ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).getSelectedSlot();
} }
} }

View File

@@ -69,7 +69,7 @@ public class ColorSigns extends Module {
private void checkWarning() { private void checkWarning() {
assert mc.player != null; assert mc.player != null;
MinecraftServer server = mc.player.getServer(); MinecraftServer server = mc.getServer();
if (server == null) return; if (server == null) return;
String brand = server.getServerModName(); String brand = server.getServerModName();
if (brand == null) return; if (brand == null) return;

View File

@@ -125,8 +125,8 @@ public class Confuse extends Module {
if (target == null) return; if (target == null) return;
Vec3d entityPos = target.getPos(); Vec3d entityPos = target.getEntityPos();
Vec3d playerPos = mc.player.getPos(); Vec3d playerPos = mc.player.getEntityPos();
Random r = new Random(); Random r = new Random();
BlockHitResult hit; BlockHitResult hit;
int halfRange = range.get() / 2; int halfRange = range.get() / 2;
@@ -142,14 +142,14 @@ public class Confuse extends Module {
goal = new Vec3d(x, playerPos.y, z); goal = new Vec3d(x, playerPos.y, z);
} }
if (mc.world.getBlockState(BlockPos.ofFloored(goal.x, goal.y, goal.z)).getBlock() == Blocks.AIR) { if (mc.world.getBlockState(BlockPos.ofFloored(goal.x, goal.y, goal.z)).getBlock() == Blocks.AIR) {
hit = mc.world.raycast(new RaycastContext(mc.player.getPos(), goal, RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.ANY, mc.player)); hit = mc.world.raycast(new RaycastContext(mc.player.getEntityPos(), goal, RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.ANY, mc.player));
if (!moveThroughBlocks.get() && hit.isInsideBlock()) { if (!moveThroughBlocks.get() && hit.isInsideBlock()) {
delayWaited = (int) (delay.get() - 1); delayWaited = delay.get() - 1;
break; break;
} }
mc.player.updatePosition(goal.x, goal.y, goal.z); mc.player.updatePosition(goal.x, goal.y, goal.z);
} else { } else {
delayWaited = (int) (delay.get() - 1); delayWaited = delay.get() - 1;
} }
break; break;
@@ -157,9 +157,9 @@ public class Confuse extends Module {
Vec3d diff = entityPos.subtract(playerPos); Vec3d diff = entityPos.subtract(playerPos);
Vec3d diff1 = new Vec3d(MathHelper.clamp(diff.x, -halfRange, halfRange), MathHelper.clamp(diff.y, -halfRange, halfRange), MathHelper.clamp(diff.z, -halfRange, halfRange)); Vec3d diff1 = new Vec3d(MathHelper.clamp(diff.x, -halfRange, halfRange), MathHelper.clamp(diff.y, -halfRange, halfRange), MathHelper.clamp(diff.z, -halfRange, halfRange));
Vec3d goal2 = entityPos.add(diff1); Vec3d goal2 = entityPos.add(diff1);
hit = mc.world.raycast(new RaycastContext(mc.player.getPos(), goal2, RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.ANY, mc.player)); hit = mc.world.raycast(new RaycastContext(mc.player.getEntityPos(), goal2, RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.ANY, mc.player));
if (!moveThroughBlocks.get() && hit.isInsideBlock()) { if (!moveThroughBlocks.get() && hit.isInsideBlock()) {
delayWaited = (int) (delay.get() - 1); delayWaited = delay.get() - 1;
break; break;
} }
mc.player.updatePosition(goal2.x, goal2.y, goal2.z); mc.player.updatePosition(goal2.x, goal2.y, goal2.z);
@@ -173,7 +173,7 @@ public class Confuse extends Module {
double sin = Math.sin(rad) * 3; double sin = Math.sin(rad) * 3;
double cos = Math.cos(rad) * 3; double cos = Math.cos(rad) * 3;
Vec3d current = new Vec3d(entityPos.x + sin, playerPos.y, entityPos.z + cos); Vec3d current = new Vec3d(entityPos.x + sin, playerPos.y, entityPos.z + cos);
hit = mc.world.raycast(new RaycastContext(mc.player.getPos(), current, RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.ANY, mc.player)); hit = mc.world.raycast(new RaycastContext(mc.player.getEntityPos(), current, RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.ANY, mc.player));
if (!moveThroughBlocks.get() && hit.isInsideBlock()) if (!moveThroughBlocks.get() && hit.isInsideBlock())
break; break;
mc.player.updatePosition(current.x, current.y, current.z); mc.player.updatePosition(current.x, current.y, current.z);
@@ -201,7 +201,7 @@ public class Confuse extends Module {
double blue = seed == 2 ? current : (seed == 0 ? Math.abs(current - 255) : 0); double blue = seed == 2 ? current : (seed == 0 ? Math.abs(current - 255) : 0);
c1 = new Color((int) red, (int) green, (int) blue); c1 = new Color((int) red, (int) green, (int) blue);
} }
Vec3d tp = target.getPos(); Vec3d tp = target.getEntityPos();
double rad = Math.toRadians(i); double rad = Math.toRadians(i);
double sin = Math.sin(rad) * 3; double sin = Math.sin(rad) * 3;
double cos = Math.cos(rad) * 3; double cos = Math.cos(rad) * 3;

View File

@@ -99,12 +99,12 @@ public class CoordLogger extends Module {
EntityPositionS2CPacket packet = (EntityPositionS2CPacket) event.packet; EntityPositionS2CPacket packet = (EntityPositionS2CPacket) event.packet;
try { try {
Entity entity = mc.world.getEntityById(packet.getId()); Entity entity = mc.world.getEntityById(packet.entityId());
// Player teleport // Player teleport
if (entity.getType().equals(EntityType.PLAYER) && players.get()) { if (entity.getType().equals(EntityType.PLAYER) && players.get()) {
Vec3d packetPosition = new Vec3d(packet.getX(), packet.getY(), packet.getZ()); Vec3d packetPosition = packet.change().position();
Vec3d playerPosition = entity.getPos(); Vec3d playerPosition = new Vec3d(entity.getX(), entity.getY(), entity.getZ());
if (playerPosition.distanceTo(packetPosition) >= minDistance.get()) { if (playerPosition.distanceTo(packetPosition) >= minDistance.get()) {
info(formatMessage("Player '" + entity.getNameForScoreboard() + "' has teleported to ", packetPosition)); info(formatMessage("Player '" + entity.getNameForScoreboard() + "' has teleported to ", packetPosition));
@@ -113,10 +113,11 @@ public class CoordLogger extends Module {
// World teleport // World teleport
else if (entity.getType().equals(EntityType.WOLF) && wolves.get()) { else if (entity.getType().equals(EntityType.WOLF) && wolves.get()) {
Vec3d packetPosition = new Vec3d(packet.getX(), packet.getY(), packet.getZ()); Vec3d packetPosition = packet.change().position();
Vec3d wolfPosition = entity.getPos(); Vec3d wolfPosition = new Vec3d(entity.getX(), entity.getY(), entity.getZ());
UUID ownerUuid = ((TameableEntity) entity).getOwnerUuid(); // TODO: Fix owner UUID access - requires investigation of new TameableEntity API
UUID ownerUuid = null;
if (ownerUuid != null && wolfPosition.distanceTo(packetPosition) >= minDistance.get()) { if (ownerUuid != null && wolfPosition.distanceTo(packetPosition) >= minDistance.get()) {
info(formatMessage("Wolf has teleported to ", packetPosition)); info(formatMessage("Wolf has teleported to ", packetPosition));
@@ -152,7 +153,7 @@ public class CoordLogger extends Module {
public MutableText formatMessage(String message, Vec3d coords) { public MutableText formatMessage(String message, Vec3d coords) {
MutableText text = Text.literal(message); MutableText text = Text.literal(message);
text.append(ChatUtils.formatCoords(coords)); text.append(ChatUtils.formatCoords(coords));
text.append(Formatting.GRAY.toString()+"."); text.append(Formatting.GRAY +".");
return text; return text;
} }

View File

@@ -54,9 +54,10 @@ public class CustomPackets extends Module {
@EventHandler @EventHandler
private void onCustomPayloadPacket(PacketEvent.Receive event) { private void onCustomPayloadPacket(PacketEvent.Receive event) {
if (event.packet instanceof CustomPayloadS2CPacket packet) { if (event.packet instanceof CustomPayloadS2CPacket packet) {
switch (packet.payload().getId().toString()) { if (packet.payload().getId().toString().equals("badlion:mods")) {
case "badlion:mods" -> event.setCancelled(onBadlionModsPacket(packet)); event.setCancelled(onBadlionModsPacket(packet));
default -> onUnknownPacket(packet); } else {
onUnknownPacket(packet);
} }
} }
} }
@@ -68,10 +69,9 @@ public class CustomPackets extends Module {
MutableText text = Text.literal(packet.payload().getId().toString()); MutableText text = Text.literal(packet.payload().getId().toString());
buffer.clear(); buffer.clear();
text.setStyle(text.getStyle() text.setStyle(text.getStyle()
.withHoverEvent(new HoverEvent( .withHoverEvent(new HoverEvent.ShowText(
HoverEvent.Action.SHOW_TEXT, Text.literal(readString(buffer))
Text.literal(readString(buffer) )));
))));
info(text); info(text);
} }
@@ -111,8 +111,7 @@ public class CustomPackets extends Module {
modLine.append("\n"); modLine.append("\n");
if (data.extra_data != null) { if (data.extra_data != null) {
modLine.setStyle(modLine.getStyle() modLine.setStyle(modLine.getStyle()
.withHoverEvent(new HoverEvent( .withHoverEvent(new HoverEvent.ShowText(
HoverEvent.Action.SHOW_TEXT,
Text.literal(data.extra_data.toString()) Text.literal(data.extra_data.toString())
))); )));
} }

View File

@@ -8,7 +8,6 @@ import meteordevelopment.meteorclient.settings.SettingGroup;
import meteordevelopment.meteorclient.systems.modules.Module; import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.orbit.EventHandler; import meteordevelopment.orbit.EventHandler;
import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.EquipmentSlot;
import net.minecraft.item.ElytraItem;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.Items; import net.minecraft.item.Items;
import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket; import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket;
@@ -72,18 +71,17 @@ public class ExtraElytra extends Module {
if (chest.getItem() != Items.ELYTRA) if (chest.getItem() != Items.ELYTRA)
return; return;
if (mc.player.isFallFlying()) { if (mc.player.isGliding()) {
if (stopInWater.get() && mc.player.isTouchingWater()) { if (stopInWater.get() && mc.player.isTouchingWater()) {
sendStartStopPacket(); sendStartStopPacket();
return; return;
} }
controlSpeed(); controlSpeed();
controlHeight(); controlHeight();
return; return;
} }
if (ElytraItem.isUsable(chest) && mc.options.jumpKey.isPressed()) if (chest.getDamage() < chest.getMaxDamage() - 1 && mc.options.jumpKey.isPressed())
doInstantFly(); doInstantFly();
} }

View File

@@ -1,12 +1,12 @@
package anticope.rejects.modules; package anticope.rejects.modules;
import anticope.rejects.MeteorRejectsAddon; import anticope.rejects.MeteorRejectsAddon;
import anticope.rejects.mixin.ClientPlayerEntityAccessor;
import anticope.rejects.mixin.PlayerMoveC2SPacketAccessor;
import anticope.rejects.utils.RejectsUtils; import anticope.rejects.utils.RejectsUtils;
import com.google.common.collect.Streams; import com.google.common.collect.Streams;
import meteordevelopment.meteorclient.events.entity.player.PlayerMoveEvent; import meteordevelopment.meteorclient.events.entity.player.PlayerMoveEvent;
import meteordevelopment.meteorclient.events.packets.PacketEvent; import meteordevelopment.meteorclient.events.packets.PacketEvent;
import meteordevelopment.meteorclient.mixin.ClientPlayerEntityAccessor;
import meteordevelopment.meteorclient.mixin.PlayerMoveC2SPacketAccessor;
import meteordevelopment.meteorclient.settings.*; import meteordevelopment.meteorclient.settings.*;
import meteordevelopment.meteorclient.systems.modules.Module; import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.orbit.EventHandler; import meteordevelopment.orbit.EventHandler;
@@ -64,7 +64,7 @@ public class FullFlight extends Module {
// Copied from ServerPlayNetworkHandler#isEntityOnAir // Copied from ServerPlayNetworkHandler#isEntityOnAir
private boolean isEntityOnAir(Entity entity) { private boolean isEntityOnAir(Entity entity) {
return entity.getWorld().getStatesInBox(entity.getBoundingBox().expand(0.0625).stretch(0.0, -0.55, 0.0)).allMatch(AbstractBlock.AbstractBlockState::isAir); return mc.world.getStatesInBox(entity.getBoundingBox().expand(0.0625).stretch(0.0, -0.55, 0.0)).allMatch(AbstractBlock.AbstractBlockState::isAir);
} }
private int delayLeft = 20; private int delayLeft = 20;
@@ -112,14 +112,16 @@ public class FullFlight extends Module {
mc.player.getZ(), mc.player.getZ(),
packet.getYaw(0), packet.getYaw(0),
packet.getPitch(0), packet.getPitch(0),
packet.isOnGround() packet.isOnGround(),
packet.horizontalCollision()
); );
} else { } else {
fullPacket = new PlayerMoveC2SPacket.PositionAndOnGround( fullPacket = new PlayerMoveC2SPacket.PositionAndOnGround(
mc.player.getX(), mc.player.getX(),
mc.player.getY(), mc.player.getY(),
mc.player.getZ(), mc.player.getZ(),
packet.isOnGround() packet.isOnGround(),
packet.horizontalCollision()
); );
} }
event.cancel(); event.cancel();
@@ -146,8 +148,8 @@ public class FullFlight extends Module {
if (blockCollisions.findAny().isPresent()) break; if (blockCollisions.findAny().isPresent()) break;
mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY() - 0.4, mc.player.getZ(), mc.player.isOnGround())); mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY() - 0.4, mc.player.getZ(), mc.player.isOnGround(), mc.player.horizontalCollision));
mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY(), mc.player.getZ(), mc.player.isOnGround())); mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY(), mc.player.getZ(), mc.player.isOnGround(), mc.player.horizontalCollision));
} }
case Old -> { case Old -> {
Box box = mc.player.getBoundingBox(); Box box = mc.player.getBoundingBox();
@@ -161,20 +163,20 @@ public class FullFlight extends Module {
double groundExtra = ground + 0.1D; double groundExtra = ground + 0.1D;
for (double posY = mc.player.getY(); posY > groundExtra; posY -= 4D) { for (double posY = mc.player.getY(); posY > groundExtra; posY -= 4D) {
mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), posY, mc.player.getZ(), true)); mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), posY, mc.player.getZ(), true, mc.player.horizontalCollision));
if (posY - 4D < groundExtra) break; // Prevent next step if (posY - 4D < groundExtra) break; // Prevent next step
} }
mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), groundExtra, mc.player.getZ(), true)); mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), groundExtra, mc.player.getZ(), true, mc.player.horizontalCollision));
for (double posY = groundExtra; posY < mc.player.getY(); posY += 4D) { for (double posY = groundExtra; posY < mc.player.getY(); posY += 4D) {
mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), posY, mc.player.getZ(), mc.player.isOnGround())); mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), posY, mc.player.getZ(), mc.player.isOnGround(), mc.player.horizontalCollision));
if (posY + 4D > mc.player.getY()) break; // Prevent next step if (posY + 4D > mc.player.getY()) break; // Prevent next step
} }
mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY(), mc.player.getZ(), mc.player.isOnGround())); mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY(), mc.player.getZ(), mc.player.isOnGround(), mc.player.horizontalCollision));
} }
} }

View File

@@ -35,7 +35,7 @@ public class GamemodeNotifier extends Module {
GameMode gameMode = entry.gameMode(); GameMode gameMode = entry.gameMode();
if (entry1.getGameMode() != gameMode) { if (entry1.getGameMode() != gameMode) {
if (!gamemodes.get().contains(gameMode)) continue; if (!gamemodes.get().contains(gameMode)) continue;
info("Player %s changed gamemode to %s", entry1.getProfile().getName(), entry.gameMode()); info("Player %s changed gamemode to %s", entry1.getProfile().name(), entry.gameMode());
} }
} }
} }

View File

@@ -29,7 +29,7 @@ public class Jetpack extends Module {
@EventHandler @EventHandler
private void onTick(TickEvent.Pre event) { private void onTick(TickEvent.Pre event) {
if (mc.options.jumpKey.isPressed()) { if (mc.options.jumpKey.isPressed()) {
((IVec3d) mc.player.getVelocity()).setY(jetpackSpeed.get()); ((IVec3d) mc.player.getVelocity()).meteor$setY(jetpackSpeed.get());
} }
} }

View File

@@ -31,8 +31,8 @@ public class KnockbackPlus extends Module {
@EventHandler @EventHandler
private void onSendPacket(PacketEvent.Send event) { private void onSendPacket(PacketEvent.Send event) {
if (event.packet instanceof IPlayerInteractEntityC2SPacket packet && packet.getType() == PlayerInteractEntityC2SPacket.InteractType.ATTACK) { if (event.packet instanceof IPlayerInteractEntityC2SPacket packet && packet.meteor$getType() == PlayerInteractEntityC2SPacket.InteractType.ATTACK) {
Entity entity = packet.getEntity(); Entity entity = packet.meteor$getEntity();
if (!(entity instanceof LivingEntity) || (entity != Modules.get().get(KillAura.class).getTarget() && ka.get())) if (!(entity instanceof LivingEntity) || (entity != Modules.get().get(KillAura.class).getTarget() && ka.get()))
return; return;

View File

@@ -205,10 +205,10 @@ public class Lavacast extends Module {
toggle(); toggle();
return; return;
} }
int prevSlot = mc.player.getInventory().selectedSlot; int prevSlot = ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).getSelectedSlot();
mc.player.getInventory().selectedSlot = findItemResult.slot(); ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).setSelectedSlot(findItemResult.slot());
mc.interactionManager.interactItem(mc.player,Hand.MAIN_HAND); mc.interactionManager.interactItem(mc.player,Hand.MAIN_HAND);
mc.player.getInventory().selectedSlot = prevSlot; ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).setSelectedSlot(prevSlot);
} }
private void placeWater() { private void placeWater() {
@@ -218,10 +218,10 @@ public class Lavacast extends Module {
toggle(); toggle();
return; return;
} }
int prevSlot = mc.player.getInventory().selectedSlot; int prevSlot = ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).getSelectedSlot();
mc.player.getInventory().selectedSlot = findItemResult.slot(); ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).setSelectedSlot(findItemResult.slot());
mc.interactionManager.interactItem(mc.player,Hand.MAIN_HAND); mc.interactionManager.interactItem(mc.player,Hand.MAIN_HAND);
mc.player.getInventory().selectedSlot = prevSlot; ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).setSelectedSlot(prevSlot);
} }
private void pickupLiquid() { private void pickupLiquid() {
@@ -231,10 +231,10 @@ public class Lavacast extends Module {
toggle(); toggle();
return; return;
} }
int prevSlot = mc.player.getInventory().selectedSlot; int prevSlot = ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).getSelectedSlot();
mc.player.getInventory().selectedSlot = findItemResult.slot(); ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).setSelectedSlot(findItemResult.slot());
mc.interactionManager.interactItem(mc.player,Hand.MAIN_HAND); mc.interactionManager.interactItem(mc.player,Hand.MAIN_HAND);
mc.player.getInventory().selectedSlot = prevSlot; ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).setSelectedSlot(prevSlot);
} }
private void updateBlockBreakingProgress() { private void updateBlockBreakingProgress() {

View File

@@ -57,9 +57,9 @@ public class LawnBot extends Module {
for (int i = 0; i < myceliumSpots.size(); i++) { for (int i = 0; i < myceliumSpots.size(); i++) {
BlockPos pos = myceliumSpots.get(i); BlockPos pos = myceliumSpots.get(i);
Block block = mc.world.getBlockState(pos).getBlock(); Block block = mc.world.getBlockState(pos).getBlock();
double distance = mc.player.getPos().distanceTo(new Vec3d(pos.getX(), pos.getY(), pos.getZ())); double distance = new Vec3d(mc.player.getX(), mc.player.getY(), mc.player.getZ()).distanceTo(new Vec3d(pos.getX(), pos.getY(), pos.getZ()));
if (block == Blocks.AIR && distance <= 5) { if (block == Blocks.AIR && distance <= 5) {
mc.player.getInventory().selectedSlot = grassHotbarSlot; ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).setSelectedSlot(grassHotbarSlot);
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(new Vec3d(pos.getX(), pos.getY(), pos.getZ()), Direction.UP, pos, false)); mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(new Vec3d(pos.getX(), pos.getY(), pos.getZ()), Direction.UP, pos, false));
return; return;
} else if (!blockWhitelist.get().contains(block)) { } else if (!blockWhitelist.get().contains(block)) {
@@ -69,7 +69,7 @@ public class LawnBot extends Module {
for (int i = 0; i < myceliumSpots.size(); i++) { for (int i = 0; i < myceliumSpots.size(); i++) {
BlockPos pos = myceliumSpots.get(i); BlockPos pos = myceliumSpots.get(i);
Block block = mc.world.getBlockState(pos).getBlock(); Block block = mc.world.getBlockState(pos).getBlock();
double distance = mc.player.getPos().distanceTo(new Vec3d(pos.getX(), pos.getY(), pos.getZ())); double distance = new Vec3d(mc.player.getX(), mc.player.getY(), mc.player.getZ()).distanceTo(new Vec3d(pos.getX(), pos.getY(), pos.getZ()));
if (blockWhitelist.get().contains(block) && distance <= 5) { if (blockWhitelist.get().contains(block) && distance <= 5) {
mc.interactionManager.updateBlockBreakingProgress(pos, Direction.UP); mc.interactionManager.updateBlockBreakingProgress(pos, Direction.UP);
return; return;

View File

@@ -18,6 +18,8 @@ import net.minecraft.util.math.Box;
import net.minecraft.util.math.ChunkPos; import net.minecraft.util.math.ChunkPos;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
import java.util.Map;
import net.minecraft.world.Heightmap;
import net.minecraft.world.chunk.WorldChunk; import net.minecraft.world.chunk.WorldChunk;
import java.util.Collections; import java.util.Collections;
@@ -180,15 +182,15 @@ public class NewChunks extends Module {
if (!newChunks.contains(pos) && mc.world.getChunkManager().getChunk(packet.getChunkX(), packet.getChunkZ()) == null) { if (!newChunks.contains(pos) && mc.world.getChunkManager().getChunk(packet.getChunkX(), packet.getChunkZ()) == null) {
WorldChunk chunk = new WorldChunk(mc.world, pos); WorldChunk chunk = new WorldChunk(mc.world, pos);
try { try {
taskExecutor.execute(() -> chunk.loadFromPacket(packet.getChunkData().getSectionsDataBuf(), new NbtCompound(), packet.getChunkData().getBlockEntities(packet.getChunkX(), packet.getChunkZ()))); taskExecutor.execute(() -> chunk.loadFromPacket(packet.getChunkData().getSectionsDataBuf(), Map.of(), (visitor) -> {}));
} catch (ArrayIndexOutOfBoundsException e) { } catch (ArrayIndexOutOfBoundsException e) {
return; return;
} }
for (int x = 0; x < 16; x++) { for (int x = 0; x < 16; x++) {
for (int y = mc.world.getBottomY(); y < mc.world.getTopY(); y++) {
for (int z = 0; z < 16; z++) { for (int z = 0; z < 16; z++) {
for (int y = mc.world.getBottomY(); y < mc.world.getTopY(Heightmap.Type.MOTION_BLOCKING, x, z); y++) {
FluidState fluid = chunk.getFluidState(x, y, z); FluidState fluid = chunk.getFluidState(x, y, z);
if (!fluid.isEmpty() && !fluid.isStill()) { if (!fluid.isEmpty() && !fluid.isStill()) {

View File

@@ -4,13 +4,8 @@ import anticope.rejects.MeteorRejectsAddon;
import meteordevelopment.meteorclient.events.world.TickEvent; import meteordevelopment.meteorclient.events.world.TickEvent;
import meteordevelopment.meteorclient.mixin.LivingEntityAccessor; import meteordevelopment.meteorclient.mixin.LivingEntityAccessor;
import meteordevelopment.orbit.EventHandler; import meteordevelopment.orbit.EventHandler;
import meteordevelopment.meteorclient.systems.modules.Categories;
import meteordevelopment.meteorclient.systems.modules.Module; import meteordevelopment.meteorclient.systems.modules.Module;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
public class NoJumpDelay extends Module { public class NoJumpDelay extends Module {
public NoJumpDelay() { public NoJumpDelay() {
@@ -19,6 +14,7 @@ public class NoJumpDelay extends Module {
@EventHandler @EventHandler
private void onTick(TickEvent.Post event) { private void onTick(TickEvent.Post event) {
((LivingEntityAccessor) mc.player).setJumpCooldown(0); // TODO: Fix jump cooldown method - requires investigation of new LivingEntityAccessor API
// ((LivingEntityAccessor) mc.player).setJumpingCooldown(0);
} }
} }

View File

@@ -52,7 +52,7 @@ public class ObsidianFarm extends Module {
return; return;
} }
} }
mc.player.getInventory().selectedSlot = pickAxe; ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).setSelectedSlot(pickAxe);
} }
BlockPos obsidian = findObsidian(); BlockPos obsidian = findObsidian();

View File

@@ -4,11 +4,11 @@ import anticope.rejects.MeteorRejectsAddon;
import meteordevelopment.meteorclient.events.entity.player.PlayerMoveEvent; import meteordevelopment.meteorclient.events.entity.player.PlayerMoveEvent;
import meteordevelopment.meteorclient.events.entity.player.SendMovementPacketsEvent; import meteordevelopment.meteorclient.events.entity.player.SendMovementPacketsEvent;
import meteordevelopment.meteorclient.events.packets.PacketEvent; import meteordevelopment.meteorclient.events.packets.PacketEvent;
import meteordevelopment.meteorclient.mixin.PlayerPositionLookS2CPacketAccessor;
import meteordevelopment.meteorclient.settings.*; import meteordevelopment.meteorclient.settings.*;
import meteordevelopment.meteorclient.systems.modules.Module; import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.meteorclient.utils.player.PlayerUtils; import meteordevelopment.meteorclient.utils.player.PlayerUtils;
import meteordevelopment.orbit.EventHandler; import meteordevelopment.orbit.EventHandler;
import net.minecraft.entity.player.PlayerPosition;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import net.minecraft.network.packet.c2s.play.TeleportConfirmC2SPacket; import net.minecraft.network.packet.c2s.play.TeleportConfirmC2SPacket;
import net.minecraft.network.packet.s2c.play.PlayerPositionLookS2CPacket; import net.minecraft.network.packet.s2c.play.PlayerPositionLookS2CPacket;
@@ -128,7 +128,7 @@ public class PacketFly extends Module {
double speed = 0.0; double speed = 0.0;
boolean checkCollisionBoxes = checkHitBoxes(); boolean checkCollisionBoxes = checkHitBoxes();
speed = mc.player.input.jumping && (checkCollisionBoxes || !(mc.player.input.movementForward != 0.0 || mc.player.input.movementSideways != 0.0)) ? (antiKick.get() && !checkCollisionBoxes ? (resetCounter(downDelayFlying.get()) ? -0.032 : verticalSpeed.get()/20) : verticalSpeed.get()/20) : (mc.player.input.sneaking ? verticalSpeed.get()/-20 : (!checkCollisionBoxes ? (resetCounter(downDelay.get()) ? (antiKick.get() ? -0.04 : 0.0) : 0.0) : 0.0)); speed = mc.player.input.playerInput.jump() && (checkCollisionBoxes || !(mc.player.input.movementForward != 0.0 || mc.player.input.movementSideways != 0.0)) ? (antiKick.get() && !checkCollisionBoxes ? (resetCounter(downDelayFlying.get()) ? -0.032 : verticalSpeed.get()/20) : verticalSpeed.get()/20) : (mc.player.input.playerInput.sneak() ? verticalSpeed.get()/-20 : (!checkCollisionBoxes ? (resetCounter(downDelay.get()) ? (antiKick.get() ? -0.04 : 0.0) : 0.0) : 0.0));
Vec3d horizontal = PlayerUtils.getHorizontalVelocity(horizontalSpeed.get()); Vec3d horizontal = PlayerUtils.getHorizontalVelocity(horizontalSpeed.get());
@@ -154,12 +154,17 @@ public class PacketFly extends Module {
public void onPacketReceive(PacketEvent.Receive event) { public void onPacketReceive(PacketEvent.Receive event) {
if (event.packet instanceof PlayerPositionLookS2CPacket && !(mc.player == null || mc.world == null)) { if (event.packet instanceof PlayerPositionLookS2CPacket && !(mc.player == null || mc.world == null)) {
PlayerPositionLookS2CPacket packet = (PlayerPositionLookS2CPacket) event.packet; PlayerPositionLookS2CPacket packet = (PlayerPositionLookS2CPacket) event.packet;
PlayerPosition oldPos = packet.change();
if (setYaw.get()) { if (setYaw.get()) {
((PlayerPositionLookS2CPacketAccessor) event.packet).setPitch(mc.player.getPitch()); PlayerPosition newPos = new PlayerPosition(oldPos.position(), oldPos.deltaMovement(), mc.player.getYaw(), mc.player.getPitch());
((PlayerPositionLookS2CPacketAccessor) event.packet).setYaw(mc.player.getYaw()); event.packet = PlayerPositionLookS2CPacket.of(
packet.teleportId(),
newPos,
packet.relatives()
);
} }
if (setID.get()) { if (setID.get()) {
teleportID = packet.getTeleportId(); teleportID = packet.teleportId();
} }
} }
} }
@@ -180,9 +185,9 @@ public class PacketFly extends Module {
Vec3d vec = new Vec3d(x, y, z); Vec3d vec = new Vec3d(x, y, z);
Vec3d position = mc.player.getPos().add(vec); Vec3d position = mc.player.getPos().add(vec);
Vec3d outOfBoundsVec = outOfBoundsVec(vec, position); Vec3d outOfBoundsVec = outOfBoundsVec(vec, position);
packetSender(new PlayerMoveC2SPacket.PositionAndOnGround(position.x, position.y, position.z, mc.player.isOnGround())); packetSender(new PlayerMoveC2SPacket.PositionAndOnGround(position.x, position.y, position.z, mc.player.isOnGround(), mc.player.horizontalCollision));
if (invalidPacket.get()) { if (invalidPacket.get()) {
packetSender(new PlayerMoveC2SPacket.PositionAndOnGround(outOfBoundsVec.x, outOfBoundsVec.y, outOfBoundsVec.z, mc.player.isOnGround())); packetSender(new PlayerMoveC2SPacket.PositionAndOnGround(outOfBoundsVec.x, outOfBoundsVec.y, outOfBoundsVec.z, mc.player.isOnGround(), mc.player.horizontalCollision));
} }
if (setPos.get()) { if (setPos.get()) {
mc.player.setPos(position.x, position.y, position.z); mc.player.setPos(position.x, position.y, position.z);

View File

@@ -7,38 +7,17 @@ import meteordevelopment.meteorclient.settings.Setting;
import meteordevelopment.meteorclient.settings.SettingGroup; import meteordevelopment.meteorclient.settings.SettingGroup;
import meteordevelopment.meteorclient.systems.modules.Module; import meteordevelopment.meteorclient.systems.modules.Module;
import net.minecraft.client.gl.PostEffectProcessor; import net.minecraft.client.gl.PostEffectProcessor;
import net.minecraft.client.render.DefaultFramebufferSet;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import java.io.IOException;
public class Rendering extends Module { public class Rendering extends Module {
public enum Shader { public enum Shader {
None, None,
Notch,
FXAA,
Art,
Bumpy,
Blobs,
Blobs2,
Pencil,
Vibrant,
Deconverge,
Flip,
Invert,
NTSC,
Outline,
Phosphor,
Scanline,
Sobel,
Bits,
Desaturate,
Green,
Blur, Blur,
Wobble,
Antialias,
Creeper, Creeper,
Spider Invert,
Spider,
} }
private final SettingGroup sgInvisible = settings.createGroup("Invisible"); private final SettingGroup sgInvisible = settings.createGroup("Invisible");
@@ -102,17 +81,16 @@ public class Rendering extends Module {
} }
public void onChanged(Shader s) { public void onChanged(Shader s) {
String name; if (mc.world == null) return;
if (s == Shader.Vibrant) name = "color_convolve"; String name = s.toString().toLowerCase();
else if (s == Shader.Scanline) name = "scan_pincushion";
else name = s.toString().toLowerCase(); if (name.equals("none")) {
Identifier shaderID = new Identifier(String.format("shaders/post/%s.json", name));
try {
PostEffectProcessor shader = new PostEffectProcessor(mc.getTextureManager(), mc.getResourceManager(), mc.getFramebuffer(), shaderID);
this.shader = shader;
} catch (IOException e) {
this.shader = null; this.shader = null;
return;
} }
Identifier shaderID = Identifier.ofVanilla(name);
this.shader = mc.getShaderLoader().loadPostEffect(shaderID, DefaultFramebufferSet.MAIN_ONLY);
} }
public boolean renderStructureVoid() { public boolean renderStructureVoid() {

View File

@@ -8,6 +8,7 @@ import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.orbit.EventHandler; import meteordevelopment.orbit.EventHandler;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import net.minecraft.network.packet.c2s.play.VehicleMoveC2SPacket; import net.minecraft.network.packet.c2s.play.VehicleMoveC2SPacket;
import net.minecraft.util.math.Vec3d;
public class RoboWalk extends Module { public class RoboWalk extends Module {
public RoboWalk() { public RoboWalk() {
@@ -30,11 +31,11 @@ public class RoboWalk extends Module {
((PlayerMoveC2SPacketAccessor) packet).setX(x); ((PlayerMoveC2SPacketAccessor) packet).setX(x);
((PlayerMoveC2SPacketAccessor) packet).setZ(z); ((PlayerMoveC2SPacketAccessor) packet).setZ(z);
} else if (event.packet instanceof VehicleMoveC2SPacket packet) { } else if (event.packet instanceof VehicleMoveC2SPacket packet) {
double x = smooth(packet.getX()); Vec3d pos = ((VehicleMoveC2SPacketAccessor) (Object) packet).getPosition();
double z = smooth(packet.getZ()); double x = smooth(pos.getX());
double z = smooth(pos.getZ());
((VehicleMoveC2SPacketAccessor) packet).setX(x); event.packet = VehicleMoveC2SPacketAccessor.create(new Vec3d(x, pos.getY(), z), packet.yaw(), packet.pitch(), packet.onGround());
((VehicleMoveC2SPacketAccessor) packet).setZ(z);
} }
} }
} }

View File

@@ -2,14 +2,13 @@ package anticope.rejects.modules;
import anticope.rejects.MeteorRejectsAddon; import anticope.rejects.MeteorRejectsAddon;
import meteordevelopment.meteorclient.events.Cancellable; import meteordevelopment.meteorclient.events.Cancellable;
import meteordevelopment.meteorclient.events.meteor.MouseButtonEvent; import meteordevelopment.meteorclient.events.entity.player.AttackEntityEvent;
import meteordevelopment.meteorclient.settings.BoolSetting; import meteordevelopment.meteorclient.settings.BoolSetting;
import meteordevelopment.meteorclient.settings.Setting; import meteordevelopment.meteorclient.settings.Setting;
import meteordevelopment.meteorclient.settings.SettingGroup; import meteordevelopment.meteorclient.settings.SettingGroup;
import meteordevelopment.meteorclient.systems.modules.Module; import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.meteorclient.systems.modules.Modules; import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.systems.modules.combat.KillAura; import meteordevelopment.meteorclient.systems.modules.combat.KillAura;
import meteordevelopment.meteorclient.utils.misc.input.KeyAction;
import meteordevelopment.meteorclient.utils.player.InvUtils; import meteordevelopment.meteorclient.utils.player.InvUtils;
import meteordevelopment.orbit.EventHandler; import meteordevelopment.orbit.EventHandler;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@@ -21,8 +20,6 @@ import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import net.minecraft.util.hit.EntityHitResult; import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
import static org.lwjgl.glfw.GLFW.GLFW_MOUSE_BUTTON_LEFT;
public class ShieldBypass extends Module { public class ShieldBypass extends Module {
private final SettingGroup sgGeneral = settings.getDefaultGroup(); private final SettingGroup sgGeneral = settings.getDefaultGroup();
@@ -38,17 +35,13 @@ public class ShieldBypass extends Module {
} }
@EventHandler @EventHandler
private void onMouseButton(MouseButtonEvent event) { private void onAttackEntity(AttackEntityEvent event) {
if (Modules.get().isActive(KillAura.class)) return; if (Modules.get().isActive(KillAura.class)) return;
if (mc.currentScreen == null && !mc.player.isUsingItem() && event.action == KeyAction.Press && event.button == GLFW_MOUSE_BUTTON_LEFT) { bypass(event.entity, event);
if (mc.crosshairTarget instanceof EntityHitResult result) {
bypass(result.getEntity(), event);
}
}
} }
private boolean isBlocked(Vec3d pos, LivingEntity target) { private boolean isBlocked(Vec3d pos, LivingEntity target) {
Vec3d vec3d3 = pos.relativize(target.getPos()).normalize(); Vec3d vec3d3 = pos.relativize(new Vec3d(target.getX(), target.getY(), target.getZ())).normalize();
return new Vec3d(vec3d3.x, 0.0d, vec3d3.z).dotProduct(target.getRotationVec(1.0f)) >= 0.0d; return new Vec3d(vec3d3.x, 0.0d, vec3d3.z).dotProduct(target.getRotationVec(1.0f)) >= 0.0d;
} }
@@ -57,10 +50,10 @@ public class ShieldBypass extends Module {
if (ignoreAxe.get() && InvUtils.testInMainHand(i -> i.getItem() instanceof AxeItem)) return; if (ignoreAxe.get() && InvUtils.testInMainHand(i -> i.getItem() instanceof AxeItem)) return;
// Shield check // Shield check
if (isBlocked(mc.player.getPos(), e)) return; if (isBlocked(new Vec3d(mc.player.getX(), mc.player.getY(), mc.player.getZ()), e)) return;
Vec3d offset = Vec3d.fromPolar(0, mc.player.getYaw()).normalize().multiply(2); Vec3d offset = Vec3d.fromPolar(0, mc.player.getYaw()).normalize().multiply(2);
Vec3d newPos = e.getPos().add(offset); Vec3d newPos = new Vec3d(e.getX(), e.getY(), e.getZ()).add(offset);
// Move up to prevent tping into blocks // Move up to prevent tping into blocks
boolean inside = false; boolean inside = false;
@@ -81,13 +74,13 @@ public class ShieldBypass extends Module {
event.cancel(); event.cancel();
mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(newPos.getX(), newPos.getY(), newPos.getZ(), true)); mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(newPos.getX(), newPos.getY(), newPos.getZ(), true, false));
mc.getNetworkHandler().sendPacket(PlayerInteractEntityC2SPacket.attack(e, mc.player.isSneaking())); mc.getNetworkHandler().sendPacket(PlayerInteractEntityC2SPacket.attack(e, mc.player.isSneaking()));
mc.getNetworkHandler().sendPacket(new HandSwingC2SPacket(mc.player.getActiveHand())); mc.getNetworkHandler().sendPacket(new HandSwingC2SPacket(mc.player.getActiveHand()));
mc.player.resetLastAttackedTicks(); mc.player.resetLastAttackedTicks();
mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY(), mc.player.getZ(), true)); mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY(), mc.player.getZ(), true, mc.player.horizontalCollision));
} }
} }
} }

View File

@@ -17,12 +17,14 @@ import meteordevelopment.meteorclient.utils.render.color.Color;
import meteordevelopment.meteorclient.utils.render.color.SettingColor; import meteordevelopment.meteorclient.utils.render.color.SettingColor;
import meteordevelopment.orbit.EventHandler; import meteordevelopment.orbit.EventHandler;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gl.ShaderProgram;
import net.minecraft.client.model.ModelPart; import net.minecraft.client.model.ModelPart;
import net.minecraft.client.option.Perspective; import net.minecraft.client.option.Perspective;
import net.minecraft.client.render.*; import net.minecraft.client.render.*;
import net.minecraft.client.render.entity.LivingEntityRenderer; import net.minecraft.client.render.entity.LivingEntityRenderer;
import net.minecraft.client.render.entity.PlayerEntityRenderer; import net.minecraft.client.render.entity.PlayerEntityRenderer;
import net.minecraft.client.render.entity.model.PlayerEntityModel; import net.minecraft.client.render.entity.model.PlayerEntityModel;
import net.minecraft.client.render.entity.state.PlayerEntityRenderState;
import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
@@ -61,7 +63,7 @@ public class SkeletonESP extends Module {
MatrixStack matrixStack = event.matrices; MatrixStack matrixStack = event.matrices;
float g = event.tickDelta; float g = event.tickDelta;
RenderSystem.setShader(GameRenderer::getPositionColorProgram); RenderSystem.setShader(ShaderProgram::getPositionColorProgram);
RenderSystem.enableBlend(); RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc(); RenderSystem.defaultBlendFunc();
RenderSystem.disableDepthTest(); RenderSystem.disableDepthTest();
@@ -79,8 +81,8 @@ public class SkeletonESP extends Module {
PlayerEntity playerEntity = (PlayerEntity) entity; PlayerEntity playerEntity = (PlayerEntity) entity;
Vec3d footPos = getEntityRenderPosition(playerEntity, g); Vec3d footPos = getEntityRenderPosition(playerEntity, g);
PlayerEntityRenderer livingEntityRenderer = (PlayerEntityRenderer) (LivingEntityRenderer<?, ?>) mc.getEntityRenderDispatcher().getRenderer(playerEntity); PlayerEntityRenderer livingEntityRenderer = (PlayerEntityRenderer) (LivingEntityRenderer<?, ?, ?>) mc.getEntityRenderDispatcher().getRenderer(playerEntity);
PlayerEntityModel<PlayerEntity> playerEntityModel = (PlayerEntityModel) livingEntityRenderer.getModel(); PlayerEntityModel playerEntityModel = livingEntityRenderer.getModel();
float h = MathHelper.lerpAngleDegrees(g, playerEntity.prevBodyYaw, playerEntity.bodyYaw); float h = MathHelper.lerpAngleDegrees(g, playerEntity.prevBodyYaw, playerEntity.bodyYaw);
if (mc.player == entity && Rotations.rotationTimer < rotationHoldTicks) h = Rotations.serverYaw; if (mc.player == entity && Rotations.rotationTimer < rotationHoldTicks) h = Rotations.serverYaw;
@@ -94,12 +96,17 @@ public class SkeletonESP extends Module {
float m = playerEntity.getPitch(g); float m = playerEntity.getPitch(g);
if (mc.player == entity && Rotations.rotationTimer < rotationHoldTicks) m = Rotations.serverPitch; if (mc.player == entity && Rotations.rotationTimer < rotationHoldTicks) m = Rotations.serverPitch;
playerEntityModel.animateModel(playerEntity, q, p, g); PlayerEntityRenderState renderState = new PlayerEntityRenderState();
playerEntityModel.setAngles(playerEntity, q, p, o, k, m); renderState.limbFrequency = q;
renderState.limbAmplitudeMultiplier = p;
renderState.age = o;
renderState.yawDegrees = k;
renderState.pitch = m;
playerEntityModel.setAngles(renderState);
boolean swimming = playerEntity.isInSwimmingPose(); boolean swimming = playerEntity.isInSwimmingPose();
boolean sneaking = playerEntity.isSneaking(); boolean sneaking = playerEntity.isSneaking();
boolean flying = playerEntity.isFallFlying(); boolean flying = playerEntity.isGliding();
ModelPart head = playerEntityModel.head; ModelPart head = playerEntityModel.head;
ModelPart leftArm = playerEntityModel.leftArm; ModelPart leftArm = playerEntityModel.leftArm;
@@ -115,26 +122,26 @@ public class SkeletonESP extends Module {
matrixStack.multiply(new Quaternionf().setAngleAxis((90 + m) * Math.PI / 180F, -1, 0, 0)); matrixStack.multiply(new Quaternionf().setAngleAxis((90 + m) * Math.PI / 180F, -1, 0, 0));
if (swimming) matrixStack.translate(0, -0.95f, 0); if (swimming) matrixStack.translate(0, -0.95f, 0);
BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer(); Tessellator tessellator = Tessellator.getInstance();
bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION_COLOR); BufferBuilder bufferBuilder = tessellator.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION_COLOR);
Matrix4f matrix4f = matrixStack.peek().getPositionMatrix(); Matrix4f matrix4f = matrixStack.peek().getPositionMatrix();
bufferBuilder.vertex(matrix4f, 0, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next(); bufferBuilder.vertex(matrix4f, 0, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a);
bufferBuilder.vertex(matrix4f, 0, sneaking ? 1.05f : 1.4f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();//spine bufferBuilder.vertex(matrix4f, 0, sneaking ? 1.05f : 1.4f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a);//spine
bufferBuilder.vertex(matrix4f, -0.37f, sneaking ? 1.05f : 1.35f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();//shoulders bufferBuilder.vertex(matrix4f, -0.37f, sneaking ? 1.05f : 1.35f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a);//shoulders
bufferBuilder.vertex(matrix4f, 0.37f, sneaking ? 1.05f : 1.35f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next(); bufferBuilder.vertex(matrix4f, 0.37f, sneaking ? 1.05f : 1.35f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a);
bufferBuilder.vertex(matrix4f, -0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();//pelvis bufferBuilder.vertex(matrix4f, -0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a);//pelvis
bufferBuilder.vertex(matrix4f, 0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next(); bufferBuilder.vertex(matrix4f, 0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a);
// Head // Head
matrixStack.push(); matrixStack.push();
matrixStack.translate(0, sneaking ? 1.05f : 1.4f, 0); matrixStack.translate(0, sneaking ? 1.05f : 1.4f, 0);
rotate(matrixStack, head); rotate(matrixStack, head);
matrix4f = matrixStack.peek().getPositionMatrix(); matrix4f = matrixStack.peek().getPositionMatrix();
bufferBuilder.vertex(matrix4f, 0, 0, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next(); bufferBuilder.vertex(matrix4f, 0, 0, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a);
bufferBuilder.vertex(matrix4f, 0, 0.15f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next(); bufferBuilder.vertex(matrix4f, 0, 0.15f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a);
matrixStack.pop(); matrixStack.pop();
// Right Leg // Right Leg
@@ -142,8 +149,8 @@ public class SkeletonESP extends Module {
matrixStack.translate(0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0); matrixStack.translate(0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0);
rotate(matrixStack, rightLeg); rotate(matrixStack, rightLeg);
matrix4f = matrixStack.peek().getPositionMatrix(); matrix4f = matrixStack.peek().getPositionMatrix();
bufferBuilder.vertex(matrix4f, 0, 0, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next(); bufferBuilder.vertex(matrix4f, 0, 0, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a);
bufferBuilder.vertex(matrix4f, 0, -0.6f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next(); bufferBuilder.vertex(matrix4f, 0, -0.6f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a);
matrixStack.pop(); matrixStack.pop();
// Left Leg // Left Leg
@@ -151,8 +158,8 @@ public class SkeletonESP extends Module {
matrixStack.translate(-0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0); matrixStack.translate(-0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0);
rotate(matrixStack, leftLeg); rotate(matrixStack, leftLeg);
matrix4f = matrixStack.peek().getPositionMatrix(); matrix4f = matrixStack.peek().getPositionMatrix();
bufferBuilder.vertex(matrix4f, 0, 0, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next(); bufferBuilder.vertex(matrix4f, 0, 0, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a);
bufferBuilder.vertex(matrix4f, 0, -0.6f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next(); bufferBuilder.vertex(matrix4f, 0, -0.6f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a);
matrixStack.pop(); matrixStack.pop();
// Right Arm // Right Arm
@@ -160,8 +167,8 @@ public class SkeletonESP extends Module {
matrixStack.translate(0.37f, sneaking ? 1.05f : 1.35f, 0); matrixStack.translate(0.37f, sneaking ? 1.05f : 1.35f, 0);
rotate(matrixStack, rightArm); rotate(matrixStack, rightArm);
matrix4f = matrixStack.peek().getPositionMatrix(); matrix4f = matrixStack.peek().getPositionMatrix();
bufferBuilder.vertex(matrix4f, 0, 0, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next(); bufferBuilder.vertex(matrix4f, 0, 0, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a);
bufferBuilder.vertex(matrix4f, 0, -0.55f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next(); bufferBuilder.vertex(matrix4f, 0, -0.55f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a);
matrixStack.pop(); matrixStack.pop();
// Left Arm // Left Arm
@@ -169,11 +176,11 @@ public class SkeletonESP extends Module {
matrixStack.translate(-0.37f, sneaking ? 1.05f : 1.35f, 0); matrixStack.translate(-0.37f, sneaking ? 1.05f : 1.35f, 0);
rotate(matrixStack, leftArm); rotate(matrixStack, leftArm);
matrix4f = matrixStack.peek().getPositionMatrix(); matrix4f = matrixStack.peek().getPositionMatrix();
bufferBuilder.vertex(matrix4f, 0, 0, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next(); bufferBuilder.vertex(matrix4f, 0, 0, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a);
bufferBuilder.vertex(matrix4f, 0, -0.55f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next(); bufferBuilder.vertex(matrix4f, 0, -0.55f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a);
matrixStack.pop(); matrixStack.pop();
bufferBuilder.clear(); tessellator.clear();
BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); BufferRenderer.drawWithGlobalProgram(bufferBuilder.end());
if (swimming) matrixStack.translate(0, 0.95f, 0); if (swimming) matrixStack.translate(0, 0.95f, 0);
@@ -189,7 +196,7 @@ public class SkeletonESP extends Module {
RenderSystem.disableBlend(); RenderSystem.disableBlend();
RenderSystem.enableDepthTest(); RenderSystem.enableDepthTest();
RenderSystem.depthMask(true); RenderSystem.depthMask(true);
RenderSystem.setShader(GameRenderer::getPositionColorProgram); RenderSystem.setShader(ShaderProgram::getPositionColorProgram);
} }
private void rotate(MatrixStack matrix, ModelPart modelPart) { private void rotate(MatrixStack matrix, ModelPart modelPart) {

View File

@@ -114,7 +114,7 @@ public class SoundLocator extends Module {
if(whitelist.get()) { if(whitelist.get()) {
// Whitelist ON // Whitelist ON
for (SoundEvent sound : sounds.get()) { for (SoundEvent sound : sounds.get()) {
if (sound.getId().equals(event.sound.getId())) { if (sound.id().equals(event.sound.getId())) {
printSound(event.sound); printSound(event.sound);
break; break;
} }

View File

@@ -1,6 +1,7 @@
package anticope.rejects.modules; package anticope.rejects.modules;
import anticope.rejects.MeteorRejectsAddon; import anticope.rejects.MeteorRejectsAddon;
import anticope.rejects.utils.WorldUtils;
import meteordevelopment.meteorclient.events.world.TickEvent; import meteordevelopment.meteorclient.events.world.TickEvent;
import meteordevelopment.meteorclient.settings.*; import meteordevelopment.meteorclient.settings.*;
import meteordevelopment.meteorclient.systems.modules.Module; import meteordevelopment.meteorclient.systems.modules.Module;
@@ -139,22 +140,9 @@ public class TreeAura extends Module {
return false; return false;
} }
private List<BlockPos> getBlocks(BlockPos centerPos, int radius, int height) {
ArrayList<BlockPos> blocks = new ArrayList<>();
for (int i = centerPos.getX() - radius; i < centerPos.getX() + radius; i++) {
for (int j = centerPos.getY() - height; j < centerPos.getY() + height; j++) {
for (int k = centerPos.getZ() - radius; k < centerPos.getZ() + radius; k++) {
BlockPos pos = new BlockPos(i, j, k);
if (distanceBetween(centerPos, pos) <= radius && !blocks.contains(pos)) blocks.add(pos);
}
}
}
return blocks;
}
private List<BlockPos> findSaplings(BlockPos centerPos, int radius, int height) { private List<BlockPos> findSaplings(BlockPos centerPos, int radius, int height) {
ArrayList<BlockPos> blocc = new ArrayList<>(); ArrayList<BlockPos> blocc = new ArrayList<>();
List<BlockPos> blocks = getBlocks(centerPos, radius, height); List<BlockPos> blocks = WorldUtils.getSphere(centerPos, radius, height);
for (BlockPos b : blocks) if (isSapling(b)) blocc.add(b); for (BlockPos b : blocks) if (isSapling(b)) blocc.add(b);
return blocc; return blocc;
} }
@@ -169,7 +157,7 @@ public class TreeAura extends Module {
private List<BlockPos> getPlantLocations(BlockPos centerPos, int radius, int height) { private List<BlockPos> getPlantLocations(BlockPos centerPos, int radius, int height) {
ArrayList<BlockPos> blocc = new ArrayList<>(); ArrayList<BlockPos> blocc = new ArrayList<>();
List<BlockPos> blocks = getBlocks(centerPos, radius, height); List<BlockPos> blocks = WorldUtils.getSphere(centerPos, radius, height);
for (BlockPos b : blocks) if (canPlant(b)) blocc.add(b); for (BlockPos b : blocks) if (canPlant(b)) blocc.add(b);
return blocc; return blocc;
} }

View File

@@ -22,7 +22,7 @@ public class GameModeListSetting extends Setting<List<GameMode>> {
String[] values = str.split(","); String[] values = str.split(",");
List<GameMode> modes = new ArrayList<>(values.length); List<GameMode> modes = new ArrayList<>(values.length);
for (String s : values) { for (String s : values) {
GameMode mode = GameMode.byName(s); GameMode mode = GameMode.byId(s);
if (mode != null) modes.add(mode); if (mode != null) modes.add(mode);
} }
return modes; return modes;
@@ -42,7 +42,7 @@ public class GameModeListSetting extends Setting<List<GameMode>> {
public NbtCompound save(NbtCompound tag) { public NbtCompound save(NbtCompound tag) {
NbtList valueTag = new NbtList(); NbtList valueTag = new NbtList();
for (GameMode mode : get()) { for (GameMode mode : get()) {
valueTag.add(NbtString.of(mode.getName())); valueTag.add(NbtString.of(mode.name()));
} }
tag.put("value", valueTag); tag.put("value", valueTag);
@@ -53,9 +53,9 @@ public class GameModeListSetting extends Setting<List<GameMode>> {
public List<GameMode> load(NbtCompound tag) { public List<GameMode> load(NbtCompound tag) {
get().clear(); get().clear();
NbtList valueTag = tag.getList("value", 8); NbtList valueTag = tag.getList("value").orElse(new NbtList());
for (NbtElement tagI : valueTag) { for (NbtElement tagI : valueTag) {
GameMode mode = GameMode.byName(tagI.asString()); GameMode mode = GameMode.byId(tagI.asString().orElse(""));
if (mode != null) if (mode != null)
get().add(mode); get().add(mode);
} }

View File

@@ -23,7 +23,7 @@ public class GameModeListSettingScreen extends WindowScreen {
public void initWidgets() { public void initWidgets() {
List<GameMode> gms = setting.get(); List<GameMode> gms = setting.get();
for (GameMode gameMode : GameMode.values()) { for (GameMode gameMode : GameMode.values()) {
table.add(theme.label(Utils.nameToTitle(gameMode.getName()))).expandCellX(); table.add(theme.label(Utils.nameToTitle(gameMode.name()))).expandCellX();
boolean contains = setting.get().contains(gameMode); boolean contains = setting.get().contains(gameMode);
WCheckbox checkbox = table.add(theme.checkbox(contains)).widget(); WCheckbox checkbox = table.add(theme.checkbox(contains)).widget();

View File

@@ -72,9 +72,9 @@ public class StringMapSetting extends Setting<Map<String, String>> {
protected Map<String, String> load(NbtCompound tag) { protected Map<String, String> load(NbtCompound tag) {
get().clear(); get().clear();
NbtCompound valueTag = tag.getCompound("map"); NbtCompound valueTag = tag.getCompound("map").orElse(new NbtCompound());
for (String key : valueTag.getKeys()) { for (String key : valueTag.getKeys()) {
get().put(key, valueTag.getString(key)); get().put(key, valueTag.getString(key).orElse(""));
} }
return get(); return get();

View File

@@ -5,6 +5,7 @@ import it.unimi.dsi.fastutil.ints.IntList;
import net.minecraft.component.ComponentChanges; import net.minecraft.component.ComponentChanges;
import net.minecraft.component.DataComponentTypes; import net.minecraft.component.DataComponentTypes;
import net.minecraft.component.type.*; import net.minecraft.component.type.*;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.Enchantments; import net.minecraft.enchantment.Enchantments;
import net.minecraft.entity.effect.StatusEffect; import net.minecraft.entity.effect.StatusEffect;
import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffectInstance;
@@ -15,6 +16,8 @@ import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtList; import net.minecraft.nbt.NbtList;
import net.minecraft.nbt.StringNbtReader; import net.minecraft.nbt.StringNbtReader;
import net.minecraft.registry.Registries; import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
@@ -25,7 +28,7 @@ import java.util.function.Function;
import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
import org.apache.commons.lang3.text.WordUtils; import org.apache.commons.text.WordUtils;
import org.apache.commons.lang3.tuple.Triple; import org.apache.commons.lang3.tuple.Triple;
import static meteordevelopment.meteorclient.MeteorClient.mc; import static meteordevelopment.meteorclient.MeteorClient.mc;
@@ -38,13 +41,13 @@ public class GiveUtils {
private final static SimpleCommandExceptionType NO_SPACE = new SimpleCommandExceptionType(Text.literal("No space in hotbar.")); private final static SimpleCommandExceptionType NO_SPACE = new SimpleCommandExceptionType(Text.literal("No space in hotbar."));
private static final List<Identifier> HIDDEN_ENTITIES = Arrays.asList( private static final List<Identifier> HIDDEN_ENTITIES = Arrays.asList(
new Identifier("giant"), Identifier.of("giant"),
new Identifier("ender_dragon"), Identifier.of("ender_dragon"),
new Identifier("wither"), Identifier.of("wither"),
new Identifier("iron_golem"), Identifier.of("iron_golem"),
new Identifier("ender_dragon"), Identifier.of("ender_dragon"),
new Identifier("tnt_minecart"), Identifier.of("tnt_minecart"),
new Identifier("lightning_bolt")); Identifier.of("lightning_bolt"));
// Some ported from: https://github.com/BleachDrinker420/BleachHack/blob/master/BleachHack-Fabric-1.16/src/main/java/bleach/hack/command/commands/CmdGive.java // Some ported from: https://github.com/BleachDrinker420/BleachHack/blob/master/BleachHack-Fabric-1.16/src/main/java/bleach/hack/command/commands/CmdGive.java
private static final List<Triple<String, Item, String>> ENTITY_PRESETS = Arrays.asList( private static final List<Triple<String, Item, String>> ENTITY_PRESETS = Arrays.asList(
@@ -65,9 +68,20 @@ public class GiveUtils {
); );
private static final Random random = new Random(); private static final Random random = new Random();
private static Registry<Enchantment> enchantmentRegistry;
private static NbtCompound parseNbtString(String nbtString) {
try {
return StringNbtReader.readCompound(nbtString);
} catch (CommandSyntaxException e) {
return new NbtCompound();
}
}
public static void giveItem(ItemStack item) throws CommandSyntaxException { public static void giveItem(ItemStack item) throws CommandSyntaxException {
if (!mc.player.getAbilities().creativeMode) throw NOT_IN_CREATIVE.create(); if (mc.player == null || !mc.player.getAbilities().creativeMode) {
throw NOT_IN_CREATIVE.create();
}
if (!mc.player.getInventory().insertStack(item)) { if (!mc.player.getInventory().insertStack(item)) {
throw NO_SPACE.create(); throw NO_SPACE.create();
@@ -75,78 +89,88 @@ public class GiveUtils {
} }
static { static {
ENTITY_PRESETS.forEach((preset) -> { ENTITY_PRESETS.forEach((preset) -> PRESETS.put(preset.getLeft(), (preview) -> {
PRESETS.put(preset.getLeft(), (preview) -> { if (preview) return preset.getMiddle().getDefaultStack();
if (preview) preset.getMiddle().getDefaultStack();
ItemStack item = preset.getMiddle().getDefaultStack(); ItemStack item = preset.getMiddle().getDefaultStack();
try {
item.set(DataComponentTypes.ENTITY_DATA, NbtComponent.of(StringNbtReader.parse(preset.getRight())));
} catch (CommandSyntaxException e) { }
item.set(DataComponentTypes.CUSTOM_NAME, Text.literal(toName(preset.getLeft())));
return item;
});
});
BLOCK_PRESETS.forEach((preset) -> { var changes = ComponentChanges.builder()
PRESETS.put(preset.getLeft(), (preview) -> { .add(DataComponentTypes.CUSTOM_DATA, NbtComponent.of(parseNbtString(preset.getRight())))
if (preview) preset.getMiddle().getDefaultStack(); .add(DataComponentTypes.CUSTOM_NAME, Text.literal(toName(preset.getLeft())))
ItemStack item = preset.getMiddle().getDefaultStack(); .build();
try { item.applyChanges(changes);
item.set(DataComponentTypes.BLOCK_ENTITY_DATA, NbtComponent.of(StringNbtReader.parse(preset.getRight())));
} catch (CommandSyntaxException e) { }
item.set(DataComponentTypes.CUSTOM_NAME, Text.literal(toName(preset.getLeft())));
return item; return item;
}); }));
});
BLOCK_PRESETS.forEach((preset) -> PRESETS.put(preset.getLeft(), (preview) -> {
if (preview) return preset.getMiddle().getDefaultStack();
ItemStack item = preset.getMiddle().getDefaultStack();
var changes = ComponentChanges.builder()
.add(DataComponentTypes.CUSTOM_DATA, NbtComponent.of(parseNbtString(preset.getRight())))
.add(DataComponentTypes.CUSTOM_NAME, Text.literal(toName(preset.getLeft())))
.build();
item.applyChanges(changes);
return item;
}));
// TODO update // TODO update
PRESETS.put("force_op", (preview) -> { PRESETS.put("force_op", (preview) -> {
if (preview) Items.SPIDER_SPAWN_EGG.getDefaultStack(); if (preview) return Items.SPIDER_SPAWN_EGG.getDefaultStack();
if (mc.player == null) return Items.SPIDER_SPAWN_EGG.getDefaultStack();
ItemStack item = Items.SPIDER_SPAWN_EGG.getDefaultStack(); ItemStack item = Items.SPIDER_SPAWN_EGG.getDefaultStack();
String nick = mc.player.getName().getString(); String nick = mc.player.getName().getString();
try { var changes = ComponentChanges.builder()
item.set(DataComponentTypes.ENTITY_DATA, NbtComponent.of(StringNbtReader.parse("{Time:1,BlockState:{Name:\"minecraft:spawner\"},id:\"minecraft:falling_block\",TileEntityData:{SpawnCount:20,SpawnData:{id:\"minecraft:villager\",Passengers:[{Time:1,BlockState:{Name:\"minecraft:redstone_block\"},id:\"minecraft:falling_block\",Passengers:[{id:\"minecraft:fox\",Passengers:[{Time:1,BlockState:{Name:\"minecraft:activator_rail\"},id:\"minecraft:falling_block\",Passengers:[{Command:\"execute as @e run op "+nick+"\",id:\"minecraft:command_block_minecart\"}]}],NoAI:1b,Health:1.0f,ActiveEffects:[{Duration:1000,Id:20b,Amplifier:4b}]}]}],NoAI:1b,Health:1.0f,ActiveEffects:[{Duration:1000,Id:20b,Amplifier:4b}]},MaxSpawnDelay:100,SpawnRange:10,Delay:1,MinSpawnDelay:100}}"))); .add(DataComponentTypes.CUSTOM_DATA, NbtComponent.of(parseNbtString("{Time:1,BlockState:{Name:\"minecraft:spawner\"},id:\"minecraft:falling_block\",TileEntityData:{SpawnCount:20,SpawnData:{id:\"minecraft:villager\",Passengers:[{Time:1,BlockState:{Name:\"minecraft:redstone_block\"},id:\"minecraft:falling_block\",Passengers:[{id:\"minecraft:fox\",Passengers:[{Time:1,BlockState:{Name:\"minecraft:activator_rail\"},id:\"minecraft:falling_block\",Passengers:[{Command:\"execute as @e run op "+nick+"\",id:\"minecraft:command_block_minecart\"}]}],NoAI:1b,Health:1.0f,ActiveEffects:[{Duration:1000,Id:20b,Amplifier:4b}]}]}],NoAI:1b,Health:1.0f,ActiveEffects:[{Duration:1000,Id:20b,Amplifier:4b}]},MaxSpawnDelay:100,SpawnRange:10,Delay:1,MinSpawnDelay:100}}")))
} catch (CommandSyntaxException e) { } .add(DataComponentTypes.CUSTOM_NAME, Text.of("Force OP"))
item.set(DataComponentTypes.CUSTOM_NAME, Text.of("Force OP")); .build();
item.applyChanges(changes);
return item; return item;
}); });
// Thanks wurst ! // Thanks wurst !
PRESETS.put("troll_potion", (preview) -> { PRESETS.put("troll_potion", (preview) -> {
if (preview) Items.LINGERING_POTION.getDefaultStack(); if (preview) return Items.LINGERING_POTION.getDefaultStack();
ItemStack stack = Items.LINGERING_POTION.getDefaultStack(); ItemStack stack = Items.LINGERING_POTION.getDefaultStack();
ArrayList<StatusEffectInstance> effects = new ArrayList<>(); ArrayList<StatusEffectInstance> effects = new ArrayList<>();
for(int i = 1; i <= 31; i++) for(int i = 1; i <= 31; i++)
{ {
StatusEffect effect = Optional<RegistryEntry.Reference<StatusEffect>> effectOpt = Registries.STATUS_EFFECT.getEntry(i);
Registries.STATUS_EFFECT.getEntry(i).get().value(); if (effectOpt.isPresent()) {
RegistryEntry<StatusEffect> entry = StatusEffect effect = effectOpt.get().value();
Registries.STATUS_EFFECT.getEntry(effect); RegistryEntry<StatusEffect> entry = Registries.STATUS_EFFECT.getEntry(effect);
effects.add(new StatusEffectInstance(entry, Integer.MAX_VALUE, effects.add(new StatusEffectInstance(entry, Integer.MAX_VALUE, Integer.MAX_VALUE));
Integer.MAX_VALUE)); }
} }
stack.set(DataComponentTypes.POTION_CONTENTS, new PotionContentsComponent(Optional.empty(), Optional.empty(), stack.set(DataComponentTypes.POTION_CONTENTS, new PotionContentsComponent(Optional.empty(), Optional.empty(),
effects)); effects, Optional.empty()));
stack.set(DataComponentTypes.CUSTOM_NAME, Text.literal("Lingering Potion of Trolling")); stack.set(DataComponentTypes.CUSTOM_NAME, Text.literal("Lingering Potion of Trolling"));
return stack; return stack;
}); });
PRESETS.put("32k", (preview) -> { PRESETS.put("32k", (preview) -> {
if (preview) return Items.DIAMOND_SWORD.getDefaultStack(); if (mc.world != null) {
enchantmentRegistry = mc.world.getRegistryManager().getOrThrow(RegistryKeys.ENCHANTMENT);
}
if (preview || enchantmentRegistry == null) return Items.DIAMOND_SWORD.getDefaultStack();
ItemStack stack = Items.DIAMOND_SWORD.getDefaultStack(); ItemStack stack = Items.DIAMOND_SWORD.getDefaultStack();
stack.apply(DataComponentTypes.ENCHANTMENTS, ItemEnchantmentsComponent.DEFAULT, component -> { stack.apply(DataComponentTypes.ENCHANTMENTS, ItemEnchantmentsComponent.DEFAULT, component -> {
ItemEnchantmentsComponent.Builder builder = new ItemEnchantmentsComponent.Builder(component); ItemEnchantmentsComponent.Builder builder = new ItemEnchantmentsComponent.Builder(component);
builder.add(Enchantments.SHARPNESS, 255); builder.add(enchantmentRegistry.getOrThrow(Enchantments.SHARPNESS), 255);
builder.add(Enchantments.KNOCKBACK, 255); builder.add(enchantmentRegistry.getOrThrow(Enchantments.KNOCKBACK), 255);
builder.add(Enchantments.FIRE_ASPECT, 255); builder.add(enchantmentRegistry.getOrThrow(Enchantments.FIRE_ASPECT), 255);
builder.add(Enchantments.LOOTING, 10); builder.add(enchantmentRegistry.getOrThrow(Enchantments.LOOTING), 10);
builder.add(Enchantments.SWEEPING_EDGE, 3); builder.add(enchantmentRegistry.getOrThrow(Enchantments.SWEEPING_EDGE), 3);
builder.add(Enchantments.UNBREAKING, 255); builder.add(enchantmentRegistry.getOrThrow(Enchantments.UNBREAKING), 255);
builder.add(Enchantments.MENDING, 1); builder.add(enchantmentRegistry.getOrThrow(Enchantments.MENDING), 1);
builder.add(Enchantments.VANISHING_CURSE, 1); builder.add(enchantmentRegistry.getOrThrow(Enchantments.VANISHING_CURSE), 1);
return builder.build(); return builder.build();
}); });
@@ -185,8 +209,7 @@ public class GiveUtils {
return firework; return firework;
}); });
HIDDEN_ENTITIES.forEach((id) -> { HIDDEN_ENTITIES.forEach((id) -> PRESETS.put(id.getPath()+"_spawn_egg", (preview) -> {
PRESETS.put(id.getPath()+"_spawn_egg", (preview) -> {
if (preview) return Items.PIG_SPAWN_EGG.getDefaultStack(); if (preview) return Items.PIG_SPAWN_EGG.getDefaultStack();
ItemStack egg = Items.PIG_SPAWN_EGG.getDefaultStack(); ItemStack egg = Items.PIG_SPAWN_EGG.getDefaultStack();
@@ -195,13 +218,12 @@ public class GiveUtils {
var changes = ComponentChanges.builder() var changes = ComponentChanges.builder()
.add(DataComponentTypes.CUSTOM_NAME, Text.literal(String.format("%s", toName(id.getPath())))) .add(DataComponentTypes.CUSTOM_NAME, Text.literal(String.format("%s", toName(id.getPath()))))
.add(DataComponentTypes.ENTITY_DATA, NbtComponent.of(entityTag)) .add(DataComponentTypes.CUSTOM_DATA, NbtComponent.of(entityTag))
.build(); .build();
egg.applyChanges(changes); egg.applyChanges(changes);
return egg; return egg;
}); }));
});
} }
public static ItemStack getPreset(String name, boolean preview) { public static ItemStack getPreset(String name, boolean preview) {

View File

@@ -48,8 +48,8 @@ public class Ore {
public static Map<RegistryKey<Biome>, List<Ore>> getRegistry(Dimension dimension) { public static Map<RegistryKey<Biome>, List<Ore>> getRegistry(Dimension dimension) {
RegistryWrapper.WrapperLookup registry = BuiltinRegistries.createWrapperLookup(); RegistryWrapper.WrapperLookup registry = BuiltinRegistries.createWrapperLookup();
RegistryWrapper.Impl<PlacedFeature> features = registry.getWrapperOrThrow(RegistryKeys.PLACED_FEATURE); RegistryWrapper.Impl<PlacedFeature> features = registry.getOrThrow(RegistryKeys.PLACED_FEATURE);
var reg = registry.getWrapperOrThrow(RegistryKeys.WORLD_PRESET).getOrThrow(WorldPresets.DEFAULT).value().createDimensionsRegistryHolder().dimensions(); var reg = registry.getOrThrow(RegistryKeys.WORLD_PRESET).getOrThrow(WorldPresets.DEFAULT).value().createDimensionsRegistryHolder().dimensions();
var dim = switch (dimension) { var dim = switch (dimension) {
case Overworld -> reg.get(DimensionOptions.OVERWORLD); case Overworld -> reg.get(DimensionOptions.OVERWORLD);

View File

@@ -80,15 +80,21 @@ public class RejectsConfig extends System<RejectsConfig> {
@Override @Override
public RejectsConfig fromTag(NbtCompound tag) { public RejectsConfig fromTag(NbtCompound tag) {
httpAllowed = HttpAllowed.valueOf(tag.getString("httpAllowed")); tag.getString("httpAllowed").ifPresent(s -> {
httpUserAgent = tag.getString("httpUserAgent"); try {
loadSystemFonts = tag.getBoolean("loadSystemFonts"); httpAllowed = HttpAllowed.valueOf(s);
duplicateModuleNames = tag.getBoolean("duplicateModuleNames"); } catch (IllegalArgumentException ignored) {}
});
NbtList valueTag = tag.getList("hiddenModules", 8); httpUserAgent = tag.getString("httpUserAgent").orElse("Meteor Client");
loadSystemFonts = tag.getBoolean("loadSystemFonts").orElse(true);
duplicateModuleNames = tag.getBoolean("duplicateModuleNames").orElse(false);
tag.getList("hiddenModules").ifPresent(valueTag -> {
for (NbtElement tagI : valueTag) { for (NbtElement tagI : valueTag) {
hiddenModules.add(tagI.asString()); tagI.asString().ifPresent(hiddenModules::add);
} }
});
return this; return this;
} }

Some files were not shown because too many files have changed in this diff Show More