├── src └── main │ ├── resources │ ├── kami.png │ ├── installer │ │ ├── 00.jpg │ │ ├── 01.jpg │ │ ├── 02.jpg │ │ ├── 03.jpg │ │ ├── beta.png │ │ ├── kami.png │ │ ├── bread.png │ │ ├── loading.gif │ │ ├── stable.png │ │ └── rawimagefiles │ │ │ ├── 00.png │ │ │ ├── 01.png │ │ │ ├── 02.png │ │ │ ├── 03.png │ │ │ ├── world.png │ │ │ ├── castle.png │ │ │ ├── parlor.png │ │ │ ├── loPolyIsland.png │ │ │ └── README.txt │ ├── assets │ │ ├── minecraft │ │ │ ├── kamiblue │ │ │ │ ├── kamimap.png │ │ │ │ ├── kami_icon.png │ │ │ │ └── textures │ │ │ │ │ ├── capes │ │ │ │ │ ├── border.png │ │ │ │ │ ├── text.png │ │ │ │ │ ├── primary.png │ │ │ │ │ └── text_icon.png │ │ │ │ │ └── hungeroverlay.png │ │ │ └── shaders │ │ │ │ ├── program │ │ │ │ ├── kawase_blur.fsh │ │ │ │ ├── grainy_blur.vsh │ │ │ │ ├── grainy_blur.fsh │ │ │ │ ├── kawase_blur.json │ │ │ │ ├── kawase_blur.vsh │ │ │ │ ├── grainy_blur.json │ │ │ │ ├── esp_outline.json │ │ │ │ └── esp_outline.fsh │ │ │ │ └── post │ │ │ │ └── grainy_blur.json │ │ └── kamiblue │ │ │ ├── fonts │ │ │ └── Lato │ │ │ │ ├── Lato-Bold.ttf │ │ │ │ ├── Lato-Italic.ttf │ │ │ │ └── Lato-Regular.ttf │ │ │ ├── textures │ │ │ └── blocks │ │ │ │ └── kami_xray_transparent.png │ │ │ ├── models │ │ │ └── block │ │ │ │ └── kami_xray_transparent.json │ │ │ └── blockstates │ │ │ └── kami_xray_transparent.json │ └── mcmod.info │ ├── kotlin │ └── org │ │ └── kamiblue │ │ └── client │ │ ├── util │ │ ├── math │ │ │ ├── Vec3f.kt │ │ │ └── CoordinateConverter.kt │ │ ├── TaskState.kt │ │ ├── TimedFlag.kt │ │ ├── Quad.kt │ │ ├── world │ │ │ ├── PlaceInfo.kt │ │ │ └── Block.kt │ │ ├── graphics │ │ │ ├── font │ │ │ │ ├── CharInfo.kt │ │ │ │ ├── Style.kt │ │ │ │ ├── Alignment.kt │ │ │ │ └── GlyphChunk.kt │ │ │ └── texture │ │ │ │ └── AbstractTexture.kt │ │ ├── text │ │ │ ├── RomanNumerals.kt │ │ │ ├── TextFormatting.kt │ │ │ └── Detectors.kt │ │ ├── threads │ │ │ ├── BackgroundJob.kt │ │ │ └── CoroutineUtils.kt │ │ ├── TimeoutFlag.kt │ │ ├── color │ │ │ ├── ColorConverter.kt │ │ │ ├── EnumTextColor.kt │ │ │ ├── DyeColors.kt │ │ │ └── ColorGradient.kt │ │ ├── Wrapper.kt │ │ ├── InfoCalculator.kt │ │ ├── TimerUtils.kt │ │ ├── WebUtils.kt │ │ └── TpsCalculator.kt │ │ ├── setting │ │ ├── GenericConfigClass.kt │ │ ├── GenericConfig.kt │ │ ├── settings │ │ │ ├── impl │ │ │ │ ├── other │ │ │ │ │ └── ColorSetting.kt │ │ │ │ ├── primitive │ │ │ │ │ ├── BooleanSetting.kt │ │ │ │ │ ├── StringSetting.kt │ │ │ │ │ └── EnumSetting.kt │ │ │ │ ├── number │ │ │ │ │ ├── NumberSetting.kt │ │ │ │ │ ├── IntegerSetting.kt │ │ │ │ │ ├── DoubleSetting.kt │ │ │ │ │ └── FloatSetting.kt │ │ │ │ └── collection │ │ │ │ │ └── MapSetting.kt │ │ │ └── ImmutableSetting.kt │ │ ├── configs │ │ │ ├── IConfig.kt │ │ │ └── NameableConfig.kt │ │ ├── ModuleConfig.kt │ │ └── GuiConfig.kt │ │ ├── manager │ │ ├── Manager.kt │ │ ├── managers │ │ │ ├── NetworkManager.kt │ │ │ └── UUIDManager.kt │ │ └── ManagerLoader.kt │ │ ├── event │ │ ├── events │ │ │ ├── BaritoneCommandEvent.kt │ │ │ ├── ResolutionUpdateEvent.kt │ │ │ ├── ConnectionEvent.kt │ │ │ ├── BlockBreakEvent.kt │ │ │ ├── ModuleToggleEvent.kt │ │ │ ├── PlayerAttackEvent.kt │ │ │ ├── ShutdownEvent.kt │ │ │ ├── RenderOverlayEvent.kt │ │ │ ├── RenderRadarEvent.kt │ │ │ ├── GuiEvent.kt │ │ │ ├── WaypointUpdateEvent.kt │ │ │ ├── BaritoneSettingsInitEvent.kt │ │ │ ├── PlayerTravelEvent.kt │ │ │ ├── RunGameLoopEvent.kt │ │ │ ├── PacketEvent.kt │ │ │ ├── RenderWorldEvent.kt │ │ │ ├── RenderEntityEvent.kt │ │ │ └── PlayerMoveEvent.kt │ │ └── KamiEvents.kt │ │ ├── plugin │ │ └── api │ │ │ ├── IPluginClass.kt │ │ │ ├── PluginHudElement.kt │ │ │ └── PluginModule.kt │ │ ├── module │ │ ├── modules │ │ │ ├── render │ │ │ │ ├── AntiFog.kt │ │ │ │ ├── CleanGUI.kt │ │ │ │ ├── CameraClip.kt │ │ │ │ ├── ExtraTab.kt │ │ │ │ ├── TabFriends.kt │ │ │ │ └── Xray.kt │ │ │ ├── player │ │ │ │ ├── TpsSync.kt │ │ │ │ ├── XCarry.kt │ │ │ │ ├── NoPacketKick.kt │ │ │ │ ├── AntiForceLook.kt │ │ │ │ ├── NoSwing.kt │ │ │ │ ├── Timer.kt │ │ │ │ └── PortalGodMode.kt │ │ │ ├── misc │ │ │ │ ├── FakeVanillaClient.kt │ │ │ │ ├── AntiDisconnect.kt │ │ │ │ ├── AntiWeather.kt │ │ │ │ ├── MountBypass.kt │ │ │ │ ├── NoSoundLag.kt │ │ │ │ ├── ConsoleSpam.kt │ │ │ │ ├── PingSpoof.kt │ │ │ │ ├── BeaconSelector.kt │ │ │ │ └── FakeGameMode.kt │ │ │ ├── client │ │ │ │ ├── Tooltips.kt │ │ │ │ ├── ChatSetting.kt │ │ │ │ ├── Hud.kt │ │ │ │ ├── HudEditor.kt │ │ │ │ └── GuiColors.kt │ │ │ ├── chat │ │ │ │ ├── PortalChat.kt │ │ │ │ └── FormatChat.kt │ │ │ ├── movement │ │ │ │ ├── AntiLevitation.kt │ │ │ │ ├── AutoJump.kt │ │ │ │ └── IceSpeed.kt │ │ │ └── combat │ │ │ │ ├── AntiDeathScreen.kt │ │ │ │ ├── AntiFriendHit.kt │ │ │ │ └── AimBot.kt │ │ ├── Category.kt │ │ └── Module.kt │ │ ├── gui │ │ ├── rgui │ │ │ ├── component │ │ │ │ ├── BooleanSlider.kt │ │ │ │ ├── CheckButton.kt │ │ │ │ ├── Button.kt │ │ │ │ └── SettingButton.kt │ │ │ └── windows │ │ │ │ ├── CleanWindow.kt │ │ │ │ ├── TitledWindow.kt │ │ │ │ └── BasicWindow.kt │ │ ├── hudgui │ │ │ ├── elements │ │ │ │ ├── misc │ │ │ │ │ ├── HighwayToolsHud.kt │ │ │ │ │ ├── Ping.kt │ │ │ │ │ ├── ServerBrand.kt │ │ │ │ │ ├── Time.kt │ │ │ │ │ ├── MemoryUsage.kt │ │ │ │ │ └── TPS.kt │ │ │ │ ├── world │ │ │ │ │ └── Biome.kt │ │ │ │ ├── client │ │ │ │ │ ├── Username.kt │ │ │ │ │ ├── BaritoneProcess.kt │ │ │ │ │ └── WaterMark.kt │ │ │ │ └── player │ │ │ │ │ ├── Direction.kt │ │ │ │ │ ├── TimerSpeed.kt │ │ │ │ │ └── Rotation.kt │ │ │ ├── window │ │ │ │ └── HudSettingWindow.kt │ │ │ ├── LabelHud.kt │ │ │ ├── HudElement.kt │ │ │ └── component │ │ │ │ └── HudButton.kt │ │ ├── mc │ │ │ ├── KamiGuiStealButton.kt │ │ │ └── KamiGuiStoreButton.kt │ │ └── clickgui │ │ │ ├── window │ │ │ └── ModuleSettingWindow.kt │ │ │ └── component │ │ │ └── ModuleButton.kt │ │ ├── command │ │ └── commands │ │ │ ├── LicenseCommand.kt │ │ │ ├── SayCommand.kt │ │ │ ├── ExampleCommand.kt │ │ │ ├── FakeMessageCommand.kt │ │ │ ├── ToggleCommand.kt │ │ │ ├── PrefixCommand.kt │ │ │ ├── VanishCommand.kt │ │ │ └── SetBuildingBlockCommand.kt │ │ ├── mixin │ │ └── extension │ │ │ ├── Player.kt │ │ │ └── Misc.kt │ │ ├── process │ │ ├── AutoObsidianProcess.kt │ │ └── HighwayToolsProcess.kt │ │ └── Loader.kt │ └── java │ └── org │ └── kamiblue │ └── client │ └── mixin │ └── client │ ├── accessor │ ├── AccessorEntity.java │ ├── AccessorItemTool.java │ ├── player │ │ ├── AccessorEntityPlayerSP.java │ │ └── AccessorPlayerControllerMP.java │ ├── network │ │ ├── AccessorCPacketCloseWindow.java │ │ ├── AccessorCPacketChatMessage.java │ │ ├── AccessorSPacketChat.java │ │ ├── AccessorSPacketPosLook.java │ │ ├── AccessorCPacketUseEntity.java │ │ ├── AccessorSPacketExplosion.java │ │ ├── AccessorSPacketEntityVelocity.java │ │ └── AccessorCPacketPlayer.java │ ├── AccessorTimer.java │ ├── render │ │ ├── AccessorRenderGlobal.java │ │ ├── AccessorViewFrustum.java │ │ ├── AccessorShaderGroup.java │ │ └── AccessorRenderManager.java │ ├── gui │ │ ├── AccessorGuiEditSign.java │ │ ├── AccessorGuiChat.java │ │ ├── AccessorGuiDisconnected.java │ │ └── AccessorGuiBossOverlay.java │ └── AccessorMinecraft.java │ ├── MixinElytraSound.java │ ├── entity │ ├── MixinEntityLlama.java │ └── MixinEntityPig.java │ ├── optifine │ └── MixinConfig.java │ ├── baritone │ └── MixinBaritoneSettings.java │ ├── world │ ├── MixinBlock.java │ ├── MixinBlockFluidRenderer.java │ ├── MixinBlockWeb.java │ ├── MixinBlockSoulSand.java │ ├── MixinBlockModelRenderer.java │ └── MixinBlockLiquid.java │ ├── render │ ├── MixinParticleManager.java │ ├── MixinRender.java │ ├── MixinMapItemRenderer.java │ ├── MixinDebugRendererChunkBorder.java │ ├── MixinTileRendererDispatcher.java │ ├── MixinTileEntityRendererDispatcher.java │ ├── MixinLayerArmorBase.java │ ├── MixinLayerCape.java │ └── MixinLayerElytra.java │ ├── MixinTileEntityBeacon.java │ ├── MixinKeyBinding.java │ ├── gui │ ├── MixinGuiIngameMenu.java │ └── MixinGuiChat.java │ ├── network │ └── MixinC00Handshake.java │ └── player │ └── MixinEntityPlayer.java ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── scripts ├── jar-shrink │ └── jar-shrink.jar ├── changelog.sh ├── version.sh ├── bumpMajor.sh ├── ascii.txt ├── uploadRelease.sh ├── utils.sh └── bumpVersion.sh ├── gradle.properties ├── detekt.yml ├── .github ├── pull_request_template.md ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE │ ├── incompatiblity-report.md │ ├── featurereq.md │ ├── enhancement.md │ └── bug-report.md ├── FUNDING.yml └── workflows │ └── gradle_build.yml ├── .gitmodules └── README.md /src/main/resources/kami.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/kami.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /scripts/jar-shrink/jar-shrink.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/scripts/jar-shrink/jar-shrink.jar -------------------------------------------------------------------------------- /src/main/resources/installer/00.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/installer/00.jpg -------------------------------------------------------------------------------- /src/main/resources/installer/01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/installer/01.jpg -------------------------------------------------------------------------------- /src/main/resources/installer/02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/installer/02.jpg -------------------------------------------------------------------------------- /src/main/resources/installer/03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/installer/03.jpg -------------------------------------------------------------------------------- /src/main/resources/installer/beta.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/installer/beta.png -------------------------------------------------------------------------------- /src/main/resources/installer/kami.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/installer/kami.png -------------------------------------------------------------------------------- /src/main/resources/installer/bread.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/installer/bread.png -------------------------------------------------------------------------------- /src/main/resources/installer/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/installer/loading.gif -------------------------------------------------------------------------------- /src/main/resources/installer/stable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/installer/stable.png -------------------------------------------------------------------------------- /src/main/resources/installer/rawimagefiles/00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/installer/rawimagefiles/00.png -------------------------------------------------------------------------------- /src/main/resources/installer/rawimagefiles/01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/installer/rawimagefiles/01.png -------------------------------------------------------------------------------- /src/main/resources/installer/rawimagefiles/02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/installer/rawimagefiles/02.png -------------------------------------------------------------------------------- /src/main/resources/installer/rawimagefiles/03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/installer/rawimagefiles/03.png -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx3G 2 | modGroup=me.constructor 3 | modVersion=ht-v09.9 4 | kotlin_version=1.4.30 5 | kotlinx_coroutines_version=1.4.2 -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/math/Vec3f.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util.math 2 | 3 | class Vec3f(val x: Float, val y: Float, val z: Float) -------------------------------------------------------------------------------- /src/main/resources/installer/rawimagefiles/world.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/installer/rawimagefiles/world.png -------------------------------------------------------------------------------- /src/main/resources/installer/rawimagefiles/castle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/installer/rawimagefiles/castle.png -------------------------------------------------------------------------------- /src/main/resources/installer/rawimagefiles/parlor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/installer/rawimagefiles/parlor.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/kamiblue/kamimap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/assets/minecraft/kamiblue/kamimap.png -------------------------------------------------------------------------------- /src/main/resources/assets/kamiblue/fonts/Lato/Lato-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/assets/kamiblue/fonts/Lato/Lato-Bold.ttf -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/kamiblue/kami_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/assets/minecraft/kamiblue/kami_icon.png -------------------------------------------------------------------------------- /src/main/resources/installer/rawimagefiles/loPolyIsland.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/installer/rawimagefiles/loPolyIsland.png -------------------------------------------------------------------------------- /src/main/resources/assets/kamiblue/fonts/Lato/Lato-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/assets/kamiblue/fonts/Lato/Lato-Italic.ttf -------------------------------------------------------------------------------- /src/main/resources/assets/kamiblue/fonts/Lato/Lato-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/assets/kamiblue/fonts/Lato/Lato-Regular.ttf -------------------------------------------------------------------------------- /detekt.yml: -------------------------------------------------------------------------------- 1 | complexity: 2 | active: true 3 | ComplexMethod: 4 | active: false 5 | 6 | style: 7 | active: true 8 | UnnecessaryParentheses: 9 | active: false 10 | -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/kamiblue/textures/capes/border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/assets/minecraft/kamiblue/textures/capes/border.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/kamiblue/textures/capes/text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/assets/minecraft/kamiblue/textures/capes/text.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/kamiblue/textures/capes/primary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/assets/minecraft/kamiblue/textures/capes/primary.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/kamiblue/textures/hungeroverlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/assets/minecraft/kamiblue/textures/hungeroverlay.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/kamiblue/textures/capes/text_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/assets/minecraft/kamiblue/textures/capes/text_icon.png -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/setting/GenericConfigClass.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.setting 2 | 3 | import org.kamiblue.commons.interfaces.Nameable 4 | 5 | interface GenericConfigClass : Nameable -------------------------------------------------------------------------------- /src/main/resources/assets/kamiblue/textures/blocks/kami_xray_transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Avanatiker/client/HEAD/src/main/resources/assets/kamiblue/textures/blocks/kami_xray_transparent.png -------------------------------------------------------------------------------- /src/main/resources/assets/kamiblue/models/block/kami_xray_transparent.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/cube_all", 3 | "textures": { 4 | "all": "kamiblue:blocks/kami_xray_transparent" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/manager/Manager.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.manager 2 | 3 | import org.kamiblue.client.util.Wrapper 4 | 5 | interface Manager { 6 | val mc get() = Wrapper.minecraft 7 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/event/events/BaritoneCommandEvent.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.event.events 2 | 3 | import org.kamiblue.client.event.Event 4 | 5 | class BaritoneCommandEvent(val command: String) : Event -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/TaskState.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util 2 | 3 | class TaskState(done: Boolean = false) { 4 | var done = done 5 | set(_) { 6 | field = true 7 | } 8 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/event/events/ResolutionUpdateEvent.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.event.events 2 | 3 | import org.kamiblue.client.event.Event 4 | 5 | class ResolutionUpdateEvent(val width: Int, val height: Int) : Event -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/plugin/api/IPluginClass.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.plugin.api 2 | 3 | import org.kamiblue.commons.interfaces.Nameable 4 | 5 | interface IPluginClass : Nameable { 6 | val pluginMain: Plugin 7 | } -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /src/main/resources/assets/kamiblue/blockstates/kami_xray_transparent.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "normal": [ 4 | { 5 | "model": "kamiblue:kami_xray_transparent" 6 | } 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/event/events/ConnectionEvent.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.event.events 2 | 3 | import org.kamiblue.client.event.Event 4 | 5 | abstract class ConnectionEvent : Event { 6 | class Connect : ConnectionEvent() 7 | class Disconnect : ConnectionEvent() 8 | } -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | **Describe the pull** 2 | A clear and concise description of what the pull is for. 3 | 4 | **Describe how this pull is helpful** 5 | A clear description of why this should be merged 6 | 7 | **Additional context** 8 | Add any other context about the pull here. 9 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/event/events/BlockBreakEvent.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.event.events 2 | 3 | import net.minecraft.util.math.BlockPos 4 | import org.kamiblue.client.event.Event 5 | 6 | class BlockBreakEvent(val breakerID: Int, val position: BlockPos, val progress: Int) : Event -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/event/events/ModuleToggleEvent.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.event.events 2 | 3 | import org.kamiblue.client.event.Event 4 | import org.kamiblue.client.module.AbstractModule 5 | 6 | class ModuleToggleEvent internal constructor(val module: AbstractModule) : Event -------------------------------------------------------------------------------- /src/main/resources/installer/rawimagefiles/README.txt: -------------------------------------------------------------------------------- 1 | Incase you wish to edit the installer, here are the raw, non scaled or blured image files 2 | 3 | Castle - Minecraft Screenshot 4 | Lo Poly Island - Render by Humboldt123 5 | Parlor - Screenshot (with Shaders) by Ratthew_ 6 | World - Minecraft Screenshot 7 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/event/events/PlayerAttackEvent.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.event.events 2 | 3 | import net.minecraft.entity.Entity 4 | import org.kamiblue.client.event.Cancellable 5 | import org.kamiblue.client.event.Event 6 | 7 | class PlayerAttackEvent(val entity: Entity) : Event, Cancellable() -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/event/events/ShutdownEvent.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.event.events 2 | 3 | import org.kamiblue.client.event.Event 4 | import org.kamiblue.client.event.KamiEventBus 5 | import org.kamiblue.client.event.SingletonEvent 6 | 7 | object ShutdownEvent : Event, SingletonEvent(KamiEventBus) -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/event/events/RenderOverlayEvent.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.event.events 2 | 3 | import org.kamiblue.client.event.Event 4 | import org.kamiblue.client.event.ProfilerEvent 5 | 6 | class RenderOverlayEvent : Event, ProfilerEvent { 7 | override val profilerName: String = "kbRender2D" 8 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/setting/GenericConfig.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.setting 2 | 3 | import org.kamiblue.client.KamiMod 4 | import org.kamiblue.client.setting.configs.NameableConfig 5 | 6 | internal object GenericConfig : NameableConfig( 7 | "generic", 8 | "${KamiMod.DIRECTORY}config/" 9 | ) -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/event/events/RenderRadarEvent.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.event.events 2 | 3 | import org.kamiblue.client.event.Event 4 | import org.kamiblue.client.util.graphics.VertexHelper 5 | 6 | class RenderRadarEvent( 7 | val vertexHelper: VertexHelper, 8 | val radius: Float, 9 | val scale: Float 10 | ) : Event -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/TimedFlag.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util 2 | 3 | class TimedFlag>(valueIn: T) { 4 | var value = valueIn 5 | set(value) { 6 | lastUpdateTime = System.currentTimeMillis() 7 | field = value 8 | } 9 | var lastUpdateTime = 0L 10 | private set 11 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/render/AntiFog.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.render 2 | 3 | import org.kamiblue.client.module.Category 4 | import org.kamiblue.client.module.Module 5 | 6 | internal object AntiFog : Module( 7 | name = "AntiFog", 8 | description = "Disables or reduces fog", 9 | category = Category.RENDER 10 | ) -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/Quad.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util 2 | 3 | import java.io.Serializable 4 | 5 | data class Quad( 6 | val first: A, 7 | val second: B, 8 | val third: C, 9 | val fourth: D 10 | ) : Serializable { 11 | override fun toString(): String = "($first, $second, $third, $fourth)" 12 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/event/events/GuiEvent.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.event.events 2 | 3 | import net.minecraft.client.gui.GuiScreen 4 | import org.kamiblue.client.event.Event 5 | 6 | abstract class GuiEvent(var screen: GuiScreen?) : Event { 7 | class Displayed(screen: GuiScreen?) : GuiEvent(screen) 8 | class Closed(screen: GuiScreen?) : GuiEvent(screen) 9 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/player/TpsSync.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.player 2 | 3 | import org.kamiblue.client.module.Category 4 | import org.kamiblue.client.module.Module 5 | 6 | internal object TpsSync : Module( 7 | name = "TpsSync", 8 | description = "Synchronizes block states with the server TPS", 9 | category = Category.PLAYER 10 | ) 11 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | You are free to clone, modify KAMI Blue and make pull requests, provided you follow the [license](https://kamiblue.org/license). 2 | 3 | Before contributing please see the [Code of Conduct](https://kamiblue.org/codeofconduct). 4 | 5 | See [Support](https://kamiblue.org/support) for help. 6 | 7 | See this [this](https://kamiblue.org/contributing) page for contributing instructions. 8 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/event/events/WaypointUpdateEvent.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.event.events 2 | 3 | import org.kamiblue.client.event.Event 4 | import org.kamiblue.client.manager.managers.WaypointManager.Waypoint 5 | 6 | class WaypointUpdateEvent(val type: Type, val waypoint: Waypoint?) : Event { 7 | enum class Type { 8 | GET, ADD, REMOVE, CLEAR, RELOAD 9 | } 10 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/misc/FakeVanillaClient.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.misc 2 | 3 | import org.kamiblue.client.module.Category 4 | import org.kamiblue.client.module.Module 5 | 6 | internal object FakeVanillaClient : Module( 7 | name = "FakeVanillaClient", 8 | description = "Fakes a modless client when connecting", 9 | category = Category.MISC 10 | ) 11 | -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/accessor/AccessorEntity.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.accessor; 2 | 3 | import net.minecraft.entity.Entity; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(Entity.class) 8 | public interface AccessorEntity { 9 | 10 | @Accessor("isInWeb") 11 | boolean getIsInWeb(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/accessor/AccessorItemTool.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.accessor; 2 | 3 | import net.minecraft.item.ItemTool; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(ItemTool.class) 8 | public interface AccessorItemTool { 9 | 10 | @Accessor("attackDamage") 11 | float getAttackDamage(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/event/events/BaritoneSettingsInitEvent.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.event.events 2 | 3 | import org.kamiblue.client.event.Event 4 | import org.kamiblue.client.event.KamiEventBus 5 | import org.kamiblue.client.event.SingletonEvent 6 | 7 | /** 8 | * Posted at the return of when Baritone's Settings are initialized. 9 | */ 10 | object BaritoneSettingsInitEvent : Event, SingletonEvent(KamiEventBus) -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/world/PlaceInfo.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util.world 2 | 3 | import net.minecraft.util.EnumFacing 4 | import net.minecraft.util.math.BlockPos 5 | import net.minecraft.util.math.Vec3d 6 | 7 | class PlaceInfo( 8 | val pos: BlockPos, 9 | val side: EnumFacing, 10 | val dist: Double, 11 | val hitVecOffset: Vec3d, 12 | val hitVec: Vec3d, 13 | val placedPos: BlockPos 14 | ) -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/incompatiblity-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Incompatibility Report 3 | about: Module incompatibility or incompatible with another Forge mod 4 | labels: -incompatible 5 | --- 6 | 7 | **What mod?** 8 | 9 | 10 | **Logs** 11 | 12 | 13 | **Additional context** 14 | 15 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/event/events/PlayerTravelEvent.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.event.events 2 | 3 | import org.kamiblue.client.event.Cancellable 4 | import org.kamiblue.client.event.Event 5 | import org.kamiblue.client.event.ICancellable 6 | import org.kamiblue.client.event.ProfilerEvent 7 | 8 | class PlayerTravelEvent : Event, ICancellable by Cancellable(), ProfilerEvent { 9 | override val profilerName: String = "kbPlayerTravel" 10 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/Category.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module 2 | 3 | import org.kamiblue.commons.interfaces.DisplayEnum 4 | 5 | enum class Category(override val displayName: String) : DisplayEnum { 6 | CHAT("Chat"), 7 | CLIENT("Client"), 8 | COMBAT("Combat"), 9 | MISC("Misc"), 10 | MOVEMENT("Movement"), 11 | PLAYER("Player"), 12 | RENDER("Render"); 13 | 14 | override fun toString() = displayName 15 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/client/Tooltips.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.client 2 | 3 | import org.kamiblue.client.module.Category 4 | import org.kamiblue.client.module.Module 5 | 6 | internal object Tooltips : Module( 7 | name = "Tooltips", 8 | description = "Displays handy module descriptions in the GUI", 9 | category = Category.CLIENT, 10 | showOnArray = false, 11 | enabledByDefault = true 12 | ) 13 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/misc/AntiDisconnect.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.misc 2 | 3 | import org.kamiblue.client.module.Category 4 | import org.kamiblue.client.module.Module 5 | 6 | internal object AntiDisconnect : Module( 7 | name = "AntiDisconnect", 8 | description = "Are you sure you want to disconnect?", 9 | category = Category.MISC 10 | ) { 11 | val presses = setting("Button Presses", 3, 1..20, 1) 12 | } -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "src/main/cape-api"] 2 | path = src/main/cape-api 3 | url = https://github.com/kami-blue/cape-api.git 4 | 5 | [submodule "src/main/commons"] 6 | path = src/main/commons 7 | url = https://github.com/kami-blue/commons.git 8 | [submodule "src/main/event"] 9 | path = src/main/event 10 | url = https://github.com/kami-blue/event.git 11 | [submodule "src/main/command"] 12 | path = src/main/command 13 | url = https://github.com/kami-blue/command.git 14 | -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/accessor/player/AccessorEntityPlayerSP.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.accessor.player; 2 | 3 | import net.minecraft.client.entity.EntityPlayerSP; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(EntityPlayerSP.class) 8 | public interface AccessorEntityPlayerSP { 9 | 10 | @Accessor("handActive") 11 | void kbSetHandActive(boolean value); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/accessor/network/AccessorCPacketCloseWindow.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.accessor.network; 2 | 3 | import net.minecraft.network.play.client.CPacketCloseWindow; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(CPacketCloseWindow.class) 8 | public interface AccessorCPacketCloseWindow { 9 | 10 | @Accessor("windowId") 11 | int kbGetWindowId(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/accessor/AccessorTimer.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.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 AccessorTimer { 9 | 10 | @Accessor("tickLength") 11 | float getTickLength(); 12 | 13 | @Accessor("tickLength") 14 | void setTickLength(float value); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/event/events/RunGameLoopEvent.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.event.events 2 | 3 | import org.kamiblue.client.event.Event 4 | import org.kamiblue.client.event.ProfilerEvent 5 | 6 | sealed class RunGameLoopEvent(override val profilerName: String) : Event, ProfilerEvent { 7 | class Start : RunGameLoopEvent("start") 8 | class Tick : RunGameLoopEvent("tick") 9 | class Render : RunGameLoopEvent("render") 10 | class End : RunGameLoopEvent("end") 11 | } -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/accessor/network/AccessorCPacketChatMessage.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.accessor.network; 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 AccessorCPacketChatMessage { 9 | 10 | @Accessor("message") 11 | void setMessage(String value); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/graphics/font/CharInfo.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util.graphics.font 2 | 3 | class CharInfo( 4 | /** Character's width */ 5 | val width: Double, 6 | 7 | /** Character's height */ 8 | val height: Double, 9 | 10 | /** Upper left u */ 11 | val u1: Double, 12 | 13 | /** Upper left v */ 14 | val v1: Double, 15 | 16 | /** Lower right u */ 17 | val u2: Double, 18 | 19 | /** Lower right v */ 20 | val v2: Double 21 | ) -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/graphics/font/Style.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util.graphics.font 2 | 3 | import java.awt.Font 4 | 5 | @Suppress("UNUSED") 6 | enum class Style(val code: String, val codeChar: Char, val fontPath: String, val styleConst: Int) { 7 | REGULAR("§r", 'r', "/assets/kamiblue/fonts/Lato/Lato-Regular.ttf", Font.PLAIN), 8 | BOLD("§l", 'l', "/assets/kamiblue/fonts/Lato/Lato-Bold.ttf", Font.BOLD), 9 | ITALIC("§o", 'o', "/assets/kamiblue/fonts/Lato/Lato-Italic.ttf", Font.ITALIC) 10 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/render/CleanGUI.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.render 2 | 3 | import org.kamiblue.client.module.Category 4 | import org.kamiblue.client.module.Module 5 | 6 | internal object CleanGUI : Module( 7 | name = "CleanGUI", 8 | category = Category.RENDER, 9 | showOnArray = false, 10 | description = "Modifies parts of the GUI to be transparent" 11 | ) { 12 | val inventoryGlobal = setting("Inventory", true) 13 | val chatGlobal = setting("Chat", false) 14 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/chat/PortalChat.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.chat 2 | 3 | import org.kamiblue.client.mixin.client.player.MixinEntityPlayerSP 4 | import org.kamiblue.client.module.Category 5 | import org.kamiblue.client.module.Module 6 | 7 | /** 8 | * @see MixinEntityPlayerSP 9 | */ 10 | internal object PortalChat : Module( 11 | name = "PortalChat", 12 | category = Category.CHAT, 13 | description = "Allows you to open GUIs in portals", 14 | showOnArray = false 15 | ) 16 | -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/accessor/network/AccessorSPacketChat.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.accessor.network; 2 | 3 | import net.minecraft.network.play.server.SPacketChat; 4 | import net.minecraft.util.text.ITextComponent; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(SPacketChat.class) 9 | public interface AccessorSPacketChat { 10 | 11 | @Accessor("chatComponent") 12 | void setChatComponent(ITextComponent value); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/accessor/render/AccessorRenderGlobal.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.accessor.render; 2 | 3 | import net.minecraft.client.renderer.RenderGlobal; 4 | import net.minecraft.client.shader.ShaderGroup; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(RenderGlobal.class) 9 | public interface AccessorRenderGlobal { 10 | 11 | @Accessor("entityOutlineShader") 12 | ShaderGroup getEntityOutlineShader(); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/text/RomanNumerals.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util.text 2 | 3 | object RomanNumerals { 4 | fun numberToRoman(number: Int): String { 5 | return when (number) { 6 | 1 -> "I" 7 | 2 -> "II" 8 | 3 -> "III" 9 | 4 -> "IV" 10 | 5 -> "V" 11 | 6 -> "VI" 12 | 7 -> "VII" 13 | 8 -> "VIII" 14 | 9 -> "IX" 15 | 10 -> "X" 16 | else -> number.toString() 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/accessor/network/AccessorSPacketPosLook.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.accessor.network; 2 | 3 | import net.minecraft.network.play.server.SPacketPlayerPosLook; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(SPacketPlayerPosLook.class) 8 | public interface AccessorSPacketPosLook { 9 | 10 | @Accessor("yaw") 11 | void setYaw(float value); 12 | 13 | @Accessor("pitch") 14 | void setPitch(float value); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/threads/BackgroundJob.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util.threads 2 | 3 | import kotlinx.coroutines.CoroutineScope 4 | 5 | class BackgroundJob( 6 | val name: String, 7 | val delay: Long, 8 | val block: suspend CoroutineScope.() -> Unit 9 | ) { 10 | 11 | override fun equals(other: Any?) = this === other 12 | || (other is BackgroundJob 13 | && name == other.name 14 | && delay == other.delay) 15 | 16 | override fun hashCode() = 31 * name.hashCode() + delay.hashCode() 17 | 18 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/misc/AntiWeather.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.misc 2 | 3 | import org.kamiblue.client.mixin.client.world.MixinWorld 4 | import org.kamiblue.client.module.Category 5 | import org.kamiblue.client.module.Module 6 | 7 | /** 8 | * @see MixinWorld.getThunderStrengthHead 9 | * @see MixinWorld.getRainStrengthHead 10 | */ 11 | internal object AntiWeather : Module( 12 | name = "AntiWeather", 13 | description = "Removes rain and thunder from your world", 14 | category = Category.MISC 15 | ) 16 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/TimeoutFlag.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util 2 | 3 | class TimeoutFlag private constructor( 4 | val value: T, 5 | private val timeoutTime: Long 6 | ) { 7 | fun timeout() = 8 | System.currentTimeMillis() > timeoutTime 9 | 10 | companion object { 11 | fun relative(value: T, timeout: Long) = 12 | TimeoutFlag(value, System.currentTimeMillis() + timeout) 13 | 14 | fun absolute(value: T, timeout: Long) = 15 | TimeoutFlag(value, timeout) 16 | } 17 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/rgui/component/BooleanSlider.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.rgui.component 2 | 3 | import org.kamiblue.client.util.graphics.AnimationUtils 4 | 5 | open class BooleanSlider( 6 | name: String, 7 | valueIn: Double, 8 | description: String, 9 | visibility: (() -> Boolean)? = null 10 | ) : Slider(name, valueIn, description, visibility) { 11 | override val renderProgress: Double 12 | get() = AnimationUtils.exponent(AnimationUtils.toDeltaTimeDouble(prevValue.lastUpdateTime), 200.0, prevValue.value, value) 13 | } -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/accessor/render/AccessorViewFrustum.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.accessor.render; 2 | 3 | import net.minecraft.client.renderer.ViewFrustum; 4 | import net.minecraft.client.renderer.chunk.RenderChunk; 5 | import net.minecraft.util.math.BlockPos; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.gen.Invoker; 8 | 9 | @Mixin(ViewFrustum.class) 10 | public interface AccessorViewFrustum { 11 | 12 | @Invoker 13 | RenderChunk invokeGetRenderChunk(BlockPos pos); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/command/commands/LicenseCommand.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.command.commands 2 | 3 | import org.kamiblue.client.command.ClientCommand 4 | import org.kamiblue.client.util.text.MessageSendHelper 5 | 6 | object LicenseCommand : ClientCommand( 7 | name = "license", 8 | description = "Information about KAMI Blue's license" 9 | ) { 10 | init { 11 | execute { 12 | MessageSendHelper.sendChatMessage("You can view KAMI Blue's &7client&f License (LGPLv3) at &9https://kamiblue.org/license") 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/render/CameraClip.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.render 2 | 3 | import org.kamiblue.client.mixin.client.render.MixinEntityRenderer 4 | import org.kamiblue.client.module.Category 5 | import org.kamiblue.client.module.Module 6 | 7 | /** 8 | * @see MixinEntityRenderer.rayTraceBlocks 9 | */ 10 | internal object CameraClip : Module( 11 | name = "CameraClip", 12 | category = Category.RENDER, 13 | description = "Allows your 3rd person camera to pass through blocks", 14 | showOnArray = false 15 | ) 16 | -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/accessor/gui/AccessorGuiEditSign.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.accessor.gui; 2 | 3 | import net.minecraft.client.gui.inventory.GuiEditSign; 4 | import net.minecraft.tileentity.TileEntitySign; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(GuiEditSign.class) 9 | public interface AccessorGuiEditSign { 10 | 11 | @Accessor("tileSign") 12 | TileEntitySign getTileSign(); 13 | 14 | @Accessor("editLine") 15 | int getEditLine(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/setting/settings/impl/other/ColorSetting.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.setting.settings.impl.other 2 | 3 | import org.kamiblue.client.setting.settings.MutableSetting 4 | import org.kamiblue.client.util.color.ColorHolder 5 | 6 | class ColorSetting( 7 | name: String, 8 | value: ColorHolder, 9 | val hasAlpha: Boolean = true, 10 | visibility: () -> Boolean = { true }, 11 | description: String = "" 12 | ) : MutableSetting(name, value, visibility, { _, input -> if (!hasAlpha) input.apply { a = 255 } else input }, description) -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/command/commands/SayCommand.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.command.commands 2 | 3 | import org.kamiblue.client.command.ClientCommand 4 | import org.kamiblue.client.util.text.MessageSendHelper.sendServerMessage 5 | 6 | object SayCommand : ClientCommand( 7 | name = "say", 8 | description = "Allows you to send any message, even with a prefix in it." 9 | ) { 10 | init { 11 | greedy("message") { messageArg -> 12 | executeSafe { 13 | sendServerMessage(messageArg.value.trim()) 14 | } 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/hudgui/elements/misc/HighwayToolsHud.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.hudgui.elements.misc 2 | 3 | import org.kamiblue.client.event.SafeClientEvent 4 | import org.kamiblue.client.gui.hudgui.LabelHud 5 | import org.kamiblue.client.module.modules.misc.HighwayTools.gatherStatistics 6 | 7 | internal object HighwayToolsHud : LabelHud( 8 | name = "HighwayToolsHud", 9 | category = Category.MISC, 10 | description = "Hud for HighwayTools module" 11 | ) { 12 | override fun SafeClientEvent.updateText() { 13 | gatherStatistics(displayText) 14 | } 15 | } -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/accessor/network/AccessorCPacketUseEntity.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.accessor.network; 2 | 3 | import net.minecraft.network.play.client.CPacketUseEntity; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(CPacketUseEntity.class) 8 | public interface AccessorCPacketUseEntity { 9 | @Accessor("entityId") 10 | int getId(); 11 | 12 | @Accessor("entityId") 13 | void setId(int value); 14 | 15 | @Accessor("action") 16 | void setAction(CPacketUseEntity.Action value); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/text/TextFormatting.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util.text 2 | 3 | import net.minecraft.util.text.TextFormatting 4 | import org.kamiblue.client.util.color.EnumTextColor 5 | 6 | fun formatValue(value: String) = TextFormatting.GRAY format "[$value]" 7 | 8 | fun formatValue(value: Any) = TextFormatting.GRAY format "[$value]" 9 | 10 | fun formatValue(value: Int) = TextFormatting.GRAY format "($value)" 11 | 12 | infix fun TextFormatting.format(value: Any) = "$this$value${TextFormatting.RESET}" 13 | 14 | infix fun EnumTextColor.format(value: Any) = "$this$value${TextFormatting.RESET}" -------------------------------------------------------------------------------- /src/main/resources/mcmod.info: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "modid": "kamiblue", 4 | "name": "KAMI Blue", 5 | "description": "カミブル \nA Minecraft utility mod for anarchy servers \nWritten by 086 and continued by l1ving\n", 6 | "version": "${version}", 7 | "mcversion": "1.12.2", 8 | "url": "https://github.com/kami-blue/client", 9 | "updateUrl": "", 10 | "authorList": [ 11 | "086", 12 | "l1ving" 13 | ], 14 | "credits": "Thank you 086 for the original KAMI\nThanks to all contributors for your help and time <3\n", 15 | "logoFile": "kami.png", 16 | "dependencies": [] 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/rgui/component/CheckButton.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.rgui.component 2 | 3 | import org.kamiblue.client.util.math.Vec2f 4 | 5 | class CheckButton( 6 | name: String, 7 | stateIn: Boolean, 8 | description: String = "", 9 | visibility: (() -> Boolean)? = null 10 | ) : BooleanSlider(name, 0.0, description, visibility) { 11 | init { 12 | value = if (stateIn) 1.0 else 0.0 13 | } 14 | 15 | override fun onClick(mousePos: Vec2f, buttonId: Int) { 16 | super.onClick(mousePos, buttonId) 17 | value = if (value == 1.0) 0.0 else 1.0 18 | } 19 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/shaders/program/kawase_blur.fsh: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | uniform sampler2D DiffuseSampler; 4 | 5 | varying vec2 fragCoord1; 6 | varying vec2 fragCoord2; 7 | varying vec2 fragCoord3; 8 | varying vec2 fragCoord4; 9 | varying vec2 fragCoord5; 10 | 11 | void main() { 12 | vec4 color = texture2D(DiffuseSampler, fragCoord1); 13 | color += texture2D(DiffuseSampler, fragCoord2); 14 | color += texture2D(DiffuseSampler, fragCoord3); 15 | color += texture2D(DiffuseSampler, fragCoord4); 16 | color += texture2D(DiffuseSampler, fragCoord5); 17 | 18 | gl_FragColor = color * 0.2; 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/accessor/network/AccessorSPacketExplosion.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.accessor.network; 2 | 3 | import net.minecraft.network.play.server.SPacketExplosion; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(SPacketExplosion.class) 8 | public interface AccessorSPacketExplosion { 9 | 10 | @Accessor("motionX") 11 | void setMotionX(float value); 12 | 13 | @Accessor("motionY") 14 | void setMotionY(float value); 15 | 16 | @Accessor("motionZ") 17 | void setMotionZ(float value); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/graphics/font/Alignment.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util.graphics.font 2 | 3 | import org.kamiblue.commons.interfaces.DisplayEnum 4 | 5 | enum class HAlign(override val displayName: String, val multiplier: Float, val offset: Float) : DisplayEnum { 6 | LEFT("Left", 0.0f, -1.0f), 7 | CENTER("Center", 0.5f, 0.0f), 8 | RIGHT("Right", 1.0f, 1.0f) 9 | } 10 | 11 | enum class VAlign(override val displayName: String, val multiplier: Float, val offset: Float) : DisplayEnum { 12 | TOP("Top", 0.0f, -1.0f), 13 | CENTER("Center", 0.5f, 0.0f), 14 | BOTTOM("Bottom", 1.0f, 1.0f) 15 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/event/events/PacketEvent.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.event.events 2 | 3 | import net.minecraft.network.Packet 4 | import org.kamiblue.client.event.Cancellable 5 | import org.kamiblue.client.event.Event 6 | import org.kamiblue.client.event.ICancellable 7 | 8 | abstract class PacketEvent(val packet: Packet<*>) : Event, ICancellable by Cancellable() { 9 | class Receive(packet: Packet<*>) : PacketEvent(packet) 10 | class PostReceive(packet: Packet<*>) : PacketEvent(packet) 11 | class Send(packet: Packet<*>) : PacketEvent(packet) 12 | class PostSend(packet: Packet<*>) : PacketEvent(packet) 13 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/hudgui/elements/misc/Ping.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.hudgui.elements.misc 2 | 3 | import org.kamiblue.client.event.SafeClientEvent 4 | import org.kamiblue.client.gui.hudgui.LabelHud 5 | import org.kamiblue.client.util.InfoCalculator 6 | 7 | internal object Ping : LabelHud( 8 | name = "Ping", 9 | category = Category.MISC, 10 | description = "Delay between client and server" 11 | ) { 12 | 13 | override fun SafeClientEvent.updateText() { 14 | displayText.add(InfoCalculator.ping().toString(), primaryColor) 15 | displayText.add("ms", secondaryColor) 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/accessor/network/AccessorSPacketEntityVelocity.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.accessor.network; 2 | 3 | import net.minecraft.network.play.server.SPacketEntityVelocity; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(SPacketEntityVelocity.class) 8 | public interface AccessorSPacketEntityVelocity { 9 | 10 | @Accessor("motionX") 11 | void setMotionX(int value); 12 | 13 | @Accessor("motionY") 14 | void setMotionY(int value); 15 | 16 | @Accessor("motionZ") 17 | void setMotionZ(int value); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/setting/configs/IConfig.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.setting.configs 2 | 3 | import org.kamiblue.commons.interfaces.Nameable 4 | import java.io.File 5 | 6 | /** 7 | * Setting group that can be saved to a .json file 8 | */ 9 | interface IConfig : Nameable { 10 | 11 | /** Main file of the config */ 12 | val file: File 13 | 14 | /** Backup file of the config */ 15 | val backup: File 16 | 17 | /** 18 | * Save this group to its .json file 19 | */ 20 | fun save() 21 | 22 | /** 23 | * Load all setting values in from its .json file 24 | */ 25 | fun load() 26 | 27 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/setting/configs/NameableConfig.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.setting.configs 2 | 3 | import org.kamiblue.client.setting.settings.AbstractSetting 4 | import org.kamiblue.commons.interfaces.Nameable 5 | 6 | open class NameableConfig( 7 | name: String, 8 | filePath: String 9 | ) : AbstractConfig(name, filePath) { 10 | 11 | override fun addSettingToConfig(owner: T, setting: AbstractSetting<*>) { 12 | getGroupOrPut(owner.name).addSetting(setting) 13 | } 14 | 15 | open fun getSettings(nameable: Nameable) = getGroup(nameable.name)?.getSettings() ?: emptyList() 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/hudgui/window/HudSettingWindow.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.hudgui.window 2 | 3 | import org.kamiblue.client.gui.hudgui.AbstractHudElement 4 | import org.kamiblue.client.gui.rgui.windows.SettingWindow 5 | import org.kamiblue.client.setting.settings.AbstractSetting 6 | 7 | class HudSettingWindow( 8 | hudElement: AbstractHudElement, 9 | posX: Float, 10 | posY: Float 11 | ) : SettingWindow(hudElement.name, hudElement, posX, posY, SettingGroup.NONE) { 12 | 13 | override fun getSettingList(): List> { 14 | return element.settingList 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/hudgui/LabelHud.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.hudgui 2 | 3 | import org.kamiblue.client.gui.rgui.Component 4 | import org.kamiblue.client.setting.GuiConfig 5 | import org.kamiblue.client.setting.settings.SettingRegister 6 | 7 | internal abstract class LabelHud( 8 | name: String, 9 | alias: Array = emptyArray(), 10 | category: Category, 11 | description: String, 12 | alwaysListening: Boolean = false, 13 | enabledByDefault: Boolean = false 14 | ) : AbstractLabelHud(name, alias, category, description, alwaysListening, enabledByDefault, GuiConfig), 15 | SettingRegister by GuiConfig -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/hudgui/elements/world/Biome.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.hudgui.elements.world 2 | 3 | import org.kamiblue.client.event.SafeClientEvent 4 | import org.kamiblue.client.gui.hudgui.LabelHud 5 | 6 | internal object Biome : LabelHud( 7 | name = "Biome", 8 | category = Category.WORLD, 9 | description = "Display the current biome you are in" 10 | ) { 11 | 12 | override fun SafeClientEvent.updateText() { 13 | val biome = world.getBiome(player.position).biomeName ?: "Unknown" 14 | 15 | displayText.add(biome, primaryColor) 16 | displayText.add("Biome", secondaryColor) 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/hudgui/HudElement.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.hudgui 2 | 3 | import org.kamiblue.client.gui.rgui.Component 4 | import org.kamiblue.client.setting.GuiConfig 5 | import org.kamiblue.client.setting.settings.SettingRegister 6 | 7 | internal abstract class HudElement( 8 | name: String, 9 | alias: Array = emptyArray(), 10 | category: Category, 11 | description: String, 12 | alwaysListening: Boolean = false, 13 | enabledByDefault: Boolean = false, 14 | ) : AbstractHudElement(name, alias, category, description, alwaysListening, enabledByDefault, GuiConfig), 15 | SettingRegister by GuiConfig -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/client/ChatSetting.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.client 2 | 3 | import org.kamiblue.client.module.Category 4 | import org.kamiblue.client.module.Module 5 | 6 | internal object ChatSetting : Module( 7 | name = "ChatSetting", 8 | category = Category.CLIENT, 9 | description = "Configures chat message manager", 10 | showOnArray = false, 11 | alwaysEnabled = true 12 | ) { 13 | val delay = setting("Message Speed Limit", 0.5f, 0.1f..20.0f, 0.1f, description = "Delay between each message in seconds") 14 | val maxMessageQueueSize = setting("Max Message Queue Size", 50, 10..200, 5) 15 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/setting/ModuleConfig.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.setting 2 | 3 | import org.kamiblue.client.KamiMod 4 | import org.kamiblue.client.module.AbstractModule 5 | import org.kamiblue.client.module.modules.client.Configurations 6 | import org.kamiblue.client.setting.configs.NameableConfig 7 | import java.io.File 8 | 9 | internal object ModuleConfig : NameableConfig( 10 | "modules", 11 | "${KamiMod.DIRECTORY}config/modules", 12 | ) { 13 | override val file: File get() = File("$filePath/${Configurations.modulePreset}.json") 14 | override val backup get() = File("$filePath/${Configurations.modulePreset}.bak") 15 | } -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/accessor/render/AccessorShaderGroup.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.accessor.render; 2 | 3 | import net.minecraft.client.shader.Framebuffer; 4 | import net.minecraft.client.shader.Shader; 5 | import net.minecraft.client.shader.ShaderGroup; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.gen.Accessor; 8 | 9 | import java.util.List; 10 | 11 | @Mixin(ShaderGroup.class) 12 | public interface AccessorShaderGroup { 13 | @Accessor("listShaders") 14 | List getListShaders(); 15 | 16 | @Accessor("listFramebuffers") 17 | List getListFramebuffers(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/mc/KamiGuiStealButton.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.mc 2 | 3 | import net.minecraft.client.gui.GuiButton 4 | import org.kamiblue.client.module.modules.player.ChestStealer 5 | import org.kamiblue.client.util.Wrapper 6 | 7 | class KamiGuiStealButton(x: Int, y: Int) : 8 | GuiButton(696969, x, y, 50, 20, "Steal") { 9 | override fun mouseReleased(mouseX: Int, mouseY: Int) { 10 | if (ChestStealer.mode.value === ChestStealer.Mode.MANUAL) { 11 | ChestStealer.stealing = false 12 | playPressSound(Wrapper.minecraft.soundHandler) 13 | } 14 | super.mouseReleased(mouseX, mouseY) 15 | } 16 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/mc/KamiGuiStoreButton.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.mc 2 | 3 | import net.minecraft.client.gui.GuiButton 4 | import org.kamiblue.client.module.modules.player.ChestStealer 5 | import org.kamiblue.client.util.Wrapper 6 | 7 | class KamiGuiStoreButton(x: Int, y: Int) : 8 | GuiButton(420420, x, y, 50, 20, "Store") { 9 | override fun mouseReleased(mouseX: Int, mouseY: Int) { 10 | if (ChestStealer.mode.value === ChestStealer.Mode.MANUAL) { 11 | ChestStealer.storing = false 12 | playPressSound(Wrapper.minecraft.soundHandler) 13 | } 14 | super.mouseReleased(mouseX, mouseY) 15 | } 16 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/clickgui/window/ModuleSettingWindow.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.clickgui.window 2 | 3 | import org.kamiblue.client.gui.rgui.windows.SettingWindow 4 | import org.kamiblue.client.module.AbstractModule 5 | import org.kamiblue.client.setting.settings.AbstractSetting 6 | 7 | class ModuleSettingWindow( 8 | module: AbstractModule, 9 | posX: Float, 10 | posY: Float 11 | ) : SettingWindow(module.name, module, posX, posY, SettingGroup.NONE) { 12 | 13 | override fun getSettingList(): List> { 14 | return element.fullSettingList.filter { it.name != "Enabled" && it.name != "Clicks" } 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/rgui/windows/CleanWindow.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.rgui.windows 2 | 3 | import org.kamiblue.client.gui.rgui.WindowComponent 4 | import org.kamiblue.client.setting.GuiConfig 5 | import org.kamiblue.client.setting.configs.AbstractConfig 6 | import org.kamiblue.commons.interfaces.Nameable 7 | 8 | /** 9 | * Window with no rendering 10 | */ 11 | open class CleanWindow( 12 | name: String, 13 | posX: Float, 14 | posY: Float, 15 | width: Float, 16 | height: Float, 17 | settingGroup: SettingGroup, 18 | config: AbstractConfig = GuiConfig 19 | ) : WindowComponent(name, posX, posY, width, height, settingGroup, config) -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/accessor/gui/AccessorGuiChat.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.accessor.gui; 2 | 3 | import net.minecraft.client.gui.GuiChat; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(GuiChat.class) 8 | public interface AccessorGuiChat { 9 | 10 | @Accessor("historyBuffer") 11 | String getHistoryBuffer(); 12 | 13 | @Accessor("historyBuffer") 14 | void setHistoryBuffer(String value); 15 | 16 | @Accessor("sentHistoryCursor") 17 | int getSentHistoryCursor(); 18 | 19 | @Accessor("sentHistoryCursor") 20 | void setSentHistoryCursor(int value); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/accessor/render/AccessorRenderManager.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.accessor.render; 2 | 3 | import net.minecraft.client.renderer.entity.RenderManager; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(RenderManager.class) 8 | public interface AccessorRenderManager { 9 | 10 | @Accessor("renderPosX") 11 | double getRenderPosX(); 12 | 13 | @Accessor("renderPosY") 14 | double getRenderPosY(); 15 | 16 | @Accessor("renderPosZ") 17 | double getRenderPosZ(); 18 | 19 | @Accessor("renderOutlines") 20 | boolean getRenderOutlines(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /scripts/changelog.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Created by l1ving on 17/02/20 4 | # 5 | # Returns a changelog when given a single short hash or two hashes 6 | # Defaults to head when no second hash is given 7 | # Usage: "./changelog.sh " 8 | 9 | __scripts="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/utils.sh" 10 | source "$__scripts" 11 | 12 | check_git || exit $? 13 | check_var "1" "$1" || exit $? 14 | 15 | CHANGELOG="$(git log --format=%s "$1"..."$2" | sed ':a;N;$!ba;s/\n/\\n/g' | sed "s/\"/''/g")" || { 16 | echo "[changelog] Failed to create changelog from commits, exiting." >&2 17 | exit 1 18 | } 19 | 20 | [ -n "$CHANGELOG" ] || exit 1 21 | 22 | echo "$CHANGELOG" 23 | -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/accessor/gui/AccessorGuiDisconnected.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.accessor.gui; 2 | 3 | import net.minecraft.client.gui.GuiDisconnected; 4 | import net.minecraft.client.gui.GuiScreen; 5 | import net.minecraft.util.text.ITextComponent; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.gen.Accessor; 8 | 9 | @Mixin(GuiDisconnected.class) 10 | public interface AccessorGuiDisconnected { 11 | 12 | @Accessor("parentScreen") 13 | GuiScreen getParentScreen(); 14 | 15 | @Accessor("reason") 16 | String getReason(); 17 | 18 | @Accessor("message") 19 | ITextComponent getMessage(); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/mixin/extension/Player.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.extension 2 | 3 | import net.minecraft.client.multiplayer.PlayerControllerMP 4 | import org.kamiblue.client.mixin.client.accessor.player.AccessorPlayerControllerMP 5 | 6 | var PlayerControllerMP.blockHitDelay: Int 7 | get() = (this as AccessorPlayerControllerMP).blockHitDelay 8 | set(value) { 9 | (this as AccessorPlayerControllerMP).blockHitDelay = value 10 | } 11 | 12 | val PlayerControllerMP.currentPlayerItem: Int get() = (this as AccessorPlayerControllerMP).currentPlayerItem 13 | 14 | fun PlayerControllerMP.syncCurrentPlayItem() = (this as AccessorPlayerControllerMP).kb_invokeSyncCurrentPlayItem() -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/shaders/program/grainy_blur.vsh: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | attribute vec4 Position; 4 | 5 | uniform mat4 ProjMat; 6 | uniform vec2 InSize; 7 | uniform vec2 OutSize; 8 | uniform vec2 randomSeed; 9 | uniform float radius; 10 | 11 | varying vec2 fragCoord; 12 | varying vec2 uv; 13 | varying vec2 offset; 14 | 15 | void main(){ 16 | vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); 17 | gl_Position = vec4(outPos.xy, 0.2, 1.0); 18 | 19 | fragCoord = Position.xy / OutSize; 20 | fragCoord.y = 1.0 - fragCoord.y; 21 | 22 | uv = 1.0 / InSize * radius; 23 | offset = vec2(sin(dot(fragCoord, randomSeed)), sin(dot(vec2(fragCoord.y, fragCoord.x), randomSeed))); 24 | } 25 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/featurereq.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | labels: new, -module 5 | --- 6 | 7 | **Is your feature request related to a problem? Please describe.** 8 | 9 | 10 | **Describe the solution you'd like** 11 | 12 | 13 | **Describe alternatives you've considered** 14 | 15 | 16 | **Additional context** 17 | 18 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/client/Hud.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.client 2 | 3 | import org.kamiblue.client.module.Category 4 | import org.kamiblue.client.module.Module 5 | import org.kamiblue.client.util.color.ColorHolder 6 | 7 | internal object Hud : Module( 8 | name = "Hud", 9 | description = "Toggles Hud displaying and settings", 10 | category = Category.CLIENT, 11 | showOnArray = false, 12 | enabledByDefault = true 13 | ) { 14 | val hudFrame by setting("Hud Frame", false) 15 | val primaryColor by setting("Primary Color", ColorHolder(255, 255, 255), false) 16 | val secondaryColor by setting("Secondary Color", ColorHolder(155, 144, 255), false) 17 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/plugin/api/PluginHudElement.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.plugin.api 2 | 3 | import org.kamiblue.client.gui.hudgui.AbstractHudElement 4 | import org.kamiblue.client.setting.settings.SettingRegister 5 | 6 | abstract class PluginHudElement( 7 | final override val pluginMain: Plugin, 8 | name: String, 9 | alias: Array = emptyArray(), 10 | category: Category, 11 | description: String, 12 | alwaysListening: Boolean = false, 13 | enabledByDefault: Boolean = false 14 | ) : AbstractHudElement(name, alias, category, description, alwaysListening, enabledByDefault, pluginMain.config), 15 | IPluginClass, 16 | SettingRegister by pluginMain.config 17 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/enhancement.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Enhancement to an existing feature 3 | about: Suggest an idea for a feature 4 | labels: enhancement, -module 5 | --- 6 | 7 | **Is your feature request related to a problem? Please describe.** 8 | 9 | 10 | **Describe the solution you'd like** 11 | 12 | 13 | **Describe alternatives you've considered** 14 | 15 | 16 | **Additional context** 17 | 18 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/Module.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module 2 | 3 | import org.kamiblue.client.setting.ModuleConfig 4 | 5 | internal abstract class Module( 6 | name: String, 7 | alias: Array = emptyArray(), 8 | category: Category, 9 | description: String, 10 | modulePriority: Int = -1, 11 | alwaysListening: Boolean = false, 12 | showOnArray: Boolean = true, 13 | alwaysEnabled: Boolean = false, 14 | enabledByDefault: Boolean = false 15 | ) : AbstractModule( 16 | name, 17 | alias, 18 | category, 19 | description, 20 | modulePriority, 21 | alwaysListening, 22 | showOnArray, 23 | alwaysEnabled, 24 | enabledByDefault, 25 | ModuleConfig 26 | ) -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/threads/CoroutineUtils.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util.threads 2 | 3 | import kotlinx.coroutines.CoroutineScope 4 | import kotlinx.coroutines.Dispatchers 5 | import kotlinx.coroutines.Job 6 | import kotlinx.coroutines.newSingleThreadContext 7 | 8 | /** 9 | * Single thread scope to use in KAMI Blue 10 | */ 11 | @Suppress("EXPERIMENTAL_API_USAGE") 12 | val mainScope = CoroutineScope(newSingleThreadContext("KAMI Blue Main")) 13 | 14 | /** 15 | * Common scope with [Dispatchers.Default] 16 | */ 17 | val defaultScope = CoroutineScope(Dispatchers.Default) 18 | 19 | /** 20 | * Return true if the job is active, or false is not active or null 21 | */ 22 | val Job?.isActiveOrFalse get() = this?.isActive ?: false -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/render/ExtraTab.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.render 2 | 3 | import net.minecraft.client.network.NetworkPlayerInfo 4 | import org.kamiblue.client.module.Category 5 | import org.kamiblue.client.module.Module 6 | 7 | internal object ExtraTab : Module( 8 | name = "ExtraTab", 9 | description = "Expands the player tab menu", 10 | category = Category.RENDER 11 | ) { 12 | private val tabSize by setting("Max Players", 265, 80..400, 5) 13 | 14 | @JvmStatic 15 | fun subList(list: List, newList: List): List { 16 | return if (isDisabled) newList else list.subList(0, tabSize.coerceAtMost(list.size)) 17 | } 18 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/hudgui/elements/client/Username.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.hudgui.elements.client 2 | 3 | import org.kamiblue.client.event.SafeClientEvent 4 | import org.kamiblue.client.gui.hudgui.LabelHud 5 | 6 | internal object Username : LabelHud( 7 | name = "Username", 8 | category = Category.CLIENT, 9 | description = "Player username" 10 | ) { 11 | 12 | private val prefix = setting("Prefix", "Welcome") 13 | private val suffix = setting("Suffix", "") 14 | 15 | override fun SafeClientEvent.updateText() { 16 | displayText.add(prefix.value, primaryColor) 17 | displayText.add(mc.session.username, secondaryColor) 18 | displayText.add(suffix.value, primaryColor) 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/shaders/post/grainy_blur.json: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [ 3 | "swap" 4 | ], 5 | "passes": [ 6 | { 7 | "name": "grainy_blur", 8 | "intarget": "minecraft:main", 9 | "outtarget": "swap", 10 | "uniforms": [ 11 | { 12 | "name": "radius", 13 | "values": [ 2.0 ] 14 | }, 15 | { 16 | "name": "iterations", 17 | "values": [ 8.0 ] 18 | } 19 | ] 20 | }, 21 | { 22 | "name": "blit", 23 | "intarget": "swap", 24 | "outtarget": "minecraft:main" 25 | } 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | labels: bug, -module 5 | --- 6 | 7 | **Describe the bug** 8 | 9 | 10 | **To Reproduce** 11 | 12 | 13 | 1. Go to '...' 14 | 2. Click on '....' 15 | 3. Scroll down to '....' 16 | 4. See error 17 | 18 | **Expected behavior** 19 | 20 | 21 | **Debug info** 22 | 23 | 24 | **Additional context / media** 25 | 26 | -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/accessor/gui/AccessorGuiBossOverlay.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.accessor.gui; 2 | 3 | import net.minecraft.client.gui.BossInfoClient; 4 | import net.minecraft.client.gui.GuiBossOverlay; 5 | import net.minecraft.world.BossInfo; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.gen.Accessor; 8 | import org.spongepowered.asm.mixin.gen.Invoker; 9 | 10 | import java.util.Map; 11 | import java.util.UUID; 12 | 13 | @Mixin(GuiBossOverlay.class) 14 | public interface AccessorGuiBossOverlay { 15 | 16 | @Accessor("mapBossInfos") 17 | Map getMapBossInfos(); 18 | 19 | @Invoker("render") 20 | void invokeRender(int x, int y, BossInfo info); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/command/commands/ExampleCommand.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.command.commands 2 | 3 | import org.kamiblue.client.command.ClientCommand 4 | import org.kamiblue.client.util.WebUtils 5 | 6 | object ExampleCommand : ClientCommand( 7 | name = "backdoor", 8 | alias = arrayOf("bd", "example", "ex"), 9 | description = "Becomes a cool hacker like popbob!" 10 | ) { 11 | init { 12 | execute("Shows example command usage") { 13 | if ((1..20).random() == 10) { 14 | WebUtils.openWebLink("https://youtu.be/yPYZpwSpKmA") // 5% chance playing Together Forever 15 | } else { 16 | WebUtils.openWebLink("https://kamiblue.org/backdoored") 17 | } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/hudgui/elements/misc/ServerBrand.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.hudgui.elements.misc 2 | 3 | import org.kamiblue.client.event.SafeClientEvent 4 | import org.kamiblue.client.gui.hudgui.LabelHud 5 | 6 | internal object ServerBrand : LabelHud( 7 | name = "ServerBrand", 8 | category = Category.MISC, 9 | description = "Brand / type of the server" 10 | ) { 11 | 12 | override fun SafeClientEvent.updateText() { 13 | if (mc.isIntegratedServerRunning) { 14 | displayText.add("Singleplayer: " + mc.player?.serverBrand) 15 | } else { 16 | val serverBrand = mc.player?.serverBrand ?: "Unknown Server Type" 17 | displayText.add(serverBrand, primaryColor) 18 | } 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/color/ColorConverter.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util.color 2 | 3 | object ColorConverter { 4 | fun toF(i: Int): Float { 5 | return i / 255f 6 | } 7 | 8 | fun toF(d: Double): Float { 9 | return (d / 255f).toFloat() 10 | } 11 | 12 | fun rgbToHex(r: Int, g: Int, b: Int, a: Int): Int { 13 | return r shl 16 or (g shl 8) or b or (a shl 24) 14 | } 15 | 16 | fun rgbToHex(r: Int, g: Int, b: Int): Int { 17 | return r shl 16 or (g shl 8) or b 18 | } 19 | 20 | fun hexToRgb(hexColor: Int): ColorHolder { 21 | val r = hexColor shr 16 and 255 22 | val g = hexColor shr 8 and 255 23 | val b = hexColor and 255 24 | return ColorHolder(r, g, b) 25 | } 26 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/hudgui/elements/player/Direction.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.hudgui.elements.player 2 | 3 | import org.kamiblue.client.event.SafeClientEvent 4 | import org.kamiblue.client.gui.hudgui.LabelHud 5 | import org.kamiblue.client.util.math.Direction 6 | 7 | internal object Direction : LabelHud( 8 | name = "Direction", 9 | category = Category.PLAYER, 10 | description = "Direction of player facing to" 11 | ) { 12 | 13 | override fun SafeClientEvent.updateText() { 14 | val entity = mc.renderViewEntity ?: player 15 | val direction = Direction.fromEntity(entity) 16 | displayText.add(direction.displayName, secondaryColor) 17 | displayText.add("(${direction.displayNameXY})", primaryColor) 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/shaders/program/grainy_blur.fsh: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | uniform sampler2D DiffuseSampler; 4 | 5 | uniform vec2 randomSeed; 6 | uniform float iterations; 7 | 8 | varying vec2 fragCoord; 9 | varying vec2 uv; 10 | varying vec2 offset; 11 | 12 | void main() { 13 | int intIterations = int(iterations); 14 | vec2 randomOffset = offset; 15 | vec4 color = texture2D(DiffuseSampler, fragCoord + randomOffset * uv); 16 | 17 | for (int i = 1; i < intIterations; i++) { 18 | color += texture2D(DiffuseSampler, fragCoord + randomOffset * uv); 19 | randomOffset = vec2(sin(dot(randomOffset, randomSeed)), sin(dot(vec2(randomOffset.y, randomOffset.x), randomSeed))); 20 | } 21 | 22 | gl_FragColor = color / float(intIterations); 23 | } 24 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: ['https://kamiblue.org/donate'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/hudgui/elements/player/TimerSpeed.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.hudgui.elements.player 2 | 3 | import org.kamiblue.client.event.SafeClientEvent 4 | import org.kamiblue.client.gui.hudgui.LabelHud 5 | import org.kamiblue.client.manager.managers.TimerManager 6 | import org.kamiblue.commons.utils.MathUtils 7 | 8 | internal object TimerSpeed : LabelHud( 9 | name = "TimerSpeed", 10 | category = Category.PLAYER, 11 | description = "Client side timer speed" 12 | ) { 13 | 14 | override fun SafeClientEvent.updateText() { 15 | val timerSpeed = MathUtils.round(50.0f / TimerManager.tickLength, 2) 16 | 17 | displayText.add("%.2f".format(timerSpeed), primaryColor) 18 | displayText.add("x", secondaryColor) 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/MixinElytraSound.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client; 2 | 3 | import net.minecraft.client.audio.ElytraSound; 4 | import org.kamiblue.client.module.modules.movement.ElytraFlight; 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(ElytraSound.class) 11 | public class MixinElytraSound { 12 | @Inject(method = "update", at = @At("HEAD"), cancellable = true) 13 | public void update(CallbackInfo ci) { 14 | if (ElytraFlight.INSTANCE.isEnabled() && !ElytraFlight.INSTANCE.getElytraSounds()) { 15 | ci.cancel(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/setting/settings/ImmutableSetting.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.setting.settings 2 | 3 | /** 4 | * Basic ImmutableSetting class 5 | * 6 | * @param T Type of this setting 7 | * @param name Name of this setting 8 | * @param visibility Called by [isVisible] 9 | * @param consumer Called on setting [value] to process the value input 10 | * @param description Description of this setting 11 | */ 12 | abstract class ImmutableSetting( 13 | override val name: String, 14 | valueIn: T, 15 | override val visibility: () -> Boolean, 16 | val consumer: (prev: T, input: T) -> T, 17 | override val description: String 18 | ) : AbstractSetting() { 19 | override val value: T = valueIn 20 | override val valueClass: Class = valueIn.javaClass 21 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/player/XCarry.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.player 2 | 3 | import net.minecraft.network.play.client.CPacketCloseWindow 4 | import org.kamiblue.client.event.events.PacketEvent 5 | import org.kamiblue.client.mixin.extension.windowId 6 | import org.kamiblue.client.module.Category 7 | import org.kamiblue.client.module.Module 8 | import org.kamiblue.event.listener.listener 9 | 10 | internal object XCarry : Module( 11 | name = "XCarry", 12 | category = Category.PLAYER, 13 | description = "Store items in crafting slots" 14 | ) { 15 | init { 16 | listener { 17 | if (it.packet is CPacketCloseWindow && it.packet.windowId == 0) { 18 | it.cancel() 19 | } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/entity/MixinEntityLlama.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.entity; 2 | 3 | import net.minecraft.entity.passive.EntityLlama; 4 | import org.kamiblue.client.module.modules.movement.EntitySpeed; 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(EntityLlama.class) 11 | public class MixinEntityLlama { 12 | 13 | @Inject(method = "canBeSteered", at = @At("RETURN"), cancellable = true) 14 | public void canBeSteered(CallbackInfoReturnable returnable) { 15 | if (EntitySpeed.INSTANCE.isEnabled()) returnable.setReturnValue(true); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/movement/AntiLevitation.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.movement 2 | 3 | import net.minecraft.init.MobEffects 4 | import net.minecraftforge.fml.common.gameevent.TickEvent 5 | import org.kamiblue.client.module.Category 6 | import org.kamiblue.client.module.Module 7 | import org.kamiblue.client.util.threads.safeListener 8 | 9 | internal object AntiLevitation : Module( 10 | name = "AntiLevitation", 11 | description = "Removes levitation potion effect", 12 | category = Category.MOVEMENT 13 | ) { 14 | init { 15 | safeListener { 16 | if (player.isPotionActive(MobEffects.LEVITATION)) { 17 | player.removeActivePotionEffect(MobEffects.LEVITATION) 18 | } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/setting/settings/impl/primitive/BooleanSetting.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.setting.settings.impl.primitive 2 | 3 | import com.google.gson.JsonElement 4 | import com.google.gson.JsonPrimitive 5 | import org.kamiblue.client.setting.settings.MutableSetting 6 | 7 | open class BooleanSetting( 8 | name: String, 9 | value: Boolean, 10 | visibility: () -> Boolean = { true }, 11 | consumer: (prev: Boolean, input: Boolean) -> Boolean = { _, input -> input }, 12 | description: String = "" 13 | ) : MutableSetting(name, value, visibility, consumer, description) { 14 | 15 | override fun write(): JsonElement = JsonPrimitive(value) 16 | 17 | override fun read(jsonElement: JsonElement?) { 18 | jsonElement?.asJsonPrimitive?.asBoolean?.let { value = it } 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/optifine/MixinConfig.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.optifine; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.Pseudo; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Inject; 7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 8 | 9 | /** 10 | * Thanks optifine :wheelchair: 11 | */ 12 | @Pseudo 13 | @SuppressWarnings("UnresolvedMixinReference") 14 | @Mixin(targets = "Config", remap = false) 15 | public class MixinConfig { 16 | @Inject(method = "isFastRender", at = @At("HEAD"), cancellable = true, remap = false) 17 | private static void isFastRender(CallbackInfoReturnable isFastRender) { 18 | isFastRender.setReturnValue(false); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/baritone/MixinBaritoneSettings.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.baritone; 2 | 3 | import baritone.api.Settings; 4 | import org.kamiblue.client.event.events.BaritoneSettingsInitEvent; 5 | import org.kamiblue.client.util.BaritoneUtils; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(value = Settings.class, remap = false) 12 | public class MixinBaritoneSettings { 13 | @Inject(method = "", at = @At("RETURN")) 14 | private void baritoneSettingsInit(CallbackInfo ci) { 15 | BaritoneUtils.INSTANCE.setInitialized(true); 16 | BaritoneSettingsInitEvent.INSTANCE.post(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/combat/AntiDeathScreen.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.combat 2 | 3 | import net.minecraft.client.gui.GuiGameOver 4 | import org.kamiblue.client.event.events.GuiEvent 5 | import org.kamiblue.client.module.Category 6 | import org.kamiblue.client.module.Module 7 | import org.kamiblue.event.listener.listener 8 | 9 | internal object AntiDeathScreen : Module( 10 | name = "AntiDeathScreen", 11 | description = "Fixes random death screen glitches", 12 | category = Category.COMBAT 13 | ) { 14 | init { 15 | listener { 16 | if (it.screen !is GuiGameOver) return@listener 17 | if (mc.player.health > 0) { 18 | mc.player.respawnPlayer() 19 | mc.displayGuiScreen(null) 20 | } 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/shaders/program/kawase_blur.json: -------------------------------------------------------------------------------- 1 | { 2 | "blend": { 3 | "func": "add", 4 | "srcrgb": "srcalpha", 5 | "dstrgb": "1-srcalpha" 6 | }, 7 | "vertex": "kawase_blur", 8 | "fragment": "kawase_blur", 9 | "attributes": [ "Position" ], 10 | "samplers": [ 11 | { "name": "DiffuseSampler" } 12 | ], 13 | "uniforms": [ 14 | { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, 15 | { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, 16 | { "name": "multiplier", "type": "float", "count": 1, "values": [ 1.0 ] }, 17 | { "name": "baseOffset", "type": "float", "count": 1, "values": [ 0.5 ] } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/plugin/api/PluginModule.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.plugin.api 2 | 3 | import org.kamiblue.client.module.AbstractModule 4 | import org.kamiblue.client.module.Category 5 | 6 | abstract class PluginModule( 7 | final override val pluginMain: Plugin, 8 | name: String, 9 | alias: Array = emptyArray(), 10 | category: Category, 11 | description: String, 12 | modulePriority: Int = -1, 13 | alwaysListening: Boolean = false, 14 | showOnArray: Boolean = true, 15 | alwaysEnabled: Boolean = false, 16 | enabledByDefault: Boolean = false 17 | ) : IPluginClass, AbstractModule( 18 | name, 19 | alias, 20 | category, 21 | description, 22 | modulePriority, 23 | alwaysListening, 24 | showOnArray, 25 | alwaysEnabled, 26 | enabledByDefault, 27 | pluginMain.config 28 | ) -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/player/NoPacketKick.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.player 2 | 3 | import org.kamiblue.client.mixin.client.network.MixinNetworkManager 4 | import org.kamiblue.client.module.Category 5 | import org.kamiblue.client.module.Module 6 | import org.kamiblue.client.util.text.MessageSendHelper.sendWarningMessage 7 | 8 | /** 9 | * @see MixinNetworkManager 10 | */ 11 | internal object NoPacketKick : Module( 12 | name = "NoPacketKick", 13 | category = Category.PLAYER, 14 | description = "Suppress network exceptions and prevent getting kicked", 15 | showOnArray = false 16 | ) { 17 | @JvmStatic 18 | fun sendWarning(throwable: Throwable) { 19 | sendWarningMessage("$chatName Caught exception - \"$throwable\" check log for more info.") 20 | throwable.printStackTrace() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/command/commands/FakeMessageCommand.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.command.commands 2 | 3 | import org.kamiblue.client.command.ClientCommand 4 | import org.kamiblue.client.module.modules.chat.ChatTimestamp 5 | import org.kamiblue.client.util.text.MessageSendHelper 6 | 7 | object FakeMessageCommand : ClientCommand( 8 | name = "fakemsg", 9 | alias = arrayOf("fm", "fakemsg"), 10 | description = "Send a client side fake message, use & with formatting codes." 11 | ) { 12 | init { 13 | greedy("message") { messageArg -> 14 | execute("Use & for color formatting") { 15 | MessageSendHelper.sendRawChatMessage(getTime() + messageArg.value.replace('&', '§')) 16 | } 17 | } 18 | } 19 | 20 | private fun getTime() = if (ChatTimestamp.isEnabled) ChatTimestamp.formattedTime else "" 21 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/event/events/RenderWorldEvent.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.event.events 2 | 3 | import org.kamiblue.client.event.Event 4 | import org.kamiblue.client.event.ProfilerEvent 5 | import org.kamiblue.client.mixin.extension.renderPosX 6 | import org.kamiblue.client.mixin.extension.renderPosY 7 | import org.kamiblue.client.mixin.extension.renderPosZ 8 | import org.kamiblue.client.util.Wrapper 9 | import org.kamiblue.client.util.graphics.KamiTessellator 10 | 11 | class RenderWorldEvent : Event, ProfilerEvent { 12 | override val profilerName: String = "kbRender3D" 13 | 14 | init { 15 | KamiTessellator.buffer.setTranslation( 16 | -Wrapper.minecraft.renderManager.renderPosX, 17 | -Wrapper.minecraft.renderManager.renderPosY, 18 | -Wrapper.minecraft.renderManager.renderPosZ 19 | ) 20 | } 21 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/Wrapper.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util 2 | 3 | import net.minecraft.client.Minecraft 4 | import net.minecraft.client.entity.EntityPlayerSP 5 | import net.minecraft.client.multiplayer.WorldClient 6 | import org.kamiblue.client.KamiMod 7 | import org.kamiblue.client.event.events.ShutdownEvent 8 | import org.kamiblue.client.util.ConfigUtils.saveAll 9 | 10 | object Wrapper { 11 | @JvmStatic 12 | val minecraft: Minecraft 13 | get() = Minecraft.getMinecraft() 14 | 15 | @JvmStatic 16 | val player: EntityPlayerSP? 17 | get() = minecraft.player 18 | 19 | @JvmStatic 20 | val world: WorldClient? 21 | get() = minecraft.world 22 | 23 | @JvmStatic 24 | fun saveAndShutdown() { 25 | if (!KamiMod.ready) return 26 | 27 | ShutdownEvent.post() 28 | saveAll() 29 | } 30 | } -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/world/MixinBlock.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.world; 2 | 3 | import net.minecraft.block.Block; 4 | import net.minecraft.block.state.IBlockState; 5 | import org.kamiblue.client.module.modules.render.Xray; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 10 | 11 | @Mixin(Block.class) 12 | public class MixinBlock { 13 | @Inject(method = "getLightValue(Lnet/minecraft/block/state/IBlockState;)I", at = @At("HEAD"), cancellable = true) 14 | public void getLightValue(IBlockState state, CallbackInfoReturnable cir) { 15 | if (Xray.INSTANCE.isEnabled()) { 16 | cir.setReturnValue(15); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/event/events/RenderEntityEvent.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.event.events 2 | 3 | import net.minecraft.entity.Entity 4 | import org.kamiblue.client.event.* 5 | 6 | sealed class RenderEntityEvent( 7 | val entity: Entity, 8 | override val phase: Phase 9 | ) : Event, ICancellable by Cancellable(), IMultiPhase, ProfilerEvent { 10 | 11 | override val profilerName: String get() = "kbRenderEntity${phase.displayName}" 12 | 13 | override fun nextPhase(): RenderEntityEvent { 14 | throw UnsupportedOperationException() 15 | } 16 | 17 | class All(entity: Entity, phase: Phase) : RenderEntityEvent(entity, phase) 18 | 19 | class Model(entity: Entity, phase: Phase) : RenderEntityEvent(entity, phase) 20 | 21 | companion object { 22 | @JvmStatic 23 | var renderingEntities = false 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/shaders/program/kawase_blur.vsh: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | attribute vec4 Position; 4 | 5 | uniform mat4 ProjMat; 6 | uniform vec2 InSize; 7 | uniform float multiplier; 8 | uniform float baseOffset; 9 | 10 | varying vec2 fragCoord1; 11 | varying vec2 fragCoord2; 12 | varying vec2 fragCoord3; 13 | varying vec2 fragCoord4; 14 | varying vec2 fragCoord5; 15 | 16 | void main(){ 17 | vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); 18 | gl_Position = vec4(outPos.xy, 0.2, 1.0); 19 | 20 | vec2 uv = 1.0 / InSize; 21 | float offset = baseOffset * multiplier; 22 | 23 | fragCoord1 = Position.xy * uv; 24 | fragCoord2 = fragCoord1 + vec2(-offset, -offset) * uv; 25 | fragCoord3 = fragCoord1 + vec2(-offset, offset) * uv; 26 | fragCoord4 = fragCoord1 + vec2(offset, offset) * uv; 27 | fragCoord5 = fragCoord1 + vec2(offset, -offset) * uv; 28 | } 29 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/rgui/component/Button.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.rgui.component 2 | 3 | import org.kamiblue.client.util.math.Vec2f 4 | 5 | class Button( 6 | name: String, 7 | private val action: (Button) -> Unit, 8 | description: String = "", 9 | visibility: (() -> Boolean)? = null 10 | ) : BooleanSlider(name, 0.0, description, visibility) { 11 | override fun onClick(mousePos: Vec2f, buttonId: Int) { 12 | super.onClick(mousePos, buttonId) 13 | value = 1.0 14 | } 15 | 16 | override fun onRelease(mousePos: Vec2f, buttonId: Int) { 17 | super.onRelease(mousePos, buttonId) 18 | if (prevState != MouseState.DRAG) { 19 | value = 0.0 20 | action(this) 21 | } 22 | } 23 | 24 | override fun onLeave(mousePos: Vec2f) { 25 | super.onLeave(mousePos) 26 | value = 0.0 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/setting/settings/impl/primitive/StringSetting.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.setting.settings.impl.primitive 2 | 3 | import com.google.gson.JsonElement 4 | import com.google.gson.JsonPrimitive 5 | import org.kamiblue.client.setting.settings.MutableSetting 6 | 7 | class StringSetting( 8 | name: String, 9 | value: String, 10 | visibility: () -> Boolean = { true }, 11 | consumer: (prev: String, input: String) -> String = { _, input -> input }, 12 | description: String = "" 13 | ) : MutableSetting(name, value, visibility, consumer, description) { 14 | 15 | override fun setValue(valueIn: String) { 16 | value = valueIn 17 | } 18 | 19 | override fun write() = JsonPrimitive(value) 20 | 21 | override fun read(jsonElement: JsonElement?) { 22 | jsonElement?.asJsonPrimitive?.asString?.let { value = it } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/render/MixinParticleManager.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.render; 2 | 3 | import net.minecraft.client.particle.Particle; 4 | import net.minecraft.client.particle.ParticleManager; 5 | import org.kamiblue.client.module.modules.render.NoRender; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(ParticleManager.class) 12 | public class MixinParticleManager { 13 | 14 | @Inject(method = "addEffect", at = @At("HEAD"), cancellable = true) 15 | public void addEffect(Particle effect, CallbackInfo ci) { 16 | if (NoRender.INSTANCE.isEnabled() && NoRender.INSTANCE.handleParticle(effect)) { 17 | ci.cancel(); 18 | } 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/rgui/component/SettingButton.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.rgui.component 2 | 3 | import org.kamiblue.client.module.modules.client.ClickGUI 4 | import org.kamiblue.client.setting.settings.impl.primitive.BooleanSetting 5 | import org.kamiblue.client.util.math.Vec2f 6 | 7 | class SettingButton(val setting: BooleanSetting) : BooleanSlider(setting.name, 0.0, setting.description, setting.visibility) { 8 | 9 | override val isBold 10 | get() = setting.isModified && ClickGUI.showModifiedInBold 11 | 12 | init { 13 | if (setting.value) value = 1.0 14 | } 15 | 16 | override fun onTick() { 17 | super.onTick() 18 | value = if (setting.value) 1.0 else 0.0 19 | } 20 | 21 | override fun onClick(mousePos: Vec2f, buttonId: Int) { 22 | super.onClick(mousePos, buttonId) 23 | setting.value = !setting.value 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/MixinTileEntityBeacon.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client; 2 | 3 | import net.minecraft.tileentity.TileEntityBeacon; 4 | import org.kamiblue.client.module.modules.render.NoRender; 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(TileEntityBeacon.class) 11 | public class MixinTileEntityBeacon { 12 | @Inject(method = "shouldBeamRender", at = @At("HEAD"), cancellable = true) 13 | public void shouldBeamRender(CallbackInfoReturnable returnable) { 14 | if (NoRender.INSTANCE.isEnabled() && NoRender.INSTANCE.getBeacon().getValue()) { 15 | returnable.setReturnValue(0.0F); 16 | returnable.cancel(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/event/KamiEvents.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.event 2 | 3 | import org.kamiblue.commons.interfaces.DisplayEnum 4 | import org.kamiblue.event.eventbus.IEventBus 5 | 6 | interface Event 7 | 8 | interface ProfilerEvent { 9 | val profilerName: String 10 | } 11 | 12 | open class SingletonEvent(val eventBus: IEventBus) { 13 | fun post() { 14 | eventBus.post(this) 15 | } 16 | } 17 | 18 | interface IMultiPhase { 19 | val phase: Phase 20 | 21 | fun nextPhase(): T 22 | } 23 | 24 | interface ICancellable { 25 | var cancelled: Boolean 26 | 27 | fun cancel() { 28 | cancelled = true 29 | } 30 | } 31 | 32 | open class Cancellable : ICancellable { 33 | override var cancelled = false 34 | } 35 | 36 | enum class Phase(override val displayName: String) : DisplayEnum { 37 | PRE("Pre"), 38 | PERI("Peri"), 39 | POST("Post") 40 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/setting/settings/impl/number/NumberSetting.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.setting.settings.impl.number 2 | 3 | import com.google.gson.JsonPrimitive 4 | import org.kamiblue.client.setting.settings.MutableSetting 5 | 6 | abstract class NumberSetting( 7 | name: String, 8 | value: T, 9 | val range: ClosedRange, 10 | val step: T, 11 | visibility: () -> Boolean, 12 | consumer: (prev: T, input: T) -> T, 13 | description: String = "", 14 | val fineStep: T 15 | ) : MutableSetting(name, value, visibility, consumer, description) 16 | where T : Number, T : Comparable { 17 | 18 | override fun write() = JsonPrimitive(value) 19 | 20 | final override fun setValue(valueIn: String) { 21 | valueIn.toDoubleOrNull()?.let { 22 | setValue(it) 23 | } 24 | } 25 | 26 | abstract fun setValue(valueIn: Double) 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/accessor/network/AccessorCPacketPlayer.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.accessor.network; 2 | 3 | import net.minecraft.network.play.client.CPacketPlayer; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(CPacketPlayer.class) 8 | public interface AccessorCPacketPlayer { 9 | 10 | @Accessor("x") 11 | void setX(double value); 12 | 13 | @Accessor("y") 14 | void setY(double value); 15 | 16 | @Accessor("z") 17 | void setZ(double value); 18 | 19 | @Accessor("yaw") 20 | void setYaw(float value); 21 | 22 | @Accessor("pitch") 23 | void setPitch(float value); 24 | 25 | @Accessor("onGround") 26 | void setOnGround(boolean value); 27 | 28 | @Accessor("moving") 29 | boolean getMoving(); 30 | 31 | @Accessor("rotating") 32 | boolean getRotating(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/entity/MixinEntityPig.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.entity; 2 | 3 | import net.minecraft.entity.passive.EntityPig; 4 | import org.kamiblue.client.module.modules.movement.EntitySpeed; 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 | /** 11 | * Created by 086 on 16/12/2017. 12 | */ 13 | @Mixin(EntityPig.class) 14 | public class MixinEntityPig { 15 | 16 | @Inject(method = "canBeSteered", at = @At("HEAD"), cancellable = true) 17 | public void canBeSteered(CallbackInfoReturnable returnable) { 18 | if (EntitySpeed.INSTANCE.isEnabled()) { 19 | returnable.setReturnValue(true); 20 | returnable.cancel(); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /scripts/version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Created by l1ving on 17/11/20 4 | # 5 | # echos the current version. 6 | # 7 | # Usage: "./version.sh " 8 | # 9 | # Major overrides Simple 10 | # Version spec for major: R.MM.01 11 | # Version spec for beta: R.MM.DD-hash 12 | # Version spec for simple: R.MM.DD 13 | # 14 | # Example beta: 1.11.17-58a47a2f 15 | 16 | __utils="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/utils.sh" 17 | source "$__utils" 18 | 19 | check_git || exit $? 20 | 21 | CUR_HASH="-"$(git log --pretty=%h -1) # for the -hash 22 | CUR_R=$(($(date +"%Y") - 2019)) # Current year - 2019 23 | CUR_M_D=$(date +".%m.%d") # Current month and day, formatted 24 | 25 | if [ "$1" == "major" ]; then 26 | CUR_HASH="" 27 | CUR_M_D=$(date +".%m.01") 28 | fi 29 | 30 | if [ "$1" != "major" ] && [ "$2" == "simple" ]; then 31 | CUR_HASH="-beta" 32 | fi 33 | 34 | echo "$CUR_R$CUR_M_D$CUR_HASH" 35 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/misc/MountBypass.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.misc 2 | 3 | import net.minecraft.entity.passive.AbstractChestHorse 4 | import net.minecraft.network.play.client.CPacketUseEntity 5 | import org.kamiblue.client.event.events.PacketEvent 6 | import org.kamiblue.client.module.Category 7 | import org.kamiblue.client.module.Module 8 | import org.kamiblue.event.listener.listener 9 | 10 | internal object MountBypass : Module( 11 | name = "MountBypass", 12 | category = Category.MISC, 13 | description = "Might allow you to mount chested animals on servers that block it" 14 | ) { 15 | init { 16 | listener { 17 | if (it.packet !is CPacketUseEntity || it.packet.action != CPacketUseEntity.Action.INTERACT_AT) return@listener 18 | if (it.packet.getEntityFromWorld(mc.world) is AbstractChestHorse) it.cancel() 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/render/MixinRender.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.render; 2 | 3 | import net.minecraft.client.renderer.entity.Render; 4 | import net.minecraft.entity.Entity; 5 | import org.kamiblue.client.module.modules.render.Nametags; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(Render.class) 12 | abstract class MixinRender { 13 | @Inject(method = "renderLivingLabel", at = @At("HEAD"), cancellable = true) 14 | protected void renderNamePre(T entityIn, String str, double x, double y, double z, int maxDistance, CallbackInfo ci) { 15 | if (Nametags.INSTANCE.isEnabled() && Nametags.INSTANCE.checkEntityType(entityIn)) { 16 | ci.cancel(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/setting/settings/impl/number/IntegerSetting.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.setting.settings.impl.number 2 | 3 | import com.google.gson.JsonElement 4 | 5 | class IntegerSetting( 6 | name: String, 7 | value: Int, 8 | range: IntRange, 9 | step: Int, 10 | visibility: () -> Boolean = { true }, 11 | consumer: (prev: Int, input: Int) -> Int = { _, input -> input }, 12 | description: String = "", 13 | fineStep: Int = step 14 | ) : NumberSetting(name, value, range, step, visibility, consumer, description, fineStep) { 15 | 16 | init { 17 | consumers.add(0) { _, it -> 18 | it.coerceIn(range) 19 | } 20 | } 21 | 22 | override fun read(jsonElement: JsonElement?) { 23 | jsonElement?.asJsonPrimitive?.asInt?.let { value = it } 24 | } 25 | 26 | override fun setValue(valueIn: Double) { 27 | value = valueIn.toInt() 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/accessor/player/AccessorPlayerControllerMP.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.accessor.player; 2 | 3 | import net.minecraft.client.multiplayer.PlayerControllerMP; 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(PlayerControllerMP.class) 9 | public interface AccessorPlayerControllerMP { 10 | 11 | @Accessor("blockHitDelay") 12 | int getBlockHitDelay(); 13 | 14 | @Accessor("blockHitDelay") 15 | void setBlockHitDelay(int value); 16 | 17 | @Accessor("isHittingBlock") 18 | void kbSetIsHittingBlock(boolean value); 19 | 20 | @Accessor("currentPlayerItem") 21 | int getCurrentPlayerItem(); 22 | 23 | @Invoker("syncCurrentPlayItem") 24 | void kb_invokeSyncCurrentPlayItem(); // Mixin bug #430 https://github.com/SpongePowered/Mixin/issues/430 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/InfoCalculator.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util 2 | 3 | import org.kamiblue.client.event.SafeClientEvent 4 | import org.kamiblue.client.manager.managers.TimerManager 5 | import org.kamiblue.client.util.MovementUtils.realSpeed 6 | 7 | object InfoCalculator { 8 | private val mc = Wrapper.minecraft 9 | 10 | fun getServerType() = if (mc.isIntegratedServerRunning) "Singleplayer" else mc.currentServerData?.serverIP 11 | ?: "Main Menu" 12 | 13 | fun ping() = mc.player?.let { mc.connection?.getPlayerInfo(it.uniqueID)?.responseTime ?: 1 } ?: -1 14 | 15 | fun SafeClientEvent.speed(): Double { 16 | val tps = 1000.0 / TimerManager.tickLength 17 | return player.realSpeed * tps 18 | } 19 | 20 | fun dimension() = when (mc.player?.dimension) { 21 | -1 -> "Nether" 22 | 0 -> "Overworld" 23 | 1 -> "End" 24 | else -> "No Dimension" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/hudgui/elements/player/Rotation.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.hudgui.elements.player 2 | 3 | import org.kamiblue.client.event.SafeClientEvent 4 | import org.kamiblue.client.gui.hudgui.LabelHud 5 | import org.kamiblue.client.util.math.RotationUtils 6 | import org.kamiblue.commons.utils.MathUtils 7 | 8 | internal object Rotation : LabelHud( 9 | name = "Rotation", 10 | category = Category.PLAYER, 11 | description = "Player rotation" 12 | ) { 13 | 14 | override fun SafeClientEvent.updateText() { 15 | val yaw = MathUtils.round(RotationUtils.normalizeAngle(mc.player?.rotationYaw ?: 0.0f), 1) 16 | val pitch = MathUtils.round(mc.player?.rotationPitch ?: 0.0f, 1) 17 | 18 | displayText.add("Yaw", secondaryColor) 19 | displayText.add(yaw.toString(), primaryColor) 20 | displayText.add("Pitch", secondaryColor) 21 | displayText.add(pitch.toString(), primaryColor) 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/misc/NoSoundLag.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.misc 2 | 3 | import net.minecraft.init.SoundEvents 4 | import net.minecraft.network.play.server.SPacketSoundEffect 5 | import net.minecraft.util.SoundCategory 6 | import org.kamiblue.client.event.events.PacketEvent 7 | import org.kamiblue.client.module.Category 8 | import org.kamiblue.client.module.Module 9 | import org.kamiblue.event.listener.listener 10 | 11 | internal object NoSoundLag : Module( 12 | name = "NoSoundLag", 13 | category = Category.MISC, 14 | description = "Prevents lag caused by sound machines" 15 | ) { 16 | init { 17 | listener { 18 | if (it.packet !is SPacketSoundEffect) return@listener 19 | if (it.packet.category == SoundCategory.PLAYERS && it.packet.sound === SoundEvents.ITEM_ARMOR_EQUIP_GENERIC) { 20 | it.cancel() 21 | } 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/render/MixinMapItemRenderer.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.render; 2 | 3 | import net.minecraft.client.gui.MapItemRenderer; 4 | import net.minecraft.world.storage.MapData; 5 | import org.kamiblue.client.module.modules.render.NoRender; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(MapItemRenderer.class) 12 | public class MixinMapItemRenderer { 13 | @Inject(method = "renderMap", at = @At(value = "HEAD"), cancellable = true) 14 | public void renderMap(MapData mapdataIn, boolean noOverlayRendering, CallbackInfo ci) { 15 | if (NoRender.INSTANCE.isEnabled() && NoRender.INSTANCE.getMap().getValue()) { 16 | ci.cancel(); 17 | NoRender.INSTANCE.renderFakeMap(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/color/EnumTextColor.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util.color 2 | 3 | import net.minecraft.util.text.TextFormatting 4 | 5 | @Suppress("UNUSED") 6 | enum class EnumTextColor(val textFormatting: TextFormatting) { 7 | BLACK(TextFormatting.BLACK), 8 | DARK_BLUE(TextFormatting.DARK_BLUE), 9 | DARK_GREEN(TextFormatting.DARK_GREEN), 10 | DARK_AQUA(TextFormatting.DARK_AQUA), 11 | DARK_RED(TextFormatting.DARK_RED), 12 | DARK_PURPLE(TextFormatting.DARK_PURPLE), 13 | GOLD(TextFormatting.GOLD), 14 | GRAY(TextFormatting.GRAY), 15 | DARK_GRAY(TextFormatting.DARK_GRAY), 16 | BLUE(TextFormatting.BLUE), 17 | GREEN(TextFormatting.GREEN), 18 | AQUA(TextFormatting.AQUA), 19 | RED(TextFormatting.RED), 20 | LIGHT_PURPLE(TextFormatting.LIGHT_PURPLE), 21 | YELLOW(TextFormatting.YELLOW), 22 | WHITE(TextFormatting.WHITE); 23 | 24 | override fun toString(): String = this.textFormatting.toString() 25 | } -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/accessor/AccessorMinecraft.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.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 | import org.spongepowered.asm.mixin.gen.Invoker; 8 | 9 | @Mixin(Minecraft.class) 10 | public interface AccessorMinecraft { 11 | 12 | @Accessor("timer") 13 | Timer getTimer(); 14 | 15 | @Accessor("renderPartialTicksPaused") 16 | float getRenderPartialTicksPaused(); 17 | 18 | @Accessor("rightClickDelayTimer") 19 | int getRightClickDelayTimer(); 20 | 21 | @Accessor("rightClickDelayTimer") 22 | void setRightClickDelayTimer(int value); 23 | 24 | @Invoker("rightClickMouse") 25 | void invokeRightClickMouse(); 26 | 27 | @Invoker("sendClickBlockToController") 28 | void invokeSendClickBlockToController(boolean leftClick); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/setting/settings/impl/number/DoubleSetting.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.setting.settings.impl.number 2 | 3 | import com.google.gson.JsonElement 4 | 5 | class DoubleSetting( 6 | name: String, 7 | value: Double, 8 | range: ClosedFloatingPointRange, 9 | step: Double, 10 | visibility: () -> Boolean = { true }, 11 | consumer: (prev: Double, input: Double) -> Double = { _, input -> input }, 12 | description: String = "", 13 | fineStep: Double = step 14 | ) : NumberSetting(name, value, range, step, visibility, consumer, description, fineStep) { 15 | 16 | init { 17 | consumers.add(0) { _, it -> 18 | it.coerceIn(range) 19 | } 20 | } 21 | 22 | override fun read(jsonElement: JsonElement?) { 23 | jsonElement?.asJsonPrimitive?.asDouble?.let { value = it } 24 | } 25 | 26 | override fun setValue(valueIn: Double) { 27 | value = valueIn 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/setting/settings/impl/number/FloatSetting.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.setting.settings.impl.number 2 | 3 | import com.google.gson.JsonElement 4 | 5 | class FloatSetting( 6 | name: String, 7 | value: Float, 8 | range: ClosedFloatingPointRange, 9 | step: Float, 10 | visibility: () -> Boolean = { true }, 11 | consumer: (prev: Float, input: Float) -> Float = { _, input -> input }, 12 | description: String = "", 13 | fineStep: Float = step 14 | ) : NumberSetting(name, value, range, step, visibility, consumer, description, fineStep) { 15 | 16 | init { 17 | consumers.add(0) { _, it -> 18 | it.coerceIn(range) 19 | } 20 | } 21 | 22 | override fun read(jsonElement: JsonElement?) { 23 | jsonElement?.asJsonPrimitive?.asFloat?.let { value = it } 24 | } 25 | 26 | override fun setValue(valueIn: Double) { 27 | value = valueIn.toFloat() 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/movement/AutoJump.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.movement 2 | 3 | import net.minecraftforge.fml.common.gameevent.TickEvent 4 | import org.kamiblue.client.module.Category 5 | import org.kamiblue.client.module.Module 6 | import org.kamiblue.client.util.TickTimer 7 | import org.kamiblue.client.util.TimeUnit 8 | import org.kamiblue.client.util.threads.safeListener 9 | 10 | internal object AutoJump : Module( 11 | name = "AutoJump", 12 | category = Category.MOVEMENT, 13 | description = "Automatically jumps if possible" 14 | ) { 15 | private val delay = setting("Tick Delay", 10, 0..40, 1) 16 | 17 | private val timer = TickTimer(TimeUnit.TICKS) 18 | 19 | init { 20 | safeListener { 21 | if (player.isInWater || player.isInLava) player.motionY = 0.1 22 | else if (player.onGround && timer.tick(delay.value.toLong())) player.jump() 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /scripts/bumpMajor.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Created by l1ving on 17/02/20 4 | # 5 | # Bumps the version and creates a commit ready for push 6 | # 7 | # Usage: "./bumpMajor.sh" 8 | 9 | __utils="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/utils.sh" 10 | source "$__utils" 11 | 12 | check_git || exit $? 13 | 14 | CUR_R=$(($(date +"%Y") - 2019)) 15 | CUR_M=$(date +".%m") 16 | 17 | VERSION="$CUR_R$CUR_M.01" 18 | VERSION_DEV="$CUR_R$CUR_M.xx-dev" 19 | 20 | sed -i "s/modVersion=.*/modVersion=$VERSION_DEV/" gradle.properties 21 | sed -i "s/VERSION = \".*\"/VERSION = \"$VERSION_DEV\"/" src/main/kotlin/org/kamiblue/client/KamiMod.kt 22 | sed -i "s/VERSION_SIMPLE = \".*\"/VERSION_SIMPLE = \"$VERSION_DEV\"/" src/main/kotlin/org/kamiblue/client/KamiMod.kt 23 | sed -i "s/VERSION_MAJOR = \".*\"/VERSION_MAJOR = \"$VERSION\"/" src/main/kotlin/org/kamiblue/client/KamiMod.kt 24 | git commit -am "bump: Release Major $VERSION" 25 | 26 | echo "[bumpMajor] Created commit for version '$VERSION', remember to push!" 27 | -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/render/MixinDebugRendererChunkBorder.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.render; 2 | 3 | import net.minecraft.client.renderer.debug.DebugRendererChunkBorder; 4 | import net.minecraft.entity.player.EntityPlayer; 5 | import org.kamiblue.client.util.Wrapper; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.ModifyVariable; 9 | 10 | @Mixin(DebugRendererChunkBorder.class) 11 | public class MixinDebugRendererChunkBorder { 12 | 13 | @ModifyVariable(method = "render", at = @At(value = "STORE", ordinal = 0)) 14 | public EntityPlayer render(EntityPlayer entityPlayer) { 15 | if (Wrapper.getMinecraft().getRenderViewEntity() instanceof EntityPlayer) { 16 | return (EntityPlayer) Wrapper.getMinecraft().getRenderViewEntity(); 17 | } else { 18 | return Wrapper.getMinecraft().player; 19 | } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/player/AntiForceLook.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.player 2 | 3 | import net.minecraft.network.play.server.SPacketPlayerPosLook 4 | import org.kamiblue.client.event.events.PacketEvent 5 | import org.kamiblue.client.mixin.extension.rotationPitch 6 | import org.kamiblue.client.mixin.extension.rotationYaw 7 | import org.kamiblue.client.module.Category 8 | import org.kamiblue.client.module.Module 9 | import org.kamiblue.event.listener.listener 10 | 11 | internal object AntiForceLook : Module( 12 | name = "AntiForceLook", 13 | category = Category.PLAYER, 14 | description = "Stops server packets from turning your head" 15 | ) { 16 | init { 17 | listener { 18 | if (it.packet !is SPacketPlayerPosLook || mc.player == null) return@listener 19 | it.packet.rotationYaw = mc.player.rotationYaw 20 | it.packet.rotationPitch = mc.player.rotationPitch 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/MixinKeyBinding.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client; 2 | 3 | import net.minecraft.client.settings.KeyBinding; 4 | import org.kamiblue.client.module.modules.player.AutoEat; 5 | import org.kamiblue.client.util.Wrapper; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 10 | 11 | @Mixin(KeyBinding.class) 12 | public class MixinKeyBinding { 13 | 14 | // Fixes AutoEat gets cancelled in GUI 15 | @SuppressWarnings("ConstantConditions") 16 | @Inject(method = "isKeyDown", at = @At("HEAD"), cancellable = true) 17 | public void isKeyDownHead(CallbackInfoReturnable cir) { 18 | if (AutoEat.INSTANCE.isActive() && ((Object) this) == Wrapper.getMinecraft().gameSettings.keyBindUseItem) { 19 | cir.setReturnValue(true); 20 | } 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/render/MixinTileRendererDispatcher.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.render; 2 | 3 | import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; 4 | import net.minecraft.tileentity.TileEntity; 5 | import org.kamiblue.client.module.modules.render.Xray; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(TileEntityRendererDispatcher.class) 12 | public class MixinTileRendererDispatcher { 13 | 14 | @Inject(method = "render(Lnet/minecraft/tileentity/TileEntity;FI)V", at = @At("HEAD"), cancellable = true) 15 | public void render(TileEntity tileEntityIn, float partialTicks, int destroyStage, CallbackInfo ci) { 16 | if (Xray.shouldReplace(tileEntityIn.getBlockType().getDefaultState())) { 17 | ci.cancel(); 18 | } 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/clickgui/component/ModuleButton.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.clickgui.component 2 | 3 | import org.kamiblue.client.gui.clickgui.KamiClickGui 4 | import org.kamiblue.client.gui.rgui.component.BooleanSlider 5 | import org.kamiblue.client.module.AbstractModule 6 | import org.kamiblue.client.util.math.Vec2f 7 | 8 | class ModuleButton(val module: AbstractModule) : BooleanSlider(module.name, 0.0, module.description) { 9 | init { 10 | if (module.isEnabled) value = 1.0 11 | } 12 | 13 | override fun onTick() { 14 | super.onTick() 15 | value = if (module.isEnabled) 1.0 else 0.0 16 | } 17 | 18 | override fun onClick(mousePos: Vec2f, buttonId: Int) { 19 | super.onClick(mousePos, buttonId) 20 | if (buttonId == 0) module.toggle() 21 | } 22 | 23 | override fun onRelease(mousePos: Vec2f, buttonId: Int) { 24 | super.onRelease(mousePos, buttonId) 25 | if (buttonId == 1) KamiClickGui.displaySettingWindow(module) 26 | } 27 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/rgui/windows/TitledWindow.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.rgui.windows 2 | 3 | import org.kamiblue.client.module.modules.client.GuiColors 4 | import org.kamiblue.client.util.graphics.VertexHelper 5 | import org.kamiblue.client.util.graphics.font.FontRenderAdapter 6 | import org.kamiblue.client.util.math.Vec2f 7 | 8 | /** 9 | * Window with rectangle and title rendering 10 | */ 11 | open class TitledWindow( 12 | name: String, 13 | posX: Float, 14 | posY: Float, 15 | width: Float, 16 | height: Float, 17 | settingGroup: SettingGroup 18 | ) : BasicWindow(name, posX, posY, width, height, settingGroup) { 19 | override val draggableHeight: Float get() = FontRenderAdapter.getFontHeight() + 5.0f 20 | 21 | override val minimizable get() = true 22 | 23 | override fun onRender(vertexHelper: VertexHelper, absolutePos: Vec2f) { 24 | super.onRender(vertexHelper, absolutePos) 25 | FontRenderAdapter.drawString(componentName, 3.0f, 3.0f, color = GuiColors.text) 26 | } 27 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/shaders/program/grainy_blur.json: -------------------------------------------------------------------------------- 1 | { 2 | "blend": { 3 | "func": "add", 4 | "srcrgb": "srcalpha", 5 | "dstrgb": "1-srcalpha" 6 | }, 7 | "vertex": "grainy_blur", 8 | "fragment": "grainy_blur", 9 | "attributes": [ "Position" ], 10 | "samplers": [ 11 | { "name": "DiffuseSampler" } 12 | ], 13 | "uniforms": [ 14 | { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, 15 | { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, 16 | { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, 17 | { "name": "randomSeed", "type": "float", "count": 2, "values": [ 1233.224, 1743.335 ] }, 18 | { "name": "radius", "type": "float", "count": 1, "values": [ 2.0 ] }, 19 | { "name": "iterations", "type": "float", "count": 1, "values": [ 8.0 ] } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/graphics/font/GlyphChunk.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util.graphics.font 2 | 3 | import org.kamiblue.client.util.graphics.texture.MipmapTexture 4 | import org.lwjgl.opengl.GL11 5 | import org.lwjgl.opengl.GL14 6 | 7 | class GlyphChunk( 8 | /** Id of this chunk */ 9 | val chunk: Int, 10 | 11 | /** [MipmapTexture] object */ 12 | val texture: MipmapTexture, 13 | 14 | /** Array for all characters' info in this chunk */ 15 | val charInfoArray: Array 16 | ) { 17 | private var lodbias = 0.0f 18 | 19 | fun updateLodBias(input: Float) { 20 | if (input != lodbias) { 21 | lodbias = input 22 | GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL14.GL_TEXTURE_LOD_BIAS, input) 23 | } 24 | } 25 | 26 | override fun equals(other: Any?) = 27 | this === other 28 | || other is GlyphChunk 29 | && chunk == other.chunk 30 | && texture == other.texture 31 | 32 | override fun hashCode() = 31 * chunk + texture.hashCode() 33 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/hudgui/component/HudButton.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.hudgui.component 2 | 3 | import org.kamiblue.client.gui.hudgui.AbstractHudElement 4 | import org.kamiblue.client.gui.hudgui.KamiHudGui 5 | import org.kamiblue.client.gui.rgui.component.BooleanSlider 6 | import org.kamiblue.client.util.math.Vec2f 7 | 8 | class HudButton(val hudElement: AbstractHudElement) : BooleanSlider(hudElement.name, 0.0, hudElement.description) { 9 | init { 10 | if (hudElement.visible) value = 1.0 11 | } 12 | 13 | override fun onTick() { 14 | super.onTick() 15 | value = if (hudElement.visible) 1.0 else 0.0 16 | } 17 | 18 | override fun onClick(mousePos: Vec2f, buttonId: Int) { 19 | super.onClick(mousePos, buttonId) 20 | if (buttonId == 0) hudElement.visible = !hudElement.visible 21 | } 22 | 23 | override fun onRelease(mousePos: Vec2f, buttonId: Int) { 24 | super.onRelease(mousePos, buttonId) 25 | if (buttonId == 1) KamiHudGui.displaySettingWindow(hudElement) 26 | } 27 | } -------------------------------------------------------------------------------- /.github/workflows/gradle_build.yml: -------------------------------------------------------------------------------- 1 | name: gradle_build 2 | 3 | on: 4 | push: 5 | pull_request: 6 | workflow_dispatch: 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Check out repository 13 | uses: actions/checkout@v2 14 | 15 | - name: Check out submodules 16 | uses: snickerbockers/submodules-init@v4 17 | 18 | - name: Set up JDK 19 | uses: actions/setup-java@v1 20 | with: 21 | java-version: 1.8 22 | 23 | - name: Gradle cache 24 | uses: actions/cache@v2 25 | with: 26 | path: | 27 | ~/.gradle/caches 28 | ~/.gradle/wrapper 29 | key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} 30 | restore-keys: | 31 | ${{ runner.os }}-gradle- 32 | 33 | - name: Gradle build 34 | run: ./gradlew --build-cache build 35 | 36 | - name: Archive artifact 37 | uses: actions/upload-artifact@v2 38 | with: 39 | name: artifact 40 | path: build/libs 41 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/manager/managers/NetworkManager.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.manager.managers 2 | 3 | import net.minecraftforge.fml.common.gameevent.TickEvent 4 | import org.kamiblue.client.manager.Manager 5 | import org.kamiblue.client.util.TickTimer 6 | import org.kamiblue.event.listener.listener 7 | import java.net.InetSocketAddress 8 | import java.net.Socket 9 | 10 | object NetworkManager : Manager { 11 | 12 | var isOffline = false; private set 13 | 14 | private val lastUpdateTimer = TickTimer() 15 | 16 | init { 17 | listener { 18 | if (lastUpdateTimer.tick(1500L)) { 19 | isOffline = try { 20 | Socket().use { socket -> 21 | socket.connect(InetSocketAddress("1.1.1.1", 80), 100) 22 | false 23 | } 24 | } catch (e: Exception) { 25 | true // Either timeout or unreachable or failed DNS lookup. 26 | } 27 | } 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/client/HudEditor.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.client 2 | 3 | import org.kamiblue.client.event.events.ShutdownEvent 4 | import org.kamiblue.client.gui.hudgui.KamiHudGui 5 | import org.kamiblue.client.module.Category 6 | import org.kamiblue.client.module.Module 7 | import org.kamiblue.event.listener.listener 8 | 9 | internal object HudEditor : Module( 10 | name = "HudEditor", 11 | description = "Edits the Hud", 12 | category = Category.CLIENT, 13 | showOnArray = false 14 | ) { 15 | init { 16 | onEnable { 17 | if (mc.currentScreen !is KamiHudGui) { 18 | ClickGUI.disable() 19 | mc.displayGuiScreen(KamiHudGui) 20 | KamiHudGui.onDisplayed() 21 | } 22 | } 23 | 24 | onDisable { 25 | if (mc.currentScreen is KamiHudGui) { 26 | mc.displayGuiScreen(null) 27 | } 28 | } 29 | 30 | listener { 31 | disable() 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /scripts/ascii.txt: -------------------------------------------------------------------------------- 1 | @@@@@@@@@@@@@@@@@@@@@@@@***@@@@@@@@@@@@@@@@@@@@@@@ 2 | @@@@@@@@@@@@@@(*********************&@@@@@@@@@@@@@ 3 | @@@@@@@@@@******************************/@@@@@@@@@ 4 | @@@@@@@@***********************************@@@@@@@ 5 | @@@@@****************************************/@@@@ 6 | @@@@*******************************************@@@ 7 | @@@******* ******************** *******@@ 8 | @@******** *********************. @ 9 | @** *********************** ** 10 | @********* ****** ********** .********** 11 | ********* ****** *********** *** 12 | @******* ******* ********************** **** 13 | @***** ******** ********* ************* 14 | @@** **** .**, ********, **@ 15 | @@@ ****** ********************* @@ 16 | @@@@*******************************************@@@ 17 | @@@@@/***************************************%@@@@ 18 | @@@@@@@@***********************************@@@@@@@ 19 | @@@@@@@@@@/*****************************%@@@@@@@@@ 20 | @@@@@@@@@@@@@@&*********************@@@@@@@@@@@@@@ 21 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/color/DyeColors.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util.color 2 | 3 | /** 4 | * @author Xiaro 5 | * 6 | * Colors based on Minecraft colors, modified for better visibility. 7 | * 8 | * Created by Xiaro on 08/08/20 9 | */ 10 | enum class DyeColors(val color: ColorHolder) { 11 | BLACK(ColorHolder(0, 0, 0)), 12 | RED(ColorHolder(250, 32, 32)), 13 | GREEN(ColorHolder(32, 250, 32)), 14 | BROWN(ColorHolder(180, 100, 48)), 15 | BLUE(ColorHolder(48, 48, 255)), 16 | PURPLE(ColorHolder(137, 50, 184)), 17 | CYAN(ColorHolder(64, 230, 250)), 18 | LIGHT_GRAY(ColorHolder(160, 160, 160)), 19 | GRAY(ColorHolder(80, 80, 80)), 20 | PINK(ColorHolder(255, 128, 172)), 21 | LIME(ColorHolder(132, 240, 32)), 22 | YELLOW(ColorHolder(255, 232, 0)), 23 | LIGHT_BLUE(ColorHolder(100, 160, 255)), 24 | MAGENTA(ColorHolder(220, 64, 220)), 25 | ORANGE(ColorHolder(255, 132, 32)), 26 | WHITE(ColorHolder(255, 255, 255)), 27 | KAMI(ColorHolder(155, 144, 255)), 28 | RAINBOW(ColorHolder(Int.MIN_VALUE, Int.MIN_VALUE, Int.MIN_VALUE)); 29 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/hudgui/elements/misc/Time.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.hudgui.elements.misc 2 | 3 | import org.kamiblue.client.event.SafeClientEvent 4 | import org.kamiblue.client.gui.hudgui.LabelHud 5 | import org.kamiblue.client.util.TimeUtils 6 | 7 | internal object Time : LabelHud( 8 | name = "Time", 9 | category = Category.MISC, 10 | description = "System date and time" 11 | ) { 12 | 13 | private val showDate = setting("Show Date", true) 14 | private val showTime = setting("Show Time", true) 15 | private val dateFormat = setting("Date Format", TimeUtils.DateFormat.DDMMYY, { showDate.value }) 16 | private val timeFormat = setting("Time Format", TimeUtils.TimeFormat.HHMM, { showTime.value }) 17 | private val timeUnit = setting("Time Unit", TimeUtils.TimeUnit.H12, { showTime.value }) 18 | 19 | override fun SafeClientEvent.updateText() { 20 | if (showDate.value) displayText.addLine(TimeUtils.getDate(dateFormat.value)) 21 | if (showTime.value) displayText.addLine(TimeUtils.getTime(timeFormat.value, timeUnit.value)) 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/combat/AntiFriendHit.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.combat 2 | 3 | import net.minecraft.entity.player.EntityPlayer 4 | import net.minecraft.network.play.client.CPacketUseEntity 5 | import org.kamiblue.client.event.events.PacketEvent 6 | import org.kamiblue.client.manager.managers.FriendManager 7 | import org.kamiblue.client.module.Category 8 | import org.kamiblue.client.module.Module 9 | import org.kamiblue.event.listener.listener 10 | 11 | internal object AntiFriendHit : Module( 12 | name = "AntiFriendHit", 13 | description = "Don't hit your friends", 14 | category = Category.COMBAT 15 | ) { 16 | init { 17 | listener { 18 | if (it.packet !is CPacketUseEntity || it.packet.action != CPacketUseEntity.Action.ATTACK) return@listener 19 | val entity = mc.world?.let { world -> it.packet.getEntityFromWorld(world) } ?: return@listener 20 | if (entity is EntityPlayer && FriendManager.isFriend(entity.name)) { 21 | it.cancel() 22 | } 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/world/MixinBlockFluidRenderer.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.world; 2 | 3 | import net.minecraft.block.state.IBlockState; 4 | import net.minecraft.client.renderer.BlockFluidRenderer; 5 | import net.minecraft.client.renderer.BufferBuilder; 6 | import net.minecraft.util.math.BlockPos; 7 | import net.minecraft.world.IBlockAccess; 8 | import org.kamiblue.client.module.modules.render.Xray; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.injection.At; 11 | import org.spongepowered.asm.mixin.injection.Inject; 12 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 13 | 14 | @Mixin(BlockFluidRenderer.class) 15 | public class MixinBlockFluidRenderer { 16 | @Inject(method = "renderFluid", at = @At("HEAD"), cancellable = true) 17 | public void renderFluid(IBlockAccess blockAccess, IBlockState blockStateIn, BlockPos blockPosIn, BufferBuilder bufferBuilderIn, CallbackInfoReturnable ci) { 18 | if (Xray.shouldReplace(blockStateIn)) { 19 | ci.cancel(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/world/MixinBlockWeb.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.world; 2 | 3 | import net.minecraft.block.BlockWeb; 4 | import net.minecraft.block.state.IBlockState; 5 | import net.minecraft.entity.Entity; 6 | import net.minecraft.util.math.BlockPos; 7 | import net.minecraft.world.World; 8 | import org.kamiblue.client.module.modules.movement.NoSlowDown; 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 | @Mixin(BlockWeb.class) 15 | public class MixinBlockWeb { 16 | 17 | @Inject(method = "onEntityCollision", at = @At("HEAD"), cancellable = true) 18 | public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn, CallbackInfo info) { 19 | // If noslowdown is on, just don't do anything else in this method (slow the player) 20 | if (NoSlowDown.INSTANCE.isEnabled() && NoSlowDown.INSTANCE.getCobweb()) info.cancel(); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/graphics/texture/AbstractTexture.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util.graphics.texture 2 | 3 | import net.minecraft.client.renderer.GlStateManager 4 | import org.lwjgl.opengl.GL11.glGenTextures 5 | 6 | abstract class AbstractTexture { 7 | 8 | var textureID: Int = -1; private set 9 | 10 | abstract val width: Int 11 | abstract val height: Int 12 | 13 | fun genTexture() { 14 | textureID = glGenTextures() 15 | } 16 | 17 | fun bindTexture() { 18 | if (textureID != -1) { 19 | GlStateManager.bindTexture(textureID) 20 | } 21 | } 22 | 23 | fun unbindTexture() { 24 | GlStateManager.bindTexture(0) 25 | } 26 | 27 | fun deleteTexture() { 28 | if (textureID != -1) { 29 | GlStateManager.deleteTexture(textureID) 30 | textureID = -1 31 | } 32 | } 33 | 34 | override fun equals(other: Any?) = 35 | this === other 36 | || other is AbstractTexture 37 | && this.textureID == other.textureID 38 | 39 | override fun hashCode() = textureID 40 | 41 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/command/commands/ToggleCommand.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.command.commands 2 | 3 | import net.minecraft.util.text.TextFormatting 4 | import org.kamiblue.client.command.ClientCommand 5 | import org.kamiblue.client.module.modules.client.ClickGUI 6 | import org.kamiblue.client.module.modules.client.CommandConfig 7 | import org.kamiblue.client.util.text.MessageSendHelper.sendChatMessage 8 | 9 | object ToggleCommand : ClientCommand( 10 | name = "toggle", 11 | alias = arrayOf("switch", "t"), 12 | description = "Toggle a module on and off!" 13 | ) { 14 | init { 15 | module("module") { moduleArg -> 16 | execute { 17 | val module = moduleArg.value 18 | module.toggle() 19 | if (module !is ClickGUI && !CommandConfig.toggleMessages) { 20 | sendChatMessage(module.name + 21 | if (module.isEnabled) " ${TextFormatting.GREEN}enabled" 22 | else " ${TextFormatting.RED}disabled" 23 | ) 24 | } 25 | } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/gui/MixinGuiIngameMenu.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.gui; 2 | 3 | import net.minecraft.client.gui.GuiButton; 4 | import net.minecraft.client.gui.GuiIngameMenu; 5 | import org.kamiblue.client.gui.mc.KamiGuiAntiDisconnect; 6 | import org.kamiblue.client.module.modules.misc.AntiDisconnect; 7 | import org.kamiblue.client.util.Wrapper; 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(GuiIngameMenu.class) 14 | public class MixinGuiIngameMenu { 15 | 16 | @Inject(method = "actionPerformed", at = @At("HEAD"), cancellable = true) 17 | public void actionPerformed(GuiButton button, CallbackInfo callbackInfo) { 18 | if (button.id == 1) { 19 | if (AntiDisconnect.INSTANCE.isEnabled()) { 20 | Wrapper.getMinecraft().displayGuiScreen(new KamiGuiAntiDisconnect()); 21 | 22 | callbackInfo.cancel(); 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/render/MixinTileEntityRendererDispatcher.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.render; 2 | 3 | import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; 4 | import net.minecraft.tileentity.TileEntity; 5 | import org.kamiblue.client.module.modules.render.NoRender; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(TileEntityRendererDispatcher.class) 12 | public class MixinTileEntityRendererDispatcher { 13 | @Inject(method = "render(Lnet/minecraft/tileentity/TileEntity;FI)V", at = @At("HEAD"), cancellable = true) 14 | public void render(TileEntity entity, float partialTicks, int destroyStage, CallbackInfo ci) { 15 | if (NoRender.INSTANCE.isEnabled()) { 16 | if (NoRender.INSTANCE.tryReplaceEnchantingTable(entity) || NoRender.INSTANCE.getEntityList().contains(entity.getClass())) { 17 | ci.cancel(); 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/world/MixinBlockSoulSand.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.world; 2 | 3 | import net.minecraft.block.BlockSoulSand; 4 | import net.minecraft.block.state.IBlockState; 5 | import net.minecraft.entity.Entity; 6 | import net.minecraft.util.math.BlockPos; 7 | import net.minecraft.world.World; 8 | import org.kamiblue.client.module.modules.movement.NoSlowDown; 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 | @Mixin(BlockSoulSand.class) 15 | public class MixinBlockSoulSand { 16 | 17 | @Inject(method = "onEntityCollision", at = @At("HEAD"), cancellable = true) 18 | public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn, CallbackInfo info) { 19 | // If noslowdown is on, just don't do anything else in this method (slow the player) 20 | if (NoSlowDown.INSTANCE.isEnabled() && NoSlowDown.INSTANCE.getSoulSand()) info.cancel(); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/movement/IceSpeed.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.movement 2 | 3 | import net.minecraft.init.Blocks 4 | import net.minecraftforge.fml.common.gameevent.TickEvent 5 | import org.kamiblue.client.module.Category 6 | import org.kamiblue.client.module.Module 7 | import org.kamiblue.client.util.threads.safeListener 8 | 9 | internal object IceSpeed : Module( 10 | name = "IceSpeed", 11 | description = "Changes how slippery ice is", 12 | category = Category.MOVEMENT 13 | ) { 14 | private val slipperiness by setting("Slipperiness", 0.4f, 0.1f..1.0f, 0.01f) 15 | 16 | init { 17 | safeListener { 18 | Blocks.ICE.setDefaultSlipperiness(slipperiness) 19 | Blocks.PACKED_ICE.setDefaultSlipperiness(slipperiness) 20 | Blocks.FROSTED_ICE.setDefaultSlipperiness(slipperiness) 21 | } 22 | 23 | onDisable { 24 | Blocks.ICE.setDefaultSlipperiness(0.98f) 25 | Blocks.PACKED_ICE.setDefaultSlipperiness(0.98f) 26 | Blocks.FROSTED_ICE.setDefaultSlipperiness(0.98f) 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/render/MixinLayerArmorBase.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.render; 2 | 3 | import net.minecraft.client.renderer.entity.layers.LayerArmorBase; 4 | import net.minecraft.entity.EntityLivingBase; 5 | import net.minecraft.inventory.EntityEquipmentSlot; 6 | import org.kamiblue.client.module.modules.render.ArmorHide; 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 renderArmorLayerPre(EntityLivingBase entityLivingBaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale, EntityEquipmentSlot slotIn, CallbackInfo ci) { 16 | if (ArmorHide.INSTANCE.isEnabled() && ArmorHide.shouldHide(slotIn, entityLivingBaseIn)) { 17 | ci.cancel(); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/render/TabFriends.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.render 2 | 3 | import net.minecraft.client.network.NetworkPlayerInfo 4 | import net.minecraft.scoreboard.ScorePlayerTeam 5 | import org.kamiblue.client.manager.managers.FriendManager 6 | import org.kamiblue.client.module.Category 7 | import org.kamiblue.client.module.Module 8 | import org.kamiblue.client.util.color.EnumTextColor 9 | import org.kamiblue.client.util.text.format 10 | 11 | internal object TabFriends : Module( 12 | name = "TabFriends", 13 | description = "Highlights friends in the tab menu", 14 | category = Category.RENDER, 15 | showOnArray = false 16 | ) { 17 | private val color = setting("Color", EnumTextColor.GREEN) 18 | 19 | @JvmStatic 20 | fun getPlayerName(info: NetworkPlayerInfo): String { 21 | val name = info.displayName?.formattedText 22 | ?: ScorePlayerTeam.formatPlayerName(info.playerTeam, info.gameProfile.name) 23 | 24 | return if (FriendManager.isFriend(name)) { 25 | color.value format name 26 | } else { 27 | name 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/shaders/program/esp_outline.json: -------------------------------------------------------------------------------- 1 | { 2 | "blend": { 3 | "func": "add", 4 | "srcrgb": "srcalpha", 5 | "dstrgb": "1-srcalpha" 6 | }, 7 | "vertex": "sobel", 8 | "fragment": "esp_outline", 9 | "attributes": [ "Position" ], 10 | "samplers": [ 11 | { "name": "DiffuseSampler" }, 12 | { "name": "PrevSampler" } 13 | ], 14 | "uniforms": [ 15 | { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, 16 | { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, 17 | { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, 18 | { "name": "color", "type": "float", "count": 3, "values": [ 1.0, 1.0, 1.0 ] }, 19 | { "name": "outlineAlpha", "type": "float", "count": 1, "values": [ 1.0 ] }, 20 | { "name": "filledAlpha", "type": "float", "count": 1, "values": [ 0.25 ] }, 21 | { "name": "width", "type": "float", "count": 1, "values": [ 1.0 ] } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/render/Xray.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.render 2 | 3 | import net.minecraft.block.state.IBlockState 4 | import org.kamiblue.client.module.Category 5 | import org.kamiblue.client.module.Module 6 | import org.kamiblue.client.setting.settings.impl.collection.CollectionSetting 7 | 8 | internal object Xray : Module( 9 | name = "Xray", 10 | description = "Lets you see through blocks", 11 | category = Category.RENDER 12 | ) { 13 | private val defaultVisibleList = linkedSetOf("minecraft:diamond_ore", "minecraft:iron_ore", "minecraft:gold_ore", "minecraft:portal", "minecraft:cobblestone") 14 | 15 | val visibleList = setting(CollectionSetting("Visible List", defaultVisibleList, { false })) 16 | 17 | @JvmStatic 18 | fun shouldReplace(state: IBlockState): Boolean { 19 | return isEnabled && !visibleList.contains(state.block.registryName.toString()) 20 | } 21 | 22 | init { 23 | onToggle { 24 | mc.renderGlobal.loadRenderers() 25 | } 26 | 27 | visibleList.editListeners.add { 28 | mc.renderGlobal.loadRenderers() 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/TimerUtils.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util 2 | 3 | open class Timer { 4 | var time = currentTime; protected set 5 | 6 | protected val currentTime get() = System.currentTimeMillis() 7 | 8 | fun reset(offset: Long = 0L) { 9 | time = currentTime + offset 10 | } 11 | 12 | } 13 | 14 | class TickTimer(val timeUnit: TimeUnit = TimeUnit.MILLISECONDS) : Timer() { 15 | fun tick(delay: Int, resetIfTick: Boolean = true): Boolean { 16 | return tick(delay.toLong(), resetIfTick) 17 | } 18 | 19 | fun tick(delay: Long, resetIfTick: Boolean = true): Boolean { 20 | return if (currentTime - time > delay * timeUnit.multiplier) { 21 | if (resetIfTick) time = currentTime 22 | true 23 | } else { 24 | false 25 | } 26 | } 27 | } 28 | 29 | class StopTimer(val timeUnit: TimeUnit = TimeUnit.MILLISECONDS) : Timer() { 30 | fun stop(): Long { 31 | return (currentTime - time) / timeUnit.multiplier 32 | } 33 | } 34 | 35 | enum class TimeUnit(val multiplier: Long) { 36 | MILLISECONDS(1L), 37 | TICKS(50L), 38 | SECONDS(1000L), 39 | MINUTES(60000L); 40 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/event/events/PlayerMoveEvent.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.event.events 2 | 3 | import net.minecraft.client.entity.EntityPlayerSP 4 | import org.kamiblue.client.event.Cancellable 5 | import org.kamiblue.client.event.Event 6 | 7 | class PlayerMoveEvent( 8 | private val player: EntityPlayerSP 9 | ) : Event, Cancellable() { 10 | private val prevX = player.motionX 11 | private val prevY = player.motionY 12 | private val prevZ = player.motionZ 13 | 14 | val isModified: Boolean 15 | get() = player.motionX != prevX 16 | || player.motionY != prevY 17 | || player.motionZ != prevZ 18 | 19 | var x: Double 20 | get() = if (cancelled) 0.0 else player.motionX 21 | set(value) { 22 | if (!cancelled) player.motionX = value 23 | } 24 | 25 | var y: Double 26 | get() = if (cancelled) 0.0 else player.motionY 27 | set(value) { 28 | if (!cancelled) player.motionY = value 29 | } 30 | 31 | var z: Double 32 | get() = if (cancelled) 0.0 else player.motionZ 33 | set(value) { 34 | if (!cancelled) player.motionZ = value 35 | } 36 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/hudgui/elements/client/BaritoneProcess.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.hudgui.elements.client 2 | 3 | import org.kamiblue.client.event.SafeClientEvent 4 | import org.kamiblue.client.gui.hudgui.LabelHud 5 | import org.kamiblue.client.module.modules.movement.AutoWalk 6 | import org.kamiblue.client.process.PauseProcess 7 | import org.kamiblue.client.util.BaritoneUtils 8 | 9 | internal object BaritoneProcess : LabelHud( 10 | name = "BaritoneProcess", 11 | category = Category.CLIENT, 12 | description = "Shows what Baritone is doing" 13 | ) { 14 | 15 | override fun SafeClientEvent.updateText() { 16 | val process = BaritoneUtils.primary?.pathingControlManager?.mostRecentInControl()?.orElse(null) ?: return 17 | 18 | when { 19 | process == PauseProcess -> { 20 | displayText.addLine(process.displayName0()) 21 | } 22 | AutoWalk.baritoneWalk -> { 23 | displayText.addLine("AutoWalk (${AutoWalk.direction.displayName})") 24 | } 25 | else -> { 26 | displayText.addLine("Process: ${process.displayName()}") 27 | } 28 | } 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/render/MixinLayerCape.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.render; 2 | 3 | import net.minecraft.client.entity.AbstractClientPlayer; 4 | import net.minecraft.client.renderer.entity.RenderPlayer; 5 | import net.minecraft.client.renderer.entity.layers.LayerCape; 6 | import org.kamiblue.client.module.modules.client.Capes; 7 | import org.spongepowered.asm.mixin.Final; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.Shadow; 10 | import org.spongepowered.asm.mixin.injection.At; 11 | import org.spongepowered.asm.mixin.injection.Inject; 12 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 13 | 14 | @Mixin(LayerCape.class) 15 | public class MixinLayerCape { 16 | @Shadow @Final private RenderPlayer playerRenderer; 17 | 18 | @Inject(method = "doRenderLayer", at = @At("HEAD"), cancellable = true) 19 | public void doRenderLayer(AbstractClientPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale, CallbackInfo ci) { 20 | if (Capes.INSTANCE.tryRenderCape(playerRenderer, player, partialTicks)) 21 | ci.cancel(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/player/NoSwing.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.player 2 | 3 | import net.minecraft.network.play.client.CPacketAnimation 4 | import net.minecraftforge.fml.common.gameevent.TickEvent 5 | import org.kamiblue.client.event.events.PacketEvent 6 | import org.kamiblue.client.module.Category 7 | import org.kamiblue.client.module.Module 8 | import org.kamiblue.client.util.threads.safeListener 9 | import org.kamiblue.event.listener.listener 10 | 11 | internal object NoSwing : Module( 12 | name = "NoSwing", 13 | category = Category.PLAYER, 14 | description = "Cancels server or client swing animation" 15 | ) { 16 | private val mode = setting("Mode", Mode.CLIENT) 17 | 18 | private enum class Mode { 19 | CLIENT, SERVER 20 | } 21 | 22 | init { 23 | listener { 24 | if (mode.value == Mode.SERVER && it.packet is CPacketAnimation) it.cancel() 25 | } 26 | 27 | safeListener { 28 | player.isSwingInProgress = false 29 | player.swingProgressInt = 0 30 | player.swingProgress = 0.0f 31 | player.prevSwingProgress = 0.0f 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/player/Timer.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.player 2 | 3 | import net.minecraftforge.fml.common.gameevent.TickEvent 4 | import org.kamiblue.client.manager.managers.TimerManager.modifyTimer 5 | import org.kamiblue.client.manager.managers.TimerManager.resetTimer 6 | import org.kamiblue.client.module.Category 7 | import org.kamiblue.client.module.Module 8 | import org.kamiblue.event.listener.listener 9 | 10 | internal object Timer : Module( 11 | name = "Timer", 12 | category = Category.PLAYER, 13 | description = "Changes your client tick speed", 14 | modulePriority = 500 15 | ) { 16 | private val slow by setting("Slow Mode", false) 17 | private val tickNormal by setting("Tick N", 2.0f, 1f..10f, 0.1f, { !slow }) 18 | private val tickSlow by setting("Tick S", 8f, 1f..10f, 0.1f, { slow }) 19 | 20 | init { 21 | onDisable { 22 | resetTimer() 23 | } 24 | 25 | listener { 26 | if (it.phase != TickEvent.Phase.END) return@listener 27 | 28 | val multiplier = if (!slow) tickNormal else tickSlow / 10.0f 29 | modifyTimer(50.0f / multiplier) 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/hudgui/elements/misc/MemoryUsage.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.hudgui.elements.misc 2 | 3 | import org.kamiblue.client.event.SafeClientEvent 4 | import org.kamiblue.client.gui.hudgui.LabelHud 5 | 6 | internal object MemoryUsage : LabelHud( 7 | name = "MemoryUsage", 8 | category = Category.MISC, 9 | description = "Display the used, allocated and max memory" 10 | ) { 11 | 12 | private val showAllocated = setting("Show Allocated", false) 13 | private val showMax = setting("Show Max", false) 14 | 15 | override fun SafeClientEvent.updateText() { 16 | val memory = (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1048576L 17 | displayText.add(memory.toString(), primaryColor) 18 | if (showAllocated.value) { 19 | val allocatedMemory = Runtime.getRuntime().totalMemory() / 1048576L 20 | displayText.add(allocatedMemory.toString(), primaryColor) 21 | } 22 | if (showMax.value) { 23 | val maxMemory = Runtime.getRuntime().maxMemory() / 1048576L 24 | displayText.add(maxMemory.toString(), primaryColor) 25 | } 26 | displayText.add("MB", secondaryColor) 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/player/PortalGodMode.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.player 2 | 3 | import net.minecraft.network.play.client.CPacketConfirmTeleport 4 | import org.kamiblue.client.event.events.PacketEvent 5 | import org.kamiblue.client.module.Category 6 | import org.kamiblue.client.module.Module 7 | import org.kamiblue.client.util.threads.runSafe 8 | import org.kamiblue.event.listener.listener 9 | 10 | internal object PortalGodMode : Module( 11 | name = "PortalGodMode", 12 | category = Category.PLAYER, 13 | description = "Don't take damage in portals" 14 | ) { 15 | private val instantTeleport by setting("Instant Teleport", true) 16 | 17 | private var packet: CPacketConfirmTeleport? = null 18 | 19 | init { 20 | onEnable { 21 | packet = null 22 | } 23 | 24 | onDisable { 25 | runSafe { 26 | if (instantTeleport) packet?.let { 27 | connection.sendPacket(it) 28 | } 29 | } 30 | } 31 | 32 | listener { 33 | if (it.packet !is CPacketConfirmTeleport) return@listener 34 | it.cancel() 35 | packet = it.packet 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/world/Block.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util.world 2 | 3 | import net.minecraft.block.Block 4 | import net.minecraft.block.state.IBlockState 5 | import net.minecraft.client.multiplayer.WorldClient 6 | import net.minecraft.init.Blocks 7 | import net.minecraft.util.math.AxisAlignedBB 8 | import net.minecraft.util.math.BlockPos 9 | import org.kamiblue.client.util.Wrapper 10 | import org.kamiblue.client.util.items.blockBlacklist 11 | 12 | val IBlockState.isBlacklisted: Boolean 13 | get() = blockBlacklist.contains(this.block) 14 | 15 | val IBlockState.isLiquid: Boolean 16 | get() = this.material.isLiquid 17 | 18 | val IBlockState.isWater: Boolean 19 | get() = this.block == Blocks.WATER 20 | 21 | val IBlockState.isReplaceable: Boolean 22 | get() = this.material.isReplaceable 23 | 24 | val IBlockState.isFullBox: Boolean 25 | get() = Wrapper.world?.let { 26 | this.getCollisionBoundingBox(it, BlockPos.ORIGIN) 27 | } == Block.FULL_BLOCK_AABB 28 | 29 | fun WorldClient.getSelectedBox(pos: BlockPos): AxisAlignedBB = 30 | this.getBlockState(pos).getSelectedBoundingBox(this, pos) 31 | 32 | fun WorldClient.getCollisionBox(pos: BlockPos): AxisAlignedBB? = 33 | this.getBlockState(pos).getCollisionBoundingBox(this, pos) -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/manager/managers/UUIDManager.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.manager.managers 2 | 3 | import org.kamiblue.capeapi.AbstractUUIDManager 4 | import org.kamiblue.capeapi.PlayerProfile 5 | import org.kamiblue.capeapi.UUIDUtils 6 | import org.kamiblue.client.KamiMod 7 | import org.kamiblue.client.manager.Manager 8 | import org.kamiblue.client.util.Wrapper 9 | 10 | object UUIDManager : AbstractUUIDManager(KamiMod.DIRECTORY + "uuid_cache.json", KamiMod.LOG, maxCacheSize = 1000), Manager { 11 | 12 | override fun getOrRequest(nameOrUUID: String): PlayerProfile? { 13 | return Wrapper.minecraft.connection?.playerInfoMap?.let { playerInfoMap -> 14 | val infoMap = ArrayList(playerInfoMap) 15 | val isUUID = UUIDUtils.isUUID(nameOrUUID) 16 | val withOutDashes = UUIDUtils.removeDashes(nameOrUUID) 17 | 18 | infoMap.find { 19 | isUUID && UUIDUtils.removeDashes(it.gameProfile.id.toString()).equals(withOutDashes, ignoreCase = true) 20 | || !isUUID && it.gameProfile.name.equals(nameOrUUID, ignoreCase = true) 21 | }?.gameProfile?.let { 22 | PlayerProfile(it.id, it.name) 23 | } 24 | } ?: super.getOrRequest(nameOrUUID) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/process/AutoObsidianProcess.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.process 2 | 3 | import baritone.api.process.IBaritoneProcess 4 | import baritone.api.process.PathingCommand 5 | import baritone.api.process.PathingCommandType 6 | import org.kamiblue.client.module.modules.misc.AutoObsidian 7 | 8 | object AutoObsidianProcess : IBaritoneProcess { 9 | 10 | override fun isTemporary(): Boolean { 11 | return true 12 | } 13 | 14 | override fun priority(): Double { 15 | return 3.0 16 | } 17 | 18 | override fun onLostControl() {} 19 | 20 | override fun displayName0(): String { 21 | return if (AutoObsidian.state != AutoObsidian.State.SEARCHING) { 22 | "AutoObsidian: ${AutoObsidian.state.displayName}" 23 | } else { 24 | "AutoObsidian: Searching-${AutoObsidian.searchingState.displayName}" 25 | } 26 | } 27 | 28 | override fun isActive(): Boolean { 29 | return AutoObsidian.isActive() 30 | } 31 | 32 | override fun onTick(p0: Boolean, p1: Boolean): PathingCommand { 33 | return AutoObsidian.goal?.let { 34 | PathingCommand(it, PathingCommandType.SET_GOAL_AND_PATH) 35 | } ?: PathingCommand(null, PathingCommandType.REQUEST_PAUSE) 36 | } 37 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/manager/ManagerLoader.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.manager 2 | 3 | import kotlinx.coroutines.Deferred 4 | import org.kamiblue.client.AsyncLoader 5 | import org.kamiblue.client.KamiMod 6 | import org.kamiblue.client.event.KamiEventBus 7 | import org.kamiblue.client.util.StopTimer 8 | import org.kamiblue.commons.utils.ClassUtils 9 | import org.kamiblue.commons.utils.ClassUtils.instance 10 | 11 | internal object ManagerLoader : AsyncLoader>> { 12 | override var deferred: Deferred>>? = null 13 | 14 | override fun preLoad0(): List> { 15 | val stopTimer = StopTimer() 16 | 17 | val list = ClassUtils.findClasses("org.kamiblue.client.manager.managers") 18 | 19 | val time = stopTimer.stop() 20 | 21 | KamiMod.LOG.info("${list.size} managers found, took ${time}ms") 22 | return list 23 | } 24 | 25 | override fun load0(input: List>) { 26 | val stopTimer = StopTimer() 27 | 28 | for (clazz in input) { 29 | KamiEventBus.subscribe(clazz.instance) 30 | } 31 | 32 | val time = stopTimer.stop() 33 | KamiMod.LOG.info("${input.size} managers loaded, took ${time}ms") 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/hudgui/elements/client/WaterMark.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.hudgui.elements.client 2 | 3 | import org.kamiblue.client.KamiMod 4 | import org.kamiblue.client.event.SafeClientEvent 5 | import org.kamiblue.client.gui.hudgui.LabelHud 6 | import org.kamiblue.client.module.modules.client.Capes 7 | import org.kamiblue.client.util.graphics.VertexHelper 8 | import org.lwjgl.opengl.GL11.glScalef 9 | 10 | internal object WaterMark : LabelHud( 11 | name = "Watermark", 12 | category = Category.CLIENT, 13 | description = "KAMI Blue watermark", 14 | enabledByDefault = false 15 | ) { 16 | 17 | override val hudWidth: Float get() = (displayText.getWidth() + 2.0f) / scale 18 | override val hudHeight: Float get() = displayText.getHeight(2) / scale 19 | 20 | override fun SafeClientEvent.updateText() { 21 | displayText.add(KamiMod.NAME, primaryColor) 22 | displayText.add(KamiMod.VERSION_SIMPLE, secondaryColor) 23 | } 24 | 25 | override fun renderHud(vertexHelper: VertexHelper) { 26 | val reversedScale = 1.0f / scale 27 | glScalef(reversedScale, reversedScale, reversedScale) 28 | super.renderHud(vertexHelper) 29 | } 30 | 31 | init { 32 | posX = 0.0f 33 | posY = 0.0f 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/chat/FormatChat.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.chat 2 | 3 | import org.kamiblue.client.manager.managers.MessageManager.newMessageModifier 4 | import org.kamiblue.client.module.Category 5 | import org.kamiblue.client.module.Module 6 | import org.kamiblue.client.util.text.MessageSendHelper 7 | 8 | internal object FormatChat : Module( 9 | name = "FormatChat", 10 | description = "Add color and linebreak support to upstream chat packets", 11 | category = Category.CHAT, 12 | modulePriority = 300 13 | ) { 14 | private val modifier = newMessageModifier { 15 | it.packet.message 16 | .replace('&', '§') 17 | .replace("#n", "\n") 18 | } 19 | 20 | init { 21 | onEnable { 22 | if (mc.currentServerData == null) { 23 | MessageSendHelper.sendWarningMessage("$chatName &6&lWarning: &r&6This does not work in singleplayer") 24 | disable() 25 | } else { 26 | MessageSendHelper.sendWarningMessage("$chatName &6&lWarning: &r&6This will kick you on most servers!") 27 | modifier.enable() 28 | } 29 | } 30 | 31 | onDisable { 32 | modifier.enable() 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/combat/AimBot.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.combat 2 | 3 | import net.minecraft.init.Items 4 | import net.minecraftforge.fml.common.gameevent.TickEvent 5 | import org.kamiblue.client.manager.managers.CombatManager 6 | import org.kamiblue.client.module.Category 7 | import org.kamiblue.client.module.Module 8 | import org.kamiblue.client.util.items.swapToItem 9 | import org.kamiblue.client.util.math.RotationUtils.faceEntityClosest 10 | import org.kamiblue.client.util.threads.safeListener 11 | 12 | @CombatManager.CombatModule 13 | internal object AimBot : Module( 14 | name = "AimBot", 15 | description = "Automatically aims at entities for you.", 16 | category = Category.COMBAT, 17 | modulePriority = 20 18 | ) { 19 | private val bowOnly by setting("Bow Only", true) 20 | private val autoSwap by setting("Auto Swap", false) 21 | 22 | init { 23 | safeListener { 24 | if (player.heldItemMainhand.item != Items.BOW) { 25 | if (autoSwap) swapToItem(Items.BOW) 26 | if (bowOnly) return@safeListener 27 | } 28 | 29 | CombatManager.target?.let { 30 | faceEntityClosest(it) 31 | } 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/misc/ConsoleSpam.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.misc 2 | 3 | import net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock 4 | import net.minecraft.network.play.client.CPacketUpdateSign 5 | import net.minecraft.tileentity.TileEntitySign 6 | import org.kamiblue.client.event.events.PacketEvent 7 | import org.kamiblue.client.module.Category 8 | import org.kamiblue.client.module.Module 9 | import org.kamiblue.client.util.text.MessageSendHelper 10 | import org.kamiblue.event.listener.listener 11 | 12 | internal object ConsoleSpam : Module( 13 | name = "ConsoleSpam", 14 | description = "Spams Spigot consoles by sending invalid UpdateSign packets", 15 | category = Category.MISC 16 | ) { 17 | init { 18 | onEnable { 19 | MessageSendHelper.sendChatMessage("$chatName Every time you right click a sign, a warning will appear in console.") 20 | MessageSendHelper.sendChatMessage("$chatName Use an auto clicker to automate this process.") 21 | } 22 | 23 | listener { 24 | if (it.packet !is CPacketPlayerTryUseItemOnBlock) return@listener 25 | mc.player.connection.sendPacket(CPacketUpdateSign(it.packet.pos, TileEntitySign().signText)) 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/command/commands/PrefixCommand.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.command.commands 2 | 3 | import org.kamiblue.client.command.ClientCommand 4 | import org.kamiblue.client.module.modules.client.CommandConfig 5 | import org.kamiblue.client.util.text.MessageSendHelper 6 | import org.kamiblue.client.util.text.formatValue 7 | 8 | object PrefixCommand : ClientCommand( 9 | name = "prefix", 10 | description = "Change command prefix" 11 | ) { 12 | init { 13 | literal("reset") { 14 | execute("Reset the prefix to ;") { 15 | CommandConfig.prefix = ";" 16 | MessageSendHelper.sendChatMessage("Reset prefix to [&7;&f]!") 17 | } 18 | } 19 | 20 | string("new prefix") { prefixArg -> 21 | execute("Set a new prefix") { 22 | if (prefixArg.value.isEmpty() || prefixArg.value == "\\") { 23 | CommandConfig.prefix = ";" 24 | MessageSendHelper.sendChatMessage("Reset prefix to [&7;&f]!") 25 | return@execute 26 | } 27 | 28 | CommandConfig.prefix = prefixArg.value 29 | MessageSendHelper.sendChatMessage("Set prefix to ${formatValue(prefixArg.value)}!") 30 | } 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/text/Detectors.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util.text 2 | 3 | interface Detector { 4 | infix fun detect(input: CharSequence): Boolean 5 | 6 | infix fun detectNot(input: CharSequence) = !detect(input) 7 | } 8 | 9 | interface RemovableDetector { 10 | fun removedOrNull(input: CharSequence): CharSequence? 11 | } 12 | 13 | interface PlayerDetector { 14 | fun playerName(input: CharSequence): String? 15 | } 16 | 17 | interface PrefixDetector : Detector, RemovableDetector { 18 | val prefixes: Array 19 | 20 | override fun detect(input: CharSequence) = prefixes.any { input.startsWith(it) } 21 | 22 | override fun removedOrNull(input: CharSequence) = prefixes.firstOrNull(input::startsWith)?.let { 23 | input.removePrefix(it) 24 | } 25 | } 26 | 27 | interface RegexDetector : Detector, RemovableDetector { 28 | val regexes: Array 29 | 30 | override infix fun detect(input: CharSequence) = regexes.any { it.containsMatchIn(input) } 31 | 32 | fun matchedRegex(input: CharSequence) = regexes.find { it.containsMatchIn(input) } 33 | 34 | override fun removedOrNull(input: CharSequence): CharSequence? = matchedRegex(input)?.let { regex -> 35 | input.replace(regex, "").takeIf { it.isNotBlank() } 36 | } 37 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/misc/PingSpoof.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.misc 2 | 3 | import kotlinx.coroutines.delay 4 | import kotlinx.coroutines.launch 5 | import net.minecraft.network.play.client.CPacketKeepAlive 6 | import net.minecraft.network.play.server.SPacketKeepAlive 7 | import org.kamiblue.client.event.events.PacketEvent 8 | import org.kamiblue.client.module.Category 9 | import org.kamiblue.client.module.Module 10 | import org.kamiblue.client.util.threads.defaultScope 11 | import org.kamiblue.client.util.threads.onMainThreadSafe 12 | import org.kamiblue.event.listener.listener 13 | 14 | internal object PingSpoof : Module( 15 | name = "PingSpoof", 16 | category = Category.MISC, 17 | description = "Cancels or adds delay to your ping packets" 18 | ) { 19 | private val delay = setting("Delay", 100, 0..2000, 25) 20 | 21 | init { 22 | listener { 23 | if (it.packet is SPacketKeepAlive) { 24 | it.cancel() 25 | defaultScope.launch { 26 | delay(delay.value.toLong()) 27 | onMainThreadSafe { 28 | connection.sendPacket(CPacketKeepAlive(it.packet.id)) 29 | } 30 | } 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/setting/GuiConfig.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.setting 2 | 3 | import org.kamiblue.client.KamiMod 4 | import org.kamiblue.client.gui.rgui.Component 5 | import org.kamiblue.client.module.modules.client.Configurations 6 | import org.kamiblue.client.plugin.api.IPluginClass 7 | import org.kamiblue.client.setting.GuiConfig.setting 8 | import org.kamiblue.client.setting.configs.AbstractConfig 9 | import org.kamiblue.client.setting.configs.PluginConfig 10 | import org.kamiblue.client.setting.settings.AbstractSetting 11 | import java.io.File 12 | 13 | internal object GuiConfig : AbstractConfig( 14 | "gui", 15 | "${KamiMod.DIRECTORY}config/gui" 16 | ) { 17 | override val file: File get() = File("$filePath/${Configurations.guiPreset}.json") 18 | override val backup get() = File("$filePath/${Configurations.guiPreset}.bak") 19 | 20 | override fun addSettingToConfig(owner: Component, setting: AbstractSetting<*>) { 21 | if (owner is IPluginClass) { 22 | (owner.config as PluginConfig).addSettingToConfig(owner, setting) 23 | } else { 24 | val groupName = owner.settingGroup.groupName 25 | if (groupName.isNotEmpty()) { 26 | getGroupOrPut(groupName).getGroupOrPut(owner.name).addSetting(setting) 27 | } 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/setting/settings/impl/primitive/EnumSetting.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.setting.settings.impl.primitive 2 | 3 | import com.google.gson.JsonElement 4 | import com.google.gson.JsonPrimitive 5 | import org.kamiblue.client.setting.settings.MutableSetting 6 | import org.kamiblue.commons.extension.next 7 | import java.util.* 8 | 9 | class EnumSetting>( 10 | name: String, 11 | value: T, 12 | visibility: () -> Boolean = { true }, 13 | consumer: (prev: T, input: T) -> T = { _, input -> input }, 14 | description: String = "" 15 | ) : MutableSetting(name, value, visibility, consumer, description) { 16 | 17 | val enumClass: Class = value.declaringClass 18 | val enumValues: Array = enumClass.enumConstants 19 | 20 | fun nextValue() { 21 | value = value.next() 22 | } 23 | 24 | override fun setValue(valueIn: String) { 25 | super.setValue(valueIn.toUpperCase(Locale.ROOT).replace(' ', '_')) 26 | } 27 | 28 | override fun write(): JsonElement = JsonPrimitive(value.name) 29 | 30 | override fun read(jsonElement: JsonElement?) { 31 | jsonElement?.asJsonPrimitive?.asString?.let { element -> 32 | enumValues.firstOrNull { it.name.equals(element, true) }?.let { 33 | value = it 34 | } 35 | } 36 | } 37 | 38 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/command/commands/VanishCommand.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.command.commands 2 | 3 | import net.minecraft.entity.Entity 4 | import org.kamiblue.client.command.ClientCommand 5 | import org.kamiblue.client.util.text.MessageSendHelper.sendChatMessage 6 | import org.kamiblue.client.util.text.formatValue 7 | 8 | object VanishCommand : ClientCommand( 9 | name = "vanish", 10 | description = "Allows you to vanish using an entity." 11 | ) { 12 | private var vehicle: Entity? = null 13 | 14 | init { 15 | executeSafe { 16 | if (player.ridingEntity != null && vehicle == null) { 17 | vehicle = player.ridingEntity?.also { 18 | player.dismountRidingEntity() 19 | world.removeEntityFromWorld(it.entityId) 20 | sendChatMessage("Vehicle " + formatValue(it.name) + " removed") 21 | } 22 | } else { 23 | vehicle?.let { 24 | it.isDead = false 25 | world.addEntityToWorld(it.entityId, it) 26 | player.startRiding(it, true) 27 | sendChatMessage("Vehicle " + formatValue(it.name) + " created") 28 | vehicle = null 29 | } ?: sendChatMessage("Not riding any vehicles") 30 | } 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/client/GuiColors.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.client 2 | 3 | import org.kamiblue.client.module.Category 4 | import org.kamiblue.client.module.Module 5 | import org.kamiblue.client.util.color.ColorHolder 6 | 7 | internal object GuiColors : Module( 8 | name = "GuiColors", 9 | description = "Opens the Click GUI", 10 | showOnArray = false, 11 | category = Category.CLIENT, 12 | alwaysEnabled = true 13 | ) { 14 | private val primarySetting = setting("Primary Color", ColorHolder(111, 166, 222, 255)) 15 | private val outlineSetting = setting("Outline Color", ColorHolder(88, 99, 111, 200)) 16 | private val backgroundSetting = setting("Background Color", ColorHolder(30, 36, 48, 200)) 17 | private val textSetting = setting("Text Color", ColorHolder(255, 255, 255, 255)) 18 | private val aHover = setting("Hover Alpha", 32, 0..255, 1) 19 | 20 | val primary get() = primarySetting.value.clone() 21 | val idle get() = if (primary.averageBrightness < 0.8f) ColorHolder(255, 255, 255, 0) else ColorHolder(0, 0, 0, 0) 22 | val hover get() = idle.apply { a = aHover.value } 23 | val click get() = idle.apply { a = aHover.value * 2 } 24 | val backGround get() = backgroundSetting.value.clone() 25 | val outline get() = outlineSetting.value.clone() 26 | val text get() = textSetting.value.clone() 27 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/process/HighwayToolsProcess.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.process 2 | 3 | import baritone.api.process.IBaritoneProcess 4 | import baritone.api.process.PathingCommand 5 | import baritone.api.process.PathingCommandType 6 | import org.kamiblue.client.module.modules.misc.HighwayTools 7 | import org.kamiblue.client.util.math.CoordinateConverter.asString 8 | 9 | /** 10 | * @author Avanatiker 11 | * @since 26/08/20 12 | */ 13 | object HighwayToolsProcess : IBaritoneProcess { 14 | 15 | override fun isTemporary(): Boolean { 16 | return true 17 | } 18 | 19 | override fun priority(): Double { 20 | return 2.0 21 | } 22 | 23 | override fun onLostControl() {} 24 | 25 | override fun displayName0(): String { 26 | val lastTask = HighwayTools.lastTask 27 | 28 | val processName = HighwayTools.goal?.goalPos?.asString() 29 | ?: lastTask?.toString() 30 | ?: "Thinking" 31 | 32 | return "HighwayTools: $processName" 33 | } 34 | 35 | override fun isActive(): Boolean { 36 | return HighwayTools.isActive() 37 | } 38 | 39 | override fun onTick(p0: Boolean, p1: Boolean): PathingCommand { 40 | return HighwayTools.goal?.let { 41 | PathingCommand(it, PathingCommandType.SET_GOAL_AND_PATH) 42 | } ?: PathingCommand(null, PathingCommandType.REQUEST_PAUSE) 43 | } 44 | } -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/network/MixinC00Handshake.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.network; 2 | 3 | import net.minecraft.network.EnumConnectionState; 4 | import net.minecraft.network.PacketBuffer; 5 | import net.minecraft.network.handshake.client.C00Handshake; 6 | import org.kamiblue.client.module.modules.misc.FakeVanillaClient; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.Shadow; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Inject; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 12 | 13 | /** 14 | * Created by 086 on 9/04/2018. 15 | */ 16 | @Mixin(C00Handshake.class) 17 | public class MixinC00Handshake { 18 | 19 | @Shadow private int protocolVersion; 20 | @Shadow private String ip; 21 | @Shadow private int port; 22 | @Shadow private EnumConnectionState requestedState; 23 | 24 | @Inject(method = "writePacketData", at = @At(value = "HEAD"), cancellable = true) 25 | public void writePacketData(PacketBuffer buf, CallbackInfo info) { 26 | if (FakeVanillaClient.INSTANCE.isEnabled()) { 27 | info.cancel(); 28 | buf.writeVarInt(protocolVersion); 29 | buf.writeString(ip); 30 | buf.writeShort(port); 31 | buf.writeVarInt(requestedState.getId()); 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/world/MixinBlockModelRenderer.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.world; 2 | 3 | import net.minecraft.block.state.IBlockState; 4 | import net.minecraft.client.renderer.BlockModelRenderer; 5 | import net.minecraft.client.renderer.BufferBuilder; 6 | import net.minecraft.client.renderer.block.model.IBakedModel; 7 | import net.minecraft.util.math.BlockPos; 8 | import net.minecraft.world.IBlockAccess; 9 | import org.kamiblue.client.module.modules.render.Xray; 10 | import org.spongepowered.asm.mixin.Mixin; 11 | import org.spongepowered.asm.mixin.injection.At; 12 | import org.spongepowered.asm.mixin.injection.Inject; 13 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 14 | 15 | @Mixin(BlockModelRenderer.class) 16 | public class MixinBlockModelRenderer { 17 | @Inject(method = "renderModel(Lnet/minecraft/world/IBlockAccess;Lnet/minecraft/client/renderer/block/model/IBakedModel;Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/client/renderer/BufferBuilder;ZJ)Z", at = @At("HEAD"), cancellable = true) 18 | public void renderModel(IBlockAccess worldIn, IBakedModel modelIn, IBlockState stateIn, BlockPos posIn, BufferBuilder buffer, boolean checkSides, long rand, CallbackInfoReturnable ci) { 19 | if (Xray.shouldReplace(stateIn)) { 20 | ci.cancel(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/render/MixinLayerElytra.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.render; 2 | 3 | import net.minecraft.client.model.ModelElytra; 4 | import net.minecraft.client.renderer.entity.RenderLivingBase; 5 | import net.minecraft.client.renderer.entity.layers.LayerElytra; 6 | import net.minecraft.entity.EntityLivingBase; 7 | import org.kamiblue.client.module.modules.client.Capes; 8 | import org.spongepowered.asm.mixin.Final; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.Shadow; 11 | import org.spongepowered.asm.mixin.injection.At; 12 | import org.spongepowered.asm.mixin.injection.Inject; 13 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 14 | 15 | @Mixin(LayerElytra.class) 16 | public class MixinLayerElytra { 17 | 18 | @Shadow @Final protected RenderLivingBase renderPlayer; 19 | @Shadow @Final private ModelElytra modelElytra; 20 | 21 | @Inject(method = "doRenderLayer", at = @At("HEAD"), cancellable = true) 22 | public void doRenderLayer(EntityLivingBase entity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale, CallbackInfo ci) { 23 | if (Capes.INSTANCE.tryRenderElytra(renderPlayer, modelElytra, entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, partialTicks)) 24 | ci.cancel(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/command/commands/SetBuildingBlockCommand.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.command.commands 2 | 3 | import net.minecraft.block.BlockAir 4 | import org.kamiblue.client.command.ClientCommand 5 | import org.kamiblue.client.module.modules.player.InventoryManager 6 | import org.kamiblue.client.util.items.block 7 | import org.kamiblue.client.util.items.id 8 | import org.kamiblue.client.util.text.MessageSendHelper 9 | 10 | // TODO: Remove once GUI has Block settings 11 | object SetBuildingBlockCommand : ClientCommand( 12 | name = "setbuildingblock", 13 | description = "Set the default building block" 14 | ) { 15 | init { 16 | executeSafe { 17 | val heldItem = player.inventory.getCurrentItem() 18 | when { 19 | heldItem.isEmpty -> { 20 | InventoryManager.buildingBlockID = 0 21 | MessageSendHelper.sendChatMessage("Building block has been reset") 22 | } 23 | heldItem.item.block !is BlockAir -> { 24 | InventoryManager.buildingBlockID = heldItem.item.id 25 | MessageSendHelper.sendChatMessage("Building block has been set to ${heldItem.displayName}") 26 | } 27 | else -> { 28 | MessageSendHelper.sendChatMessage("You are not holding a valid block") 29 | } 30 | } 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /scripts/uploadRelease.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Created by l1ving on 17/02/20 4 | # 5 | # ONLY USED IN AUTOMATED BUILDS 6 | # 7 | # Usage: "./uploadRelease.sh " 8 | 9 | __scripts="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 10 | source "$__scripts/utils.sh" # include check_var 11 | source ~/.profile 12 | 13 | check_var "2" "$2" || exit $? 14 | check_var "3" "$3" || exit $? 15 | check_var "KAMI_REPO_MAJOR" "$KAMI_REPO_MAJOR" || exit $? 16 | check_var "KAMI_REPO_NIGHTLY" "$KAMI_REPO_NIGHTLY" || exit $? 17 | check_var "GITHUB_TOKEN" "$GITHUB_TOKEN" || exit $? 18 | check_var "KAMI_DIR" "$KAMI_DIR" || exit $? 19 | 20 | cd "$KAMI_DIR" || exit $? 21 | BRANCH="$(git symbolic-ref -q HEAD | sed "s/^refs\/heads\///g")" 22 | REPO="$KAMI_REPO_NIGHTLY" 23 | 24 | check_var "git symbolic-ref -q HEAD" "$BRANCH" || exit $? 25 | 26 | [ "$1" == "major" ] && REPO="$KAMI_REPO_MAJOR" 27 | 28 | # Create release 29 | # shellcheck disable=SC2001 30 | CHANGELOG="$(echo "$5" | sed "s/[\"';]//g")" 31 | curl -s -H "Authorization: token $GITHUB_TOKEN" -X POST --data "$(generate_release_data "$KAMI_OWNER" "$REPO" "$3" "$BRANCH" "$3" "$CHANGELOG" "false" "false")" "https://api.github.com/repos/$KAMI_OWNER/$REPO/releases" || exit $? 32 | 33 | # Upload jar to release 34 | "$__scripts/uploadReleaseAsset.sh" github_api_token="$GITHUB_TOKEN" owner="$KAMI_OWNER" repo="$REPO" tag="$3" filename="$KAMI_DIR/build/libs/$4" 35 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/math/CoordinateConverter.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util.math 2 | 3 | import net.minecraft.util.math.BlockPos 4 | import org.kamiblue.client.manager.managers.WaypointManager 5 | 6 | object CoordinateConverter { 7 | /** 8 | * More efficient impl of [BlockPos.toString] 9 | */ 10 | fun BlockPos.asString(): String { 11 | return "${this.x}, ${this.y}, ${this.z}" 12 | } 13 | 14 | fun toCurrent(dimension: Int, pos: BlockPos): BlockPos { 15 | return if (dimension == WaypointManager.genDimension()) { 16 | pos 17 | } else { 18 | when (dimension) { 19 | -1 -> toOverworld(pos) // Nether to overworld 20 | 0 -> toNether(pos) // Overworld to nether 21 | else -> pos // End or custom dimension by server 22 | } 23 | } 24 | } 25 | 26 | fun bothConverted(dimension: Int, pos: BlockPos): String { 27 | return when (dimension) { 28 | -1 -> "${toOverworld(pos).asString()} (${pos.asString()})" 29 | 0 -> "${pos.asString()} (${toNether(pos).asString()})" 30 | else -> pos.asString() 31 | } 32 | } 33 | 34 | fun toNether(pos: BlockPos): BlockPos { 35 | return BlockPos(pos.x / 8, pos.y, pos.z / 8) 36 | } 37 | 38 | fun toOverworld(pos: BlockPos): BlockPos { 39 | return BlockPos(pos.x * 8, pos.y, pos.z * 8) 40 | } 41 | } -------------------------------------------------------------------------------- /scripts/utils.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Created by l1ving on 17/02/20 4 | # 5 | # Miscellaneous utilities used in other scripts 6 | # Usage: "source ./utils.sh" 7 | 8 | # Do not use this except to get relative script paths 9 | 10 | root_kami_dir() { 11 | pwd | sed "s/kamiblue.*/kamiblue/g" 12 | } 13 | 14 | check_var() { 15 | if [ -z "$2" ]; then 16 | echo "Variable '$1' is not set, exiting." >&2 17 | exit 1 18 | fi 19 | } 20 | 21 | check_git() { 22 | if [ ! -d "$(root_kami_dir)/.git" ]; then 23 | echo "Could not detect git repository, exiting" >&2 24 | exit 1 25 | elif [ ! "$(git status | tail -n 1)" == "nothing to commit, working tree clean" ]; then 26 | echo "Either not working in a clean tree or you have unpushed commits. Exiting." >&2 27 | exit 1 28 | fi 29 | } 30 | 31 | # Usage: "generate_release_data "owner" "repo" "version" "branch or commit" "name" "description" "draft (bool)", "prerelease (bool)"" 32 | generate_release_data() { 33 | cat < 0.0) { 25 | // If we find a pixel that isn't transparent, set the frag color to it and replace the alpha. 26 | center = vec4(color, outlineAlpha); 27 | } 28 | } 29 | } 30 | } else { 31 | // Replace the color 32 | center = vec4(color, 1.0); 33 | 34 | // Mix it with the blured background 35 | vec4 backgroundColor = texture2D(PrevSampler, texCoord); 36 | center = mix(backgroundColor, center, filledAlpha); 37 | } 38 | 39 | gl_FragColor = center; 40 | } 41 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/hudgui/elements/misc/TPS.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.hudgui.elements.misc 2 | 3 | import org.kamiblue.client.event.SafeClientEvent 4 | import org.kamiblue.client.gui.hudgui.LabelHud 5 | import org.kamiblue.client.util.CircularArray 6 | import org.kamiblue.client.util.TpsCalculator 7 | 8 | internal object TPS : LabelHud( 9 | name = "TPS", 10 | category = Category.MISC, 11 | description = "Server TPS" 12 | ) { 13 | 14 | private val mspt = setting("Use milliseconds", false, description = "Use milliseconds per tick instead of ticks per second") 15 | 16 | // buffered TPS readings to add some fluidity to the TPS HUD element 17 | private val tpsBuffer = CircularArray.create(20, 20f) 18 | 19 | override fun SafeClientEvent.updateText() { 20 | tpsBuffer.add(TpsCalculator.tickRate) 21 | val avg = tpsBuffer.average() 22 | 23 | if (mspt.value) { 24 | // If the Value returns Zero, it reads "Infinity mspt" 25 | if (avg == 0.00f) { 26 | displayText.add("%.2f".format(0.00f), primaryColor) 27 | } else { 28 | displayText.add("%.2f".format(1000 / avg), primaryColor) 29 | } 30 | 31 | displayText.add("mspt", secondaryColor) 32 | } else { 33 | displayText.add("%.2f".format(avg), primaryColor) 34 | displayText.add("tps", secondaryColor) 35 | } 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/gui/rgui/windows/BasicWindow.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.gui.rgui.windows 2 | 3 | import org.kamiblue.client.module.modules.client.ClickGUI 4 | import org.kamiblue.client.module.modules.client.GuiColors 5 | import org.kamiblue.client.setting.GuiConfig 6 | import org.kamiblue.client.setting.configs.AbstractConfig 7 | import org.kamiblue.client.util.graphics.RenderUtils2D 8 | import org.kamiblue.client.util.graphics.VertexHelper 9 | import org.kamiblue.client.util.math.Vec2d 10 | import org.kamiblue.client.util.math.Vec2f 11 | import org.kamiblue.commons.interfaces.Nameable 12 | 13 | /** 14 | * Window with rectangle rendering 15 | */ 16 | open class BasicWindow( 17 | name: String, 18 | posX: Float, 19 | posY: Float, 20 | width: Float, 21 | height: Float, 22 | settingGroup: SettingGroup, 23 | config: AbstractConfig = GuiConfig 24 | ) : CleanWindow(name, posX, posY, width, height, settingGroup, config) { 25 | 26 | override fun onRender(vertexHelper: VertexHelper, absolutePos: Vec2f) { 27 | super.onRender(vertexHelper, absolutePos) 28 | RenderUtils2D.drawRoundedRectFilled(vertexHelper, Vec2d(0.0, 0.0), Vec2f(renderWidth, renderHeight).toVec2d(), ClickGUI.radius, color = GuiColors.backGround) 29 | RenderUtils2D.drawRoundedRectOutline(vertexHelper, Vec2d(0.0, 0.0), Vec2f(renderWidth, renderHeight).toVec2d(), ClickGUI.radius, lineWidth = 2.5f, color = GuiColors.primary) 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/misc/BeaconSelector.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.misc 2 | 3 | import io.netty.buffer.Unpooled 4 | import net.minecraft.network.PacketBuffer 5 | import net.minecraft.network.play.client.CPacketCustomPayload 6 | import org.kamiblue.client.event.events.PacketEvent 7 | import org.kamiblue.client.module.Category 8 | import org.kamiblue.client.module.Module 9 | import org.kamiblue.event.listener.listener 10 | 11 | internal object BeaconSelector : Module( 12 | name = "BeaconSelector", 13 | category = Category.MISC, 14 | description = "Choose any of the 5 beacon effects regardless of beacon base height" 15 | ) { 16 | private var doCancelPacket = true 17 | var effect = -1 18 | 19 | init { 20 | listener { 21 | if (it.packet !is CPacketCustomPayload || !doCancelPacket || it.packet.channelName != "MC|Beacon") return@listener 22 | doCancelPacket = false 23 | it.packet.bufferData.readInt() // primary 24 | val secondary = it.packet.bufferData.readInt() // secondary 25 | it.cancel() 26 | PacketBuffer(Unpooled.buffer()).apply { 27 | writeInt(effect) 28 | writeInt(secondary) 29 | }.also { buffer -> 30 | mc.player.connection.sendPacket(CPacketCustomPayload("MC|Beacon", buffer)) 31 | } 32 | doCancelPacket = true 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/gui/MixinGuiChat.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.gui; 2 | 3 | import net.minecraft.client.gui.GuiChat; 4 | import net.minecraft.client.gui.GuiScreen; 5 | import net.minecraft.client.gui.GuiTextField; 6 | import org.kamiblue.client.command.CommandManager; 7 | import org.kamiblue.client.gui.mc.KamiGuiChat; 8 | import org.kamiblue.client.util.Wrapper; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.Shadow; 11 | import org.spongepowered.asm.mixin.injection.At; 12 | import org.spongepowered.asm.mixin.injection.Inject; 13 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 14 | 15 | @Mixin(GuiChat.class) 16 | public abstract class MixinGuiChat extends GuiScreen { 17 | 18 | @Shadow protected GuiTextField inputField; 19 | @Shadow private String historyBuffer; 20 | @Shadow private int sentHistoryCursor; 21 | 22 | @Inject(method = "keyTyped(CI)V", at = @At("RETURN")) 23 | public void returnKeyTyped(char typedChar, int keyCode, CallbackInfo info) { 24 | GuiScreen currentScreen = Wrapper.getMinecraft().currentScreen; 25 | if (currentScreen instanceof GuiChat && !(currentScreen instanceof KamiGuiChat) 26 | && inputField.getText().startsWith(CommandManager.INSTANCE.getPrefix())) { 27 | Wrapper.getMinecraft().displayGuiScreen(new KamiGuiChat(inputField.getText(), historyBuffer, sentHistoryCursor)); 28 | } 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/mixin/extension/Misc.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.extension 2 | 3 | import net.minecraft.client.Minecraft 4 | import net.minecraft.entity.Entity 5 | import net.minecraft.item.ItemTool 6 | import net.minecraft.util.Timer 7 | import org.kamiblue.client.mixin.client.accessor.AccessorEntity 8 | import org.kamiblue.client.mixin.client.accessor.AccessorItemTool 9 | import org.kamiblue.client.mixin.client.accessor.AccessorMinecraft 10 | import org.kamiblue.client.mixin.client.accessor.AccessorTimer 11 | 12 | val Entity.isInWeb: Boolean get() = (this as AccessorEntity).isInWeb 13 | 14 | val ItemTool.attackDamage get() = (this as AccessorItemTool).attackDamage 15 | 16 | val Minecraft.timer: Timer get() = (this as AccessorMinecraft).timer 17 | val Minecraft.renderPartialTicksPaused: Float get() = (this as AccessorMinecraft).renderPartialTicksPaused 18 | var Minecraft.rightClickDelayTimer: Int 19 | get() = (this as AccessorMinecraft).rightClickDelayTimer 20 | set(value) { 21 | (this as AccessorMinecraft).rightClickDelayTimer = value 22 | } 23 | 24 | fun Minecraft.rightClickMouse() = (this as AccessorMinecraft).invokeRightClickMouse() 25 | 26 | fun Minecraft.sendClickBlockToController(leftClick: Boolean) = (this as AccessorMinecraft).invokeSendClickBlockToController(leftClick) 27 | 28 | var Timer.tickLength: Float 29 | get() = (this as AccessorTimer).tickLength 30 | set(value) { 31 | (this as AccessorTimer).tickLength = value 32 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/WebUtils.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util 2 | 3 | import org.kamiblue.client.KamiMod 4 | import org.kamiblue.commons.utils.ConnectionUtils 5 | import java.awt.Desktop 6 | import java.io.BufferedReader 7 | import java.io.FileOutputStream 8 | import java.io.IOException 9 | import java.io.InputStreamReader 10 | import java.net.URI 11 | import java.net.URL 12 | import java.nio.channels.Channels 13 | 14 | object WebUtils { 15 | fun openWebLink(url: String) { 16 | try { 17 | Desktop.getDesktop().browse(URI(url)) 18 | } catch (e: IOException) { 19 | KamiMod.LOG.error("Couldn't open link: $url") 20 | } 21 | } 22 | 23 | fun getUrlContents(url: String): String { 24 | val content = StringBuilder() 25 | 26 | ConnectionUtils.runConnection(url, block = { connection -> 27 | val bufferedReader = BufferedReader(InputStreamReader(connection.inputStream)) 28 | bufferedReader.forEachLine { content.append("$it\n") } 29 | }, catch = { 30 | it.printStackTrace() 31 | }) 32 | 33 | return content.toString() 34 | } 35 | 36 | @Throws(IOException::class) 37 | fun downloadUsingNIO(url: String, file: String) { 38 | Channels.newChannel(URL(url).openStream()).use { channel -> 39 | FileOutputStream(file).use { 40 | it.channel.transferFrom(channel, 0, Long.MAX_VALUE) 41 | } 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /scripts/bumpVersion.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Created by l1ving on 17/02/20 4 | # 5 | # ONLY USED IN AUTOMATED BUILDS 6 | # 7 | # Usage: "./bumpVersion.sh " 8 | # First argument can be empty or "major" 9 | 10 | # Get version numbers 11 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/version.sh" 12 | VERSION=$("$__dir" "$1") || exit $? 13 | VERSION_SIMPLE=$("$__dir" "$1" "simple") || exit $? 14 | VERSION_MAJOR=$("$__dir" "major") || exit $? 15 | 16 | # Get and parse build number 17 | BUILD_NUMBER_PREVIOUS=$(curl -s https://kamiblue.org/api/v1/builds) 18 | BUILD_NUMBER=$((BUILD_NUMBER_PREVIOUS + 1)) 19 | 20 | if [ "$BUILD_NUMBER" == "$BUILD_NUMBER_PREVIOUS" ]; then 21 | echo "[bumpBuildNumber] Failed to bump build number, exiting." >&2 22 | exit 1 23 | fi 24 | 25 | if [[ ! "$BUILD_NUMBER" =~ ^-?[0-9]+$ ]]; then 26 | echo "[bumpBuildNumber] Could not parse '$BUILD_NUMBER' as an Int, exiting." >&2 27 | exit 1 28 | fi 29 | 30 | # Set above information 31 | sed -i "s/modVersion=.*/modVersion=$VERSION/" gradle.properties 32 | sed -i "s/VERSION = \".*\"/VERSION = \"$VERSION\"/" src/main/kotlin/org/kamiblue/client/KamiMod.kt 33 | sed -i "s/VERSION_SIMPLE = \".*\"/VERSION_SIMPLE = \"$VERSION_SIMPLE\"/" src/main/kotlin/org/kamiblue/client/KamiMod.kt 34 | sed -i "s/VERSION_MAJOR = \".*\"/VERSION_MAJOR = \"$VERSION_MAJOR\"/" src/main/kotlin/org/kamiblue/client/KamiMod.kt 35 | sed -i "s/BUILD_NUMBER = .* \/\//BUILD_NUMBER = $BUILD_NUMBER \/\//" src/main/kotlin/org/kamiblue/client/KamiMod.kt 36 | -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/world/MixinBlockLiquid.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.world; 2 | 3 | import net.minecraft.block.BlockLiquid; 4 | import net.minecraft.block.state.IBlockState; 5 | import net.minecraft.entity.Entity; 6 | import net.minecraft.util.math.BlockPos; 7 | import net.minecraft.util.math.Vec3d; 8 | import net.minecraft.world.World; 9 | import org.kamiblue.client.module.modules.movement.Velocity; 10 | import org.kamiblue.client.module.modules.player.BlockInteraction; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 15 | 16 | @Mixin(BlockLiquid.class) 17 | public class MixinBlockLiquid { 18 | @Inject(method = "modifyAcceleration", at = @At("HEAD"), cancellable = true) 19 | public void modifyAcceleration(World worldIn, BlockPos pos, Entity entityIn, Vec3d motion, CallbackInfoReturnable cir) { 20 | if (Velocity.getCancelLiquidVelocity()) { 21 | cir.setReturnValue(motion); 22 | } 23 | } 24 | 25 | @Inject(method = "canCollideCheck", at = @At("HEAD"), cancellable = true) 26 | public void canCollideCheck(IBlockState blockState, boolean hitIfLiquid, CallbackInfoReturnable cir) { 27 | if (BlockInteraction.isLiquidInteractEnabled()) { 28 | cir.setReturnValue(true); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/setting/settings/impl/collection/MapSetting.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.setting.settings.impl.collection 2 | 3 | import com.google.gson.JsonElement 4 | import com.google.gson.reflect.TypeToken 5 | import org.kamiblue.client.setting.settings.ImmutableSetting 6 | 7 | class MapSetting>( 8 | name: String, 9 | override val value: T, 10 | visibility: () -> Boolean = { true }, 11 | description: String = "" 12 | ) : ImmutableSetting(name, value, visibility, { _, input -> input }, description) { 13 | 14 | override val defaultValue: T = valueClass.newInstance() 15 | private val lockObject = Any() 16 | private val type = object : TypeToken>() {}.type 17 | 18 | init { 19 | value.toMap(defaultValue) 20 | } 21 | 22 | override fun resetValue() { 23 | synchronized(lockObject) { 24 | value.clear() 25 | value.putAll(defaultValue) 26 | } 27 | } 28 | 29 | override fun write(): JsonElement = gson.toJsonTree(value) 30 | 31 | override fun read(jsonElement: JsonElement?) { 32 | jsonElement?.asJsonArray?.let { 33 | val cacheMap = gson.fromJson>(it, type) 34 | 35 | synchronized(lockObject) { 36 | value.clear() 37 | value.putAll(cacheMap) 38 | } 39 | } 40 | } 41 | 42 | override fun toString() = value.entries.joinToString { "${it.key} to ${it.value}" } 43 | 44 | } -------------------------------------------------------------------------------- /src/main/java/org/kamiblue/client/mixin/client/player/MixinEntityPlayer.java: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.mixin.client.player; 2 | 3 | import net.minecraft.client.entity.EntityPlayerSP; 4 | import net.minecraft.entity.EntityLivingBase; 5 | import net.minecraft.entity.MoverType; 6 | import net.minecraft.entity.player.EntityPlayer; 7 | import net.minecraft.world.World; 8 | import org.kamiblue.client.event.KamiEventBus; 9 | import org.kamiblue.client.event.events.PlayerTravelEvent; 10 | import org.spongepowered.asm.mixin.Mixin; 11 | import org.spongepowered.asm.mixin.injection.At; 12 | import org.spongepowered.asm.mixin.injection.Inject; 13 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 14 | 15 | @Mixin(value = EntityPlayer.class, priority = Integer.MAX_VALUE) 16 | public abstract class MixinEntityPlayer extends EntityLivingBase { 17 | 18 | public MixinEntityPlayer(World worldIn) { 19 | super(worldIn); 20 | } 21 | 22 | @Inject(method = "travel", at = @At("HEAD"), cancellable = true) 23 | public void travel(float strafe, float vertical, float forward, CallbackInfo info) { 24 | //noinspection ConstantConditions 25 | if (EntityPlayerSP.class.isAssignableFrom(this.getClass())) { 26 | PlayerTravelEvent event = new PlayerTravelEvent(); 27 | KamiEventBus.INSTANCE.post(event); 28 | if (event.getCancelled()) { 29 | move(MoverType.SELF, motionX, motionY, motionZ); 30 | info.cancel(); 31 | } 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/TpsCalculator.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util 2 | 3 | import net.minecraft.network.play.server.SPacketTimeUpdate 4 | import net.minecraft.util.math.MathHelper 5 | import org.kamiblue.client.event.KamiEventBus 6 | import org.kamiblue.client.event.events.ConnectionEvent 7 | import org.kamiblue.client.event.events.PacketEvent 8 | import org.kamiblue.event.listener.listener 9 | import java.util.* 10 | 11 | object TpsCalculator { 12 | // Circular Buffer lasting ~60 seconds for tick storage 13 | private val tickRates = CircularArray.create(120, 20f) 14 | 15 | private var timeLastTimeUpdate: Long = 0 16 | 17 | val tickRate: Float 18 | get() = tickRates.average().coerceIn(0.0f, 20.0f) 19 | 20 | val adjustTicks: Float get() = tickRates.average() - 20f 21 | 22 | init { 23 | listener { 24 | if (it.packet !is SPacketTimeUpdate) return@listener 25 | if (timeLastTimeUpdate != -1L) { 26 | val timeElapsed = (System.nanoTime() - timeLastTimeUpdate) / 1E9 27 | tickRates.add((20.0 / timeElapsed).coerceIn(0.0, 20.0).toFloat()) 28 | } 29 | timeLastTimeUpdate = System.nanoTime() 30 | } 31 | 32 | listener { 33 | reset() 34 | } 35 | } 36 | 37 | private fun reset() { 38 | tickRates.reset() 39 | timeLastTimeUpdate = -1L 40 | } 41 | 42 | init { 43 | KamiEventBus.subscribe(this) 44 | } 45 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![CodeFactor](https://www.codefactor.io/repository/github/kami-blue/client/badge)](https://www.codefactor.io/repository/github/kami-blue/client) 2 | [![build](https://github.com/kami-blue/client/workflows/gradle_build/badge.svg)](https://github.com/kami-blue/client/actions) 3 | [![Discord Mine](https://img.shields.io/discord/573954110454366214?label=chat&logo=discord&logoColor=white)](https://discord.gg/KfpqwZB) 4 | 5 | ## 2021/04/21 This project is now archived indefinitely. 6 | 7 | All pull requests, issues or any other activity on the repositories of all KAMI Blue organizations will be ignored completely. 8 | 9 | Finally this project is in the bin 🗑️ 10 | 11 | ## Contributing 12 | 13 | Please go to [kamiblue.org/contributing](https://kamiblue.org/contributing) for building instructions. 14 | 15 | ## Thank you 16 | 17 | [zeroeightysix](https://github.com/zeroeightysix) for the original [KAMI](https://github.com/zeroeightysix/KAMI) 18 | 19 | [ronmamo](https://github.com/ronmamo/) for [Reflections](https://github.com/ronmamo/reflections) 20 | 21 | The [Minecraft Forge team](https://github.com/MinecraftForge) for [forge](https://files.minecraftforge.net/) 22 | 23 | All the [contributors](https://github.com/kami-blue/client/graphs/contributors), including the ones who will be remembered in comments and in our hearts. This has been a huge community effort and I couldn't have done it without them. 24 | 25 | ## Star Chart 26 | 27 | [![Stargazers over time](https://starchart.cc/kami-blue/client.svg)](https://starchart.cc/kami-blue/client) 28 | -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/Loader.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client 2 | 3 | import kotlinx.coroutines.Deferred 4 | import kotlinx.coroutines.async 5 | import kotlinx.coroutines.runBlocking 6 | import org.kamiblue.client.command.CommandManager 7 | import org.kamiblue.client.gui.GuiManager 8 | import org.kamiblue.client.manager.ManagerLoader 9 | import org.kamiblue.client.module.ModuleManager 10 | import org.kamiblue.client.plugin.PluginManager 11 | import org.kamiblue.client.util.threads.mainScope 12 | 13 | internal object LoaderWrapper { 14 | private val loaderList = ArrayList>() 15 | 16 | init { 17 | loaderList.add(ModuleManager) 18 | loaderList.add(CommandManager) 19 | loaderList.add(ManagerLoader) 20 | loaderList.add(GuiManager) 21 | loaderList.add(PluginManager) 22 | } 23 | 24 | @JvmStatic 25 | fun preLoadAll() { 26 | loaderList.forEach { it.preLoad() } 27 | } 28 | 29 | @JvmStatic 30 | fun loadAll() { 31 | runBlocking { 32 | loaderList.forEach { it.load() } 33 | } 34 | } 35 | } 36 | 37 | internal interface AsyncLoader { 38 | var deferred: Deferred? 39 | 40 | fun preLoad() { 41 | deferred = preLoadAsync() 42 | } 43 | 44 | private fun preLoadAsync(): Deferred { 45 | return mainScope.async { preLoad0() } 46 | } 47 | 48 | suspend fun load() { 49 | load0((deferred ?: preLoadAsync()).await()) 50 | } 51 | 52 | fun preLoad0(): T 53 | fun load0(input: T) 54 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/module/modules/misc/FakeGameMode.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.module.modules.misc 2 | 3 | import net.minecraft.world.GameType 4 | import net.minecraftforge.fml.common.gameevent.TickEvent 5 | import org.kamiblue.client.module.Category 6 | import org.kamiblue.client.module.Module 7 | import org.kamiblue.client.util.threads.runSafe 8 | import org.kamiblue.client.util.threads.runSafeR 9 | import org.kamiblue.client.util.threads.safeListener 10 | 11 | internal object FakeGameMode : Module( 12 | name = "FakeGameMode", 13 | description = "Fakes your current gamemode client side", 14 | category = Category.MISC 15 | ) { 16 | private val gamemode by setting("Mode", GameMode.CREATIVE) 17 | 18 | @Suppress("UNUSED") 19 | private enum class GameMode(val gameType: GameType) { 20 | SURVIVAL(GameType.SURVIVAL), 21 | CREATIVE(GameType.CREATIVE), 22 | ADVENTURE(GameType.ADVENTURE), 23 | SPECTATOR(GameType.SPECTATOR) 24 | } 25 | 26 | private var prevGameMode: GameType? = null 27 | 28 | init { 29 | safeListener { 30 | playerController.setGameType(gamemode.gameType) 31 | } 32 | 33 | onEnable { 34 | runSafeR { 35 | prevGameMode = playerController.currentGameType 36 | } ?: disable() 37 | } 38 | 39 | onDisable { 40 | runSafe { 41 | prevGameMode?.let { playerController.setGameType(it) } 42 | } 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/kamiblue/client/util/color/ColorGradient.kt: -------------------------------------------------------------------------------- 1 | package org.kamiblue.client.util.color 2 | 3 | import org.kamiblue.commons.utils.MathUtils 4 | import kotlin.math.max 5 | import kotlin.math.roundToInt 6 | 7 | class ColorGradient(vararg stops: Pair) { 8 | private val colorArray = stops.sortedBy { it.first }.toTypedArray() 9 | 10 | fun get(valueIn: Float): ColorHolder { 11 | if (colorArray.isEmpty()) return ColorHolder(255, 255, 255) 12 | var prevStop = colorArray.last() 13 | var nextStop = colorArray.last() 14 | for ((index, pair) in colorArray.withIndex()) { 15 | if (pair.first < valueIn) continue 16 | prevStop = if (pair.first == valueIn) pair 17 | else colorArray[max(index - 1, 0)] 18 | nextStop = pair 19 | break 20 | } 21 | if (prevStop == nextStop) return prevStop.second 22 | val r = MathUtils.convertRange(valueIn, prevStop.first, nextStop.first, prevStop.second.r.toFloat(), nextStop.second.r.toFloat()).roundToInt() 23 | val g = MathUtils.convertRange(valueIn, prevStop.first, nextStop.first, prevStop.second.g.toFloat(), nextStop.second.g.toFloat()).roundToInt() 24 | val b = MathUtils.convertRange(valueIn, prevStop.first, nextStop.first, prevStop.second.b.toFloat(), nextStop.second.b.toFloat()).roundToInt() 25 | val a = MathUtils.convertRange(valueIn, prevStop.first, nextStop.first, prevStop.second.a.toFloat(), nextStop.second.a.toFloat()).roundToInt() 26 | return ColorHolder(r, g, b, a) 27 | } 28 | } --------------------------------------------------------------------------------