├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
└── workflows
│ └── build.yml
├── .gitignore
├── COPYING.md
├── README.md
├── build.gradle
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── settings.gradle
└── src
└── main
├── java
└── dev
│ └── tensor
│ ├── Tensor.java
│ ├── backend
│ ├── MixinPriority.java
│ ├── events
│ │ ├── BlockInteractEvent.java
│ │ ├── ClientRenderEvent.java
│ │ ├── ClientTickEvent.java
│ │ ├── DisconnectEvent.java
│ │ ├── KeyPressedEvent.java
│ │ ├── PacketEvent.java
│ │ └── PlaySoundEvent.java
│ └── mixins
│ │ ├── AbstractClientPlayerEntityMixin.java
│ │ ├── AdvancementToastMixin.java
│ │ ├── ArmorFeatureRendererMixin.java
│ │ ├── BackgroundRendererMixin.java
│ │ ├── BlockMixin.java
│ │ ├── BossBarHudMixin.java
│ │ ├── CameraMixin.java
│ │ ├── ChatScreenMixin.java
│ │ ├── ClientBrandRetrieverMixin.java
│ │ ├── ClientConnectionMixin.java
│ │ ├── ClientPlayerEntityMixin.java
│ │ ├── ClientPlayerInteractionManagerMixin.java
│ │ ├── CobWebBlockMixin.java
│ │ ├── CrashReportMixin.java
│ │ ├── DimensionTypeMixin.java
│ │ ├── EnchantingTableBlockEntityRendererMixin.java
│ │ ├── EntityMixin.java
│ │ ├── FluidBlockMixin.java
│ │ ├── FluidStateMixin.java
│ │ ├── GameRendererMixin.java
│ │ ├── HeldItemRendererMixin.java
│ │ ├── InGameHudMixin.java
│ │ ├── InGameOverlayRendererMixin.java
│ │ ├── KeyBindingMixin.java
│ │ ├── KeyboardInputMixin.java
│ │ ├── MinecraftClientMixin.java
│ │ ├── NarratorManagerMixin.java
│ │ ├── PlayerEntityMixin.java
│ │ ├── PlayerEntityRendererMixin.java
│ │ ├── PowderSnowBlockMixin.java
│ │ ├── RecipeToastMixin.java
│ │ ├── RenderTickCounterMixin.java
│ │ ├── ScreenMixin.java
│ │ ├── SlimeBlockMixin.java
│ │ ├── SoundManagerMixin.java
│ │ ├── SweetBerryBushBlockMixin.java
│ │ ├── WorldRendererMixin.java
│ │ └── accessors
│ │ ├── ChatHudAccessor.java
│ │ ├── ChatMessageC2SPacketAccessor.java
│ │ ├── ClientPlayerEntityAccessor.java
│ │ ├── CloseHandledScreenC2SAccessor.java
│ │ ├── EntityVelocityUpdateS2CPacketAccessor.java
│ │ ├── ExplosionS2CPacketAccessor.java
│ │ ├── KeyBindingAccessor.java
│ │ ├── MinecraftClientAccessor.java
│ │ └── PlayerMoveC2SPacketAccessor.java
│ ├── feature
│ ├── commands
│ │ ├── Bind.java
│ │ ├── Capes.java
│ │ ├── Clear.java
│ │ ├── Commands.java
│ │ ├── Config.java
│ │ ├── Drawn.java
│ │ ├── Friends.java
│ │ ├── Help.java
│ │ ├── Messages.java
│ │ ├── Modules.java
│ │ ├── Ping.java
│ │ ├── Plugins.java
│ │ ├── Prefix.java
│ │ ├── Profiles.java
│ │ ├── Reload.java
│ │ ├── Reset.java
│ │ ├── Set.java
│ │ ├── Spammer.java
│ │ ├── Toggle.java
│ │ └── VClip.java
│ ├── managers
│ │ ├── CapeManager.java
│ │ ├── CommandManager.java
│ │ ├── ConfigManager.java
│ │ ├── EventManager.java
│ │ ├── FriendManager.java
│ │ ├── GUIManager.java
│ │ ├── ModuleManager.java
│ │ ├── PluginManager.java
│ │ └── SettingManager.java
│ └── modules
│ │ ├── AntiNarrator.java
│ │ ├── AutoRespawn.java
│ │ ├── AutoTool.java
│ │ ├── AutoWalk.java
│ │ ├── CameraClip.java
│ │ ├── Capes.java
│ │ ├── ChatSuffix.java
│ │ ├── ClickGUI.java
│ │ ├── Commands.java
│ │ ├── Coordinates.java
│ │ ├── Criticals.java
│ │ ├── DeathDebug.java
│ │ ├── DebugReport.java
│ │ ├── Disconnect.java
│ │ ├── ElytraFlight.java
│ │ ├── FakePlayer.java
│ │ ├── Flight.java
│ │ ├── Freecam.java
│ │ ├── FullBright.java
│ │ ├── InventoryMove.java
│ │ ├── Jesus.java
│ │ ├── LiquidInteract.java
│ │ ├── MiddleClickFriend.java
│ │ ├── MiddleClickPearl.java
│ │ ├── NoBreakDelay.java
│ │ ├── NoFog.java
│ │ ├── NoGlitchBlock.java
│ │ ├── NoOverlay.java
│ │ ├── NoParticles.java
│ │ ├── NoPlaceDelay.java
│ │ ├── NoPortalEffect.java
│ │ ├── NoPush.java
│ │ ├── NoRender.java
│ │ ├── NoSlow.java
│ │ ├── NoViewBob.java
│ │ ├── NoWeather.java
│ │ ├── OnGround.java
│ │ ├── SafeWalk.java
│ │ ├── Sneak.java
│ │ ├── Spammer.java
│ │ ├── Sprint.java
│ │ ├── Timer.java
│ │ ├── UnfocusedCPU.java
│ │ ├── VanillaSpoof.java
│ │ ├── Velocity.java
│ │ ├── ViewModel.java
│ │ ├── VisualRange.java
│ │ ├── Watermark.java
│ │ └── XCarry.java
│ └── misc
│ ├── event
│ ├── EventHandler.java
│ ├── EventTarget.java
│ └── imp
│ │ ├── Cancellable.java
│ │ ├── Event.java
│ │ ├── EventCancellable.java
│ │ └── Priority.java
│ ├── freecam
│ ├── CameraEntity.java
│ └── DummyInput.java
│ ├── gui
│ ├── Element.java
│ ├── TensorChatGUI.java
│ ├── TensorGUI.java
│ └── elements
│ │ ├── CategoryElement.java
│ │ ├── ModuleElement.java
│ │ ├── PropertyElement.java
│ │ ├── SettingElement.java
│ │ └── settings
│ │ ├── BooleanElement.java
│ │ ├── ColorElement.java
│ │ ├── EnumElement.java
│ │ ├── ModulePropertyElement.java
│ │ └── NumberElement.java
│ ├── imp
│ ├── Category.java
│ ├── Command.java
│ ├── Global.java
│ ├── HUDComponent.java
│ ├── Manager.java
│ ├── Methods.java
│ ├── Module.java
│ ├── Profile.java
│ ├── Setting.java
│ └── settings
│ │ ├── BooleanSetting.java
│ │ ├── ColorSetting.java
│ │ ├── EnumSetting.java
│ │ └── NumberSetting.java
│ └── plugin
│ ├── Plugin.java
│ └── PluginEntryPoint.java
└── resources
├── fabric.mod.json
└── tensor.mixins.json
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report for a bug
4 | title: "[BUG]"
5 | labels: bug
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Client (please complete the following information):**
27 | - Fabric Version: [e.g. 0.11.3]
28 | - Tensor Version [e.g. 0.6.0]
29 | - Server [e.g. 2b2t.org]
30 | - Other Mods [e.g. Meteor]
31 |
32 | **Additional context**
33 | Add any other context about the problem here.
34 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest a feature for this project
4 | title: "[FEATURE]"
5 | labels: enhancement
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: build
2 | on: [ pull_request, push ]
3 |
4 | jobs:
5 | build:
6 | runs-on: ubuntu-20.04
7 | steps:
8 | - name: checkout repository
9 | uses: actions/checkout@v2
10 | - name: validate gradle wrapper
11 | uses: gradle/wrapper-validation-action@v1
12 | - name: setup jdk 16
13 | uses: actions/setup-java@v2
14 | with:
15 | distribution: adopt
16 | java-version: 16
17 | - name: cache gradle projects
18 | uses: actions/cache@v2
19 | with:
20 | path: |
21 | ~/.gradle/caches
22 | ~/.gradle/wrapper
23 | key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*','**/gradle-wrapper.properties') }}
24 | restore-keys: |
25 | ${{ runner.os }}-gradle-
26 | - name: make gradle wrapper executable
27 | run: chmod +x ./gradlew
28 | - name: build
29 | run: ./gradlew build
30 | - name: capture build artifacts
31 | uses: actions/upload-artifact@v2
32 | with:
33 | name: Artifacts
34 | path: |
35 | build/libs/*-SNAPSHOT.jar
36 | build/libs/*-RELEASE.jar
37 | build/libs/*-SNAPSHOT-dev.jar
38 | build/libs/*-RELEASE-dev.jar
39 | - name: cleanup gradle cache
40 | run: |
41 | rm -rf ~/.gradle/caches/modules-2/modules-2.lock
42 | rm -rf ~/.gradle/caches/modules-2/gc.properties
43 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.DS_Store
2 | .gradle/
3 | build/
4 | out/
5 | classes/
6 | *.launch
7 | .idea/
8 | *.iml
9 | *.ipr
10 | *.iws
11 | .settings/
12 | .vscode/
13 | bin/
14 | .classpath
15 | .project
16 | run/
17 |
--------------------------------------------------------------------------------
/COPYING.md:
--------------------------------------------------------------------------------
1 | # Tensor
2 |
3 | The MIT License (MIT)
4 |
5 | Copyright (c) 2021 IUDevman
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in all
15 | copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | SOFTWARE.
24 |
25 | # DarkMagician6 Event API
26 |
27 | The MIT License (MIT)
28 |
29 | Copyright (c) 2014 Kevin Driessen
30 |
31 | Permission is hereby granted, free of charge, to any person obtaining a copy
32 | of this software and associated documentation files (the "Software"), to deal
33 | in the Software without restriction, including without limitation the rights
34 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
35 | copies of the Software, and to permit persons to whom the Software is
36 | furnished to do so, subject to the following conditions:
37 |
38 | The above copyright notice and this permission notice shall be included in all
39 | copies or substantial portions of the Software.
40 |
41 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
42 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
43 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
44 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
45 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
46 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
47 | SOFTWARE.
48 |
49 | # Freecam
50 |
51 | MIT License
52 |
53 | Copyright (c) 2020 wagyourtail
54 |
55 | Permission is hereby granted, free of charge, to any person obtaining a copy
56 | of this software and associated documentation files (the "Software"), to deal
57 | in the Software without restriction, including without limitation the rights
58 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
59 | copies of the Software, and to permit persons to whom the Software is
60 | furnished to do so, subject to the following conditions:
61 |
62 | The above copyright notice and this permission notice shall be included in all
63 | copies or substantial portions of the Software.
64 |
65 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
66 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
67 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
68 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
69 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
70 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
71 | SOFTWARE.
72 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | Based utility mod. GUI bind is right shift and commands is "-".
4 |
5 |
6 |
7 | For people building the client: Jars appended with "-DEV" are not remapped and can be used as a library for plugins.
8 |
9 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id "fabric-loom" version "0.10-SNAPSHOT"
3 | }
4 |
5 | sourceCompatibility = JavaVersion.VERSION_16
6 | targetCompatibility = JavaVersion.VERSION_16
7 |
8 | group = "dev.tensor"
9 | archivesBaseName = "tensor"
10 | version = "1.0.0-SNAPSHOT"
11 |
12 | dependencies {
13 | minecraft "com.mojang:minecraft:1.17.1"
14 | mappings "net.fabricmc:yarn:1.17.1+build.63:v2"
15 | modImplementation "net.fabricmc:fabric-loader:0.12.9"
16 | }
17 |
18 | processResources {
19 | inputs.property "version", project.version
20 |
21 | filesMatching("fabric.mod.json") {
22 | expand "version": project.version
23 | }
24 | }
25 |
26 | tasks.withType(JavaCompile).configureEach {
27 | it.options.encoding = "UTF-8"
28 | }
29 |
30 | java {
31 | withSourcesJar()
32 | }
33 |
34 | jar {
35 | from("COPYING.md") {
36 | rename { "META-INF/${it}" }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IUDevman/Tensor/fe6809b2c2f8c9eb7dd898332877da3217256709/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto execute
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto execute
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :execute
68 | @rem Setup the command line
69 |
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 |
72 |
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 |
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if "%ERRORLEVEL%"=="0" goto mainEnd
79 |
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84 | exit /b 1
85 |
86 | :mainEnd
87 | if "%OS%"=="Windows_NT" endlocal
88 |
89 | :omega
90 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | maven {
4 | name = "Fabric"
5 | url = "https://maven.fabricmc.net/"
6 | }
7 | gradlePluginPortal()
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/Tensor.java:
--------------------------------------------------------------------------------
1 | package dev.tensor;
2 |
3 | import dev.tensor.feature.managers.*;
4 | import dev.tensor.misc.event.EventHandler;
5 | import dev.tensor.misc.imp.Manager;
6 | import net.fabricmc.api.ClientModInitializer;
7 | import org.apache.logging.log4j.LogManager;
8 | import org.apache.logging.log4j.Logger;
9 |
10 | /**
11 | * @author IUDevman
12 | * @since 04-12-2021
13 | */
14 |
15 | public final class Tensor implements ClientModInitializer {
16 |
17 | public static Tensor INSTANCE;
18 |
19 | public Tensor() {
20 | INSTANCE = this;
21 | }
22 |
23 | public final String MOD_NAME = "Tensor";
24 | public final String MOD_VERSION = "1.0.0-SNAPSHOT";
25 |
26 | public final Logger LOGGER = LogManager.getLogger(this.MOD_NAME);
27 |
28 | public EventHandler EVENT_HANDLER;
29 |
30 | public CommandManager COMMAND_MANAGER;
31 | public ModuleManager MODULE_MANAGER;
32 | public PluginManager PLUGIN_MANAGER;
33 | public SettingManager SETTING_MANAGER;
34 | public EventManager EVENT_MANAGER;
35 | public CapeManager CAPE_MANAGER;
36 | public FriendManager FRIEND_MANAGER;
37 | public GUIManager GUI_MANAGER;
38 | public ConfigManager CONFIG_MANAGER;
39 |
40 | @Override
41 | public void onInitializeClient() {
42 | long startTime = System.currentTimeMillis();
43 | this.LOGGER.info("Initializing " + this.MOD_NAME + " " + this.MOD_VERSION + "!");
44 |
45 | loadClient();
46 |
47 | long finishedTime = System.currentTimeMillis() - startTime;
48 | this.LOGGER.info("Finished initializing " + this.MOD_NAME + " " + this.MOD_VERSION + " (" + finishedTime + "ms)!");
49 | }
50 |
51 | private void loadClient() {
52 | this.EVENT_HANDLER = new EventHandler();
53 |
54 | this.COMMAND_MANAGER = returnLoadedManager(new CommandManager());
55 |
56 | this.MODULE_MANAGER = returnLoadedManager(new ModuleManager());
57 |
58 | this.PLUGIN_MANAGER = returnLoadedManager(new PluginManager());
59 |
60 | this.SETTING_MANAGER = returnLoadedManager(new SettingManager());
61 |
62 | this.EVENT_MANAGER = returnLoadedManager(new EventManager());
63 |
64 | this.CAPE_MANAGER = returnLoadedManager(new CapeManager());
65 |
66 | this.FRIEND_MANAGER = returnLoadedManager(new FriendManager());
67 |
68 | this.GUI_MANAGER = returnLoadedManager(new GUIManager());
69 |
70 | this.CONFIG_MANAGER = returnLoadedManager(new ConfigManager());
71 | }
72 |
73 | private T returnLoadedManager(T manager) {
74 | this.EVENT_HANDLER.register(manager);
75 | manager.load();
76 |
77 | return manager;
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/MixinPriority.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend;
2 |
3 | /**
4 | * @author IUDevman
5 | * @since 07-22-2021
6 | */
7 |
8 | public final class MixinPriority {
9 |
10 | public static final int VALUE = Integer.MAX_VALUE;
11 | }
12 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/events/BlockInteractEvent.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.events;
2 |
3 | import dev.tensor.misc.event.imp.EventCancellable;
4 | import net.minecraft.util.math.BlockPos;
5 |
6 | /**
7 | * @author IUDevman
8 | * @since 05-01-2021
9 | */
10 |
11 | public final class BlockInteractEvent extends EventCancellable {
12 |
13 | private final Type type;
14 | private final BlockPos blockPos;
15 |
16 | public BlockInteractEvent(Type type, BlockPos blockPos) {
17 | this.type = type;
18 | this.blockPos = blockPos;
19 | }
20 |
21 | public Type getType() {
22 | return this.type;
23 | }
24 |
25 | public BlockPos getBlockPos() {
26 | return this.blockPos;
27 | }
28 |
29 | public enum Type {
30 | Damage,
31 | Break
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/events/ClientRenderEvent.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.events;
2 |
3 | import dev.tensor.misc.event.imp.EventCancellable;
4 |
5 | /**
6 | * @author IUDevman
7 | * @since 05-01-2021
8 | */
9 |
10 | public final class ClientRenderEvent extends EventCancellable {
11 |
12 | private final Type type;
13 |
14 | public ClientRenderEvent(Type type) {
15 | this.type = type;
16 | }
17 |
18 | public Type getType() {
19 | return this.type;
20 | }
21 |
22 | public enum Type {
23 | World,
24 | HUD
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/events/ClientTickEvent.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.events;
2 |
3 | import dev.tensor.misc.event.imp.EventCancellable;
4 |
5 | /**
6 | * @author IUDevman
7 | * @since 04-12-2021
8 | */
9 |
10 | public final class ClientTickEvent extends EventCancellable {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/events/DisconnectEvent.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.events;
2 |
3 | import dev.tensor.misc.event.imp.EventCancellable;
4 |
5 | /**
6 | * @author IUDevman
7 | * @since 05-17-2021
8 | */
9 |
10 | public final class DisconnectEvent extends EventCancellable {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/events/KeyPressedEvent.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.events;
2 |
3 | import dev.tensor.misc.event.imp.EventCancellable;
4 |
5 | /**
6 | * @author IUDevman
7 | * @since 04-13-2021
8 | */
9 |
10 | public final class KeyPressedEvent extends EventCancellable {
11 |
12 | private final int bind;
13 |
14 | public KeyPressedEvent(int bind) {
15 | this.bind = bind;
16 | }
17 |
18 | public int getBind() {
19 | return this.bind;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/events/PacketEvent.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.events;
2 |
3 | import dev.tensor.misc.event.imp.EventCancellable;
4 | import net.minecraft.network.Packet;
5 |
6 | /**
7 | * @author IUDevman
8 | * @since 04-13-2021
9 | */
10 |
11 | public final class PacketEvent extends EventCancellable {
12 |
13 | private final Type type;
14 | private final Packet> packet;
15 |
16 | public PacketEvent(Type type, Packet> packet) {
17 | this.type = type;
18 | this.packet = packet;
19 | }
20 |
21 | public Type getType() {
22 | return this.type;
23 | }
24 |
25 | public Packet> getPacket() {
26 | return this.packet;
27 | }
28 |
29 | public enum Type {
30 | Send,
31 | Receive
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/events/PlaySoundEvent.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.events;
2 |
3 | import dev.tensor.misc.event.imp.EventCancellable;
4 | import net.minecraft.client.sound.SoundInstance;
5 |
6 | /**
7 | * @author IUDevman
8 | * @since 05-25-2021
9 | */
10 |
11 | public final class PlaySoundEvent extends EventCancellable {
12 |
13 | private final SoundInstance soundInstance;
14 |
15 | public PlaySoundEvent(SoundInstance soundInstance) {
16 | this.soundInstance = soundInstance;
17 | }
18 |
19 | public SoundInstance getSoundInstance() {
20 | return this.soundInstance;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/AbstractClientPlayerEntityMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import com.mojang.authlib.GameProfile;
4 | import dev.tensor.Tensor;
5 | import dev.tensor.backend.MixinPriority;
6 | import dev.tensor.feature.modules.Capes;
7 | import dev.tensor.misc.imp.Global;
8 | import net.minecraft.client.network.AbstractClientPlayerEntity;
9 | import net.minecraft.entity.player.PlayerEntity;
10 | import net.minecraft.util.Identifier;
11 | import net.minecraft.util.math.BlockPos;
12 | import net.minecraft.world.World;
13 | import org.spongepowered.asm.mixin.Mixin;
14 | import org.spongepowered.asm.mixin.injection.At;
15 | import org.spongepowered.asm.mixin.injection.Inject;
16 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
17 |
18 | /**
19 | * @author IUDevman
20 | * @since 05-26-2021
21 | */
22 |
23 | @Mixin(value = AbstractClientPlayerEntity.class, priority = MixinPriority.VALUE)
24 | public abstract class AbstractClientPlayerEntityMixin extends PlayerEntity implements Global {
25 |
26 | public AbstractClientPlayerEntityMixin(World world, BlockPos pos, float yaw, GameProfile profile) {
27 | super(world, pos, yaw, profile);
28 | }
29 |
30 | @Inject(method = "getCapeTexture", at = @At("HEAD"), cancellable = true)
31 | public void getCapeTexture(CallbackInfoReturnable cir) {
32 | Capes capes = Tensor.INSTANCE.MODULE_MANAGER.getModule(Capes.class);
33 |
34 | if (capes != null && capes.isEnabled()) {
35 | cir.setReturnValue(Tensor.INSTANCE.CAPE_MANAGER.getCape(this.getEntityName()));
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/AdvancementToastMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.NoOverlay;
6 | import dev.tensor.misc.imp.Global;
7 | import net.minecraft.client.toast.AdvancementToast;
8 | import net.minecraft.client.toast.Toast;
9 | import net.minecraft.client.toast.ToastManager;
10 | import net.minecraft.client.util.math.MatrixStack;
11 | import org.spongepowered.asm.mixin.Mixin;
12 | import org.spongepowered.asm.mixin.injection.At;
13 | import org.spongepowered.asm.mixin.injection.Inject;
14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
15 |
16 | /**
17 | * @author IUDevman
18 | * @since 05-25-2021
19 | */
20 |
21 | @Mixin(value = AdvancementToast.class, priority = MixinPriority.VALUE)
22 | public final class AdvancementToastMixin implements Global {
23 |
24 | @Inject(method = "draw", at = @At("HEAD"), cancellable = true)
25 | public void draw(MatrixStack matrices, ToastManager manager, long startTime, CallbackInfoReturnable cir) {
26 | NoOverlay noOverlay = Tensor.INSTANCE.MODULE_MANAGER.getModule(NoOverlay.class);
27 |
28 | if (noOverlay != null && noOverlay.isEnabled() && noOverlay.toast.getValue()) {
29 | cir.setReturnValue(Toast.Visibility.HIDE);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/ArmorFeatureRendererMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.NoRender;
6 | import dev.tensor.misc.imp.Global;
7 | import net.minecraft.client.render.VertexConsumerProvider;
8 | import net.minecraft.client.render.entity.feature.ArmorFeatureRenderer;
9 | import net.minecraft.client.util.math.MatrixStack;
10 | import net.minecraft.entity.LivingEntity;
11 | import org.spongepowered.asm.mixin.Mixin;
12 | import org.spongepowered.asm.mixin.injection.At;
13 | import org.spongepowered.asm.mixin.injection.Inject;
14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
15 |
16 | /**
17 | * @author IUDevman
18 | * @since 05-15-2021
19 | */
20 |
21 | @Mixin(value = ArmorFeatureRenderer.class, priority = MixinPriority.VALUE)
22 | public final class ArmorFeatureRendererMixin implements Global {
23 |
24 | @Inject(method = "render", at = @At("HEAD"), cancellable = true)
25 | public void render(MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, T livingEntity, float f, float g, float h, float j, float k, float l, CallbackInfo ci) {
26 | NoRender noRender = Tensor.INSTANCE.MODULE_MANAGER.getModule(NoRender.class);
27 |
28 | if (noRender != null && noRender.isEnabled() && noRender.armor.getValue()) ci.cancel();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/BackgroundRendererMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.NoFog;
6 | import dev.tensor.misc.imp.Global;
7 | import net.minecraft.client.render.BackgroundRenderer;
8 | import net.minecraft.client.render.Camera;
9 | import org.spongepowered.asm.mixin.Mixin;
10 | import org.spongepowered.asm.mixin.injection.At;
11 | import org.spongepowered.asm.mixin.injection.Inject;
12 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
13 |
14 | /**
15 | * @author IUDevman
16 | * @since 04-14-2021
17 | */
18 |
19 | @Mixin(value = BackgroundRenderer.class, priority = MixinPriority.VALUE)
20 | public final class BackgroundRendererMixin implements Global {
21 |
22 | @Inject(method = "applyFog", at = @At("HEAD"), cancellable = true)
23 | private static void applyFog(Camera camera, BackgroundRenderer.FogType fogType, float viewDistance, boolean thickFog, CallbackInfo ci) {
24 | NoFog noFog = Tensor.INSTANCE.MODULE_MANAGER.getModule(NoFog.class);
25 |
26 | if (noFog != null && noFog.isEnabled()) {
27 | ci.cancel();
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/BlockMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.NoGlitchBlock;
6 | import dev.tensor.feature.modules.NoSlow;
7 | import dev.tensor.misc.imp.Global;
8 | import net.minecraft.block.Block;
9 | import net.minecraft.block.BlockState;
10 | import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket;
11 | import net.minecraft.util.math.BlockPos;
12 | import net.minecraft.util.math.Direction;
13 | import net.minecraft.world.WorldAccess;
14 | import org.spongepowered.asm.mixin.Mixin;
15 | import org.spongepowered.asm.mixin.injection.At;
16 | import org.spongepowered.asm.mixin.injection.Inject;
17 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
18 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
19 |
20 | /**
21 | * @author IUDevman
22 | * @since 05-09-2021
23 | */
24 |
25 | @Mixin(value = Block.class, priority = MixinPriority.VALUE)
26 | public final class BlockMixin implements Global {
27 |
28 | @Inject(method = "getVelocityMultiplier()F", at = @At("HEAD"), cancellable = true)
29 | public void getVelocityMultiplier(CallbackInfoReturnable cir) {
30 | NoSlow noSlow = Tensor.INSTANCE.MODULE_MANAGER.getModule(NoSlow.class);
31 |
32 | if (noSlow != null && noSlow.isEnabled() && noSlow.blocks.getValue() && cir.getReturnValueF() < 1F) {
33 | cir.setReturnValue(1F);
34 | }
35 | }
36 |
37 | @Inject(method = "onBroken", at = @At("RETURN"))
38 | public void onBroken(WorldAccess world, BlockPos pos, BlockState state, CallbackInfo ci) {
39 | NoGlitchBlock noGlitchBlock = Tensor.INSTANCE.MODULE_MANAGER.getModule(NoGlitchBlock.class);
40 |
41 | if (noGlitchBlock != null && noGlitchBlock.isEnabled()) {
42 | this.getNetwork().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, pos, Direction.UP));
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/BossBarHudMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.NoOverlay;
6 | import dev.tensor.misc.imp.Global;
7 | import net.minecraft.client.gui.hud.BossBarHud;
8 | import net.minecraft.client.util.math.MatrixStack;
9 | import org.spongepowered.asm.mixin.Mixin;
10 | import org.spongepowered.asm.mixin.injection.At;
11 | import org.spongepowered.asm.mixin.injection.Inject;
12 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
13 |
14 | /**
15 | * @author IUDevman
16 | * @since 05-14-2021
17 | */
18 |
19 | @Mixin(value = BossBarHud.class, priority = MixinPriority.VALUE)
20 | public final class BossBarHudMixin implements Global {
21 |
22 | @Inject(method = "render", at = @At("HEAD"), cancellable = true)
23 | public void render(MatrixStack matrices, CallbackInfo ci) {
24 | NoOverlay noOverlay = Tensor.INSTANCE.MODULE_MANAGER.getModule(NoOverlay.class);
25 |
26 | if (noOverlay != null && noOverlay.isEnabled() && noOverlay.bossBar.getValue()) {
27 | ci.cancel();
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/CameraMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.CameraClip;
6 | import dev.tensor.feature.modules.Freecam;
7 | import dev.tensor.misc.imp.Global;
8 | import net.minecraft.client.render.Camera;
9 | import net.minecraft.entity.Entity;
10 | import org.spongepowered.asm.mixin.Mixin;
11 | import org.spongepowered.asm.mixin.injection.At;
12 | import org.spongepowered.asm.mixin.injection.Inject;
13 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
14 |
15 | /**
16 | * @author IUDevman
17 | * @since 05-11-2021
18 | */
19 |
20 | @Mixin(value = Camera.class, priority = MixinPriority.VALUE)
21 | public final class CameraMixin implements Global {
22 |
23 | @Inject(method = "clipToSpace", at = @At("HEAD"), cancellable = true)
24 | public void clipToSpace(double desiredCameraDistance, CallbackInfoReturnable cir) {
25 | CameraClip cameraClip = Tensor.INSTANCE.MODULE_MANAGER.getModule(CameraClip.class);
26 |
27 | if (cameraClip != null && cameraClip.isEnabled()) {
28 | cir.setReturnValue(cameraClip.distance.getValue());
29 | }
30 | }
31 |
32 | @Inject(method = "isThirdPerson", at = @At("HEAD"), cancellable = true)
33 | public void isThirdPerson(CallbackInfoReturnable cir) {
34 | Freecam freecam = Tensor.INSTANCE.MODULE_MANAGER.getModule(Freecam.class);
35 |
36 | if (freecam != null && freecam.isEnabled()) {
37 | cir.setReturnValue(true);
38 | }
39 | }
40 |
41 | @Inject(method = "getFocusedEntity", at = @At("HEAD"), cancellable = true)
42 | public void getFocusedEntity(CallbackInfoReturnable cir) {
43 | if (this.isNull()) return;
44 |
45 | Freecam freecam = Tensor.INSTANCE.MODULE_MANAGER.getModule(Freecam.class);
46 |
47 | if (freecam != null && freecam.isEnabled()) {
48 | cir.setReturnValue(getPlayer());
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/ChatScreenMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.Commands;
6 | import dev.tensor.misc.imp.Global;
7 | import net.minecraft.client.gui.screen.ChatScreen;
8 | import net.minecraft.client.gui.screen.Screen;
9 | import net.minecraft.client.gui.widget.TextFieldWidget;
10 | import net.minecraft.client.util.math.MatrixStack;
11 | import net.minecraft.text.Text;
12 | import org.spongepowered.asm.mixin.Mixin;
13 | import org.spongepowered.asm.mixin.Shadow;
14 | import org.spongepowered.asm.mixin.injection.At;
15 | import org.spongepowered.asm.mixin.injection.Inject;
16 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
17 |
18 | /**
19 | * @author IUDevman
20 | * @since 09-03-2021
21 | */
22 |
23 | @Mixin(value = ChatScreen.class, priority = MixinPriority.VALUE)
24 | public final class ChatScreenMixin extends Screen implements Global {
25 |
26 | @Shadow
27 | protected TextFieldWidget chatField;
28 |
29 | public ChatScreenMixin(Text title) {
30 | super(title);
31 | }
32 |
33 | @Inject(method = "render", at = @At("HEAD"))
34 | public void render(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo ci) {
35 | Commands commands = Tensor.INSTANCE.MODULE_MANAGER.getModule(Commands.class);
36 |
37 | if (commands != null && commands.isEnabled() && commands.preview.getValue()) {
38 | Tensor.INSTANCE.GUI_MANAGER.getTensorChatGUI().render(matrices, this.chatField.getText(), 2, this.height - 14, this.width - 2, this.height - 2);
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/ClientBrandRetrieverMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.VanillaSpoof;
6 | import dev.tensor.misc.imp.Global;
7 | import net.minecraft.client.ClientBrandRetriever;
8 | import org.spongepowered.asm.mixin.Mixin;
9 | import org.spongepowered.asm.mixin.injection.At;
10 | import org.spongepowered.asm.mixin.injection.Inject;
11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
12 |
13 | /**
14 | * @author IUDevman
15 | * @since 08-02-2021
16 | */
17 |
18 | @Mixin(value = ClientBrandRetriever.class, priority = MixinPriority.VALUE)
19 | public final class ClientBrandRetrieverMixin implements Global {
20 |
21 | @Inject(method = "getClientModName", at = @At("HEAD"), cancellable = true, remap = false)
22 | private static void getClientModName(CallbackInfoReturnable cir) {
23 | VanillaSpoof vanillaSpoof = Tensor.INSTANCE.MODULE_MANAGER.getModule(VanillaSpoof.class);
24 |
25 | if (vanillaSpoof != null && vanillaSpoof.isEnabled()) {
26 | cir.setReturnValue("vanilla");
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/ClientConnectionMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.backend.events.PacketEvent;
6 | import dev.tensor.misc.imp.Global;
7 | import io.netty.channel.ChannelHandlerContext;
8 | import io.netty.util.concurrent.Future;
9 | import io.netty.util.concurrent.GenericFutureListener;
10 | import net.minecraft.network.ClientConnection;
11 | import net.minecraft.network.Packet;
12 | import org.spongepowered.asm.mixin.Mixin;
13 | import org.spongepowered.asm.mixin.injection.At;
14 | import org.spongepowered.asm.mixin.injection.Inject;
15 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
16 |
17 | /**
18 | * @author IUDevman
19 | * @since 04-13-2021
20 | */
21 |
22 | @Mixin(value = ClientConnection.class, priority = MixinPriority.VALUE)
23 | public final class ClientConnectionMixin implements Global {
24 |
25 | @Inject(method = "send(Lnet/minecraft/network/Packet;Lio/netty/util/concurrent/GenericFutureListener;)V", at = @At("HEAD"), cancellable = true)
26 | public void send(Packet> packet, GenericFutureListener extends Future super Void>> callback, CallbackInfo ci) {
27 | if (this.isNull()) return;
28 |
29 | PacketEvent packetEvent = new PacketEvent(PacketEvent.Type.Send, packet);
30 |
31 | Tensor.INSTANCE.EVENT_HANDLER.call(packetEvent);
32 | if (packetEvent.isCancelled()) ci.cancel();
33 | }
34 |
35 | @Inject(method = "channelRead0", at = @At("HEAD"), cancellable = true)
36 | public void receive(ChannelHandlerContext channelHandlerContext, Packet> packet, CallbackInfo ci) {
37 | if (this.isNull()) return;
38 |
39 | PacketEvent packetEvent = new PacketEvent(PacketEvent.Type.Receive, packet);
40 |
41 | Tensor.INSTANCE.EVENT_HANDLER.call(packetEvent);
42 | if (packetEvent.isCancelled()) ci.cancel();
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/ClientPlayerEntityMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.Freecam;
6 | import dev.tensor.feature.modules.NoPortalEffect;
7 | import dev.tensor.feature.modules.NoPush;
8 | import dev.tensor.feature.modules.NoSlow;
9 | import dev.tensor.misc.imp.Global;
10 | import net.minecraft.client.network.ClientPlayerEntity;
11 | import org.spongepowered.asm.mixin.Mixin;
12 | import org.spongepowered.asm.mixin.injection.At;
13 | import org.spongepowered.asm.mixin.injection.Inject;
14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
15 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
16 |
17 | /**
18 | * @author IUDevman
19 | * @since 05-09-2021
20 | */
21 |
22 | @Mixin(value = ClientPlayerEntity.class, priority = MixinPriority.VALUE)
23 | public final class ClientPlayerEntityMixin implements Global {
24 |
25 | @Inject(method = "updateNausea", at = @At("HEAD"), cancellable = true)
26 | public void updateNausea(CallbackInfo ci) {
27 | NoPortalEffect noPortalEffect = Tensor.INSTANCE.MODULE_MANAGER.getModule(NoPortalEffect.class);
28 |
29 | if (noPortalEffect != null && noPortalEffect.isEnabled()) ci.cancel();
30 | }
31 |
32 | @Inject(method = "shouldSlowDown", at = @At("HEAD"), cancellable = true)
33 | public void shouldSlowDown(CallbackInfoReturnable cir) {
34 | NoSlow noSlow = Tensor.INSTANCE.MODULE_MANAGER.getModule(NoSlow.class);
35 |
36 | if (noSlow != null && noSlow.isEnabled() && noSlow.sneaking.getValue()) cir.setReturnValue(false);
37 | }
38 |
39 | @Inject(method = "tickMovement", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;isUsingItem()Z"))
40 | public void tickMovement(CallbackInfo ci) {
41 | if (this.isNull()) return;
42 |
43 | NoSlow noSlow = Tensor.INSTANCE.MODULE_MANAGER.getModule(NoSlow.class);
44 |
45 | if (noSlow != null && noSlow.isEnabled() && noSlow.items.getValue() && this.getPlayer().isUsingItem()) {
46 | this.getPlayer().input.movementForward /= 0.2F;
47 | this.getPlayer().input.movementSideways /= 0.2F;
48 | }
49 | }
50 |
51 | @Inject(method = "pushOutOfBlocks", at = @At("HEAD"), cancellable = true)
52 | public void pushOutOfBlocks(double x, double d, CallbackInfo ci) {
53 | NoPush noPush = Tensor.INSTANCE.MODULE_MANAGER.getModule(NoPush.class);
54 |
55 | if (noPush != null && noPush.isEnabled() && noPush.blocks.getValue()) ci.cancel();
56 | }
57 |
58 | @Inject(method = "isCamera", at = @At("HEAD"), cancellable = true)
59 | public void isCamera(CallbackInfoReturnable cir) {
60 | Freecam freecam = Tensor.INSTANCE.MODULE_MANAGER.getModule(Freecam.class);
61 |
62 | if (freecam != null && freecam.isEnabled()) {
63 | cir.setReturnValue(true);
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/ClientPlayerInteractionManagerMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.backend.events.BlockInteractEvent;
6 | import dev.tensor.feature.modules.Freecam;
7 | import dev.tensor.feature.modules.NoBreakDelay;
8 | import dev.tensor.misc.imp.Global;
9 | import net.minecraft.client.network.ClientPlayerInteractionManager;
10 | import net.minecraft.entity.Entity;
11 | import net.minecraft.entity.player.PlayerEntity;
12 | import net.minecraft.util.ActionResult;
13 | import net.minecraft.util.Hand;
14 | import net.minecraft.util.math.BlockPos;
15 | import net.minecraft.util.math.Direction;
16 | import org.spongepowered.asm.mixin.Mixin;
17 | import org.spongepowered.asm.mixin.Shadow;
18 | import org.spongepowered.asm.mixin.injection.At;
19 | import org.spongepowered.asm.mixin.injection.Inject;
20 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
21 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
22 |
23 | /**
24 | * @author IUDevman
25 | * @since 05-01-2021
26 | */
27 |
28 | @Mixin(value = ClientPlayerInteractionManager.class, priority = MixinPriority.VALUE)
29 | public final class ClientPlayerInteractionManagerMixin implements Global {
30 |
31 | @Shadow
32 | private int blockBreakingCooldown;
33 |
34 | @Inject(method = "updateBlockBreakingProgress", at = @At("HEAD"))
35 | public void updateBlockBreakingProgress(BlockPos pos, Direction direction, CallbackInfoReturnable cir) {
36 | Tensor.INSTANCE.EVENT_HANDLER.call(new BlockInteractEvent(BlockInteractEvent.Type.Damage, pos));
37 |
38 | NoBreakDelay noBreakDelay = Tensor.INSTANCE.MODULE_MANAGER.getModule(NoBreakDelay.class);
39 |
40 | if (noBreakDelay != null && noBreakDelay.isEnabled()) blockBreakingCooldown = 0;
41 | }
42 |
43 | @Inject(method = "breakBlock", at = @At("HEAD"))
44 | public void breakBlockHead(BlockPos pos, CallbackInfoReturnable cir) {
45 | Tensor.INSTANCE.EVENT_HANDLER.call(new BlockInteractEvent(BlockInteractEvent.Type.Break, pos));
46 | }
47 |
48 | @Inject(method = "attackEntity", at = @At("HEAD"), cancellable = true)
49 | public void attackEntity(PlayerEntity player, Entity target, CallbackInfo ci) {
50 | Freecam freecam = Tensor.INSTANCE.MODULE_MANAGER.getModule(Freecam.class);
51 |
52 | if (freecam != null && (target.equals(player) || target.equals(freecam.getCameraEntity()))) {
53 | ci.cancel();
54 | }
55 | }
56 |
57 | @Inject(method = "interactEntity", at = @At("HEAD"), cancellable = true)
58 | public void interactEntity(PlayerEntity player, Entity entity, Hand hand, CallbackInfoReturnable cir) {
59 | if (entity.equals(player)) {
60 | cir.setReturnValue(ActionResult.FAIL);
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/CobWebBlockMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.NoSlow;
6 | import dev.tensor.misc.imp.Global;
7 | import net.minecraft.block.BlockState;
8 | import net.minecraft.block.CobwebBlock;
9 | import net.minecraft.entity.Entity;
10 | import net.minecraft.util.math.BlockPos;
11 | import net.minecraft.world.World;
12 | import org.spongepowered.asm.mixin.Mixin;
13 | import org.spongepowered.asm.mixin.injection.At;
14 | import org.spongepowered.asm.mixin.injection.Inject;
15 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
16 |
17 | /**
18 | * @author IUDevman
19 | * @since 05-12-2021
20 | */
21 |
22 | @Mixin(value = CobwebBlock.class, priority = MixinPriority.VALUE)
23 | public final class CobWebBlockMixin implements Global {
24 |
25 | @Inject(method = "onEntityCollision", at = @At("HEAD"), cancellable = true)
26 | public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity, CallbackInfo ci) {
27 | if (this.isNull() || entity != this.getPlayer()) return;
28 |
29 | NoSlow noSlow = Tensor.INSTANCE.MODULE_MANAGER.getModule(NoSlow.class);
30 |
31 | if (noSlow != null && noSlow.isEnabled() && noSlow.sticky.getValue()) ci.cancel();
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/CrashReportMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.DebugReport;
6 | import dev.tensor.misc.imp.Global;
7 | import net.minecraft.util.crash.CrashReport;
8 | import net.minecraft.util.crash.CrashReportSection;
9 | import org.spongepowered.asm.mixin.Final;
10 | import org.spongepowered.asm.mixin.Mixin;
11 | import org.spongepowered.asm.mixin.Shadow;
12 | import org.spongepowered.asm.mixin.injection.At;
13 | import org.spongepowered.asm.mixin.injection.Inject;
14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
15 |
16 | import java.io.File;
17 | import java.util.List;
18 |
19 | /**
20 | * @author IUDevman
21 | * @since 09-05-2021
22 | */
23 |
24 | @Mixin(value = CrashReport.class, priority = MixinPriority.VALUE)
25 | public final class CrashReportMixin implements Global {
26 |
27 | @Shadow
28 | @Final
29 | private List otherSections;
30 |
31 | @Inject(method = "writeToFile", at = @At("HEAD"))
32 | public void writeToFile(File file, CallbackInfoReturnable cir) {
33 | DebugReport debugReport = Tensor.INSTANCE.MODULE_MANAGER.getModule(DebugReport.class);
34 |
35 | if (debugReport != null && debugReport.isEnabled()) {
36 | this.otherSections.add(debugReport.getTensorCrashReportSection());
37 | Tensor.INSTANCE.LOGGER.info("Added debug information to crash report!");
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/DimensionTypeMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.FullBright;
6 | import dev.tensor.misc.imp.Global;
7 | import net.minecraft.world.dimension.DimensionType;
8 | import org.spongepowered.asm.mixin.Mixin;
9 | import org.spongepowered.asm.mixin.injection.At;
10 | import org.spongepowered.asm.mixin.injection.Inject;
11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
12 |
13 | /**
14 | * @author A2H#6255
15 | * Added with explicit permission, thanks! :D
16 | */
17 |
18 | @Mixin(value = DimensionType.class, priority = MixinPriority.VALUE)
19 | public final class DimensionTypeMixin implements Global {
20 |
21 | @Inject(method = "getBrightness", at = @At("HEAD"), cancellable = true)
22 | public void getBrightness(int i, CallbackInfoReturnable cir) {
23 | FullBright fullBright = Tensor.INSTANCE.MODULE_MANAGER.getModule(FullBright.class);
24 |
25 | if (fullBright != null && fullBright.isEnabled()) {
26 | cir.setReturnValue(1F);
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/EnchantingTableBlockEntityRendererMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.NoRender;
6 | import dev.tensor.misc.imp.Global;
7 | import net.minecraft.client.render.block.entity.EnchantingTableBlockEntityRenderer;
8 | import org.spongepowered.asm.mixin.Mixin;
9 | import org.spongepowered.asm.mixin.injection.At;
10 | import org.spongepowered.asm.mixin.injection.Inject;
11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
12 |
13 | /**
14 | * @author IUDevman
15 | * @since 05-15-2021
16 | */
17 |
18 | @Mixin(value = EnchantingTableBlockEntityRenderer.class, priority = MixinPriority.VALUE)
19 | public final class EnchantingTableBlockEntityRendererMixin implements Global {
20 |
21 | @Inject(method = "render", at = @At("HEAD"), cancellable = true)
22 | public void render(CallbackInfo ci) {
23 | NoRender noRender = Tensor.INSTANCE.MODULE_MANAGER.getModule(NoRender.class);
24 |
25 | if (noRender != null && noRender.isEnabled() && noRender.enchantBooks.getValue()) ci.cancel();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/FluidBlockMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.Jesus;
6 | import dev.tensor.misc.imp.Global;
7 | import net.minecraft.block.BlockState;
8 | import net.minecraft.block.FluidBlock;
9 | import net.minecraft.block.ShapeContext;
10 | import net.minecraft.fluid.LavaFluid;
11 | import net.minecraft.util.math.BlockPos;
12 | import net.minecraft.util.shape.VoxelShape;
13 | import net.minecraft.util.shape.VoxelShapes;
14 | import net.minecraft.world.BlockView;
15 | import org.spongepowered.asm.mixin.Mixin;
16 | import org.spongepowered.asm.mixin.injection.At;
17 | import org.spongepowered.asm.mixin.injection.Inject;
18 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
19 |
20 | /**
21 | * @author IUDevman
22 | * @since 05-23-2021
23 | */
24 |
25 | @Mixin(value = FluidBlock.class, priority = MixinPriority.VALUE)
26 | public final class FluidBlockMixin implements Global {
27 |
28 | @Inject(method = "getCollisionShape", at = @At("HEAD"), cancellable = true)
29 | public void getCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable cir) {
30 | if (this.isNull() || this.getPlayer().isSubmergedInWater() || this.getPlayer().isSneaking() || this.getWorld().getBlockState(this.getPlayer().getBlockPos()).getBlock() instanceof FluidBlock) {
31 | return;
32 | }
33 |
34 | Jesus jesus = Tensor.INSTANCE.MODULE_MANAGER.getModule(Jesus.class);
35 |
36 | if (jesus != null && jesus.isEnabled()) {
37 |
38 | if (jesus.cancelOnFall.getValue() && getPlayer().fallDistance >= 3 && !(state.getFluidState().getFluid() instanceof LavaFluid)) {
39 | return;
40 | }
41 |
42 | cir.setReturnValue(VoxelShapes.fullCube());
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/FluidStateMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.NoPush;
6 | import dev.tensor.misc.imp.Global;
7 | import net.minecraft.fluid.FluidState;
8 | import net.minecraft.util.math.BlockPos;
9 | import net.minecraft.util.math.Vec3d;
10 | import net.minecraft.world.BlockView;
11 | import org.spongepowered.asm.mixin.Mixin;
12 | import org.spongepowered.asm.mixin.injection.At;
13 | import org.spongepowered.asm.mixin.injection.Inject;
14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
15 |
16 | /**
17 | * @author IUDevman
18 | * @since 05-16-2021
19 | */
20 |
21 | @Mixin(value = FluidState.class, priority = MixinPriority.VALUE)
22 | public final class FluidStateMixin implements Global {
23 |
24 | @Inject(method = "getVelocity", at = @At("HEAD"), cancellable = true)
25 | public void getVelocity(BlockView world, BlockPos pos, CallbackInfoReturnable cir) {
26 | if (this.isNull() || this.getPlayer().squaredDistanceTo(pos.getX(), pos.getY(), pos.getZ()) > 3) return;
27 |
28 | NoPush noPush = Tensor.INSTANCE.MODULE_MANAGER.getModule(NoPush.class);
29 |
30 | if (noPush != null && noPush.isEnabled() && noPush.water.getValue()) cir.setReturnValue(Vec3d.ZERO);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/GameRendererMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.backend.events.ClientRenderEvent;
6 | import dev.tensor.feature.modules.Freecam;
7 | import dev.tensor.feature.modules.NoViewBob;
8 | import dev.tensor.misc.imp.Global;
9 | import net.minecraft.client.render.GameRenderer;
10 | import net.minecraft.client.util.math.MatrixStack;
11 | import org.spongepowered.asm.mixin.Mixin;
12 | import org.spongepowered.asm.mixin.injection.At;
13 | import org.spongepowered.asm.mixin.injection.Inject;
14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
15 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
16 |
17 | /**
18 | * @author IUDevman
19 | * @since 04-12-2021
20 | */
21 |
22 | @Mixin(value = GameRenderer.class, priority = MixinPriority.VALUE)
23 | public final class GameRendererMixin implements Global {
24 |
25 | @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/InGameHud;render(Lnet/minecraft/client/util/math/MatrixStack;F)V"))
26 | public void render(CallbackInfo ci) {
27 | if (this.isNull()) return;
28 |
29 | Tensor.INSTANCE.EVENT_HANDLER.call(new ClientRenderEvent(ClientRenderEvent.Type.HUD));
30 | }
31 |
32 | @Inject(method = "renderHand", at = @At("HEAD"))
33 | public void renderHand(CallbackInfo ci) {
34 | if (this.isNull()) return;
35 |
36 | Tensor.INSTANCE.EVENT_HANDLER.call(new ClientRenderEvent(ClientRenderEvent.Type.World));
37 | }
38 |
39 | @Inject(method = "bobView", at = @At("HEAD"), cancellable = true)
40 | public void bobView(MatrixStack matrixStack, float f, CallbackInfo ci) {
41 | NoViewBob noViewBob = Tensor.INSTANCE.MODULE_MANAGER.getModule(NoViewBob.class);
42 |
43 | if (noViewBob != null && noViewBob.isEnabled() && !noViewBob.hurtOnly.getValue()) {
44 | ci.cancel();
45 | }
46 | }
47 |
48 | @Inject(method = "bobViewWhenHurt", at = @At("HEAD"), cancellable = true)
49 | public void bobViewWhenHurt(MatrixStack matrixStack, float f, CallbackInfo ci) {
50 | NoViewBob noViewBob = Tensor.INSTANCE.MODULE_MANAGER.getModule(NoViewBob.class);
51 |
52 | if (noViewBob != null && noViewBob.isEnabled()) {
53 | ci.cancel();
54 | }
55 | }
56 |
57 | @Inject(method = "shouldRenderBlockOutline", at = @At("HEAD"), cancellable = true)
58 | public void shouldRenderBlockOutline(CallbackInfoReturnable cir) {
59 | Freecam freecam = Tensor.INSTANCE.MODULE_MANAGER.getModule(Freecam.class);
60 |
61 | if (freecam != null && freecam.isEnabled() && freecam.hideBlockOutline.getValue()) cir.setReturnValue(false);
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/HeldItemRendererMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.ViewModel;
6 | import dev.tensor.misc.imp.Global;
7 | import net.minecraft.client.network.AbstractClientPlayerEntity;
8 | import net.minecraft.client.render.VertexConsumerProvider;
9 | import net.minecraft.client.render.item.HeldItemRenderer;
10 | import net.minecraft.client.util.math.MatrixStack;
11 | import net.minecraft.item.ItemStack;
12 | import net.minecraft.util.Hand;
13 | import org.spongepowered.asm.mixin.Mixin;
14 | import org.spongepowered.asm.mixin.injection.At;
15 | import org.spongepowered.asm.mixin.injection.Inject;
16 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
17 |
18 | /**
19 | * @author IUDevman
20 | * @since 05-14-2021
21 | */
22 |
23 | @Mixin(value = HeldItemRenderer.class, priority = MixinPriority.VALUE)
24 | public final class HeldItemRendererMixin implements Global {
25 |
26 | @Inject(method = "renderFirstPersonItem", at = @At("HEAD"))
27 | public void renderFirstPersonItem(AbstractClientPlayerEntity player, float tickDelta, float pitch, Hand hand, float swingProgress, ItemStack item, float equipProgress, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, CallbackInfo ci) {
28 | if (this.isNull() || player != this.getPlayer()) return;
29 |
30 | ViewModel viewModel = Tensor.INSTANCE.MODULE_MANAGER.getModule(ViewModel.class);
31 |
32 | if (viewModel != null && viewModel.isEnabled() && hand == Hand.MAIN_HAND) {
33 | matrices.translate(0, viewModel.vertical.getValue(), viewModel.horizontal.getValue());
34 | matrices.scale(viewModel.scale.getValue().floatValue(), viewModel.scale.getValue().floatValue(), viewModel.scale.getValue().floatValue());
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/InGameHudMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.Freecam;
6 | import dev.tensor.feature.modules.NoOverlay;
7 | import dev.tensor.misc.imp.Global;
8 | import net.minecraft.client.gui.hud.InGameHud;
9 | import net.minecraft.client.util.math.MatrixStack;
10 | import net.minecraft.entity.Entity;
11 | import net.minecraft.entity.player.PlayerEntity;
12 | import net.minecraft.util.Identifier;
13 | import org.spongepowered.asm.mixin.Final;
14 | import org.spongepowered.asm.mixin.Mixin;
15 | import org.spongepowered.asm.mixin.Shadow;
16 | import org.spongepowered.asm.mixin.injection.At;
17 | import org.spongepowered.asm.mixin.injection.Inject;
18 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
19 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
20 |
21 | /**
22 | * @author IUDevman
23 | * @since 05-10-2021
24 | */
25 |
26 | @Mixin(value = InGameHud.class, priority = MixinPriority.VALUE)
27 | public final class InGameHudMixin implements Global {
28 |
29 | @Shadow
30 | @Final
31 | private static Identifier PUMPKIN_BLUR;
32 |
33 | @Shadow
34 | @Final
35 | private static Identifier POWDER_SNOW_OUTLINE;
36 |
37 | @Inject(method = "renderOverlay", at = @At("HEAD"), cancellable = true)
38 | public void renderOverlay(Identifier texture, float opacity, CallbackInfo ci) {
39 | NoOverlay noOverlay = Tensor.INSTANCE.MODULE_MANAGER.getModule(NoOverlay.class);
40 |
41 | if (noOverlay != null && noOverlay.isEnabled()) {
42 | if ((noOverlay.pumpkin.getValue() && texture == PUMPKIN_BLUR) || (noOverlay.powderedSnow.getValue() && texture == POWDER_SNOW_OUTLINE)) {
43 | ci.cancel();
44 | }
45 | }
46 | }
47 |
48 | @Inject(method = "renderStatusEffectOverlay", at = @At("HEAD"), cancellable = true)
49 | public void renderStatusEffectOverlay(MatrixStack matrices, CallbackInfo ci) {
50 | NoOverlay noOverlay = Tensor.INSTANCE.MODULE_MANAGER.getModule(NoOverlay.class);
51 |
52 | if (noOverlay != null && noOverlay.isEnabled() && noOverlay.status.getValue()) ci.cancel();
53 | }
54 |
55 | @Inject(method = "renderVignetteOverlay", at = @At("HEAD"), cancellable = true)
56 | public void renderVignetteOverlay(Entity entity, CallbackInfo ci) {
57 | NoOverlay noOverlay = Tensor.INSTANCE.MODULE_MANAGER.getModule(NoOverlay.class);
58 |
59 | if (noOverlay != null && noOverlay.isEnabled() && noOverlay.vignette.getValue()) ci.cancel();
60 | }
61 |
62 | @Inject(method = "getCameraPlayer", at = @At("HEAD"), cancellable = true)
63 | public void getCameraPlayer(CallbackInfoReturnable cir) {
64 | if (this.isNull()) return;
65 |
66 | Freecam freecam = Tensor.INSTANCE.MODULE_MANAGER.getModule(Freecam.class);
67 |
68 | if (freecam != null && freecam.isEnabled()) {
69 | cir.setReturnValue(this.getPlayer());
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/InGameOverlayRendererMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.NoOverlay;
6 | import dev.tensor.misc.imp.Global;
7 | import net.minecraft.client.MinecraftClient;
8 | import net.minecraft.client.gui.hud.InGameOverlayRenderer;
9 | import net.minecraft.client.util.math.MatrixStack;
10 | import org.spongepowered.asm.mixin.Mixin;
11 | import org.spongepowered.asm.mixin.injection.At;
12 | import org.spongepowered.asm.mixin.injection.Inject;
13 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
14 |
15 | /**
16 | * @author IUDevman
17 | * @since 05-10-2021
18 | */
19 |
20 | @Mixin(value = InGameOverlayRenderer.class, priority = MixinPriority.VALUE)
21 | public final class InGameOverlayRendererMixin implements Global {
22 |
23 | @Inject(method = "renderOverlays", at = @At("HEAD"), cancellable = true)
24 | private static void renderOverlays(MinecraftClient minecraftClient, MatrixStack matrixStack, CallbackInfo ci) {
25 | NoOverlay noOverlay = Tensor.INSTANCE.MODULE_MANAGER.getModule(NoOverlay.class);
26 |
27 | if (noOverlay != null && noOverlay.isEnabled()) ci.cancel();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/KeyBindingMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.backend.events.KeyPressedEvent;
6 | import dev.tensor.misc.imp.Global;
7 | import net.minecraft.client.option.KeyBinding;
8 | import net.minecraft.client.util.InputUtil;
9 | import org.spongepowered.asm.mixin.Mixin;
10 | import org.spongepowered.asm.mixin.injection.At;
11 | import org.spongepowered.asm.mixin.injection.Inject;
12 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
13 |
14 | /**
15 | * @author Hoosiers
16 | * @since 04-13-2021
17 | */
18 |
19 | @Mixin(value = KeyBinding.class, priority = MixinPriority.VALUE)
20 | public final class KeyBindingMixin implements Global {
21 |
22 | @Inject(method = "onKeyPressed", at = @At("HEAD"))
23 | private static void onKeyPressed(InputUtil.Key key, CallbackInfo ci) {
24 | Tensor.INSTANCE.EVENT_HANDLER.call(new KeyPressedEvent(key.getCode()));
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/MinecraftClientMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.backend.events.ClientTickEvent;
6 | import dev.tensor.backend.events.DisconnectEvent;
7 | import dev.tensor.feature.modules.UnfocusedCPU;
8 | import dev.tensor.misc.imp.Global;
9 | import net.minecraft.client.MinecraftClient;
10 | import net.minecraft.util.profiler.Profiler;
11 | import org.spongepowered.asm.mixin.Mixin;
12 | import org.spongepowered.asm.mixin.Shadow;
13 | import org.spongepowered.asm.mixin.injection.At;
14 | import org.spongepowered.asm.mixin.injection.Inject;
15 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
16 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
17 |
18 | /**
19 | * @author IUDevman
20 | * @since 04-12-2021
21 | */
22 |
23 | @Mixin(value = MinecraftClient.class, priority = MixinPriority.VALUE)
24 | public abstract class MinecraftClientMixin implements Global {
25 |
26 | @Shadow
27 | private boolean windowFocused;
28 |
29 | @Shadow
30 | public abstract Profiler getProfiler();
31 |
32 | @Inject(method = "getFramerateLimit", at = @At("HEAD"), cancellable = true)
33 | public void getFramerateLimit(CallbackInfoReturnable cir) {
34 | UnfocusedCPU unfocusedCPU = Tensor.INSTANCE.MODULE_MANAGER.getModule(UnfocusedCPU.class);
35 |
36 | if (unfocusedCPU != null && unfocusedCPU.isEnabled() && !this.windowFocused) {
37 | cir.setReturnValue(1);
38 | }
39 | }
40 |
41 | @Inject(method = "getWindowTitle", at = @At("RETURN"), cancellable = true)
42 | public void getWindowTitle(CallbackInfoReturnable cir) {
43 | cir.setReturnValue(Tensor.INSTANCE.MOD_NAME + " " + Tensor.INSTANCE.MOD_VERSION + " (" + cir.getReturnValue() + ")");
44 | }
45 |
46 | @Inject(method = "tick", at = @At("HEAD"))
47 | public void tick(CallbackInfo ci) {
48 | if (this.isNull()) return;
49 |
50 | this.getProfiler().push(Tensor.INSTANCE.MOD_NAME);
51 | Tensor.INSTANCE.EVENT_HANDLER.call(new ClientTickEvent());
52 | this.getProfiler().pop();
53 | }
54 |
55 | @Inject(method = "stop", at = @At("HEAD"))
56 | public void stop(CallbackInfo ci) {
57 | Tensor.INSTANCE.CONFIG_MANAGER.save();
58 | }
59 |
60 | @Inject(method = "cleanUpAfterCrash", at = @At("HEAD"))
61 | public void cleanUpAfterCrash(CallbackInfo ci) {
62 | Tensor.INSTANCE.CONFIG_MANAGER.save();
63 | }
64 |
65 | @Inject(method = "disconnect()V", at = @At("HEAD"))
66 | public void disconnect(CallbackInfo ci) {
67 | Tensor.INSTANCE.EVENT_HANDLER.call(new DisconnectEvent());
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/NarratorManagerMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.AntiNarrator;
6 | import dev.tensor.misc.imp.Global;
7 | import net.minecraft.client.option.NarratorMode;
8 | import net.minecraft.client.util.NarratorManager;
9 | import org.spongepowered.asm.mixin.Mixin;
10 | import org.spongepowered.asm.mixin.injection.At;
11 | import org.spongepowered.asm.mixin.injection.Inject;
12 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
13 |
14 | /**
15 | * @author IUDevman
16 | * @since 07-21-2021
17 | */
18 |
19 | @Mixin(value = NarratorManager.class, priority = MixinPriority.VALUE)
20 | public final class NarratorManagerMixin implements Global {
21 |
22 | @Inject(method = "getNarratorOption", at = @At("HEAD"), cancellable = true)
23 | private static void getNarratorOption(CallbackInfoReturnable cir) {
24 | AntiNarrator antiNarrator = Tensor.INSTANCE.MODULE_MANAGER.getModule(AntiNarrator.class);
25 |
26 | if (antiNarrator != null && antiNarrator.isEnabled()) {
27 | cir.setReturnValue(NarratorMode.OFF);
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/PlayerEntityMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.SafeWalk;
6 | import dev.tensor.misc.imp.Global;
7 | import net.minecraft.entity.player.PlayerEntity;
8 | import org.spongepowered.asm.mixin.Mixin;
9 | import org.spongepowered.asm.mixin.injection.At;
10 | import org.spongepowered.asm.mixin.injection.Inject;
11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
12 |
13 | /**
14 | * @author IUDevman
15 | * @since 07-20-2021
16 | */
17 |
18 | @Mixin(value = PlayerEntity.class, priority = MixinPriority.VALUE)
19 | public final class PlayerEntityMixin implements Global {
20 |
21 | @Inject(method = "clipAtLedge", at = @At("HEAD"), cancellable = true)
22 | public void clipAtLedge(CallbackInfoReturnable cir) {
23 | if (this.isNull()) return;
24 |
25 | SafeWalk safeWalk = Tensor.INSTANCE.MODULE_MANAGER.getModule(SafeWalk.class);
26 |
27 | if (safeWalk != null && safeWalk.isEnabled()) {
28 |
29 | if (!safeWalk.fluids.getValue() && (this.getPlayer().isInLava() || this.getPlayer().isTouchingWater())) {
30 | return;
31 | }
32 |
33 | cir.setReturnValue(true);
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/PlayerEntityRendererMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.ViewModel;
6 | import dev.tensor.misc.imp.Global;
7 | import net.minecraft.client.network.AbstractClientPlayerEntity;
8 | import net.minecraft.client.render.VertexConsumerProvider;
9 | import net.minecraft.client.render.entity.PlayerEntityRenderer;
10 | import net.minecraft.client.util.math.MatrixStack;
11 | import org.spongepowered.asm.mixin.Mixin;
12 | import org.spongepowered.asm.mixin.injection.At;
13 | import org.spongepowered.asm.mixin.injection.Inject;
14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
15 |
16 | /**
17 | * @author IUDevman
18 | * @since 05-14-2021
19 | */
20 |
21 | @Mixin(value = PlayerEntityRenderer.class, priority = MixinPriority.VALUE)
22 | public final class PlayerEntityRendererMixin implements Global {
23 |
24 | @Inject(method = "renderRightArm", at = @At("HEAD"), cancellable = true)
25 | public void renderRightArm(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, AbstractClientPlayerEntity player, CallbackInfo ci) {
26 | if (this.isNull() || player != this.getPlayer()) return;
27 |
28 | ViewModel viewModel = Tensor.INSTANCE.MODULE_MANAGER.getModule(ViewModel.class);
29 |
30 | if (viewModel != null && viewModel.isEnabled() && !viewModel.renderEmptyMainHand.getValue()) {
31 | ci.cancel();
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/PowderSnowBlockMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.Jesus;
6 | import dev.tensor.misc.imp.Global;
7 | import net.minecraft.block.BlockState;
8 | import net.minecraft.block.PowderSnowBlock;
9 | import net.minecraft.block.ShapeContext;
10 | import net.minecraft.client.MinecraftClient;
11 | import net.minecraft.entity.Entity;
12 | import net.minecraft.util.math.BlockPos;
13 | import net.minecraft.util.shape.VoxelShape;
14 | import net.minecraft.util.shape.VoxelShapes;
15 | import net.minecraft.world.BlockView;
16 | import org.spongepowered.asm.mixin.Mixin;
17 | import org.spongepowered.asm.mixin.injection.At;
18 | import org.spongepowered.asm.mixin.injection.Inject;
19 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
20 |
21 | /**
22 | * @author IUDevman
23 | * @since 07-29-2021
24 | */
25 |
26 | @Mixin(value = PowderSnowBlock.class, priority = MixinPriority.VALUE)
27 | public final class PowderSnowBlockMixin implements Global {
28 |
29 | @Inject(method = "canWalkOnPowderSnow", at = @At("HEAD"), cancellable = true)
30 | private static void canWalkOnPowderSnow(Entity entity, CallbackInfoReturnable cir) {
31 | MinecraftClient minecraft = MinecraftClient.getInstance();
32 |
33 | if (minecraft == null || minecraft.player == null || minecraft.player != entity) return;
34 |
35 | Jesus jesus = Tensor.INSTANCE.MODULE_MANAGER.getModule(Jesus.class);
36 |
37 | if (jesus != null && jesus.isEnabled() && jesus.powderedSnow.getValue()) {
38 | cir.setReturnValue(true);
39 | }
40 | }
41 |
42 | @Inject(method = "getCollisionShape", at = @At("HEAD"), cancellable = true)
43 | public void getCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable cir) {
44 | if (this.isNull() || this.getPlayer().inPowderSnow) return;
45 |
46 | Jesus jesus = Tensor.INSTANCE.MODULE_MANAGER.getModule(Jesus.class);
47 |
48 | if (jesus != null && jesus.isEnabled() && jesus.powderedSnow.getValue() && jesus.cancelOnFall.getValue() && this.getPlayer().fallDistance >= 3) {
49 |
50 | cir.setReturnValue(VoxelShapes.fullCube());
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/RecipeToastMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.NoOverlay;
6 | import dev.tensor.misc.imp.Global;
7 | import net.minecraft.client.toast.RecipeToast;
8 | import net.minecraft.client.toast.Toast;
9 | import net.minecraft.client.toast.ToastManager;
10 | import net.minecraft.client.util.math.MatrixStack;
11 | import org.spongepowered.asm.mixin.Mixin;
12 | import org.spongepowered.asm.mixin.injection.At;
13 | import org.spongepowered.asm.mixin.injection.Inject;
14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
15 |
16 | /**
17 | * @author IUDevman
18 | * @since 05-25-2021
19 | */
20 |
21 | @Mixin(value = RecipeToast.class, priority = MixinPriority.VALUE)
22 | public final class RecipeToastMixin implements Global {
23 |
24 | @Inject(method = "draw", at = @At("HEAD"), cancellable = true)
25 | public void draw(MatrixStack matrices, ToastManager manager, long startTime, CallbackInfoReturnable cir) {
26 | NoOverlay noOverlay = Tensor.INSTANCE.MODULE_MANAGER.getModule(NoOverlay.class);
27 |
28 | if (noOverlay != null && noOverlay.isEnabled() && noOverlay.toast.getValue()) {
29 | cir.setReturnValue(Toast.Visibility.HIDE);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/RenderTickCounterMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.Timer;
6 | import dev.tensor.misc.imp.Global;
7 | import net.minecraft.client.render.RenderTickCounter;
8 | import org.spongepowered.asm.mixin.Mixin;
9 | import org.spongepowered.asm.mixin.Shadow;
10 | import org.spongepowered.asm.mixin.injection.At;
11 | import org.spongepowered.asm.mixin.injection.Inject;
12 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
13 |
14 | /**
15 | * @author IUDevman
16 | * @since 04-14-2021
17 | */
18 |
19 | @Mixin(value = RenderTickCounter.class, priority = MixinPriority.VALUE)
20 | public final class RenderTickCounterMixin implements Global {
21 |
22 | @Shadow
23 | public float lastFrameDuration;
24 |
25 | @Inject(method = "beginRenderTick", at = @At(value = "FIELD", target = "Lnet/minecraft/client/render/RenderTickCounter;prevTimeMillis:J"))
26 | public void beginRenderTick(long timeMillis, CallbackInfoReturnable cir) {
27 | Timer timer = Tensor.INSTANCE.MODULE_MANAGER.getModule(Timer.class);
28 |
29 | if (timer != null && timer.isEnabled()) {
30 | this.lastFrameDuration *= timer.multiplier.getValue();
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/ScreenMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.DeathDebug;
6 | import dev.tensor.misc.imp.Global;
7 | import net.minecraft.client.gui.screen.Screen;
8 | import net.minecraft.client.util.InputUtil;
9 | import org.spongepowered.asm.mixin.Mixin;
10 | import org.spongepowered.asm.mixin.injection.At;
11 | import org.spongepowered.asm.mixin.injection.Inject;
12 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
13 |
14 | /**
15 | * @author IUDevman
16 | * @since 08-07-2021
17 | */
18 |
19 | @Mixin(value = Screen.class, priority = MixinPriority.VALUE)
20 | public final class ScreenMixin implements Global {
21 |
22 | @Inject(method = "keyPressed", at = @At("HEAD"))
23 | public void keyPressed(int keyCode, int scanCode, int modifiers, CallbackInfoReturnable cir) {
24 | if (this.isNull() || !this.getPlayer().isDead() || keyCode != InputUtil.GLFW_KEY_F3) return;
25 |
26 | DeathDebug deathDebug = Tensor.INSTANCE.MODULE_MANAGER.getModule(DeathDebug.class);
27 |
28 | if (deathDebug != null && deathDebug.isEnabled()) {
29 | this.getMinecraft().options.debugEnabled = !this.getMinecraft().options.debugEnabled;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/SlimeBlockMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.NoSlow;
6 | import dev.tensor.misc.imp.Global;
7 | import net.minecraft.block.BlockState;
8 | import net.minecraft.block.SlimeBlock;
9 | import net.minecraft.entity.Entity;
10 | import net.minecraft.util.math.BlockPos;
11 | import net.minecraft.world.World;
12 | import org.spongepowered.asm.mixin.Mixin;
13 | import org.spongepowered.asm.mixin.injection.At;
14 | import org.spongepowered.asm.mixin.injection.Inject;
15 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
16 |
17 | /**
18 | * @author IUDevman
19 | * @since 05-12-2021
20 | */
21 |
22 | @Mixin(value = SlimeBlock.class, priority = MixinPriority.VALUE)
23 | public final class SlimeBlockMixin implements Global {
24 |
25 | @Inject(method = "onSteppedOn", at = @At("HEAD"), cancellable = true)
26 | public void onSteppedOn(World world, BlockPos pos, BlockState state, Entity entity, CallbackInfo ci) {
27 | if (this.isNull() || entity != this.getPlayer()) return;
28 |
29 | NoSlow noSlow = Tensor.INSTANCE.MODULE_MANAGER.getModule(NoSlow.class);
30 |
31 | if (noSlow != null && noSlow.isEnabled() && noSlow.blocks.getValue()) ci.cancel();
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/SoundManagerMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.backend.events.PlaySoundEvent;
6 | import dev.tensor.misc.imp.Global;
7 | import net.minecraft.client.sound.SoundInstance;
8 | import net.minecraft.client.sound.SoundManager;
9 | import org.spongepowered.asm.mixin.Mixin;
10 | import org.spongepowered.asm.mixin.injection.At;
11 | import org.spongepowered.asm.mixin.injection.Inject;
12 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
13 |
14 | /**
15 | * @author IUDevman
16 | * @since 05-25-2021
17 | */
18 |
19 | @Mixin(value = SoundManager.class, priority = MixinPriority.VALUE)
20 | public final class SoundManagerMixin implements Global {
21 |
22 | @Inject(method = "play(Lnet/minecraft/client/sound/SoundInstance;)V", at = @At("HEAD"), cancellable = true)
23 | public void playNoDelay(SoundInstance sound, CallbackInfo ci) {
24 | PlaySoundEvent playSoundEvent = new PlaySoundEvent(sound);
25 |
26 | Tensor.INSTANCE.EVENT_HANDLER.call(playSoundEvent);
27 | if (playSoundEvent.isCancelled()) ci.cancel();
28 | }
29 |
30 | @Inject(method = "play(Lnet/minecraft/client/sound/SoundInstance;I)V", at = @At("HEAD"), cancellable = true)
31 | public void playWithDelay(SoundInstance sound, int delay, CallbackInfo ci) {
32 | PlaySoundEvent playSoundEvent = new PlaySoundEvent(sound);
33 |
34 | Tensor.INSTANCE.EVENT_HANDLER.call(playSoundEvent);
35 | if (playSoundEvent.isCancelled()) ci.cancel();
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/SweetBerryBushBlockMixin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.MixinPriority;
5 | import dev.tensor.feature.modules.NoSlow;
6 | import dev.tensor.misc.imp.Global;
7 | import net.minecraft.block.BlockState;
8 | import net.minecraft.block.SweetBerryBushBlock;
9 | import net.minecraft.entity.Entity;
10 | import net.minecraft.util.math.BlockPos;
11 | import net.minecraft.world.World;
12 | import org.spongepowered.asm.mixin.Mixin;
13 | import org.spongepowered.asm.mixin.injection.At;
14 | import org.spongepowered.asm.mixin.injection.Inject;
15 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
16 |
17 | /**
18 | * @author IUDevman
19 | * @since 05-09-2021
20 | */
21 |
22 | @Mixin(value = SweetBerryBushBlock.class, priority = MixinPriority.VALUE)
23 | public final class SweetBerryBushBlockMixin implements Global {
24 |
25 | @Inject(method = "onEntityCollision", at = @At("HEAD"), cancellable = true)
26 | public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity, CallbackInfo ci) {
27 | if (this.isNull() || entity != this.getPlayer()) return;
28 |
29 | NoSlow noSlow = Tensor.INSTANCE.MODULE_MANAGER.getModule(NoSlow.class);
30 |
31 | if (noSlow != null && noSlow.isEnabled() && noSlow.sticky.getValue()) ci.cancel();
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/accessors/ChatHudAccessor.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins.accessors;
2 |
3 | import dev.tensor.backend.MixinPriority;
4 | import net.minecraft.client.gui.hud.ChatHud;
5 | import net.minecraft.text.Text;
6 | import org.spongepowered.asm.mixin.Mixin;
7 | import org.spongepowered.asm.mixin.gen.Invoker;
8 |
9 | /**
10 | * @author IUDevman
11 | * @since 04-17-2021
12 | */
13 |
14 | @Mixin(value = ChatHud.class, priority = MixinPriority.VALUE)
15 | public interface ChatHudAccessor {
16 |
17 | @Invoker(value = "addMessage")
18 | void addReplaceable(Text text, int id);
19 |
20 | @Invoker(value = "removeMessage")
21 | void removeReplaceable(int id);
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/accessors/ChatMessageC2SPacketAccessor.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins.accessors;
2 |
3 | import dev.tensor.backend.MixinPriority;
4 | import net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket;
5 | import org.spongepowered.asm.mixin.Mixin;
6 | import org.spongepowered.asm.mixin.Mutable;
7 | import org.spongepowered.asm.mixin.gen.Accessor;
8 |
9 | /**
10 | * @author IUDevman
11 | * @since 05-14-2021
12 | */
13 |
14 | @Mixin(value = ChatMessageC2SPacket.class, priority = MixinPriority.VALUE)
15 | public interface ChatMessageC2SPacketAccessor {
16 |
17 | @Mutable
18 | @Accessor(value = "chatMessage")
19 | void setChatMessage(String chatMessage);
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/accessors/ClientPlayerEntityAccessor.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins.accessors;
2 |
3 | import dev.tensor.backend.MixinPriority;
4 | import net.minecraft.client.input.Input;
5 | import net.minecraft.client.network.ClientPlayerEntity;
6 | import org.spongepowered.asm.mixin.Mixin;
7 | import org.spongepowered.asm.mixin.gen.Accessor;
8 |
9 | /**
10 | * @author IUDevman
11 | * @since 05-17-2021
12 | */
13 |
14 | @Mixin(value = ClientPlayerEntity.class, priority = MixinPriority.VALUE)
15 | public interface ClientPlayerEntityAccessor {
16 |
17 | @Accessor(value = "input")
18 | void setInput(Input input);
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/accessors/CloseHandledScreenC2SAccessor.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins.accessors;
2 |
3 | import dev.tensor.backend.MixinPriority;
4 | import net.minecraft.network.packet.c2s.play.CloseHandledScreenC2SPacket;
5 | import org.spongepowered.asm.mixin.Mixin;
6 | import org.spongepowered.asm.mixin.Mutable;
7 | import org.spongepowered.asm.mixin.gen.Accessor;
8 |
9 | /**
10 | * @author IUDevman
11 | * @since 05-12-2021
12 | */
13 |
14 | @Mixin(value = CloseHandledScreenC2SPacket.class, priority = MixinPriority.VALUE)
15 | public interface CloseHandledScreenC2SAccessor {
16 |
17 | @Mutable
18 | @Accessor(value = "syncId")
19 | int getSyncId();
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/accessors/EntityVelocityUpdateS2CPacketAccessor.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins.accessors;
2 |
3 | import dev.tensor.backend.MixinPriority;
4 | import net.minecraft.network.packet.s2c.play.EntityVelocityUpdateS2CPacket;
5 | import org.spongepowered.asm.mixin.Mixin;
6 | import org.spongepowered.asm.mixin.Mutable;
7 | import org.spongepowered.asm.mixin.gen.Accessor;
8 |
9 | /**
10 | * @author IUDevman
11 | * @since 05-13-2021
12 | */
13 |
14 | @Mixin(value = EntityVelocityUpdateS2CPacket.class, priority = MixinPriority.VALUE)
15 | public interface EntityVelocityUpdateS2CPacketAccessor {
16 |
17 | @Mutable
18 | @Accessor(value = "velocityX")
19 | void setVelocityX(int velocityX);
20 |
21 | @Mutable
22 | @Accessor(value = "velocityY")
23 | void setVelocityY(int velocityY);
24 |
25 | @Mutable
26 | @Accessor(value = "velocityZ")
27 | void setVelocityZ(int velocityZ);
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/accessors/ExplosionS2CPacketAccessor.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins.accessors;
2 |
3 | import dev.tensor.backend.MixinPriority;
4 | import net.minecraft.network.packet.s2c.play.ExplosionS2CPacket;
5 | import org.spongepowered.asm.mixin.Mixin;
6 | import org.spongepowered.asm.mixin.Mutable;
7 | import org.spongepowered.asm.mixin.gen.Accessor;
8 |
9 | /**
10 | * @author IUDevman
11 | * @since 05-13-2021
12 | */
13 |
14 | @Mixin(value = ExplosionS2CPacket.class, priority = MixinPriority.VALUE)
15 | public interface ExplosionS2CPacketAccessor {
16 |
17 | @Mutable
18 | @Accessor(value = "playerVelocityX")
19 | void setPlayerVelocityX(float playerVelocityX);
20 |
21 | @Mutable
22 | @Accessor(value = "playerVelocityY")
23 | void setPlayerVelocityY(float playerVelocityY);
24 |
25 | @Mutable
26 | @Accessor(value = "playerVelocityZ")
27 | void setPlayerVelocityZ(float playerVelocityZ);
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/accessors/KeyBindingAccessor.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins.accessors;
2 |
3 | import dev.tensor.backend.MixinPriority;
4 | import net.minecraft.client.option.KeyBinding;
5 | import net.minecraft.client.util.InputUtil;
6 | import org.spongepowered.asm.mixin.Mixin;
7 | import org.spongepowered.asm.mixin.gen.Accessor;
8 |
9 | /**
10 | * @author IUDevman
11 | * @since 07-21-2021
12 | */
13 |
14 | @Mixin(value = KeyBinding.class, priority = MixinPriority.VALUE)
15 | public interface KeyBindingAccessor {
16 |
17 | @Accessor(value = "boundKey")
18 | InputUtil.Key getBoundKey();
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/accessors/MinecraftClientAccessor.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins.accessors;
2 |
3 | import dev.tensor.backend.MixinPriority;
4 | import net.minecraft.client.MinecraftClient;
5 | import org.spongepowered.asm.mixin.Mixin;
6 | import org.spongepowered.asm.mixin.gen.Accessor;
7 |
8 | /**
9 | * @author IUDevman
10 | * @since 05-21-2021
11 | */
12 |
13 | @Mixin(value = MinecraftClient.class, priority = MixinPriority.VALUE)
14 | public interface MinecraftClientAccessor {
15 |
16 | @Accessor(value = "itemUseCooldown")
17 | void setItemUseCooldown(int itemUseCooldown);
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/backend/mixins/accessors/PlayerMoveC2SPacketAccessor.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.backend.mixins.accessors;
2 |
3 | import dev.tensor.backend.MixinPriority;
4 | import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
5 | import org.spongepowered.asm.mixin.Mixin;
6 | import org.spongepowered.asm.mixin.Mutable;
7 | import org.spongepowered.asm.mixin.gen.Accessor;
8 |
9 | /**
10 | * @author IUDevman
11 | * @since 05-14-2021
12 | */
13 |
14 | @Mixin(value = PlayerMoveC2SPacket.class, priority = MixinPriority.VALUE)
15 | public interface PlayerMoveC2SPacketAccessor {
16 |
17 | @Mutable
18 | @Accessor(value = "onGround")
19 | void setOnGround(boolean onGround);
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/commands/Bind.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.commands;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.misc.imp.Command;
5 | import dev.tensor.misc.imp.Module;
6 | import net.minecraft.client.util.InputUtil;
7 | import net.minecraft.util.Formatting;
8 | import org.lwjgl.glfw.GLFW;
9 |
10 | import java.util.Locale;
11 |
12 | /**
13 | * @author IUDevman
14 | * @since 04-27-2021
15 | */
16 |
17 | public final class Bind implements Command {
18 |
19 | @Override
20 | public String getName() {
21 | return "Bind";
22 | }
23 |
24 | @Override
25 | public String getMarker() {
26 | return "(" + Formatting.YELLOW + this.getName() + Formatting.GRAY + ") ";
27 | }
28 |
29 | @Override
30 | public String getSyntax() {
31 | return "{name} [module] [key/none]";
32 | }
33 |
34 | @Override
35 | public int getID() {
36 | return 672;
37 | }
38 |
39 | @Override
40 | public void onCommand(String[] message) {
41 | if (message == null || message.length < 2) {
42 | this.sendReplaceableClientMessage(this.getMarker() + "No module inputted!", this.getID(), true);
43 | return;
44 | } else if (message.length < 3) {
45 | this.sendReplaceableClientMessage(this.getMarker() + "No bind inputted!", this.getID(), true);
46 | return;
47 | }
48 |
49 | String moduleName = message[1];
50 |
51 | Module module = Tensor.INSTANCE.MODULE_MANAGER.getModule(moduleName);
52 |
53 | if (module == null) {
54 | this.sendReplaceableClientMessage(this.getMarker() + "Invalid module (" + Formatting.YELLOW + moduleName + Formatting.GRAY + ")!", this.getID(), true);
55 | return;
56 | }
57 |
58 | String bindName = message[2].toLowerCase(Locale.ROOT);
59 |
60 | try {
61 | int keyCode = GLFW.GLFW_KEY_UNKNOWN;
62 |
63 | if (!bindName.equalsIgnoreCase("none")) {
64 | keyCode = InputUtil.fromTranslationKey("key.keyboard." + bindName).getCode();
65 | }
66 |
67 | module.setBind(keyCode);
68 | this.sendReplaceableClientMessage(this.getMarker() + "Set bind for: " + module.getName() + " (" + Formatting.GREEN + bindName + Formatting.GRAY + ")!", this.getID(), true);
69 |
70 | } catch (IllegalArgumentException ignored) {
71 | this.sendReplaceableClientMessage(this.getMarker() + "Invalid bind (" + Formatting.YELLOW + bindName + Formatting.GRAY + ")!", this.getID(), true);
72 | }
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/commands/Clear.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.commands;
2 |
3 | import dev.tensor.misc.imp.Command;
4 | import net.minecraft.util.Formatting;
5 |
6 | /**
7 | * @author SrgantMooMoo
8 | * @since 08-09-2021
9 | */
10 |
11 | public final class Clear implements Command {
12 |
13 | @Override
14 | public String getName() {
15 | return "Clear";
16 | }
17 |
18 | @Override
19 | public String getMarker() {
20 | return "(" + Formatting.YELLOW + this.getName() + Formatting.GRAY + ") ";
21 | }
22 |
23 | @Override
24 | public String getSyntax() {
25 | return "{name}";
26 | }
27 |
28 | @Override
29 | public int getID() {
30 | return 686;
31 | }
32 |
33 | @Override
34 | public void onCommand(String[] message) {
35 | this.getChatHud().clear(true);
36 | this.sendReplaceableClientMessage(this.getMarker() + "Cleared the chat!", this.getID(), true);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/commands/Commands.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.commands;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.misc.imp.Command;
5 | import net.minecraft.util.Formatting;
6 |
7 | import java.util.ArrayList;
8 |
9 | /**
10 | * @author IUDevman
11 | * @since 04-17-2021
12 | */
13 |
14 | public final class Commands implements Command {
15 |
16 | @Override
17 | public String getName() {
18 | return "Commands";
19 | }
20 |
21 | @Override
22 | public String getMarker() {
23 | return "(" + Formatting.YELLOW + this.getName() + Formatting.GRAY + ") ";
24 | }
25 |
26 | @Override
27 | public String getSyntax() {
28 | return "{name} [page]";
29 | }
30 |
31 | @Override
32 | public int getID() {
33 | return 664;
34 | }
35 |
36 | @Override
37 | public void onCommand(String[] message) {
38 | ArrayList commands = Tensor.INSTANCE.COMMAND_MANAGER.getCommands();
39 |
40 | int commandPages = (int) Math.ceil((double) commands.size() / 4);
41 |
42 | if (commandPages == 0) commandPages = 1;
43 |
44 | int startingPage = 1;
45 |
46 | if (message != null && message.length >= 2) {
47 | try {
48 | startingPage = Integer.parseInt(message[1]);
49 |
50 | } catch (NumberFormatException ignored) {
51 |
52 | }
53 | }
54 |
55 | if (startingPage <= 0) {
56 | startingPage = 1;
57 | } else if (startingPage > commandPages) {
58 | startingPage = commandPages;
59 | }
60 |
61 | this.sendReplaceableClientMessage(this.getMarker() + "Available commands (" + Formatting.GREEN + commands.size() + Formatting.GRAY + " total, page " + Formatting.YELLOW + startingPage + "/" + commandPages + Formatting.GRAY + "):", this.getID(), true);
62 |
63 | int count = 0;
64 |
65 | for (int i = (startingPage * 4) - 4; i < startingPage * 4; i++) {
66 | count += 1;
67 |
68 | if (i >= commands.size()) {
69 | this.removeReplaceableClientMessage(this.getID() - count);
70 | continue;
71 | }
72 |
73 | Command command = commands.get(i);
74 |
75 | String syntax = command.getSyntax().replace("{name}", Formatting.YELLOW + command.getName() + Formatting.GRAY + ":");
76 |
77 | if (command.getSyntax().equalsIgnoreCase("{name}")) {
78 | syntax += " none";
79 | }
80 |
81 | this.sendReplaceableClientMessage(syntax, this.getID() - count, true);
82 | }
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/commands/Config.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.commands;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.misc.imp.Command;
5 | import net.minecraft.util.Formatting;
6 |
7 | import java.util.Locale;
8 |
9 | /**
10 | * @author IUDevman
11 | * @since 05-19-2021
12 | */
13 |
14 | public final class Config implements Command {
15 |
16 | @Override
17 | public String getName() {
18 | return "Config";
19 | }
20 |
21 | @Override
22 | public String getMarker() {
23 | return "(" + Formatting.YELLOW + this.getName() + Formatting.GRAY + ") ";
24 | }
25 |
26 | @Override
27 | public String getSyntax() {
28 | return "{name} [save/reload]";
29 | }
30 |
31 | @Override
32 | public int getID() {
33 | return 673;
34 | }
35 |
36 | @Override
37 | public void onCommand(String[] message) {
38 | if (message == null || message.length < 2) {
39 | this.sendReplaceableClientMessage(this.getMarker() + "No argument inputted!", this.getID(), true);
40 | return;
41 | }
42 |
43 | String argument = message[1];
44 |
45 | switch (argument.toLowerCase(Locale.ROOT)) {
46 | case "save": {
47 | Tensor.INSTANCE.CONFIG_MANAGER.save();
48 | this.sendReplaceableClientMessage(this.getMarker() + "Saved config!", this.getID(), true);
49 | break;
50 | }
51 | case "reload": {
52 | Tensor.INSTANCE.CONFIG_MANAGER.load();
53 | this.sendReplaceableClientMessage(this.getMarker() + "Reloaded config!", this.getID(), true);
54 | break;
55 | }
56 | default: {
57 | this.sendReplaceableClientMessage(this.getMarker() + "Invalid argument (" + Formatting.YELLOW + argument + Formatting.GRAY + ")!", this.getID(), true);
58 | break;
59 | }
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/commands/Drawn.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.commands;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.misc.imp.Command;
5 | import dev.tensor.misc.imp.Module;
6 | import net.minecraft.util.Formatting;
7 |
8 | /**
9 | * @author IUDevman
10 | * @since 05-21-2021
11 | */
12 |
13 | public final class Drawn implements Command {
14 |
15 | @Override
16 | public String getName() {
17 | return "Drawn";
18 | }
19 |
20 | @Override
21 | public String getMarker() {
22 | return "(" + Formatting.YELLOW + this.getName() + Formatting.GRAY + ") ";
23 | }
24 |
25 | @Override
26 | public String getSyntax() {
27 | return "{name} [module]";
28 | }
29 |
30 | @Override
31 | public int getID() {
32 | return 677;
33 | }
34 |
35 | @Override
36 | public void onCommand(String[] message) {
37 | if (message == null || message.length < 2) {
38 | this.sendReplaceableClientMessage(this.getMarker() + "No module inputted!", this.getID(), true);
39 | return;
40 | }
41 |
42 | String moduleName = message[1];
43 |
44 | Module module = Tensor.INSTANCE.MODULE_MANAGER.getModule(moduleName);
45 |
46 | if (module == null) {
47 | this.sendReplaceableClientMessage(this.getMarker() + "Invalid module (" + Formatting.YELLOW + moduleName + Formatting.GRAY + ")!", this.getID(), true);
48 | return;
49 | }
50 |
51 | module.setDrawn(!module.isDrawn());
52 |
53 | String value = module.isMessages() ? Formatting.GREEN + "true" : Formatting.RED + "false";
54 | this.sendReplaceableClientMessage(this.getMarker() + "Set drawn: " + module.getName() + " (" + value + Formatting.GRAY + ")!", this.getID(), true);
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/commands/Help.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.commands;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.feature.modules.ClickGUI;
5 | import dev.tensor.misc.imp.Command;
6 | import net.minecraft.client.util.InputUtil;
7 | import net.minecraft.util.Formatting;
8 |
9 | import java.util.Locale;
10 |
11 | /**
12 | * @author IUDevman
13 | * @since 05-19-2021
14 | */
15 |
16 | public final class Help implements Command {
17 |
18 | @Override
19 | public String getName() {
20 | return "Help";
21 | }
22 |
23 | @Override
24 | public String getMarker() {
25 | return "(" + Formatting.YELLOW + this.getName() + Formatting.GRAY + ") ";
26 | }
27 |
28 | @Override
29 | public String getSyntax() {
30 | return "{name}";
31 | }
32 |
33 | @Override
34 | public int getID() {
35 | return 674;
36 | }
37 |
38 | @Override
39 | public void onCommand(String[] message) {
40 | ClickGUI clickGUI = Tensor.INSTANCE.MODULE_MANAGER.getModule(ClickGUI.class);
41 |
42 | if (clickGUI == null) {
43 | this.sendReplaceableClientMessage(this.getMarker() + "Failed to dispatch command... you're probably reloading the client!", this.getID(), true);
44 | return;
45 | }
46 |
47 | String bind = InputUtil.Type.KEYSYM.createFromCode(clickGUI.getBind()).getTranslationKey().replace("key.keyboard.", "").replace("unknown", "none").toUpperCase(Locale.ROOT);
48 |
49 | this.sendClientMessage(this.getMarker() + "Welcome to " + Tensor.INSTANCE.MOD_NAME + " (" + Formatting.GREEN + Tensor.INSTANCE.MOD_VERSION + Formatting.GRAY + "):", true);
50 | this.sendClientMessage("The current ClickGUI bind is " + Formatting.YELLOW + bind, true);
51 | this.sendClientMessage("The current command prefix is " + Formatting.YELLOW + Tensor.INSTANCE.COMMAND_MANAGER.getPrefix(), true);
52 | this.sendClientMessage("Use " + Formatting.YELLOW + Tensor.INSTANCE.COMMAND_MANAGER.getPrefix() + "commands" + Formatting.GRAY + " to see a list of commands", true);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/commands/Messages.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.commands;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.misc.imp.Command;
5 | import dev.tensor.misc.imp.Module;
6 | import net.minecraft.util.Formatting;
7 |
8 | /**
9 | * @author IUDevman
10 | * @since 04-17-2021
11 | */
12 |
13 | public final class Messages implements Command {
14 |
15 | @Override
16 | public String getName() {
17 | return "Messages";
18 | }
19 |
20 | @Override
21 | public String getMarker() {
22 | return "(" + Formatting.YELLOW + this.getName() + Formatting.GRAY + ") ";
23 | }
24 |
25 | @Override
26 | public String getSyntax() {
27 | return "{name} [module]";
28 | }
29 |
30 | @Override
31 | public int getID() {
32 | return 670;
33 | }
34 |
35 | @Override
36 | public void onCommand(String[] message) {
37 | if (message == null || message.length < 2) {
38 | this.sendReplaceableClientMessage(this.getMarker() + "No module inputted!", this.getID(), true);
39 | return;
40 | }
41 |
42 | String moduleName = message[1];
43 |
44 | Module module = Tensor.INSTANCE.MODULE_MANAGER.getModule(moduleName);
45 |
46 | if (module == null) {
47 | this.sendReplaceableClientMessage(this.getMarker() + "Invalid module (" + Formatting.YELLOW + moduleName + Formatting.GRAY + ")!", this.getID(), true);
48 | return;
49 | }
50 |
51 | module.setMessages(!module.isMessages());
52 |
53 | String value = module.isMessages() ? Formatting.GREEN + "true" : Formatting.RED + "false";
54 | this.sendReplaceableClientMessage(this.getMarker() + "Toggled messages: " + module.getName() + " (" + value + Formatting.GRAY + ")!", this.getID(), true);
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/commands/Modules.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.commands;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.misc.imp.Category;
5 | import dev.tensor.misc.imp.Command;
6 | import net.minecraft.util.Formatting;
7 |
8 | import java.util.ArrayList;
9 | import java.util.Arrays;
10 |
11 | /**
12 | * @author IUDevman
13 | * @since 07-04-2021
14 | */
15 |
16 | public final class Modules implements Command {
17 |
18 | @Override
19 | public String getName() {
20 | return "Modules";
21 | }
22 |
23 | @Override
24 | public String getMarker() {
25 | return "(" + Formatting.YELLOW + this.getName() + Formatting.GRAY + ") ";
26 | }
27 |
28 | @Override
29 | public String getSyntax() {
30 | return "{name}";
31 | }
32 |
33 | @Override
34 | public int getID() {
35 | return 684;
36 | }
37 |
38 | @Override
39 | public void onCommand(String[] message) {
40 | this.sendClientMessage(this.getMarker() + "Available modules:", true);
41 |
42 | Arrays.stream(Category.values()).forEach(category -> {
43 |
44 | ArrayList modules = new ArrayList<>();
45 |
46 | Tensor.INSTANCE.MODULE_MANAGER.getModulesInCategory(category).forEach(module -> modules.add((module.isEnabled() ? Formatting.GREEN : "") + module.getName() + Formatting.GRAY));
47 |
48 | int count = modules.size();
49 |
50 | String moduleString = modules.toString().replace("[", "").replace("]", "");
51 |
52 | this.sendClientMessage(Formatting.YELLOW + category.name() + Formatting.GRAY + " (" + Formatting.YELLOW + count + Formatting.GRAY + "): " + moduleString, true);
53 | });
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/commands/Ping.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.commands;
2 |
3 | import dev.tensor.misc.imp.Command;
4 | import net.minecraft.client.network.PlayerListEntry;
5 | import net.minecraft.util.Formatting;
6 |
7 | /**
8 | * @author IUDevman
9 | * @since 04-12-2021
10 | */
11 |
12 | public final class Ping implements Command {
13 |
14 | @Override
15 | public String getName() {
16 | return "Ping";
17 | }
18 |
19 | @Override
20 | public String getMarker() {
21 | return "(" + Formatting.YELLOW + this.getName() + Formatting.GRAY + ") ";
22 | }
23 |
24 | @Override
25 | public String getSyntax() {
26 | return "{name} [player]";
27 | }
28 |
29 | @Override
30 | public int getID() {
31 | return 669;
32 | }
33 |
34 | @Override
35 | public void onCommand(String[] message) {
36 | if (message == null || message.length < 2) {
37 | this.sendReplaceableClientMessage(this.getMarker() + "No player inputted!", this.getID(), true);
38 | return;
39 | }
40 |
41 | String playerName = message[1];
42 |
43 | if (this.getMinecraft().getNetworkHandler() == null) {
44 | this.sendReplaceableClientMessage(this.getMarker() + "No network connection!", this.getID(), true);
45 | return;
46 | }
47 |
48 | try {
49 | PlayerListEntry playerListEntry = findPlayerListEntryByName(playerName);
50 |
51 | if (playerListEntry == null) {
52 | this.sendReplaceableClientMessage(this.getMarker() + "Invalid player (" + Formatting.YELLOW + playerName + Formatting.GRAY + ")!", this.getID(), true);
53 | return;
54 | }
55 |
56 | this.sendReplaceableClientMessage(this.getMarker() + "Ping for player " + Formatting.YELLOW + playerListEntry.getProfile().getName() + Formatting.GRAY + " is " + Formatting.GREEN + playerListEntry.getLatency() + "ms" + Formatting.GRAY + "!", this.getID(), true);
57 |
58 | } catch (Exception ignored) {
59 | this.sendReplaceableClientMessage(this.getMarker() + "Error with grabbing latency values (your game is still loading)!", this.getID(), true);
60 | }
61 | }
62 |
63 | private PlayerListEntry findPlayerListEntryByName(String name) {
64 | if (this.getMinecraft().getNetworkHandler() == null) return null;
65 |
66 | return this.getMinecraft().getNetworkHandler().getPlayerList().stream().filter(playerListEntry -> playerListEntry.getProfile().getName().equalsIgnoreCase(name)).findFirst().orElse(null);
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/commands/Plugins.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.commands;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.misc.imp.Command;
5 | import net.minecraft.util.Formatting;
6 |
7 | /**
8 | * @author IUDevman
9 | * @since 08-06-2021
10 | */
11 |
12 | public final class Plugins implements Command {
13 |
14 | @Override
15 | public String getName() {
16 | return "Plugins";
17 | }
18 |
19 | @Override
20 | public String getMarker() {
21 | return "(" + Formatting.YELLOW + this.getName() + Formatting.GRAY + ") ";
22 | }
23 |
24 | @Override
25 | public String getSyntax() {
26 | return "{name}";
27 | }
28 |
29 | @Override
30 | public int getID() {
31 | return 685;
32 | }
33 |
34 | @Override
35 | public void onCommand(String[] message) {
36 | this.sendClientMessage(this.getMarker() + "Available modules:", true);
37 |
38 | Tensor.INSTANCE.PLUGIN_MANAGER.getPlugins().forEach(plugin -> this.sendClientMessage(this.getMarker() + plugin.getName() + ", version " + Formatting.YELLOW + plugin.getVersion(), true));
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/commands/Prefix.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.commands;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.misc.imp.Command;
5 | import net.minecraft.util.Formatting;
6 |
7 | /**
8 | * @author IUDevman
9 | * @since 04-17-2021
10 | */
11 |
12 | public final class Prefix implements Command {
13 |
14 | @Override
15 | public String getName() {
16 | return "Prefix";
17 | }
18 |
19 | @Override
20 | public String getMarker() {
21 | return "(" + Formatting.YELLOW + this.getName() + Formatting.GRAY + ") ";
22 | }
23 |
24 | @Override
25 | public String getSyntax() {
26 | return "{name} [char]";
27 | }
28 |
29 | @Override
30 | public int getID() {
31 | return 668;
32 | }
33 |
34 | @Override
35 | public void onCommand(String[] message) {
36 | if (message == null || message.length < 2) {
37 | this.sendReplaceableClientMessage(this.getMarker() + "No prefix inputted!", this.getID(), true);
38 | return;
39 | }
40 |
41 | String prefix = message[1];
42 |
43 | if (prefix.length() > 1) {
44 | this.sendReplaceableClientMessage(this.getMarker() + "Invalid prefix (" + Formatting.YELLOW + prefix + Formatting.GRAY + ")!", this.getID(), true);
45 | return;
46 | }
47 |
48 | Tensor.INSTANCE.COMMAND_MANAGER.setPrefix(prefix);
49 | this.sendReplaceableClientMessage(this.getMarker() + "Set command prefix to (" + Formatting.GREEN + prefix + Formatting.GRAY + ")!", this.getID(), true);
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/commands/Reload.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.commands;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.misc.imp.Command;
5 | import net.minecraft.util.Formatting;
6 |
7 | /**
8 | * @author IUDevman
9 | * @since 06-30-2021
10 | */
11 |
12 | public final class Reload implements Command {
13 |
14 | @Override
15 | public String getName() {
16 | return "Reload";
17 | }
18 |
19 | @Override
20 | public String getMarker() {
21 | return "(" + Formatting.YELLOW + this.getName() + Formatting.GRAY + ") ";
22 | }
23 |
24 | @Override
25 | public String getSyntax() {
26 | return "{name}";
27 | }
28 |
29 | @Override
30 | public int getID() {
31 | return 682;
32 | }
33 |
34 | @Override
35 | public void onCommand(String[] message) {
36 | Tensor.INSTANCE.CONFIG_MANAGER.save();
37 |
38 | Tensor.INSTANCE.onInitializeClient();
39 |
40 | this.sendReplaceableClientMessage(this.getMarker() + "Reloaded client!", this.getID(), true);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/commands/Reset.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.commands;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.misc.imp.Command;
5 | import dev.tensor.misc.imp.Module;
6 | import dev.tensor.misc.imp.Setting;
7 | import net.minecraft.util.Formatting;
8 |
9 | /**
10 | * @author IUDevman
11 | * @since 06-29-2021
12 | */
13 |
14 | public final class Reset implements Command {
15 |
16 | @Override
17 | public String getName() {
18 | return "Reset";
19 | }
20 |
21 | @Override
22 | public String getMarker() {
23 | return "(" + Formatting.YELLOW + this.getName() + Formatting.GRAY + ") ";
24 | }
25 |
26 | @Override
27 | public String getSyntax() {
28 | return "{name} [module]";
29 | }
30 |
31 | @Override
32 | public int getID() {
33 | return 681;
34 | }
35 |
36 | @Override
37 | public void onCommand(String[] message) {
38 | if (message == null || message.length < 2) {
39 | this.sendReplaceableClientMessage(this.getMarker() + "No module inputted!", this.getID(), true);
40 | return;
41 | }
42 |
43 | String moduleName = message[1];
44 |
45 | Module module = Tensor.INSTANCE.MODULE_MANAGER.getModule(moduleName);
46 |
47 | if (module == null) {
48 | this.sendReplaceableClientMessage(this.getMarker() + "Invalid module (" + Formatting.YELLOW + moduleName + Formatting.GRAY + ")!", this.getID(), true);
49 | return;
50 | }
51 |
52 | module.reset();
53 |
54 | Tensor.INSTANCE.SETTING_MANAGER.getSettingsForModule(module).forEach(Setting::reset);
55 |
56 | this.sendReplaceableClientMessage(this.getMarker() + "Reset: " + module.getName() + "!", this.getID(), true);
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/commands/Spammer.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.commands;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.misc.imp.Command;
5 | import net.minecraft.util.Formatting;
6 |
7 | import java.nio.file.Files;
8 | import java.nio.file.Path;
9 | import java.nio.file.Paths;
10 | import java.util.Locale;
11 |
12 | /**
13 | * @author IUDevman
14 | * @since 05-28-2021
15 | */
16 |
17 | public final class Spammer implements Command {
18 |
19 | @Override
20 | public String getName() {
21 | return "Spammer";
22 | }
23 |
24 | @Override
25 | public String getMarker() {
26 | return "(" + Formatting.YELLOW + this.getName() + Formatting.GRAY + ") ";
27 | }
28 |
29 | @Override
30 | public String getSyntax() {
31 | return "{name} [file.txt]";
32 | }
33 |
34 | @Override
35 | public int getID() {
36 | return 680;
37 | }
38 |
39 | @Override
40 | public void onCommand(String[] message) {
41 | if (message == null || message.length < 2) {
42 | this.sendReplaceableClientMessage(this.getMarker() + "No file inputted!", this.getID(), true);
43 | return;
44 | }
45 |
46 | String file = message[1];
47 |
48 | Path path = Paths.get(Tensor.INSTANCE.MOD_NAME.toLowerCase(Locale.ROOT) + "/spammer/" + file);
49 |
50 | if (!Files.exists(path)) {
51 | this.sendReplaceableClientMessage(this.getMarker() + "Invalid file (" + Formatting.RED + file + Formatting.GRAY + ")!", this.getID(), true);
52 | return;
53 | }
54 |
55 | this.sendReplaceableClientMessage(this.getMarker() + "Set spammer file (" + Formatting.GREEN + file + Formatting.GRAY + ")!", this.getID(), true);
56 |
57 | dev.tensor.feature.modules.Spammer spammer = Tensor.INSTANCE.MODULE_MANAGER.getModule(dev.tensor.feature.modules.Spammer.class);
58 |
59 | if (spammer == null) {
60 | this.sendReplaceableClientMessage(this.getMarker() + "Failed to set spammer file path!", this.getID(), true);
61 | return;
62 | }
63 |
64 | spammer.setPath(path);
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/commands/Toggle.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.commands;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.misc.imp.Command;
5 | import dev.tensor.misc.imp.Module;
6 | import net.minecraft.util.Formatting;
7 |
8 | /**
9 | * @author IUDevman
10 | * @since 04-17-2021
11 | */
12 |
13 | public final class Toggle implements Command {
14 |
15 | @Override
16 | public String getName() {
17 | return "Toggle";
18 | }
19 |
20 | @Override
21 | public String getMarker() {
22 | return "(" + Formatting.YELLOW + this.getName() + Formatting.GRAY + ") ";
23 | }
24 |
25 | @Override
26 | public String getSyntax() {
27 | return "{name} [module]";
28 | }
29 |
30 | @Override
31 | public int getID() {
32 | return 667;
33 | }
34 |
35 | @Override
36 | public void onCommand(String[] message) {
37 | if (message == null || message.length < 2) {
38 | this.sendReplaceableClientMessage(this.getMarker() + "No module inputted!", this.getID(), true);
39 | return;
40 | }
41 |
42 | String moduleName = message[1];
43 |
44 | Module module = Tensor.INSTANCE.MODULE_MANAGER.getModule(moduleName);
45 |
46 | if (module == null) {
47 | this.sendReplaceableClientMessage(this.getMarker() + "Invalid module (" + Formatting.YELLOW + moduleName + Formatting.GRAY + ")!", this.getID(), true);
48 | return;
49 | }
50 |
51 | module.toggle();
52 |
53 | String value = module.isEnabled() ? Formatting.GREEN + "true" : Formatting.RED + "false";
54 | this.sendReplaceableClientMessage(this.getMarker() + "Toggled: " + module.getName() + " (" + value + Formatting.GRAY + ")!", this.getID(), true);
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/commands/VClip.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.commands;
2 |
3 | import dev.tensor.misc.imp.Command;
4 | import net.minecraft.util.Formatting;
5 |
6 | /**
7 | * @author IUDevman
8 | * @since 05-25-2021
9 | */
10 |
11 | public final class VClip implements Command {
12 |
13 | @Override
14 | public String getName() {
15 | return "VClip";
16 | }
17 |
18 | @Override
19 | public String getMarker() {
20 | return "(" + Formatting.YELLOW + this.getName() + Formatting.GRAY + ") ";
21 | }
22 |
23 | @Override
24 | public String getSyntax() {
25 | return "{name} [value]";
26 | }
27 |
28 | @Override
29 | public int getID() {
30 | return 678;
31 | }
32 |
33 | @Override
34 | public void onCommand(String[] message) {
35 | if (message == null || message.length < 2) {
36 | this.sendReplaceableClientMessage(this.getMarker() + "No value inputted!", this.getID(), true);
37 | return;
38 | }
39 |
40 | String value = message[1];
41 |
42 | try {
43 | int clipAmount = Integer.parseInt(value);
44 |
45 | this.getPlayer().updatePosition(this.getPlayer().getX(), this.getPlayer().getY() + clipAmount, this.getPlayer().getZ());
46 | this.sendReplaceableClientMessage(this.getMarker() + "Attempted to y-teleport (" + Formatting.GREEN + clipAmount + Formatting.GRAY + ") blocks!", this.getID(), true);
47 |
48 | } catch (NullPointerException | NumberFormatException ignored) {
49 | this.sendReplaceableClientMessage(this.getMarker() + "Invalid value (" + Formatting.RED + value + Formatting.GRAY + ")!", this.getID(), true);
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/managers/CommandManager.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.managers;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.feature.commands.*;
5 | import dev.tensor.misc.imp.Command;
6 | import dev.tensor.misc.imp.Manager;
7 | import dev.tensor.misc.plugin.PluginEntryPoint;
8 | import net.minecraft.util.Formatting;
9 |
10 | import java.util.ArrayList;
11 | import java.util.Comparator;
12 | import java.util.concurrent.atomic.AtomicBoolean;
13 |
14 | /**
15 | * @author IUDevman
16 | * @since 04-12-2021
17 | */
18 |
19 | public final class CommandManager implements Manager {
20 |
21 | private String prefix = "-";
22 |
23 | private final ArrayList commands = new ArrayList<>();
24 |
25 | @Override
26 | public void load() {
27 | Tensor.INSTANCE.LOGGER.info("CommandManager");
28 |
29 | this.addCommand(new Bind());
30 | this.addCommand(new Capes());
31 | this.addCommand(new Clear());
32 | this.addCommand(new Commands());
33 | this.addCommand(new Config());
34 | this.addCommand(new Drawn());
35 | this.addCommand(new Friends());
36 | this.addCommand(new Help());
37 | this.addCommand(new Messages());
38 | this.addCommand(new Modules());
39 | this.addCommand(new Ping());
40 | this.addCommand(new Plugins());
41 | this.addCommand(new Prefix());
42 | this.addCommand(new Profiles());
43 | this.addCommand(new Reload());
44 | this.addCommand(new Reset());
45 | this.addCommand(new Set());
46 | this.addCommand(new Spammer());
47 | this.addCommand(new Toggle());
48 | this.addCommand(new VClip());
49 |
50 | this.postSortCommands();
51 | }
52 |
53 | public void postSortCommands() {
54 | this.commands.sort(Comparator.comparing(Command::getName));
55 | }
56 |
57 | @PluginEntryPoint
58 | public void addCommand(Command command) {
59 | this.commands.add(command);
60 | }
61 |
62 | public ArrayList getCommands() {
63 | return this.commands;
64 | }
65 |
66 | public Command getCommand(String name) {
67 | return this.commands.stream().filter(command -> command.getName().equalsIgnoreCase(name)).findFirst().orElse(null);
68 | }
69 |
70 | public String getPrefix() {
71 | return this.prefix;
72 | }
73 |
74 | public void setPrefix(String prefix) {
75 | if (prefix.length() > 1) return;
76 |
77 | this.prefix = prefix;
78 | }
79 |
80 | public void dispatchCommands(String message) {
81 | String[] splitMessage = message.split("\\s");
82 |
83 | AtomicBoolean foundMessage = new AtomicBoolean(false);
84 |
85 | getCommands().forEach(command -> {
86 | if (command.getName().equalsIgnoreCase(splitMessage[0])) {
87 | foundMessage.set(true);
88 | command.onCommand(splitMessage);
89 | }
90 | });
91 |
92 | if (!foundMessage.get()) {
93 | this.sendReplaceableClientMessage("Invalid command! Type " + Formatting.YELLOW + getPrefix() + "commands" + Formatting.GRAY + " to see a full list of commands!", 666, true);
94 | }
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/managers/EventManager.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.managers;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.events.ClientRenderEvent;
5 | import dev.tensor.backend.events.ClientTickEvent;
6 | import dev.tensor.backend.events.KeyPressedEvent;
7 | import dev.tensor.backend.events.PacketEvent;
8 | import dev.tensor.feature.modules.ClickGUI;
9 | import dev.tensor.feature.modules.Commands;
10 | import dev.tensor.misc.event.EventTarget;
11 | import dev.tensor.misc.event.imp.Priority;
12 | import dev.tensor.misc.gui.TensorGUI;
13 | import dev.tensor.misc.imp.HUDComponent;
14 | import dev.tensor.misc.imp.Manager;
15 | import dev.tensor.misc.imp.Module;
16 | import net.minecraft.client.util.math.MatrixStack;
17 | import net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket;
18 |
19 | /**
20 | * @author IUDevman
21 | * @since 04-12-2021
22 | */
23 |
24 | public final class EventManager implements Manager {
25 |
26 | @Override
27 | public void load() {
28 | Tensor.INSTANCE.LOGGER.info("EventHandler");
29 | }
30 |
31 | @SuppressWarnings("unused")
32 | @EventTarget(Priority.HIGHEST)
33 | public void onClientTick(ClientTickEvent event) {
34 | Tensor.INSTANCE.MODULE_MANAGER.getEnabledModules().forEach(Module::onTick);
35 | }
36 |
37 | @SuppressWarnings("unused")
38 | @EventTarget(Priority.HIGHEST)
39 | public void onClientRender(ClientRenderEvent event) {
40 | Tensor.INSTANCE.MODULE_MANAGER.getEnabledModules().forEach(module -> {
41 | if (event.getType().equals(ClientRenderEvent.Type.World)) {
42 | module.onRender3D();
43 | } else if (event.getType().equals(ClientRenderEvent.Type.HUD) && module instanceof HUDComponent && shouldRender2D()) {
44 | MatrixStack matrixStack = new MatrixStack();
45 |
46 | matrixStack.push();
47 | ((HUDComponent) module).onRender2D(matrixStack);
48 | matrixStack.pop();
49 | }
50 | });
51 | }
52 |
53 | @SuppressWarnings("unused")
54 | @EventTarget(Priority.HIGHEST)
55 | public void onKeyPressed(KeyPressedEvent event) {
56 | Tensor.INSTANCE.MODULE_MANAGER.getModules().forEach(module -> {
57 | if (module.getBind() == event.getBind()) module.toggle();
58 | });
59 | }
60 |
61 | @SuppressWarnings("unused")
62 | @EventTarget(Priority.HIGHEST)
63 | public void onPacket(PacketEvent event) {
64 | if (!event.getType().equals(PacketEvent.Type.Send)) return;
65 |
66 | if (event.getPacket() instanceof ChatMessageC2SPacket chatMessageC2SPacket) {
67 |
68 | if (chatMessageC2SPacket.getChatMessage().startsWith(Tensor.INSTANCE.COMMAND_MANAGER.getPrefix()) && shouldDispatchCommands()) {
69 | event.setCancelled(true);
70 | Tensor.INSTANCE.COMMAND_MANAGER.dispatchCommands(chatMessageC2SPacket.getChatMessage().substring(1));
71 | }
72 | }
73 | }
74 |
75 | private boolean shouldRender2D() {
76 | ClickGUI clickGUI = Tensor.INSTANCE.MODULE_MANAGER.getModule(ClickGUI.class);
77 |
78 | if (clickGUI == null) return false;
79 |
80 | return !(this.getMinecraft().currentScreen instanceof TensorGUI) || clickGUI.showHUDComponents.getValue();
81 | }
82 |
83 | private boolean shouldDispatchCommands() {
84 | Commands commands = Tensor.INSTANCE.MODULE_MANAGER.getModule(Commands.class);
85 |
86 | if (commands == null) return false;
87 |
88 | return commands.isEnabled();
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/managers/FriendManager.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.managers;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.misc.imp.Manager;
5 |
6 | import java.util.ArrayList;
7 |
8 | /**
9 | * @author IUDevman
10 | * @since 05-20-2021
11 | */
12 |
13 | public final class FriendManager implements Manager {
14 |
15 | private final ArrayList friends = new ArrayList<>();
16 |
17 | @Override
18 | public void load() {
19 | Tensor.INSTANCE.LOGGER.info("FriendManager");
20 | }
21 |
22 | public ArrayList getFriends() {
23 | return this.friends;
24 | }
25 |
26 | public void addFriend(String name) {
27 | this.friends.add(name);
28 | }
29 |
30 | public void removeFriend(String name) {
31 | this.friends.remove(name);
32 | }
33 |
34 | public void clearFriends() {
35 | this.friends.clear();
36 | }
37 |
38 | public boolean isFriend(String name) {
39 | return this.friends.contains(name);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/managers/GUIManager.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.managers;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.misc.gui.TensorChatGUI;
5 | import dev.tensor.misc.gui.TensorGUI;
6 | import dev.tensor.misc.imp.Manager;
7 |
8 | /**
9 | * @author IUDevman
10 | * @since 05-16-2021
11 | */
12 |
13 | public final class GUIManager implements Manager {
14 |
15 | private final TensorGUI tensorGUI = new TensorGUI();
16 | private final TensorChatGUI tensorChatGUI = new TensorChatGUI();
17 |
18 | @Override
19 | public void load() {
20 | Tensor.INSTANCE.LOGGER.info("GUIManager");
21 | }
22 |
23 | public TensorGUI getGUI() {
24 | return this.tensorGUI;
25 | }
26 |
27 | public TensorChatGUI getTensorChatGUI() {
28 | return this.tensorChatGUI;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/managers/PluginManager.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.managers;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.misc.imp.Manager;
5 | import dev.tensor.misc.plugin.Plugin;
6 | import net.fabricmc.loader.api.FabricLoader;
7 |
8 | import java.util.ArrayList;
9 | import java.util.Locale;
10 |
11 | /**
12 | * @author IUDevman
13 | * @since 08-10-2021
14 | */
15 |
16 | public final class PluginManager implements Manager {
17 |
18 | private final ArrayList plugins = new ArrayList<>();
19 |
20 | @Override
21 | public void load() {
22 | Tensor.INSTANCE.LOGGER.info("PluginManager");
23 |
24 | FabricLoader.getInstance().getEntrypoints(Tensor.INSTANCE.MOD_NAME.toLowerCase(Locale.ROOT), Plugin.class).forEach(plugin -> {
25 |
26 | if (plugin.getClass().isAnnotationPresent(Plugin.Info.class)) {
27 | this.plugins.add(plugin);
28 | }
29 | });
30 |
31 | if (this.plugins.size() == 0) return;
32 |
33 | this.plugins.forEach(plugin -> {
34 | plugin.load();
35 | Tensor.INSTANCE.LOGGER.info("Loaded plugin: " + plugin.getName() + " " + plugin.getVersion() + "!");
36 | });
37 |
38 | Tensor.INSTANCE.COMMAND_MANAGER.postSortCommands();
39 | Tensor.INSTANCE.MODULE_MANAGER.postSortModules();
40 | }
41 |
42 | public void save() {
43 | this.plugins.forEach(Plugin::save);
44 | }
45 |
46 | public ArrayList getPlugins() {
47 | return this.plugins;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/managers/SettingManager.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.managers;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.misc.imp.Manager;
5 | import dev.tensor.misc.imp.Module;
6 | import dev.tensor.misc.imp.Setting;
7 |
8 | import java.util.ArrayList;
9 | import java.util.Arrays;
10 | import java.util.Collection;
11 | import java.util.LinkedHashMap;
12 |
13 | /**
14 | * @author IUDevman
15 | * @since 04-13-2021
16 | */
17 |
18 | public final class SettingManager implements Manager {
19 |
20 | private final LinkedHashMap, Module> moduleSettings = new LinkedHashMap<>();
21 |
22 | @Override
23 | public void load() {
24 | Tensor.INSTANCE.LOGGER.info("SettingManager");
25 |
26 | Tensor.INSTANCE.MODULE_MANAGER.getModules().forEach(module -> Arrays.stream(module.getClass().getDeclaredFields()).forEach(field -> {
27 |
28 | if (Setting.class.isAssignableFrom(field.getType())) {
29 | if (!field.canAccess(module)) field.setAccessible(true);
30 |
31 | try {
32 | Setting> setting = (Setting>) field.get(module);
33 | this.moduleSettings.put(setting, module);
34 |
35 | } catch (IllegalAccessException ignored) {
36 | Tensor.INSTANCE.LOGGER.warn("Failed to load settings!");
37 | }
38 | }
39 | }));
40 | }
41 |
42 | public Collection> getSettings() {
43 | return this.moduleSettings.keySet();
44 | }
45 |
46 | public ArrayList> getSettingsForModule(Module module) {
47 | ArrayList> settings = new ArrayList<>();
48 |
49 | this.moduleSettings.forEach((setting, module1) -> {
50 | if (module1.equals(module)) settings.add(setting);
51 | });
52 |
53 | return settings;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/AntiNarrator.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 |
6 | /**
7 | * @author IUDevman
8 | * @since 07-21-2021
9 | */
10 |
11 | @Module.Info(name = "AntiNarrator", category = Category.Misc)
12 | public final class AntiNarrator extends Module {
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/AutoRespawn.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 | import net.minecraft.client.gui.screen.DeathScreen;
6 |
7 | /**
8 | * @author IUDevman
9 | * @since 05-10-2021
10 | */
11 |
12 | @Module.Info(name = "AutoRespawn", category = Category.Misc)
13 | public final class AutoRespawn extends Module {
14 |
15 | @Override
16 | public void onTick() {
17 | if (this.getMinecraft().currentScreen instanceof DeathScreen) {
18 | this.getPlayer().requestRespawn();
19 | this.getMinecraft().setScreen(null);
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/AutoTool.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.backend.events.BlockInteractEvent;
4 | import dev.tensor.misc.event.EventTarget;
5 | import dev.tensor.misc.imp.Category;
6 | import dev.tensor.misc.imp.Module;
7 | import dev.tensor.misc.imp.settings.BooleanSetting;
8 | import net.minecraft.block.BlockState;
9 | import net.minecraft.enchantment.EnchantmentHelper;
10 | import net.minecraft.enchantment.Enchantments;
11 | import net.minecraft.item.ItemStack;
12 | import net.minecraft.util.math.BlockPos;
13 |
14 | import java.util.HashMap;
15 |
16 | /**
17 | * @author IUDevman
18 | * @since 05-01-2021
19 | */
20 |
21 | @Module.Info(name = "AutoTool", category = Category.Player)
22 | public final class AutoTool extends Module {
23 |
24 | public final BooleanSetting swapBack = new BooleanSetting("Swap Back", true);
25 |
26 | private final HashMap blockPosIntegerHashMap = new HashMap<>();
27 |
28 | @SuppressWarnings("unused")
29 | @EventTarget
30 | public void onBlockInteract(BlockInteractEvent event) {
31 | switch (event.getType()) {
32 | case Break: {
33 | if (swapBack.getValue() && blockPosIntegerHashMap.containsKey(event.getBlockPos()) && this.getInventory().selectedSlot != blockPosIntegerHashMap.get(event.getBlockPos())) {
34 | this.swap(blockPosIntegerHashMap.get(event.getBlockPos()));
35 | }
36 |
37 | if (blockPosIntegerHashMap.size() >= 10) blockPosIntegerHashMap.clear();
38 | break;
39 | }
40 | case Damage: {
41 | final int toolSlot = findBestTool(this.getWorld().getBlockState(event.getBlockPos()));
42 |
43 | if (toolSlot != -1) {
44 | blockPosIntegerHashMap.put(event.getBlockPos(), blockPosIntegerHashMap.getOrDefault(event.getBlockPos(), this.getInventory().selectedSlot));
45 | this.swap(toolSlot);
46 | }
47 | break;
48 | }
49 | default:
50 | break;
51 | }
52 | }
53 |
54 | private int findBestTool(BlockState blockState) {
55 | int slot = -1;
56 | double maxMultiplier = 0;
57 |
58 | for (int i = 0; i < 9; i++) {
59 | ItemStack itemStack = this.getInventory().getStack(i);
60 |
61 | if (itemStack.isEmpty()) continue;
62 |
63 | float speedMultiplier = itemStack.getMiningSpeedMultiplier(blockState);
64 | final int efficiencyLevel = EnchantmentHelper.getLevel(Enchantments.EFFICIENCY, itemStack);
65 |
66 | if (speedMultiplier > 1) {
67 | speedMultiplier += efficiencyLevel > 0 ? Math.pow(efficiencyLevel, 2) + 1 : 0;
68 |
69 | if (speedMultiplier > maxMultiplier) {
70 | maxMultiplier = speedMultiplier;
71 | slot = i;
72 | }
73 | }
74 | }
75 |
76 | return slot;
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/AutoWalk.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 |
6 | /**
7 | * @author IUDevman
8 | * @since 05-21-2021
9 | */
10 |
11 | @Module.Info(name = "AutoWalk", category = Category.Movement)
12 | public final class AutoWalk extends Module {
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/CameraClip.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 | import dev.tensor.misc.imp.settings.NumberSetting;
6 |
7 | /**
8 | * @author IUDevman
9 | * @since 05-11-2021
10 | */
11 |
12 | @Module.Info(name = "CameraClip", category = Category.Render)
13 | public final class CameraClip extends Module {
14 |
15 | public final NumberSetting distance = new NumberSetting("Distance", 5.0, 1.0, 50.0, 1);
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/Capes.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 |
6 | /**
7 | * @author IUDevman
8 | * @since 05-26-2021
9 | */
10 |
11 | @Module.Info(name = "Capes", category = Category.Render)
12 | public final class Capes extends Module {
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/ChatSuffix.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.events.PacketEvent;
5 | import dev.tensor.backend.mixins.accessors.ChatMessageC2SPacketAccessor;
6 | import dev.tensor.misc.event.EventTarget;
7 | import dev.tensor.misc.imp.Category;
8 | import dev.tensor.misc.imp.Module;
9 | import dev.tensor.misc.imp.settings.EnumSetting;
10 | import net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket;
11 |
12 | /**
13 | * @author IUDevman
14 | * @since 05-14-2021
15 | */
16 |
17 | @Module.Info(name = "ChatSuffix", category = Category.Misc)
18 | public final class ChatSuffix extends Module {
19 |
20 | public final EnumSetting mode = new EnumSetting("Mode", Mode.Regular);
21 |
22 | @SuppressWarnings("unused")
23 | @EventTarget
24 | public void onPacket(PacketEvent event) {
25 | if (event.getType() != PacketEvent.Type.Send) return;
26 |
27 | if (event.getPacket() instanceof ChatMessageC2SPacket packet) {
28 | String message = packet.getChatMessage();
29 |
30 | if (message.startsWith(Tensor.INSTANCE.COMMAND_MANAGER.getPrefix()) || message.startsWith("/")) return;
31 |
32 | String newMessage = message + getSuffix();
33 |
34 | if (newMessage.length() > 256) {
35 | newMessage = newMessage.substring(0, 256);
36 | }
37 |
38 | ((ChatMessageC2SPacketAccessor) packet).setChatMessage(newMessage);
39 | }
40 | }
41 |
42 | private String getSuffix() {
43 | switch ((Mode) mode.getValue()) {
44 | case Script: {
45 | return " \u23D0 \u1d1b\u1d07\u0274\ua731\u1d0f\u0280";
46 | }
47 | case Regular: {
48 | return " | " + Tensor.INSTANCE.MOD_NAME;
49 | }
50 | default:
51 | return "You broke something!";
52 | }
53 | }
54 |
55 | public enum Mode {
56 | Script,
57 | Regular
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/ClickGUI.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.misc.imp.Category;
5 | import dev.tensor.misc.imp.Module;
6 | import dev.tensor.misc.imp.settings.BooleanSetting;
7 | import org.lwjgl.glfw.GLFW;
8 |
9 | /**
10 | * @author IUDevman
11 | * @since 05-03-2021
12 | */
13 |
14 | @Module.Info(name = "ClickGUI", category = Category.Client, bind = GLFW.GLFW_KEY_RIGHT_SHIFT, drawn = false)
15 | public final class ClickGUI extends Module {
16 |
17 | public final BooleanSetting showHUDComponents = new BooleanSetting("Show HUD Components", true);
18 |
19 | @Override
20 | public void onEnable() {
21 | this.getMinecraft().setScreen(Tensor.INSTANCE.GUI_MANAGER.getGUI());
22 | this.disable();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/Commands.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 | import dev.tensor.misc.imp.settings.BooleanSetting;
6 |
7 | /**
8 | * @author IUDevman
9 | * @since 07-29-2021
10 | */
11 |
12 | @Module.Info(name = "Commands", category = Category.Client, drawn = false, enabled = true)
13 | public final class Commands extends Module {
14 |
15 | public final BooleanSetting preview = new BooleanSetting("Preview", true);
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/Coordinates.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.HUDComponent;
5 | import dev.tensor.misc.imp.Module;
6 | import dev.tensor.misc.imp.settings.BooleanSetting;
7 | import dev.tensor.misc.imp.settings.NumberSetting;
8 | import net.minecraft.client.gui.DrawableHelper;
9 | import net.minecraft.client.util.math.MatrixStack;
10 |
11 | import java.awt.*;
12 | import java.text.DecimalFormat;
13 |
14 | /**
15 | * @author IUDevman
16 | * @since 06-29-2021
17 | */
18 |
19 | @Module.Info(name = "Coordinates", category = Category.HUD)
20 | public final class Coordinates extends Module implements HUDComponent {
21 |
22 | public final NumberSetting x = new NumberSetting("X", 1, 0, 1000, 0);
23 | public final NumberSetting y = new NumberSetting("Y", 17, 0, 1000, 0);
24 | public final BooleanSetting nether = new BooleanSetting("Nether", false);
25 |
26 | private final DecimalFormat decimalFormat = new DecimalFormat("###.#");
27 |
28 | @Override
29 | public NumberSetting getStartX() {
30 | return this.x;
31 | }
32 |
33 | @Override
34 | public NumberSetting getStartY() {
35 | return this.y;
36 | }
37 |
38 | @Override
39 | public void onRender2D(MatrixStack matrixStack) {
40 | double playerX = this.getPlayer().getX();
41 | double playerY = this.getPlayer().getY();
42 | double playerZ = this.getPlayer().getZ();
43 |
44 | if (this.getWorld().getDimension().isRespawnAnchorWorking()) {
45 | playerX *= 8;
46 | playerZ *= 8;
47 | }
48 |
49 | final String overWorld = "X: " + decimalFormat.format(playerX) + " Y: " + decimalFormat.format(playerY) + " Z: " + decimalFormat.format(playerZ);
50 | DrawableHelper.drawStringWithShadow(matrixStack, this.getMinecraft().textRenderer, overWorld, x.getValue().intValue(), y.getValue().intValue(), new Color(255, 255, 255, 255).getRGB());
51 |
52 | if (nether.getValue() && !this.getWorld().getDimension().hasEnderDragonFight()) {
53 | final String nether = "X: " + decimalFormat.format(playerX / 8) + " Y: " + decimalFormat.format(playerY) + " Z: " + decimalFormat.format(playerZ / 8);
54 | DrawableHelper.drawStringWithShadow(matrixStack, this.getMinecraft().textRenderer, nether, x.getValue().intValue(), y.getValue().intValue() + this.getMinecraft().textRenderer.fontHeight + 1, new Color(255, 0, 0, 255).getRGB());
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/Criticals.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.backend.events.PacketEvent;
4 | import dev.tensor.misc.event.EventTarget;
5 | import dev.tensor.misc.imp.Category;
6 | import dev.tensor.misc.imp.Module;
7 | import dev.tensor.misc.imp.settings.BooleanSetting;
8 | import dev.tensor.misc.imp.settings.EnumSetting;
9 | import net.minecraft.entity.Entity;
10 | import net.minecraft.entity.decoration.EndCrystalEntity;
11 | import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket;
12 | import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
13 |
14 | /**
15 | * @author IUDevman
16 | * @since 05-17-2021
17 | */
18 |
19 | @Module.Info(name = "Criticals", category = Category.Combat)
20 | public final class Criticals extends Module {
21 |
22 | public final EnumSetting type = new EnumSetting("Type", Type.Packet);
23 | public final BooleanSetting endCrystals = new BooleanSetting("End Crystals", false);
24 |
25 | @SuppressWarnings("unused")
26 | @EventTarget
27 | public void onPacket(PacketEvent event) {
28 | if (event.getType() != PacketEvent.Type.Send) return;
29 |
30 | if (event.getPacket() instanceof PlayerInteractEntityC2SPacket packet) {
31 | if (this.getMinecraft().getServer() == null) return;
32 |
33 | if (!shouldApplyCriticals(packet.getEntity(this.getMinecraft().getServer().getWorld(this.getWorld().getRegistryKey())))) {
34 | return;
35 | }
36 |
37 | switch ((Type) type.getValue()) {
38 | case Packet: {
39 | this.getNetwork().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(this.getPlayer().getX(), this.getPlayer().getY() + 0.05, this.getPlayer().getZ(), false));
40 | this.getNetwork().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(this.getPlayer().getX(), this.getPlayer().getY(), this.getPlayer().getZ(), false));
41 | this.getNetwork().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(this.getPlayer().getX(), this.getPlayer().getY() + 0.03, this.getPlayer().getZ(), false));
42 | this.getNetwork().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(this.getPlayer().getX(), this.getPlayer().getY(), this.getPlayer().getZ(), false));
43 | break;
44 | }
45 | case Strict: {
46 | this.getNetwork().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(this.getPlayer().getX(), this.getPlayer().getY() + 0.062602401692772, this.getPlayer().getZ(), false));
47 | this.getNetwork().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(this.getPlayer().getX(), this.getPlayer().getY() + 0.0726023996066094, this.getPlayer().getZ(), false));
48 | this.getNetwork().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(this.getPlayer().getX(), this.getPlayer().getY(), this.getPlayer().getZ(), false));
49 | break;
50 | }
51 | default:
52 | break;
53 | }
54 | }
55 | }
56 |
57 | private boolean shouldApplyCriticals(Entity entity) {
58 | if (this.getPlayer().isSwimming() || this.getPlayer().isInSwimmingPose()) return false;
59 | else if (this.getPlayer().isInLava()) return false;
60 | else if (!this.getPlayer().isOnGround()) return false;
61 | else return !(entity instanceof EndCrystalEntity) || endCrystals.getValue();
62 | }
63 |
64 | public enum Type {
65 | Packet,
66 | Strict
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/DeathDebug.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 |
6 | /**
7 | * @author IUDevman
8 | * @since 08-07-2021
9 | */
10 |
11 | @Module.Info(name = "DeathDebug", category = Category.Misc)
12 | public final class DeathDebug extends Module {
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/DebugReport.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.misc.imp.Category;
5 | import dev.tensor.misc.imp.Module;
6 | import net.minecraft.util.crash.CrashReportSection;
7 |
8 | import java.util.ArrayList;
9 |
10 | /**
11 | * @author IUDevman
12 | * @since 09-05-2021
13 | */
14 |
15 | @Module.Info(name = "DebugReport", category = Category.Client, drawn = false, enabled = true)
16 | public final class DebugReport extends Module {
17 |
18 | public CrashReportSection getTensorCrashReportSection() {
19 | CrashReportSection crashReportSection = new CrashReportSection("Tensor Debug Report");
20 |
21 | ArrayList moduleNameArray = new ArrayList<>();
22 | ArrayList pluginNameArray = new ArrayList<>();
23 |
24 | Tensor.INSTANCE.MODULE_MANAGER.getEnabledModules().forEach(module -> moduleNameArray.add(module.getName()));
25 | Tensor.INSTANCE.PLUGIN_MANAGER.getPlugins().forEach(plugin -> pluginNameArray.add(plugin.getName() + " (" + plugin.getVersion() + ")"));
26 |
27 | crashReportSection.add("Name", Tensor.INSTANCE.MOD_NAME);
28 | crashReportSection.add("Version", Tensor.INSTANCE.MOD_VERSION);
29 | crashReportSection.add("Enabled Modules", "[" + Tensor.INSTANCE.MODULE_MANAGER.getEnabledModules().size() + "/" + Tensor.INSTANCE.MODULE_MANAGER.getModules().size() + "] " + moduleNameArray);
30 | crashReportSection.add("Commands", Tensor.INSTANCE.COMMAND_MANAGER.getCommands().size());
31 | crashReportSection.add("Plugins", "[" + Tensor.INSTANCE.PLUGIN_MANAGER.getPlugins().size() + "] " + pluginNameArray);
32 |
33 | return crashReportSection;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/Disconnect.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 |
6 | /**
7 | * @author IUDevman
8 | * @since 05-16-2021
9 | */
10 |
11 | @Module.Info(name = "Disconnect", category = Category.Misc)
12 | public final class Disconnect extends Module {
13 |
14 | @Override
15 | public void onEnable() {
16 | this.getWorld().disconnect();
17 | this.disable();
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/ElytraFlight.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 | import dev.tensor.misc.imp.settings.BooleanSetting;
6 | import dev.tensor.misc.imp.settings.NumberSetting;
7 | import net.minecraft.util.math.Vec3d;
8 |
9 | /**
10 | * @author IUDevman
11 | * @since 05-28-2021
12 | */
13 |
14 | @Module.Info(name = "ElytraFlight", category = Category.Movement)
15 | public final class ElytraFlight extends Module {
16 |
17 | public final BooleanSetting ignoreFluids = new BooleanSetting("Ignore Fluids", true);
18 | public final BooleanSetting alwaysMoving = new BooleanSetting("Always Moving", false);
19 | public final BooleanSetting stableY = new BooleanSetting("Stable Y", false);
20 | public final BooleanSetting rotationY = new BooleanSetting("Rotation Y", false);
21 | public final NumberSetting speed = new NumberSetting("Speed", 15, 1, 100, 1);
22 |
23 | @Override
24 | public void onTick() {
25 | if (!this.getPlayer().isFallFlying()) return;
26 |
27 | this.getPlayer().getAbilities().flying = false;
28 |
29 | if (areButtonsDown() || alwaysMoving.getValue()) {
30 | this.getPlayer().setVelocity(getFlyingVelocity());
31 |
32 | } else {
33 | this.getPlayer().setVelocity(0, 0, 0);
34 | }
35 |
36 | if (!stableY.getValue() && !rotationY.getValue()) {
37 | if (this.getMinecraft().options.keyJump.isPressed()) {
38 | this.getPlayer().setVelocity(this.getPlayer().getVelocity().add(0, getSpeed(), 0));
39 | } else if (getMinecraft().options.keySneak.isPressed()) {
40 | this.getPlayer().setVelocity(this.getPlayer().getVelocity().add(0, -getSpeed(), 0));
41 | }
42 | }
43 | }
44 |
45 | private float getSpeed() {
46 | return (float) (this.speed.getValue() / 10);
47 | }
48 |
49 | private boolean areButtonsDown() {
50 | if (this.getMinecraft().options.keyForward.isPressed()) return true;
51 | else if (this.getMinecraft().options.keyBack.isPressed()) return true;
52 | else if (this.getMinecraft().options.keyLeft.isPressed()) return true;
53 | else if (this.getMinecraft().options.keyRight.isPressed()) return true;
54 |
55 | if (rotationY.getValue()) {
56 | if (this.getMinecraft().options.keySneak.isPressed()) return true;
57 | else return this.getMinecraft().options.keyJump.isPressed();
58 | }
59 |
60 | return false;
61 | }
62 |
63 | private Vec3d getFlyingVelocity() {
64 | double x = this.getPlayer().getRotationVector().getX() * getSpeed();
65 | double y = this.getPlayer().getRotationVector().getY();
66 | double z = this.getPlayer().getRotationVector().getZ() * getSpeed();
67 |
68 | if (rotationY.getValue()) y *= getSpeed();
69 |
70 | return new Vec3d(x, stableY.getValue() ? 0 : y, z);
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/FakePlayer.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import com.mojang.authlib.GameProfile;
4 | import dev.tensor.backend.events.DisconnectEvent;
5 | import dev.tensor.misc.event.EventTarget;
6 | import dev.tensor.misc.imp.Category;
7 | import dev.tensor.misc.imp.Module;
8 | import net.minecraft.client.network.OtherClientPlayerEntity;
9 | import net.minecraft.entity.Entity;
10 |
11 | import java.util.UUID;
12 |
13 | /**
14 | * @author IUDevman
15 | * @since 05-18-2021
16 | */
17 |
18 | @Module.Info(name = "FakePlayer", category = Category.Misc)
19 | public final class FakePlayer extends Module {
20 |
21 | private OtherClientPlayerEntity otherClientPlayerEntity = null;
22 |
23 | @Override
24 | public void onEnable() {
25 | otherClientPlayerEntity = new OtherClientPlayerEntity(this.getWorld(), new GameProfile(UUID.fromString("fdee323e-7f0c-4c15-8d1c-0f277442342a"), "Fit"));
26 | otherClientPlayerEntity.copyPositionAndRotation(this.getPlayer());
27 | otherClientPlayerEntity.setId(-666);
28 | this.getWorld().addEntity(otherClientPlayerEntity.getId(), otherClientPlayerEntity);
29 | this.getWorld().getPlayers().add(otherClientPlayerEntity);
30 | }
31 |
32 | @Override
33 | public void onDisable() {
34 | if (otherClientPlayerEntity == null) return;
35 |
36 | this.getWorld().removeEntity(otherClientPlayerEntity.getId(), Entity.RemovalReason.DISCARDED);
37 | }
38 |
39 | @SuppressWarnings("unused")
40 | @EventTarget
41 | public void onDisconnect(DisconnectEvent event) {
42 | this.disable();
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/Flight.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 | import dev.tensor.misc.imp.settings.BooleanSetting;
6 | import dev.tensor.misc.imp.settings.NumberSetting;
7 | import net.minecraft.util.math.Vec3d;
8 |
9 | /**
10 | * @author IUDevman
11 | * @since 05-18-2021
12 | */
13 |
14 | @Module.Info(name = "Flight", category = Category.Movement)
15 | public final class Flight extends Module {
16 |
17 | public final BooleanSetting ignoreFluids = new BooleanSetting("Ignore Fluids", true);
18 | public final BooleanSetting elytraCheck = new BooleanSetting("Elytra Check", true);
19 | public final NumberSetting speed = new NumberSetting("Speed", 20, 1, 50, 1);
20 |
21 | @Override
22 | public void onTick() {
23 | if (elytraCheck.getValue() && this.getPlayer().isFallFlying()) return;
24 |
25 | this.getPlayer().getAbilities().flying = false;
26 |
27 | this.getPlayer().flyingSpeed = getSpeed();
28 | this.getPlayer().setVelocity(new Vec3d(0, 0, 0));
29 |
30 | if (this.getMinecraft().options.keyJump.isPressed()) {
31 | this.getPlayer().setVelocity(this.getPlayer().getVelocity().add(0, getSpeed(), 0));
32 | } else if (this.getMinecraft().options.keySneak.isPressed()) {
33 | this.getPlayer().setVelocity(this.getPlayer().getVelocity().add(0, -getSpeed(), 0));
34 | }
35 | }
36 |
37 | private float getSpeed() {
38 | return (float) (this.speed.getValue() / 10);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/Freecam.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.backend.events.DisconnectEvent;
4 | import dev.tensor.backend.mixins.accessors.ClientPlayerEntityAccessor;
5 | import dev.tensor.misc.event.EventTarget;
6 | import dev.tensor.misc.freecam.CameraEntity;
7 | import dev.tensor.misc.freecam.DummyInput;
8 | import dev.tensor.misc.imp.Category;
9 | import dev.tensor.misc.imp.Module;
10 | import dev.tensor.misc.imp.settings.BooleanSetting;
11 | import dev.tensor.misc.imp.settings.NumberSetting;
12 | import net.minecraft.client.input.KeyboardInput;
13 | import net.minecraft.client.option.Perspective;
14 |
15 | /**
16 | * @author wagyourtail#3826
17 | * Added with explicit permission, thanks! :D
18 | */
19 |
20 | @Module.Info(name = "Freecam", category = Category.Render)
21 | public final class Freecam extends Module {
22 |
23 | public final BooleanSetting hideBlockOutline = new BooleanSetting("Hide Block Outline", true);
24 | public final NumberSetting speed = new NumberSetting("Speed", 10, 1, 20, 1);
25 |
26 | private CameraEntity cameraEntity = null;
27 | private Perspective perspective = null;
28 |
29 | @Override
30 | public void onEnable() {
31 | cameraEntity = new CameraEntity(this.getWorld(), this.getPlayer().getGameProfile(), this);
32 | cameraEntity.copyPositionAndRotation(this.getPlayer());
33 | cameraEntity.setHeadYaw(this.getPlayer().headYaw);
34 | cameraEntity.spawn();
35 |
36 | perspective = this.getMinecraft().options.getPerspective();
37 | this.getMinecraft().options.setPerspective(Perspective.FIRST_PERSON);
38 | this.getMinecraft().setCameraEntity(cameraEntity);
39 |
40 | if (this.getPlayer().input instanceof KeyboardInput) {
41 | ((ClientPlayerEntityAccessor) this.getPlayer()).setInput(new DummyInput());
42 | }
43 | }
44 |
45 | @Override
46 | public void onDisable() {
47 | if (perspective != null) this.getMinecraft().options.setPerspective(perspective);
48 | this.getMinecraft().setCameraEntity(this.getPlayer());
49 | if (cameraEntity != null) cameraEntity.despawn();
50 | cameraEntity = null;
51 |
52 | if (this.getPlayer().input instanceof DummyInput) {
53 | ((ClientPlayerEntityAccessor) this.getPlayer()).setInput(new KeyboardInput(this.getMinecraft().options));
54 | }
55 | }
56 |
57 | @Override
58 | public void onTick() {
59 | if (cameraEntity == null || this.getPlayer().isDead()) {
60 | this.disable();
61 | return;
62 | }
63 |
64 | cameraEntity.setHealth(this.getPlayer().getHealth());
65 |
66 | if (this.getPlayer().input instanceof KeyboardInput) {
67 | ((ClientPlayerEntityAccessor) this.getPlayer()).setInput(new DummyInput());
68 | }
69 |
70 | cameraEntity.tickMovement();
71 | }
72 |
73 | @SuppressWarnings("unused")
74 | @EventTarget
75 | public void onDisconnect(DisconnectEvent event) {
76 | this.disable();
77 | }
78 |
79 | public float getSpeed() {
80 | return (float) (this.speed.getValue() / 20);
81 | }
82 |
83 | public CameraEntity getCameraEntity() {
84 | return this.cameraEntity;
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/FullBright.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 |
6 | /**
7 | * @author IUDevman
8 | * @since 04-12-2021
9 | */
10 |
11 | @Module.Info(name = "FullBright", category = Category.Render)
12 | public final class FullBright extends Module {
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/InventoryMove.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 | import dev.tensor.misc.imp.settings.BooleanSetting;
6 |
7 | /**
8 | * @author IUDevman
9 | * @since 07-21-2021
10 | */
11 |
12 | @Module.Info(name = "InventoryMove", category = Category.Movement)
13 | public final class InventoryMove extends Module {
14 |
15 | public final BooleanSetting chatScreen = new BooleanSetting("Chat Screen", false);
16 | public final BooleanSetting jump = new BooleanSetting("Jump", true);
17 | public final BooleanSetting sneak = new BooleanSetting("Sneak", true);
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/Jesus.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 | import dev.tensor.misc.imp.settings.BooleanSetting;
6 | import dev.tensor.misc.imp.settings.EnumSetting;
7 |
8 | /**
9 | * @author IUDevman
10 | * @since 05-23-2021
11 | */
12 |
13 | @Module.Info(name = "Jesus", category = Category.Movement)
14 | public final class Jesus extends Module {
15 |
16 | public final EnumSetting denomination = new EnumSetting("Denomination", Denomination.Baptist);
17 | public final BooleanSetting cancelOnFall = new BooleanSetting("Cancel On Fall", true);
18 | public final BooleanSetting powderedSnow = new BooleanSetting("Powdered Snow", false);
19 |
20 | @SuppressWarnings("unused")
21 | public enum Denomination {
22 | Baptist,
23 | Methodist,
24 | Presbyterian,
25 | Orthodox,
26 | Catholic,
27 | Christian,
28 | Lutheran,
29 | Spirit,
30 | Reformed,
31 | Episcopal
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/LiquidInteract.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 |
6 | /**
7 | * @author IUDevman
8 | * @since 05-21-2021
9 | */
10 |
11 | @Module.Info(name = "LiquidInteract", category = Category.Player)
12 | public final class LiquidInteract extends Module {
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/MiddleClickFriend.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.events.KeyPressedEvent;
5 | import dev.tensor.misc.event.EventTarget;
6 | import dev.tensor.misc.imp.Category;
7 | import dev.tensor.misc.imp.Module;
8 | import net.minecraft.entity.player.PlayerEntity;
9 | import net.minecraft.util.Formatting;
10 | import net.minecraft.util.hit.EntityHitResult;
11 | import net.minecraft.util.hit.HitResult;
12 | import org.lwjgl.glfw.GLFW;
13 |
14 | import java.util.Objects;
15 |
16 | /**
17 | * @author IUDevman
18 | * @since 05-20-2021
19 | */
20 |
21 | @Module.Info(name = "MiddleClickFriend", category = Category.Misc)
22 | public final class MiddleClickFriend extends Module {
23 |
24 | @SuppressWarnings("unused")
25 | @EventTarget
26 | public void onKeyPressed(KeyPressedEvent event) {
27 | if (event.getBind() != GLFW.GLFW_MOUSE_BUTTON_MIDDLE) return;
28 | if (Objects.requireNonNull(this.getMinecraft().crosshairTarget).getType() != HitResult.Type.ENTITY) return;
29 |
30 | EntityHitResult entityHitResult = (EntityHitResult) this.getMinecraft().crosshairTarget;
31 | if (!(entityHitResult.getEntity() instanceof PlayerEntity)) return;
32 |
33 | String name = entityHitResult.getEntity().getEntityName();
34 |
35 | if (Tensor.INSTANCE.FRIEND_MANAGER.isFriend(name)) {
36 | Tensor.INSTANCE.FRIEND_MANAGER.removeFriend(name);
37 | this.sendReplaceableClientMessage("Removed " + Formatting.RED + name + Formatting.GRAY + " from the friends list!", 1000, true);
38 | } else {
39 | Tensor.INSTANCE.FRIEND_MANAGER.addFriend(name);
40 | this.sendReplaceableClientMessage("Added " + Formatting.GREEN + name + Formatting.GRAY + " to the friends list!", 1000, true);
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/MiddleClickPearl.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.backend.events.KeyPressedEvent;
4 | import dev.tensor.misc.event.EventTarget;
5 | import dev.tensor.misc.imp.Category;
6 | import dev.tensor.misc.imp.Module;
7 | import net.minecraft.item.Items;
8 | import net.minecraft.util.Hand;
9 | import net.minecraft.util.hit.HitResult;
10 | import org.lwjgl.glfw.GLFW;
11 |
12 | import java.util.Objects;
13 |
14 | /**
15 | * @author IUDevman
16 | * @since 05-13-2021
17 | */
18 |
19 | @Module.Info(name = "MiddleClickPearl", category = Category.Player)
20 | public final class MiddleClickPearl extends Module {
21 |
22 | @SuppressWarnings("unused")
23 | @EventTarget
24 | public void onKeyPressed(KeyPressedEvent event) {
25 | if (event.getBind() != GLFW.GLFW_MOUSE_BUTTON_MIDDLE) return;
26 | if (Objects.requireNonNull(this.getMinecraft().crosshairTarget).getType() != HitResult.Type.MISS) return;
27 |
28 | int oldSlot = this.getInventory().selectedSlot;
29 | int newSlot = this.findItem(Items.ENDER_PEARL);
30 |
31 | if (newSlot != -1) {
32 | this.swap(newSlot);
33 | Objects.requireNonNull(this.getMinecraft().interactionManager).interactItem(this.getPlayer(), this.getWorld(), Hand.MAIN_HAND);
34 | this.swap(oldSlot);
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/NoBreakDelay.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 |
6 | /**
7 | * @author IUDevman
8 | * @since 05-11-2021
9 | */
10 |
11 | @Module.Info(name = "NoBreakDelay", category = Category.Player)
12 | public final class NoBreakDelay extends Module {
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/NoFog.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 |
6 | /**
7 | * @author IUDevman
8 | * @since 04-14-2021
9 | */
10 |
11 | @Module.Info(name = "NoFog", category = Category.Render)
12 | public final class NoFog extends Module {
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/NoGlitchBlock.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 |
6 | /**
7 | * @author IUDevman
8 | * @since 05-25-2021
9 | */
10 |
11 | @Module.Info(name = "NoGlitchBlock", category = Category.Player)
12 | public final class NoGlitchBlock extends Module {
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/NoOverlay.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.backend.events.PlaySoundEvent;
4 | import dev.tensor.misc.event.EventTarget;
5 | import dev.tensor.misc.imp.Category;
6 | import dev.tensor.misc.imp.Module;
7 | import dev.tensor.misc.imp.settings.BooleanSetting;
8 | import net.minecraft.client.sound.PositionedSoundInstance;
9 | import net.minecraft.sound.SoundEvents;
10 | import net.minecraft.util.Identifier;
11 |
12 | /**
13 | * @author IUDevman
14 | * @since 05-10-2021
15 | */
16 |
17 | @Module.Info(name = "NoOverlay", category = Category.Render)
18 | public final class NoOverlay extends Module {
19 |
20 | public final BooleanSetting vignette = new BooleanSetting("Vignette", true);
21 | public final BooleanSetting pumpkin = new BooleanSetting("Pumpkin", true);
22 | public final BooleanSetting powderedSnow = new BooleanSetting("Powdered Snow", true);
23 | public final BooleanSetting bossBar = new BooleanSetting("Boss Bar", true);
24 | public final BooleanSetting status = new BooleanSetting("Status", false);
25 | public final BooleanSetting toast = new BooleanSetting("Toast", false);
26 |
27 | @SuppressWarnings("unused")
28 | @EventTarget
29 | public void onPlaySound(PlaySoundEvent event) {
30 | if (!toast.getValue() || !(event.getSoundInstance() instanceof PositionedSoundInstance instance)) return;
31 |
32 | Identifier identifier = instance.getId();
33 |
34 | if (identifier == SoundEvents.UI_TOAST_IN.getId() || identifier == SoundEvents.UI_TOAST_OUT.getId() || identifier == SoundEvents.UI_TOAST_CHALLENGE_COMPLETE.getId()) {
35 | event.setCancelled(true);
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/NoParticles.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 | import dev.tensor.misc.imp.settings.BooleanSetting;
6 |
7 | /**
8 | * @author IUDevman
9 | * @since 05-11-2021
10 | */
11 |
12 | @Module.Info(name = "NoParticles", category = Category.Render)
13 | public final class NoParticles extends Module {
14 |
15 | public final BooleanSetting all = new BooleanSetting("All", false);
16 | public final BooleanSetting ash = new BooleanSetting("Ash", true);
17 | public final BooleanSetting spore = new BooleanSetting("Spore", true);
18 | public final BooleanSetting explosion = new BooleanSetting("Explosion", true);
19 | public final BooleanSetting underWater = new BooleanSetting("Underwater", true);
20 | public final BooleanSetting lava = new BooleanSetting("Lava", false);
21 | public final BooleanSetting portal = new BooleanSetting("Portal", false);
22 | public final BooleanSetting eating = new BooleanSetting("Item Use Effect", false);
23 | public final BooleanSetting potions = new BooleanSetting("Potion Effect", false);
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/NoPlaceDelay.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.backend.mixins.accessors.MinecraftClientAccessor;
4 | import dev.tensor.misc.imp.Category;
5 | import dev.tensor.misc.imp.Module;
6 | import dev.tensor.misc.imp.settings.BooleanSetting;
7 | import net.minecraft.item.Items;
8 |
9 | /**
10 | * @author IUDevman
11 | * @since 05-21-2021
12 | */
13 |
14 | @Module.Info(name = "NoPlaceDelay", category = Category.Player)
15 | public final class NoPlaceDelay extends Module {
16 |
17 | public final BooleanSetting all = new BooleanSetting("All", true);
18 | public final BooleanSetting xp = new BooleanSetting("XP Bottle", false);
19 | public final BooleanSetting mainCrystal = new BooleanSetting("Mainhand Crystal", false);
20 | public final BooleanSetting offhandCrystal = new BooleanSetting("Offhand Crystal", false);
21 |
22 | @Override
23 | public void onTick() {
24 | if (shouldToggleDelay()) {
25 | ((MinecraftClientAccessor) this.getMinecraft()).setItemUseCooldown(0);
26 | }
27 | }
28 |
29 | private boolean shouldToggleDelay() {
30 | if (all.getValue()) {
31 | return true;
32 | } else if (xp.getValue() && this.getPlayer().getMainHandStack().getItem() == Items.EXPERIENCE_BOTTLE) {
33 | return true;
34 | } else if (mainCrystal.getValue() && this.getPlayer().getMainHandStack().getItem() == Items.END_CRYSTAL) {
35 | return true;
36 | } else {
37 | return offhandCrystal.getValue() && this.getPlayer().getOffHandStack().getItem() == Items.END_CRYSTAL;
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/NoPortalEffect.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 |
6 | /**
7 | * @author IUDevman
8 | * @since 05-09-2021
9 | */
10 |
11 | @Module.Info(name = "NoPortalEffect", category = Category.Misc)
12 | public final class NoPortalEffect extends Module {
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/NoPush.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 | import dev.tensor.misc.imp.settings.BooleanSetting;
6 |
7 | /**
8 | * @author IUDevman
9 | * @since 05-16-2021
10 | */
11 |
12 | @Module.Info(name = "NoPush", category = Category.Movement)
13 | public final class NoPush extends Module {
14 |
15 | public final BooleanSetting collisions = new BooleanSetting("Collisions", true);
16 | public final BooleanSetting blocks = new BooleanSetting("Blocks", true);
17 | public final BooleanSetting water = new BooleanSetting("Water", true);
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/NoRender.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 | import dev.tensor.misc.imp.settings.BooleanSetting;
6 |
7 | /**
8 | * @author IUDevman
9 | * @since 05-15-2021
10 | */
11 |
12 | @Module.Info(name = "NoRender", category = Category.Render)
13 | public final class NoRender extends Module {
14 |
15 | public final BooleanSetting armor = new BooleanSetting("Armor", false);
16 | public final BooleanSetting enchantBooks = new BooleanSetting("Enchantment Table Books", false);
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/NoSlow.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 | import dev.tensor.misc.imp.settings.BooleanSetting;
6 |
7 | /**
8 | * @author IUDevman
9 | * @since 05-12-2021
10 | */
11 |
12 | @Module.Info(name = "NoSlow", category = Category.Movement)
13 | public final class NoSlow extends Module {
14 |
15 | public final BooleanSetting items = new BooleanSetting("Items", true);
16 | public final BooleanSetting blocks = new BooleanSetting("Blocks", true);
17 | public final BooleanSetting sticky = new BooleanSetting("Sticky", true);
18 | public final BooleanSetting sneaking = new BooleanSetting("Sneaking", false);
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/NoViewBob.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 | import dev.tensor.misc.imp.settings.BooleanSetting;
6 |
7 | /**
8 | * @author IUDevman
9 | * @since 05-12-2021
10 | */
11 |
12 | @Module.Info(name = "NoViewBob", category = Category.Render)
13 | public final class NoViewBob extends Module {
14 |
15 | public final BooleanSetting hurtOnly = new BooleanSetting("Hurt Only", true);
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/NoWeather.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.backend.events.PacketEvent;
4 | import dev.tensor.misc.event.EventTarget;
5 | import dev.tensor.misc.imp.Category;
6 | import dev.tensor.misc.imp.Module;
7 | import net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket;
8 | import net.minecraft.sound.SoundEvents;
9 |
10 | /**
11 | * @author IUDevman
12 | * @since 05-11-2021
13 | */
14 |
15 | @Module.Info(name = "NoWeather", category = Category.Render)
16 | public final class NoWeather extends Module {
17 |
18 | @SuppressWarnings("unused")
19 | @EventTarget
20 | public void onPacket(PacketEvent event) {
21 | if (event.getType() != PacketEvent.Type.Receive) return;
22 |
23 | if (event.getPacket() instanceof PlaySoundS2CPacket packet) {
24 |
25 | if (packet.getSound().equals(SoundEvents.ENTITY_LIGHTNING_BOLT_THUNDER)) {
26 | event.setCancelled(true);
27 | } else if (packet.getSound().equals(SoundEvents.WEATHER_RAIN) || packet.getSound().equals(SoundEvents.WEATHER_RAIN_ABOVE)) {
28 | event.setCancelled(true);
29 | }
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/OnGround.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.backend.events.PacketEvent;
4 | import dev.tensor.backend.mixins.accessors.PlayerMoveC2SPacketAccessor;
5 | import dev.tensor.misc.event.EventTarget;
6 | import dev.tensor.misc.imp.Category;
7 | import dev.tensor.misc.imp.Module;
8 | import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
9 |
10 | /**
11 | * @author IUDevman
12 | * @since 05-14-2021
13 | */
14 |
15 | @Module.Info(name = "OnGround", category = Category.Player)
16 | public final class OnGround extends Module {
17 |
18 | @SuppressWarnings("unused")
19 | @EventTarget
20 | public void onPacket(PacketEvent event) {
21 | if (event.getType() != PacketEvent.Type.Send) return;
22 |
23 | if (event.getPacket() instanceof PlayerMoveC2SPacket packet) {
24 | ((PlayerMoveC2SPacketAccessor) packet).setOnGround(false);
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/SafeWalk.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 | import dev.tensor.misc.imp.settings.BooleanSetting;
6 |
7 | /**
8 | * @author IUDevman
9 | * @since 07-20-2021
10 | */
11 |
12 | @Module.Info(name = "SafeWalk", category = Category.Movement)
13 | public final class SafeWalk extends Module {
14 |
15 | public final BooleanSetting fluids = new BooleanSetting("Fluids", false);
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/Sneak.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 |
6 | /**
7 | * @author IUDevman
8 | * @since 05-13-2021
9 | */
10 |
11 | @Module.Info(name = "Sneak", category = Category.Movement)
12 | public final class Sneak extends Module {
13 |
14 | @Override
15 | public void onDisable() {
16 | if (!this.getPlayer().isSneaking()) return;
17 |
18 | this.getMinecraft().options.keySneak.setPressed(false);
19 | }
20 |
21 | @Override
22 | public void onTick() {
23 | if (this.getPlayer().isSneaking()) return;
24 |
25 | this.getMinecraft().options.keySneak.setPressed(true);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/Spammer.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.events.DisconnectEvent;
5 | import dev.tensor.misc.event.EventTarget;
6 | import dev.tensor.misc.imp.Category;
7 | import dev.tensor.misc.imp.Module;
8 | import dev.tensor.misc.imp.settings.NumberSetting;
9 |
10 | import java.io.BufferedReader;
11 | import java.io.FileReader;
12 | import java.io.IOException;
13 | import java.nio.file.Path;
14 | import java.util.ArrayList;
15 |
16 | /**
17 | * @author IUDevman
18 | * @since 05-28-2021
19 | */
20 |
21 | @Module.Info(name = "Spammer", category = Category.Misc)
22 | public final class Spammer extends Module {
23 |
24 | public final NumberSetting delayTicks = new NumberSetting("Delay Ticks", 60, 0, 200, 0);
25 |
26 | private final ArrayList spammerFiles = new ArrayList<>();
27 | private Path path = null;
28 | private int delayCount = 0;
29 |
30 | @Override
31 | public void onTick() {
32 | if (spammerFiles.size() == 0) {
33 | loadSpammer();
34 | }
35 |
36 | if (delayCount >= delayTicks.getValue() && spammerFiles.size() != 0) {
37 | delayCount = 0;
38 |
39 | String string = spammerFiles.get(0);
40 |
41 | if (string.length() > 256) {
42 | string = string.substring(0, 256);
43 | }
44 |
45 | this.getPlayer().sendChatMessage(string);
46 | spammerFiles.remove(0);
47 | }
48 | delayCount++;
49 | }
50 |
51 | @SuppressWarnings("unused")
52 | @EventTarget
53 | public void onDisconnect(DisconnectEvent event) {
54 | this.disable();
55 | }
56 |
57 | private void loadSpammer() {
58 | spammerFiles.clear();
59 |
60 | if (path != null) {
61 | try {
62 | BufferedReader bufferedReader = new BufferedReader(new FileReader(path.toFile()));
63 |
64 | String line;
65 | while ((line = bufferedReader.readLine()) != null) {
66 | spammerFiles.add(line);
67 | }
68 |
69 | } catch (IOException ignored) {
70 | Tensor.INSTANCE.LOGGER.warn("Failed to load spammer file!");
71 | }
72 | }
73 | }
74 |
75 | public void setPath(Path path) {
76 | this.path = path;
77 |
78 | loadSpammer();
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/Sprint.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 | import dev.tensor.misc.imp.settings.BooleanSetting;
6 |
7 | /**
8 | * @author IUDevman
9 | * @since 04-14-2021
10 | */
11 |
12 | @Module.Info(name = "Sprint", category = Category.Movement)
13 | public final class Sprint extends Module {
14 |
15 | public final BooleanSetting stationary = new BooleanSetting("Stationary", false);
16 | public final BooleanSetting reverse = new BooleanSetting("Reverse", true);
17 | public final BooleanSetting sideways = new BooleanSetting("Sideways", true);
18 | public final BooleanSetting liquids = new BooleanSetting("Liquids", false);
19 |
20 | @Override
21 | public void onTick() {
22 | if (!stationary.getValue() && this.getPlayer().forwardSpeed == 0 && this.getPlayer().sidewaysSpeed == 0) {
23 | return;
24 | } else if (!sideways.getValue() && this.getPlayer().sidewaysSpeed != 0) {
25 | return;
26 | } else if (!reverse.getValue() && this.getPlayer().forwardSpeed < 0) {
27 | return;
28 | } else if (!liquids.getValue() && (this.getPlayer().isInsideWaterOrBubbleColumn() || this.getPlayer().isInLava())) {
29 | return;
30 | }
31 |
32 | this.getPlayer().setSprinting(true);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/Timer.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 | import dev.tensor.misc.imp.settings.NumberSetting;
6 |
7 | /**
8 | * @author IUDevman
9 | * @since 04-14-2021
10 | */
11 |
12 | @Module.Info(name = "Timer", category = Category.Movement)
13 | public final class Timer extends Module {
14 |
15 | public final NumberSetting multiplier = new NumberSetting("Multiplier", 2.0, 0.1, 20.0, 1);
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/UnfocusedCPU.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 |
6 | /**
7 | * @author IUDevman
8 | * @since 08-29-2021
9 | */
10 |
11 | @Module.Info(name = "UnfocusedCPU", category = Category.Misc)
12 | public final class UnfocusedCPU extends Module {
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/VanillaSpoof.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 |
6 | /**
7 | * @author IUDevman
8 | * @since 08-02-2021
9 | */
10 |
11 | @Module.Info(name = "VanillaSpoof", category = Category.Misc)
12 | public final class VanillaSpoof extends Module {
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/Velocity.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.backend.events.PacketEvent;
4 | import dev.tensor.backend.mixins.accessors.EntityVelocityUpdateS2CPacketAccessor;
5 | import dev.tensor.backend.mixins.accessors.ExplosionS2CPacketAccessor;
6 | import dev.tensor.misc.event.EventTarget;
7 | import dev.tensor.misc.imp.Category;
8 | import dev.tensor.misc.imp.Module;
9 | import dev.tensor.misc.imp.settings.BooleanSetting;
10 | import net.minecraft.network.packet.s2c.play.EntityVelocityUpdateS2CPacket;
11 | import net.minecraft.network.packet.s2c.play.ExplosionS2CPacket;
12 |
13 | /**
14 | * @author IUDevman
15 | * @since 05-13-2021
16 | */
17 |
18 | @Module.Info(name = "Velocity", category = Category.Movement)
19 | public final class Velocity extends Module {
20 |
21 | public final BooleanSetting damage = new BooleanSetting("Damage", true);
22 | public final BooleanSetting explosion = new BooleanSetting("Explosion", true);
23 |
24 | @SuppressWarnings("unused")
25 | @EventTarget
26 | public void onPacket(PacketEvent event) {
27 | if (event.getType() != PacketEvent.Type.Receive) return;
28 |
29 | if (event.getPacket() instanceof EntityVelocityUpdateS2CPacket packet && damage.getValue()) {
30 | if (packet.getId() != this.getPlayer().getId()) return;
31 |
32 | ((EntityVelocityUpdateS2CPacketAccessor) packet).setVelocityX(0);
33 | ((EntityVelocityUpdateS2CPacketAccessor) packet).setVelocityY(0);
34 | ((EntityVelocityUpdateS2CPacketAccessor) packet).setVelocityZ(0);
35 |
36 | } else if (event.getPacket() instanceof ExplosionS2CPacket packet && explosion.getValue()) {
37 | ((ExplosionS2CPacketAccessor) packet).setPlayerVelocityX(0);
38 | ((ExplosionS2CPacketAccessor) packet).setPlayerVelocityY(0);
39 | ((ExplosionS2CPacketAccessor) packet).setPlayerVelocityZ(0);
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/ViewModel.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.misc.imp.Category;
4 | import dev.tensor.misc.imp.Module;
5 | import dev.tensor.misc.imp.settings.BooleanSetting;
6 | import dev.tensor.misc.imp.settings.NumberSetting;
7 |
8 | /**
9 | * @author IUDevman
10 | * @since 05-14-2021
11 | */
12 |
13 | @Module.Info(name = "ViewModel", category = Category.Render)
14 | public final class ViewModel extends Module {
15 |
16 | public final BooleanSetting renderEmptyMainHand = new BooleanSetting("Render Empty Mainhand", false);
17 | public final NumberSetting vertical = new NumberSetting("Vertical", 0.20, -2.00, 2.00, 2);
18 | public final NumberSetting horizontal = new NumberSetting("Horizontal", -1.20, -2.00, 2.00, 2);
19 | public final NumberSetting scale = new NumberSetting("Scale", 1.00, 0.10, 1.50, 2);
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/VisualRange.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.misc.imp.Category;
5 | import dev.tensor.misc.imp.Module;
6 | import dev.tensor.misc.imp.settings.BooleanSetting;
7 | import net.minecraft.entity.player.PlayerEntity;
8 | import net.minecraft.util.Formatting;
9 |
10 | import java.util.ArrayList;
11 |
12 | /**
13 | * @author IUDevman
14 | * @since 05-26-2021
15 | */
16 |
17 | @Module.Info(name = "VisualRange", category = Category.Misc)
18 | public final class VisualRange extends Module {
19 |
20 | public final BooleanSetting friends = new BooleanSetting("Friends", true);
21 | public final BooleanSetting replaceMessages = new BooleanSetting("Replace Messages", true);
22 |
23 | private final ArrayList spottedPlayers = new ArrayList<>();
24 |
25 | @Override
26 | public void onDisable() {
27 | spottedPlayers.clear();
28 | }
29 |
30 | @SuppressWarnings("SuspiciousMethodCalls")
31 | @Override
32 | public void onTick() {
33 | this.getWorld().getPlayers().forEach(player -> {
34 |
35 | if (!spottedPlayers.contains(player) && player != this.getPlayer()) {
36 |
37 | if (!friends.getValue() && Tensor.INSTANCE.FRIEND_MANAGER.isFriend(player.getEntityName())) return;
38 |
39 | spottedPlayers.add(player);
40 |
41 | String message = "Player " + Formatting.YELLOW + player.getEntityName() + Formatting.GRAY + " has " + Formatting.RED + "entered " + Formatting.GRAY + "your visual range!";
42 |
43 | if (replaceMessages.getValue()) {
44 | this.sendReplaceableClientMessage(message, 1001, true);
45 | } else {
46 | this.sendClientMessage(message, true);
47 | }
48 | }
49 | });
50 |
51 | ArrayList removedPlayers = new ArrayList<>();
52 |
53 | spottedPlayers.forEach(player -> {
54 |
55 | if (!this.getWorld().getPlayers().contains(player)) {
56 | removedPlayers.add(player);
57 |
58 | if (!friends.getValue() && Tensor.INSTANCE.FRIEND_MANAGER.isFriend(player.getEntityName())) return;
59 |
60 | String message = "Player " + Formatting.YELLOW + player.getEntityName() + Formatting.GRAY + " has " + Formatting.GREEN + "left " + Formatting.GRAY + "your visual range!";
61 |
62 | if (replaceMessages.getValue()) {
63 | this.sendReplaceableClientMessage(message, 1001, true);
64 | } else {
65 | this.sendClientMessage(message, true);
66 | }
67 | }
68 | });
69 |
70 | removedPlayers.forEach(spottedPlayers::remove);
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/Watermark.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.misc.imp.Category;
5 | import dev.tensor.misc.imp.HUDComponent;
6 | import dev.tensor.misc.imp.Module;
7 | import dev.tensor.misc.imp.settings.NumberSetting;
8 | import net.minecraft.client.gui.DrawableHelper;
9 | import net.minecraft.client.util.math.MatrixStack;
10 | import net.minecraft.util.Formatting;
11 |
12 | import java.awt.*;
13 |
14 | /**
15 | * @author IUDevman
16 | * @since 06-29-2021
17 | */
18 |
19 | @Module.Info(name = "Watermark", category = Category.HUD)
20 | public final class Watermark extends Module implements HUDComponent {
21 |
22 | public final NumberSetting x = new NumberSetting("X", 1, 0, 1000, 0);
23 | public final NumberSetting y = new NumberSetting("Y", 1, 0, 1000, 0);
24 |
25 | private final String text = Tensor.INSTANCE.MOD_NAME + " (" + Formatting.YELLOW + Tensor.INSTANCE.MOD_VERSION + Formatting.RESET + ")";
26 | private final Color textColor = new Color(255, 255, 255, 255);
27 |
28 | @Override
29 | public NumberSetting getStartX() {
30 | return this.x;
31 | }
32 |
33 | @Override
34 | public NumberSetting getStartY() {
35 | return this.y;
36 | }
37 |
38 | @Override
39 | public void onRender2D(MatrixStack matrixStack) {
40 | DrawableHelper.drawStringWithShadow(matrixStack, this.getMinecraft().textRenderer, text, x.getValue().intValue(), y.getValue().intValue(), textColor.getRGB());
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/feature/modules/XCarry.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.feature.modules;
2 |
3 | import dev.tensor.backend.events.PacketEvent;
4 | import dev.tensor.backend.mixins.accessors.CloseHandledScreenC2SAccessor;
5 | import dev.tensor.misc.event.EventTarget;
6 | import dev.tensor.misc.imp.Category;
7 | import dev.tensor.misc.imp.Module;
8 | import net.minecraft.network.packet.c2s.play.CloseHandledScreenC2SPacket;
9 |
10 | /**
11 | * @author IUDevman
12 | * @since 05-12-2021
13 | */
14 |
15 | @Module.Info(name = "XCarry", category = Category.Player)
16 | public final class XCarry extends Module {
17 |
18 | private boolean cancelled = false;
19 |
20 | @Override
21 | public void onDisable() {
22 | if (cancelled) {
23 | this.getNetwork().sendPacket(new CloseHandledScreenC2SPacket(this.getPlayer().playerScreenHandler.syncId));
24 | }
25 | }
26 |
27 | @SuppressWarnings("unused")
28 | @EventTarget
29 | public void onPacket(PacketEvent event) {
30 | if (event.getType() != PacketEvent.Type.Send) return;
31 |
32 | if (event.getPacket() instanceof CloseHandledScreenC2SPacket packet) {
33 |
34 | if (((CloseHandledScreenC2SAccessor) packet).getSyncId() == this.getPlayer().playerScreenHandler.syncId) {
35 | event.setCancelled(true);
36 | cancelled = true;
37 | }
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/misc/event/EventTarget.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.misc.event;
2 |
3 | import dev.tensor.misc.event.imp.Priority;
4 |
5 | import java.lang.annotation.*;
6 |
7 | /**
8 | * @author DarkMagician6
9 | * @since 07-30-2013
10 | */
11 |
12 | @Documented
13 | @Retention(RetentionPolicy.RUNTIME)
14 | @Target(ElementType.METHOD)
15 | public @interface EventTarget {
16 |
17 | byte value() default Priority.MEDIUM;
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/misc/event/imp/Cancellable.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.misc.event.imp;
2 |
3 | /**
4 | * @author DarkMagician6
5 | * @since 08-27-2013
6 | */
7 |
8 | public interface Cancellable {
9 |
10 | boolean isCancelled();
11 |
12 | void setCancelled(boolean cancelled);
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/misc/event/imp/Event.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.misc.event.imp;
2 |
3 | /**
4 | * @author DarkMagician6
5 | * @since 07-30-2013
6 | */
7 |
8 | public interface Event {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/misc/event/imp/EventCancellable.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.misc.event.imp;
2 |
3 | /**
4 | * @author DarkMagician6
5 | * @since 08-27-2013
6 | */
7 |
8 | public abstract class EventCancellable implements Event, Cancellable {
9 |
10 | private boolean cancelled;
11 |
12 | @Override
13 | public boolean isCancelled() {
14 | return this.cancelled;
15 | }
16 |
17 | @Override
18 | public void setCancelled(boolean cancelled) {
19 | this.cancelled = cancelled;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/misc/event/imp/Priority.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.misc.event.imp;
2 |
3 | /**
4 | * @author DarkMagician6
5 | * @since 08-03-2013
6 | */
7 |
8 | public final class Priority {
9 |
10 | public static final byte HIGHEST = 0;
11 | public static final byte HIGH = 1;
12 | public static final byte MEDIUM = 2;
13 | public static final byte LOW = 3;
14 | public static final byte LOWEST = 4;
15 |
16 | public static final byte[] STANDARD_VALUES = new byte[]{
17 | HIGHEST,
18 | HIGH,
19 | MEDIUM,
20 | LOW,
21 | LOWEST
22 | };
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/misc/freecam/CameraEntity.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.misc.freecam;
2 |
3 | import com.mojang.authlib.GameProfile;
4 | import dev.tensor.feature.modules.Freecam;
5 | import dev.tensor.misc.imp.Global;
6 | import net.minecraft.client.input.Input;
7 | import net.minecraft.client.input.KeyboardInput;
8 | import net.minecraft.client.network.OtherClientPlayerEntity;
9 | import net.minecraft.client.world.ClientWorld;
10 | import net.minecraft.util.math.Vec3d;
11 |
12 | /**
13 | * @author wagyourtail
14 | * @since 06-02-2020
15 | */
16 |
17 | @SuppressWarnings("EntityConstructor")
18 | public final class CameraEntity extends OtherClientPlayerEntity implements Global {
19 |
20 | private final Input input;
21 | private final Freecam freecam;
22 |
23 | public CameraEntity(ClientWorld clientWorld, GameProfile gameProfile, Freecam freecam) {
24 | super(clientWorld, gameProfile);
25 |
26 | this.input = new KeyboardInput(this.getMinecraft().options);
27 | this.freecam = freecam;
28 | }
29 |
30 | public void spawn() {
31 | this.getWorld().addEntity(this.getId(), this);
32 | }
33 |
34 | public void despawn() {
35 | this.getWorld().removeEntity(this.getId(), RemovalReason.DISCARDED);
36 | }
37 |
38 | @Override
39 | public boolean shouldRender(double cameraX, double cameraY, double cameraZ) {
40 | return false;
41 | }
42 |
43 | @Override
44 | public boolean shouldRender(double distance) {
45 | return false;
46 | }
47 |
48 | @Override
49 | public boolean shouldRenderName() {
50 | return false;
51 | }
52 |
53 | @Override
54 | public void tickMovement() {
55 | this.setVelocity(0, 0, 0);
56 |
57 | this.input.tick(false);
58 |
59 | float upDown = (this.input.sneaking ? -this.freecam.getSpeed() : 0) + (this.input.jumping ? this.freecam.getSpeed() : 0);
60 |
61 | Vec3d forward = new Vec3d(0, 0, this.freecam.getSpeed() * 2.5).rotateY((float) -Math.toRadians(this.headYaw));
62 | Vec3d strafe = forward.rotateY((float) Math.toRadians(90));
63 | Vec3d motion = this.getVelocity();
64 |
65 | motion = motion.add(0, 2 * upDown, 0);
66 | motion = motion.add(strafe.getX() * this.input.movementSideways, 0, strafe.getZ() * this.input.movementSideways);
67 | motion = motion.add(forward.getX() * this.input.movementForward, 0, forward.getZ() * this.input.movementForward);
68 |
69 | this.setPos(this.getX() + motion.getX(), this.getY() + motion.getY(), this.getZ() + motion.getZ());
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/misc/freecam/DummyInput.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.misc.freecam;
2 |
3 | import net.minecraft.client.input.Input;
4 |
5 | /**
6 | * @author wagyourtail
7 | * @since 06-02-2020
8 | */
9 |
10 | public final class DummyInput extends Input {
11 |
12 | public DummyInput() {
13 | this.movementForward = 0;
14 | this.movementSideways = 0;
15 | this.pressingForward = false;
16 | this.pressingBack = false;
17 | this.pressingLeft = false;
18 | this.pressingRight = false;
19 | this.jumping = false;
20 | this.sneaking = false;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/misc/gui/Element.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.misc.gui;
2 |
3 | import dev.tensor.misc.imp.Global;
4 | import net.minecraft.client.util.math.MatrixStack;
5 |
6 | /**
7 | * @author IUDevman
8 | * @since 05-03-2021
9 | */
10 |
11 | public interface Element extends Global {
12 |
13 | int getWidth();
14 |
15 | int getHeight();
16 |
17 | int getPosX();
18 |
19 | int getPosY();
20 |
21 | void render(MatrixStack matrixStack, int x, int y);
22 |
23 | void onClick(double mouseX, double mouseY);
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/misc/gui/elements/SettingElement.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.misc.gui.elements;
2 |
3 | import dev.tensor.misc.gui.Element;
4 | import dev.tensor.misc.imp.settings.NumberSetting;
5 |
6 | /**
7 | * @author IUDevman
8 | * @since 05-04-2021
9 | */
10 |
11 | public abstract class SettingElement implements Element {
12 |
13 | private final NumberSetting x;
14 | private final NumberSetting y;
15 | private final NumberSetting scrollY;
16 | private final int posX;
17 | private final int posY;
18 |
19 | public SettingElement(NumberSetting x, NumberSetting y, NumberSetting scrollY, int posX, int posY) {
20 | this.x = x;
21 | this.y = y;
22 | this.scrollY = scrollY;
23 | this.posX = posX;
24 | this.posY = posY;
25 | }
26 |
27 | public NumberSetting getX() {
28 | return this.x;
29 | }
30 |
31 | public NumberSetting getY() {
32 | return this.y;
33 | }
34 |
35 | public NumberSetting getScrollY() {
36 | return this.scrollY;
37 | }
38 |
39 | public int getXPos() {
40 | return this.posX;
41 | }
42 |
43 | public int getYPos() {
44 | return this.posY;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/misc/gui/elements/settings/BooleanElement.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.misc.gui.elements.settings;
2 |
3 | import dev.tensor.misc.gui.elements.SettingElement;
4 | import dev.tensor.misc.imp.settings.BooleanSetting;
5 | import dev.tensor.misc.imp.settings.NumberSetting;
6 | import net.minecraft.client.gui.DrawableHelper;
7 | import net.minecraft.client.util.math.MatrixStack;
8 | import net.minecraft.util.Formatting;
9 |
10 | import java.awt.*;
11 |
12 | /**
13 | * @author IUDevman
14 | * @since 05-04-2021
15 | */
16 |
17 | public final class BooleanElement extends SettingElement {
18 |
19 | private final BooleanSetting booleanSetting;
20 |
21 | private final Color fillColor = new Color(0, 0, 0, 150);
22 | private final Color textColor = new Color(255, 255, 255, 255);
23 |
24 | public BooleanElement(BooleanSetting booleanSetting, NumberSetting x, NumberSetting y, NumberSetting scrollY, int posX, int posY) {
25 | super(x, y, scrollY, posX, posY);
26 | this.booleanSetting = booleanSetting;
27 | }
28 |
29 | public BooleanSetting getBooleanSetting() {
30 | return this.booleanSetting;
31 | }
32 |
33 | @Override
34 | public int getWidth() {
35 | return 204;
36 | }
37 |
38 | @Override
39 | public int getHeight() {
40 | return 15;
41 | }
42 |
43 | @Override
44 | public int getPosX() {
45 | return getX().getValue().intValue() + getXPos();
46 | }
47 |
48 | @Override
49 | public int getPosY() {
50 | return getY().getValue().intValue() + getScrollY().getValue().intValue() + getYPos();
51 | }
52 |
53 | @Override
54 | public void render(MatrixStack matrixStack, int x, int y) {
55 | DrawableHelper.fill(matrixStack, x, y, x + this.getWidth(), y + this.getHeight(), this.fillColor.getRGB());
56 |
57 | String text = getBooleanSetting().getName() + " (" + (getBooleanSetting().getValue() ? Formatting.GREEN + "true" : Formatting.RED + "false") + Formatting.RESET + ")";
58 | DrawableHelper.drawStringWithShadow(matrixStack, this.getMinecraft().textRenderer, text, x + 3, y + 3, this.textColor.getRGB());
59 | }
60 |
61 | @Override
62 | public void onClick(double mouseX, double mouseY) {
63 | this.booleanSetting.setValue(!this.booleanSetting.getValue());
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/misc/gui/elements/settings/EnumElement.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.misc.gui.elements.settings;
2 |
3 | import dev.tensor.misc.gui.elements.SettingElement;
4 | import dev.tensor.misc.imp.settings.EnumSetting;
5 | import dev.tensor.misc.imp.settings.NumberSetting;
6 | import net.minecraft.client.gui.DrawableHelper;
7 | import net.minecraft.client.util.math.MatrixStack;
8 | import net.minecraft.util.Formatting;
9 |
10 | import java.awt.*;
11 |
12 | /**
13 | * @author IUDevman
14 | * @since 05-04-2021
15 | */
16 |
17 | public final class EnumElement extends SettingElement {
18 |
19 | private final EnumSetting enumSetting;
20 |
21 | private final Color fillColor = new Color(0, 0, 0, 150);
22 | private final Color textColor = new Color(255, 255, 255, 255);
23 |
24 | public EnumElement(EnumSetting enumSetting, NumberSetting x, NumberSetting y, NumberSetting scrollY, int posX, int posY) {
25 | super(x, y, scrollY, posX, posY);
26 | this.enumSetting = enumSetting;
27 | }
28 |
29 | public EnumSetting getEnumSetting() {
30 | return this.enumSetting;
31 | }
32 |
33 | @Override
34 | public int getWidth() {
35 | return 204;
36 | }
37 |
38 | @Override
39 | public int getHeight() {
40 | return 15;
41 | }
42 |
43 | @Override
44 | public int getPosX() {
45 | return getX().getValue().intValue() + getXPos();
46 | }
47 |
48 | @Override
49 | public int getPosY() {
50 | return getY().getValue().intValue() + getScrollY().getValue().intValue() + getYPos();
51 | }
52 |
53 | @Override
54 | public void render(MatrixStack matrixStack, int x, int y) {
55 | DrawableHelper.fill(matrixStack, x, y, x + this.getWidth(), y + this.getHeight(), this.fillColor.getRGB());
56 |
57 | String text = getEnumSetting().getName() + " : " + Formatting.GRAY + getEnumSetting().getValue().name();
58 | DrawableHelper.drawStringWithShadow(matrixStack, this.getMinecraft().textRenderer, text, x + 3, y + 3, this.textColor.getRGB());
59 | }
60 |
61 | @Override
62 | public void onClick(double mouseX, double mouseY) {
63 | getEnumSetting().increment();
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/misc/imp/Category.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.misc.imp;
2 |
3 | /**
4 | * @author IUDevman
5 | * @since 04-12-2021
6 | */
7 |
8 | public enum Category {
9 |
10 | Combat,
11 | Movement,
12 | Player,
13 | Render,
14 | Misc,
15 | HUD,
16 | Client
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/misc/imp/Command.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.misc.imp;
2 |
3 | /**
4 | * @author IUDevman
5 | * @since 04-12-2021
6 | */
7 |
8 | public interface Command extends Global, Methods {
9 |
10 | String getName();
11 |
12 | String getMarker();
13 |
14 | String getSyntax();
15 |
16 | int getID();
17 |
18 | void onCommand(String[] message);
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/misc/imp/Global.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.misc.imp;
2 |
3 | import net.minecraft.client.MinecraftClient;
4 | import net.minecraft.client.gui.hud.ChatHud;
5 | import net.minecraft.client.network.ClientPlayNetworkHandler;
6 | import net.minecraft.client.network.ClientPlayerEntity;
7 | import net.minecraft.client.world.ClientWorld;
8 | import net.minecraft.entity.player.PlayerInventory;
9 |
10 | /**
11 | * @author IUDevman
12 | * @since 04-12-2021
13 | */
14 |
15 | public interface Global {
16 |
17 | default MinecraftClient getMinecraft() {
18 | return MinecraftClient.getInstance();
19 | }
20 |
21 | default ClientPlayerEntity getPlayer() {
22 | return getMinecraft().player;
23 | }
24 |
25 | default ClientWorld getWorld() {
26 | return getMinecraft().world;
27 | }
28 |
29 | default ClientPlayNetworkHandler getNetwork() {
30 | return getPlayer().networkHandler;
31 | }
32 |
33 | default PlayerInventory getInventory() {
34 | return getPlayer().getInventory();
35 | }
36 |
37 | default ChatHud getChatHud() {
38 | return getMinecraft().inGameHud.getChatHud();
39 | }
40 |
41 | default boolean isNull() {
42 | return getPlayer() == null || getWorld() == null;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/misc/imp/HUDComponent.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.misc.imp;
2 |
3 | import dev.tensor.misc.imp.settings.NumberSetting;
4 | import net.minecraft.client.util.math.MatrixStack;
5 |
6 | /**
7 | * @author IUDevman
8 | * @since 06-29-2021
9 | */
10 |
11 | public interface HUDComponent {
12 |
13 | NumberSetting getStartX();
14 |
15 | NumberSetting getStartY();
16 |
17 | void onRender2D(MatrixStack matrixStack);
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/misc/imp/Manager.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.misc.imp;
2 |
3 | /**
4 | * @author IUDevman
5 | * @since 04-12-2021
6 | */
7 |
8 | @FunctionalInterface
9 | public interface Manager extends Global, Methods {
10 |
11 | void load();
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/misc/imp/Methods.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.misc.imp;
2 |
3 | import dev.tensor.Tensor;
4 | import dev.tensor.backend.mixins.accessors.ChatHudAccessor;
5 | import net.minecraft.block.Block;
6 | import net.minecraft.item.BlockItem;
7 | import net.minecraft.item.Item;
8 | import net.minecraft.item.ItemStack;
9 | import net.minecraft.text.LiteralText;
10 | import net.minecraft.util.Formatting;
11 |
12 | /**
13 | * @author IUDevman
14 | * @since 05-14-2021
15 | */
16 |
17 | public interface Methods extends Global {
18 |
19 | String clientPrefix = Formatting.DARK_GRAY + "[" + Formatting.DARK_RED + Tensor.INSTANCE.MOD_NAME + Formatting.DARK_GRAY + "]";
20 |
21 | default void sendClientMessage(String message, boolean prefix) {
22 | this.getChatHud().addMessage(new LiteralText((prefix ? clientPrefix + " " : "") + Formatting.GRAY + message));
23 | }
24 |
25 | default void sendReplaceableClientMessage(String message, int id, boolean prefix) {
26 | ((ChatHudAccessor) this.getChatHud()).addReplaceable(new LiteralText((prefix ? clientPrefix + " " : "") + Formatting.GRAY + message), id);
27 | }
28 |
29 | default void removeReplaceableClientMessage(int id) {
30 | ((ChatHudAccessor) this.getChatHud()).removeReplaceable(id);
31 | }
32 |
33 | default int findBlock(Block block) {
34 | int slot = -1;
35 |
36 | for (int i = 0; i < 9; i++) {
37 | ItemStack itemStack = this.getInventory().getStack(i);
38 |
39 | if (itemStack.isEmpty() || !(itemStack.getItem() instanceof BlockItem)) continue;
40 |
41 | if (((BlockItem) itemStack.getItem()).getBlock().equals(block)) {
42 | slot = i;
43 | break;
44 | }
45 | }
46 |
47 | return slot;
48 | }
49 |
50 | default int findItem(Item item) {
51 | int slot = -1;
52 |
53 | for (int i = 0; i < 9; i++) {
54 | ItemStack itemStack = this.getInventory().getStack(i);
55 |
56 | if (itemStack.isEmpty()) continue;
57 |
58 | if (itemStack.getItem().equals(item)) {
59 | slot = i;
60 | break;
61 | }
62 | }
63 |
64 | return slot;
65 | }
66 |
67 | default void swap(int slot) {
68 | this.getInventory().selectedSlot = slot;
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/misc/imp/Module.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.misc.imp;
2 |
3 | import dev.tensor.Tensor;
4 | import net.minecraft.util.Formatting;
5 | import org.lwjgl.glfw.GLFW;
6 |
7 | import java.lang.annotation.*;
8 |
9 | /**
10 | * @author IUDevman
11 | * @since 04-12-2021
12 | */
13 |
14 | @SuppressWarnings("EmptyMethod")
15 | public abstract class Module implements Global, Methods {
16 |
17 | @Documented
18 | @Retention(RetentionPolicy.RUNTIME)
19 | @Target(ElementType.TYPE)
20 | public @interface Info {
21 | String name();
22 |
23 | Category category();
24 |
25 | int bind() default GLFW.GLFW_KEY_UNKNOWN;
26 |
27 | boolean drawn() default true;
28 |
29 | boolean messages() default false;
30 |
31 | boolean enabled() default false;
32 | }
33 |
34 | private Info getInfo() {
35 | return getClass().getAnnotation(Info.class);
36 | }
37 |
38 | private final String name = getInfo().name();
39 | private final Category category = getInfo().category();
40 | private int bind = getInfo().bind();
41 | private boolean drawn = getInfo().drawn();
42 | private boolean messages = getInfo().messages();
43 | private boolean enabled = getInfo().enabled();
44 |
45 | public void reset() {
46 | this.bind = getInfo().bind();
47 | this.drawn = getInfo().drawn();
48 | this.messages = getInfo().messages();
49 | this.enabled = getInfo().enabled();
50 | }
51 |
52 | public String getName() {
53 | return this.name;
54 | }
55 |
56 | public Category getCategory() {
57 | return this.category;
58 | }
59 |
60 | public int getBind() {
61 | return this.bind;
62 | }
63 |
64 | public void setBind(int bind) {
65 | this.bind = bind;
66 | }
67 |
68 | public boolean isDrawn() {
69 | return this.drawn;
70 | }
71 |
72 | public void setDrawn(boolean drawn) {
73 | this.drawn = drawn;
74 | }
75 |
76 | public boolean isMessages() {
77 | return this.messages;
78 | }
79 |
80 | public void setMessages(boolean messages) {
81 | this.messages = messages;
82 | }
83 |
84 | public boolean isEnabled() {
85 | return this.enabled;
86 | }
87 |
88 | public void setEnabled(boolean enabled) {
89 | if (enabled) enable();
90 | else disable();
91 | }
92 |
93 | public void toggle() {
94 | setEnabled(!isEnabled());
95 | }
96 |
97 | protected void enable() {
98 | this.enabled = true;
99 | Tensor.INSTANCE.EVENT_HANDLER.register(this);
100 | if (!this.isNull()) {
101 | onEnable();
102 | if (isMessages()) this.sendReplaceableClientMessage(Formatting.GREEN + getName() + " ENABLED!", 665, true);
103 | }
104 | }
105 |
106 | protected void disable() {
107 | this.enabled = false;
108 | Tensor.INSTANCE.EVENT_HANDLER.unregister(this);
109 | if (!this.isNull()) {
110 | onDisable();
111 | if (isMessages()) this.sendReplaceableClientMessage(Formatting.RED + getName() + " DISABLED!", 665, true);
112 | }
113 | }
114 |
115 | protected void onEnable() {
116 |
117 | }
118 |
119 | protected void onDisable() {
120 |
121 | }
122 |
123 | public void onTick() {
124 |
125 | }
126 |
127 | public void onRender3D() {
128 |
129 | }
130 | }
131 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/misc/imp/Setting.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.misc.imp;
2 |
3 | /**
4 | * @author IUDevman
5 | * @since 04-12-2021
6 | */
7 |
8 | public interface Setting {
9 |
10 | String getName();
11 |
12 | T getDefaultValue();
13 |
14 | T getValue();
15 |
16 | void setValue(T value);
17 |
18 | default void reset() {
19 | setValue(getDefaultValue());
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/misc/imp/settings/BooleanSetting.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.misc.imp.settings;
2 |
3 | import dev.tensor.misc.imp.Setting;
4 |
5 | /**
6 | * @author IUDevman
7 | * @since 04-12-2021
8 | */
9 |
10 | public final class BooleanSetting implements Setting {
11 |
12 | private final String name;
13 | private final boolean defaultValue;
14 | private boolean value;
15 |
16 | public BooleanSetting(String name, boolean value) {
17 | this.name = name;
18 | this.defaultValue = value;
19 | this.value = value;
20 | }
21 |
22 | @Override
23 | public String getName() {
24 | return this.name;
25 | }
26 |
27 | @Override
28 | public Boolean getDefaultValue() {
29 | return this.defaultValue;
30 | }
31 |
32 | @Override
33 | public Boolean getValue() {
34 | return this.value;
35 | }
36 |
37 | @Override
38 | public void setValue(Boolean value) {
39 | this.value = value;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/misc/imp/settings/ColorSetting.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.misc.imp.settings;
2 |
3 | import dev.tensor.misc.imp.Setting;
4 |
5 | import java.awt.*;
6 |
7 | /**
8 | * @author IUDevman
9 | * @since 04-15-2021
10 | */
11 |
12 | public final class ColorSetting implements Setting {
13 |
14 | private final String name;
15 | private final Color defaultValue;
16 | private Color value;
17 |
18 | public ColorSetting(String name, Color value) {
19 | this.name = name;
20 | this.defaultValue = value;
21 | this.value = value;
22 | }
23 |
24 | @Override
25 | public String getName() {
26 | return name;
27 | }
28 |
29 | @Override
30 | public Color getDefaultValue() {
31 | return this.defaultValue;
32 | }
33 |
34 | @Override
35 | public Color getValue() {
36 | return value;
37 | }
38 |
39 | @Override
40 | public void setValue(Color value) {
41 | this.value = value;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/misc/imp/settings/EnumSetting.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.misc.imp.settings;
2 |
3 | import dev.tensor.misc.imp.Setting;
4 |
5 | /**
6 | * @author IUDevman
7 | * @since 04-12-2021
8 | */
9 |
10 | public final class EnumSetting implements Setting> {
11 |
12 | private final String name;
13 | private final Enum> defaultValue;
14 | private Enum> value;
15 |
16 | public EnumSetting(String name, Enum> value) {
17 | this.name = name;
18 | this.defaultValue = value;
19 | this.value = value;
20 | }
21 |
22 | @Override
23 | public String getName() {
24 | return this.name;
25 | }
26 |
27 | @Override
28 | public Enum> getDefaultValue() {
29 | return this.defaultValue;
30 | }
31 |
32 | @Override
33 | public Enum> getValue() {
34 | return this.value;
35 | }
36 |
37 | @Override
38 | public void setValue(Enum> value) {
39 | this.value = value;
40 | }
41 |
42 | public void increment() {
43 | Enum>[] array = getValue().getDeclaringClass().getEnumConstants();
44 | int index = getValue().ordinal() + 1;
45 |
46 | if (index >= array.length) index = 0;
47 |
48 | setValue(array[index]);
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/misc/imp/settings/NumberSetting.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.misc.imp.settings;
2 |
3 | import dev.tensor.misc.imp.Setting;
4 |
5 | /**
6 | * @author IUDevman
7 | * @since 04-12-2021
8 | */
9 |
10 | public final class NumberSetting implements Setting {
11 |
12 | private final String name;
13 | private final double defaultValue;
14 | private double value;
15 | private final double min;
16 | private final double max;
17 | private final int decimal;
18 |
19 | public NumberSetting(String name, double value, double min, double max, int decimal) {
20 | this.name = name;
21 | this.defaultValue = value;
22 | this.value = value;
23 | this.min = min;
24 | this.max = max;
25 | this.decimal = decimal;
26 | }
27 |
28 | @Override
29 | public String getName() {
30 | return this.name;
31 | }
32 |
33 | @Override
34 | public Double getDefaultValue() {
35 | return this.defaultValue;
36 | }
37 |
38 | @Override
39 | public Double getValue() {
40 | return this.value;
41 | }
42 |
43 | @Override
44 | public void setValue(Double value) {
45 | this.value = value;
46 | }
47 |
48 | public double getMin() {
49 | return this.min;
50 | }
51 |
52 | public double getMax() {
53 | return this.max;
54 | }
55 |
56 | public int getDecimal() {
57 | return this.decimal;
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/misc/plugin/Plugin.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.misc.plugin;
2 |
3 | import dev.tensor.misc.imp.Global;
4 | import dev.tensor.misc.imp.Methods;
5 |
6 | import java.lang.annotation.*;
7 |
8 | /**
9 | * @author IUDevman
10 | * @since 08-10-2021
11 | */
12 |
13 | @SuppressWarnings("EmptyMethod")
14 | public abstract class Plugin implements Global, Methods {
15 |
16 | @Documented
17 | @Retention(RetentionPolicy.RUNTIME)
18 | @Target(ElementType.TYPE)
19 | public @interface Info {
20 | String name();
21 |
22 | String version();
23 | }
24 |
25 | private Info getInfo() {
26 | return getClass().getAnnotation(Info.class);
27 | }
28 |
29 | private final String name = getInfo().name();
30 | private final String version = getInfo().version();
31 |
32 | public String getName() {
33 | return this.name;
34 | }
35 |
36 | public String getVersion() {
37 | return this.version;
38 | }
39 |
40 | public abstract void load();
41 |
42 | public void save() {
43 |
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/main/java/dev/tensor/misc/plugin/PluginEntryPoint.java:
--------------------------------------------------------------------------------
1 | package dev.tensor.misc.plugin;
2 |
3 | import java.lang.annotation.*;
4 |
5 | /**
6 | * @author IUDevman
7 | * @since 08-10-2021
8 | */
9 |
10 | @Documented
11 | @Retention(RetentionPolicy.RUNTIME)
12 | @Target(ElementType.METHOD)
13 | public @interface PluginEntryPoint {
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/resources/fabric.mod.json:
--------------------------------------------------------------------------------
1 | {
2 | "schemaVersion": 1,
3 | "id": "tensor",
4 | "version": "${version}",
5 | "name": "Tensor",
6 | "description": "1.17.1 utility mod for anarchy-related servers using Fabric.",
7 | "authors": [
8 | "Go_Hoosiers"
9 | ],
10 | "contact": {
11 | "homepage": "https://github.com/IUDevman",
12 | "sources": "https://github.com/IUDevman/Tensor"
13 | },
14 | "license": "MIT",
15 | "environment": "*",
16 | "entrypoints": {
17 | "client": [
18 | "dev.tensor.Tensor"
19 | ]
20 | },
21 | "mixins": [
22 | "tensor.mixins.json"
23 | ],
24 | "depends": {
25 | "fabricloader": ">=0.11.3",
26 | "minecraft": "1.17.x",
27 | "java": ">=16"
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/resources/tensor.mixins.json:
--------------------------------------------------------------------------------
1 | {
2 | "required": true,
3 | "minVersion": "0.8",
4 | "package": "dev.tensor.backend.mixins",
5 | "priority": 1010,
6 | "mixinPriority": 1010,
7 | "compatibilityLevel": "JAVA_16",
8 | "mixins": [
9 | "AbstractClientPlayerEntityMixin",
10 | "AdvancementToastMixin",
11 | "ArmorFeatureRendererMixin",
12 | "BackgroundRendererMixin",
13 | "BlockMixin",
14 | "BossBarHudMixin",
15 | "CameraMixin",
16 | "ChatScreenMixin",
17 | "ClientBrandRetrieverMixin",
18 | "ClientConnectionMixin",
19 | "ClientPlayerEntityMixin",
20 | "ClientPlayerInteractionManagerMixin",
21 | "CobWebBlockMixin",
22 | "CrashReportMixin",
23 | "DimensionTypeMixin",
24 | "EnchantingTableBlockEntityRendererMixin",
25 | "EntityMixin",
26 | "FluidBlockMixin",
27 | "FluidStateMixin",
28 | "GameRendererMixin",
29 | "HeldItemRendererMixin",
30 | "InGameHudMixin",
31 | "InGameOverlayRendererMixin",
32 | "KeyBindingMixin",
33 | "KeyboardInputMixin",
34 | "MinecraftClientMixin",
35 | "NarratorManagerMixin",
36 | "PlayerEntityMixin",
37 | "PlayerEntityRendererMixin",
38 | "PowderSnowBlockMixin",
39 | "RecipeToastMixin",
40 | "RenderTickCounterMixin",
41 | "ScreenMixin",
42 | "SlimeBlockMixin",
43 | "SoundManagerMixin",
44 | "SweetBerryBushBlockMixin",
45 | "WorldRendererMixin",
46 | "accessors.ChatHudAccessor",
47 | "accessors.ChatMessageC2SPacketAccessor",
48 | "accessors.ClientPlayerEntityAccessor",
49 | "accessors.CloseHandledScreenC2SAccessor",
50 | "accessors.EntityVelocityUpdateS2CPacketAccessor",
51 | "accessors.ExplosionS2CPacketAccessor",
52 | "accessors.KeyBindingAccessor",
53 | "accessors.MinecraftClientAccessor",
54 | "accessors.PlayerMoveC2SPacketAccessor"
55 | ],
56 | "injectors": {
57 | "defaultRequire": 1
58 | }
59 | }
60 |
--------------------------------------------------------------------------------