├── .gitignore
├── .idea
├── .gitignore
├── compiler.xml
├── discord.xml
├── gradle.xml
├── inspectionProfiles
│ └── Project_Default.xml
├── jarRepositories.xml
├── libraries
│ ├── apache_logging_log4j_1_2_api.xml
│ ├── groovy_4_0_2.xml
│ ├── junit_jupiter.xml
│ ├── lwjgl.xml
│ └── lwjgl1.xml
├── meowhack.iml
├── misc.xml
├── modules.xml
├── modules
│ ├── Meowhack.api.iml
│ ├── Meowhack.iml
│ ├── Meowhack.main.iml
│ └── Meowhack.test.iml
├── runConfigurations
│ ├── Minecraft_Client.xml
│ └── Minecraft_Server.xml
├── templateLanguages.xml
├── uiDesigner.xml
└── vcs.xml
├── LICENSE.md
├── README.md
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── src
├── main
├── java
│ └── me
│ │ └── notkronos
│ │ └── meowhack
│ │ ├── Loader.java
│ │ ├── Meowhack.java
│ │ ├── command
│ │ ├── Command.java
│ │ └── commands
│ │ │ ├── BindCommand.java
│ │ │ ├── Drawn.java
│ │ │ ├── Font.java
│ │ │ ├── Friend.java
│ │ │ ├── Load.java
│ │ │ ├── Save.java
│ │ │ └── SpammerFile.java
│ │ ├── event
│ │ └── events
│ │ │ ├── client
│ │ │ └── SettingUpdateEvent.java
│ │ │ ├── combat
│ │ │ └── TotemPopEvent.java
│ │ │ ├── entity
│ │ │ ├── DeathEvent.java
│ │ │ └── EntityWorldEvent.java
│ │ │ ├── network
│ │ │ └── PacketEvent.java
│ │ │ └── render
│ │ │ ├── RenderCrystalEvent.java
│ │ │ ├── RenderFontEvent.java
│ │ │ ├── RenderLivingEntityEvent.java
│ │ │ ├── RenderWorldEvent.java
│ │ │ └── tileEntity
│ │ │ └── RenderEnchantmentTableEvent.java
│ │ ├── font
│ │ ├── CustomFont.java
│ │ └── CustomFontRenderer.java
│ │ ├── gui
│ │ └── clickgui
│ │ │ ├── ClickGuiScreen.java
│ │ │ ├── Frame.java
│ │ │ └── items
│ │ │ ├── Button.java
│ │ │ ├── Item.java
│ │ │ └── buttons
│ │ │ ├── BindButton.java
│ │ │ ├── BooleanButton.java
│ │ │ ├── EnumButton.java
│ │ │ ├── FloatSlider.java
│ │ │ ├── IntegerSlider.java
│ │ │ └── ModuleButton.java
│ │ ├── manager
│ │ ├── Manager.java
│ │ └── managers
│ │ │ ├── CommandManager.java
│ │ │ ├── ConfigManager.java
│ │ │ ├── EventManager.java
│ │ │ ├── FriendManager.java
│ │ │ ├── HoleManager.java
│ │ │ ├── ModuleManager.java
│ │ │ ├── ThreadManager.java
│ │ │ └── TickManager.java
│ │ ├── mixin
│ │ └── mixins
│ │ │ ├── MixinMinecraft.java
│ │ │ ├── accessor
│ │ │ ├── ICPacketChatMessageAccessor.java
│ │ │ ├── IMInecraftAccessor.java
│ │ │ ├── ITextComponentStringAccessor.java
│ │ │ └── ITimerAccessor.java
│ │ │ ├── entity
│ │ │ ├── MixinEntityLivingBase.java
│ │ │ └── player
│ │ │ │ └── MixinAbstractClientPlayer.java
│ │ │ ├── gui
│ │ │ └── MixinGuiBossOverlay.java
│ │ │ ├── network
│ │ │ └── MixinNetworkManager.java
│ │ │ ├── render
│ │ │ ├── MixinLayerArmorBase.java
│ │ │ ├── MixinParticleTotem.java
│ │ │ ├── entity
│ │ │ │ ├── IEntityRenderer.java
│ │ │ │ ├── MixinEntityRenderer.java
│ │ │ │ ├── MixinRenderEnderCrystal.java
│ │ │ │ ├── MixinRenderLivingBase.java
│ │ │ │ └── MixinRenderPlayer.java
│ │ │ ├── gui
│ │ │ │ └── MixinFontRenderer.java
│ │ │ └── tileEntity
│ │ │ │ └── MixinTileEntityEnchantmentTableRenderer.java
│ │ │ └── world
│ │ │ └── MixinWorld.java
│ │ ├── module
│ │ ├── Category.java
│ │ ├── Module.java
│ │ ├── client
│ │ │ ├── ClickGUIModule.java
│ │ │ ├── Colors.java
│ │ │ ├── CustomFontMod.java
│ │ │ └── HUD.java
│ │ ├── combat
│ │ │ ├── AntiPoplag.java
│ │ │ ├── AutoHeadBurrow.java
│ │ │ ├── ChestplateSwap.java
│ │ │ ├── CornerClip.java
│ │ │ ├── PopLag.java
│ │ │ ├── StrengthDetect.java
│ │ │ ├── TotemPopCounter.java
│ │ │ └── VisualRange.java
│ │ ├── misc
│ │ │ ├── Announcer.java
│ │ │ ├── AutoMeow.java
│ │ │ ├── ChatSuffix.java
│ │ │ ├── ChatTimestamp.java
│ │ │ ├── NBTViewer.java
│ │ │ ├── RPC.java
│ │ │ └── Spammer.java
│ │ ├── movement
│ │ │ └── Sprint.java
│ │ └── render
│ │ │ ├── Ambience.java
│ │ │ ├── CrystalChamsRewrite.java
│ │ │ ├── DeathEffects.java
│ │ │ ├── FullBright.java
│ │ │ ├── HoleESP.java
│ │ │ ├── NoBob.java
│ │ │ ├── NoEnchantingTableLag.java
│ │ │ ├── NoRender.java
│ │ │ ├── PlayerChams.java
│ │ │ ├── PlayerModel.java
│ │ │ ├── PopParticles.java
│ │ │ ├── StaticFOV.java
│ │ │ ├── SwingSpeed.java
│ │ │ └── Weather.java
│ │ ├── setting
│ │ ├── Setting.java
│ │ └── settings
│ │ │ ├── BindSetting.java
│ │ │ ├── BooleanSetting.java
│ │ │ ├── EnumSetting.java
│ │ │ ├── FloatSetting.java
│ │ │ ├── IntegerSetting.java
│ │ │ └── StringSetting.java
│ │ └── util
│ │ ├── Bind.java
│ │ ├── ColorUtil.java
│ │ ├── EnumUtil.java
│ │ ├── MathUtil.java
│ │ ├── MotionUtil.java
│ │ ├── Passable.java
│ │ ├── Stopwatch.java
│ │ ├── Timer.java
│ │ ├── Wrapper.java
│ │ ├── chat
│ │ ├── ChatUtil.java
│ │ └── MessageType.java
│ │ ├── file
│ │ └── FileSystemUtil.java
│ │ ├── minecraft
│ │ ├── BlockUtil.java
│ │ ├── EntityUtil.java
│ │ └── PlayerUtil.java
│ │ ├── render
│ │ ├── FontUtil.java
│ │ ├── RenderBuilder.java
│ │ └── RenderUtil.java
│ │ ├── rpc
│ │ └── IMAGE.java
│ │ └── string
│ │ └── FormatUtil.java
└── resources
│ ├── assets
│ ├── meowhack
│ │ └── shaders
│ │ │ ├── blur.json
│ │ │ ├── glow.fsh
│ │ │ ├── item.fsh
│ │ │ └── passthrough.vsh
│ └── minecraft
│ │ ├── meowhack
│ │ └── shaders
│ │ │ ├── frag
│ │ │ ├── hgrad.frag
│ │ │ ├── itemglow.frag
│ │ │ ├── rainbow.frag
│ │ │ └── vgrad.frag
│ │ │ ├── vert
│ │ │ └── chams.vert
│ │ │ └── vertex.vert
│ │ └── textures
│ │ └── rainbow.png
│ ├── mcmod.info
│ ├── mixins.meowhack.json
│ └── shaders
│ ├── alpha.shader
│ ├── armorimage.shader
│ ├── blur.shader
│ ├── cape.shader
│ ├── chams.shader
│ ├── cool.shader
│ ├── default.shader
│ ├── framebufferimage.shader
│ ├── hgrad.shader
│ ├── image.shader
│ ├── item.shader
│ ├── model.shader
│ ├── modelrender.shader
│ ├── modelrenderboneless.shader
│ ├── newimage.shader
│ ├── outlineglow.shader
│ ├── stars.shader
│ ├── stencil.shader
│ ├── testing.shader
│ ├── vgrad.shader
│ └── water.shader
└── test
└── java
└── me
└── notkronos
└── meowhack
└── util
└── ColorUtilTest.java
/.gitignore:
--------------------------------------------------------------------------------
1 | # Project exclude paths
2 | /.gradle/
3 | /build/
4 | /lib/
5 | /run/
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/discord.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
17 |
18 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/jarRepositories.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/.idea/libraries/apache_logging_log4j_1_2_api.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/libraries/junit_jupiter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/.idea/libraries/lwjgl.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/.idea/libraries/lwjgl1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/.idea/meowhack.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/modules/Meowhack.api.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | FORGE
8 | MIXIN
9 | MCP
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/.idea/modules/Meowhack.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | MIXIN
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/modules/Meowhack.main.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | FORGE
8 | MIXIN
9 | MCP
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/.idea/modules/Meowhack.test.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | FORGE
8 | MIXIN
9 | MCP
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/.idea/runConfigurations/Minecraft_Client.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/.idea/templateLanguages.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Meowhack
2 | Minecraft utility mod for 1.12.2
3 |
4 |
5 |
6 | # Download
7 | https://github.com/OutOfOpioids/meowhack/releases/download/1.4/meowhack-1.4.jar
8 |
9 | # FAQ
10 |
11 | - How do I open click GUI?
12 | By default it's bound to RControl
13 | - What's the command prefix?
14 | Client's prefix is "++".
15 | - Where are the configs stored?
16 | %userprofile%/meowhack/config
17 |
18 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | maven { url 'https://repo.spongepowered.org/maven' }
5 | maven { url 'https://maven.minecraftforge.net/' }
6 | }
7 | dependencies {
8 | classpath 'net.minecraftforge.gradle:ForgeGradle:2.3.4'
9 | classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
10 | }
11 | }
12 | apply plugin: 'net.minecraftforge.gradle.forge'
13 | apply plugin: 'org.spongepowered.mixin'
14 |
15 | version = modversion
16 | group = modgroup
17 | archivesBaseName = modid
18 |
19 | sourceCompatibility = targetCompatibility = '1.8'
20 | compileJava {
21 | sourceCompatibility = targetCompatibility = '1.8'
22 | options.encoding 'UTF-8'
23 | }
24 |
25 | minecraft {
26 | version = mcforgeversion
27 | runDir = 'run'
28 | mappings = mappingsversion
29 | makeObfSourceJar = false
30 | clientJvmArgs += '-Dfml.coreMods.load=' + mixinclass
31 | clientRunArgs += '--mixin ' + mixinconfig
32 | }
33 |
34 | mixin {
35 | defaultObfuscationEnv searge // Types of obf env: searge, notch.
36 | sourceSets {
37 | main {
38 | ext.refMap = 'mixins.meowhack.refmap.json'
39 | }
40 | }
41 | }
42 |
43 | repositories {
44 | mavenCentral()
45 | maven { url 'https://repo.spongepowered.org/maven' }
46 | maven { url 'https://jitpack.io' }
47 | }
48 |
49 | configurations {
50 | embed
51 | compile.extendsFrom embed
52 | }
53 |
54 | dependencies {
55 | implementation 'org.jetbrains:annotations:19.0.0'
56 | testImplementation 'junit:junit:4.13.1'
57 | testImplementation 'junit:junit:4.13.1'
58 | testImplementation 'org.junit.jupiter:junit-jupiter:5.8.1'
59 |
60 | embed('org.spongepowered:mixin:0.7.11-SNAPSHOT') {
61 | exclude module: 'launchwrapper'
62 | exclude module: 'guava'
63 | exclude module: 'gson'
64 | exclude module: 'commons-io'
65 | exclude module: 'log4j-core'
66 | }
67 |
68 | embed('club.minnced:java-discord-rpc:2.0.2') {
69 | exclude module: 'jna'
70 | }
71 |
72 | embed ('com.moandjiezana.toml:toml4j:0.7.2') {
73 | exclude module: 'gson'
74 | }
75 | }
76 |
77 | processResources {
78 | inputs.property 'version', project.version
79 | from(sourceSets.main.resources.srcDirs) {
80 | include 'mcmod.info'
81 | expand 'version': project.version
82 | }
83 | from(sourceSets.main.resources.srcDirs) {
84 | exclude 'mcmod.info'
85 | }
86 | }
87 |
88 | jar {
89 | from(configurations.embed.collect {
90 | it.isDirectory() ? it : zipTree(it)
91 | }) {
92 | // Excludes/Removes useless bloat files from the compiled jar.
93 | exclude 'dummyThing',
94 | 'LICENSE.txt',
95 | 'META-INF/MUMFREY.RSA',
96 | 'META-INF/maven/**',
97 | 'org/**/*.html'
98 | }
99 | manifest.attributes(
100 | 'MixinConfigs': mixinconfig,
101 | 'TweakClass': 'org.spongepowered.asm.launch.MixinTweaker',
102 | 'TweakOrder': 0,
103 | 'FMLCorePlugin': mixinclass,
104 | 'ForceLoadAsMod': 'true'
105 | )
106 | }
107 |
108 | test {
109 | useJUnitPlatform()
110 | }
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs = -Xmx3G
2 | org.gradle.parallel = true
3 | org.gradle.caching = true
4 | modversion = 1.5-beta
5 | modid = meowhack
6 | modname = Meowhack
7 | modgroup = me.notkronos
8 | mainclass = me.notkronos.meowhack.Meowhack
9 | mixinclass = me.notkronos.meowhack.Loader
10 | mixinconfig = mixins.meowhack.json
11 | mcforgeversion=1.12.2-14.23.5.2768
12 | mappingsversion=stable_39
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OutOfOpioids/meowhack/70863b2fba15702b17b8954b7c1ca3a193205190/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
6 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/Loader.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack;
2 |
3 | import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
4 | import org.spongepowered.asm.launch.MixinBootstrap;
5 | import org.spongepowered.asm.mixin.Mixins;
6 |
7 | import java.util.Map;
8 |
9 | @IFMLLoadingPlugin.Name("Meowhack")
10 | @IFMLLoadingPlugin.MCVersion("1.12.2")
11 | public class Loader implements IFMLLoadingPlugin {
12 | public Loader() {
13 | MixinBootstrap.init();
14 | Mixins.addConfiguration("mixins.meowhack.json");
15 | }
16 |
17 | @Override
18 | public String[] getASMTransformerClass() {
19 | return null;
20 | }
21 |
22 | @Override
23 | public String getModContainerClass() {
24 | return null;
25 | }
26 |
27 | @Override
28 | public String getSetupClass() {
29 | return null;
30 | }
31 |
32 | @Override
33 | public void injectData(Map data) {
34 |
35 | }
36 |
37 | @Override
38 | public String getAccessTransformerClass() {
39 | return null;
40 | }
41 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/command/Command.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.command;
2 |
3 | import me.notkronos.meowhack.util.Wrapper;
4 | import me.notkronos.meowhack.util.chat.MessageType;
5 |
6 | import java.io.IOException;
7 |
8 | public abstract class Command implements Wrapper {
9 | String name;
10 | String description;
11 | String[] alias;
12 |
13 | public Command(String name, String description) {
14 | this.name = name;
15 | this.description = description;
16 | }
17 |
18 | public Command(String name, String description, String[] alias) {
19 | this.name = name;
20 | this.description = name;
21 | this.alias = alias;
22 | }
23 |
24 | public abstract void onExecute(String[] args) throws IOException;
25 |
26 | public abstract String getUseCase();
27 |
28 | public abstract int getArgSize();
29 |
30 | public abstract String getName();
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/command/commands/BindCommand.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.command.commands;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import me.notkronos.meowhack.command.Command;
5 | import me.notkronos.meowhack.module.Module;
6 | import me.notkronos.meowhack.util.Bind;
7 | import me.notkronos.meowhack.util.Bind.Device;
8 | import me.notkronos.meowhack.util.chat.ChatUtil;
9 | import me.notkronos.meowhack.util.chat.MessageType;
10 | import org.lwjgl.input.Keyboard;
11 |
12 | public class BindCommand extends Command {
13 |
14 | private final String name = "bind";
15 |
16 | public BindCommand() {
17 | super("bind","Used to change module keybinds", new String[]{});
18 | }
19 |
20 | @Override
21 | public void onExecute(String[] args) {
22 | if(args.length != 2) {
23 | ChatUtil.commandFeedback("Bind takes 2 arguments. Correct usage is " + Meowhack.PREFIX + "bind " + getUseCase(), MessageType.ERROR);
24 | return;
25 | }
26 |
27 | Module module = getMeowhack().getModuleManager().getModule(name -> name.getName().equalsIgnoreCase(args[0]));
28 |
29 | if(module == null) {
30 | ChatUtil.commandFeedback("Module " + args[0] + " doesn't exist", MessageType.ERROR);
31 | return;
32 | }
33 |
34 | int key = Keyboard.getKeyIndex(args[1].toUpperCase());
35 |
36 | if(key != Keyboard.KEY_NONE) {
37 | module.getBind().setValue(new Bind(key, Device.KEYBOARD));
38 | ChatUtil.commandFeedback("Bound " + module.getName() + " to " + args[1].toUpperCase(), MessageType.SUCCESS);
39 | }
40 | }
41 |
42 | @Override
43 | public String getUseCase() {
44 | return " [bind]";
45 | }
46 |
47 | @Override
48 | public int getArgSize() {
49 | return 2;
50 | }
51 |
52 | @Override
53 | public String getName() {
54 | return name;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/command/commands/Drawn.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.command.commands;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import me.notkronos.meowhack.command.Command;
5 | import me.notkronos.meowhack.module.Module;
6 | import me.notkronos.meowhack.util.chat.ChatUtil;
7 | import me.notkronos.meowhack.util.chat.MessageType;
8 |
9 | public class Drawn extends Command {
10 |
11 | private final String name = "drawn";
12 |
13 | public Drawn() {
14 | super("drawn","Decides if modules should be in the array list", new String[] {"drawn", "draw"});
15 | }
16 |
17 | @Override
18 | public void onExecute(String[] args) {
19 | if(args.length != 1) {
20 | ChatUtil.commandFeedback("Drawn takes 1 argument. Correct usage is " + Meowhack.PREFIX + "drawn " + getUseCase(), MessageType.ERROR);
21 | }
22 |
23 | Module module = getMeowhack().getModuleManager().getModule(name -> name.getName().equals(args[0]));
24 | if(module != null) {
25 | module.setDrawn(!module.isDrawn());
26 | } else {
27 | ChatUtil.commandFeedback("Module " + args[0] + " not found.", MessageType.ERROR);
28 | }
29 | }
30 |
31 | @Override
32 | public int getArgSize() {
33 | return 1;
34 | }
35 |
36 | @Override
37 | public String getName() {
38 | return name;
39 | }
40 |
41 | @Override
42 | public String getUseCase() {
43 | return "";
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/command/commands/Font.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.command.commands;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import me.notkronos.meowhack.command.Command;
5 | import me.notkronos.meowhack.font.CustomFontRenderer;
6 | import me.notkronos.meowhack.module.client.CustomFontMod;
7 | import me.notkronos.meowhack.util.chat.ChatUtil;
8 | import me.notkronos.meowhack.util.chat.MessageType;
9 | import me.notkronos.meowhack.util.render.FontUtil;
10 |
11 | import java.awt.*;
12 | import java.io.IOException;
13 | import java.util.Arrays;
14 | import java.util.List;
15 |
16 | public class Font extends Command {
17 | public Font() {
18 | super("font", "Change the font", new String[]{"font", "font"});
19 | }
20 |
21 | public static String fontName = "Verdana";
22 |
23 | @Override
24 | public void onExecute(String[] args) throws IOException {
25 | if (args.length == 1) {
26 | List fonts = Arrays.asList(GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames());
27 | if(fonts.stream().anyMatch(f -> f.equalsIgnoreCase(args[0]))) {
28 | FontUtil.customFont = new CustomFontRenderer(
29 | new java.awt.Font(args[0],
30 | CustomFontMod.fontStyle.value,
31 | CustomFontMod.fontSize.value
32 | ),
33 | CustomFontMod.antiAlias.value,
34 | CustomFontMod.metrics.value
35 | );
36 | fontName = args[0];
37 | Meowhack.INSTANCE.getConfigManager().saveFont(args[0]);
38 | } else {
39 | ChatUtil.commandFeedback("Font " + args[0] + " not found.", MessageType.ERROR);
40 | }
41 | }
42 | }
43 |
44 | @Override
45 | public String getUseCase() {
46 | return null;
47 | }
48 |
49 | @Override
50 | public int getArgSize() {
51 | return 1;
52 | }
53 |
54 | @Override
55 | public String getName() {
56 | return "font";
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/command/commands/Friend.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.command.commands;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import me.notkronos.meowhack.command.Command;
5 | import me.notkronos.meowhack.util.chat.ChatUtil;
6 | import me.notkronos.meowhack.util.chat.MessageType;
7 |
8 | public class Friend extends Command {
9 |
10 | public Friend() {
11 | super("friend", "Add or remove a friend", new String[]{"f", "friends"});
12 | }
13 |
14 | @Override
15 | public void onExecute(String[] args) {
16 | if(args.length == 1) {
17 | addFriend(args[0]);
18 | }
19 | else if(args.length == 2) {
20 | if(args[0].equalsIgnoreCase("add")) {
21 | addFriend(args[1]);
22 | }
23 | else if(args[0].equalsIgnoreCase("del") || args[0].equalsIgnoreCase("remove")) {
24 | removeFriend(args[1]);
25 | }
26 | else {
27 | ChatUtil.commandFeedback("Friend takes 1 or 2 arguments. Correct usage is " + Meowhack.PREFIX + "friend " + getUseCase(), MessageType.ERROR);
28 | }
29 | }
30 | else {
31 | ChatUtil.commandFeedback("Friend takes 1 or 2 arguments. Correct usage is " + Meowhack.PREFIX + "friend " + getUseCase(), MessageType.ERROR);
32 | }
33 | Meowhack.INSTANCE.getConfigManager().saveFriends();
34 | }
35 |
36 | private void addFriend(String name) {
37 | if(Meowhack.INSTANCE.getFriendManager().isFriend(name)) {
38 | ChatUtil.commandFeedback(name + " is already a friend", MessageType.ERROR);
39 | return;
40 | }
41 | Meowhack.INSTANCE.getFriendManager().addFriend(name);
42 | ChatUtil.commandFeedback("Added " + name + " as a friend", MessageType.SUCCESS);
43 | }
44 |
45 | private void removeFriend(String name) {
46 | if(!Meowhack.INSTANCE.getFriendManager().isFriend(name)) {
47 | ChatUtil.commandFeedback(name + " is not a friend", MessageType.ERROR);
48 | return;
49 | }
50 | Meowhack.INSTANCE.getFriendManager().removeFriend(name);
51 | ChatUtil.commandFeedback("Removed " + name + " as a friend", MessageType.ERROR);
52 | }
53 |
54 | @Override
55 | public String getUseCase() {
56 | return "(add/del) ";
57 | }
58 |
59 | @Override
60 | public int getArgSize() {
61 | return 2;
62 | }
63 |
64 | @Override
65 | public String getName() {
66 | return "friend";
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/command/commands/Load.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.command.commands;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import me.notkronos.meowhack.command.Command;
5 | import me.notkronos.meowhack.util.chat.ChatUtil;
6 | import me.notkronos.meowhack.util.chat.MessageType;
7 |
8 | public class Load extends Command {
9 |
10 | public Load() {
11 | super("load", "Used to load the config", new String[]{});
12 | }
13 |
14 | @Override
15 | public void onExecute(String[] args) {
16 | Meowhack.INSTANCE.getConfigManager().loadModules();
17 | Meowhack.INSTANCE.getConfigManager().loadFriends();
18 | ChatUtil.commandFeedback("Loaded the default config", MessageType.SUCCESS);
19 | }
20 |
21 | @Override
22 | public String getUseCase() {
23 | return "";
24 | }
25 |
26 | @Override
27 | public int getArgSize() {
28 | return 0;
29 | }
30 |
31 | @Override
32 | public String getName() {
33 | return "load";
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/command/commands/Save.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.command.commands;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import me.notkronos.meowhack.command.Command;
5 | import me.notkronos.meowhack.util.chat.ChatUtil;
6 | import me.notkronos.meowhack.util.chat.MessageType;
7 |
8 | public class Save extends Command {
9 |
10 | public Save() {
11 | super("save", "Used to save the config", new String[]{});
12 | }
13 |
14 | @Override
15 | public void onExecute(String[] args) {
16 | Meowhack.INSTANCE.getConfigManager().saveModules();
17 | Meowhack.INSTANCE.getConfigManager().saveFriends();
18 | ChatUtil.commandFeedback("Saved the default config", MessageType.SUCCESS);
19 | }
20 |
21 | @Override
22 | public String getUseCase() {
23 | return "";
24 | }
25 |
26 | @Override
27 | public int getArgSize() {
28 | return 0;
29 | }
30 |
31 | @Override
32 | public String getName() {
33 | return "save";
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/command/commands/SpammerFile.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.command.commands;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import me.notkronos.meowhack.command.Command;
5 | import me.notkronos.meowhack.module.misc.Spammer;
6 | import me.notkronos.meowhack.util.chat.ChatUtil;
7 | import me.notkronos.meowhack.util.chat.MessageType;
8 | import me.notkronos.meowhack.util.file.FileSystemUtil;
9 |
10 | import java.io.IOException;
11 | import java.nio.file.Files;
12 | import java.nio.file.Path;
13 | import java.nio.file.Paths;
14 |
15 | public class SpammerFile extends Command {
16 |
17 | public SpammerFile() {
18 | super("spammerfile", "Used to change the spammer file", new String[]{});
19 | }
20 |
21 |
22 | @Override
23 | public void onExecute(String[] args) {
24 | if (args.length != 1) {
25 | ChatUtil.commandFeedback("SpammerFile takes 1 argument. Correct usage is " + Meowhack.PREFIX + "spammerfile " + getUseCase(), MessageType.ERROR);
26 | }
27 | String filename = args[0];
28 |
29 | Path path = Paths.get(FileSystemUtil.getSpammerFile(filename).toString());
30 |
31 | if (!path.toFile().exists()) {
32 | ChatUtil.commandFeedback("File " + filename + ".txt does not exist", MessageType.ERROR);
33 | return;
34 | }
35 |
36 | String[] allLines = new String[0];
37 |
38 | try {
39 | allLines = Files.readAllLines(path).toArray(new String[0]);
40 | Spammer.INSTANCE.spam = allLines;
41 | Spammer.INSTANCE.isFileSet = true;
42 | ChatUtil.commandFeedback("Spammer file set to " + filename + ".txt", MessageType.SUCCESS);
43 | } catch (IOException e) {
44 | throw new RuntimeException(e);
45 | }
46 | }
47 |
48 |
49 | @Override
50 | public String getUseCase() {
51 | return "";
52 | }
53 |
54 | @Override
55 | public int getArgSize() {
56 | return 1;
57 | }
58 |
59 | @Override
60 | public String getName() {
61 | return "SpammerFile";
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/event/events/client/SettingUpdateEvent.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.event.events.client;
2 |
3 | import me.notkronos.meowhack.setting.Setting;
4 | import net.minecraftforge.fml.common.eventhandler.Cancelable;
5 | import net.minecraftforge.fml.common.eventhandler.Event;
6 |
7 | @Cancelable
8 | public abstract class SettingUpdateEvent extends Event {
9 |
10 | private final Setting> setting;
11 |
12 | public SettingUpdateEvent(Setting> setting) {
13 | this.setting = setting;
14 | }
15 |
16 | public Setting> getSetting() {
17 | return setting;
18 | }
19 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/event/events/combat/TotemPopEvent.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.event.events.combat;
2 |
3 | import net.minecraft.entity.Entity;
4 | import net.minecraftforge.fml.common.eventhandler.Cancelable;
5 | import net.minecraftforge.fml.common.eventhandler.Event;
6 |
7 | @Cancelable
8 | public class TotemPopEvent extends Event {
9 |
10 | private final Entity popEntity;
11 |
12 | public TotemPopEvent(Entity popEntity) {
13 | this.popEntity = popEntity;
14 | }
15 |
16 | public Entity getPopEntity() {
17 | return popEntity;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/event/events/entity/DeathEvent.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.event.events.entity;
2 |
3 | import net.minecraft.entity.EntityLivingBase;
4 | import net.minecraftforge.fml.common.eventhandler.Event;
5 |
6 | public class DeathEvent extends Event {
7 | private final EntityLivingBase entity;
8 |
9 | public DeathEvent(EntityLivingBase entity) {
10 | this.entity = entity;
11 | }
12 |
13 | public EntityLivingBase getEntity() {
14 | return entity;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/event/events/entity/EntityWorldEvent.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.event.events.entity;
2 |
3 | import net.minecraft.entity.Entity;
4 | import net.minecraftforge.fml.common.eventhandler.Cancelable;
5 | import net.minecraftforge.fml.common.eventhandler.Event;
6 |
7 | @Cancelable
8 | public class EntityWorldEvent extends Event {
9 |
10 | private final Entity entity;
11 |
12 | public EntityWorldEvent(Entity entity) {
13 | this.entity = entity;
14 | }
15 |
16 | public static class EntitySpawnEvent extends EntityWorldEvent {
17 | public EntitySpawnEvent(Entity entity) {
18 | super(entity);
19 | }
20 | }
21 |
22 | public static class EntityRemoveEvent extends EntityWorldEvent {
23 | public EntityRemoveEvent(Entity entity) {
24 | super(entity);
25 | }
26 | }
27 |
28 | public static class EntityUpdateEvent extends EntityWorldEvent {
29 | public EntityUpdateEvent(Entity entity) {
30 | super(entity);
31 | }
32 | }
33 |
34 | public Entity getEntity() {
35 | return entity;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/event/events/network/PacketEvent.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.event.events.network;
2 |
3 | import net.minecraft.network.Packet;
4 | import net.minecraftforge.fml.common.eventhandler.Cancelable;
5 | import net.minecraftforge.fml.common.eventhandler.Event;
6 |
7 | public class PacketEvent extends Event {
8 |
9 | private final Packet> packet;
10 |
11 | public PacketEvent(Packet> packet) {
12 | this.packet = packet;
13 | }
14 |
15 | public Packet> getPacket() {
16 | return packet;
17 | }
18 |
19 | @Cancelable
20 | public static class PacketReceiveEvent extends PacketEvent {
21 | public PacketReceiveEvent(Packet> packet) {
22 | super(packet);
23 | }
24 | }
25 |
26 | @Cancelable
27 | public static class PacketSendEvent extends PacketEvent {
28 | public PacketSendEvent(Packet> packet) {
29 | super(packet);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/event/events/render/RenderFontEvent.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.event.events.render;
2 |
3 | import net.minecraftforge.fml.common.eventhandler.Cancelable;
4 | import net.minecraftforge.fml.common.eventhandler.Event;
5 |
6 | @Cancelable
7 | public class RenderFontEvent extends Event {
8 |
9 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/event/events/render/RenderLivingEntityEvent.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.event.events.render;
2 |
3 | import net.minecraft.client.model.ModelBase;
4 | import net.minecraft.entity.EntityLivingBase;
5 | import net.minecraftforge.fml.common.eventhandler.Event;
6 |
7 | public class RenderLivingEntityEvent extends Event {
8 | private final ModelBase modelBase;
9 | private final EntityLivingBase entityLivingBase;
10 | private final float limbSwing;
11 | private final float limbSwingAmount;
12 | private final float ageInTicks;
13 | private final float netHeadYaw;
14 | private final float headPitch;
15 | private final float scaleFactor;
16 |
17 | public RenderLivingEntityEvent(ModelBase modelBase, EntityLivingBase entityLivingBase, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor) {
18 | this.modelBase = modelBase;
19 | this.entityLivingBase = entityLivingBase;
20 | this.limbSwing = limbSwing;
21 | this.limbSwingAmount = limbSwingAmount;
22 | this.ageInTicks = ageInTicks;
23 | this.netHeadYaw = netHeadYaw;
24 | this.headPitch = headPitch;
25 | this.scaleFactor = scaleFactor;
26 | }
27 |
28 | public ModelBase getModelBase() {
29 | return modelBase;
30 | }
31 |
32 | public EntityLivingBase getEntityLivingBase() {
33 | return entityLivingBase;
34 | }
35 |
36 | public float getLimbSwing() {
37 | return limbSwing;
38 | }
39 |
40 | public float getLimbSwingAmount() {
41 | return limbSwingAmount;
42 | }
43 |
44 | public float getAgeInTicks() {
45 | return ageInTicks;
46 | }
47 |
48 | public float getNetHeadYaw() {
49 | return netHeadYaw;
50 | }
51 |
52 | public float getHeadPitch() {
53 | return headPitch;
54 | }
55 |
56 | public float getScaleFactor() {
57 | return scaleFactor;
58 | }
59 |
60 | public static class RenderLivingEntityPreEvent extends RenderLivingEntityEvent {
61 |
62 | // pre render
63 | public RenderLivingEntityPreEvent(ModelBase modelBase, EntityLivingBase entityLivingBase, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor) {
64 | super(modelBase, entityLivingBase, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor);
65 | }
66 | }
67 |
68 | public static class RenderLivingEntityPostEvent extends RenderLivingEntityEvent {
69 |
70 | // post render
71 | public RenderLivingEntityPostEvent(ModelBase modelBase, EntityLivingBase entityLivingBase, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor) {
72 | super(modelBase, entityLivingBase, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor);
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/event/events/render/RenderWorldEvent.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.event.events.render;
2 |
3 | import net.minecraftforge.fml.common.eventhandler.Event;
4 |
5 | public class RenderWorldEvent extends Event {
6 |
7 | }
8 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/event/events/render/tileEntity/RenderEnchantmentTableEvent.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.event.events.render.tileEntity;
2 |
3 | import net.minecraftforge.fml.common.eventhandler.Cancelable;
4 | import net.minecraftforge.fml.common.eventhandler.Event;
5 |
6 | @Cancelable
7 | public class RenderEnchantmentTableEvent extends Event {
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/gui/clickgui/ClickGuiScreen.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.gui.clickgui;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import me.notkronos.meowhack.gui.clickgui.items.buttons.ModuleButton;
5 | import me.notkronos.meowhack.module.Category;
6 | import me.notkronos.meowhack.module.client.ClickGUIModule;
7 | import net.minecraft.client.gui.GuiScreen;
8 | import org.lwjgl.input.Keyboard;
9 |
10 | import java.io.IOException;
11 | import java.util.ArrayList;
12 |
13 | public class ClickGuiScreen extends GuiScreen {
14 | private static ClickGuiScreen clickGui;
15 | private final ArrayList frames = new ArrayList<>();
16 |
17 | public ClickGuiScreen() {
18 | if(this.getFrames().isEmpty()) {
19 | this.load();
20 | }
21 | }
22 |
23 | public static ClickGuiScreen getClickGui() {
24 | return clickGui == null ? (clickGui = new ClickGuiScreen()) : clickGui;
25 | }
26 |
27 | private void load() {
28 | int x = -84;
29 | for(Category category : Category.values()) {
30 | this.frames.add(new Frame(category.name(), x += 90, 4, true) {
31 | @Override
32 | public void setupItems() {
33 | Meowhack.INSTANCE.getModuleManager().getAllModules().forEach(module -> {
34 | if(module.getCategory() == category) {
35 | this.addButton(new ModuleButton(module));
36 | }
37 | });
38 | }
39 | });
40 | }
41 |
42 | }
43 |
44 | @Override
45 | public void drawScreen(int mouseX, int mouseY, float partialTicks) {
46 | this.frames.forEach(panel -> panel.drawScreen(mouseX, mouseY, partialTicks));
47 | }
48 |
49 | @Override
50 | public void mouseClicked(int mouseX, int mouseY, int clickedButton) {
51 | this.frames.forEach(panel -> panel.mouseClicked(mouseX, mouseY, clickedButton));
52 | }
53 |
54 | @Override
55 | public void mouseReleased(int mouseX, int mouseY, int releaseButton) {
56 | this.frames.forEach(panel -> panel.mouseReleased(mouseX, mouseY, releaseButton));
57 | }
58 |
59 | @Override
60 | public void keyTyped(char typedChar, int keyCode) throws IOException {
61 | super.keyTyped(typedChar, keyCode);
62 | this.frames.forEach(panel -> panel.getItems().forEach(item -> item.onType(keyCode)));
63 | }
64 |
65 | @Override
66 | public boolean doesGuiPauseGame() {
67 | return false;
68 | }
69 |
70 | public ArrayList getFrames() {
71 | return this.frames;
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/gui/clickgui/items/Button.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.gui.clickgui.items;
2 |
3 | import me.notkronos.meowhack.gui.clickgui.ClickGuiScreen;
4 | import me.notkronos.meowhack.gui.clickgui.Frame;
5 | import me.notkronos.meowhack.util.render.FontUtil;
6 | import me.notkronos.meowhack.util.render.RenderUtil;
7 |
8 | public class Button extends Item {
9 | private boolean state;
10 |
11 | public Button(String name) {
12 | super(name);
13 | this.height = 15;
14 | }
15 |
16 | @Override
17 | public void drawScreen(int mouseX, int mouseY, float partialTicks) {
18 | RenderUtil.drawRect(this.x, this.y, this.x + (float)this.width, this.y + (float)this.height - 0.5f, this.getState() ? color : -15658735);
19 | FontUtil.drawStringWithShadow(this.getName(), this.x + 2.0f, this.y + 4.0f, this.getState() ? -1 : -5592406);
20 | }
21 |
22 | @Override
23 | public void mouseClicked(int mouseX, int mouseY, int mouseButton) {
24 | if (mouseButton == 0 && this.isHovering(mouseX, mouseY)) {
25 | this.state = !this.state;
26 | this.toggle();
27 | }
28 | }
29 |
30 | public void toggle() {
31 | }
32 |
33 | public boolean getState() {
34 | return this.state;
35 | }
36 |
37 | @Override
38 | public int getHeight() {
39 | return 14;
40 | }
41 |
42 | protected boolean isHovering(int mouseX, int mouseY) {
43 | for (Frame frame : ClickGuiScreen.getClickGui().getFrames()) {
44 | if (!frame.dragging) continue;
45 | return false;
46 | }
47 | return (float)mouseX >= this.getX() && (float)mouseX <= this.getX() + (float)this.getWidth() && (float)mouseY >= this.getY() && (float)mouseY <= this.getY() + (float)this.height;
48 | }
49 |
50 | @Override
51 | public void onType(int in) {
52 |
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/gui/clickgui/items/Item.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.gui.clickgui.items;
2 |
3 | import me.notkronos.meowhack.util.ColorUtil;
4 |
5 | public class Item {
6 | private final String name;
7 | protected float x;
8 | protected float y;
9 | protected int width;
10 | protected int height;
11 | private static int clientColor = ColorUtil.decimalToHex(ColorUtil.getPrimaryColor()[0], ColorUtil.getPrimaryColor()[1], ColorUtil.getPrimaryColor()[2]);
12 | public static int color = ColorUtil.addAlpha(clientColor, 255);
13 |
14 | public Item(final String name) {
15 | this.name = name;
16 | }
17 |
18 | public void setLocation(float x, float y) {
19 | this.x = x;
20 | this.y = y;
21 | }
22 |
23 | public void drawScreen(int mouseX, int mouseY, float partialTicks) {
24 | }
25 |
26 | public void mouseClicked(int mouseX, int mouseY, int mouseButton) {
27 | }
28 |
29 | public void mouseReleased(int mouseX, int mouseY, int releaseButton) {
30 | }
31 |
32 | public final String getName() {
33 | return this.name;
34 | }
35 |
36 | public float getX() {
37 | return this.x;
38 | }
39 |
40 | public float getY() {
41 | return this.y;
42 | }
43 |
44 | public int getWidth() {
45 | return this.width;
46 | }
47 |
48 | public int getHeight() {
49 | return this.height;
50 | }
51 |
52 | public void setWidth(int width) {
53 | this.width = width;
54 | }
55 |
56 | public void setHeight(int height) {
57 | this.height = height;
58 | }
59 |
60 | public void onType(int in) { }
61 | }
62 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/gui/clickgui/items/buttons/BindButton.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.gui.clickgui.items.buttons;
2 |
3 | import me.notkronos.meowhack.gui.clickgui.items.Button;
4 | import me.notkronos.meowhack.setting.Setting;
5 | import me.notkronos.meowhack.util.Bind;
6 | import me.notkronos.meowhack.util.render.FontUtil;
7 | import me.notkronos.meowhack.util.render.RenderUtil;
8 | import org.lwjgl.input.Keyboard;
9 |
10 | public class BindButton extends Button {
11 | private Setting bindSetting;
12 | private boolean isListening;
13 |
14 | public BindButton(Setting bind) {
15 | super(bind.name);
16 | this.bindSetting = bind;
17 | this.width = 15;
18 | }
19 |
20 | @Override
21 | public void drawScreen(int mouseX, int mouseY, float partialTicks) {
22 | RenderUtil.drawRect(this.x, this.y, this.x + (float)this.width + 7.4f, this.y + (float)this.height, this.getState() ? -14540254 : -15658735);
23 | FontUtil.drawStringWithShadow(isListening ? "Listening..." : this.bindSetting.getValue().getButtonName(), this.x + 2.3f, this.y + 2.7f - (float) FontUtil.getFontHeight() / 2 + (float) this.height / 2.0f, -1);
24 | }
25 |
26 | @Override
27 | public void mouseClicked(int mouseX, int mouseY, int mouseButton) {
28 | if (mouseButton == 0 && this.isHovering(mouseX, mouseY)) {
29 | isListening = !isListening;
30 | }
31 | }
32 |
33 | @Override
34 | public void onType(int in) {
35 | if(!isListening) return;
36 | if(in != -1 && in != Keyboard.KEY_ESCAPE) {
37 | if(in == Keyboard.KEY_DELETE) {
38 | this.bindSetting.setValue(new Bind(Keyboard.KEY_NONE, Bind.Device.KEYBOARD));
39 | } else {
40 | this.bindSetting.setValue(new Bind(in, Bind.Device.KEYBOARD));
41 | }
42 | }
43 | isListening = false;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/gui/clickgui/items/buttons/BooleanButton.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.gui.clickgui.items.buttons;
2 |
3 | import me.notkronos.meowhack.font.CustomFontRenderer;
4 | import me.notkronos.meowhack.gui.clickgui.items.Button;
5 | import me.notkronos.meowhack.module.client.CustomFontMod;
6 | import me.notkronos.meowhack.setting.Setting;
7 | import me.notkronos.meowhack.util.render.FontUtil;
8 | import me.notkronos.meowhack.util.render.RenderUtil;
9 |
10 | import java.awt.*;
11 |
12 | public class BooleanButton extends Button {
13 | private Setting setting;
14 |
15 | public BooleanButton(Setting setting) {
16 | super(setting.name);
17 | this.setting = setting;
18 | this.width = 15;
19 | }
20 |
21 | //:troll:
22 | @Override
23 | public void drawScreen(int mouseX, int mouseY, float partialTicks) {
24 | RenderUtil.drawRect(this.x, this.y, this.x + (float)this.width + 7.4f, this.y + (float)this.height, this.getState() ? color : -15658735);
25 | FontUtil.drawStringWithShadow(this.getName(), this.x + 2.0f, this.y + 4.0f, this.getState() ? -1 : -5592406);
26 | }
27 |
28 | @Override
29 | public void mouseClicked(int mouseX, int mouseY, int mouseButton) {
30 | super.mouseClicked(mouseX, mouseY, mouseButton);
31 | if (this.isHovering(mouseX, mouseY)) {
32 | // Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.createPositionedSoundRecord(new ResourceLocation("random.click"), 1.0f));
33 | }
34 | }
35 |
36 | @Override
37 | public int getHeight() {
38 | return 14;
39 | }
40 |
41 | @Override
42 | public void toggle() {
43 | this.setting.setValue(!(Boolean)this.setting.getValue());
44 | if(setting.getModule() == CustomFontMod.INSTANCE && CustomFontMod.INSTANCE.isEnabled()) {
45 | FontUtil.customFont = new CustomFontRenderer(
46 | new Font(me.notkronos.meowhack.command.commands.Font.fontName,
47 | CustomFontMod.fontStyle.value,
48 | CustomFontMod.fontSize.value
49 | ),
50 | CustomFontMod.antiAlias.value,
51 | CustomFontMod.metrics.value
52 | );
53 | }
54 | }
55 |
56 | @Override
57 | public boolean getState() {
58 | return (Boolean)this.setting.getValue();
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/gui/clickgui/items/buttons/EnumButton.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.gui.clickgui.items.buttons;
2 |
3 | import me.notkronos.meowhack.gui.clickgui.items.Button;
4 | import me.notkronos.meowhack.setting.Setting;
5 | import me.notkronos.meowhack.util.render.FontUtil;
6 | import me.notkronos.meowhack.util.render.RenderUtil;
7 |
8 | public class EnumButton extends Button {
9 | private Setting> setting;
10 |
11 | public EnumButton(Setting> setting) {
12 | super(setting.getName());
13 | this.setting = setting;
14 | this.width = 15;
15 | }
16 |
17 | @Override
18 | public void drawScreen(int mouseX, int mouseY, float partialTicks) {
19 | RenderUtil.drawRect(this.x, this.y, this.x + (float)this.width + 7.4f, this.y + (float)this.height, this.getState() ? -14540254 : -15658735);
20 | FontUtil.drawStringWithShadow(this.setting.getName() + ": " + this.setting.value.name(), this.x + 2.0f, this.y + 4.0f, this.getState() ? -1 : -5592406);
21 | }
22 |
23 |
24 | @Override
25 | public void mouseClicked(int mouseX, int mouseY, int mouseButton) {
26 | super.mouseClicked(mouseX, mouseY, mouseButton);
27 | if (this.isHovering(mouseX, mouseY)) {
28 | if (mouseButton == 0) {
29 | this.setting.setValue(this.setting.getNextMode());
30 | } else if (mouseButton == 1) {
31 | this.setting.setValue(this.setting.getLastMode());
32 | }
33 | }
34 | }
35 |
36 | @Override
37 | public int getHeight() {
38 | return 14;
39 | }
40 |
41 | @Override
42 | public void toggle() {
43 | }
44 |
45 | @Override
46 | public boolean getState() {
47 | return true;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/gui/clickgui/items/buttons/FloatSlider.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.gui.clickgui.items.buttons;
2 |
3 | import me.notkronos.meowhack.gui.clickgui.ClickGuiScreen;
4 | import me.notkronos.meowhack.gui.clickgui.Frame;
5 | import me.notkronos.meowhack.gui.clickgui.items.Item;
6 | import me.notkronos.meowhack.setting.Setting;
7 | import me.notkronos.meowhack.util.MathUtil;
8 | import me.notkronos.meowhack.util.render.FontUtil;
9 | import me.notkronos.meowhack.util.render.RenderUtil;
10 | import net.minecraft.util.math.MathHelper;
11 | import org.lwjgl.input.Mouse;
12 |
13 | public class FloatSlider extends Item {
14 | private Setting setting;
15 | private Float min;
16 | private Float max;
17 | private float difference;
18 |
19 | public FloatSlider(Setting setting) {
20 | super(setting.getName());
21 | this.setting = setting;
22 | this.min = setting.getFmin();
23 | this.max = setting.getFmax();
24 | this.difference = max - min;
25 | }
26 |
27 | @Override
28 | public void drawScreen(int mouseX, int mouseY, float partialTicks) {
29 | dragSetting(mouseX, mouseY);
30 | RenderUtil.drawRect(x, y, setting.getValue() <= min.floatValue() ? x : x + (width + 7.4F) * partialMultiplier(), y + height - 0.5f, color);
31 | FontUtil.drawStringWithShadow(String.format("%s\u00a77 %s", this.getName(), this.setting.getValue()), this.x + 2.0f, this.y + 4.0f, -1);
32 | }
33 |
34 | @Override
35 | public void mouseClicked(int mouseX, int mouseY, int mouseButton) {
36 | super.mouseClicked(mouseX, mouseY, mouseButton);
37 | if (isHovering(mouseX, mouseY) && mouseButton == 0) {
38 | setSettingFromX(mouseX);
39 | }
40 | }
41 |
42 | private void setSettingFromX(int mouseX) {
43 | float percent = (mouseX - x) / (width + 7.4F);
44 | float result = setting.getFmin() + (difference * percent);
45 | float round = Math.round(10.0f * result) / 10.0f;
46 | setting.setValue(MathHelper.clamp(round, setting.getFmin(), setting.getFmax()));
47 | }
48 |
49 | @Override
50 | public int getHeight() {
51 | return 14;
52 | }
53 |
54 | private void dragSetting(int mouseX, int mouseY) {
55 | if(isHovering(mouseX, mouseY) && Mouse.isButtonDown(0)) {
56 | setSettingFromX(mouseX);
57 | }
58 | }
59 |
60 | private boolean isHovering(int mouseX, int mouseY) {
61 | for (Frame frame : ClickGuiScreen.getClickGui().getFrames()) {
62 | if (!frame.dragging) continue;
63 | return false;
64 | }
65 | return (float)mouseX >= this.getX() && (float)mouseX <= this.getX() + (float)this.getWidth() + 10f && (float)mouseY >= this.getY() && (float)mouseY <= this.getY() + (float)this.height;
66 | }
67 |
68 | private float getValueWidth() {
69 | return this.setting.getFmax() - this.setting.getFmin() + this.setting.getValue();
70 | }
71 |
72 | private float middle() {
73 | return max.floatValue() - min;
74 | }
75 |
76 | private float part() {
77 | return setting.getValue() - min;
78 | }
79 |
80 | private float partialMultiplier() {
81 | return part() / middle();
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/manager/Manager.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.manager;
2 |
3 | public class Manager {
4 | private final String name;
5 |
6 | public Manager(String name) {
7 | this.name = name;
8 | }
9 |
10 | /**
11 | * Runs every update ticks (i.e. 20 times a second)
12 | */
13 | public void onUpdate() {
14 |
15 | }
16 |
17 | /**
18 | * Runs every tick (i.e. 40 times a second)
19 | */
20 | public void onTick() {
21 |
22 | }
23 |
24 | /**
25 | * Runs on the separate module thread (i.e. every cpu tick)
26 | */
27 | public void onThread() {
28 |
29 | }
30 |
31 | /**
32 | * Runs on the game overlay tick (i.e. once every frame)
33 | */
34 | public void onRender2D() {
35 |
36 | }
37 |
38 | /**
39 | * Runs on the global render tick (i.e. once every frame)
40 | */
41 | public void onRender3D() {
42 |
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/manager/managers/CommandManager.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.manager.managers;
2 |
3 |
4 | import com.mojang.realmsclient.gui.ChatFormatting;
5 | import me.notkronos.meowhack.Meowhack;
6 | import me.notkronos.meowhack.command.Command;
7 | import me.notkronos.meowhack.command.commands.*;
8 | import me.notkronos.meowhack.manager.Manager;
9 | import me.notkronos.meowhack.util.chat.ChatUtil;
10 | import net.minecraftforge.client.event.ClientChatEvent;
11 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
12 |
13 | import java.io.IOException;
14 | import java.util.ArrayList;
15 | import java.util.Arrays;
16 | import java.util.List;
17 | import java.util.function.Predicate;
18 |
19 | import static me.notkronos.meowhack.util.Wrapper.mc;
20 |
21 | public class CommandManager extends Manager {
22 | private final List commands = new ArrayList<>();
23 |
24 | public CommandManager() {
25 | super("CommandManager");
26 | commands.add(new BindCommand());
27 | commands.add(new Drawn());
28 | commands.add(new Friend());
29 | commands.add(new Font());
30 | commands.add(new Load());
31 | commands.add(new Save());
32 | commands.add(new SpammerFile());
33 | Meowhack.EVENT_BUS.register(this);
34 | }
35 |
36 | @SubscribeEvent
37 | public void onChatInput(ClientChatEvent event) throws IOException {
38 | String chatMessage = event.getMessage().trim();
39 |
40 | if(!chatMessage.startsWith(Meowhack.PREFIX)) {
41 | return;
42 | }
43 |
44 | event.setCanceled(true);
45 | mc.ingameGUI.getChatGUI().addToSentMessages(event.getMessage());
46 |
47 | chatMessage = chatMessage.substring(Meowhack.PREFIX.length());
48 |
49 | String[] arguments = chatMessage.split(" ");
50 | String command = arguments[0];
51 | arguments = Arrays.copyOfRange(arguments, 1, arguments.length);
52 |
53 | Command executableCommand = Meowhack.INSTANCE.getCommandManager().getCommand(command1 -> command1.getName().equalsIgnoreCase(command));
54 |
55 | if(executableCommand != null) {
56 | executableCommand.onExecute(arguments);
57 | } else {
58 | ChatUtil.sendMessageClientSide(ChatFormatting.RED + "[Meowhack] Unrecognized command!");
59 | }
60 |
61 | }
62 |
63 | public Command getCommand(Predicate super Command> predicate) {
64 | return commands.stream()
65 | .filter(predicate)
66 | .findFirst()
67 | .orElse(null);
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/manager/managers/FriendManager.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.manager.managers;
2 |
3 | import me.notkronos.meowhack.manager.Manager;
4 |
5 | import java.util.ArrayList;
6 | import java.util.List;
7 |
8 | public class FriendManager extends Manager {
9 |
10 | private final List friends = new ArrayList<>();
11 |
12 | public FriendManager() {
13 | super("FriendManager");
14 | }
15 |
16 | public void addFriend(String name) {
17 | friends.add(name);
18 | }
19 |
20 | public void removeFriend(String name) {
21 | friends.remove(name);
22 | }
23 |
24 | public boolean isFriend(String name) {
25 | return friends.contains(name);
26 | }
27 |
28 | public List getFriends() {
29 | return friends;
30 | }
31 |
32 | public void setFriends(List friends) {
33 | this.friends.addAll(friends);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/manager/managers/ModuleManager.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.manager.managers;
2 |
3 | import me.notkronos.meowhack.manager.Manager;
4 | import me.notkronos.meowhack.module.Module;
5 | import me.notkronos.meowhack.module.client.ClickGUIModule;
6 | import me.notkronos.meowhack.module.client.Colors;
7 | import me.notkronos.meowhack.module.client.CustomFontMod;
8 | import me.notkronos.meowhack.module.client.HUD;
9 | import me.notkronos.meowhack.module.combat.*;
10 | import me.notkronos.meowhack.module.misc.*;
11 | import me.notkronos.meowhack.module.movement.Sprint;
12 | import me.notkronos.meowhack.module.render.*;
13 |
14 | import java.util.Arrays;
15 | import java.util.List;
16 | import java.util.function.Predicate;
17 |
18 | public class ModuleManager extends Manager {
19 |
20 | private final List modules;
21 |
22 | public ModuleManager() {
23 | super("ModuleManager");
24 | modules = Arrays.asList(
25 | new Announcer(),
26 | new AntiPoplag(),
27 | new Ambience(),
28 | new AutoMeow(),
29 | new AutoHeadBurrow(),
30 | new ChatSuffix(),
31 | new ChatTimestamp(),
32 | new ChestplateSwap(),
33 | new ClickGUIModule(),
34 | new Colors(),
35 | new CornerClip(),
36 | new CrystalChamsRewrite(),
37 | new CustomFontMod(),
38 | new DeathEffects(),
39 | new FullBright(),
40 | new HoleESP(),
41 | new HUD(),
42 | new NBTViewer(),
43 | new NoBob(),
44 | new NoEnchantingTableLag(),
45 | new NoRender(),
46 | new PlayerChams(),
47 | new PlayerModel(),
48 | new PopLag(),
49 | new PopParticles(),
50 | new RPC(),
51 | new Spammer(),
52 | new Sprint(),
53 | new StaticFOV(),
54 | new StrengthDetect(),
55 | new SwingSpeed(),
56 | new TotemPopCounter(),
57 | new VisualRange(),
58 | new Weather()
59 | );
60 | }
61 |
62 | @Override
63 | public void onThread() {
64 | for (Module module : modules) {
65 | if (module.getBind().getValue().isPressed()) {
66 | module.toggle();
67 | if (module.isEnabled()) {
68 | module.onEnable();
69 | } else {
70 | module.onDisable();
71 | }
72 | }
73 | }
74 | }
75 |
76 | public List getAllModules() {
77 | return modules;
78 | }
79 |
80 | public Module getModule(Predicate super Module> predicate) {
81 | return modules.stream()
82 | .filter(predicate)
83 | .findFirst()
84 | .orElse(null);
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/manager/managers/TickManager.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.manager.managers;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import me.notkronos.meowhack.event.events.network.PacketEvent;
5 | import me.notkronos.meowhack.manager.Manager;
6 | import me.notkronos.meowhack.mixin.mixins.accessor.IMInecraftAccessor;
7 | import me.notkronos.meowhack.mixin.mixins.accessor.ITimerAccessor;
8 | import me.notkronos.meowhack.util.MathUtil;
9 | import net.minecraft.network.play.server.SPacketTimeUpdate;
10 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
11 |
12 | import static me.notkronos.meowhack.util.Wrapper.mc;
13 |
14 | public class TickManager extends Manager {
15 | private final float[] latestTicks = new float[10];
16 | private long time = -1;
17 | private int tick;
18 |
19 | public TickManager() {
20 | super("TickManager");
21 | Meowhack.EVENT_BUS.register(this);
22 | }
23 |
24 | @SubscribeEvent
25 | public void onPacketReceive(PacketEvent.PacketReceiveEvent event) {
26 |
27 | // packet for server time updates
28 | if (event.getPacket() instanceof SPacketTimeUpdate) {
29 |
30 | // update our ticks
31 | if (time != -1) {
32 | latestTicks[tick % latestTicks.length] = (20 / ((float) (System.currentTimeMillis() - time) / 1000));
33 | tick++;
34 | }
35 |
36 | // mark as last response
37 | time = System.currentTimeMillis();
38 | }
39 |
40 | }
41 |
42 | public float getTPS(TPS tps) {
43 |
44 | // do not calculate ticks if we are not on a server
45 | if (mc.isSingleplayer() || tps.equals(TPS.NONE)) {
46 | return 20;
47 | }
48 |
49 | else {
50 | switch (tps) {
51 | case CURRENT:
52 | // use the last ticks calculation
53 | return MathUtil.roundFloat(latestTicks[0], 2);
54 | case AVERAGE:
55 | default:
56 | int tickCount = 0;
57 | float tickRate = 0;
58 |
59 | // calculate the average ticks
60 | for (float tick : latestTicks) {
61 | if (tick > 0) {
62 | tickRate += tick;
63 | tickCount++;
64 | }
65 | }
66 |
67 | return MathUtil.roundFloat((tickRate / tickCount), 2);
68 | }
69 | }
70 | }
71 | public void setClientTicks(float ticks) {
72 | ((ITimerAccessor) ((IMInecraftAccessor) mc).getTimer()).setTickLength((50 / ticks));
73 | }
74 |
75 | public float getTickLength() {
76 | return ((ITimerAccessor) ((IMInecraftAccessor) mc).getTimer()).getTickLength();
77 | }
78 |
79 | public enum TPS {
80 | CURRENT,
81 |
82 | AVERAGE,
83 | NONE
84 | }
85 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/mixin/mixins/MixinMinecraft.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.mixin.mixins;
2 |
3 | import me.notkronos.meowhack.module.render.SwingSpeed;
4 | import net.minecraft.client.Minecraft;
5 | import org.spongepowered.asm.mixin.Mixin;
6 | import org.spongepowered.asm.mixin.injection.At;
7 | import org.spongepowered.asm.mixin.injection.Inject;
8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
9 |
10 | @Mixin(Minecraft.class)
11 | public class MixinMinecraft {
12 | @Inject(method = "rightClickMouse", at = @At("HEAD"))
13 | public void onRCM(CallbackInfo ci) {
14 | SwingSpeed.INSTANCE.isCausedByRClick = true;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/mixin/mixins/accessor/ICPacketChatMessageAccessor.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.mixin.mixins.accessor;
2 |
3 | import net.minecraft.network.play.client.CPacketChatMessage;
4 | import org.spongepowered.asm.mixin.Mixin;
5 | import org.spongepowered.asm.mixin.gen.Accessor;
6 |
7 | @Mixin(CPacketChatMessage.class)
8 | public interface ICPacketChatMessageAccessor {
9 |
10 | @Accessor("message")
11 | void setMessage(String message);
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/mixin/mixins/accessor/IMInecraftAccessor.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.mixin.mixins.accessor;
2 |
3 | import net.minecraft.client.Minecraft;
4 | import net.minecraft.util.Timer;
5 | import org.spongepowered.asm.mixin.Mixin;
6 | import org.spongepowered.asm.mixin.gen.Accessor;
7 |
8 | @Mixin(Minecraft.class)
9 | public interface IMInecraftAccessor {
10 | @Accessor("timer")
11 | Timer getTimer();
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/mixin/mixins/accessor/ITextComponentStringAccessor.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.mixin.mixins.accessor;
2 |
3 | import net.minecraft.util.text.TextComponentString;
4 | import org.spongepowered.asm.mixin.Mixin;
5 | import org.spongepowered.asm.mixin.gen.Accessor;
6 |
7 | @Mixin(TextComponentString.class)
8 | public interface ITextComponentStringAccessor {
9 |
10 | @Accessor("text")
11 | void setText(String text);
12 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/mixin/mixins/accessor/ITimerAccessor.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.mixin.mixins.accessor;
2 |
3 | import net.minecraft.util.Timer;
4 | import org.spongepowered.asm.mixin.Mixin;
5 | import org.spongepowered.asm.mixin.gen.Accessor;
6 |
7 | @Mixin(Timer.class)
8 | public interface ITimerAccessor {
9 |
10 | @Accessor("tickLength")
11 | float getTickLength();
12 |
13 | @Accessor("tickLength")
14 | void setTickLength(float tick);
15 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/mixin/mixins/entity/player/MixinAbstractClientPlayer.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.mixin.mixins.entity.player;
2 |
3 | import me.notkronos.meowhack.module.render.StaticFOV;
4 | import net.minecraft.client.entity.AbstractClientPlayer;
5 | import org.spongepowered.asm.mixin.Mixin;
6 | import org.spongepowered.asm.mixin.injection.At;
7 | import org.spongepowered.asm.mixin.injection.Inject;
8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
9 |
10 | @Mixin(AbstractClientPlayer.class)
11 | public abstract class MixinAbstractClientPlayer {
12 | @Inject(method = "getFovModifier", at = @At("HEAD"), cancellable = true)
13 | public void onGetFovModifier(CallbackInfoReturnable cir) {
14 | if(StaticFOV.INSTANCE.isEnabled()) {
15 | cir.setReturnValue(StaticFOV.fovModifier.getValue());
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/mixin/mixins/gui/MixinGuiBossOverlay.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.mixin.mixins.gui;
2 |
3 | import me.notkronos.meowhack.module.render.NoRender;
4 | import net.minecraft.client.gui.GuiBossOverlay;
5 | import org.spongepowered.asm.mixin.Mixin;
6 | import org.spongepowered.asm.mixin.injection.At;
7 | import org.spongepowered.asm.mixin.injection.Inject;
8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
9 |
10 | @Mixin(GuiBossOverlay.class)
11 | public abstract class MixinGuiBossOverlay {
12 | @Inject(method = "renderBossHealth", at = @At("HEAD"), cancellable = true)
13 | public void renderBossHealth(CallbackInfo info) {
14 | if (NoRender.INSTANCE.isEnabled() && NoRender.noBossOverlay.getValue()) {
15 | info.cancel();
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/mixin/mixins/network/MixinNetworkManager.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.mixin.mixins.network;
2 |
3 | import io.netty.channel.ChannelHandlerContext;
4 | import me.notkronos.meowhack.Meowhack;
5 | import me.notkronos.meowhack.event.events.network.PacketEvent;
6 | import net.minecraft.network.NetworkManager;
7 | import net.minecraft.network.Packet;
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 | @Mixin(value = NetworkManager.class)
14 | public class MixinNetworkManager {
15 | @Inject(method = "channelRead0", at = @At("HEAD"), cancellable = true)
16 | public void onPacketReceive(ChannelHandlerContext channelHandlerContext, Packet> packet, CallbackInfo callbackInfo) {
17 | PacketEvent.PacketReceiveEvent packetReceiveEvent = new PacketEvent.PacketReceiveEvent(packet);
18 | Meowhack.EVENT_BUS.post(packetReceiveEvent);
19 | if(packetReceiveEvent.isCanceled()) {
20 | callbackInfo.cancel();
21 | }
22 | }
23 | @Inject(method = "sendPacket(Lnet/minecraft/network/Packet;)V", at = @At("HEAD"), cancellable = true)
24 | public void onSendPacket(Packet> packetIn, CallbackInfo info) {
25 | PacketEvent.PacketSendEvent packetSendEvent = new PacketEvent.PacketSendEvent(packetIn);
26 | Meowhack.EVENT_BUS.post(packetSendEvent);
27 |
28 | if (packetSendEvent.isCanceled()) {
29 | info.cancel();
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/mixin/mixins/render/MixinLayerArmorBase.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.mixin.mixins.render;
2 |
3 | import me.notkronos.meowhack.module.render.NoRender;
4 | import net.minecraft.client.renderer.entity.layers.LayerArmorBase;
5 | import net.minecraft.entity.EntityLivingBase;
6 | import net.minecraft.inventory.EntityEquipmentSlot;
7 | import org.spongepowered.asm.mixin.Mixin;
8 | import org.spongepowered.asm.mixin.injection.At;
9 | import org.spongepowered.asm.mixin.injection.Inject;
10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
11 |
12 | @Mixin(LayerArmorBase.class)
13 | public abstract class MixinLayerArmorBase {
14 | @Inject(method = "renderArmorLayer", at = @At("HEAD"), cancellable = true)
15 | public void renderArmorLayer(EntityLivingBase entityLivingBaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale, EntityEquipmentSlot slotIn, CallbackInfo info) {
16 | if (NoRender.INSTANCE.isEnabled()) {
17 | if(slotIn == EntityEquipmentSlot.HEAD && NoRender.helmet.getValue()
18 | || slotIn == EntityEquipmentSlot.CHEST && NoRender.chestplate.getValue()
19 | || slotIn == EntityEquipmentSlot.LEGS && NoRender.leggings.getValue()
20 | || slotIn == EntityEquipmentSlot.FEET && NoRender.boots.getValue()) {
21 | info.cancel();
22 | }
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/mixin/mixins/render/MixinParticleTotem.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.mixin.mixins.render;
2 |
3 | import me.notkronos.meowhack.module.render.PopParticles;
4 | import net.minecraft.client.particle.ParticleSimpleAnimated;
5 | import net.minecraft.client.particle.ParticleTotem;
6 | import net.minecraft.world.World;
7 | import net.minecraftforge.fml.relauncher.Side;
8 | import net.minecraftforge.fml.relauncher.SideOnly;
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 | import static me.notkronos.meowhack.module.render.PopParticles.ParticleType.TRANS;
15 |
16 | @SideOnly(Side.CLIENT)
17 | @Mixin(ParticleTotem.class)
18 | public abstract class MixinParticleTotem extends ParticleSimpleAnimated {
19 |
20 | public MixinParticleTotem(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn) {
21 | super(worldIn, xCoordIn, yCoordIn, zCoordIn, 176, 8, -0.05f);
22 | this.motionX = xSpeedIn;
23 | this.motionY = ySpeedIn;
24 | this.motionZ = zSpeedIn;
25 | }
26 |
27 | @Inject(method = "", at = @At("RETURN"))
28 | public void onParticleTotem(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, CallbackInfo info) {
29 | if(PopParticles.INSTANCE.isEnabled()) {
30 | if(PopParticles.mode.value.equals(TRANS)) {
31 | int rand = (int) (1 + Math.random() * 3);
32 | switch (rand) {
33 | case 1:
34 | this.setRBGColorF(91 / 255f, 206 / 255f, 250 / 255f);
35 | break;
36 | case 2:
37 | this.setRBGColorF(255 / 255f, 255 / 255f, 255 / 255f);
38 | break;
39 | case 3:
40 | this.setRBGColorF(245 / 255f, 169 / 255f, 184 / 255f);
41 | break;
42 | default:
43 | break;
44 | }
45 | } else {
46 | this.setRBGColorF(PopParticles.red.value / 255f, PopParticles.green.value / 255f, PopParticles.blue.value / 255f);
47 | }
48 | this.setBaseAirFriction(0.6F);
49 | this.motionX *= PopParticles.duration.value;
50 | this.motionY *= PopParticles.duration.value;
51 | this.motionZ *= PopParticles.duration.value;
52 | } else {
53 | this.particleScale *= 0.75F;
54 | this.particleMaxAge = 60 + this.rand.nextInt(12);
55 |
56 | if (this.rand.nextInt(4) == 0)
57 | {
58 | this.setRBGColorF(0.6F + this.rand.nextFloat() * 0.2F, 0.6F + this.rand.nextFloat() * 0.3F, this.rand.nextFloat() * 0.2F);
59 | }
60 | else
61 | {
62 | this.setRBGColorF(0.1F + this.rand.nextFloat() * 0.2F, 0.4F + this.rand.nextFloat() * 0.3F, this.rand.nextFloat() * 0.2F);
63 | }
64 |
65 | this.setBaseAirFriction(0.6F);
66 | }
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/mixin/mixins/render/entity/IEntityRenderer.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.mixin.mixins.render.entity;
2 |
3 | import net.minecraft.client.renderer.EntityRenderer;
4 | import org.spongepowered.asm.mixin.Mixin;
5 | import org.spongepowered.asm.mixin.gen.Accessor;
6 | import org.spongepowered.asm.mixin.gen.Invoker;
7 |
8 | @Mixin(EntityRenderer.class)
9 | public interface IEntityRenderer {
10 |
11 | @Accessor("rendererUpdateCount")
12 | int getRendererUpdateCount();
13 |
14 | @Accessor("rainXCoords")
15 | float[] getRainXCoords();
16 |
17 | @Accessor("rainYCoords")
18 | float[] getRainYCoords();
19 |
20 | @Invoker("setupCameraTransform")
21 | void invokeSetupCameraTransform(float partialTicks, int pass);
22 |
23 | @Invoker("renderHand")
24 | void invokeRenderHand(float partialTicks, int pass);
25 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/mixin/mixins/render/entity/MixinEntityRenderer.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.mixin.mixins.render.entity;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import me.notkronos.meowhack.event.events.render.RenderWorldEvent;
5 | import me.notkronos.meowhack.module.render.Weather;
6 | import net.minecraft.client.renderer.EntityRenderer;
7 | import org.spongepowered.asm.mixin.Mixin;
8 | import org.spongepowered.asm.mixin.injection.At;
9 | import org.spongepowered.asm.mixin.injection.Inject;
10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
11 |
12 | import static me.notkronos.meowhack.util.Wrapper.mc;
13 |
14 | @Mixin(EntityRenderer.class)
15 | public abstract class MixinEntityRenderer {
16 | @Inject(method = "renderWorld", at = @At("RETURN"))
17 | private void renderWorldHook(CallbackInfo info)
18 | {
19 | final int guiScale = mc.gameSettings.guiScale;
20 | mc.gameSettings.guiScale = 1;
21 | Meowhack.EVENT_BUS.post(new RenderWorldEvent());
22 | mc.gameSettings.guiScale = guiScale;
23 | }
24 | @Inject(method = "renderWorldPass", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/EntityRenderer;renderRainSnow(F)V"))
25 | public void weatherHook(int pass, float partialTicks, long finishTimeNano, CallbackInfo ci) {
26 | try {
27 | if (Weather.INSTANCE.isEnabled()) {
28 | Weather.render(partialTicks);
29 | }
30 | } catch (Exception e) {
31 | e.printStackTrace();
32 | }
33 | }
34 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/mixin/mixins/render/entity/MixinRenderEnderCrystal.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.mixin.mixins.render.entity;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import me.notkronos.meowhack.event.events.render.RenderCrystalEvent;
5 | import net.minecraft.client.model.ModelBase;
6 | import net.minecraft.client.renderer.entity.RenderEnderCrystal;
7 | import net.minecraft.entity.Entity;
8 | import net.minecraft.entity.item.EntityEnderCrystal;
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.Redirect;
15 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
16 |
17 | @Mixin(value = RenderEnderCrystal.class, priority = Integer.MAX_VALUE - 1)
18 | public class MixinRenderEnderCrystal {
19 | @Redirect(method = "doRender(Lnet/minecraft/entity/item/EntityEnderCrystal;DDDFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelBase;render(Lnet/minecraft/entity/Entity;FFFFFF)V"))
20 | private void onDoRenderPre(ModelBase instance, Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
21 | RenderCrystalEvent.RenderCrystalPreEvent renderCrystalEvent = new RenderCrystalEvent.RenderCrystalPreEvent(instance, entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
22 | Meowhack.EVENT_BUS.post(renderCrystalEvent);
23 | if (!renderCrystalEvent.isCanceled()) {
24 | instance.render(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
25 | }
26 | }
27 | @Inject(method = "doRender(Lnet/minecraft/entity/item/EntityEnderCrystal;DDDFF)V", at = @At("TAIL"), cancellable = true)
28 | public void onDoRender(EntityEnderCrystal entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) {
29 | RenderCrystalEvent.RenderCrystalPostEvent renderCrystalEvent = new RenderCrystalEvent.RenderCrystalPostEvent(modelEnderCrystal, modelEnderCrystalNoBase, entity, x, y, z, 0, partialTicks);
30 | Meowhack.EVENT_BUS.post(renderCrystalEvent);
31 | if(renderCrystalEvent.isCanceled()) {
32 | ci.cancel();
33 | }
34 | }
35 |
36 | @Final
37 | @Shadow
38 | private ModelBase modelEnderCrystal;
39 | @Final
40 | @Shadow
41 | private ModelBase modelEnderCrystalNoBase;
42 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/mixin/mixins/render/entity/MixinRenderLivingBase.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.mixin.mixins.render.entity;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import me.notkronos.meowhack.event.events.render.RenderLivingEntityEvent;
5 | import me.notkronos.meowhack.module.render.PlayerModel;
6 | import net.minecraft.client.model.ModelBase;
7 | import net.minecraft.client.renderer.entity.RenderLivingBase;
8 | import net.minecraft.entity.Entity;
9 | import net.minecraft.entity.EntityLivingBase;
10 | import net.minecraft.entity.player.EntityPlayer;
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.Redirect;
16 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
17 |
18 | @Mixin(value = RenderLivingBase.class, priority = Integer.MAX_VALUE - 1)
19 | public abstract class MixinRenderLivingBase {
20 | @Shadow
21 | protected ModelBase mainModel;
22 |
23 | @Redirect(method = {"renderModel"}, at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelBase;render(Lnet/minecraft/entity/Entity;FFFFFF)V"))
24 | private void onRenderModelPreEntityLivingBase(ModelBase modelBase, Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor) {
25 | RenderLivingEntityEvent.RenderLivingEntityPreEvent event = new RenderLivingEntityEvent.RenderLivingEntityPreEvent(modelBase, (EntityLivingBase) entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor);
26 | Meowhack.EVENT_BUS.post(event);
27 | if(PlayerModel.INSTANCE.isEnabled() && PlayerModel.limbAnimation.value) {
28 | if(entityIn instanceof EntityPlayer) {
29 | limbSwing = PlayerModel.limbSwing.value;
30 | limbSwingAmount = PlayerModel.limbSwingAmount.value;
31 | }
32 | }
33 | if (!event.isCanceled()) {
34 | modelBase.render(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor);
35 | }
36 | }
37 |
38 | @Inject(method = "renderModel", at = @At("RETURN"), cancellable = true)
39 | private void onRenderModelPost(EntityLivingBase entityLivingBase, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, CallbackInfo ci) {
40 | RenderLivingEntityEvent.RenderLivingEntityPostEvent event = new RenderLivingEntityEvent.RenderLivingEntityPostEvent(this.mainModel, entityLivingBase, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor);
41 | Meowhack.EVENT_BUS.post(event);
42 | if (event.isCanceled()) {
43 | ci.cancel();
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/mixin/mixins/render/entity/MixinRenderPlayer.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.mixin.mixins.render.entity;
2 |
3 | import me.notkronos.meowhack.module.render.PlayerModel;
4 | import net.minecraft.client.entity.AbstractClientPlayer;
5 | import net.minecraft.client.model.ModelPlayer;
6 | import net.minecraft.client.renderer.GlStateManager;
7 | import net.minecraft.client.renderer.entity.RenderManager;
8 | import net.minecraft.client.renderer.entity.RenderPlayer;
9 | import net.minecraftforge.client.event.RenderPlayerEvent;
10 | import net.minecraftforge.common.MinecraftForge;
11 | import org.spongepowered.asm.mixin.Mixin;
12 | import org.spongepowered.asm.mixin.Overwrite;
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.Redirect;
17 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
18 |
19 | import static me.notkronos.meowhack.util.Wrapper.mc;
20 |
21 | @Mixin(RenderPlayer.class)
22 | public abstract class MixinRenderPlayer {
23 |
24 | @Shadow
25 | public abstract ModelPlayer getMainModel();
26 |
27 | @Shadow
28 | public abstract void setModelVisibilities(AbstractClientPlayer clientPlayer);
29 |
30 | @Inject(method = "setModelVisibilities", at = @At("TAIL"), cancellable = true)
31 | public void onSetModelVisiblities(AbstractClientPlayer clientPlayer, CallbackInfo ci) {
32 | ModelPlayer modelplayer = this.getMainModel();
33 | if(PlayerModel.INSTANCE.isEnabled() && PlayerModel.crouch.value) {
34 | modelplayer.isSneak = true;
35 | }
36 | }
37 |
38 | @Inject(method = "doRender", at = @At("HEAD"))
39 | private void onRenderPre(AbstractClientPlayer entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo info) {
40 | if(PlayerModel.INSTANCE.isEnabled() && PlayerModel.crouch.value) {
41 | y -= 0.125D;
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/mixin/mixins/render/gui/MixinFontRenderer.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.mixin.mixins.render.gui;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import me.notkronos.meowhack.event.events.render.RenderFontEvent;
5 | import me.notkronos.meowhack.util.render.FontUtil;
6 | import net.minecraft.client.gui.FontRenderer;
7 | import org.spongepowered.asm.mixin.Mixin;
8 | import org.spongepowered.asm.mixin.injection.At;
9 | import org.spongepowered.asm.mixin.injection.Inject;
10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
11 |
12 | @Mixin(FontRenderer.class)
13 | public class MixinFontRenderer {
14 |
15 | @Inject(method = "drawString(Ljava/lang/String;FFIZ)I", at = @At("HEAD"), cancellable = true)
16 | public void renderString(String text, float x, float y, int color, boolean dropShadow, CallbackInfoReturnable info) {
17 | RenderFontEvent renderFontEvent = new RenderFontEvent();
18 | Meowhack.EVENT_BUS.post(renderFontEvent);
19 | }
20 |
21 | @Inject(method = "getStringWidth", at = @At("HEAD"), cancellable = true)
22 | public void getWidth(String text, CallbackInfoReturnable info) {
23 | RenderFontEvent renderFontEvent = new RenderFontEvent();
24 | Meowhack.EVENT_BUS.post(renderFontEvent);
25 |
26 | if (renderFontEvent.isCanceled()) {
27 | info.setReturnValue(FontUtil.getStringWidth(text));
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/mixin/mixins/render/tileEntity/MixinTileEntityEnchantmentTableRenderer.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.mixin.mixins.render.tileEntity;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import me.notkronos.meowhack.event.events.render.tileEntity.RenderEnchantmentTableEvent;
5 | import net.minecraft.client.renderer.tileentity.TileEntityEnchantmentTableRenderer;
6 | import net.minecraft.tileentity.TileEntityEnchantmentTable;
7 | import org.spongepowered.asm.mixin.Mixin;
8 | import org.spongepowered.asm.mixin.injection.At;
9 | import org.spongepowered.asm.mixin.injection.Inject;
10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
11 |
12 | @Mixin(TileEntityEnchantmentTableRenderer.class)
13 | public class MixinTileEntityEnchantmentTableRenderer {
14 | @Inject(method = "render*", at = @At("HEAD"), cancellable = true)
15 | public void renderBook(TileEntityEnchantmentTable enchantmentTable, double x, double y, double z, float partialTicks, int destroyStage, float alpha, CallbackInfo callbackInfo) {
16 | RenderEnchantmentTableEvent renderEnchantmentTableEvent = new RenderEnchantmentTableEvent();
17 | Meowhack.EVENT_BUS.post(renderEnchantmentTableEvent);
18 | if(renderEnchantmentTableEvent.isCanceled()) {
19 | callbackInfo.cancel();
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/mixin/mixins/world/MixinWorld.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.mixin.mixins.world;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import me.notkronos.meowhack.event.events.entity.EntityWorldEvent;
5 | import net.minecraft.entity.Entity;
6 | import net.minecraft.world.World;
7 | import org.spongepowered.asm.mixin.Mixin;
8 | import org.spongepowered.asm.mixin.injection.At;
9 | import org.spongepowered.asm.mixin.injection.Inject;
10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
11 |
12 | @Mixin(World.class)
13 | public class MixinWorld {
14 | @Inject(method = "removeEntity", at =@At("HEAD"), cancellable = true)
15 | public void onRemoveEntity(Entity entity, CallbackInfo callbackInfo) {
16 | EntityWorldEvent.EntityRemoveEvent entityRemoveEvent = new EntityWorldEvent.EntityRemoveEvent(entity);
17 | Meowhack.EVENT_BUS.post(entityRemoveEvent);
18 |
19 | if(entityRemoveEvent.isCanceled()) {
20 | callbackInfo.cancel();
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/Category.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module;
2 |
3 | public enum Category {
4 | CLIENT,
5 | COMBAT,
6 | MISC,
7 | MOVEMENT,
8 | RENDER,
9 | WORLD;
10 | }
11 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/Module.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module;
2 |
3 | import me.notkronos.meowhack.setting.Setting;
4 | import me.notkronos.meowhack.util.Bind;
5 |
6 | import java.util.ArrayList;
7 | import java.util.Arrays;
8 | import java.util.List;
9 | import java.util.function.Predicate;
10 | import java.util.stream.Collectors;
11 |
12 | public abstract class Module {
13 | protected boolean enabled;
14 | protected boolean drawn = true;
15 |
16 | private final Setting bind = new Setting("Bind", Bind.none());
17 | private final String name;
18 | private final Category category;
19 | private final String description;
20 | private final String[] alias;
21 | private final List> settings = new ArrayList<>();
22 |
23 | public Module(String name, Category category, String description, String[] alias) {
24 | this.name = name;
25 | this.category = category;
26 | this.description = description;
27 | this.alias = alias;
28 | Arrays.stream(getClass().getDeclaredFields())
29 | .filter(field -> Setting.class.isAssignableFrom(field.getType()))
30 | .forEach(field -> {
31 | field.setAccessible(true);
32 | try {
33 | Setting> setting = ((Setting>) field.get(this));
34 |
35 | // set the setting's current module as this module
36 | setting.setModule(this);
37 |
38 | // add it this module's settings
39 | settings.add(setting);
40 | } catch (IllegalArgumentException | IllegalAccessException exception) {
41 | exception.printStackTrace();
42 | }
43 | });
44 |
45 | // Add bind
46 | settings.add(bind);
47 | drawn = true;
48 | }
49 |
50 | //setters
51 |
52 | public void setEnabled(boolean enabled) {
53 | this.enabled = enabled;
54 | }
55 | public void toggle() {
56 | enabled = !enabled;
57 | }
58 |
59 | public void setDrawn(boolean b) {
60 | drawn = true;
61 | }
62 |
63 | //getters
64 | public boolean isEnabled() {
65 | return enabled;
66 | }
67 | public boolean isDrawn() {
68 | return drawn;
69 | }
70 | public Setting getBind() {
71 | return bind;
72 | }
73 | public Category getCategory() {
74 | return category;
75 | }
76 | public List> getAllSettings() {
77 | return settings;
78 | }
79 | public List> getSettings(Predicate super Setting>> predicate) {
80 | return settings.stream()
81 | .filter(predicate)
82 | .collect(Collectors.toList());
83 | }
84 | public Setting> getSetting(Predicate super Setting>> predicate) {
85 | return settings.stream()
86 | .filter(predicate)
87 | .findFirst()
88 | .orElse(null);
89 | }
90 | public String getName() {
91 | return name;
92 | }
93 |
94 | public void onUpdate() {
95 |
96 | }
97 | public void onRender2D() {
98 |
99 | }
100 | public void onThread() {
101 | }
102 | public void onEnable() {
103 |
104 | }
105 | public void onTick() {
106 |
107 | }
108 | public void onDisable() {
109 |
110 | }
111 | public void onRender3D() {
112 |
113 | };
114 | }
115 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/client/ClickGUIModule.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.client;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import me.notkronos.meowhack.event.events.client.SettingUpdateEvent;
5 | import me.notkronos.meowhack.gui.clickgui.ClickGuiScreen;
6 | import me.notkronos.meowhack.module.Category;
7 | import me.notkronos.meowhack.module.Module;
8 | import me.notkronos.meowhack.setting.Setting;
9 | import me.notkronos.meowhack.util.Bind;
10 | import net.minecraft.util.ResourceLocation;
11 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
12 | import org.lwjgl.input.Keyboard;
13 |
14 | import static me.notkronos.meowhack.util.Wrapper.mc;
15 |
16 | public class ClickGUIModule extends Module {
17 | public static ClickGUIModule INSTANCE;
18 |
19 | public ClickGUIModule() {
20 | super("ClickGUI", Category.CLIENT, "This screen.", new String[] {"GUI", "UI"});
21 | INSTANCE = this;
22 | INSTANCE.drawn = false;
23 | getBind().setValue(new Bind(Keyboard.KEY_RCONTROL, Bind.Device.KEYBOARD));
24 | }
25 |
26 | Meowhack meowhack = Meowhack.INSTANCE;
27 |
28 | @Override
29 | public void onEnable() {
30 | mc.displayGuiScreen(ClickGuiScreen.getClickGui());
31 | this.setEnabled(false);
32 | }
33 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/client/Colors.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.client;
2 |
3 | import me.notkronos.meowhack.module.Category;
4 | import me.notkronos.meowhack.module.Module;
5 | import me.notkronos.meowhack.setting.Setting;
6 |
7 | public class Colors extends Module {
8 | public static Colors INSTANCE;
9 |
10 | public Colors() {
11 | super("Colors", Category.CLIENT, "Decides the color of the HUD", new String[]{});
12 | INSTANCE = this;
13 | INSTANCE.drawn = false;
14 | }
15 |
16 | //Settings
17 | public static Setting red = new Setting("red", 111, 0, 255);
18 | public static Setting green = new Setting("green", 0, 0, 255);
19 | public static Setting blue = new Setting("blue", 255, 0, 255);
20 | public static Setting HudPrimaryColor = new Setting("HUDColor", true);
21 |
22 | public Integer getRed() { return red.value; }
23 | public Integer getBlue() {
24 | return blue.value;
25 | }
26 | public Integer getGreen() {
27 | return green.value;
28 | }
29 |
30 | public boolean getHudPrimaryColor() {
31 | return HudPrimaryColor.getValue();
32 | }
33 | }
34 |
35 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/client/CustomFontMod.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.client;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import me.notkronos.meowhack.module.Category;
5 | import me.notkronos.meowhack.module.Module;
6 | import me.notkronos.meowhack.setting.Setting;
7 |
8 | public class CustomFontMod extends Module
9 | {
10 | public static CustomFontMod INSTANCE;
11 |
12 | public CustomFontMod() {
13 | super("CustomFont", Category.CLIENT, "Allows you to use custom fonts", new String[]{"CustomFont"});
14 | CustomFontMod.INSTANCE = this;
15 | this.enabled = false;
16 | this.drawn = false;
17 | Meowhack.EVENT_BUS.register(this);
18 | }
19 |
20 | public static Setting fontStyle = new Setting<>("Font Style", 0, 0, 3);
21 | public static Setting fontSize = new Setting<>("Font Size", 14, 8, 30);
22 | public static Setting antiAlias = new Setting<>("Anti Alias", true);
23 | public static Setting metrics = new Setting<>("Metrics", true);
24 | public static Setting shadow = new Setting<>("Shadow", true);
25 | public static Setting fontOffset = new Setting<>("Font Offset", 0, -5, 5);
26 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/combat/AntiPoplag.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.combat;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import me.notkronos.meowhack.event.events.network.PacketEvent;
5 | import me.notkronos.meowhack.module.Category;
6 | import me.notkronos.meowhack.module.Module;
7 | import me.notkronos.meowhack.util.chat.ChatUtil;
8 | import net.minecraft.network.play.server.SPacketChat;
9 | import net.minecraft.util.text.TextComponentString;
10 | import net.minecraft.util.text.TextFormatting;
11 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
12 |
13 | import java.util.regex.Matcher;
14 | import java.util.regex.Pattern;
15 |
16 | import static me.notkronos.meowhack.util.Wrapper.mc;
17 |
18 | public class AntiPoplag extends Module {
19 |
20 | public static AntiPoplag INSTANCE;
21 |
22 | public AntiPoplag() {
23 | super("AntiPoplag", Category.COMBAT, "Prevents poplag message from lagging your game", new String[]{});
24 | INSTANCE = this;
25 | INSTANCE.enabled = true;
26 | INSTANCE.drawn = true;
27 | Meowhack.EVENT_BUS.register(this);
28 | }
29 |
30 | @SubscribeEvent
31 | public void onPacketReceive(PacketEvent.PacketReceiveEvent event) {
32 | if (event.getPacket() instanceof SPacketChat && this.enabled) {
33 | String message = ((SPacketChat) event.getPacket()).getChatComponent().getUnformattedText();
34 | Pattern pattern = Pattern.compile("[^\\x00-\\x7F\\u0400-\\u04FF]+", Pattern.CASE_INSENSITIVE);
35 | Matcher matcher = pattern.matcher(message);
36 | if (matcher.find()) {
37 | event.setCanceled(true);
38 | ChatUtil.sendMessageClientSide(TextFormatting.RED + "[meowhack]" + TextFormatting.WHITE + " Poplag message blocked!");
39 | mc.ingameGUI.getChatGUI().printChatMessage(new TextComponentString(message.replaceAll(pattern.pattern(), "")));
40 | }
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/combat/AutoHeadBurrow.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.combat;
2 |
3 | import me.notkronos.meowhack.module.Category;
4 | import me.notkronos.meowhack.module.Module;
5 | import me.notkronos.meowhack.setting.Setting;
6 | import me.notkronos.meowhack.util.chat.ChatUtil;
7 | import me.notkronos.meowhack.util.chat.MessageType;
8 | import net.minecraft.init.Items;
9 |
10 | import static me.notkronos.meowhack.util.Wrapper.mc;
11 |
12 | public class AutoHeadBurrow extends Module {
13 | public static AutoHeadBurrow INSTANCE;
14 |
15 | public AutoHeadBurrow() {
16 | super("AutoHeadBurrow", Category.COMBAT, "Automatically burrows your head in a block", new String[]{"AutoHead"});
17 | INSTANCE = this;
18 | this.enabled = false;
19 | this.drawn = true;
20 | }
21 |
22 | public static Setting> type = new Setting<>("Type", Type.DISTANCE);
23 |
24 | @Override
25 | public void onEnable() {
26 | if(!hasHeadItem()) {
27 | this.setEnabled(false);
28 | ChatUtil.commandFeedback("No Skulls in hotbar found!", MessageType.ERROR);
29 | return;
30 | }
31 | }
32 |
33 | private boolean hasHeadItem() {
34 | for (int i = 0; i < 9; i++) {
35 | if (mc.player.inventory.getStackInSlot(i).getItem() == Items.SKULL) {
36 | return true;
37 | }
38 | }
39 | return false;
40 | }
41 | }
42 |
43 | enum Type {
44 | SMART,
45 | DISTANCE
46 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/combat/CornerClip.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.combat;
2 |
3 | import me.notkronos.meowhack.module.Category;
4 | import me.notkronos.meowhack.module.Module;
5 | import me.notkronos.meowhack.util.chat.ChatUtil;
6 | import me.notkronos.meowhack.util.chat.MessageType;
7 | import net.minecraft.network.play.client.CPacketPlayer;
8 | import net.minecraft.util.math.MathHelper;
9 |
10 | import static me.notkronos.meowhack.util.Wrapper.mc;
11 |
12 | public class CornerClip extends Module {
13 | Integer timeout = 0;
14 | public static CornerClip INSTANCE;
15 | public CornerClip() {
16 | super("CornerClip", Category.COMBAT, "Russian exploit", new String[]{"CornerClip"});
17 | INSTANCE = this;
18 | this.enabled = false;
19 | this.drawn = true;
20 | }
21 |
22 | @Override
23 | public void onEnable() {
24 | timeout = 0;
25 | }
26 |
27 | @Override
28 | public void onTick() {
29 | if(timeout <= 10) {
30 | push();
31 | timeout++;
32 | } else {
33 | this.setEnabled(false);
34 | ChatUtil.commandFeedback("CornerClip timed out.", MessageType.INFO);
35 | timeout = 0;
36 | }
37 | }
38 |
39 | private void push() {
40 | if (mc.world.getCollisionBoxes(mc.player, mc.player.getEntityBoundingBox().grow(0.01, 0, 0.01)).size() < 2) {
41 | mc.player.setPosition(roundToClosest(mc.player.posX, Math.floor(mc.player.posX) + 0.301, Math.floor(mc.player.posX) + 0.699), mc.player.posY, roundToClosest(mc.player.posZ, Math.floor(mc.player.posZ) + 0.301, Math.floor(mc.player.posZ) + 0.699));
42 | } else if (mc.player.ticksExisted % 5 == 0) {
43 | mc.player.setPosition(mc.player.posX + MathHelper.clamp(roundToClosest(mc.player.posX, Math.floor(mc.player.posX) + 0.241, Math.floor(mc.player.posX) + 0.759) - mc.player.posX, -0.03, 0.03), mc.player.posY, mc.player.posZ + MathHelper.clamp(roundToClosest(mc.player.posZ, Math.floor(mc.player.posZ) + 0.241, Math.floor(mc.player.posZ) + 0.759) - mc.player.posZ, -0.03, 0.03));
44 | mc.player.connection.sendPacket(new CPacketPlayer.Position(mc.player.posX, mc.player.posY, mc.player.posZ, true));
45 | mc.player.connection.sendPacket(new CPacketPlayer.Position(roundToClosest(mc.player.posX, Math.floor(mc.player.posX) + 0.23, Math.floor(mc.player.posX) + 0.77), mc.player.posY, roundToClosest(mc.player.posZ, Math.floor(mc.player.posZ) + 0.23, Math.floor(mc.player.posZ) + 0.77), true));
46 | }
47 | }
48 |
49 | private double roundToClosest(double in, double min, double max) {
50 | double d1 = in - min;
51 | double d2 = max - in;
52 | if (d1 < d2) {
53 | return min;
54 | } else {
55 | return max;
56 | }
57 | }
58 |
59 | public int getTimeout() {
60 | return timeout;
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/combat/StrengthDetect.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.combat;
2 |
3 | import me.notkronos.meowhack.module.Category;
4 | import me.notkronos.meowhack.module.Module;
5 | import me.notkronos.meowhack.util.chat.ChatUtil;
6 | import net.minecraft.entity.player.EntityPlayer;
7 | import net.minecraft.init.MobEffects;
8 |
9 | import java.util.Collections;
10 | import java.util.Set;
11 | import java.util.WeakHashMap;
12 |
13 | import static me.notkronos.meowhack.util.Wrapper.mc;
14 |
15 | public class StrengthDetect extends Module {
16 | public static StrengthDetect INSTANCE;
17 |
18 | private final Set str = Collections.newSetFromMap(new WeakHashMap<>());
19 |
20 | public StrengthDetect() {
21 | super("StrengthNotif", Category.COMBAT, "Notifies when someone gets strength in your visual range", new String[]{});
22 | INSTANCE = this;
23 | this.enabled = false;
24 | this.drawn = false;
25 | }
26 |
27 | @Override
28 | public void onTick() {
29 | for (EntityPlayer player : mc.world.playerEntities) {
30 | if(player.isPotionActive(MobEffects.STRENGTH) && !player.equals(mc.player)) {
31 | if (!str.contains(player)) {
32 | str.add(player);
33 | ChatUtil.sendMessageClientSide(player.getName() + " has strength!");
34 | }
35 | } else {
36 | str.remove(player);
37 | }
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/combat/TotemPopCounter.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.combat;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import me.notkronos.meowhack.event.events.combat.TotemPopEvent;
5 | import me.notkronos.meowhack.event.events.entity.DeathEvent;
6 | import me.notkronos.meowhack.event.events.entity.EntityWorldEvent;
7 | import me.notkronos.meowhack.module.Category;
8 | import me.notkronos.meowhack.module.Module;
9 | import me.notkronos.meowhack.util.Wrapper;
10 | import me.notkronos.meowhack.util.chat.ChatUtil;
11 | import net.minecraft.entity.Entity;
12 | import net.minecraft.util.text.TextFormatting;
13 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
14 |
15 | import java.util.HashMap;
16 | import java.util.Map;
17 |
18 | public class TotemPopCounter extends Module implements Wrapper {
19 | public static TotemPopCounter INSTANCE;
20 | private final Map totemPops = new HashMap<>();
21 |
22 | public int getTotemPops(Entity entity) {
23 | return totemPops.getOrDefault(entity, 0);
24 | }
25 |
26 | public TotemPopCounter(){
27 | super("TotemPopCounter", Category.COMBAT, "Counts totem pops and print pop notifs in chat", new String[]{"PopCounter"});
28 | INSTANCE = this;
29 | INSTANCE.drawn = false;
30 | INSTANCE.enabled = true;
31 | Meowhack.EVENT_BUS.register(this);
32 | }
33 |
34 | @SubscribeEvent
35 | public void onTotemPop(TotemPopEvent event) {
36 | if(isEnabled()) {
37 | totemPops.put(event.getPopEntity(), totemPops.containsKey(event.getPopEntity()) ? totemPops.get(event.getPopEntity()) + 1 : 1);
38 | String message;
39 | Entity player = event.getPopEntity();
40 | int pops = getTotemPops(player);
41 | if (pops == 1) {
42 | message = TextFormatting.RED + "[Meowhack] " + TextFormatting.WHITE
43 | + player.getName() + " popped " + TextFormatting.GREEN + pops + TextFormatting.WHITE + " totem.";
44 | } else {
45 | message = TextFormatting.RED + "[Meowhack] " + TextFormatting.WHITE
46 | + player.getName() + " popped " + TextFormatting.GREEN + pops + TextFormatting.WHITE + " totems.";
47 | }
48 | ChatUtil.sendMessageClientSide(message);
49 | }
50 | }
51 |
52 | @SubscribeEvent
53 | public void onDeath(DeathEvent event) {
54 | if(totemPops.containsKey(event.getEntity())) {
55 | int pops = totemPops.get(event.getEntity());
56 | ChatUtil.sendMessageClientSide(TextFormatting.RED + "[Meowhack] " + TextFormatting.WHITE
57 | + event.getEntity().getName() + " died after popping " + TextFormatting.GREEN + totemPops.get(event.getEntity()) + TextFormatting.WHITE + (pops == 1 ? " totem." : " totems."));
58 | }
59 | }
60 |
61 | @SubscribeEvent
62 | public void onRemoveEntity(EntityWorldEvent.EntityRemoveEvent event) {
63 | totemPops.remove(event.getEntity());
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/combat/VisualRange.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.combat;
2 |
3 | import me.notkronos.meowhack.module.Category;
4 | import me.notkronos.meowhack.module.Module;
5 | import me.notkronos.meowhack.util.chat.ChatUtil;
6 | import net.minecraft.entity.Entity;
7 | import net.minecraft.entity.player.EntityPlayer;
8 | import net.minecraft.util.text.TextFormatting;
9 |
10 | import java.util.List;
11 | import java.util.concurrent.CopyOnWriteArrayList;
12 | import java.util.stream.Collectors;
13 |
14 | import static me.notkronos.meowhack.util.Wrapper.mc;
15 |
16 | public class VisualRange extends Module {
17 | public static VisualRange INSTANCE;
18 |
19 | public VisualRange() {
20 | super("VisualRange", Category.COMBAT, "Sends a chat notif when someone enters your render distance.", new String[]{"AutoGroom"});
21 | INSTANCE = this;
22 | INSTANCE.enabled = false;
23 | INSTANCE.drawn = false;
24 | }
25 |
26 | private final List players = new CopyOnWriteArrayList<>();
27 |
28 | @Override
29 | public void onEnable() {
30 | super.onEnable();
31 |
32 | // clear old list
33 | players.clear();
34 | for(Entity entity : mc.world.loadedEntityList) {
35 | if(entity instanceof EntityPlayer) {
36 | players.add(entity);
37 | }
38 | }
39 | }
40 |
41 | @Override
42 | public void onUpdate() {
43 | if(mc.player.ticksExisted > 20) {
44 | List currentPlayers = mc.world.loadedEntityList.stream().filter(
45 | player -> player instanceof EntityPlayer).filter(
46 | player -> !player.equals(mc.player)).collect(Collectors.toList());
47 |
48 |
49 | // on enter
50 |
51 | for(Entity player : currentPlayers) {
52 | if(!players.contains(player)) {
53 | String message = TextFormatting.RED + "[Meowhack] " + TextFormatting.GREEN
54 | + player.getName() + TextFormatting.WHITE + " has " + TextFormatting.GREEN
55 | + "entered " + TextFormatting.WHITE + " your visual range!";
56 | players.add(player);
57 | ChatUtil.sendMessageClientSide(message);
58 | }
59 | }
60 |
61 | // on exit
62 | for(Entity player : players) {
63 | if(!currentPlayers.contains(player)) {
64 | String message = TextFormatting.RED + "[Meowhack] " + TextFormatting.GREEN
65 | + player.getName() + TextFormatting.WHITE + " has " + TextFormatting.RED
66 | + "left " + TextFormatting.WHITE + " your visual range!";
67 | players.remove(player);
68 | ChatUtil.sendMessageClientSide(message);
69 | }
70 | }
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/misc/Announcer.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.misc;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import me.notkronos.meowhack.event.events.combat.TotemPopEvent;
5 | import me.notkronos.meowhack.module.Category;
6 | import me.notkronos.meowhack.module.Module;
7 | import me.notkronos.meowhack.setting.Setting;
8 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
9 |
10 | import static me.notkronos.meowhack.util.Wrapper.mc;
11 |
12 | public class Announcer extends Module {
13 | public static Announcer INSTANCE;
14 | public Announcer() {
15 | super("Announcer", Category.MISC, "Announces different events in chat", new String[]{});
16 | INSTANCE = this;
17 | INSTANCE.drawn = true;
18 | INSTANCE.enabled = false;
19 | Meowhack.EVENT_BUS.register(this);
20 | }
21 |
22 | //Settings
23 | public static Setting meow = new Setting<>("CatMode", true);
24 |
25 | //Event Settings
26 | public static Setting announcePops = new Setting<>("TotemPops", true);
27 |
28 | @SubscribeEvent
29 | public void onTotemPop(TotemPopEvent event) {
30 | if (isEnabled()) {
31 | if (announcePops.getValue()) {
32 | if(event.getPopEntity() != mc.player) {
33 | //Avoid announcing friend totem pops
34 | if(Meowhack.INSTANCE.getFriendManager().isFriend(event.getPopEntity().getName())) {
35 | return;
36 | }
37 | if (meow.getValue()) {
38 | mc.player.sendChatMessage(event.getPopEntity().getName() + " meow meow meow meow meow meowhack!");
39 | } else {
40 | mc.player.sendChatMessage(event.getPopEntity().getName() + " popped a totem thanks to meowhack!");
41 | }
42 | }
43 | }
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/misc/AutoMeow.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.misc;
2 |
3 | import me.notkronos.meowhack.module.Category;
4 | import me.notkronos.meowhack.module.Module;
5 | import me.notkronos.meowhack.setting.Setting;
6 |
7 | import static me.notkronos.meowhack.util.Wrapper.mc;
8 |
9 |
10 | public class AutoMeow extends Module {
11 | public static AutoMeow INSTANCE;
12 | private long lastMeow = 0;
13 |
14 | public AutoMeow() {
15 | super("AutoMeow", Category.MISC, "Meows so you don't have to!", new String[]{});
16 | INSTANCE = this;
17 | INSTANCE.enabled = true;
18 | INSTANCE.drawn = true;
19 |
20 | }
21 |
22 | public static Setting seconds = new Setting<>("Delay", 30, 1, 60);
23 |
24 | @Override
25 | public void onTick() {
26 | if (isEnabled()) {
27 | int time = seconds.getValue(); // set time in seconds
28 | long tick = mc.world.getTotalWorldTime();
29 | if (tick - lastMeow >= 20L * time) { // stops it from meowing twice
30 | mc.player.sendChatMessage("meow");
31 | lastMeow = tick;
32 | }
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/misc/ChatSuffix.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.misc;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import me.notkronos.meowhack.event.events.network.PacketEvent;
5 | import me.notkronos.meowhack.mixin.mixins.accessor.ICPacketChatMessageAccessor;
6 | import me.notkronos.meowhack.module.Category;
7 | import me.notkronos.meowhack.module.Module;
8 | import net.minecraft.network.play.client.CPacketChatMessage;
9 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
10 |
11 | import java.util.regex.Matcher;
12 | import java.util.regex.Pattern;
13 |
14 | public class ChatSuffix extends Module {
15 | public static ChatSuffix INSTANCE;
16 |
17 | public ChatSuffix() {
18 | super("ChatSuffix", Category.MISC, "Appends meowhack watermark to messages you send", new String[]{});
19 | INSTANCE = this;
20 | INSTANCE.enabled = false;
21 | INSTANCE.drawn = false;
22 | Meowhack.EVENT_BUS.register(this);
23 | }
24 |
25 | @SubscribeEvent
26 | public void onPacketSend(PacketEvent.PacketSendEvent event) {
27 | if (isEnabled()) {
28 | if (event.getPacket() instanceof CPacketChatMessage) {
29 | StringBuilder message = new StringBuilder();
30 | message.append(((CPacketChatMessage) event.getPacket()).getMessage())
31 | .append(" | ᴍᴇᴏᴡʜᴀᴄᴋ");
32 | Pattern pattern = Pattern.compile("[+]", Pattern.CASE_INSENSITIVE);
33 | Matcher matcher = pattern.matcher(Meowhack.VERSION);
34 | if (matcher.find()) {
35 | message.append("-ʙᴇᴛᴀ");
36 | }
37 | ((ICPacketChatMessageAccessor) event.getPacket()).setMessage(message.toString());
38 | }
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/misc/ChatTimestamp.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.misc;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import me.notkronos.meowhack.event.events.network.PacketEvent;
5 | import me.notkronos.meowhack.mixin.mixins.accessor.ITextComponentStringAccessor;
6 | import me.notkronos.meowhack.module.Category;
7 | import me.notkronos.meowhack.module.Module;
8 | import net.minecraft.network.play.server.SPacketChat;
9 | import net.minecraft.util.text.TextComponentString;
10 | import net.minecraft.util.text.TextFormatting;
11 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
12 |
13 | import java.text.SimpleDateFormat;
14 | import java.util.Date;
15 |
16 |
17 | public class ChatTimestamp extends Module {
18 | public static ChatTimestamp INSTANCE;
19 |
20 | public ChatTimestamp() {
21 | super("ChatTimestamp", Category.MISC, "Adds timestamps before chat messages", new String[]{});
22 | INSTANCE = this;
23 | INSTANCE.enabled = true;
24 | INSTANCE.drawn = false;
25 | Meowhack.EVENT_BUS.register(this);
26 | }
27 |
28 | @SubscribeEvent
29 | public void onPacketReceive(PacketEvent.PacketReceiveEvent event) {
30 | // packet for server chat messages
31 | if (event.getPacket() instanceof SPacketChat) {
32 |
33 | // get the text
34 | if (((SPacketChat) event.getPacket()).getChatComponent() instanceof TextComponentString) {
35 |
36 | // the chat message
37 | TextComponentString component = (TextComponentString) ((SPacketChat) event.getPacket()).getChatComponent();
38 |
39 | // timestamp
40 | String formattedTime = "";
41 | formattedTime = new SimpleDateFormat("h:mm a").format(new Date());
42 |
43 | component.getText();// timestamp formatted
44 | StringBuilder formattedText = new StringBuilder();
45 |
46 | formattedText.append(TextFormatting.GRAY).append("[").append(formattedTime).append("] ").append(TextFormatting.RESET);
47 |
48 | formattedText.append(component.getText());
49 |
50 | // replace the chat message
51 | ((ITextComponentStringAccessor) component).setText(formattedText.toString());
52 | }
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/misc/NBTViewer.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.misc;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import me.notkronos.meowhack.module.Category;
5 | import me.notkronos.meowhack.module.Module;
6 | import me.notkronos.meowhack.setting.Setting;
7 | import net.minecraft.client.gui.GuiScreen;
8 | import net.minecraft.nbt.NBTBase;
9 | import net.minecraft.nbt.NBTTagCompound;
10 | import net.minecraft.nbt.NBTTagList;
11 | import net.minecraftforge.event.entity.player.ItemTooltipEvent;
12 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
13 |
14 | import java.util.ArrayList;
15 |
16 | public class NBTViewer extends Module {
17 |
18 | public static NBTViewer INSTANCE;
19 | public NBTViewer() {
20 | super("NBTViewer", Category.MISC, "View NBT tags of items", new String[]{});
21 | INSTANCE = this;
22 | INSTANCE.enabled = false;
23 | INSTANCE.drawn = true;
24 | Meowhack.EVENT_BUS.register(this);
25 | }
26 |
27 | @SubscribeEvent
28 | public void onTooltip(ItemTooltipEvent event) {
29 | if(INSTANCE.enabled) {
30 | NBTTagCompound tag = event.getItemStack().getTagCompound();
31 | ArrayList linesOfNBT = new ArrayList<>();
32 | if(tag == null) return;
33 | linesOfNBT.addAll(nbtToList(tag, "", "root", " "));
34 | event.getToolTip().addAll(linesOfNBT);
35 | }
36 | }
37 |
38 | public ArrayList nbtToList(NBTBase nbt, String pad, String tagName, String padIncrement) {
39 | ArrayList lines = new ArrayList<>();
40 | if(nbt instanceof NBTTagCompound) {
41 | NBTTagCompound compound = (NBTTagCompound) nbt;
42 | lines.add(tagName + ": " + compound.getSize());
43 | for(String key : compound.getKeySet()) {
44 | lines.addAll(nbtToList(compound.getTag(key), pad + padIncrement, key, padIncrement));
45 | }
46 | } else if(nbt instanceof NBTTagList) {
47 | NBTTagList list = (NBTTagList) nbt;
48 | lines.add(tagName + ": " + list.tagCount());
49 | for(int i = 0; i < list.tagCount(); i++) {
50 | lines.addAll(nbtToList(list.get(i), pad + padIncrement, "[" + i + "]", padIncrement));
51 | }
52 | } else {
53 | lines.add(tagName + ": " + nbt.toString());
54 | }
55 | return lines;
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/misc/RPC.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.misc;
2 |
3 | import club.minnced.discord.rpc.DiscordEventHandlers;
4 | import club.minnced.discord.rpc.DiscordRPC;
5 | import club.minnced.discord.rpc.DiscordRichPresence;
6 | import me.notkronos.meowhack.Meowhack;
7 | import me.notkronos.meowhack.module.Category;
8 | import me.notkronos.meowhack.module.Module;
9 | import me.notkronos.meowhack.setting.Setting;
10 | import me.notkronos.meowhack.util.rpc.IMAGE;
11 |
12 | import static me.notkronos.meowhack.util.Wrapper.mc;
13 |
14 | public class RPC extends Module {
15 | public static RPC INSTANCE;
16 |
17 | public static Setting> image = new Setting<>("image", IMAGE.OG);
18 |
19 | public RPC() {
20 | super("RPC", Category.MISC, "Displays discord RPC", new String[]{"DiscordRichPresence"});
21 | INSTANCE = this;
22 | INSTANCE.drawn = true;
23 | INSTANCE.enabled = false;
24 | }
25 | // discord stuff
26 | private static final DiscordRPC discordPresence = DiscordRPC.INSTANCE;
27 | private static final DiscordRichPresence richPresence = new DiscordRichPresence();
28 | private static final DiscordEventHandlers presenceHandlers = new DiscordEventHandlers();
29 |
30 | // discord presence thread
31 | private static Thread presenceThread;
32 |
33 | @Override
34 | public void onEnable() {
35 | super.onEnable();
36 | startPresence();
37 |
38 | }
39 | @Override
40 | public void onDisable() {
41 | super.onDisable();
42 | interruptPresence();
43 | }
44 | public static void startPresence() {
45 |
46 | discordPresence.Discord_Initialize("975671314440392704", presenceHandlers, true, "");
47 | richPresence.startTimestamp = System.currentTimeMillis() / 1000L;
48 | discordPresence.Discord_UpdatePresence(richPresence);
49 |
50 | presenceThread = new Thread(() -> {
51 | while (!Thread.currentThread().isInterrupted()) {
52 | try {
53 | richPresence.largeImageKey = getLargeImageKey();
54 | richPresence.largeImageText = Meowhack.NAME + " " + Meowhack.VERSION;
55 | richPresence.smallImageKey = "nya";
56 | richPresence.smallImageText = "Nya :3";
57 | richPresence.details = mc.isIntegratedServerRunning() ? "SinglePlayer" : (mc.getCurrentServerData() != null ? mc.getCurrentServerData().serverIP.toLowerCase() : "Menus");
58 | richPresence.state = "Owning spawn!";
59 | discordPresence.Discord_UpdatePresence(richPresence);
60 |
61 | // update every 3 seconds
62 | Thread.sleep(3000);
63 | } catch (Exception ignored) {
64 |
65 | }
66 | }
67 | });
68 |
69 | presenceThread.start();
70 | }
71 | public static void interruptPresence() {
72 | if (presenceThread != null && !presenceThread.isInterrupted()) {
73 | presenceThread.interrupt();
74 | }
75 |
76 | // shutdown
77 | discordPresence.Discord_Shutdown();
78 | discordPresence.Discord_ClearPresence();
79 | }
80 |
81 | public static String getLargeImageKey() {
82 | if(image.getValue() == IMAGE.OG) {
83 | return "meowhack";
84 | }
85 | else if(image.getValue() == IMAGE.CATGIRL) {
86 | return "kitsureii";
87 | }
88 | return "";
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/misc/Spammer.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.misc;
2 |
3 | import com.mojang.realmsclient.gui.ChatFormatting;
4 | import me.notkronos.meowhack.Meowhack;
5 | import me.notkronos.meowhack.module.Category;
6 | import me.notkronos.meowhack.module.Module;
7 | import me.notkronos.meowhack.setting.Setting;
8 | import me.notkronos.meowhack.util.chat.ChatUtil;
9 |
10 | import static me.notkronos.meowhack.util.Wrapper.mc;
11 |
12 | public class Spammer extends Module {
13 | private final String[] hazelSpam = {
14 | "hazel",
15 | "EMPERIUM DIES IN A 5V1 TO HAZELBESTIEE QUEEN OF GRIM",
16 | "bezo is a cuck",
17 | "SUPERHATEMEWINNING",
18 | "DOCTORKEA IS GOD",
19 | "meow :3",
20 | "trans rights are human rights ^_^",
21 | "RAHHHHHHHHHHHHH",
22 | "FatManLana",
23 | "i love asplint"
24 | };
25 | public static String[] spam;
26 |
27 | public static Spammer INSTANCE;
28 | private long time = 0;
29 | public boolean isFileSet = false;
30 | private boolean isWarningSent = false;
31 |
32 | public Spammer() {
33 | super("Spammer", Category.MISC, "Spams the chat with messages inside of a specified file", new String[]{});
34 | INSTANCE = this;
35 | INSTANCE.enabled = true;
36 | INSTANCE.drawn = true;
37 | }
38 |
39 | public static Setting seconds = new Setting<>("Delay", 30, 1, 60);
40 | public static Setting> mode = new Setting<>("Mode", modeEnum.file);
41 |
42 | @Override
43 | public void onTick() {
44 | if (isEnabled()) {
45 | int time = seconds.getValue(); // set time in seconds
46 | long tick = mc.world.getTotalWorldTime();
47 | if (tick - this.time >= 20L * time) {
48 | if(mode.getValue() == modeEnum.file) {
49 | if(!isFileSet && !isWarningSent) {
50 | ChatUtil.sendMessageClientSide(ChatFormatting.RED + "SpammerFile is not set. Please set it using " + Meowhack.PREFIX + "spammerfile ");
51 | isWarningSent = true;
52 | } else if(spam != null) {
53 | mc.player.sendChatMessage(spam[(int) (Math.random() * spam.length)]);
54 | this.time = tick;
55 | }
56 | } else {
57 | mc.player.sendChatMessage(hazelSpam[(int) (Math.random() * hazelSpam.length)]);
58 | this.time = tick;
59 | }
60 | }
61 | }
62 | }
63 |
64 | public static String[] getSpam(String[] spam) {
65 | return spam;
66 | }
67 | }
68 |
69 | enum modeEnum {
70 | file, hazelSpammer
71 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/movement/Sprint.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.movement;
2 |
3 | import me.notkronos.meowhack.module.Category;
4 | import me.notkronos.meowhack.module.Module;
5 |
6 | import static me.notkronos.meowhack.util.Wrapper.mc;
7 |
8 | public class Sprint extends Module {
9 | public static Sprint INSTANCE;
10 |
11 | public Sprint() {
12 | super("Sprint", Category.MOVEMENT, "Automatically sprints", new String[]{});
13 | INSTANCE = this;
14 | INSTANCE.enabled = false;
15 | INSTANCE.drawn = true;
16 | }
17 |
18 | @Override
19 | public void onTick() {
20 | if (isEnabled()) {
21 | mc.player.setSprinting(true); // Very primitive sprint module. Can refine later.
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/render/Ambience.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.render;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import me.notkronos.meowhack.module.Category;
5 | import me.notkronos.meowhack.module.Module;
6 | import me.notkronos.meowhack.module.client.Colors;
7 | import me.notkronos.meowhack.setting.Setting;
8 | import net.minecraftforge.client.event.EntityViewRenderEvent;
9 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
10 |
11 | public class Ambience extends Module {
12 | public static Ambience INSTANCE;
13 |
14 | public Ambience() {
15 | super("Ambience", Category.RENDER, "Changes sky color.", new String[]{"SkyColor", "Environment"});
16 | INSTANCE = this;
17 | INSTANCE.enabled = false;
18 | INSTANCE.drawn = true;
19 | }
20 |
21 | // Settings
22 | public static Setting red = new Setting<>("Red", 0, 0, 255);
23 | public static Setting green = new Setting<>("Green", 0, 0, 255);
24 | public static Setting blue = new Setting<>("Blue", 0, 0, 255);
25 | public static Setting fog = new Setting("Fog", false);
26 | public static Setting useGlobalColor = new Setting<>("GlobalColor", true);
27 |
28 | @SubscribeEvent
29 | public void fogColors(EntityViewRenderEvent.FogColors event) {
30 | if(useGlobalColor.getValue()) {
31 | setFogColors(event, Colors.red.getValue(), Colors.green.getValue(), Colors.blue.getValue());
32 | } else {
33 | setFogColors(event, red.getValue(), green.getValue(), blue.getValue());
34 | }
35 | }
36 | @SubscribeEvent
37 | public void fog_density(EntityViewRenderEvent.FogDensity event) {
38 | if (fog.getValue()) {
39 | event.setDensity(0.0f);
40 | event.setCanceled(true);
41 | }
42 | }
43 |
44 | @Override
45 | public void onEnable() {
46 | Meowhack.EVENT_BUS.register(this);
47 | }
48 |
49 | @Override
50 | public void onDisable() {
51 | Meowhack.EVENT_BUS.unregister(this);
52 | }
53 |
54 | public void setFogColors(EntityViewRenderEvent.FogColors event, int r, int g, int b) {
55 | event.setRed(r / 255.0f);
56 | event.setGreen(g / 255.0f);
57 | event.setBlue(b / 255.0f);
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/render/DeathEffects.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.render;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import me.notkronos.meowhack.event.events.entity.DeathEvent;
5 | import me.notkronos.meowhack.module.Category;
6 | import me.notkronos.meowhack.module.Module;
7 | import me.notkronos.meowhack.setting.Setting;
8 | import net.minecraft.client.audio.PositionedSoundRecord;
9 | import net.minecraft.client.entity.EntityOtherPlayerMP;
10 | import net.minecraft.client.renderer.entity.RenderLightningBolt;
11 | import net.minecraft.entity.effect.EntityLightningBolt;
12 | import net.minecraft.init.SoundEvents;
13 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
14 |
15 | import static me.notkronos.meowhack.util.Wrapper.mc;
16 |
17 | public class DeathEffects extends Module {
18 | public static DeathEffects INSTANCE;
19 |
20 | public DeathEffects() {
21 | super("DeathEffects", Category.RENDER, "Adds death effects", new String[]{});
22 | INSTANCE = this;
23 | INSTANCE.enabled = false;
24 | INSTANCE.drawn = true;
25 | Meowhack.EVENT_BUS.register(this);
26 | }
27 |
28 | public static Setting lightning = new Setting<>("Lightning", true);
29 | public static Setting sound = new Setting<>("Sound", true);
30 |
31 | @SubscribeEvent
32 | public void onDeathEvent(DeathEvent event) {
33 | if (isEnabled() && event.getEntity() instanceof EntityOtherPlayerMP) {
34 | EntityLightningBolt lightningBoltEntity = new EntityLightningBolt(mc.world, event.getEntity().posX, event.getEntity().posY, event.getEntity().posZ, true);
35 | if(lightning.getValue()) {
36 | mc.world.addWeatherEffect(lightningBoltEntity);
37 | }
38 | if(sound.getValue()) {
39 | mc.getSoundHandler().playSound(PositionedSoundRecord.getMasterRecord(SoundEvents.ENTITY_LIGHTNING_IMPACT, 1.0F));
40 | mc.getSoundHandler().playSound(PositionedSoundRecord.getMasterRecord(SoundEvents.ENTITY_LIGHTNING_THUNDER, 1.0F));
41 | }
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/render/FullBright.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.render;
2 |
3 | import me.notkronos.meowhack.module.Category;
4 | import me.notkronos.meowhack.module.Module;
5 |
6 | import static me.notkronos.meowhack.util.Wrapper.mc;
7 |
8 | public class FullBright extends Module {
9 | public static FullBright INSTANCE;
10 |
11 | public FullBright() {
12 | super("FullBright", Category.RENDER, "Allows you to see in the dark", new String[]{"Brightness"});
13 | INSTANCE = this;
14 | INSTANCE.enabled = false;
15 | INSTANCE.drawn = false;
16 | }
17 |
18 | @Override
19 | public void onEnable() {
20 | mc.gameSettings.gammaSetting = 100;
21 | }
22 |
23 | @Override
24 | public void onDisable() {
25 | mc.gameSettings.gammaSetting = 1;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/render/NoBob.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.render;
2 |
3 | import me.notkronos.meowhack.module.Category;
4 | import me.notkronos.meowhack.module.Module;
5 |
6 | import static me.notkronos.meowhack.util.Wrapper.mc;
7 |
8 | public class NoBob extends Module {
9 | public static NoBob INSTANCE;
10 |
11 | public NoBob() {
12 | super("NoBob", Category.RENDER, "Stops hand bob when walking", new String[]{});
13 | INSTANCE = this;
14 | INSTANCE.enabled = false;
15 | INSTANCE.drawn = true;
16 | }
17 |
18 | @Override
19 | public void onTick() {
20 | if (isEnabled()) {
21 | mc.gameSettings.viewBobbing = false;
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/render/NoEnchantingTableLag.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.render;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import me.notkronos.meowhack.event.events.render.tileEntity.RenderEnchantmentTableEvent;
5 | import me.notkronos.meowhack.module.Category;
6 | import me.notkronos.meowhack.module.Module;
7 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
8 |
9 | public class NoEnchantingTableLag extends Module {
10 | public static NoEnchantingTableLag INSTANCE;
11 |
12 | public NoEnchantingTableLag() {
13 | super(
14 | "NoEnchantingTableLag",
15 | Category.RENDER,
16 | "Prevents Enchanting Table books from lagging your game.",
17 | new String[]{"AntiBookLag"}
18 | );
19 | INSTANCE = this;
20 | INSTANCE.drawn = true;
21 | INSTANCE.enabled = true;
22 | Meowhack.EVENT_BUS.register(this);
23 | }
24 |
25 | @SubscribeEvent
26 | public void onRenderEnchantmentTableEvent(RenderEnchantmentTableEvent event) {
27 | if(isEnabled()) {
28 | event.setCanceled(true);
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/render/NoRender.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.render;
2 |
3 | import me.notkronos.meowhack.module.Category;
4 | import me.notkronos.meowhack.module.Module;
5 | import me.notkronos.meowhack.setting.Setting;
6 |
7 | public class NoRender extends Module {
8 | public static NoRender INSTANCE;
9 |
10 | public NoRender() {
11 | super("NoRender", Category.RENDER, "Prevents certain things from rendering", new String[]{"NoRender"});
12 | INSTANCE = this;
13 | INSTANCE.enabled = false;
14 | INSTANCE.drawn = true;
15 | }
16 |
17 | public static Setting noBossOverlay = new Setting<>("NoBossOverlay", true);
18 | public static Setting helmet = new Setting<>("Helmet", true);
19 | public static Setting chestplate = new Setting<>("Chestplate", true);
20 | public static Setting leggings = new Setting<>("Leggings", true);
21 | public static Setting boots = new Setting<>("Boots", true);
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/render/PlayerModel.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.render;
2 |
3 | import me.notkronos.meowhack.module.Category;
4 | import me.notkronos.meowhack.module.Module;
5 | import me.notkronos.meowhack.setting.Setting;
6 |
7 | public class PlayerModel extends Module {
8 | public static PlayerModel INSTANCE;
9 |
10 | public PlayerModel() {
11 | super("PlayerModel", Category.RENDER, "Changes the player model", new String[]{});
12 | INSTANCE = this;
13 | INSTANCE.drawn = true;
14 | INSTANCE.enabled = false;
15 | }
16 |
17 | public static Setting limbAnimation = new Setting<>("LimbAnimation", true);
18 | public static Setting crouch = new Setting<>("Crouch", true);
19 | public static Setting limbSwing = new Setting<>("LimbSwing", 0.0f, 0.0f, 15.0f);
20 | public static Setting limbSwingAmount = new Setting<>("LimbSwingAmount", 0.0f, 0.0f, 15.0f);
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/render/PopParticles.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.render;
2 |
3 | import me.notkronos.meowhack.module.Category;
4 | import me.notkronos.meowhack.module.Module;
5 | import me.notkronos.meowhack.setting.Setting;
6 |
7 | public class PopParticles extends Module {
8 | public static PopParticles INSTANCE;
9 |
10 | public PopParticles() {
11 | super("PopParticles", Category.RENDER, "Modifies the color of pop particles", new String[]{});
12 | INSTANCE = this;
13 | INSTANCE.enabled = false;
14 | INSTANCE.drawn = true;
15 | }
16 |
17 | public static Setting> mode = new Setting<>("Mode", ParticleType.TRANS);
18 | public static Setting duration = new Setting<>("Duration", 1.0f, 0.1f, 2.5f);
19 | public static Setting red = new Setting<>("Red", 59, 0, 255);
20 | public static Setting green = new Setting<>("Green", 119, 0, 255);
21 | public static Setting blue = new Setting<>("Blue", 200, 0, 255);
22 |
23 | public enum ParticleType {
24 | TRANS,
25 | CUSTOM
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/render/StaticFOV.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.render;
2 |
3 | import me.notkronos.meowhack.module.Category;
4 | import me.notkronos.meowhack.module.Module;
5 | import me.notkronos.meowhack.setting.Setting;
6 |
7 | public class StaticFOV extends Module {
8 | public static StaticFOV INSTANCE;
9 |
10 | public StaticFOV() {
11 | super("StaticFOV", Category.RENDER, "StaticFOV", new String[]{"fov", "nodynamicfov"});
12 | INSTANCE = this;
13 | INSTANCE.enabled = false;
14 | INSTANCE.drawn = true;
15 | }
16 |
17 | public static Setting fovModifier = new Setting<>("fovModifier", 1.0f, 0.1f, 2.0f);
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/module/render/SwingSpeed.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.module.render;
2 |
3 | import me.notkronos.meowhack.module.Category;
4 | import me.notkronos.meowhack.module.Module;
5 | import me.notkronos.meowhack.setting.Setting;
6 |
7 | public class SwingSpeed extends Module {
8 | public static SwingSpeed INSTANCE;
9 |
10 | public SwingSpeed() {
11 | super("SwingSpeed", Category.RENDER, "Allows you to customize hand swing animation.", new String[]{"SwingAnimation"});
12 | INSTANCE = this;
13 | INSTANCE.enabled = false;
14 | INSTANCE.drawn = false;
15 | }
16 |
17 | //Mode Settings
18 |
19 | public static Setting> mode = new Setting<>("Mode", Mode.SELF);
20 |
21 | //Swing Settings
22 | public static Setting speed = new Setting<>("Speed", 16, -1, 32);
23 |
24 | public boolean isCausedByRClick = false;
25 |
26 | public enum Mode {
27 | SELF,
28 | OTHERS,
29 | BOTH
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/setting/settings/BindSetting.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.setting.settings;
2 |
3 | import me.notkronos.meowhack.setting.Setting;
4 | import me.notkronos.meowhack.util.Bind;
5 |
6 | public class BindSetting extends Setting{
7 |
8 | public BindSetting(String name, Bind value) {
9 | super(name, value);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/setting/settings/BooleanSetting.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.setting.settings;
2 |
3 | import me.notkronos.meowhack.setting.Setting;
4 |
5 | public class BooleanSetting extends Setting {
6 | private static final String TRUE = "true";
7 | private static final String FALSE = "false";
8 |
9 | public BooleanSetting(String name, Boolean value) {
10 | super(name, value);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/setting/settings/EnumSetting.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.setting.settings;
2 |
3 | import me.notkronos.meowhack.setting.Setting;
4 | import me.notkronos.meowhack.util.EnumUtil;
5 |
6 | public class EnumSetting> extends Setting {
7 | private final String concatenated;
8 | public EnumSetting(String name, E value) {
9 | super(name, value);
10 | concatenated = concatenateInputs();
11 | }
12 |
13 | public String getInputs(String string) {
14 | if(string == null || string.isEmpty()) {
15 | return concatenated;
16 | }
17 | Enum> entry = EnumUtil.getEnumStartingWith(string, value.getDeclaringClass());
18 | return entry == null ? "" : entry.toString();
19 | }
20 |
21 | private String concatenateInputs() {
22 | StringBuilder concatenated = new StringBuilder("<");
23 | Class extends Enum>> clazz = this.value.getDeclaringClass();
24 | for(Enum> entry : clazz.getEnumConstants()) {
25 | concatenated.append(entry.name()).append(", ");
26 | }
27 | concatenated.replace(concatenated.length() - 2, concatenated.length(), ">");
28 | return concatenated.toString();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/setting/settings/FloatSetting.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.setting.settings;
2 |
3 | import me.notkronos.meowhack.setting.Setting;
4 |
5 | public class FloatSetting extends Setting {
6 | public FloatSetting(String name, Float value, Integer min, Integer max) {
7 | super(name, value, min, max);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/setting/settings/IntegerSetting.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.setting.settings;
2 |
3 | import me.notkronos.meowhack.setting.Setting;
4 |
5 | public class IntegerSetting extends Setting {
6 | public IntegerSetting(String name, Float value, Float fmin, Float fmax) {
7 | super(name, value, fmin, fmax);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/setting/settings/StringSetting.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.setting.settings;
2 |
3 | import me.notkronos.meowhack.setting.Setting;
4 |
5 | public class StringSetting extends Setting {
6 | public StringSetting(String name, String value) {
7 | super(name, value);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/util/Bind.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.util;
2 |
3 | import org.lwjgl.input.Keyboard;
4 | import org.lwjgl.input.Mouse;
5 |
6 | public class Bind implements Wrapper {
7 |
8 | // The button index
9 | private final int buttonCode;
10 |
11 | // Input device
12 | private final Device device;
13 |
14 | // Prevent spam
15 | private boolean alreadyPressed;
16 |
17 | public Bind(int buttonCode, Device device) {
18 | this.buttonCode = buttonCode;
19 | this.device = device;
20 | }
21 |
22 | public static Bind none() {
23 | return new Bind(-1, Device.KEYBOARD);
24 | }
25 |
26 | /**
27 | * Checks if the bind has been pressed
28 | * @return Whether the bind has been pressed
29 | */
30 | public boolean isPressed() {
31 |
32 | if (buttonCode <= 1 || mc.currentScreen != null) {
33 | return false;
34 | }
35 |
36 | // Our bind is pressed
37 | boolean pressed = device.equals(Device.KEYBOARD) && Keyboard.isKeyDown(buttonCode) || device.equals(Device.MOUSE) && Mouse.isButtonDown(buttonCode);
38 |
39 | if (pressed) {
40 |
41 | // We haven't already pressed the key
42 | if (!alreadyPressed) {
43 | alreadyPressed = true;
44 | return true;
45 | }
46 |
47 | else {
48 | return false;
49 | }
50 | }
51 |
52 | else {
53 | alreadyPressed = false;
54 | return false;
55 | }
56 | }
57 |
58 | public enum Device {
59 |
60 | /**
61 | * A key on the keyboard
62 | */
63 | KEYBOARD,
64 |
65 | /**
66 | * A mouse button
67 | */
68 | MOUSE
69 | }
70 |
71 | /**
72 | * Gets the button name for the GUI
73 | * @return The button name
74 | */
75 | public String getButtonName() {
76 |
77 | // Invalid button
78 | if (buttonCode < 1) {
79 | return "None";
80 | }
81 |
82 | else if (device.equals(Device.KEYBOARD)) {
83 | return Keyboard.getKeyName(buttonCode);
84 | }
85 |
86 | else if (device.equals(Device.MOUSE)) {
87 | return Mouse.getButtonName(buttonCode);
88 | }
89 |
90 | return "Unrecognized";
91 | }
92 |
93 | /**
94 | * Gets the button code
95 | * @return The button code
96 | */
97 | public int getButtonCode() {
98 | return buttonCode;
99 | }
100 |
101 | /**
102 | * Gets the input device
103 | * @return The input device
104 | */
105 | public Device getDevice() {
106 | return device;
107 | }
108 |
109 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/util/ColorUtil.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.util;
2 |
3 | import me.notkronos.meowhack.module.client.Colors;
4 |
5 | import java.awt.*;
6 |
7 | public class ColorUtil {
8 |
9 |
10 | public static int[] getPrimaryColor() {
11 | return new int[]{Colors.red.value, Colors.green.value, Colors.blue.value};
12 | }
13 |
14 | public static int decimalToHex(int red, int green, int blue) {
15 | String hexString;
16 | String redHex = red < 10 ? "0" + Integer.toHexString(red) : Integer.toHexString(red);
17 | String greenHex = blue < 10 ? "0" + Integer.toHexString(green) : Integer.toHexString(green);
18 | String blueHex = green < 10 ? "0" + Integer.toHexString(blue) : Integer.toHexString(blue);
19 | hexString = "0x" +
20 | redHex +
21 | greenHex +
22 | blueHex;
23 | return Integer.decode(hexString);
24 | }
25 |
26 | public static int addAlpha(int color, int alpha) {
27 | String hexString;
28 | String alphaHex = alpha < 10 ? "0" + Integer.toHexString(alpha) : Integer.toHexString(alpha);
29 | hexString = "0x" + alphaHex + Integer.toHexString(color);
30 | return Long.decode(hexString).intValue();
31 | }
32 |
33 | public Color hexToColor(int red, int green, int blue) {
34 | return new Color(red, green, blue);
35 | }
36 |
37 | public static int toRGBA(double r, double g, double b, double a) {
38 | return ColorUtil.toRGBA((float) r, (float) g, (float) b, (float) a);
39 | }
40 |
41 | public static int toRGBA(int r, int g, int b) {
42 | return ColorUtil.toRGBA(r, g, b, 255);
43 | }
44 |
45 | public static int toRGBA(int r, int g, int b, int a) {
46 | return (r << 16) + (g << 8) + b + (a << 24);
47 | }
48 | public static int toRGBA(float r, float g, float b, float a) {
49 | return ColorUtil.toRGBA((int) (r * 255.0f), (int) (g * 255.0f), (int) (b * 255.0f), (int) (a * 255.0f));
50 | }
51 | }
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/util/EnumUtil.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.util;
2 |
3 | public class EnumUtil {
4 |
5 | public static Enum> next(Enum> entry) {
6 | Enum>[] array = entry.getDeclaringClass().getEnumConstants();
7 | return array.length - 1 == entry.ordinal()
8 | ? array[0]
9 | : array[entry.ordinal() + 1];
10 | }
11 |
12 | public static Enum> previous(Enum> entry) {
13 | Enum>[] array = entry.getDeclaringClass().getEnumConstants();
14 | return entry.ordinal() - 1 < 0 ? array[array.length - 1] : array[entry.ordinal() - 1];
15 | }
16 |
17 | public static Enum> fromString(Enum> initial, String name)
18 | {
19 | Enum> e = fromString(initial.getDeclaringClass(), name);
20 | if (e != null)
21 | {
22 | return e;
23 | }
24 |
25 | return initial;
26 | }
27 |
28 | public static > T fromString(Class type, String name)
29 | {
30 | for (T constant : type.getEnumConstants())
31 | {
32 | if (constant.name().equalsIgnoreCase(name))
33 | {
34 | return constant;
35 | }
36 | }
37 |
38 | return null;
39 | }
40 |
41 | public static Enum> getEnumStartingWith(String prefix,
42 | Class extends Enum>> type)
43 | {
44 | if (prefix == null)
45 | {
46 | return null;
47 | }
48 |
49 | prefix = prefix.toLowerCase();
50 | Enum>[] array = type.getEnumConstants();
51 | for (Enum> entry : array)
52 | {
53 | if (entry.name().toLowerCase().startsWith(prefix))
54 | {
55 | return entry;
56 | }
57 | }
58 |
59 | return null;
60 | }
61 |
62 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/util/MathUtil.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.util;
2 |
3 | import java.math.BigDecimal;
4 | import java.math.RoundingMode;
5 | import java.util.Comparator;
6 | import java.util.LinkedHashMap;
7 | import java.util.LinkedList;
8 | import java.util.Map;
9 |
10 | /**
11 | * @author linustouchtips
12 | * @since 05/06/2021
13 | */
14 | public class MathUtil {
15 |
16 | /**
17 | * Rounds a double to the nearest decimal scale
18 | * @param number The double to round
19 | * @param scale The decimal points
20 | * @return The rounded double
21 | */
22 | public static double roundDouble(double number, int scale) {
23 | BigDecimal bigDecimal = new BigDecimal(number);
24 |
25 | // round
26 | bigDecimal = bigDecimal.setScale(scale, RoundingMode.HALF_UP);
27 | return bigDecimal.doubleValue();
28 | }
29 |
30 | /**
31 | * Rounds a float to the nearest decimal scale
32 | * @param number The float to round
33 | * @param scale The decimal points
34 | * @return The rounded float
35 | */
36 | public static float roundFloat(double number, int scale) {
37 | BigDecimal bigDecimal = BigDecimal.valueOf(number);
38 |
39 | // round
40 | bigDecimal = bigDecimal.setScale(scale, RoundingMode.FLOOR);
41 | return bigDecimal.floatValue();
42 | }
43 |
44 | /**
45 | * Takes a number to an exponent (around 6.96x faster than {@link Math} Math.pow())
46 | * @param num The number to take to an exponent
47 | * @param exponent The exponent
48 | * @return The number to an exponent
49 | */
50 | public static double toExponent(double num, int exponent) {
51 | double result = 1;
52 |
53 | // abs, inverse
54 | if (exponent < 0) {
55 | int exponentAbs = Math.abs(exponent);
56 |
57 | while (exponentAbs > 0) {
58 | if ((exponentAbs & 1) != 0) {
59 | result *= num;
60 | }
61 |
62 | exponentAbs >>= 1;
63 | num *= num;
64 | }
65 |
66 | return 1 / result;
67 | }
68 |
69 | else {
70 | while (exponent > 0) {
71 | if ((exponent & 1) != 0) { // 1.5% faster
72 | result *= num;
73 | }
74 |
75 | exponent >>= 1; // bitshift fuckery
76 | num *= num;
77 | }
78 |
79 | return result;
80 | }
81 | }
82 |
83 | public static > Map sortByValue(Map map, boolean descending) {
84 | LinkedList> list = new LinkedList>(map.entrySet());
85 | if (descending) {
86 | list.sort(Map.Entry.comparingByValue(Comparator.reverseOrder()));
87 | } else {
88 | list.sort(Map.Entry.comparingByValue());
89 | }
90 | LinkedHashMap result = new LinkedHashMap();
91 | for (Map.Entry entry : list) {
92 | result.put(entry.getKey(), entry.getValue());
93 | }
94 | return result;
95 | }
96 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/util/MotionUtil.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.util;
2 |
3 |
4 | public class MotionUtil implements Wrapper {
5 |
6 | public static double[] getMoveSpeed(double speed) {
7 | float forward = mc.player.movementInput.moveForward;
8 | float strafe = mc.player.movementInput.moveStrafe;
9 | float yaw = mc.player.rotationYaw;
10 |
11 | if (!isMoving()) {
12 | return new double[]{0, 0};
13 | } else if (forward != 0) {
14 | if (strafe >= 1) {
15 | yaw += (float) (forward > 0 ? -45 : 45);
16 | strafe = 0;
17 | } else if (strafe <= -1) {
18 | yaw += (float) (forward > 0 ? 45 : -45);
19 | strafe = 0;
20 | }
21 |
22 | if (forward > 0)
23 | forward = 1;
24 |
25 | else if (forward < 0)
26 | forward = -1;
27 | }
28 |
29 | double sin = Math.sin(Math.toRadians(yaw + 90));
30 | double cos = Math.cos(Math.toRadians(yaw + 90));
31 |
32 | double motionX = (double) forward * speed * cos + (double) strafe * speed * sin;
33 | double motionZ = (double) forward * speed * sin - (double) strafe * speed * cos;
34 |
35 | return new double[]{motionX, motionZ};
36 | }
37 |
38 | /**
39 | * Checks if the player is moving
40 | *
41 | * @return Whether the player is moving
42 | */
43 | public static boolean isMoving() {
44 | return mc.player.moveForward != 0 || mc.player.moveStrafing != 0;
45 | }
46 |
47 | /**
48 | * Checks if the player has moved in the last tick
49 | *
50 | * @return Whether the player has moved in the last tick
51 | */
52 | public static boolean hasMoved() {
53 | return StrictMath.pow(mc.player.motionX, 2) + StrictMath.pow(mc.player.motionY, 2) + StrictMath.pow(mc.player.motionZ, 2) >= 9.0E-4;
54 | }
55 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/util/Passable.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.util;
2 | public interface Passable
3 | {
4 | boolean passed(long delay);
5 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/util/Stopwatch.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.util;
2 |
3 | public class Stopwatch implements Passable
4 | {
5 | private volatile long time;
6 |
7 | public boolean passed(double ms)
8 | {
9 | return System.currentTimeMillis() - time >= ms;
10 | }
11 |
12 | @Override
13 | public boolean passed(long ms)
14 | {
15 | return System.currentTimeMillis() - time >= ms;
16 | }
17 |
18 | public Stopwatch reset()
19 | {
20 | time = System.currentTimeMillis();
21 | return this;
22 | }
23 |
24 | public long getTime()
25 | {
26 | return System.currentTimeMillis() - time;
27 | }
28 |
29 | public void setTime(long ns)
30 | {
31 | time = ns;
32 | }
33 |
34 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/util/Timer.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.util;
2 |
3 | public class Timer {
4 | private long time = -1L;
5 |
6 | public boolean passedS(double s) {
7 | return this.passedMs((long) s * 1000L);
8 | }
9 |
10 | public boolean passedDms(double dms) {
11 | return this.passedMs((long) dms * 10L);
12 | }
13 |
14 | public boolean passedDs(double ds) {
15 | return this.passedMs((long) ds * 100L);
16 | }
17 |
18 | public boolean passedMs(long ms) {
19 | return this.passedNS(this.convertToNS(ms));
20 | }
21 |
22 | public void setMs(long ms) {
23 | this.time = System.nanoTime() - this.convertToNS(ms);
24 | }
25 |
26 | public boolean passedNS(long ns) {
27 | return System.nanoTime() - this.time >= ns;
28 | }
29 |
30 | public long getPassedTimeMs() {
31 | return this.getMs(System.nanoTime() - this.time);
32 | }
33 |
34 | public Timer reset() {
35 | this.time = System.nanoTime();
36 | return this;
37 | }
38 |
39 | public long getMs(long time) {
40 | return time / 1000000L;
41 | }
42 |
43 | public long convertToNS(long time) {
44 | return time * 1000000L;
45 | }
46 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/util/Wrapper.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.util;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 | import net.minecraft.client.Minecraft;
5 |
6 | public interface Wrapper {
7 | Minecraft mc = Minecraft.getMinecraft();
8 | Meowhack meowhack = Meowhack.INSTANCE;
9 | default boolean nullCheck() {
10 | return mc.player != null && mc.world != null;
11 | }
12 | default Meowhack getMeowhack() {
13 | return Meowhack.INSTANCE;
14 | }
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/util/chat/ChatUtil.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.util.chat;
2 |
3 | import com.mojang.realmsclient.gui.ChatFormatting;
4 | import net.minecraft.util.text.TextComponentString;
5 |
6 | import java.util.concurrent.ThreadLocalRandom;
7 |
8 | import static me.notkronos.meowhack.util.Wrapper.mc;
9 |
10 | public class ChatUtil {
11 |
12 | public static void sendMessageClientSide(String in) {
13 | mc.ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(new TextComponentString(in), ThreadLocalRandom.current().nextInt(32767));
14 | }
15 |
16 | public static void commandFeedback(String message, MessageType type) {
17 | String finalMessage = ChatFormatting.RED + "[Meowhack] ";
18 | switch(type) {
19 | case ERROR:
20 | finalMessage += ChatFormatting.RED + message;
21 | break;
22 | case SUCCESS:
23 | finalMessage += ChatFormatting.GREEN + message;
24 | break;
25 | case INFO:
26 | finalMessage += ChatFormatting.RESET + message;
27 | }
28 | mc.ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(new TextComponentString(finalMessage), ThreadLocalRandom.current().nextInt(32767));
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/util/chat/MessageType.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.util.chat;
2 |
3 |
4 | public enum MessageType {
5 | ERROR,
6 | SUCCESS,
7 | INFO
8 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/util/file/FileSystemUtil.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.util.file;
2 |
3 | import me.notkronos.meowhack.Meowhack;
4 |
5 | import java.io.File;
6 | import java.nio.file.Path;
7 | import java.nio.file.Paths;
8 | import java.util.ArrayList;
9 |
10 | public class FileSystemUtil {
11 | private static ArrayList folders = new ArrayList<>();
12 | private static final Path MEOWHACK_PATH = Paths.get(System.getProperty("user.home"));
13 | private static final String FOLDER_STRING = MEOWHACK_PATH.toString() + "/Meowhack";
14 | public static final File MEOWHACK_FOLDER = new File(FOLDER_STRING);
15 |
16 | public static void createFileSystem() {
17 | if(!MEOWHACK_FOLDER.exists()) {
18 | MEOWHACK_FOLDER.mkdirs();
19 | Meowhack.LOGGER.info("[MEOWHACK] Created Meowhack folder");
20 | }
21 |
22 | folders.add(new File(MEOWHACK_FOLDER + "/config").toPath());
23 | folders.add(new File(MEOWHACK_FOLDER + "/font").toPath());
24 | folders.add(new File(MEOWHACK_FOLDER + "/friends").toPath());
25 | folders.add(new File(MEOWHACK_FOLDER + "/spammer").toPath());
26 | for(Path folder : folders) {
27 | if(!folder.toFile().exists()) {
28 | folder.toFile().mkdirs();
29 | }
30 | }
31 | Meowhack.LOGGER.info("[MEOWHACK] Created Meowhack files");
32 | }
33 |
34 | public static Path getConfigPath() {
35 | return Paths.get(FOLDER_STRING + "/config");
36 | }
37 | public static Path getDefaultConfigPath() {
38 | return Paths.get(getConfigPath().toString() + "/default.json");
39 | }
40 | public static Path getFontPath() {
41 | return Paths.get(FOLDER_STRING + "/font" + "/font.txt");
42 | }
43 | public static Path getFriendsPath() {
44 | return Paths.get(MEOWHACK_FOLDER + "/friends/" + "friends.txt");
45 | }
46 | public static Path getSpammerPath() {
47 | return Paths.get(FOLDER_STRING + "/spammer");
48 | }
49 |
50 | public static Path getSpammerFile(String filename) {
51 | return Paths.get(FOLDER_STRING + "/spammer/" + filename + ".txt");
52 | }
53 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/util/minecraft/BlockUtil.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.util.minecraft;
2 |
3 | import me.notkronos.meowhack.util.Wrapper;
4 | import net.minecraft.block.Block;
5 | import net.minecraft.entity.player.EntityPlayer;
6 | import net.minecraft.init.Blocks;
7 | import net.minecraft.util.math.AxisAlignedBB;
8 | import net.minecraft.util.math.BlockPos;
9 |
10 | import java.util.ArrayList;
11 | import java.util.Arrays;
12 | import java.util.List;
13 |
14 | public class BlockUtil implements Wrapper {
15 | public static final List resistantBlocks = Arrays.asList(
16 | Blocks.OBSIDIAN,
17 | Blocks.ANVIL,
18 | Blocks.ENCHANTING_TABLE,
19 | Blocks.ENDER_CHEST,
20 | Blocks.BEACON
21 | );
22 |
23 | public static final List unbreakableBlocks = Arrays.asList(
24 | Blocks.BEDROCK,
25 | Blocks.COMMAND_BLOCK,
26 | Blocks.CHAIN_COMMAND_BLOCK,
27 | Blocks.END_PORTAL_FRAME,
28 | Blocks.BARRIER,
29 | Blocks.PORTAL
30 | );
31 |
32 | public static boolean isBreakable(BlockPos position) {
33 | return !getResistance(position).equals(Resistance.UNBREAKABLE);
34 | }
35 |
36 | public static boolean isReplaceable(BlockPos pos) {
37 | return mc.world.getBlockState(pos).getMaterial().isReplaceable();
38 | }
39 |
40 | public static Resistance getResistance(BlockPos position) {
41 |
42 | Block block = mc.world.getBlockState(position).getBlock();
43 |
44 | if (resistantBlocks.contains(block)) {
45 | return Resistance.RESISTANT;
46 | }
47 |
48 | else if (unbreakableBlocks.contains(block)) {
49 | return Resistance.UNBREAKABLE;
50 | }
51 |
52 | else if (block.getDefaultState().getMaterial().isReplaceable()) {
53 | return Resistance.REPLACEABLE;
54 | }
55 |
56 | else {
57 | return Resistance.BREAKABLE;
58 | }
59 |
60 | }
61 |
62 | public static double getDistanceToCenter(EntityPlayer player, BlockPos in) {
63 |
64 | // distances
65 | double dX = in.getX() + 0.5 - player.posX;
66 | double dY = in.getY() + 0.5 - player.posY;
67 | double dZ = in.getZ() + 0.5 - player.posZ;
68 |
69 | // distance to center
70 | return StrictMath.sqrt((dX * dX) + (dY * dY) + (dZ * dZ));
71 | }
72 |
73 | public static List getBlocksInArea(EntityPlayer player, AxisAlignedBB area) {
74 | if (player != null) {
75 |
76 | List blocks = new ArrayList<>();
77 |
78 | for (double x = StrictMath.floor(area.minX); x <= StrictMath.ceil(area.maxX); x++) {
79 | for (double y = StrictMath.floor(area.minY); y <= StrictMath.ceil(area.maxY); y++) {
80 | for (double z = StrictMath.floor(area.minZ); z <= StrictMath.ceil(area.maxZ); z++) {
81 |
82 | BlockPos position = PlayerUtil.getPosition().add(x, y, z);
83 |
84 | if (getDistanceToCenter(player, position) >= area.maxX) {
85 | continue;
86 | }
87 |
88 | blocks.add(position);
89 | }
90 | }
91 | }
92 |
93 | return blocks;
94 | }
95 |
96 | return new ArrayList<>();
97 | }
98 |
99 | public enum Resistance {
100 | REPLACEABLE,
101 | BREAKABLE,
102 | RESISTANT,
103 | UNBREAKABLE,
104 | NONE
105 | }
106 | }
107 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/util/minecraft/PlayerUtil.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.util.minecraft;
2 |
3 | import me.notkronos.meowhack.util.Wrapper;
4 | import net.minecraft.util.math.BlockPos;
5 |
6 | public class PlayerUtil implements Wrapper {
7 | public static BlockPos getPosition() {
8 | return new BlockPos(mc.player.posX, mc.player.posY, mc.player.posZ);
9 | }
10 | }
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/util/render/FontUtil.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.util.render;
2 |
3 | import me.notkronos.meowhack.font.CustomFontRenderer;
4 | import me.notkronos.meowhack.module.client.CustomFontMod;
5 | import me.notkronos.meowhack.util.Wrapper;
6 | import net.minecraft.client.renderer.GlStateManager;
7 |
8 | import java.awt.*;
9 |
10 | public class FontUtil implements Wrapper {
11 | public static CustomFontRenderer customFont = new CustomFontRenderer(new Font("Verdana", 0, 14), true, true);
12 |
13 | public static float drawStringWithShadow(final String text, final double x, final double y, final int color) {
14 | if(CustomFontMod.INSTANCE.isEnabled()) {
15 | GlStateManager.enableBlend();
16 | customFont.drawStringWithShadow(text, x, y - CustomFontMod.fontOffset.getValue(), color);
17 | GlStateManager.disableBlend();
18 | } else {
19 | return mc.fontRenderer.drawStringWithShadow(text, (float) x, (float) y, color);
20 | }
21 | return 0;
22 | }
23 |
24 | public static float drawString(final String text, final float x, final float y, final int color) {
25 | if(CustomFontMod.INSTANCE.isEnabled()) {
26 | GlStateManager.enableBlend();
27 | customFont.drawString(text, x, y - CustomFontMod.fontOffset.getValue(), color);
28 | GlStateManager.disableBlend();
29 | } else {
30 | return mc.fontRenderer.drawString(text, (int)x, (int)y, color);
31 | }
32 | return 0;
33 | }
34 |
35 | public static float getFontHeight() {
36 | return mc.fontRenderer.FONT_HEIGHT;
37 | }
38 |
39 | public static int getStringWidth(final String text) {
40 | if (CustomFontMod.INSTANCE.isEnabled()) {
41 | return customFont.getStringWidth(text);
42 | }
43 | return mc.fontRenderer.getStringWidth(text);
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/util/rpc/IMAGE.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.util.rpc;
2 |
3 | public enum IMAGE {
4 | OG,
5 | CATGIRL
6 | }
7 |
--------------------------------------------------------------------------------
/src/main/java/me/notkronos/meowhack/util/string/FormatUtil.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.util.string;
2 |
3 | public class FormatUtil {
4 |
5 | public String capitalise(String string) {
6 | if(string.length() != 0) {
7 | return Character.toTitleCase(string.charAt(0)) + string.substring(1);
8 | }
9 | return "";
10 | }
11 |
12 | public static String formatEnum(Enum> in) {
13 | String enumName = in.name();
14 |
15 | if (!enumName.contains("_")) {
16 | char firstChar = enumName.charAt(0);
17 | String suffixChars = enumName.split(String.valueOf(firstChar), 2)[1];
18 | return String.valueOf(firstChar).toUpperCase() + suffixChars.toLowerCase();
19 | }
20 |
21 | String[] names = enumName.split("_");
22 | StringBuilder nameToReturn = new StringBuilder();
23 |
24 | for (String name : names) {
25 | char firstChar = name.charAt(0);
26 | String suffixChars = name.split(String.valueOf(firstChar), 2)[1];
27 | nameToReturn.append(String.valueOf(firstChar).toUpperCase()).append(suffixChars.toLowerCase());
28 | }
29 |
30 | return nameToReturn.toString();
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/resources/assets/meowhack/shaders/blur.json:
--------------------------------------------------------------------------------
1 | {
2 | "targets": [
3 | "swap"
4 | ],
5 | "passes": [
6 | {
7 | "name": "blur",
8 | "intarget": "minecraft:main",
9 | "outtarget": "swap",
10 | "uniforms": [
11 | {
12 | "name": "BlurDir",
13 | "values": [ 1.0, 0.0 ]
14 | },
15 | {
16 | "name": "Radius",
17 | "values": [ 20.0 ]
18 | }
19 | ]
20 | },
21 | {
22 | "name": "blur",
23 | "intarget": "swap",
24 | "outtarget": "minecraft:main",
25 | "uniforms": [
26 | {
27 | "name": "BlurDir",
28 | "values": [ 0.0, 1.0 ]
29 | },
30 | {
31 | "name": "Radius",
32 | "values": [ 20.0 ]
33 | }
34 | ]
35 | }
36 | ]
37 | }
--------------------------------------------------------------------------------
/src/main/resources/assets/meowhack/shaders/glow.fsh:
--------------------------------------------------------------------------------
1 | // #version 120
2 | #ifdef GL_ES
3 | precision mediump float;
4 | #endif
5 |
6 | uniform float time;
7 | uniform vec2 resolution;
8 |
9 | void main() {
10 |
11 | // Normalized pixel coordinates (from 0 to 1)
12 | vec2 uv = gl_FragCoord/resolution.xy;
13 |
14 | // Time varying pixel color
15 | vec3 col = 0.5 + 0.5*cos(time+uv.xyx+vec3(0,2,4));
16 |
17 | // Output to screen
18 | gl_FragColor = vec4(col,1.0);
19 |
20 | }
--------------------------------------------------------------------------------
/src/main/resources/assets/meowhack/shaders/item.fsh:
--------------------------------------------------------------------------------
1 | #version 120
2 |
3 | uniform sampler2D DiffuseSampler;
4 |
5 | void main() {
6 | float alpha = 1.0f;
7 | vec4 color = texture2D(DiffuseSampler, gl_FragCoord.xy);
8 | if (color.a < 1.0f) {
9 | alpha = 0.0f;
10 | }
11 | gl_FragColor = vec4(1, 1, 1, 1);
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/resources/assets/meowhack/shaders/passthrough.vsh:
--------------------------------------------------------------------------------
1 | #version 120
2 |
3 | void main() {
4 | gl_Position = gl_Vertex;
5 | }
--------------------------------------------------------------------------------
/src/main/resources/assets/minecraft/meowhack/shaders/frag/hgrad.frag:
--------------------------------------------------------------------------------
1 | //https://www.shadertoy.com/view/tdSBzK
2 | #version 120
3 |
4 | #ifdef GL_ES
5 | precision mediump float;
6 | #endif
7 |
8 | uniform sampler2D texture;
9 | uniform vec2 texelSize;
10 | uniform float radius;
11 | uniform float divider;
12 | uniform float maxSample;
13 | uniform float mixFactor;
14 | uniform float minAlpha;
15 | uniform vec3 firstGradientColor;
16 | uniform vec3 secondGradientColor;
17 | uniform float speed;
18 | uniform float stretch;
19 |
20 | uniform vec2 dimensions;
21 | uniform float time;
22 |
23 | float scrollAndStretch(float val, float st, float revolutionsPerSecond) {
24 | float s = revolutionsPerSecond * dimensions.x;
25 | return mod((val + s * time) * st, dimensions.x);
26 | }
27 |
28 | vec3 gradient(vec3 fCol, vec3 sCol, float x) {
29 | return mix(fCol, sCol, abs(1.0 - 2.0 * x / dimensions.x) * 0.35);
30 | }
31 |
32 | void main() {
33 | vec4 centerCol = texture2D(texture, gl_TexCoord[0].xy);
34 | vec3 finalColor = gradient(firstGradientColor, secondGradientColor, scrollAndStretch(gl_FragCoord.x, stretch, speed));
35 |
36 | if (centerCol.a != 0) {
37 | gl_FragColor = vec4(mix(centerCol.rgb, finalColor, mixFactor), centerCol.a);
38 | } else {
39 | float alpha = 0;
40 | for (float x = -radius; x < radius; x++) {
41 | for (float y = -radius; y < radius; y++) {
42 | vec4 currentColor = texture2D(texture, gl_TexCoord[0].xy + vec2(texelSize.x * x, texelSize.y * y));
43 |
44 | /*if (blur) {
45 | currentColor = blur13(texture, gl_TexCoord[0].xy + vec2(texelSize.x * x, texelSize.y * y), dimensions, vec2(3, 3));
46 | }*/
47 |
48 | if (currentColor.a != 0)
49 | alpha += divider > 0 ? max(0, (maxSample - distance(vec2(x, y), vec2(0))) / divider) : 1;
50 | alpha *= minAlpha;
51 | }
52 | }
53 | gl_FragColor = vec4(finalColor, alpha);
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/main/resources/assets/minecraft/meowhack/shaders/frag/itemglow.frag:
--------------------------------------------------------------------------------
1 | #version 120
2 |
3 | uniform sampler2D texture;
4 | uniform vec2 texelSize;
5 | uniform float radius;
6 | uniform float divider;
7 | uniform float maxSample;
8 | uniform float mixFactor;
9 | uniform float minAlpha;
10 | uniform vec3 firstGradientColor;
11 | uniform vec3 secondGradientColor;
12 | uniform float speed;
13 | uniform float stretch;
14 |
15 | uniform vec2 dimensions;
16 | uniform float time;
17 |
18 | void main() {
19 | vec4 centerCol = texture2D(texture, gl_TexCoord[0].xy);
20 |
21 | float alpha = 0;
22 |
23 | if (centerCol.a != 0) {
24 | gl_FragColor = vec4(mix(centerCol.rgb, firstGradientColor, mixFactor), centerCol.a);
25 | // gl_FragColor = vec4(centerCol.rgb, centerCol.a);
26 | } else {
27 | for (float x = -radius; x < radius; x++) {
28 | for (float y = -radius; y < radius; y++) {
29 | vec4 currentColor = texture2D(texture, gl_TexCoord[0].xy + vec2(texelSize.x * x, texelSize.y * y));
30 |
31 | /*if (blur) {
32 | currentColor = blur13(texture, gl_TexCoord[0].xy + vec2(texelSize.x * x, texelSize.y * y), dimensions, vec2(3, 3));
33 | }*/
34 |
35 | if (currentColor.a != 0)
36 | alpha += divider > 0 ? max(0, (maxSample - distance(vec2(x, y), vec2(0))) / divider) : 1;
37 | alpha *= minAlpha;
38 | }
39 | }
40 | gl_FragColor = vec4(secondGradientColor, alpha);
41 | }
42 | }
--------------------------------------------------------------------------------
/src/main/resources/assets/minecraft/meowhack/shaders/frag/rainbow.frag:
--------------------------------------------------------------------------------
1 | // #version 120
2 | #ifdef GL_ES
3 | precision mediump float;
4 | #endif
5 |
6 | uniform sampler2D texture;
7 | uniform vec2 texelSize;
8 |
9 | uniform float radius;
10 | uniform float divider;
11 | uniform float maxSample;
12 |
13 | uniform float time;
14 | uniform vec2 resolution;
15 |
16 | void main() {
17 | vec4 centerCol = texture2D(texture, gl_TexCoord[0].xy);
18 |
19 | vec2 uv = gl_FragCoord/resolution.xy;
20 | // Time varying pixel color
21 | vec3 color = 0.5 + 0.5*cos(time+uv.xyx+vec3(0,2,4));
22 |
23 | if(centerCol.a != 0) {
24 | gl_FragColor = vec4(centerCol.rgb, 0);
25 | } else {
26 |
27 | float alpha = 0;
28 |
29 | for (float x = -radius; x < radius; x++) {
30 | for (float y = -radius; y < radius; y++) {
31 | vec4 currentColor = texture2D(texture, gl_TexCoord[0].xy + vec2(texelSize.x * x, texelSize.y * y));
32 |
33 | if (currentColor.a != 0)
34 | alpha += divider > 0 ? max(0, (maxSample - distance(vec2(x, y), vec2(0))) / divider) : 1;
35 | }
36 | }
37 | gl_FragColor = vec4(color, alpha);
38 | }
39 | }
--------------------------------------------------------------------------------
/src/main/resources/assets/minecraft/meowhack/shaders/frag/vgrad.frag:
--------------------------------------------------------------------------------
1 | https://www.shadertoy.com/view/tdSBzK
2 | #version 120
3 |
4 | #ifdef GL_ES
5 | precision mediump float;
6 | #endif
7 |
8 | uniform sampler2D texture;
9 | uniform vec2 texelSize;
10 | uniform float radius;
11 | uniform float divider;
12 | uniform float maxSample;
13 | uniform float mixFactor;
14 | uniform float minAlpha;
15 | uniform vec3 firstGradientColor;
16 | uniform vec3 secondGradientColor;
17 | uniform float speed;
18 | uniform float stretch;
19 |
20 | uniform vec2 dimensions;
21 | uniform float time;
22 |
23 | float scrollAndStretch(float val, float st, float revolutionsPerSecond) {
24 | float s = revolutionsPerSecond * dimensions.x;
25 | return mod((val + s * time) * st, dimensions.x);
26 | }
27 |
28 | vec3 gradient(vec3 fCol, vec3 sCol, float x) {
29 | return mix(fCol, sCol, abs(1.0 - 2.0 * x / dimensions.x) * 0.35);
30 | }
31 |
32 | void main() {
33 | vec4 centerCol = texture2D(texture, gl_TexCoord[0].xy);
34 | vec3 finalColor = gradient(firstGradientColor, secondGradientColor, scrollAndStretch(gl_FragCoord.y, stretch, speed));
35 |
36 | if (centerCol.a != 0) {
37 | gl_FragColor = vec4(mix(centerCol.rgb, finalColor, mixFactor), centerCol.a);
38 | } else {
39 | float alpha = 0;
40 | for (float x = -radius; x < radius; x++) {
41 | for (float y = -radius; y < radius; y++) {
42 | vec4 currentColor = texture2D(texture, gl_TexCoord[0].xy + vec2(texelSize.x * x, texelSize.y * y));
43 |
44 | /*if (blur) {
45 | currentColor = blur13(texture, gl_TexCoord[0].xy + vec2(texelSize.x * x, texelSize.y * y), dimensions, vec2(3, 3));
46 | }*/
47 |
48 | if (currentColor.a != 0)
49 | alpha += divider > 0 ? max(0, (maxSample - distance(vec2(x, y), vec2(0))) / divider) : 1;
50 | alpha *= minAlpha;
51 | }
52 | }
53 | gl_FragColor = vec4(finalColor, alpha);
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/main/resources/assets/minecraft/meowhack/shaders/vert/chams.vert:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OutOfOpioids/meowhack/70863b2fba15702b17b8954b7c1ca3a193205190/src/main/resources/assets/minecraft/meowhack/shaders/vert/chams.vert
--------------------------------------------------------------------------------
/src/main/resources/assets/minecraft/meowhack/shaders/vertex.vert:
--------------------------------------------------------------------------------
1 | #version 120
2 |
3 | void main(void) {
4 | //Map gl_MultiTexCoord0 to index zero of gl_TexCoord
5 | gl_TexCoord[0] = gl_MultiTexCoord0;
6 |
7 | //Calculate position by multiplying model, view and projection matrix by the vertex vector
8 | gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
9 | }
--------------------------------------------------------------------------------
/src/main/resources/assets/minecraft/textures/rainbow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OutOfOpioids/meowhack/70863b2fba15702b17b8954b7c1ca3a193205190/src/main/resources/assets/minecraft/textures/rainbow.png
--------------------------------------------------------------------------------
/src/main/resources/mcmod.info:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "modid": "meowhack",
4 | "name": "Meowhack",
5 | "description": "Utility client for minecraft 1.12.2",
6 | "version": "1.5-beta",
7 | "mcversion": "1.12.2",
8 | "url": "https://github.com/notkronos/meowhack",
9 | "updateUrl": "",
10 | "authorList": [
11 | "C10H15NO#0001"
12 | ],
13 | "credits": "",
14 | "logoFile": "",
15 | "dependencies": []
16 | }
17 | ]
--------------------------------------------------------------------------------
/src/main/resources/mixins.meowhack.json:
--------------------------------------------------------------------------------
1 | {
2 | "required": true,
3 | "compatibilityLevel": "JAVA_8",
4 | "package": "me.notkronos.meowhack.mixin",
5 | "refmap": "mixins.meowhack.refmap.json",
6 | "mixins": [
7 | "mixins.accessor.ICPacketChatMessageAccessor",
8 | "mixins.accessor.ITextComponentStringAccessor",
9 | "mixins.entity.MixinEntityLivingBase",
10 | "mixins.entity.player.MixinAbstractClientPlayer",
11 | "mixins.network.MixinNetworkManager",
12 | "mixins.world.MixinWorld"
13 | ],
14 | "client": [
15 | "mixins.MixinMinecraft",
16 | "mixins.accessor.IMInecraftAccessor",
17 | "mixins.accessor.ITimerAccessor",
18 | "mixins.gui.MixinGuiBossOverlay",
19 | "mixins.render.MixinLayerArmorBase",
20 | "mixins.render.MixinParticleTotem",
21 | "mixins.render.entity.IEntityRenderer",
22 | "mixins.render.entity.MixinEntityRenderer",
23 | "mixins.render.entity.MixinRenderEnderCrystal",
24 | "mixins.render.entity.MixinRenderLivingBase",
25 | "mixins.render.entity.MixinRenderPlayer",
26 | "mixins.render.gui.MixinFontRenderer",
27 | "mixins.render.tileEntity.MixinTileEntityEnchantmentTableRenderer"
28 | ]
29 | }
--------------------------------------------------------------------------------
/src/main/resources/shaders/alpha.shader:
--------------------------------------------------------------------------------
1 | #shader vert
2 | #version 120
3 |
4 | void main(void) {
5 | gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
6 | gl_TexCoord[0] = gl_MultiTexCoord0;
7 | // pos = gl_Vertex.xyz;
8 | // normal = gl_Normal;
9 | }
10 |
11 | #shader frag
12 | // the lack of version definition is on purpose as I don't know what webgl version shadertoy uses
13 | // will fix later when i figure it out :P
14 | uniform sampler2D sampler;
15 |
16 | void main(void) {
17 | vec4 color = texture(sampler, gl_TexCoord[0].xy);
18 |
19 | if (color.a <= 0.1) {
20 | discard;
21 | }
22 |
23 | vec3 color1 = mix(color.rgb, vec3(1, 0, 0), 0.75);
24 | gl_FragColor = vec4(color1.r, color1.g, color1.b, 0.5);
25 | }
--------------------------------------------------------------------------------
/src/main/resources/shaders/armorimage.shader:
--------------------------------------------------------------------------------
1 | #shader vert
2 | #version 120
3 |
4 | void main(void) {
5 | gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
6 | gl_TexCoord[0] = gl_MultiTexCoord0;
7 | }
8 |
9 | #shader frag
10 | #version 130
11 |
12 | // uniform sampler2D sampler;
13 | uniform sampler2D overlaySampler;
14 | uniform sampler2D sampler;
15 | uniform float imageX;
16 | uniform float imageY;
17 | uniform float imageWidth;
18 | uniform float imageHeight;
19 | uniform float mixFactor;
20 | uniform vec4 inputColor;
21 |
22 | // uniform vec4 imageDimensions;
23 | // uniform vec2 dimensions;
24 |
25 | void main() {
26 | // vec2 coords1 = vec2(gl_FragCoord.x / imageDimensions.z, gl_FragCoord.y / imageDimensions.w);
27 | vec4 texColor = texture(sampler, gl_TexCoord[0].xy);
28 | if (texColor.a <= 0.1) {
29 | discard;
30 | }
31 | if (gl_FragCoord.x >= imageX && gl_FragCoord.y >= imageY) {
32 | vec2 coords = vec2(((gl_FragCoord.x - imageX) / imageWidth), ((gl_FragCoord.y - imageY) / imageHeight));
33 | vec4 color = mix(texColor, texture(overlaySampler, coords), mixFactor);
34 | color.xyz = mix(color.xyz, inputColor.xyz);
35 | color.a = inputColor.a;
36 | gl_FragColor = color;
37 | } else {
38 | gl_FragColor = vec4(1, 1, 1, 1);
39 | }
40 | /*if (gl_FragCoord.x >= floor(imageDimensions.x) && gl_FragCoord.y >= floor(imageDimensions.y)) {
41 | gl_FragColor = texture(overlaySampler, coords);
42 | } else {
43 | gl_FragColor = vec4(1, 1, 1, 1); // this won't get rendered anyway, just compiler bait :P
44 | }*/
45 |
46 |
47 | // gl_FragColor = texture(overlaySampler, vec2(gl_FragCoord.x / dimensions.x, gl_FragCoord.y / dimensions.y));
48 |
49 | }
--------------------------------------------------------------------------------
/src/main/resources/shaders/blur.shader:
--------------------------------------------------------------------------------
1 | #shader vert
2 | #version 120
3 |
4 | void main(void) {
5 | gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
6 | gl_TexCoord[0] = gl_MultiTexCoord0;
7 | }
8 |
9 | #shader frag
10 | #version 130
11 |
12 | // uniform sampler2D sampler;
13 | uniform sampler2D sampler;
14 | uniform vec2 dimensions;
15 |
16 | // uniform vec4 imageDimensions;
17 | // uniform vec2 dimensions;
18 |
19 | vec4 blur13(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) {
20 | vec4 color = vec4(0.0);
21 | vec2 off1 = vec2(1.411764705882353) * direction;
22 | vec2 off2 = vec2(3.2941176470588234) * direction;
23 | vec2 off3 = vec2(5.176470588235294) * direction;
24 | color += texture(image, uv) * 0.1964825501511404;
25 | color += texture(image, uv + (off1 / resolution)) * 0.2969069646728344;
26 | color += texture(image, uv - (off1 / resolution)) * 0.2969069646728344;
27 | color += texture(image, uv + (off2 / resolution)) * 0.09447039785044732;
28 | color += texture(image, uv - (off2 / resolution)) * 0.09447039785044732;
29 | color += texture(image, uv + (off3 / resolution)) * 0.010381362401148057;
30 | color += texture(image, uv - (off3 / resolution)) * 0.010381362401148057;
31 | return color;
32 | }
33 |
34 | void main() {
35 | // vec2 coords1 = vec2(gl_FragCoord.x / imageDimensions.z, gl_FragCoord.y / imageDimensions.w);
36 |
37 | gl_FragColor = blur13(sampler, gl_TexCoord[0].xy, dimensions, vec2(1, 0));
38 | /*if (gl_FragCoord.x >= floor(imageDimensions.x) && gl_FragCoord.y >= floor(imageDimensions.y)) {
39 | gl_FragColor = texture(overlaySampler, coords);
40 | } else {
41 | gl_FragColor = vec4(1, 1, 1, 1); // this won't get rendered anyway, just compiler bait :P
42 | }*/
43 |
44 |
45 | // gl_FragColor = texture(overlaySampler, vec2(gl_FragCoord.x / dimensions.x, gl_FragCoord.y / dimensions.y));
46 |
47 | }
--------------------------------------------------------------------------------
/src/main/resources/shaders/cape.shader:
--------------------------------------------------------------------------------
1 | #shader vert
2 | #version 330 compatibility
3 |
4 | out vec2 texCoord;
5 |
6 | void main() {
7 |
8 | }
9 |
10 | #shader frag
11 | #version 330 compatibility
12 |
13 | out vec4 FragColor;
14 |
15 | void main() {
16 | FragColor = vec4(1.0);
17 | }
--------------------------------------------------------------------------------
/src/main/resources/shaders/cool.shader:
--------------------------------------------------------------------------------
1 | #shader vert
2 | #version 120
3 |
4 | varying vec3 pos;
5 | varying vec3 normal;
6 | varying vec4 tex_coord;
7 |
8 | void main(void) {
9 | gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
10 | pos = gl_Vertex.xyz;
11 | normal = gl_Normal;
12 | tex_coord = gl_MultiTexCoord0;
13 | }
14 |
15 | #shader frag
16 | #version 120
17 |
18 | uniform vec3 viewPos;
19 | uniform sampler2D tex;
20 | uniform bool depth;
21 |
22 | varying vec3 pos;
23 | varying vec3 normal;
24 | varying vec4 tex_coord;
25 |
26 | void main(void) {
27 | vec3 actualPos = pos - viewPos;
28 |
29 | /*vec3 lightDir = vec3(0, 1, 0); // Upwards
30 | float specularStrength = 0.5;
31 | vec3 viewDir = normalize(viewPos - actualPos);
32 | vec3 reflectDir = reflect(-lightDir, normal);
33 | float spec = pow(max(dot(viewDir, reflectDir), 0.0), 32);
34 | vec3 specular = specularStrength * spec * vec3(1, 1, 1);
35 | gl_FragColor = vec4(specular * vec3(0.72, 0.72, 0.0), 1.0) * gl_Color;*/
36 | float distanceBrightness = abs(sin(actualPos.x)) * abs(sin(actualPos.z));
37 | float normalBrightness = normal.y * -0.2;
38 | vec4 texColor = texture2D(tex, tex_coord.st) * 0.04;
39 | texColor.a = 0.0;
40 |
41 | vec4 espColor;
42 | if (depth) {
43 | espColor = vec4(0.72 + normalBrightness + (distanceBrightness * 0.3), 0.72 + normalBrightness + (distanceBrightness * 0.3), 0.0, 1.0) * 0.5;
44 | } else {
45 | espColor = vec4(0.0, 0.72 + normalBrightness + (distanceBrightness * 0.3), 0.72 + normalBrightness + (distanceBrightness * 0.3), 1.0) * 0.5;
46 | }
47 | espColor.a = 1.0;
48 | gl_FragColor = espColor + texColor;
49 |
50 | // Apply brightness based on height
51 | float yBrightness = min(abs(pos.y) + 0.75, 1.0);
52 | gl_FragColor.r *= yBrightness;
53 | gl_FragColor.g *= yBrightness;
54 | gl_FragColor.b *= yBrightness;
55 | }
--------------------------------------------------------------------------------
/src/main/resources/shaders/default.shader:
--------------------------------------------------------------------------------
1 | #shader vert
2 | #version 120
3 |
4 | void main(void) {
5 | gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
6 | gl_TexCoord[0] = gl_MultiTexCoord0;
7 | }
8 |
9 | #shader frag
10 | #version 120
11 |
12 | void main(void) {
13 | gl_FragColor = vec4(1, 1, 1, 1);
14 | }
--------------------------------------------------------------------------------
/src/main/resources/shaders/framebufferimage.shader:
--------------------------------------------------------------------------------
1 | #shader vert
2 | #version 120
3 |
4 | void main(void) {
5 | //Map gl_MultiTexCoord0 to index zero of gl_TexCoord
6 | gl_TexCoord[0] = gl_MultiTexCoord0;
7 |
8 | //Calculate position by multiplying model, view and projection matrix by the vertex vector
9 | gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
10 | }
11 |
12 | #shader frag
13 | #version 120
14 |
15 | uniform sampler2D sampler;
16 | uniform sampler2D overlaySampler;
17 | uniform float mixFactor;
18 | uniform float colorMixFactor;
19 | uniform vec4 inputColor;
20 |
21 | void main(void) {
22 | vec4 framebufferColor = texture2D(sampler, gl_TexCoord[0].xy);
23 | if (framebufferColor.a > 0.0) {
24 | gl_FragColor = mix(framebufferColor, texture2D(overlaySampler, gl_TexCoord[0].xy), mixFactor);
25 | }
26 | }
--------------------------------------------------------------------------------
/src/main/resources/shaders/hgrad.shader:
--------------------------------------------------------------------------------
1 | #shader vert
2 | #version 120
3 |
4 | void main(void) {
5 | //Map gl_MultiTexCoord0 to index zero of gl_TexCoord
6 | gl_TexCoord[0] = gl_MultiTexCoord0;
7 |
8 | //Calculate position by multiplying model, view and projection matrix by the vertex vector
9 | gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
10 | }
11 |
12 | #shader frag
13 | #ifdef GL_ES
14 | precision mediump float;
15 | #endif
16 |
17 | uniform sampler2D texture;
18 | uniform vec2 texelSize;
19 | uniform float radius;
20 | uniform float divider;
21 | uniform float maxSample;
22 | uniform float mixFactor;
23 | uniform float minAlpha;
24 | uniform vec3 firstGradientColor;
25 | uniform vec3 secondGradientColor;
26 | uniform float speed;
27 | uniform float stretch;
28 |
29 | uniform vec2 dimensions;
30 | uniform float time;
31 |
32 | float scrollAndStretch(float val, float st, float revolutionsPerSecond) {
33 | float s = revolutionsPerSecond * dimensions.x;
34 | return mod((val + s * time) * st, dimensions.x);
35 | }
36 |
37 | vec3 gradient(vec3 fCol, vec3 sCol, float x) {
38 | return mix(fCol, sCol, abs(1.0 - 2.0 * x / dimensions.x) * 0.35);
39 | }
40 |
41 | void main() {
42 | vec4 centerCol = texture2D(texture, gl_TexCoord[0].xy);
43 | vec3 finalColor = gradient(firstGradientColor, secondGradientColor, scrollAndStretch(gl_FragCoord.x, stretch, speed));
44 |
45 | gl_FragColor = vec4(mix(centerCol.rgb, finalColor, mixFactor), centerCol.a);
46 | }
--------------------------------------------------------------------------------
/src/main/resources/shaders/image.shader:
--------------------------------------------------------------------------------
1 | #shader vert
2 | #version 130
3 |
4 | void main(void) {
5 | gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
6 | gl_TexCoord[0] = gl_MultiTexCoord0;
7 | }
8 |
9 | #shader frag
10 | #version 130
11 |
12 | // uniform sampler2D sampler;
13 | uniform sampler2D overlaySampler;
14 | uniform sampler2D sampler;
15 | uniform vec2 dimensions;
16 | uniform float imageX;
17 | uniform float imageY;
18 | uniform float imageWidth;
19 | uniform float imageHeight;
20 | uniform float mixFactor;
21 | uniform float colorMixFactor;
22 | uniform vec4 inputColor;
23 |
24 | // uniform vec4 imageDimensions;
25 | // uniform vec2 dimensions;
26 |
27 | // todo: broken
28 | vec4 blur13(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) {
29 | vec4 color = vec4(0.0);
30 | vec2 off1 = vec2(1.411764705882353) * direction;
31 | vec2 off2 = vec2(3.2941176470588234) * direction;
32 | vec2 off3 = vec2(5.176470588235294) * direction;
33 | color += texture(image, uv) * 0.1964825501511404;
34 | color += texture(image, uv + (off1 / resolution)) * 0.2969069646728344;
35 | color += texture(image, uv - (off1 / resolution)) * 0.2969069646728344;
36 | color += texture(image, uv + (off2 / resolution)) * 0.09447039785044732;
37 | color += texture(image, uv - (off2 / resolution)) * 0.09447039785044732;
38 | color += texture(image, uv + (off3 / resolution)) * 0.010381362401148057;
39 | color += texture(image, uv - (off3 / resolution)) * 0.010381362401148057;
40 | return color;
41 | }
42 |
43 | void main() {
44 | // vec2 coords1 = vec2(gl_FragCoord.x / imageDimensions.z, gl_FragCoord.y / imageDimensions.w);
45 | if (gl_FragCoord.x >= imageX && gl_FragCoord.y >= imageY && gl_FragCoord.x <= (imageX + imageWidth) && gl_FragCoord.y <= (imageY + imageHeight)) {
46 | vec2 coords = vec2(((gl_FragCoord.x - imageX) / imageWidth), ((gl_FragCoord.y - imageY) / imageHeight));
47 | vec4 blurColor = blur13(sampler, gl_TexCoord[0].xy / dimensions, dimensions, vec2(1, 0));
48 | vec4 blurOverlay = blur13(overlaySampler, gl_FragCoord.xy / dimensions, dimensions, vec2(1, 0));
49 | vec4 color = mix(texture(sampler, gl_TexCoord[0].xy), texture(overlaySampler, coords), mixFactor);
50 | vec4 finalColor = mix(blurColor, blurOverlay, mixFactor);
51 | color.xyz = mix(color.xyz, inputColor.xyz, colorMixFactor);
52 | finalColor.xyz = mix(finalColor.xyz, inputColor.xyz, colorMixFactor);
53 | color.a = inputColor.a;
54 | finalColor.a = inputColor.a;
55 | gl_FragColor = finalColor;
56 | } else {
57 | gl_FragColor = vec4(1, 1, 1, 1);
58 | }
59 | /*if (gl_FragCoord.x >= floor(imageDimensions.x) && gl_FragCoord.y >= floor(imageDimensions.y)) {
60 | gl_FragColor = texture(overlaySampler, coords);
61 | } else {
62 | gl_FragColor = vec4(1, 1, 1, 1); // this won't get rendered anyway, just compiler bait :P
63 | }*/
64 |
65 |
66 | // gl_FragColor = texture(overlaySampler, vec2(gl_FragCoord.x / dimensions.x, gl_FragCoord.y / dimensions.y));
67 |
68 | }
--------------------------------------------------------------------------------
/src/main/resources/shaders/item.shader:
--------------------------------------------------------------------------------
1 | #shader vert
2 | #version 120
3 |
4 | void main(void) {
5 | //Map gl_MultiTexCoord0 to index zero of gl_TexCoord
6 | gl_TexCoord[0] = gl_MultiTexCoord0;
7 |
8 | //Calculate position by multiplying model, view and projection matrix by the vertex vector
9 | gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
10 | }
11 |
12 | #shader frag
13 | #version 120
14 |
15 | uniform sampler2D texture;
16 | uniform vec2 texelSize;
17 |
18 | uniform vec3 color;
19 |
20 | uniform float radius;
21 | uniform float divider;
22 | uniform float maxSample;
23 | uniform float mixFactor;
24 | uniform float minAlpha;
25 |
26 | uniform vec2 dimensions;
27 |
28 | uniform bool blur;
29 |
30 | uniform sampler2D image;
31 | uniform float imageMix;
32 | uniform bool useImage;
33 |
34 | vec4 blur13(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) {
35 | vec4 color = vec4(0.0);
36 | vec2 off1 = vec2(1.411764705882353) * direction;
37 | vec2 off2 = vec2(3.2941176470588234) * direction;
38 | vec2 off3 = vec2(5.176470588235294) * direction;
39 | if (texture2D(image, uv + (off1 / resolution)).a == 0
40 | || texture2D(image, uv + (off2 / resolution)).a == 0
41 | || texture2D(image, uv + (off3 / resolution)).a == 0) {
42 | return texture2D(image, uv);
43 | }
44 | color += texture2D(image, uv) * 0.1964825501511404;
45 | color += texture2D(image, uv + (off1 / resolution)) * 0.2969069646728344;
46 | color += texture2D(image, uv - (off1 / resolution)) * 0.2969069646728344;
47 | color += texture2D(image, uv + (off2 / resolution)) * 0.09447039785044732;
48 | color += texture2D(image, uv - (off2 / resolution)) * 0.09447039785044732;
49 | color += texture2D(image, uv + (off3 / resolution)) * 0.010381362401148057;
50 | color += texture2D(image, uv - (off3 / resolution)) * 0.010381362401148057;
51 | return color;
52 | }
53 |
54 | void main() {
55 | vec4 centerCol = texture2D(texture, gl_TexCoord[0].xy);
56 |
57 | if (blur) {
58 | if (centerCol.a != 0) {
59 | centerCol = blur13(texture, gl_TexCoord[0].xy, dimensions, vec2(2, 2));
60 | }
61 | }
62 |
63 | if (useImage) {
64 | if (centerCol.a != 0) {
65 | centerCol = mix(centerCol, texture2D(image, gl_TexCoord[0].xy), imageMix);
66 | }
67 | }
68 |
69 | float alpha = 0;
70 |
71 | if (centerCol.a != 0) {
72 | gl_FragColor = vec4(mix(centerCol.rgb, color, mixFactor), centerCol.a);
73 | // gl_FragColor = vec4(centerCol.rgb, centerCol.a);
74 | } else {
75 | for (float x = -radius; x < radius; x++) {
76 | for (float y = -radius; y < radius; y++) {
77 | vec4 currentColor = texture2D(texture, gl_TexCoord[0].xy + vec2(texelSize.x * x, texelSize.y * y));
78 |
79 | /*if (blur) {
80 | currentColor = blur13(texture, gl_TexCoord[0].xy + vec2(texelSize.x * x, texelSize.y * y), dimensions, vec2(3, 3));
81 | }*/
82 |
83 | if (currentColor.a != 0)
84 | alpha += divider > 0 ? max(0, (maxSample - distance(vec2(x, y), vec2(0))) / divider) : 1;
85 | alpha *= minAlpha;
86 | }
87 | }
88 | gl_FragColor = vec4(color, alpha);
89 | }
90 | }
--------------------------------------------------------------------------------
/src/main/resources/shaders/model.shader:
--------------------------------------------------------------------------------
1 | #shader vert
2 | #version 130
3 |
4 | void main(void) {
5 | gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
6 | gl_TexCoord[0] = gl_MultiTexCoord0;
7 | }
8 |
9 | #shader frag
10 | #version 130
11 |
12 | uniform sampler2D sampler;
13 |
14 | void main() {
15 | gl_FragColor = texture(sampler, gl_TexCoord[0].xy);
16 | }
--------------------------------------------------------------------------------
/src/main/resources/shaders/modelrender.shader:
--------------------------------------------------------------------------------
1 | #shader vert
2 | #version 330 compatibility
3 | layout (location = 0) in vec3 pos;
4 | layout (location = 1) in vec3 normal;
5 | layout (location = 2) in vec2 tex;
6 | layout (location = 3) in ivec4 bones;
7 | layout (location = 4) in vec4 weights;
8 |
9 | // uniform mat4 model;
10 | // uniform mat4 projection;
11 |
12 | const int MAX_BONES = 100;
13 | const int MAX_BONE_INFLUENCE = 4;
14 |
15 | uniform mat4 finalBonesMatrices[100];
16 |
17 | out vec2 texCoord;
18 |
19 | void main()
20 | {
21 | vec4 totalPosition = vec4(0.0f);
22 | for(int i = 0 ; i < MAX_BONE_INFLUENCE ; i++)
23 | {
24 | if(bones[i] == -1) {
25 | continue;
26 | }
27 | if(bones[i] >= MAX_BONES) {
28 | totalPosition = vec4(pos, 1.0f);
29 | break;
30 | }
31 | vec4 localPosition = finalBonesMatrices[bones[i]] * vec4(pos, 1.0f);
32 | totalPosition += localPosition * weights[i];
33 | vec3 localNormal = mat3(finalBonesMatrices[bones[i]]) * normal;
34 | }
35 | // gl_Position = projection * model * vec4(pos, 1.0);
36 | gl_Position = gl_ModelViewProjectionMatrix * totalPosition;
37 | // gl_Position = gl_ModelViewProjectionMatrix * vec4(pos, 1.0);
38 | texCoord = tex;
39 | }
40 |
41 | #shader frag
42 | #version 330 compatibility
43 |
44 | out vec4 FragColor;
45 |
46 | in vec2 texCoord;
47 |
48 | uniform sampler2D sampler;
49 |
50 | void main()
51 | {
52 | FragColor = texture(sampler, texCoord);
53 | }
--------------------------------------------------------------------------------
/src/main/resources/shaders/modelrenderboneless.shader:
--------------------------------------------------------------------------------
1 | #shader vert
2 | #version 330 compatibility
3 | layout (location = 0) in vec3 pos;
4 | layout (location = 1) in vec3 normal;
5 | layout (location = 2) in vec2 tex;
6 |
7 | out vec2 texCoord;
8 |
9 | void main()
10 | {
11 | gl_Position = gl_ModelViewProjectionMatrix * vec4(pos, 1.0);
12 | texCoord = tex;
13 | }
14 |
15 | #shader frag
16 | #version 330 compatibility
17 |
18 | out vec4 FragColor;
19 |
20 | in vec2 texCoord;
21 |
22 | uniform sampler2D sampler;
23 |
24 | void main()
25 | {
26 | FragColor = texture(sampler, texCoord);
27 | }
--------------------------------------------------------------------------------
/src/main/resources/shaders/newimage.shader:
--------------------------------------------------------------------------------
1 | #shader vert
2 | #version 130
3 |
4 | void main(void) {
5 | gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
6 | gl_TexCoord[0] = gl_MultiTexCoord0;
7 | }
8 |
9 | #shader frag
10 | #version 130
11 |
12 | uniform sampler2D overlaySampler;
13 | uniform sampler2D sampler;
14 | uniform vec2 dimensions;
15 | uniform float imageX;
16 | uniform float imageY;
17 | uniform float imageWidth;
18 | uniform float imageHeight;
19 | uniform float mixFactor;
20 | uniform float colorMixFactor;
21 | uniform vec4 inputColor;
22 | uniform bool fill;
23 |
24 | void main() {
25 | // vec2 coords1 = vec2(gl_FragCoord.x / imageDimensions.z, gl_FragCoord.y / imageDimensions.w);
26 | if (gl_FragCoord.x >= imageX && gl_FragCoord.y >= imageY && gl_FragCoord.x <= (imageX + imageWidth) && gl_FragCoord.y <= (imageY + imageHeight)) {
27 | vec2 coords = vec2(((gl_FragCoord.x - imageX) / imageWidth), ((gl_FragCoord.y - imageY) / imageHeight));
28 |
29 | /*vec4 blurColor = blur13(sampler, gl_TexCoord[0].xy / dimensions, dimensions, vec2(1, 0));
30 | vec4 blurOverlay = blur13(overlaySampler, gl_FragCoord.xy / dimensions, dimensions, vec2(1, 0));*/
31 |
32 | vec4 texColor = texture(sampler, gl_TexCoord[0].xy);
33 | vec4 overlayColor = texture(overlaySampler, coords);
34 |
35 | vec4 color = mix(texture(sampler, gl_TexCoord[0].xy), texture(overlaySampler, coords), mixFactor);
36 | // vec4 finalColor = mix(blurColor, blurOverlay, mixFactor);
37 | color.xyz = mix(color.xyz, inputColor.xyz, colorMixFactor);
38 | // finalColor.xyz = mix(finalColor.xyz, inputColor.xyz, colorMixFactor);
39 | color.a = inputColor.a;
40 | // finalColor.a = inputColor.a;
41 | if (texColor.a == 0.0 && !fill) color.a = 0.0;
42 | gl_FragColor = color;
43 | } else {
44 | gl_FragColor = vec4(1, 1, 1, 1);
45 | }
46 | }
--------------------------------------------------------------------------------
/src/main/resources/shaders/outlineglow.shader:
--------------------------------------------------------------------------------
1 | #shader vert
2 | #version 120
3 |
4 | void main(void) {
5 | gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
6 | gl_TexCoord[0] = gl_MultiTexCoord0;
7 | }
8 |
9 | #shader frag
10 | #version 120
11 |
12 | uniform sampler2D sampler;
13 | uniform vec2 dimensions;
14 | uniform vec2 center;
15 | uniform vec4 color;
16 |
17 | float dist(vec2 vector1, vec2 vector2) {
18 | return sqrt(((vector1.x - vector2.x) * (vector1.x - vector2.x)) + ((vector1.y - vector2.y) * (vector1.y - vector2.y)));
19 | }
20 |
21 | /*float closer(vec2 value, float x, float y) {
22 | const float x1 = value.x - (x / 2.0);
23 | const float x2 = value.x + (x / 2.0);
24 |
25 | const float y1 = value.y - (y / 2.0);
26 | const float y2 = value.y + (y / 2.0);
27 |
28 | const float distX1 = dist(value, vec2(x1, value.y));
29 | const float distX2 = dist(value, vec2(x2, value.y));
30 |
31 | const float distY1 = dist(value, vec2(value.x, y1));
32 | const float distY2 = dist(value, vec2(value.x, y2));
33 |
34 | return 0.0; // placeholder
35 | }*/
36 |
37 | void main() {
38 | float factor = dist(vec2(gl_FragCoord.x, gl_FragCoord.y), vec2(center.x + (dimensions.x / 2.0), center.y + (dimensions.y / 2.0))) / dist(center, vec2(center.x + (dimensions.x / 2.0), center.y + (dimensions.y / 2.0)));
39 | gl_FragColor = mix(vec4(0, 0, 0, 1), vec4(color.x, color.y, color.z, 1), factor);
40 | }
--------------------------------------------------------------------------------
/src/main/resources/shaders/stencil.shader:
--------------------------------------------------------------------------------
1 | #shader vert
2 | #version 130
3 |
4 | void main(void) {
5 | //Map gl_MultiTexCoord0 to index zero of gl_TexCoord
6 | gl_TexCoord[0] = gl_MultiTexCoord0;
7 |
8 | //Calculate position by multiplying model, view and projection matrix by the vertex vector
9 | gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
10 | }
11 |
12 | #shader frag
13 | #version 130
14 |
15 | uniform sampler2D sampler;
16 | uniform sampler2D overlaySampler;
17 | uniform usampler2D stencilSampler;
18 | uniform float mixFactor;
19 | uniform float colorMixFactor;
20 | uniform vec4 inputColor;
21 | uniform vec2 dimensions;
22 |
23 | void main(void) {
24 | vec4 framebufferColor = texture2D(sampler, gl_TexCoord[0].xy);
25 | uvec4 stencil = texture(stencilSampler, vec2(gl_FragCoord.x / dimensions.x, gl_FragCoord.y / dimensions.y));
26 | int stencilNew = int(stencil.r);
27 | int stencilNew1 = int(stencil.g);
28 | int stencilNew2 = int(stencil.b);
29 | int stencilNew3 = int(stencil.a);
30 | if (framebufferColor.a > 0.0) {
31 | gl_FragColor = mix(framebufferColor, texture2D(overlaySampler, gl_TexCoord[0].xy), mixFactor);
32 | }
33 | }
--------------------------------------------------------------------------------
/src/main/resources/shaders/testing.shader:
--------------------------------------------------------------------------------
1 | #shader vert
2 | #version 120
3 |
4 | void main(void) {
5 | //Map gl_MultiTexCoord0 to index zero of gl_TexCoord
6 | gl_TexCoord[0] = gl_MultiTexCoord0;
7 |
8 | //Calculate position by multiplying model, view and projection matrix by the vertex vector
9 | gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
10 | }
11 |
12 | #shader frag
13 | #version 120
14 |
15 | uniform sampler2D sampler;
16 |
17 | void main(void) {
18 | vec4 centerColor = texture2D(sampler, gl_TexCoord[0].xy);
19 | if (centerColor.a != 0.0) {
20 | gl_FragColor = vec4(centerColor.rgb, 0);
21 | } else {
22 | gl_FragColor = vec4(1, 1, 1, 1);
23 | }
24 | }
--------------------------------------------------------------------------------
/src/main/resources/shaders/vgrad.shader:
--------------------------------------------------------------------------------
1 | #shader vert
2 | #version 120
3 |
4 | void main(void) {
5 | //Map gl_MultiTexCoord0 to index zero of gl_TexCoord
6 | gl_TexCoord[0] = gl_MultiTexCoord0;
7 |
8 | //Calculate position by multiplying model, view and projection matrix by the vertex vector
9 | gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
10 | }
11 |
12 | #shader frag
13 | #ifdef GL_ES
14 | precision mediump float;
15 | #endif
16 |
17 | uniform sampler2D texture;
18 | uniform vec2 texelSize;
19 | uniform float radius;
20 | uniform float divider;
21 | uniform float maxSample;
22 | uniform float mixFactor;
23 | uniform float minAlpha;
24 | uniform vec3 firstGradientColor;
25 | uniform vec3 secondGradientColor;
26 | uniform float speed;
27 | uniform float stretch;
28 |
29 | uniform vec2 dimensions;
30 | uniform float time;
31 |
32 | float scrollAndStretch(float val, float st, float revolutionsPerSecond) {
33 | float s = revolutionsPerSecond * dimensions.x;
34 | return mod((val + s * time) * st, dimensions.x);
35 | }
36 |
37 | vec3 gradient(vec3 fCol, vec3 sCol, float x) {
38 | return mix(fCol, sCol, abs(1.0 - 2.0 * x / dimensions.x) * 0.35);
39 | }
40 |
41 | void main() {
42 | vec4 centerCol = texture2D(texture, gl_TexCoord[0].xy);
43 | vec3 finalColor = gradient(firstGradientColor, secondGradientColor, scrollAndStretch(gl_FragCoord.y, stretch, speed));
44 | gl_FragColor = vec4(mix(centerCol.rgb, finalColor, mixFactor), centerCol.a);
45 | }
--------------------------------------------------------------------------------
/src/main/resources/shaders/water.shader:
--------------------------------------------------------------------------------
1 | #shader vert
2 | #version 120
3 |
4 | varying vec3 pos;
5 | varying vec3 normal;
6 | varying vec4 tex_coord;
7 |
8 | void main(void) {
9 | gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
10 | pos = gl_Vertex.xyz;
11 | normal = gl_Normal;
12 | tex_coord = gl_MultiTexCoord0;
13 | }
14 |
15 | #shader frag
16 | uniform sampler2D texture;
17 | // uniform vec2 texelSize;
18 |
19 | uniform float time;
20 | uniform vec2 resolution;
21 | uniform float alpha;
22 |
23 | varying vec3 pos;
24 | varying vec3 normal;
25 | varying vec4 tex_coord;
26 |
27 | // Found this on GLSL sandbox. I really liked it, changed a few things and made it tileable.
28 | // :)
29 | // by David Hoskins.
30 |
31 |
32 | // Water turbulence effect by joltz0r 2013-07-04, improved 2013-07-07
33 |
34 |
35 | // Redefine below to see the tiling...
36 | #define SHOW_TILING
37 |
38 | #define TAU 6.28318530718
39 | #define MAX_ITER 5
40 |
41 | void main()
42 | {
43 | float time1 = time * .5+23.0;
44 | // uv should be the 0-1 uv of texture...
45 | vec2 uv = gl_FragCoord.xy / resolution.xy;
46 |
47 | #ifdef SHOW_TILING
48 | vec2 p = mod(uv*TAU*2.0, TAU)-250.0;
49 | #else
50 | vec2 p = mod(uv*TAU, TAU)-250.0;
51 | #endif
52 | vec2 i = vec2(p);
53 | float c = 1.0;
54 | float inten = .005;
55 |
56 | for (int n = 0; n < MAX_ITER; n++)
57 | {
58 | float t = time1 * (1.0 - (3.5 / float(n+1)));
59 | i = p + vec2(cos(t - i.x) + sin(t + i.y), sin(t - i.y) + cos(t + i.x));
60 | c += 1.0/length(vec2(p.x / (sin(i.x+t)/inten),p.y / (cos(i.y+t)/inten)));
61 | }
62 | c /= float(MAX_ITER);
63 | c = 1.17-pow(c, 1.4);
64 | vec3 colour = vec3(pow(abs(c), 8.0));
65 | colour = clamp(colour + vec3(0.0, 0.35, 0.5), 0.0, 1.0);
66 |
67 | gl_FragColor = vec4(colour, alpha);
68 | }
--------------------------------------------------------------------------------
/src/test/java/me/notkronos/meowhack/util/ColorUtilTest.java:
--------------------------------------------------------------------------------
1 | package me.notkronos.meowhack.util;
2 |
3 | import org.junit.jupiter.api.Assertions;
4 | import org.junit.jupiter.api.Test;
5 |
6 | import static org.junit.jupiter.api.Assertions.*;
7 |
8 | class ColorUtilTest {
9 | @Test
10 | void addAlphaTest() {
11 | Assertions.assertEquals(ColorUtil.addAlpha(0xffffff, 0xff), Long.decode("0xffffffff").intValue());
12 | Assertions.assertEquals(ColorUtil.addAlpha(0xffffff, 0x00), Long.decode("0x00ffffff").intValue());
13 | Assertions.assertEquals(ColorUtil.addAlpha(0xffffff, 255), Long.decode("0xffffffff").intValue());
14 | }
15 | }
--------------------------------------------------------------------------------