├── .github ├── ISSUE_TEMPLATE │ ├── bug-report.md │ ├── feature-request.md │ └── question.md └── workflows │ └── build.yml ├── .gitignore ├── LICENSE ├── README.md ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── src └── main ├── java └── cope │ └── cosmos │ ├── asm │ ├── MixinLoader.java │ └── mixins │ │ ├── MixinJndiLookup.java │ │ ├── MixinMinecraft.java │ │ ├── accessor │ │ ├── ICPacketChatMessage.java │ │ ├── ICPacketCloseWindow.java │ │ ├── ICPacketConfirmTransaction.java │ │ ├── ICPacketKeepAlive.java │ │ ├── ICPacketPlayer.java │ │ ├── ICPacketPlayerTryUseItemOnBlock.java │ │ ├── ICPacketUseEntity.java │ │ ├── IEntity.java │ │ ├── IEntityLivingBase.java │ │ ├── IEntityPlayerSP.java │ │ ├── IEntityRenderer.java │ │ ├── IGameProfile.java │ │ ├── IGuiChat.java │ │ ├── IKeybinding.java │ │ ├── IMinecraft.java │ │ ├── INetHandlerPlayClient.java │ │ ├── INetworkManager.java │ │ ├── IPlayerControllerMP.java │ │ ├── IRenderGlobal.java │ │ ├── IRenderManager.java │ │ ├── ISPacketEntityVelocity.java │ │ ├── ISPacketExplosion.java │ │ ├── ISPacketPlayerPosLook.java │ │ ├── ISession.java │ │ ├── IShaderGroup.java │ │ ├── ISlot.java │ │ ├── ISoundHandler.java │ │ ├── ITextComponentString.java │ │ └── ITimer.java │ │ ├── entity │ │ ├── MixinEntity.java │ │ ├── crystal │ │ │ └── MixinEntityEnderCrystal.java │ │ ├── horse │ │ │ └── MixinAbstractHorse.java │ │ └── player │ │ │ ├── MixinAbstractClientPlayer.java │ │ │ ├── MixinEntityPlayer.java │ │ │ ├── MixinEntityPlayerSP.java │ │ │ └── MixinInventoryPlayer.java │ │ ├── input │ │ ├── MixinKeyBinding.java │ │ ├── MixinMovementInputFromOptions.java │ │ └── MixinPlayerControllerMP.java │ │ ├── network │ │ ├── MixinNettyCompressionDecoder.java │ │ └── MixinNetworkManager.java │ │ ├── render │ │ ├── MixinBufferBuilder.java │ │ ├── MixinRender.java │ │ ├── MixinRenderGlobal.java │ │ ├── MixinVisGraph.java │ │ ├── entity │ │ │ ├── MixinEntityRenderer.java │ │ │ ├── MixinRenderEnderCrystal.java │ │ │ ├── MixinRenderEntityItem.java │ │ │ ├── MixinRenderLivingBase.java │ │ │ ├── MixinRenderPlayer.java │ │ │ └── MixinRenderWitherSkull.java │ │ ├── gui │ │ │ ├── MixinFontRenderer.java │ │ │ ├── MixinGuiConnecting.java │ │ │ ├── MixinGuiInGame.java │ │ │ ├── MixinGuiMultiplayer.java │ │ │ ├── MixinGuiScreen.java │ │ │ ├── MixinGuiTextField.java │ │ │ ├── MixinSplashProgress.java │ │ │ └── overlay │ │ │ │ ├── MixinGuiBossOverlay.java │ │ │ │ ├── MixinGuiPlayerTabOverlay.java │ │ │ │ └── MixinGuiToast.java │ │ ├── item │ │ │ ├── MixinItemRenderer.java │ │ │ ├── MixinLayerBipedArmor.java │ │ │ └── MixinMapItemRenderer.java │ │ ├── renderer │ │ │ └── MixinGlStateManager.java │ │ └── tile │ │ │ ├── MixinTileEntityBeaconRenderer.java │ │ │ ├── MixinTileEntityEnchantmentTableRenderer.java │ │ │ └── MixinTileEntityRenderDispatcher.java │ │ └── world │ │ ├── MixinWorld.java │ │ ├── block │ │ ├── MixinBlock.java │ │ ├── MixinBlockLiquid.java │ │ ├── MixinBlockSlime.java │ │ ├── MixinBlockSoulSand.java │ │ └── MixinStateImplementation.java │ │ └── item │ │ └── MixinItem.java │ ├── client │ ├── Cosmos.java │ ├── events │ │ ├── block │ │ │ ├── BlockBreakEvent.java │ │ │ ├── BlockResetEvent.java │ │ │ ├── LeftClickBlockEvent.java │ │ │ ├── LiquidInteractEvent.java │ │ │ ├── SlimeEvent.java │ │ │ ├── SoulSandEvent.java │ │ │ └── WaterCollisionEvent.java │ │ ├── client │ │ │ ├── ExceptionThrownEvent.java │ │ │ ├── ModuleToggleEvent.java │ │ │ └── SettingUpdateEvent.java │ │ ├── combat │ │ │ ├── CriticalModifierEvent.java │ │ │ ├── CrystalAttackEvent.java │ │ │ ├── DeathEvent.java │ │ │ └── TotemPopEvent.java │ │ ├── entity │ │ │ ├── EntityWorldEvent.java │ │ │ ├── LivingUpdateEvent.java │ │ │ ├── hitbox │ │ │ │ ├── EntityHitboxSizeEvent.java │ │ │ │ └── HitboxInteractEvent.java │ │ │ ├── horse │ │ │ │ ├── HorseSaddledEvent.java │ │ │ │ └── HorseSteerEvent.java │ │ │ ├── player │ │ │ │ ├── PlayerTurnEvent.java │ │ │ │ ├── RotationUpdateEvent.java │ │ │ │ ├── UpdateWalkingPlayerEvent.java │ │ │ │ └── interact │ │ │ │ │ ├── DualInteractEvent.java │ │ │ │ │ ├── EntityUseItemEvent.java │ │ │ │ │ ├── ItemInputUpdateEvent.java │ │ │ │ │ ├── ReachEvent.java │ │ │ │ │ └── RightClickItemEvent.java │ │ │ └── potion │ │ │ │ └── PotionEffectEvent.java │ │ ├── input │ │ │ ├── KeyDownEvent.java │ │ │ ├── MiddleClickEvent.java │ │ │ └── UpdateMoveStateEvent.java │ │ ├── item │ │ │ └── ItemUseFinishEvent.java │ │ ├── motion │ │ │ ├── collision │ │ │ │ ├── CollisionBoundingBoxEvent.java │ │ │ │ └── EntityCollisionEvent.java │ │ │ └── movement │ │ │ │ ├── KnockBackEvent.java │ │ │ │ ├── MotionEvent.java │ │ │ │ ├── MotionUpdateEvent.java │ │ │ │ ├── PushOutOfBlocksEvent.java │ │ │ │ ├── StepEvent.java │ │ │ │ └── TravelEvent.java │ │ ├── network │ │ │ ├── ConnectEvent.java │ │ │ ├── DecodeEvent.java │ │ │ ├── DisconnectEvent.java │ │ │ └── PacketEvent.java │ │ └── render │ │ │ ├── block │ │ │ └── ColorMultiplierEvent.java │ │ │ ├── entity │ │ │ ├── CrystalTextureEvent.java │ │ │ ├── CrystalUpdateEvent.java │ │ │ ├── LayerArmorEvent.java │ │ │ ├── RenderBeaconBeamEvent.java │ │ │ ├── RenderCrystalEvent.java │ │ │ ├── RenderEntityItemEvent.java │ │ │ ├── RenderItemEvent.java │ │ │ ├── RenderLivingEntityEvent.java │ │ │ ├── RenderNametagEvent.java │ │ │ ├── RenderRotationsEvent.java │ │ │ ├── RenderWitherSkullEvent.java │ │ │ ├── ShaderColorEvent.java │ │ │ └── tile │ │ │ │ └── RenderTileEntityEvent.java │ │ │ ├── gui │ │ │ ├── BossOverlayEvent.java │ │ │ ├── GuiScreenClosedEvent.java │ │ │ ├── RenderAdvancementEvent.java │ │ │ ├── RenderChatTextEvent.java │ │ │ ├── RenderFontEvent.java │ │ │ ├── RenderOverlayEvent.java │ │ │ ├── RenderPotionHUDEvent.java │ │ │ ├── TabListSizeEvent.java │ │ │ ├── TabOverlayEvent.java │ │ │ └── tooltip │ │ │ │ └── RenderTooltipEvent.java │ │ │ ├── other │ │ │ ├── CameraClipEvent.java │ │ │ ├── CapeLocationEvent.java │ │ │ ├── RenderEnchantmentTableBookEvent.java │ │ │ ├── RenderMapEvent.java │ │ │ ├── RenderParticleEvent.java │ │ │ └── SkinLocationEvent.java │ │ │ ├── player │ │ │ ├── CrosshairBobEvent.java │ │ │ ├── HurtCameraEvent.java │ │ │ ├── ModifyFOVEvent.java │ │ │ ├── RenderEatingEvent.java │ │ │ ├── RenderHeldItemEvent.java │ │ │ ├── RenderItemActivationEvent.java │ │ │ └── RenderSelectionBoxEvent.java │ │ │ └── world │ │ │ ├── RenderCaveCullingEvent.java │ │ │ ├── RenderFogColorEvent.java │ │ │ ├── RenderFogEvent.java │ │ │ ├── RenderSkyEvent.java │ │ │ ├── RenderSkylightEvent.java │ │ │ └── RenderWorldEvent.java │ ├── features │ │ ├── Feature.java │ │ ├── command │ │ │ ├── Command.java │ │ │ └── commands │ │ │ │ ├── BindCommand.java │ │ │ │ ├── ConfigCommand.java │ │ │ │ ├── DrawnCommand.java │ │ │ │ ├── FolderCommand.java │ │ │ │ ├── FontCommand.java │ │ │ │ ├── FriendCommand.java │ │ │ │ ├── GamemodeCommand.java │ │ │ │ ├── HClipCommand.java │ │ │ │ ├── HelpCommand.java │ │ │ │ ├── PrefixCommand.java │ │ │ │ ├── ReloadSoundCommand.java │ │ │ │ ├── SettingCommand.java │ │ │ │ ├── ToggleCommand.java │ │ │ │ ├── VClipCommand.java │ │ │ │ ├── VanishCommand.java │ │ │ │ └── WaypointCommand.java │ │ ├── modules │ │ │ ├── Category.java │ │ │ ├── Module.java │ │ │ ├── PersistentModule.java │ │ │ ├── ServiceModule.java │ │ │ ├── client │ │ │ │ ├── ClickGUIModule.java │ │ │ │ ├── ColorsModule.java │ │ │ │ ├── DiscordPresenceModule.java │ │ │ │ ├── FontModule.java │ │ │ │ ├── HUDModule.java │ │ │ │ ├── SocialModule.java │ │ │ │ └── StreamerModeModule.java │ │ │ ├── combat │ │ │ │ ├── AuraModule.java │ │ │ │ ├── AutoArmorModule.java │ │ │ │ ├── AutoBowReleaseModule.java │ │ │ │ ├── AutoCrystalModule.java │ │ │ │ ├── AutoDisconnectModule.java │ │ │ │ ├── AutoTotemModule.java │ │ │ │ ├── AutoTrapModule.java │ │ │ │ ├── CriticalsModule.java │ │ │ │ ├── HoleFillModule.java │ │ │ │ ├── ReplenishModule.java │ │ │ │ ├── SelfBowModule.java │ │ │ │ ├── SelfFillModule.java │ │ │ │ └── SurroundModule.java │ │ │ ├── exploits │ │ │ │ ├── AntiHungerModule.java │ │ │ │ ├── ChorusControlModule.java │ │ │ │ ├── ClickTPModule.java │ │ │ │ ├── FastProjectileModule.java │ │ │ │ ├── NewChunksModule.java │ │ │ │ ├── PacketFlightModule.java │ │ │ │ ├── PingSpoofModule.java │ │ │ │ ├── PortalModule.java │ │ │ │ ├── ReachModule.java │ │ │ │ └── SwingModule.java │ │ │ ├── miscellaneous │ │ │ │ ├── AnnouncerModule.java │ │ │ │ ├── AntiAFKModule.java │ │ │ │ ├── AntiAimModule.java │ │ │ │ ├── AntiCrashModule.java │ │ │ │ ├── AutoEatModule.java │ │ │ │ ├── AutoFishModule.java │ │ │ │ ├── AutoRespawnModule.java │ │ │ │ ├── ChatModificationsModule.java │ │ │ │ ├── FakePlayerModule.java │ │ │ │ ├── MiddleClickModule.java │ │ │ │ ├── NotifierModule.java │ │ │ │ ├── SneakModule.java │ │ │ │ ├── SpammerModule.java │ │ │ │ ├── TimerModule.java │ │ │ │ └── XCarryModule.java │ │ │ ├── movement │ │ │ │ ├── BlinkModule.java │ │ │ │ ├── ElytraFlightModule.java │ │ │ │ ├── EntityControlModule.java │ │ │ │ ├── EntitySpeedModule.java │ │ │ │ ├── FastFallModule.java │ │ │ │ ├── FastSwimModule.java │ │ │ │ ├── FlightModule.java │ │ │ │ ├── HighJumpModule.java │ │ │ │ ├── JesusModule.java │ │ │ │ ├── LongJumpModule.java │ │ │ │ ├── NoFallModule.java │ │ │ │ ├── NoSlowModule.java │ │ │ │ ├── ParkourModule.java │ │ │ │ ├── SpeedModule.java │ │ │ │ ├── SprintModule.java │ │ │ │ ├── StepModule.java │ │ │ │ ├── TickShiftModule.java │ │ │ │ ├── VelocityModule.java │ │ │ │ └── YawModule.java │ │ │ ├── visual │ │ │ │ ├── BlockHighlightModule.java │ │ │ │ ├── BreadcrumbsModule.java │ │ │ │ ├── BreakHighlightModule.java │ │ │ │ ├── CameraClipModule.java │ │ │ │ ├── ChamsModule.java │ │ │ │ ├── ESPModule.java │ │ │ │ ├── ExtraTabModule.java │ │ │ │ ├── FreecamModule.java │ │ │ │ ├── FullBrightModule.java │ │ │ │ ├── HoleESPModule.java │ │ │ │ ├── NametagsModule.java │ │ │ │ ├── NoRenderModule.java │ │ │ │ ├── NoRotateModule.java │ │ │ │ ├── NoWeatherModule.java │ │ │ │ ├── SkyboxModule.java │ │ │ │ ├── TooltipsModule.java │ │ │ │ ├── TracersModule.java │ │ │ │ ├── ViewModelModule.java │ │ │ │ └── WaypointsModule.java │ │ │ └── world │ │ │ │ ├── AvoidModule.java │ │ │ │ ├── FastUseModule.java │ │ │ │ ├── InteractModule.java │ │ │ │ ├── MultiTaskModule.java │ │ │ │ ├── ScaffoldModule.java │ │ │ │ ├── SpeedMineModule.java │ │ │ │ └── WallhackModule.java │ │ └── setting │ │ │ ├── Bind.java │ │ │ └── Setting.java │ ├── manager │ │ ├── Manager.java │ │ └── managers │ │ │ ├── AltManager.java │ │ │ ├── CapeManager.java │ │ │ ├── ChangelogManager.java │ │ │ ├── ChatManager.java │ │ │ ├── CommandManager.java │ │ │ ├── ConfigManager.java │ │ │ ├── EventManager.java │ │ │ ├── FontManager.java │ │ │ ├── HoleManager.java │ │ │ ├── InteractionManager.java │ │ │ ├── InventoryManager.java │ │ │ ├── ItemManager.java │ │ │ ├── ModuleManager.java │ │ │ ├── NotificationManager.java │ │ │ ├── PatchManager.java │ │ │ ├── PotionManager.java │ │ │ ├── PresenceManager.java │ │ │ ├── ProgressManager.java │ │ │ ├── ReloadManager.java │ │ │ ├── RotationManager.java │ │ │ ├── SocialManager.java │ │ │ ├── SoundManager.java │ │ │ ├── ThreadManager.java │ │ │ ├── TickManager.java │ │ │ ├── TotemManager.java │ │ │ └── WaypointManager.java │ ├── shader │ │ ├── Shader.java │ │ └── shaders │ │ │ ├── DotShader.java │ │ │ ├── FillShader.java │ │ │ ├── OutlineShader.java │ │ │ └── RainbowOutlineShader.java │ └── ui │ │ ├── altgui │ │ ├── AddAltGUI.java │ │ ├── Alt.java │ │ ├── AltEntry.java │ │ └── AltManagerGUI.java │ │ ├── clickgui │ │ ├── ClickGUIScreen.java │ │ └── screens │ │ │ ├── DrawableComponent.java │ │ │ └── configuration │ │ │ ├── component │ │ │ ├── ClickType.java │ │ │ └── components │ │ │ │ ├── FrameComponent.java │ │ │ │ ├── category │ │ │ │ └── CategoryFrameComponent.java │ │ │ │ ├── module │ │ │ │ └── ModuleComponent.java │ │ │ │ └── setting │ │ │ │ ├── BindComponent.java │ │ │ │ ├── BooleanComponent.java │ │ │ │ ├── ColorComponent.java │ │ │ │ ├── DrawnComponent.java │ │ │ │ ├── EnumComponent.java │ │ │ │ ├── NumberComponent.java │ │ │ │ └── SettingComponent.java │ │ │ └── taskbar │ │ │ └── Taskbar.java │ │ ├── tabgui │ │ ├── TabGUI.java │ │ └── component │ │ │ ├── CategoryComponent.java │ │ │ └── ModuleComponent.java │ │ └── util │ │ ├── ColorHSB.java │ │ ├── InterfaceWrapper.java │ │ ├── MousePosition.java │ │ ├── ScissorStack.java │ │ └── animation │ │ ├── Animation.java │ │ └── Easing.java │ ├── connection │ └── Client.java │ ├── font │ ├── FontCache.java │ ├── FontImage.java │ └── FontRenderer.java │ └── util │ ├── Wrapper.java │ ├── chat │ ├── ChatBuilder.java │ └── ChatUtil.java │ ├── combat │ ├── DamageUtil.java │ ├── EnemyUtil.java │ └── ExplosionUtil.java │ ├── entity │ ├── EntityUtil.java │ └── InterpolationUtil.java │ ├── file │ └── FileSystemUtil.java │ ├── holder │ └── Rotation.java │ ├── math │ ├── MathUtil.java │ └── Timer.java │ ├── player │ ├── AngleUtil.java │ ├── InventoryUtil.java │ ├── MotionUtil.java │ └── PlayerUtil.java │ ├── render │ ├── FontUtil.java │ ├── RenderBuilder.java │ └── RenderUtil.java │ ├── string │ ├── ColorUtil.java │ └── StringFormatter.java │ └── world │ ├── BlockUtil.java │ ├── RaytraceUtil.java │ ├── SneakBlocks.java │ └── WorldUtil.java └── resources ├── assets ├── cosmos │ ├── shaders │ │ ├── glsl │ │ │ ├── dot.frag │ │ │ ├── fill.frag │ │ │ ├── outline.frag │ │ │ ├── rainbow_outline.frag │ │ │ └── vertex.vert │ │ └── minecraft │ │ │ └── blur.json │ └── textures │ │ ├── cape │ │ ├── contributor.png │ │ └── normal.png │ │ ├── icons │ │ ├── back.png │ │ ├── cancel.png │ │ ├── client.png │ │ ├── combat.png │ │ ├── dots.png │ │ ├── dropdown.png │ │ ├── info.png │ │ ├── misc.png │ │ ├── movement.png │ │ ├── player.png │ │ ├── visual.png │ │ └── warning.png │ │ └── imgs │ │ ├── logo.png │ │ ├── logotransparent.png │ │ ├── logotransparentnotext.png │ │ ├── picker.png │ │ ├── spacebg.png │ │ ├── splash.jpg │ │ ├── splash.png │ │ └── transparentlogo.png └── minecraft │ └── sounds │ ├── click.ogg │ └── sounds.json ├── mcmod.info ├── mixins.cosmos.json └── pack.mcmeta /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: Issue to report bugs 4 | title: '[BUG]' 5 | labels: 'bug' 6 | assignees: '' 7 | 8 | --- 9 | 10 | Issue: 11 | * What is the bug that you would like addressed? 12 | 13 | Context: 14 | * When does this bug happen? Does it persist after restart/toggle? 15 | 16 | Environment: 17 | * What other clients do you run, PC setup, relevant servers? How can this bug be replicated? 18 | 19 | Config: 20 | * Attach any relevant parts of your config here. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Issues to request features or really anything. 4 | title: '[SUGGESTION]' 5 | labels: 'enhancement' 6 | assignees: '' 7 | 8 | --- 9 | 10 | Issue: 11 | * What is the feature you would like added? 12 | 13 | Context: 14 | * Why would this feature be useful? Have you tried any existing alternatives? 15 | 16 | Environment: 17 | * What other clients do you run, PC setup, relevant servers? 18 | 19 | Config: 20 | * Attach any relevant parts of your config here. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Question 3 | about: Issues to ask a question. 4 | title: '[QUESTION]' 5 | labels: 'question' 6 | assignees: '' 7 | 8 | --- 9 | 10 | Issue: 11 | * What is the question you would like answered? 12 | 13 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Java CI with Gradle. 2 | 3 | on: [ push, pull_request ] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v2 10 | - uses: gradle/wrapper-validation-action@v1 11 | with: 12 | min-wrapper-count: 1 13 | allow-snapshots: false 14 | 15 | - name: Set up JDK 8. 16 | uses: actions/setup-java@v2 17 | 18 | with: 19 | java-version: 8 20 | distribution: adopt-openj9 21 | java-package: jdk 22 | architecture: x64 23 | check-latest: false 24 | server-id: github 25 | server-username: GITHUB_ACTOR 26 | server-password: GITHUB_TOKEN 27 | overwrite-settings: true 28 | job-status: success 29 | 30 | - name: Grant execute permission for gradlew. 31 | run: chmod +x gradlew 32 | 33 | - uses: gradle/gradle-build-action@v2 34 | with: 35 | arguments: build --no-daemon 36 | 37 | - uses: actions/upload-artifact@v2 38 | with: 39 | name: package 40 | path: build/libs/ 41 | if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`. 42 | retention-days: 30 # The retention period must be between 1 and 90 inclusive. 43 | env: 44 | JAVA_HOME: /opt/hostedtoolcache/Java_Adopt-OpenJ9_jdk/8.0.312-7/x64 45 | GRADLE_BUILD_ACTION_CACHE_RESTORED: true 46 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Eclipse. 2 | bin 3 | *.launch 4 | .settings 5 | .metadata 6 | .classpath 7 | .project 8 | 9 | # .idea 10 | out 11 | *.ipr 12 | *.iws 13 | *.iml 14 | .idea 15 | 16 | # Gradle. 17 | build 18 | .gradle 19 | 20 | # Other. 21 | eclipse 22 | run 23 | 24 | # Forge. 25 | forge*changelog.txt 26 | 27 | # Mac 28 | *.DS_Store 29 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Sets default memory used for gradle commands. Can be overridden by user or command line properties. 2 | # This is required to provide enough memory for the Minecraft decompilation process. 3 | org.gradle.jvmargs = -Xmx3G 4 | org.gradle.parallel = true 5 | org.gradle.caching = true 6 | 7 | # Mod stuff 8 | modversion = 1.5.0-beta 9 | modid = cosmos 10 | modname = Cosmos 11 | 12 | # Gradle stuff 13 | modgroup = cope.cosmos 14 | mainclass = cope.cosmos.client.Cosmos 15 | mixinclass = cope.cosmos.asm.MixinLoader 16 | mixinconfig = mixins.cosmos.json 17 | mappingsversion = snapshot_20171003 18 | mcforgeversion = 1.12.2-14.23.5.2847 19 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momentumdevelopment/cosmos/398a393008a47d223c6a7a422f7c2e04454b46df/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/MixinLoader.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm; 2 | 3 | import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin; 4 | import org.spongepowered.asm.launch.MixinBootstrap; 5 | import org.spongepowered.asm.mixin.Mixins; 6 | 7 | import java.util.Map; 8 | 9 | /** 10 | * @author bon55 11 | * @since 05/05/2021 12 | */ 13 | @IFMLLoadingPlugin.Name("Cosmos") 14 | @IFMLLoadingPlugin.MCVersion("1.12.2") 15 | public class MixinLoader implements IFMLLoadingPlugin { 16 | public MixinLoader() { 17 | MixinBootstrap.init(); 18 | Mixins.addConfiguration("mixins.cosmos.json"); 19 | } 20 | 21 | @Override 22 | public String[] getASMTransformerClass() { 23 | return null; 24 | } 25 | 26 | @Override 27 | public String getModContainerClass() { 28 | return null; 29 | } 30 | 31 | @Override 32 | public String getSetupClass() { 33 | return null; 34 | } 35 | 36 | @Override 37 | public void injectData(Map data) { 38 | 39 | } 40 | 41 | @Override 42 | public String getAccessTransformerClass() { 43 | return null; 44 | } 45 | } -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/MixinJndiLookup.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins; 2 | 3 | import org.apache.logging.log4j.core.LogEvent; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.Pseudo; 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 | @Pseudo 11 | @Mixin(targets = "org.apache.logging.log4j.core.lookup.JndiLookup", remap = false) 12 | public class MixinJndiLookup { 13 | 14 | @Inject(method = "lookup(Lorg/apache/logging/log4j/core/LogEvent;Ljava/lang/String;)Ljava/lang/String;", at = @At("HEAD"), cancellable = true) 15 | public void onLookup(LogEvent event, String key, CallbackInfoReturnable info) { 16 | info.setReturnValue(key); 17 | info.cancel(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/MixinMinecraft.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.input.MiddleClickEvent; 5 | import cope.cosmos.client.events.render.gui.GuiScreenClosedEvent; 6 | import net.minecraft.client.Minecraft; 7 | import net.minecraft.client.gui.GuiScreen; 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 | import javax.annotation.Nullable; 15 | 16 | @Mixin(Minecraft.class) 17 | public class MixinMinecraft { 18 | 19 | @Shadow 20 | @Nullable 21 | public GuiScreen currentScreen; 22 | 23 | @Inject(method = "displayGuiScreen", at = @At("HEAD"), cancellable = true) 24 | public void displayGuiScreen(GuiScreen scr, CallbackInfo info) { 25 | if (scr == null) { 26 | Cosmos.EVENT_BUS.post(new GuiScreenClosedEvent(currentScreen)); 27 | } 28 | } 29 | 30 | @Inject(method = "middleClickMouse", at = @At("HEAD"), cancellable = true) 31 | public void middleClickMouse(CallbackInfo info) { 32 | MiddleClickEvent middleClickEvent = new MiddleClickEvent(); 33 | Cosmos.EVENT_BUS.post(middleClickEvent); 34 | 35 | if (middleClickEvent.isCanceled()) { 36 | info.cancel(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/ICPacketChatMessage.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 2 | 3 | import net.minecraft.network.play.client.CPacketChatMessage; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(CPacketChatMessage.class) 8 | public interface ICPacketChatMessage { 9 | 10 | @Accessor("message") 11 | void setMessage(String message); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/ICPacketCloseWindow.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 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 ICPacketCloseWindow { 9 | 10 | @Accessor("windowId") 11 | int getWindowID(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/ICPacketConfirmTransaction.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 2 | 3 | import net.minecraft.network.play.client.CPacketConfirmTransaction; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(CPacketConfirmTransaction.class) 8 | public interface ICPacketConfirmTransaction { 9 | 10 | @Accessor("uid") 11 | void setUid(short uid); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/ICPacketKeepAlive.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 2 | 3 | import net.minecraft.network.play.client.CPacketKeepAlive; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(CPacketKeepAlive.class) 8 | public interface ICPacketKeepAlive { 9 | 10 | @Accessor("key") 11 | void setKey(long key); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/ICPacketPlayer.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 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 ICPacketPlayer { 9 | 10 | @Accessor("rotating") 11 | boolean isRotating(); 12 | 13 | @Accessor("moving") 14 | boolean isMoving(); 15 | 16 | @Accessor("x") 17 | void setX(double x); 18 | 19 | @Accessor("y") 20 | void setY(double y); 21 | 22 | @Accessor("z") 23 | void setZ(double z); 24 | 25 | @Accessor("yaw") 26 | void setYaw(float yaw); 27 | 28 | @Accessor("pitch") 29 | void setPitch(float pitch); 30 | 31 | @Accessor("onGround") 32 | void setOnGround(boolean onGround); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/ICPacketPlayerTryUseItemOnBlock.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 2 | 3 | import net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock; 4 | import net.minecraft.util.EnumFacing; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(CPacketPlayerTryUseItemOnBlock.class) 9 | public interface ICPacketPlayerTryUseItemOnBlock { 10 | 11 | @Accessor("placedBlockDirection") 12 | void setDirection(EnumFacing facing); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/ICPacketUseEntity.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 2 | 3 | import net.minecraft.network.play.client.CPacketUseEntity; 4 | import net.minecraft.network.play.client.CPacketUseEntity.Action; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(CPacketUseEntity.class) 9 | public interface ICPacketUseEntity { 10 | 11 | @Accessor("entityID") 12 | void setID(int id); 13 | 14 | @Accessor("action") 15 | void setAction(Action action); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/IEntity.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 2 | 3 | import net.minecraft.entity.Entity; 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(Entity.class) 9 | public interface IEntity { 10 | 11 | @Accessor("inPortal") 12 | boolean getInPortal(); 13 | 14 | @Accessor("isInWeb") 15 | boolean getInWeb(); 16 | 17 | @Accessor("isInWeb") 18 | void setInWeb(boolean isInWeb); 19 | 20 | @Accessor("inPortal") 21 | void setInPortal(boolean inPortal); 22 | 23 | @Invoker("setSize") 24 | void setEntitySize(float width, float height); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/IEntityLivingBase.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 2 | 3 | import net.minecraft.entity.EntityLivingBase; 4 | import net.minecraft.potion.Potion; 5 | import net.minecraft.potion.PotionEffect; 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 | 12 | @Mixin(EntityLivingBase.class) 13 | public interface IEntityLivingBase { 14 | 15 | @Accessor("activePotionsMap") 16 | void setActivePotionMap(Map in); 17 | 18 | @Invoker("onNewPotionEffect") 19 | void hookOnNewPotionEffect(PotionEffect potionEffectIn); 20 | 21 | @Invoker("onChangedPotionEffect") 22 | void hookOnChangedPotionEffect(PotionEffect potionEffectIn, boolean in); 23 | 24 | @Invoker("getArmSwingAnimationEnd") 25 | int hookGetArmSwingAnimationEnd(); 26 | 27 | @Invoker("getWaterSlowDown") 28 | float hookGetWaterSlowDown(); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/IEntityPlayerSP.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 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 IEntityPlayerSP { 9 | 10 | @Accessor("serverSprintState") 11 | boolean getServerSprintState(); 12 | 13 | @Accessor("serverSneakState") 14 | boolean getServerSneakState(); 15 | 16 | @Accessor("positionUpdateTicks") 17 | int getPositionUpdateTicks(); 18 | 19 | @Accessor("lastReportedPosX") 20 | double getLastReportedPosX(); 21 | 22 | @Accessor("lastReportedPosY") 23 | double getLastReportedPosY(); 24 | 25 | @Accessor("lastReportedPosZ") 26 | double getLastReportedPosZ(); 27 | 28 | @Accessor("lastReportedYaw") 29 | float getLastReportedYaw(); 30 | 31 | @Accessor("lastReportedPitch") 32 | float getLastReportedPitch(); 33 | 34 | @Accessor("prevOnGround") 35 | boolean getPreviousOnGround(); 36 | 37 | @Accessor("serverSprintState") 38 | void setServerSprintState(boolean serverSprintState); 39 | 40 | @Accessor("serverSneakState") 41 | void setServerSneakState(boolean serverSneakState); 42 | 43 | @Accessor("positionUpdateTicks") 44 | void setPositionUpdateTicks(int positionUpdateTicks); 45 | 46 | @Accessor("lastReportedPosX") 47 | void setLastReportedPosX(double lastReportedPosX); 48 | 49 | @Accessor("lastReportedPosY") 50 | void setLastReportedPosY(double lastReportedPosY); 51 | 52 | @Accessor("lastReportedPosZ") 53 | void setLastReportedPosZ(double lastReportedPosZ); 54 | 55 | @Accessor("lastReportedYaw") 56 | void setLastReportedYaw(float lastReportedYaw); 57 | 58 | @Accessor("lastReportedPitch") 59 | void setLastReportedPitch(float lastReportedPitch); 60 | 61 | @Accessor("prevOnGround") 62 | void setPreviousOnGround(boolean previousOnGround); 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/IEntityRenderer.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 2 | 3 | import net.minecraft.client.renderer.EntityRenderer; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Invoker; 6 | 7 | @Mixin(EntityRenderer.class) 8 | public interface IEntityRenderer { 9 | 10 | @Invoker("setupCameraTransform") 11 | void setupCamera(float partialTicks, int pass); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/IGameProfile.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 2 | 3 | import com.mojang.authlib.GameProfile; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(GameProfile.class) 8 | public interface IGameProfile { 9 | 10 | @Accessor("name") 11 | void setName(String name); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/IGuiChat.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 2 | 3 | import net.minecraft.client.gui.GuiChat; 4 | import net.minecraft.client.gui.GuiTextField; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(GuiChat.class) 9 | public interface IGuiChat { 10 | 11 | @Accessor("inputField") 12 | GuiTextField getInputField(); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/IKeybinding.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 2 | 3 | import net.minecraft.client.settings.KeyBinding; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(KeyBinding.class) 8 | public interface IKeybinding { 9 | 10 | @Accessor("pressed") 11 | void setPressed(boolean pressed); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/IMinecraft.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.entity.Entity; 5 | import net.minecraft.util.Session; 6 | import net.minecraft.util.Timer; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.gen.Accessor; 9 | import org.spongepowered.asm.mixin.gen.Invoker; 10 | 11 | @Mixin(Minecraft.class) 12 | public interface IMinecraft { 13 | 14 | @Accessor("session") 15 | void setSession(Session session); 16 | 17 | @Invoker("rightClickMouse") 18 | void hookRightClickMouse(); 19 | 20 | @Accessor("rightClickDelayTimer") 21 | void setRightClickDelayTimer(int rightClickDelayTimer); 22 | 23 | @Accessor("renderViewEntity") 24 | void hookSetRenderViewEntity(Entity renderViewEntity); 25 | 26 | @Accessor("timer") 27 | Timer getTimer(); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/INetHandlerPlayClient.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 2 | 3 | import net.minecraft.client.network.NetHandlerPlayClient; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(NetHandlerPlayClient.class) 8 | public interface INetHandlerPlayClient { 9 | 10 | @Accessor("doneLoadingTerrain") 11 | boolean isDoneLoadingTerrain(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/INetworkManager.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 2 | 3 | import io.netty.util.concurrent.Future; 4 | import io.netty.util.concurrent.GenericFutureListener; 5 | import net.minecraft.network.NetworkManager; 6 | import net.minecraft.network.Packet; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.gen.Invoker; 9 | 10 | @Mixin(NetworkManager.class) 11 | public interface INetworkManager { 12 | 13 | @Invoker("dispatchPacket") 14 | void hookDispatchPacket(Packet inPacket, GenericFutureListener>[] futureListeners); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/IPlayerControllerMP.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 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 IPlayerControllerMP { 10 | 11 | @Accessor("curBlockDamageMP") 12 | void setCurrentBlockDamage(float currentBlockDamage); 13 | 14 | @Accessor("curBlockDamageMP") 15 | float getCurrentBlockDamage(); 16 | 17 | @Accessor("blockHitDelay") 18 | void setBlockHitDelay(int blockHitDelay); 19 | 20 | @Accessor("currentPlayerItem") 21 | int getCurrentPlayerItem(); 22 | 23 | @Accessor("currentPlayerItem") 24 | void setCurrentPlayerItem(int currentPlayerItem); 25 | 26 | @Invoker("syncCurrentPlayItem") 27 | void hookSyncCurrentPlayItem(); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/IRenderGlobal.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 2 | 3 | import net.minecraft.client.renderer.DestroyBlockProgress; 4 | import net.minecraft.client.renderer.RenderGlobal; 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.Map; 10 | 11 | @Mixin(RenderGlobal.class) 12 | public interface IRenderGlobal { 13 | 14 | @Accessor("entityOutlineShader") 15 | ShaderGroup getEntityOutlineShader(); 16 | 17 | @Accessor("damagedBlocks") 18 | Map getDamagedBlocks(); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/IRenderManager.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 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 IRenderManager { 9 | 10 | @Accessor("renderPosX") 11 | double getRenderX(); 12 | 13 | @Accessor("renderPosY") 14 | double getRenderY(); 15 | 16 | @Accessor("renderPosZ") 17 | double getRenderZ(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/ISPacketEntityVelocity.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 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 ISPacketEntityVelocity { 9 | 10 | @Accessor("motionX") 11 | int getMotionX(); 12 | 13 | @Accessor("motionY") 14 | int getMotionY(); 15 | 16 | @Accessor("motionZ") 17 | int getMotionZ(); 18 | 19 | @Accessor("motionX") 20 | void setMotionX(int x); 21 | 22 | @Accessor("motionY") 23 | void setMotionY(int y); 24 | 25 | @Accessor("motionZ") 26 | void setMotionZ(int z); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/ISPacketExplosion.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 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 ISPacketExplosion { 9 | 10 | @Accessor("motionX") 11 | float getMotionX(); 12 | 13 | @Accessor("motionY") 14 | float getMotionY(); 15 | 16 | @Accessor("motionZ") 17 | float getMotionZ(); 18 | 19 | @Accessor("motionX") 20 | void setMotionX(float x); 21 | 22 | @Accessor("motionY") 23 | void setMotionY(float y); 24 | 25 | @Accessor("motionZ") 26 | void setMotionZ(float z); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/ISPacketPlayerPosLook.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 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 ISPacketPlayerPosLook { 9 | 10 | @Accessor("yaw") 11 | void setYaw(float yaw); 12 | 13 | @Accessor("yaw") 14 | float getYaw(); 15 | 16 | @Accessor("pitch") 17 | void setPitch(float pitch); 18 | 19 | @Accessor("pitch") 20 | float getPitch(); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/ISession.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 2 | 3 | import net.minecraft.util.Session; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(Session.class) 8 | public interface ISession { 9 | 10 | @Accessor("username") 11 | void setUsername(String username); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/IShaderGroup.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 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 IShaderGroup { 13 | 14 | @Accessor("listShaders") 15 | List getListShaders(); 16 | 17 | @Accessor("mainFramebuffer") 18 | Framebuffer getMainFramebuffer(); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/ISlot.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 2 | 3 | import net.minecraft.inventory.Slot; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Invoker; 6 | 7 | @Mixin(Slot.class) 8 | public interface ISlot { 9 | 10 | @Invoker("onSwapCraft") 11 | void hookOnSwapCraft(int count); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/ISoundHandler.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 2 | 3 | import net.minecraft.client.audio.SoundHandler; 4 | import net.minecraft.client.audio.SoundManager; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(SoundHandler.class) 9 | public interface ISoundHandler { 10 | 11 | @Accessor("sndManager") 12 | SoundManager getSoundManager(); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/ITextComponentString.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 2 | 3 | import net.minecraft.util.text.TextComponentString; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(TextComponentString.class) 8 | public interface ITextComponentString { 9 | 10 | @Accessor("text") 11 | void setText(String text); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/accessor/ITimer.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.accessor; 2 | 3 | import net.minecraft.util.Timer; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(Timer.class) 8 | public interface ITimer { 9 | 10 | @Accessor("tickLength") 11 | float getTickLength(); 12 | 13 | @Accessor("tickLength") 14 | void setTickLength(float tick); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/entity/crystal/MixinEntityEnderCrystal.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.entity.crystal; 2 | 3 | import cope.cosmos.client.events.render.entity.CrystalUpdateEvent; 4 | import net.minecraft.entity.item.EntityEnderCrystal; 5 | import net.minecraftforge.common.MinecraftForge; 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(EntityEnderCrystal.class) 12 | public class MixinEntityEnderCrystal { 13 | 14 | @Inject(method = "onUpdate", at = @At("HEAD"), cancellable = true) 15 | public void onOnUpdate(CallbackInfo info) { 16 | CrystalUpdateEvent crystalUpdateEvent = new CrystalUpdateEvent(); 17 | MinecraftForge.EVENT_BUS.post(crystalUpdateEvent); 18 | 19 | if (crystalUpdateEvent.isCanceled()) { 20 | info.cancel(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/entity/horse/MixinAbstractHorse.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.entity.horse; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.entity.horse.HorseSaddledEvent; 5 | import cope.cosmos.client.events.entity.horse.HorseSteerEvent; 6 | import net.minecraft.entity.passive.AbstractHorse; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 11 | 12 | @Mixin(AbstractHorse.class) 13 | public class MixinAbstractHorse { 14 | 15 | @Inject(method = "canBeSteered", at = @At("HEAD"), cancellable = true) 16 | public void canBeSteered(CallbackInfoReturnable info) { 17 | HorseSteerEvent horseSteerEvent = new HorseSteerEvent(); 18 | Cosmos.EVENT_BUS.post(horseSteerEvent); 19 | 20 | if (horseSteerEvent.isCanceled()) { 21 | info.cancel(); 22 | info.setReturnValue(true); 23 | } 24 | } 25 | 26 | @Inject(method = "isHorseSaddled", at = @At("HEAD"), cancellable = true) 27 | public void isHorseSaddled(CallbackInfoReturnable info) { 28 | HorseSaddledEvent horseSaddledEvent = new HorseSaddledEvent(); 29 | Cosmos.EVENT_BUS.post(horseSaddledEvent); 30 | 31 | if (horseSaddledEvent.isCanceled()) { 32 | info.cancel(); 33 | info.setReturnValue(true); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/entity/player/MixinInventoryPlayer.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.entity.player; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import net.minecraft.client.Minecraft; 5 | import net.minecraft.entity.player.EntityPlayer; 6 | import net.minecraft.entity.player.InventoryPlayer; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.util.NonNullList; 9 | import org.spongepowered.asm.mixin.Final; 10 | import org.spongepowered.asm.mixin.Mixin; 11 | import org.spongepowered.asm.mixin.Shadow; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 15 | 16 | @Mixin(InventoryPlayer.class) 17 | public abstract class MixinInventoryPlayer { 18 | 19 | @Shadow @Final public NonNullList mainInventory; 20 | 21 | @Shadow public int currentItem; 22 | 23 | @Shadow public EntityPlayer player; 24 | 25 | @Inject(method = "getCurrentItem", at = @At("HEAD"), cancellable = true) 26 | public void getCurrentItem(CallbackInfoReturnable info) { 27 | Cosmos cosmos = Cosmos.INSTANCE; 28 | if (cosmos != null && cosmos.getInventoryManager() != null && player.equals(Minecraft.getMinecraft().player)) { 29 | int slot = cosmos.getInventoryManager().getServerSlot(); 30 | if (slot == -1) { 31 | slot = currentItem; 32 | } 33 | 34 | info.setReturnValue(InventoryPlayer.isHotbar(slot) ? mainInventory.get(slot) : ItemStack.EMPTY); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/input/MixinKeyBinding.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.input; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.input.KeyDownEvent; 5 | import net.minecraft.client.settings.KeyBinding; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Shadow; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 11 | 12 | @Mixin(KeyBinding.class) 13 | public class MixinKeyBinding { 14 | 15 | @Shadow 16 | private boolean pressed; 17 | 18 | @Shadow 19 | private int keyCode; 20 | 21 | @Inject(method = "isKeyDown", at = @At("HEAD"), cancellable = true) 22 | public void onIsKeyDown(CallbackInfoReturnable info) { 23 | KeyDownEvent keyDownEvent = new KeyDownEvent(keyCode, pressed); 24 | Cosmos.EVENT_BUS.post(keyDownEvent); 25 | 26 | if (keyDownEvent.isCanceled()) { 27 | info.setReturnValue(keyDownEvent.isPressed()); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/input/MixinMovementInputFromOptions.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.input; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.input.UpdateMoveStateEvent; 5 | import net.minecraft.util.MovementInputFromOptions; 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(MovementInputFromOptions.class) 12 | public class MixinMovementInputFromOptions { 13 | 14 | @Inject(method = "updatePlayerMoveState", at = @At("RETURN")) 15 | public void onUpdatePlayerMoveState(CallbackInfo info) { 16 | UpdateMoveStateEvent updateMoveStateEvent = new UpdateMoveStateEvent(); 17 | Cosmos.EVENT_BUS.post(updateMoveStateEvent); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/network/MixinNettyCompressionDecoder.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.network; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.network.DecodeEvent; 5 | import net.minecraft.network.NettyCompressionDecoder; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.Constant; 8 | import org.spongepowered.asm.mixin.injection.ModifyConstant; 9 | 10 | @Mixin(NettyCompressionDecoder.class) 11 | public class MixinNettyCompressionDecoder { 12 | 13 | @ModifyConstant(method = "decode", constant = @Constant(intValue = 0x200000)) 14 | private int onDecode(int n) { 15 | DecodeEvent decodeEvent = new DecodeEvent(); 16 | Cosmos.EVENT_BUS.post(decodeEvent); 17 | 18 | // no packet limit 19 | if (decodeEvent.isCanceled()) { 20 | return Integer.MAX_VALUE; 21 | } 22 | 23 | return n; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/render/MixinRender.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.render; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.render.entity.ShaderColorEvent; 5 | import net.minecraft.client.renderer.entity.Render; 6 | import net.minecraft.entity.Entity; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 11 | 12 | @SuppressWarnings("unused") 13 | @Mixin(Render.class) 14 | public class MixinRender { 15 | 16 | @Inject(method = "getTeamColor", at = @At("HEAD"), cancellable = true) 17 | public void getTeamColor(T entity, CallbackInfoReturnable info) { 18 | ShaderColorEvent shaderColorEvent = new ShaderColorEvent(entity); 19 | Cosmos.EVENT_BUS.post(shaderColorEvent); 20 | 21 | if (shaderColorEvent.isCanceled()) { 22 | info.cancel(); 23 | info.setReturnValue(shaderColorEvent.getColor().getRGB()); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/render/MixinRenderGlobal.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.render; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.render.player.RenderSelectionBoxEvent; 5 | import cope.cosmos.client.events.render.world.RenderSkyEvent; 6 | import cope.cosmos.util.Wrapper; 7 | import net.minecraft.client.multiplayer.WorldClient; 8 | import net.minecraft.client.renderer.RenderGlobal; 9 | import net.minecraft.entity.Entity; 10 | import net.minecraft.entity.player.EntityPlayer; 11 | import net.minecraft.util.math.RayTraceResult; 12 | import net.minecraft.util.math.Vec3d; 13 | import org.spongepowered.asm.mixin.Mixin; 14 | import org.spongepowered.asm.mixin.injection.At; 15 | import org.spongepowered.asm.mixin.injection.Inject; 16 | import org.spongepowered.asm.mixin.injection.Redirect; 17 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 18 | 19 | @Mixin(RenderGlobal.class) 20 | public class MixinRenderGlobal implements Wrapper { 21 | 22 | @Inject(method = "drawSelectionBox", at = @At("HEAD"), cancellable = true) 23 | public void drawSelectionBox(EntityPlayer player, RayTraceResult movingObjectPositionIn, int execute, float partialTicks, CallbackInfo info) { 24 | RenderSelectionBoxEvent renderSelectionBoxEvent = new RenderSelectionBoxEvent(); 25 | Cosmos.EVENT_BUS.post(renderSelectionBoxEvent); 26 | 27 | if (renderSelectionBoxEvent.isCanceled()) { 28 | info.cancel(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/render/MixinVisGraph.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.render; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.render.world.RenderCaveCullingEvent; 5 | import net.minecraft.client.renderer.chunk.SetVisibility; 6 | import net.minecraft.client.renderer.chunk.VisGraph; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 11 | 12 | @Mixin(VisGraph.class) 13 | public class MixinVisGraph { 14 | 15 | @Inject(method = "computeVisibility", at = @At("HEAD"), cancellable = true) 16 | public void onComputeVisibility(CallbackInfoReturnable info) { 17 | if (Cosmos.EVENT_BUS.post(new RenderCaveCullingEvent())) { 18 | SetVisibility setVisibility = new SetVisibility(); 19 | setVisibility.setAllVisible(true); 20 | 21 | info.setReturnValue(setVisibility); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/render/entity/MixinRenderEntityItem.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.render.entity; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.render.entity.RenderEntityItemEvent; 5 | import cope.cosmos.client.events.render.entity.RenderItemEvent; 6 | import net.minecraft.client.renderer.RenderItem; 7 | import net.minecraft.client.renderer.entity.RenderEntityItem; 8 | import net.minecraft.entity.item.EntityItem; 9 | import org.spongepowered.asm.mixin.Final; 10 | import org.spongepowered.asm.mixin.Mixin; 11 | import org.spongepowered.asm.mixin.Shadow; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(RenderEntityItem.class) 17 | public class MixinRenderEntityItem { 18 | 19 | @Shadow 20 | @Final 21 | private RenderItem itemRenderer; 22 | 23 | @Inject(method = "doRender", at = @At("HEAD"), cancellable = true) 24 | public void onDoRenderHead(EntityItem entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo info) { 25 | RenderItemEvent renderItemEvent = new RenderItemEvent(entity, x, y, z, entityYaw, partialTicks); 26 | Cosmos.EVENT_BUS.post(renderItemEvent); 27 | 28 | if (renderItemEvent.isCanceled()) { 29 | info.cancel(); 30 | } 31 | } 32 | 33 | @Inject(method = "doRender", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/RenderItem;renderItem(Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/renderer/block/model/IBakedModel;)V"), cancellable = true) 34 | public void onDoRender(EntityItem entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo info) { 35 | RenderEntityItemEvent renderEntityItemEvent = new RenderEntityItemEvent(itemRenderer, entity, x, y, z, entityYaw, partialTicks); 36 | Cosmos.EVENT_BUS.post(renderEntityItemEvent); 37 | 38 | if (renderEntityItemEvent.isCanceled()) { 39 | info.cancel(); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/render/entity/MixinRenderWitherSkull.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.render.entity; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.render.entity.RenderWitherSkullEvent; 5 | import net.minecraft.client.renderer.entity.RenderWitherSkull; 6 | import net.minecraft.entity.projectile.EntityWitherSkull; 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 | @SuppressWarnings("unused") 13 | @Mixin(RenderWitherSkull.class) 14 | public class MixinRenderWitherSkull { 15 | 16 | @Inject(method = "doRender", at = @At("HEAD"), cancellable = true) 17 | public void doRender(EntityWitherSkull entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo info) { 18 | RenderWitherSkullEvent renderWitherSkullEvent = new RenderWitherSkullEvent(); 19 | Cosmos.EVENT_BUS.post(renderWitherSkullEvent); 20 | 21 | if (renderWitherSkullEvent.isCanceled()) { 22 | info.cancel(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/render/gui/MixinGuiConnecting.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.render.gui; 2 | 3 | import net.minecraft.client.multiplayer.GuiConnecting; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Inject; 7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 8 | 9 | @Mixin(GuiConnecting.class) 10 | public class MixinGuiConnecting { 11 | 12 | @Inject(method = "connect", at = @At("RETURN")) 13 | public void onConnect(String ip, int port, CallbackInfo info) { 14 | // Client client = new Client(ip, port); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/render/gui/MixinGuiInGame.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.render.gui; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.render.gui.RenderPotionHUDEvent; 5 | import net.minecraft.client.gui.GuiIngame; 6 | import net.minecraft.client.gui.ScaledResolution; 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(GuiIngame.class) 13 | public class MixinGuiInGame { 14 | 15 | @Inject(method = "renderPotionEffects", at = @At("HEAD"), cancellable = true) 16 | protected void renderPotionEffectsHUD(ScaledResolution resolution, CallbackInfo info) { 17 | RenderPotionHUDEvent renderPotionHUDEvent = new RenderPotionHUDEvent(); 18 | Cosmos.EVENT_BUS.post(renderPotionHUDEvent); 19 | 20 | if (renderPotionHUDEvent.isCanceled()) { 21 | info.cancel(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/render/gui/MixinGuiMultiplayer.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.render.gui; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.network.ConnectEvent; 5 | import cope.cosmos.client.ui.altgui.AltManagerGUI; 6 | import net.minecraft.client.gui.GuiButton; 7 | import net.minecraft.client.gui.GuiMultiplayer; 8 | import net.minecraft.client.gui.GuiScreen; 9 | import net.minecraft.client.multiplayer.ServerData; 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(GuiMultiplayer.class) 16 | public class MixinGuiMultiplayer extends GuiScreen { 17 | 18 | @Inject(method = "initGui", at = @At("RETURN")) 19 | public void initGui(CallbackInfo info) { 20 | buttonList.add(new GuiButton(417, 7, 7, 60, 20, "Alts")); 21 | } 22 | 23 | @Inject(method = "actionPerformed", at = @At("RETURN")) 24 | public void actionPerformed(GuiButton button, CallbackInfo info) { 25 | if (button.id == 417) { 26 | mc.displayGuiScreen(new AltManagerGUI(this)); 27 | } 28 | } 29 | 30 | @Inject(method = "connectToServer", at = @At("HEAD")) 31 | public void onConnectToServer(ServerData server, CallbackInfo info) { 32 | ConnectEvent connectEvent = new ConnectEvent(); 33 | Cosmos.EVENT_BUS.post(connectEvent); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/render/gui/MixinGuiScreen.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.render.gui; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.render.gui.tooltip.RenderTooltipEvent; 5 | import net.minecraft.client.gui.GuiScreen; 6 | import net.minecraft.item.ItemStack; 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(GuiScreen.class) 13 | public class MixinGuiScreen { 14 | 15 | @Inject(method = "renderToolTip", at = @At("HEAD"), cancellable = true) 16 | public void onRenderToolTip(ItemStack stack, int x, int y, CallbackInfo info) { 17 | RenderTooltipEvent renderTooltipEvent = new RenderTooltipEvent(stack, x, y); 18 | Cosmos.EVENT_BUS.post(renderTooltipEvent); 19 | 20 | if (renderTooltipEvent.isCanceled()) { 21 | info.cancel(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/render/gui/MixinGuiTextField.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.render.gui; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.render.gui.RenderChatTextEvent; 5 | import net.minecraft.client.gui.GuiTextField; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Shadow; 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(GuiTextField.class) 13 | public class MixinGuiTextField { 14 | 15 | @Shadow 16 | public int x; 17 | 18 | @Shadow 19 | public int y; 20 | 21 | @Shadow 22 | public int width; 23 | 24 | @Shadow 25 | public int height; 26 | 27 | @Shadow 28 | private boolean enableBackgroundDrawing; 29 | 30 | @Inject(method = "drawTextBox", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiTextField;getEnableBackgroundDrawing()Z", shift = At.Shift.BEFORE), cancellable = true) 31 | public void onDrawTextBox(CallbackInfo info) { 32 | RenderChatTextEvent renderChatTextEvent = new RenderChatTextEvent(x, enableBackgroundDrawing ? y + (height - 8) / 2 : y); 33 | Cosmos.EVENT_BUS.post(renderChatTextEvent); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/render/gui/MixinSplashProgress.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.render.gui; 2 | 3 | import net.minecraftforge.fml.client.SplashProgress; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Inject; 7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 8 | 9 | import java.lang.reflect.InvocationTargetException; 10 | import java.lang.reflect.Method; 11 | 12 | @Mixin(SplashProgress.class) 13 | public class MixinSplashProgress { 14 | 15 | @Inject(method = "start", at = @At("HEAD"), cancellable = true, remap = false) 16 | private static void start(CallbackInfo ci){ 17 | try { 18 | Method method = SplashProgress.class.getDeclaredMethod("disableSplash"); 19 | method.setAccessible(true); 20 | method.invoke(null); 21 | } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ignored) { 22 | 23 | } 24 | 25 | ci.cancel(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/render/gui/overlay/MixinGuiBossOverlay.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.render.gui.overlay; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.render.gui.BossOverlayEvent; 5 | import net.minecraft.client.gui.GuiBossOverlay; 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 | @SuppressWarnings("unused") 12 | @Mixin(GuiBossOverlay.class) 13 | public class MixinGuiBossOverlay { 14 | 15 | @Inject(method = "renderBossHealth", at = @At("HEAD"), cancellable = true) 16 | private void renderBossHealth(CallbackInfo info) { 17 | BossOverlayEvent bossOverlayEvent = new BossOverlayEvent(); 18 | Cosmos.EVENT_BUS.post(bossOverlayEvent); 19 | 20 | if (bossOverlayEvent.isCanceled()) { 21 | info.cancel(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/render/gui/overlay/MixinGuiToast.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.render.gui.overlay; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.render.gui.RenderAdvancementEvent; 5 | import net.minecraft.client.gui.ScaledResolution; 6 | import net.minecraft.client.gui.toasts.GuiToast; 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(GuiToast.class) 13 | public class MixinGuiToast { 14 | 15 | @Inject(method = "drawToast", at = @At("HEAD"), cancellable = true) 16 | public void drawAdvancement(ScaledResolution resolution, CallbackInfo info) { 17 | RenderAdvancementEvent renderAdvancementEvent = new RenderAdvancementEvent(); 18 | Cosmos.EVENT_BUS.post(renderAdvancementEvent); 19 | 20 | if (renderAdvancementEvent.isCanceled()) { 21 | info.cancel(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/render/item/MixinLayerBipedArmor.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.render.item; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.render.entity.LayerArmorEvent; 5 | import net.minecraft.client.model.ModelBiped; 6 | import net.minecraft.client.renderer.entity.layers.LayerBipedArmor; 7 | import net.minecraft.inventory.EntityEquipmentSlot; 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 | @SuppressWarnings("unused") 14 | @Mixin(LayerBipedArmor.class) 15 | public class MixinLayerBipedArmor { 16 | 17 | @Inject(method = "setModelSlotVisible", at = @At(value = "HEAD"), cancellable = true) 18 | protected void setModelSlotVisible(ModelBiped model, EntityEquipmentSlot slotIn, CallbackInfo info) { 19 | LayerArmorEvent layerArmorEvent = new LayerArmorEvent(model, slotIn); 20 | Cosmos.EVENT_BUS.post(layerArmorEvent); 21 | 22 | if (layerArmorEvent.isCanceled()) 23 | info.cancel(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/render/item/MixinMapItemRenderer.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.render.item; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.render.other.RenderMapEvent; 5 | import net.minecraft.client.gui.MapItemRenderer; 6 | import net.minecraft.world.storage.MapData; 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 | @SuppressWarnings("unused") 13 | @Mixin(MapItemRenderer.class) 14 | public class MixinMapItemRenderer { 15 | 16 | @Inject(method = "renderMap", at = @At("HEAD"), cancellable = true) 17 | public void renderMap(MapData mapdataIn, boolean noOverlayRendering, CallbackInfo info) { 18 | RenderMapEvent renderMapEvent = new RenderMapEvent(); 19 | Cosmos.EVENT_BUS.post(renderMapEvent); 20 | 21 | if (renderMapEvent.isCanceled()) 22 | info.cancel(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/render/renderer/MixinGlStateManager.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.render.renderer; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.render.world.RenderFogEvent; 5 | import net.minecraft.client.renderer.GlStateManager; 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(GlStateManager.class) 12 | public class MixinGlStateManager { 13 | 14 | @Inject(method = "enableFog", at = @At("HEAD"), cancellable = true) 15 | private static void onEnableFog(CallbackInfo info) { 16 | RenderFogEvent renderFogEvent = new RenderFogEvent(); 17 | Cosmos.EVENT_BUS.post(renderFogEvent); 18 | 19 | if (renderFogEvent.isCanceled()) { 20 | info.cancel(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/render/tile/MixinTileEntityBeaconRenderer.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.render.tile; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.render.entity.RenderBeaconBeamEvent; 5 | import net.minecraft.client.renderer.tileentity.TileEntityBeaconRenderer; 6 | import net.minecraft.tileentity.TileEntityBeacon; 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(TileEntityBeaconRenderer.class) 13 | public class MixinTileEntityBeaconRenderer { 14 | 15 | @Inject(method = "render", at = @At("INVOKE"), cancellable = true) 16 | public void renderBeaconBeam(TileEntityBeacon tileEntityBeacon, double x, double y, double z, float partialTicks, int destroyStage, float alpha, CallbackInfo info) { 17 | RenderBeaconBeamEvent renderBeaconBeamEvent = new RenderBeaconBeamEvent(); 18 | Cosmos.EVENT_BUS.post(renderBeaconBeamEvent); 19 | 20 | if (renderBeaconBeamEvent.isCanceled()) { 21 | info.cancel(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/render/tile/MixinTileEntityEnchantmentTableRenderer.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.render.tile; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.render.other.RenderEnchantmentTableBookEvent; 5 | import net.minecraft.client.renderer.tileentity.TileEntityEnchantmentTableRenderer; 6 | import net.minecraft.tileentity.TileEntityEnchantmentTable; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 11 | 12 | @SuppressWarnings("unused") 13 | @Mixin(TileEntityEnchantmentTableRenderer.class) 14 | public class MixinTileEntityEnchantmentTableRenderer { 15 | 16 | @Inject(method = "render", at = @At(value = "INVOKE"), cancellable = true) 17 | private void renderEnchantingTableBook(TileEntityEnchantmentTable tileEntityEnchantmentTable, double x, double y, double z, float partialTicks, int destroyStage, float alpha, CallbackInfo info) { 18 | RenderEnchantmentTableBookEvent renderEnchantmentTableBookEvent = new RenderEnchantmentTableBookEvent(); 19 | Cosmos.EVENT_BUS.post(renderEnchantmentTableBookEvent); 20 | 21 | if (renderEnchantmentTableBookEvent.isCanceled()) { 22 | info.cancel(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/render/tile/MixinTileEntityRenderDispatcher.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.render.tile; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.render.entity.tile.RenderTileEntityEvent; 5 | import net.minecraft.client.renderer.Tessellator; 6 | import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; 7 | import net.minecraft.tileentity.TileEntity; 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(TileEntityRendererDispatcher.class) 15 | public class MixinTileEntityRenderDispatcher { 16 | 17 | @Shadow 18 | private Tessellator batchBuffer; 19 | 20 | @Inject(method = "render(Lnet/minecraft/tileentity/TileEntity;DDDFIF)V", at = @At("RETURN"), cancellable = true) 21 | public void render(TileEntity tileEntityIn, double x, double y, double z, float partialTicks, int destroyStage, float p_192854_10_, CallbackInfo info) { 22 | RenderTileEntityEvent renderTileEntityEvent = new RenderTileEntityEvent(tileEntityIn, x, y, z, partialTicks, destroyStage, p_192854_10_, batchBuffer); 23 | Cosmos.EVENT_BUS.post(renderTileEntityEvent); 24 | 25 | if (renderTileEntityEvent.isCanceled()) { 26 | info.cancel(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/world/block/MixinBlock.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.world.block; 2 | 3 | import cope.cosmos.client.features.modules.world.WallhackModule; 4 | import net.minecraft.block.Block; 5 | import net.minecraft.block.state.IBlockState; 6 | import net.minecraft.util.EnumFacing; 7 | import net.minecraft.util.math.BlockPos; 8 | import net.minecraft.world.IBlockAccess; 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(Block.class) 15 | public class MixinBlock { 16 | 17 | @Inject(method = "shouldSideBeRendered", at = @At("HEAD"), cancellable = true) 18 | public void shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side, CallbackInfoReturnable info) { 19 | // if (WallhackModule.INSTANCE.isEnabled() && WallhackModule.WHITELIST.contains((Block) (Object) this)) { 20 | // info.setReturnValue(true); 21 | // } 22 | 23 | if (WallhackModule.INSTANCE.isEnabled()) { 24 | info.setReturnValue(WallhackModule.INSTANCE.isValid((Block) (Object) this)); 25 | } 26 | } 27 | 28 | // @Inject(method = "getBlockLayer", at = @At("HEAD"), cancellable = true) 29 | // public void getBlockLayer(CallbackInfoReturnable info) { 30 | // if (WallhackModule.INSTANCE.isEnabled() && !WallhackModule.WHITELIST.contains((Block) (Object) this)) { 31 | // info.setReturnValue(BlockRenderLayer.TRANSLUCENT); 32 | // } 33 | // } 34 | 35 | @Inject(method = "getLightValue(Lnet/minecraft/block/state/IBlockState;)I", at = @At("HEAD"), cancellable = true) 36 | public void getLightValue(IBlockState state, CallbackInfoReturnable info) { 37 | if (WallhackModule.INSTANCE.isEnabled()) { 38 | info.setReturnValue(100); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/world/block/MixinBlockLiquid.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.world.block; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.block.LiquidInteractEvent; 5 | import cope.cosmos.util.Wrapper; 6 | import net.minecraft.block.BlockLiquid; 7 | import net.minecraft.block.state.IBlockState; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Inject; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 12 | 13 | @SuppressWarnings("unused") 14 | @Mixin(BlockLiquid.class) 15 | public class MixinBlockLiquid implements Wrapper { 16 | 17 | @Inject(method = "canCollideCheck", at = @At("HEAD"), cancellable = true) 18 | public void canCollideCheck(IBlockState blockState, boolean liquidLevel, CallbackInfoReturnable info) { 19 | LiquidInteractEvent liquidInteractEvent = new LiquidInteractEvent(blockState, liquidLevel); 20 | Cosmos.EVENT_BUS.post(liquidInteractEvent); 21 | 22 | if (liquidInteractEvent.isCanceled()) { 23 | info.cancel(); 24 | info.setReturnValue(true); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/world/block/MixinBlockSlime.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.world.block; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.block.SlimeEvent; 5 | import net.minecraft.block.BlockSlime; 6 | import net.minecraft.entity.Entity; 7 | import net.minecraft.util.math.BlockPos; 8 | import net.minecraft.world.World; 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 | @SuppressWarnings("unused") 15 | @Mixin(BlockSlime.class) 16 | public class MixinBlockSlime { 17 | 18 | @Inject(method = "onEntityWalk", at = @At("HEAD"), cancellable = true) 19 | private void onEntityCollidedWithBlock(World world, BlockPos blockPos, Entity entity, CallbackInfo info) { 20 | SlimeEvent slimeEvent = new SlimeEvent(); 21 | Cosmos.EVENT_BUS.post(slimeEvent); 22 | 23 | if (slimeEvent.isCanceled()) 24 | info.cancel(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/world/block/MixinBlockSoulSand.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.world.block; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.block.SoulSandEvent; 5 | import net.minecraft.block.BlockSoulSand; 6 | import net.minecraft.block.state.IBlockState; 7 | import net.minecraft.entity.Entity; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.world.World; 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 | @SuppressWarnings("unused") 16 | @Mixin(BlockSoulSand.class) 17 | public class MixinBlockSoulSand { 18 | 19 | @Inject(method = "onEntityCollidedWithBlock", at = @At("HEAD"), cancellable = true) 20 | public void onEntityCollidedWithBlock(World world, BlockPos blockPos, IBlockState iBlockState, Entity entity, CallbackInfo info) { 21 | SoulSandEvent soulSandEvent = new SoulSandEvent(); 22 | Cosmos.EVENT_BUS.post(soulSandEvent); 23 | 24 | if (soulSandEvent.isCanceled()) 25 | info.cancel(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/world/block/MixinStateImplementation.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.world.block; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.motion.collision.CollisionBoundingBoxEvent; 5 | import net.minecraft.block.Block; 6 | import net.minecraft.block.state.BlockStateContainer.StateImplementation; 7 | import net.minecraft.block.state.IBlockState; 8 | import net.minecraft.entity.Entity; 9 | import net.minecraft.util.math.AxisAlignedBB; 10 | import net.minecraft.util.math.BlockPos; 11 | import net.minecraft.world.World; 12 | import org.spongepowered.asm.mixin.Final; 13 | import org.spongepowered.asm.mixin.Mixin; 14 | import org.spongepowered.asm.mixin.Shadow; 15 | import org.spongepowered.asm.mixin.injection.At; 16 | import org.spongepowered.asm.mixin.injection.Redirect; 17 | 18 | import java.util.List; 19 | 20 | @Mixin(StateImplementation.class) 21 | public class MixinStateImplementation { 22 | 23 | @Shadow 24 | @Final 25 | private Block block; 26 | 27 | @SuppressWarnings("deprecation") 28 | @Redirect(method = "addCollisionBoxToList", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/Block;addCollisionBoxToList(Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/AxisAlignedBB;Ljava/util/List;Lnet/minecraft/entity/Entity;Z)V")) 29 | public void addCollisionBoxToList(Block b, IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List collidingBoxes, Entity entityIn, boolean p_185908_6_) { 30 | CollisionBoundingBoxEvent event = new CollisionBoundingBoxEvent(b, pos, entityIn, entityBox, collidingBoxes); 31 | Cosmos.EVENT_BUS.post(event); 32 | 33 | if (!event.isCanceled()) { 34 | block.addCollisionBoxToList(state, worldIn, pos, entityBox, collidingBoxes, entityIn, p_185908_6_); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/asm/mixins/world/item/MixinItem.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.asm.mixins.world.item; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.item.ItemUseFinishEvent; 5 | import net.minecraft.entity.EntityLivingBase; 6 | import net.minecraft.item.Item; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.world.World; 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(Item.class) 15 | public class MixinItem { 16 | 17 | @Inject(method = "onItemUseFinish", at = @At("HEAD"), cancellable = true) 18 | public void onItemUseFinish(ItemStack stack, World worldIn, EntityLivingBase entityLiving, CallbackInfoReturnable info) { 19 | ItemUseFinishEvent itemUseFinishEvent = new ItemUseFinishEvent(stack); 20 | Cosmos.EVENT_BUS.post(itemUseFinishEvent); 21 | 22 | if (itemUseFinishEvent.isCanceled()) { 23 | info.cancel(); 24 | info.setReturnValue(stack); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/block/BlockBreakEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.block; 2 | 3 | import net.minecraft.util.math.BlockPos; 4 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 5 | import net.minecraftforge.fml.common.eventhandler.Event; 6 | 7 | @Cancelable 8 | public class BlockBreakEvent extends Event { 9 | 10 | private final BlockPos blockPos; 11 | 12 | public BlockBreakEvent(BlockPos blockPos) { 13 | this.blockPos = blockPos; 14 | } 15 | 16 | public BlockPos getBlockPos() { 17 | return blockPos; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/block/BlockResetEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.block; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class BlockResetEvent extends Event { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/block/LeftClickBlockEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.block; 2 | 3 | import net.minecraft.util.EnumFacing; 4 | import net.minecraft.util.math.BlockPos; 5 | import net.minecraftforge.fml.common.eventhandler.Event; 6 | 7 | /** 8 | * Called when the player left clicks a block 9 | * @author linustouchtips 10 | * @since 12/09/2021 11 | */ 12 | public class LeftClickBlockEvent extends Event { 13 | 14 | // block info 15 | private final BlockPos blockPos; 16 | private final EnumFacing blockFace; 17 | 18 | public LeftClickBlockEvent(BlockPos blockPos, EnumFacing blockFace) { 19 | this.blockPos = blockPos; 20 | this.blockFace = blockFace; 21 | } 22 | 23 | /** 24 | * Gets the position of the block 25 | * @return The position of the block 26 | */ 27 | public BlockPos getPos() { 28 | return blockPos; 29 | } 30 | 31 | /** 32 | * Gets the face of the block 33 | * @return The face of the block 34 | */ 35 | public EnumFacing getFace() { 36 | return blockFace; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/block/LiquidInteractEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.block; 2 | 3 | import net.minecraft.block.state.IBlockState; 4 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 5 | import net.minecraftforge.fml.common.eventhandler.Event; 6 | 7 | @Cancelable 8 | public class LiquidInteractEvent extends Event { 9 | 10 | private final IBlockState blockState; 11 | private final boolean liquidLevel; 12 | 13 | public LiquidInteractEvent(IBlockState blockState, boolean liquidLevel) { 14 | this.blockState = blockState; 15 | this.liquidLevel = liquidLevel; 16 | } 17 | 18 | public IBlockState getBlockState() { 19 | return blockState; 20 | } 21 | 22 | public boolean getLiquidLevel() { 23 | return liquidLevel; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/block/SlimeEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.block; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class SlimeEvent extends Event { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/block/SoulSandEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.block; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class SoulSandEvent extends Event { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/block/WaterCollisionEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.block; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class WaterCollisionEvent extends Event { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/client/ExceptionThrownEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.client; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | /** 7 | * Called when an exception is thrown by the server 8 | * @author linustouchtips 9 | * @since 12/25/2021 10 | */ 11 | @Cancelable 12 | public class ExceptionThrownEvent extends Event { 13 | 14 | // the thrown exception 15 | private final Throwable exception; 16 | 17 | public ExceptionThrownEvent(Throwable exception) { 18 | this.exception = exception; 19 | } 20 | 21 | /** 22 | * Gets the thrown exception 23 | * @return the thrown exception 24 | */ 25 | public Throwable getException() { 26 | return exception; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/client/ModuleToggleEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.client; 2 | 3 | import cope.cosmos.client.features.modules.Module; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | public class ModuleToggleEvent extends Event { 7 | 8 | private final Module module; 9 | 10 | public ModuleToggleEvent(Module module) { 11 | this.module = module; 12 | } 13 | 14 | public static class ModuleEnableEvent extends ModuleToggleEvent { 15 | public ModuleEnableEvent(Module module) { 16 | super(module); 17 | } 18 | } 19 | 20 | public static class ModuleDisableEvent extends ModuleToggleEvent { 21 | public ModuleDisableEvent(Module module) { 22 | super(module); 23 | } 24 | } 25 | 26 | public Module getModule() { 27 | return module; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/client/SettingUpdateEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.client; 2 | 3 | import cope.cosmos.client.features.setting.Setting; 4 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 5 | import net.minecraftforge.fml.common.eventhandler.Event; 6 | 7 | @Cancelable 8 | public class SettingUpdateEvent extends Event { 9 | 10 | private final Setting setting; 11 | 12 | public SettingUpdateEvent(Setting setting) { 13 | this.setting = setting; 14 | } 15 | 16 | public Setting getSetting() { 17 | return setting; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/combat/CriticalModifierEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.combat; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Event; 4 | 5 | /** 6 | * Called when a player deals a critical hit 7 | * @author linustouchtips 8 | * @since 12/09/2021 9 | */ 10 | public class CriticalModifierEvent extends Event { 11 | 12 | private float damageModifier = 1.5F; 13 | 14 | /** 15 | * Sets the critical damage modifier 16 | * @param in The new critical damage modifier 17 | */ 18 | public void setDamageModifier(float in) { 19 | damageModifier = in; 20 | } 21 | 22 | /** 23 | * Gets the critical damage modifier 24 | * @return The critical damage modifier 25 | */ 26 | public float getDamageModifier() { 27 | return damageModifier; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/combat/CrystalAttackEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.combat; 2 | 3 | import net.minecraft.util.DamageSource; 4 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 5 | import net.minecraftforge.fml.common.eventhandler.Event; 6 | 7 | @Cancelable 8 | public class CrystalAttackEvent extends Event { 9 | 10 | private final DamageSource damageSource; 11 | 12 | public CrystalAttackEvent(DamageSource damageSource) { 13 | this.damageSource = damageSource; 14 | } 15 | 16 | public DamageSource getDamageSource() { 17 | return damageSource; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/combat/DeathEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.combat; 2 | 3 | import net.minecraft.entity.Entity; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | /** 7 | * Called when an entity dies in the world 8 | * @author linustouchtips 9 | * @since 12/12/2021 10 | */ 11 | public class DeathEvent extends Event { 12 | 13 | // entity that just died 14 | private final Entity entity; 15 | 16 | public DeathEvent(Entity entity) { 17 | this.entity = entity; 18 | } 19 | 20 | /** 21 | * Gets the entity that just died 22 | * @return The entity that just died 23 | */ 24 | public Entity getEntity() { 25 | return entity; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/combat/TotemPopEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.combat; 2 | 3 | import net.minecraft.entity.Entity; 4 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 5 | import net.minecraftforge.fml.common.eventhandler.Event; 6 | 7 | @Cancelable 8 | public class TotemPopEvent extends Event { 9 | 10 | private final Entity popEntity; 11 | 12 | public TotemPopEvent(Entity popEntity) { 13 | this.popEntity = popEntity; 14 | } 15 | 16 | public Entity getPopEntity() { 17 | return popEntity; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/entity/EntityWorldEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.entity; 2 | 3 | import net.minecraft.entity.Entity; 4 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 5 | import net.minecraftforge.fml.common.eventhandler.Event; 6 | 7 | @Cancelable 8 | public class EntityWorldEvent extends Event { 9 | 10 | private final Entity entity; 11 | 12 | public EntityWorldEvent(Entity entity) { 13 | this.entity = entity; 14 | } 15 | 16 | public static class EntitySpawnEvent extends EntityWorldEvent { 17 | public EntitySpawnEvent(Entity entity) { 18 | super(entity); 19 | } 20 | } 21 | 22 | public static class EntityRemoveEvent extends EntityWorldEvent { 23 | public EntityRemoveEvent(Entity entity) { 24 | super(entity); 25 | } 26 | } 27 | 28 | public static class EntityUpdateEvent extends EntityWorldEvent { 29 | public EntityUpdateEvent(Entity entity) { 30 | super(entity); 31 | } 32 | } 33 | 34 | public Entity getEntity() { 35 | return entity; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/entity/LivingUpdateEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.entity; 2 | 3 | import net.minecraft.client.entity.EntityPlayerSP; 4 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 5 | import net.minecraftforge.fml.common.eventhandler.Event; 6 | 7 | /** 8 | * Called when a living entity updates 9 | * @author linustouchtips 10 | * @since 12/09/2021 11 | */ 12 | @Cancelable 13 | public class LivingUpdateEvent extends Event { 14 | 15 | private final EntityPlayerSP entityPlayerSP; 16 | 17 | // whether or not the player is sprinting 18 | private final boolean sprinting; 19 | 20 | public LivingUpdateEvent(EntityPlayerSP entityPlayerSP, boolean sprinting) { 21 | this.entityPlayerSP = entityPlayerSP; 22 | this.sprinting = sprinting; 23 | } 24 | 25 | /** 26 | * Gets the updating player 27 | * @return The updating player 28 | */ 29 | public EntityPlayerSP getEntityPlayerSP() { 30 | return entityPlayerSP; 31 | } 32 | 33 | /** 34 | * Gets whether or not the player is sprinting 35 | * @return Whether or not the player is sprinting 36 | */ 37 | public boolean isSprinting() { 38 | return sprinting; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/entity/hitbox/EntityHitboxSizeEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.entity.hitbox; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class EntityHitboxSizeEvent extends Event { 8 | 9 | private float hitboxSize; 10 | 11 | public void setHitboxSize(float in) { 12 | hitboxSize = in; 13 | } 14 | 15 | public float getHitboxSize() { 16 | return hitboxSize; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/entity/hitbox/HitboxInteractEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.entity.hitbox; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class HitboxInteractEvent extends Event { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/entity/horse/HorseSaddledEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.entity.horse; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | /** 7 | * Called when an {@link net.minecraft.entity.passive.AbstractHorse} AbstractHorse is saddled 8 | * @author linustouchtips 9 | * @since 02/24/2022 10 | */ 11 | @Cancelable 12 | public class HorseSaddledEvent extends Event { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/entity/horse/HorseSteerEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.entity.horse; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | /** 7 | * Called when an {@link net.minecraft.entity.passive.AbstractHorse} AbstractHorse is steered 8 | * @author linustouchtips 9 | * @since 02/24/2022 10 | */ 11 | @Cancelable 12 | public class HorseSteerEvent extends Event { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/entity/player/PlayerTurnEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.entity.player; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | /** 7 | * Called when the player turns 8 | * @author aesthetical 9 | * @since 08/29/2022 10 | */ 11 | @Cancelable 12 | public class PlayerTurnEvent extends Event { 13 | 14 | // rotations 15 | private final float yaw, pitch; 16 | 17 | public PlayerTurnEvent(float yaw, float pitch) { 18 | this.yaw = yaw; 19 | this.pitch = pitch; 20 | } 21 | 22 | /** 23 | * Gets the turned yaw 24 | * @return The turned yaw 25 | */ 26 | public float getYaw() { 27 | return yaw; 28 | } 29 | 30 | /** 31 | * Gets the turned pitch 32 | * @return The turned pitch 33 | */ 34 | public float getPitch() { 35 | return pitch; 36 | } 37 | } -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/entity/player/RotationUpdateEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.entity.player; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | /** 7 | * Called on onUpdateWalkingPlayer 8 | * @author linustouchtips 9 | * @since 11/03/2021 10 | */ 11 | @Cancelable 12 | public class RotationUpdateEvent extends Event { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/entity/player/UpdateWalkingPlayerEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.entity.player; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | /** 7 | * Called after the onUpdateWalkingPlayer method 8 | * @author linustouchtips 9 | * @since 06/30/2022 10 | */ 11 | @Cancelable 12 | public class UpdateWalkingPlayerEvent extends Event { 13 | 14 | // how many times to run the update event 15 | private int iterations; 16 | 17 | /** 18 | * Sets the number of iterations 19 | * @param in The new number of iterations 20 | */ 21 | public void setIterations(int in) { 22 | iterations = in; 23 | } 24 | 25 | /** 26 | * Gets the iterations 27 | * @return The number of iterations 28 | */ 29 | public int getIterations() { 30 | return iterations; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/entity/player/interact/DualInteractEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.entity.player.interact; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | /** 7 | * Called when the player attempts to use items in the offhand while mining 8 | * @author linustouchtips 9 | * @since 12/30/2021 10 | */ 11 | @Cancelable 12 | public class DualInteractEvent extends Event { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/entity/player/interact/EntityUseItemEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.entity.player.interact; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Event; 4 | 5 | /** 6 | * Called when an entity uses an item 7 | * @author linustouchtips 8 | * @since 12/09/2021 9 | */ 10 | public class EntityUseItemEvent extends Event { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/entity/player/interact/ItemInputUpdateEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.entity.player.interact; 2 | 3 | import net.minecraft.util.MovementInput; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | /** 7 | * Called when the player inputs on an item 8 | * @author linustouchtips 9 | * @since 12/09/2021 10 | */ 11 | public class ItemInputUpdateEvent extends Event { 12 | 13 | // player movement input 14 | private final MovementInput movementInput; 15 | 16 | public ItemInputUpdateEvent(MovementInput movementInput) { 17 | this.movementInput = movementInput; 18 | } 19 | 20 | /** 21 | * Gets the current player's movement input 22 | * @return The current player's movement input 23 | */ 24 | public MovementInput getMovementInput() { 25 | return movementInput; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/entity/player/interact/ReachEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.entity.player.interact; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | /** 7 | * Called when the player's block reach distance is called 8 | * @author linustouchtips 9 | * @since 05/04/2021 10 | */ 11 | @Cancelable 12 | public class ReachEvent extends Event { 13 | 14 | // reach value 15 | private float reach; 16 | 17 | /** 18 | * Sets the player reach 19 | * @param reach The new player reach 20 | */ 21 | public void setReach(float reach) { 22 | this.reach = reach; 23 | } 24 | 25 | /** 26 | * Gets the player reach 27 | * @return The player reach 28 | */ 29 | public float getReach() { 30 | return reach; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/entity/player/interact/RightClickItemEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.entity.player.interact; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 5 | import net.minecraftforge.fml.common.eventhandler.Event; 6 | 7 | /** 8 | * Called when an item is right-clicked by the player 9 | * @author linustouchtips 10 | * @since 12/09/2021 11 | */ 12 | @Cancelable 13 | public class RightClickItemEvent extends Event { 14 | 15 | private final ItemStack itemStack; 16 | 17 | public RightClickItemEvent(ItemStack itemStack) { 18 | this.itemStack = itemStack; 19 | } 20 | 21 | /** 22 | * Gets the item being right clicked 23 | * @return The item being right clicked 24 | */ 25 | public ItemStack getItemStack() { 26 | return itemStack; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/entity/potion/PotionEffectEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.entity.potion; 2 | 3 | import cope.cosmos.util.Wrapper; 4 | import net.minecraft.potion.Potion; 5 | import net.minecraft.potion.PotionEffect; 6 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 7 | import net.minecraftforge.fml.common.eventhandler.Event; 8 | 9 | /** 10 | * Called when a potion effect is added/removed to the player 11 | * @author linustouchtips 12 | * @since 04/19/2022 13 | */ 14 | @Cancelable 15 | public class PotionEffectEvent extends Event implements Wrapper { 16 | 17 | // added/removed potion 18 | private final PotionEffect potionEffect; 19 | 20 | public PotionEffectEvent(PotionEffect potionEffect) { 21 | this.potionEffect = potionEffect; 22 | } 23 | 24 | /** 25 | * Gets the added/removed potion effect 26 | * @return The added/removed potion effect 27 | */ 28 | public PotionEffect getPotionEffect() { 29 | return potionEffect; 30 | } 31 | 32 | public static class PotionAdd extends PotionEffectEvent { 33 | public PotionAdd(PotionEffect potionEffect) { 34 | super(potionEffect); 35 | } 36 | } 37 | 38 | public static class PotionRemove extends PotionEffectEvent { 39 | 40 | // Remove uses Potion instead of PotionEffect, why you ask, IDFK 41 | private final Potion potion; 42 | 43 | public PotionRemove(Potion potion) { 44 | super(mc.player.getActivePotionEffect(potion)); 45 | this.potion = potion; 46 | } 47 | 48 | public PotionRemove(PotionEffect potionEffect) { 49 | super(potionEffect); 50 | this.potion = potionEffect.getPotion(); 51 | } 52 | 53 | /** 54 | * Gets the removed potion 55 | * @return The removed potion 56 | */ 57 | public Potion getPotion() { 58 | return potion; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/input/KeyDownEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.input; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class KeyDownEvent extends Event { 8 | 9 | private final int keyCode; 10 | private boolean pressed; 11 | 12 | public KeyDownEvent(int keyCode, boolean pressed) { 13 | this.pressed = pressed; 14 | this.keyCode = keyCode; 15 | } 16 | 17 | public int getKeyCode() { 18 | return keyCode; 19 | } 20 | 21 | public boolean isPressed() { 22 | return pressed; 23 | } 24 | 25 | public void setPressed(boolean pressed) { 26 | this.pressed = pressed; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/input/MiddleClickEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.input; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | /** 7 | * Called when the middle mouse button is clicked 8 | * @author aesthetical 9 | * @since 06/20/2022 10 | */ 11 | @Cancelable 12 | public class MiddleClickEvent extends Event { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/input/UpdateMoveStateEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.input; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Event; 4 | 5 | /** 6 | * Called after the player move state is updated 7 | * @author linustouchtips 8 | * @since 08/22/2022 9 | */ 10 | public class UpdateMoveStateEvent extends Event { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/item/ItemUseFinishEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.item; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 5 | import net.minecraftforge.fml.common.eventhandler.Event; 6 | 7 | /** 8 | * Called when the player finishes using an item 9 | * @author linustouchtips 10 | * @since 10/25/2022 11 | */ 12 | @Cancelable 13 | public class ItemUseFinishEvent extends Event { 14 | 15 | // item in use 16 | private final ItemStack itemStack; 17 | 18 | public ItemUseFinishEvent(ItemStack itemStack) { 19 | this.itemStack = itemStack; 20 | } 21 | 22 | /** 23 | * Gets the item in use 24 | * @return The item in use 25 | */ 26 | public ItemStack getItemStack() { 27 | return itemStack; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/motion/collision/EntityCollisionEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.motion.collision; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class EntityCollisionEvent extends Event { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/motion/movement/KnockBackEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.motion.movement; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | /** 7 | * Called when an entity takes knockback 8 | * @author linustouchtips 9 | * @since 12/09/2021 10 | */ 11 | @Cancelable 12 | public class KnockBackEvent extends Event { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/motion/movement/MotionEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.motion.movement; 2 | 3 | import net.minecraft.entity.MoverType; 4 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 5 | import net.minecraftforge.fml.common.eventhandler.Event; 6 | 7 | @Cancelable 8 | public class MotionEvent extends Event { 9 | 10 | private MoverType type; 11 | private double x; 12 | private double y; 13 | private double z; 14 | 15 | public MotionEvent(MoverType type, double x, double y, double z) { 16 | this.type = type; 17 | this.x = x; 18 | this.y = y; 19 | this.z = z; 20 | } 21 | 22 | public MoverType getType() { 23 | return type; 24 | } 25 | 26 | public void setType(MoverType in) { 27 | type = in; 28 | } 29 | 30 | public double getX() { 31 | return x; 32 | } 33 | 34 | public void setX(double in) { 35 | x = in; 36 | } 37 | 38 | public double getY() { 39 | return y; 40 | } 41 | 42 | public void setY(double in) { 43 | y = in; 44 | } 45 | 46 | public double getZ() { 47 | return z; 48 | } 49 | 50 | public void setZ(double in) { 51 | z = in; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/motion/movement/MotionUpdateEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.motion.movement; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class MotionUpdateEvent extends Event { 8 | 9 | private double x, y, z; 10 | private float yaw, pitch; 11 | private boolean onGround; 12 | 13 | public double getX() { 14 | return x; 15 | } 16 | 17 | public void setX(double in) { 18 | x = in; 19 | } 20 | 21 | public double getY() { 22 | return y; 23 | } 24 | 25 | public void setY(double in) { 26 | y = in; 27 | } 28 | 29 | public double getZ() { 30 | return z; 31 | } 32 | 33 | public void setZ(double in) { 34 | z = in; 35 | } 36 | 37 | public float getYaw() { 38 | return yaw; 39 | } 40 | 41 | public float getPitch() { 42 | return pitch; 43 | } 44 | 45 | public void setYaw(float in) { 46 | yaw = in; 47 | } 48 | 49 | public void setPitch(float in) { 50 | pitch = in; 51 | } 52 | 53 | public boolean getOnGround() { 54 | return onGround; 55 | } 56 | 57 | public void setOnGround(boolean in) { 58 | onGround = in; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/motion/movement/PushOutOfBlocksEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.motion.movement; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | /** 7 | * Called when the player is pushed out of a block 8 | * @author linustouchtips 9 | * @since 10/11/2021 10 | */ 11 | @Cancelable 12 | public class PushOutOfBlocksEvent extends Event { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/motion/movement/StepEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.motion.movement; 2 | 3 | import net.minecraft.util.math.AxisAlignedBB; 4 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 5 | import net.minecraftforge.fml.common.eventhandler.Event; 6 | 7 | /** 8 | * Called when a player steps up a block 9 | * @author Doogie13 10 | * @since 12/27/2021 11 | */ 12 | @Cancelable 13 | public class StepEvent extends Event { 14 | 15 | // info 16 | private final AxisAlignedBB axisAlignedBB; 17 | private float height; 18 | 19 | public StepEvent(AxisAlignedBB axisAlignedBB, float height) { 20 | this.axisAlignedBB = axisAlignedBB; 21 | this.height = height; 22 | } 23 | 24 | /** 25 | * Gets the bounding box of the step height 26 | * @return The bounding box of the step height 27 | */ 28 | public AxisAlignedBB getAxisAlignedBB() { 29 | return axisAlignedBB; 30 | } 31 | 32 | /** 33 | * Sets the maximum height of the step 34 | * @param in The new maximum height of the step 35 | */ 36 | public void setHeight(float in) { 37 | height = in; 38 | } 39 | 40 | /** 41 | * Gets the maximum height of the step 42 | * @return The maximum height of the step 43 | */ 44 | public float getHeight() { 45 | return height; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/motion/movement/TravelEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.motion.movement; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class TravelEvent extends Event { 8 | 9 | private final float strafe, vertical, forward; 10 | 11 | public TravelEvent(float strafe, float vertical, float forward) { 12 | this.strafe = strafe; 13 | this.vertical = vertical; 14 | this.forward = forward; 15 | } 16 | 17 | public float getStrafe() { 18 | return strafe; 19 | } 20 | 21 | public float getVertical() { 22 | return vertical; 23 | } 24 | 25 | public float getForward() { 26 | return forward; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/network/ConnectEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.network; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Event; 4 | 5 | /** 6 | * Called when the player connects to a server via the Multiplayer Server Selection screen 7 | * @author linustouchtips 8 | * @since 02/23/2022 9 | */ 10 | public class ConnectEvent extends Event { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/network/DecodeEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.network; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | /** 7 | * Called when packets are decoded 8 | * @author linustouchtips 9 | * @since 04/19/2022 10 | */ 11 | @Cancelable 12 | public class DecodeEvent extends Event { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/network/DisconnectEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.network; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Event; 4 | 5 | /** 6 | * Called when the player disconnects from a server 7 | * @author linustouchtips 8 | * @since 02/02/2022 9 | */ 10 | public class DisconnectEvent extends Event { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/network/PacketEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.network; 2 | 3 | import net.minecraft.network.Packet; 4 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 5 | import net.minecraftforge.fml.common.eventhandler.Event; 6 | 7 | public class PacketEvent extends Event { 8 | 9 | private final Packet packet; 10 | 11 | public PacketEvent(Packet packet) { 12 | this.packet = packet; 13 | } 14 | 15 | public Packet getPacket() { 16 | return packet; 17 | } 18 | 19 | @Cancelable 20 | public static class PacketReceiveEvent extends PacketEvent { 21 | public PacketReceiveEvent(Packet packet) { 22 | super(packet); 23 | } 24 | } 25 | 26 | @Cancelable 27 | public static class PacketSendEvent extends PacketEvent { 28 | public PacketSendEvent(Packet packet) { 29 | super(packet); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/block/ColorMultiplierEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.block; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | /** 7 | * Called on the color multiplier for block 8 | * @author linustouchtips 9 | * @since 04/18/2022 10 | */ 11 | @Cancelable 12 | public class ColorMultiplierEvent extends Event { 13 | 14 | // block opacity 15 | private int opacity; 16 | 17 | public ColorMultiplierEvent(int opacity) { 18 | this.opacity = opacity; 19 | } 20 | 21 | /** 22 | * Sets the color opacity 23 | * @param in The new color opacity 24 | */ 25 | public void setOpacity(int in) { 26 | opacity = in; 27 | } 28 | 29 | /** 30 | * Gets the color opacity 31 | * @return The color opacity 32 | */ 33 | public int getOpacity() { 34 | return opacity; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/entity/CrystalTextureEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.entity; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class CrystalTextureEvent extends Event { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/entity/CrystalUpdateEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.entity; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | /** 7 | * Called when the crystal updates 8 | * @author linustouchtips 9 | * @since 06/17/2022 10 | */ 11 | @Cancelable 12 | public class CrystalUpdateEvent extends Event { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/entity/LayerArmorEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.entity; 2 | 3 | import net.minecraft.client.model.ModelBiped; 4 | import net.minecraft.inventory.EntityEquipmentSlot; 5 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 6 | import net.minecraftforge.fml.common.eventhandler.Event; 7 | 8 | @Cancelable 9 | public class LayerArmorEvent extends Event { 10 | 11 | private final ModelBiped modelBiped; 12 | private final EntityEquipmentSlot entityEquipmentSlot; 13 | 14 | public LayerArmorEvent(ModelBiped modelBiped, EntityEquipmentSlot entityEquipmentSlot) { 15 | this.modelBiped = modelBiped; 16 | this.entityEquipmentSlot = entityEquipmentSlot; 17 | } 18 | 19 | public EntityEquipmentSlot getEntityEquipmentSlot() { 20 | return entityEquipmentSlot; 21 | } 22 | 23 | public ModelBiped getModelBiped() { 24 | return modelBiped; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/entity/RenderBeaconBeamEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.entity; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class RenderBeaconBeamEvent extends Event { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/entity/RenderItemEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.entity; 2 | 3 | import net.minecraft.entity.item.EntityItem; 4 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 5 | import net.minecraftforge.fml.common.eventhandler.Event; 6 | 7 | /** 8 | * Called when an item is rendered 9 | * @author linustouchtips 10 | * @since 01/10/2022 11 | */ 12 | @Cancelable 13 | public class RenderItemEvent extends Event { 14 | 15 | // info 16 | private final EntityItem entityItem; 17 | private final double x, y, z; 18 | private final float entityYaw; 19 | private final float partialTicks; 20 | 21 | public RenderItemEvent(EntityItem entityItem, double x, double y, double z, float entityYaw, float partialTicks) { 22 | this.entityItem = entityItem; 23 | this.x = x; 24 | this.y = y; 25 | this.z = z; 26 | this.entityYaw = entityYaw; 27 | this.partialTicks = partialTicks; 28 | } 29 | 30 | /** 31 | * Gets the item entity 32 | * @return The item entity 33 | */ 34 | public EntityItem getEntityItem() { 35 | return entityItem; 36 | } 37 | 38 | /** 39 | * Gets the entity's x position 40 | * @return The entity's x position 41 | */ 42 | public double getX() { 43 | return x; 44 | } 45 | 46 | /** 47 | * Gets the entity's y position 48 | * @return The entity's y position 49 | */ 50 | public double getY() { 51 | return y; 52 | } 53 | 54 | /** 55 | * Gets the entity's z position 56 | * @return The entity's z position 57 | */ 58 | public double getZ() { 59 | return z; 60 | } 61 | 62 | /** 63 | * Gets the entity's yaw 64 | * @return The entity's yaw 65 | */ 66 | public float getEntityYaw() { 67 | return entityYaw; 68 | } 69 | 70 | /** 71 | * Gets the render partial ticks 72 | * @return The render partial ticks 73 | */ 74 | public float getPartialTicks() { 75 | return partialTicks; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/entity/RenderNametagEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.entity; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class RenderNametagEvent extends Event { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/entity/RenderRotationsEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.entity; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class RenderRotationsEvent extends Event { 8 | 9 | private float yaw, pitch; 10 | 11 | public float getYaw() { 12 | return yaw; 13 | } 14 | 15 | public float getPitch() { 16 | return pitch; 17 | } 18 | 19 | public void setYaw(float in) { 20 | yaw = in; 21 | } 22 | 23 | public void setPitch(float in) { 24 | pitch = in; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/entity/RenderWitherSkullEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.entity; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class RenderWitherSkullEvent extends Event { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/entity/ShaderColorEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.entity; 2 | 3 | import net.minecraft.entity.Entity; 4 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 5 | import net.minecraftforge.fml.common.eventhandler.Event; 6 | 7 | import java.awt.*; 8 | 9 | @Cancelable 10 | public class ShaderColorEvent extends Event { 11 | 12 | private final Entity entity; 13 | private Color color; 14 | 15 | public ShaderColorEvent(Entity entity) { 16 | this.entity = entity; 17 | } 18 | 19 | public Entity getEntity() { 20 | return entity; 21 | } 22 | 23 | public Color getColor() { 24 | return color; 25 | } 26 | 27 | public void setColor(Color in) { 28 | color = in; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/entity/tile/RenderTileEntityEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.entity.tile; 2 | 3 | import net.minecraft.client.renderer.Tessellator; 4 | import net.minecraft.tileentity.TileEntity; 5 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 6 | import net.minecraftforge.fml.common.eventhandler.Event; 7 | 8 | /** 9 | * Called when a {@link TileEntity} tile entity is rendered 10 | * @author linustouchtips 11 | * @since 12/24/2021 12 | */ 13 | @Cancelable 14 | public class RenderTileEntityEvent extends Event { 15 | 16 | // the tile entity being rendered 17 | private final TileEntity tileEntity; 18 | 19 | private final double x, y, z; 20 | 21 | private final float partialTicks; 22 | private final int destroyStage; 23 | private final float partial; 24 | 25 | private final Tessellator buffer; 26 | 27 | public RenderTileEntityEvent(TileEntity tileEntity, double x, double y, double z, float partialTicks, int destroyStage, float partial, Tessellator buffer) { 28 | this.tileEntity = tileEntity; 29 | this.x = x; 30 | this.y = y; 31 | this.z = z; 32 | this.partialTicks = partialTicks; 33 | this.destroyStage = destroyStage; 34 | this.partial = partial; 35 | this.buffer = buffer; 36 | } 37 | 38 | public double getX() { 39 | return x; 40 | } 41 | 42 | public double getY() { 43 | return y; 44 | } 45 | 46 | public double getZ() { 47 | return z; 48 | } 49 | 50 | public float getPartialTicks() { 51 | return partialTicks; 52 | } 53 | 54 | public int getDestroyStage() { 55 | return destroyStage; 56 | } 57 | 58 | public float getPartial() { 59 | return partial; 60 | } 61 | 62 | public Tessellator getBuffer() { 63 | return buffer; 64 | } 65 | 66 | /** 67 | * Gets the tile entity being rendered 68 | * @return the tile entity being rendered 69 | */ 70 | public TileEntity getTileEntity() { 71 | return tileEntity; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/gui/BossOverlayEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.gui; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class BossOverlayEvent extends Event { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/gui/GuiScreenClosedEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.gui; 2 | 3 | import net.minecraft.client.gui.GuiScreen; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | public class GuiScreenClosedEvent extends Event { 7 | 8 | private GuiScreen currentScreen; 9 | 10 | public GuiScreenClosedEvent(GuiScreen screen) { 11 | this.currentScreen = screen; 12 | } 13 | 14 | public GuiScreen getCurrentScreen() { 15 | return currentScreen; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/gui/RenderAdvancementEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.gui; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class RenderAdvancementEvent extends Event { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/gui/RenderChatTextEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.gui; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Event; 4 | 5 | /** 6 | * Called when the chat text is being rendered 7 | * @author linustouchtips 8 | * @since 08/24/2022 9 | */ 10 | public class RenderChatTextEvent extends Event { 11 | 12 | // render positions 13 | public int x, y; 14 | 15 | public RenderChatTextEvent(int x, int y) { 16 | this.x = x; 17 | this.y = y; 18 | } 19 | 20 | /** 21 | * Gets the x position 22 | * @return The x position 23 | */ 24 | public int getX() { 25 | return x; 26 | } 27 | 28 | /** 29 | * Gets the y position 30 | * @return The y position 31 | */ 32 | public int getY() { 33 | return y; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/gui/RenderFontEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.gui; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class RenderFontEvent extends Event { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/gui/RenderOverlayEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.gui; 2 | 3 | import net.minecraftforge.client.event.RenderBlockOverlayEvent; 4 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 5 | import net.minecraftforge.fml.common.eventhandler.Event; 6 | 7 | /** 8 | * Called when a HUD overlay is rendered 9 | * @author linustouchtips 10 | * @since 12/17/2021 11 | */ 12 | @Cancelable 13 | public class RenderOverlayEvent extends Event { 14 | 15 | // HUD overlay 16 | private final RenderBlockOverlayEvent.OverlayType overlayType; 17 | 18 | public RenderOverlayEvent(RenderBlockOverlayEvent.OverlayType overlayType) { 19 | this.overlayType = overlayType; 20 | } 21 | 22 | /** 23 | * Gets the overlay type of the render 24 | * @return tTe overlay type of the render 25 | */ 26 | public RenderBlockOverlayEvent.OverlayType getOverlayType() { 27 | return overlayType; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/gui/RenderPotionHUDEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.gui; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class RenderPotionHUDEvent extends Event { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/gui/TabListSizeEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.gui; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | /** 7 | * Called when the tab list size is determined 8 | * @author linustouchtips 9 | * @since 12/24/2021 10 | */ 11 | @Cancelable 12 | public class TabListSizeEvent extends Event { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/gui/TabOverlayEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.gui; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class TabOverlayEvent extends Event { 8 | 9 | private String information; 10 | 11 | public TabOverlayEvent(String information) { 12 | this.information = information; 13 | } 14 | 15 | public void setInformation(String in) { 16 | information = in; 17 | } 18 | 19 | public String getInformation() { 20 | return information; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/gui/tooltip/RenderTooltipEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.gui.tooltip; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 5 | import net.minecraftforge.fml.common.eventhandler.Event; 6 | 7 | @Cancelable 8 | public class RenderTooltipEvent extends Event { 9 | 10 | // shulker item 11 | private final ItemStack itemStack; 12 | 13 | // position 14 | private final int x, y; 15 | 16 | public RenderTooltipEvent(ItemStack itemStack, int x, int y) { 17 | this.itemStack = itemStack; 18 | this.x = x; 19 | this.y = y; 20 | } 21 | 22 | /** 23 | * Gets the shulker item 24 | * @return The shulker item stack 25 | */ 26 | public ItemStack getItemStack() { 27 | return itemStack; 28 | } 29 | 30 | /** 31 | * Gets the x position 32 | * @return The x position 33 | */ 34 | public int getX() { 35 | return x; 36 | } 37 | 38 | /** 39 | * Gets the y position 40 | * @return The y position 41 | */ 42 | public int getY() { 43 | return y; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/other/CameraClipEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.other; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Event; 4 | 5 | public class CameraClipEvent extends Event { 6 | 7 | private double distance; 8 | 9 | public CameraClipEvent(double distance) { 10 | this.distance = distance; 11 | } 12 | 13 | public double getDistance() { 14 | return distance; 15 | } 16 | 17 | public void setDistance(double in) { 18 | distance = in; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/other/CapeLocationEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.other; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | /** 7 | * @author Surge 8 | * @since 26/08/2022 9 | */ 10 | @Cancelable 11 | public class CapeLocationEvent extends Event { 12 | 13 | // The location of the cape texture file 14 | private String location; 15 | 16 | // The name of the player 17 | private final String playerName; 18 | 19 | public CapeLocationEvent(String playerName) { 20 | this.playerName = playerName; 21 | } 22 | 23 | /** 24 | * Gets the location of the cape texture file 25 | * @return The location of the cape texture file 26 | */ 27 | public String getLocation() { 28 | return location; 29 | } 30 | 31 | /** 32 | * Sets the location of the cape texture file 33 | * @param location The location of the cape texture file 34 | */ 35 | public void setLocation(String location) { 36 | this.location = location; 37 | } 38 | 39 | /** 40 | * Gets the player's name 41 | * @return The player's name 42 | */ 43 | public String getPlayerName() { 44 | return playerName; 45 | } 46 | 47 | } -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/other/RenderEnchantmentTableBookEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.other; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class RenderEnchantmentTableBookEvent extends Event { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/other/RenderMapEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.other; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class RenderMapEvent extends Event { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/other/RenderParticleEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.other; 2 | 3 | import net.minecraft.util.EnumParticleTypes; 4 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 5 | import net.minecraftforge.fml.common.eventhandler.Event; 6 | 7 | /** 8 | * Called when a particle is spawned 9 | * @author linustouchtips 10 | * @since 02/24/2022 11 | */ 12 | @Cancelable 13 | public class RenderParticleEvent extends Event { 14 | 15 | // particle type 16 | private final EnumParticleTypes particleTypes; 17 | 18 | public RenderParticleEvent(EnumParticleTypes particleTypes) { 19 | this.particleTypes = particleTypes; 20 | } 21 | 22 | /** 23 | * Gets the particle type of the spawned particle 24 | * @return The particle type of the spawned particle 25 | */ 26 | public EnumParticleTypes getParticleType() { 27 | return particleTypes; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/other/SkinLocationEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.other; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class SkinLocationEvent extends Event { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/player/CrosshairBobEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.player; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | /** 7 | * Called when the crosshair bobs 8 | */ 9 | @Cancelable 10 | public class CrosshairBobEvent extends Event { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/player/HurtCameraEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.player; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class HurtCameraEvent extends Event { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/player/ModifyFOVEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.player; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class ModifyFOVEvent extends Event { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/player/RenderEatingEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.player; 2 | 3 | import net.minecraft.util.EnumHandSide; 4 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 5 | import net.minecraftforge.fml.common.eventhandler.Event; 6 | 7 | /** 8 | * Called when the first person item is transformed for eating 9 | * @author Surge, linustouchtips 10 | * @since 08/27/2022 11 | */ 12 | @Cancelable 13 | public class RenderEatingEvent extends Event { 14 | 15 | // eating scale 16 | private float scale; 17 | 18 | // hand side 19 | private final EnumHandSide handSide; 20 | 21 | public RenderEatingEvent(EnumHandSide handSide) { 22 | this.handSide = handSide; 23 | } 24 | 25 | /** 26 | * Sets the eating scale 27 | * @param in The new eating scale 28 | */ 29 | public void setScale(float in) { 30 | scale = in; 31 | } 32 | 33 | /** 34 | * Gets the hand side 35 | * @return The hand side 36 | */ 37 | public EnumHandSide getHandSide() { 38 | return handSide; 39 | } 40 | 41 | /** 42 | * Gets the eating scale 43 | * @return The eating scale 44 | */ 45 | public float getScale() { 46 | return scale; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/player/RenderHeldItemEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.player; 2 | 3 | import net.minecraft.util.EnumHandSide; 4 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 5 | import net.minecraftforge.fml.common.eventhandler.Event; 6 | 7 | /** 8 | * @author Surge 9 | * @since 31/03/2022 10 | */ 11 | @Cancelable 12 | public class RenderHeldItemEvent extends Event { 13 | 14 | // The side the item is in 15 | private EnumHandSide side; 16 | 17 | public RenderHeldItemEvent(EnumHandSide enumHandSide) { 18 | this.side = enumHandSide; 19 | } 20 | 21 | /** 22 | * Gets the side the item is in 23 | * @return The side the item is in 24 | */ 25 | public EnumHandSide getSide() { 26 | return side; 27 | } 28 | 29 | public static class Pre extends RenderHeldItemEvent { 30 | public Pre(EnumHandSide enumHandSide) { 31 | super(enumHandSide); 32 | } 33 | } 34 | 35 | public static class Post extends RenderHeldItemEvent { 36 | public Post(EnumHandSide enumHandSide) { 37 | super(enumHandSide); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/player/RenderItemActivationEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.player; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class RenderItemActivationEvent extends Event { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/player/RenderSelectionBoxEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.player; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | /** 7 | * Called when the selection box is rendered 8 | * @author linustouchtips 9 | * @since 03/08/2022 10 | */ 11 | @Cancelable 12 | public class RenderSelectionBoxEvent extends Event { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/world/RenderCaveCullingEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.world; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | /** 7 | * Called when the cave culling render is applied 8 | * @author aesthetical 9 | * @since 08/29/2022 10 | */ 11 | @Cancelable 12 | public class RenderCaveCullingEvent extends Event { 13 | 14 | } -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/world/RenderFogColorEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.world; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | import java.awt.*; 7 | 8 | /** 9 | * Called when the color of the fog is calculated 10 | * @author linustouchtips 11 | * @since 12/28/2021 12 | */ 13 | @Cancelable 14 | public class RenderFogColorEvent extends Event { 15 | 16 | // fog color 17 | private Color color; 18 | 19 | /** 20 | * Gets the fog color 21 | * @return The fog color 22 | */ 23 | public Color getColor() { 24 | return color; 25 | } 26 | 27 | /** 28 | * Sets the fog color 29 | * @param in The new fog color 30 | */ 31 | public void setColor(Color in) { 32 | color = in; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/world/RenderFogEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.world; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | /** 7 | * Called when fog density is rendered 8 | * @author linustouchtips 9 | * @since 12/17/2021 10 | */ 11 | @Cancelable 12 | public class RenderFogEvent extends Event { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/world/RenderSkyEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.world; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | import java.awt.*; 7 | 8 | /** 9 | * Called when the color of sky is calculated 10 | * @author linustouchtips 11 | * @since 12/28/2021 12 | */ 13 | @Cancelable 14 | public class RenderSkyEvent extends Event { 15 | 16 | // sky color 17 | private Color color; 18 | 19 | /** 20 | * Sets the sky color 21 | * @param in The new sky color 22 | */ 23 | public void setColor(Color in) { 24 | color = in; 25 | } 26 | 27 | /** 28 | * Gets the sky color 29 | * @return The sky color 30 | */ 31 | public Color getColor() { 32 | return color; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/world/RenderSkylightEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.world; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | @Cancelable 7 | public class RenderSkylightEvent extends Event { 8 | 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/events/render/world/RenderWorldEvent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.events.render.world; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Event; 4 | 5 | public class RenderWorldEvent extends Event { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/features/command/Command.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.features.command; 2 | 3 | import cope.cosmos.client.features.Feature; 4 | import cope.cosmos.util.Wrapper; 5 | 6 | /** 7 | * @author Milse113, linustouchtips 8 | * @since 06/08/2021 9 | */ 10 | public abstract class Command extends Feature implements Wrapper { 11 | 12 | public Command(String name, String description) { 13 | super(name, description); 14 | } 15 | 16 | public Command(String name, String[] aliases, String description) { 17 | super(name, description); 18 | setAliases(aliases); 19 | } 20 | 21 | /** 22 | * Runs after command is executed 23 | */ 24 | public abstract void onExecute(String[] args); 25 | 26 | /** 27 | * Gets a correct use case 28 | * @return The correct use case 29 | */ 30 | public abstract String getUseCase(); 31 | 32 | /** 33 | * Gets the maximum argument size 34 | * @return The maximum argument size 35 | */ 36 | public abstract int getArgSize(); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/features/command/commands/FolderCommand.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.features.command.commands; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import cope.cosmos.client.features.command.Command; 5 | 6 | import java.awt.*; 7 | import java.io.File; 8 | import java.io.IOException; 9 | 10 | /** 11 | * @author linustouchtips 12 | * @since 08/24/2022 13 | */ 14 | public class FolderCommand extends Command { 15 | public static FolderCommand INSTANCE; 16 | 17 | public FolderCommand() { 18 | super("Folder", new String[]{"OpenFolder", "File", "OpenFile"}, "Opens the client folder"); 19 | INSTANCE = this; 20 | } 21 | 22 | @Override 23 | public void onExecute(String[] args) { 24 | 25 | if (args.length == 0) { 26 | 27 | // open file 28 | try { 29 | Desktop.getDesktop().open(new File("cosmos")); 30 | } catch (IOException exception) { 31 | 32 | // unrecognized file exception 33 | getCosmos().getChatManager().sendHoverableMessage(ChatFormatting.RED + "Unrecognized File!", ChatFormatting.RED + "Client folder was not found!"); 34 | } 35 | } 36 | 37 | else { 38 | 39 | // unrecognized arguments exception 40 | getCosmos().getChatManager().sendHoverableMessage(ChatFormatting.RED + "Unrecognized Arguments!", ChatFormatting.RED + "Please enter the correct arguments for this command."); 41 | } 42 | } 43 | 44 | @Override 45 | public String getUseCase() { 46 | return ""; 47 | } 48 | 49 | @Override 50 | public int getArgSize() { 51 | return 0; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/features/command/commands/FontCommand.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.features.command.commands; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import cope.cosmos.client.features.command.Command; 5 | import cope.cosmos.client.features.modules.client.FontModule; 6 | import cope.cosmos.client.features.modules.client.FontModule.FontType; 7 | 8 | import java.awt.*; 9 | 10 | /** 11 | * @author linustouchtips 12 | * @since 08/25/2022 13 | */ 14 | public class FontCommand extends Command { 15 | public static FontCommand INSTANCE; 16 | 17 | public FontCommand() { 18 | super("Font", "Sets the client's custom font"); 19 | INSTANCE = this; 20 | } 21 | 22 | @Override 23 | public void onExecute(String[] args) { 24 | 25 | if (args.length == 1) { 26 | 27 | // font to load 28 | String font = args[0]; 29 | 30 | // loads a given font 31 | getCosmos().getFontManager().loadFont(font.endsWith(".ttf") ? font : font + ".ttf", Font.PLAIN); 32 | } 33 | 34 | else if (args.length == 2) { 35 | 36 | // font to load 37 | String font = args[0]; 38 | FontType fontType = FontModule.INSTANCE.getType(args[1]); 39 | 40 | // loads a given font 41 | getCosmos().getFontManager().loadFont(font.endsWith(".ttf") ? font : font + ".ttf", fontType.getType()); 42 | } 43 | 44 | else { 45 | 46 | // unrecognized arguments exception 47 | getCosmos().getChatManager().sendHoverableMessage(ChatFormatting.RED + "Unrecognized Arguments!", ChatFormatting.RED + "Please enter the correct arguments for this command."); 48 | } 49 | } 50 | 51 | @Override 52 | public String getUseCase() { 53 | return ""; 54 | } 55 | 56 | @Override 57 | public int getArgSize() { 58 | return 1; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/features/command/commands/PrefixCommand.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.features.command.commands; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import cope.cosmos.client.Cosmos; 5 | import cope.cosmos.client.features.command.Command; 6 | 7 | /** 8 | * @author linustouchtips 9 | * @since 08/24/2022 10 | */ 11 | public class PrefixCommand extends Command { 12 | public static PrefixCommand INSTANCE; 13 | 14 | public PrefixCommand() { 15 | super("Prefix", "Sets the client prefix"); 16 | INSTANCE = this; 17 | } 18 | 19 | @Override 20 | public void onExecute(String[] args) { 21 | 22 | if (args.length == 1) { 23 | 24 | // new prefix 25 | String prefix = args[0]; 26 | 27 | // must be of length 1 28 | if (prefix.length() == 1) { 29 | 30 | // update prefix 31 | Cosmos.PREFIX = prefix; 32 | 33 | // notify 34 | getCosmos().getChatManager().sendHoverableMessage("Prefix set to " + ChatFormatting.GRAY + args[0], "Set the client prefix."); 35 | } 36 | 37 | else { 38 | 39 | // unsupported prefix length exception 40 | getCosmos().getChatManager().sendHoverableMessage(ChatFormatting.RED + "Unsupported Prefix Length!", ChatFormatting.RED + "Please enter a prefix of length 1."); 41 | } 42 | } 43 | 44 | else { 45 | 46 | // unrecognized arguments exception 47 | getCosmos().getChatManager().sendHoverableMessage(ChatFormatting.RED + "Unrecognized Arguments!", ChatFormatting.RED + "Please enter the correct arguments for this command."); 48 | } 49 | } 50 | 51 | @Override 52 | public String getUseCase() { 53 | return ""; 54 | } 55 | 56 | @Override 57 | public int getArgSize() { 58 | return 0; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/features/command/commands/ReloadSoundCommand.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.features.command.commands; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import cope.cosmos.asm.mixins.accessor.ISoundHandler; 5 | import cope.cosmos.client.features.command.Command; 6 | 7 | /** 8 | * @author linustouchtips 9 | * @since 08/24/2022 10 | */ 11 | public class ReloadSoundCommand extends Command { 12 | public static ReloadSoundCommand INSTANCE; 13 | 14 | public ReloadSoundCommand() { 15 | super("ReloadSound", new String[]{"SoundReload"}, "Reloads the world sound"); 16 | INSTANCE = this; 17 | } 18 | 19 | @Override 20 | public void onExecute(String[] args) { 21 | 22 | if (args.length == 0) { 23 | 24 | // reload sound 25 | ((ISoundHandler) mc.getSoundHandler()).getSoundManager().reloadSoundSystem(); 26 | 27 | // notify 28 | getCosmos().getChatManager().sendClientMessage("Sound Reloaded"); 29 | } 30 | 31 | else { 32 | 33 | // unrecognized arguments exception 34 | getCosmos().getChatManager().sendHoverableMessage(ChatFormatting.RED + "Unrecognized Arguments!", ChatFormatting.RED + "Please enter the correct arguments for this command."); 35 | } 36 | } 37 | 38 | @Override 39 | public String getUseCase() { 40 | return ""; 41 | } 42 | 43 | @Override 44 | public int getArgSize() { 45 | return 0; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/features/modules/Category.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.features.modules; 2 | 3 | /** 4 | * @author bon55 5 | * @since 05/05/2021 6 | */ 7 | public enum Category { 8 | 9 | /** 10 | * Modules used for combat (Ex: KillAura, AutoCrystal, Surround, etc.) 11 | */ 12 | COMBAT, 13 | 14 | /** 15 | * Modules that exploit certain anticheats to allow for "non-vanilla" behavior (Ex: AntiHunger, PacketFlight, Reach, etc.) 16 | */ 17 | EXPLOITS, 18 | 19 | /** 20 | * Modules that don't fit in the other categories 21 | */ 22 | MISCELLANEOUS, 23 | 24 | /** 25 | * Modules that allow the player to move in unnatural ways (Ex: Flight, Speed, ReverseStep, etc.) 26 | */ 27 | MOVEMENT, 28 | 29 | /** 30 | * Modules that are visual modifications (Ex: ESP, Nametags, HoleESP, etc.) 31 | */ 32 | VISUAL, 33 | 34 | /** 35 | * Modules that are modifications to world (Ex: Wallhack, SpeedMine, FastUse, etc.) 36 | */ 37 | WORLD, 38 | 39 | /** 40 | * Modules associated with client processes 41 | */ 42 | CLIENT, 43 | 44 | /** 45 | * Modules hidden from the ClickGUI 46 | */ 47 | HIDDEN 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/features/modules/client/DiscordPresenceModule.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.features.modules.client; 2 | 3 | import cope.cosmos.client.features.modules.Category; 4 | import cope.cosmos.client.features.modules.Module; 5 | import cope.cosmos.client.manager.managers.PresenceManager; 6 | 7 | /** 8 | * @author linustouchtips 9 | * @since 07/01/2021 10 | */ 11 | public class DiscordPresenceModule extends Module { 12 | public static DiscordPresenceModule INSTANCE; 13 | 14 | public DiscordPresenceModule() { 15 | super("DiscordPresence", new String[] {"DiscordRPC", "RPC"}, Category.CLIENT, "Displays a custom presence on Discord"); 16 | INSTANCE = this; 17 | 18 | setDrawn(false); 19 | setExempt(true); 20 | enable(true); 21 | } 22 | 23 | @Override 24 | public void onEnable() { 25 | super.onEnable(); 26 | 27 | // start presence 28 | PresenceManager.startPresence(); 29 | 30 | // notify user 31 | if (nullCheck()) { 32 | getCosmos().getChatManager().sendClientMessage("Starting Discord Presence!"); 33 | } 34 | } 35 | 36 | @Override 37 | public void onDisable() { 38 | super.onDisable(); 39 | 40 | // end presence 41 | PresenceManager.interruptPresence(); 42 | 43 | // notify user 44 | if (nullCheck()) { 45 | getCosmos().getChatManager().sendClientMessage("Shutting down Discord Presence!"); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/features/modules/client/SocialModule.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.features.modules.client; 2 | 3 | import cope.cosmos.client.events.render.gui.TabOverlayEvent; 4 | import cope.cosmos.client.features.modules.Category; 5 | import cope.cosmos.client.features.modules.PersistentModule; 6 | import cope.cosmos.client.features.setting.Setting; 7 | import cope.cosmos.client.manager.managers.SocialManager.Relationship; 8 | import net.minecraft.util.text.TextFormatting; 9 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 10 | 11 | /** 12 | * @author linustouchtips 13 | * @since 06/08/2021 14 | */ 15 | public class SocialModule extends PersistentModule { 16 | public static SocialModule INSTANCE; 17 | 18 | public SocialModule() { 19 | super("Social", Category.CLIENT, "Allows the social system to function"); 20 | INSTANCE = this; 21 | 22 | setExempt(true); 23 | setDrawn(false); 24 | } 25 | 26 | // **************************** general **************************** 27 | 28 | public static Setting friends = new Setting<>("Friends", true) 29 | .setDescription("Allow friends system to function"); 30 | 31 | @SubscribeEvent 32 | public void onTabOverlay(TabOverlayEvent event) { 33 | if (friends.getValue()) { 34 | 35 | // friend found in tab 36 | if (getCosmos().getSocialManager().getSocial(event.getInformation()).equals(Relationship.FRIEND)) { 37 | 38 | // highlight friend names in the tab 39 | event.setCanceled(true); 40 | event.setInformation(TextFormatting.AQUA + event.getInformation()); 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/features/modules/combat/AutoBowReleaseModule.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.features.modules.combat; 2 | 3 | import cope.cosmos.client.features.modules.Category; 4 | import cope.cosmos.client.features.modules.Module; 5 | import cope.cosmos.client.features.setting.Setting; 6 | import cope.cosmos.util.player.InventoryUtil; 7 | import net.minecraft.init.Items; 8 | import net.minecraft.network.play.client.CPacketPlayerDigging; 9 | import net.minecraft.util.EnumFacing; 10 | import net.minecraft.util.math.BlockPos; 11 | 12 | /** 13 | * @author linustouchtips 14 | * @since 08/22/2022 15 | */ 16 | public class AutoBowReleaseModule extends Module { 17 | public static AutoBowReleaseModule INSTANCE; 18 | 19 | public AutoBowReleaseModule() { 20 | super("AutoBowRelease", new String[] {"FastBow", "BowRelease", "BowSpam"}, Category.COMBAT, "Automatically releases a drawn bow"); 21 | INSTANCE = this; 22 | } 23 | 24 | // **************************** general **************************** 25 | 26 | public static Setting ticks = new Setting<>("Ticks", 3.0, 3.0, 20.0, 0) 27 | .setDescription("Ticks to draw the bow"); 28 | 29 | @Override 30 | public void onTick() { 31 | 32 | // make sure we are holding a bow and drawing it 33 | if (InventoryUtil.isHolding(Items.BOW) && mc.player.isHandActive()) { 34 | 35 | // make sure we've held it for at least a minimum of specified ticks 36 | if (mc.player.getItemInUseMaxCount() > ticks.getValue()) { 37 | 38 | // release bow packets 39 | mc.player.connection.sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, EnumFacing.DOWN)); 40 | // mc.player.connection.sendPacket(new CPacketPlayerTryUseItem(mc.player.getActiveHand())); 41 | mc.player.stopActiveHand(); 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/features/modules/miscellaneous/SneakModule.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.features.modules.miscellaneous; 2 | 3 | import cope.cosmos.client.features.modules.Category; 4 | import cope.cosmos.client.features.modules.Module; 5 | 6 | /** 7 | * @author linustouchtips 8 | * @since 10/24/2022 9 | */ 10 | public class SneakModule extends Module { 11 | public static SneakModule INSTANCE; 12 | 13 | public SneakModule() { 14 | super("Sneak", new String[] {"SafeWalk"}, Category.MISCELLANEOUS, "Automatically sneaks"); 15 | INSTANCE = this; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/features/modules/miscellaneous/SpammerModule.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.features.modules.miscellaneous; 2 | 3 | import cope.cosmos.client.features.modules.Category; 4 | import cope.cosmos.client.features.modules.Module; 5 | 6 | /** 7 | * @author linustouchtips 8 | * @since 10/26/2022 9 | */ 10 | public class SpammerModule extends Module { 11 | public static SpammerModule INSTANCE; 12 | 13 | public SpammerModule() { 14 | super("Spammer", Category.MISCELLANEOUS, "Spams in chat"); 15 | INSTANCE = this; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/features/modules/miscellaneous/TimerModule.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.features.modules.miscellaneous; 2 | 3 | import cope.cosmos.client.features.modules.Category; 4 | import cope.cosmos.client.features.modules.Module; 5 | import cope.cosmos.client.features.setting.Setting; 6 | 7 | /** 8 | * @author linustouchtips 9 | * @since 06/08/2021 10 | */ 11 | public class TimerModule extends Module { 12 | public static TimerModule INSTANCE; 13 | 14 | public TimerModule() { 15 | super("Timer", Category.MISCELLANEOUS, "Allows you to change the client side tick speed"); 16 | INSTANCE = this; 17 | } 18 | 19 | // **************************** speeds **************************** 20 | 21 | public static Setting multiplier = new Setting<>("Multiplier", 0.1, 4.0, 50.0, 1) 22 | .setAlias("Ticks") 23 | .setDescription("Multiplier for the client side tick speed"); 24 | 25 | @Override 26 | public void onUpdate() { 27 | 28 | // update client ticks 29 | getCosmos().getTickManager().setClientTicks(multiplier.getValue().floatValue()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/features/modules/miscellaneous/XCarryModule.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.features.modules.miscellaneous; 2 | 3 | import cope.cosmos.asm.mixins.accessor.ICPacketCloseWindow; 4 | import cope.cosmos.client.events.network.PacketEvent; 5 | import cope.cosmos.client.features.modules.Category; 6 | import cope.cosmos.client.features.modules.Module; 7 | import net.minecraft.network.play.client.CPacketCloseWindow; 8 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 9 | 10 | /** 11 | * @author linustouchtips 12 | * @since 07/21/2021 13 | */ 14 | public class XCarryModule extends Module { 15 | public static XCarryModule INSTANCE; 16 | 17 | public XCarryModule() { 18 | super("XCarry", new String[] {"ExtraSlots", "SecretClose"}, Category.MISCELLANEOUS, "Prevents the server from knowing when you open your inventory"); 19 | INSTANCE = this; 20 | } 21 | 22 | @SubscribeEvent 23 | public void onPacketSend(PacketEvent.PacketSendEvent event) { 24 | 25 | // packet for closing windows 26 | if (event.getPacket() instanceof CPacketCloseWindow) { 27 | 28 | // prevent the client from sending the packet that lets the server know when you've closed your inventory 29 | if (((ICPacketCloseWindow) event.getPacket()).getWindowID() == mc.player.inventoryContainer.windowId) { 30 | event.setCanceled(true); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/features/modules/movement/EntityControlModule.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.features.modules.movement; 2 | 3 | import cope.cosmos.client.events.entity.horse.HorseSaddledEvent; 4 | import cope.cosmos.client.events.entity.horse.HorseSteerEvent; 5 | import cope.cosmos.client.features.modules.Category; 6 | import cope.cosmos.client.features.modules.Module; 7 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 8 | 9 | /** 10 | * @author linustouchtips 11 | * @since 02/24/2022 12 | */ 13 | public class EntityControlModule extends Module { 14 | public static EntityControlModule INSTANCE; 15 | 16 | public EntityControlModule() { 17 | super("EntityControl", Category.MOVEMENT, "Allows you to steer entities without saddles"); 18 | INSTANCE = this; 19 | } 20 | 21 | @SubscribeEvent 22 | public void onHorseSteer(HorseSteerEvent event) { 23 | 24 | // allow any abstract horse to be steered 25 | event.setCanceled(true); 26 | } 27 | 28 | @SubscribeEvent 29 | public void onHorseSaddled(HorseSaddledEvent event) { 30 | 31 | // the current riding entity (all entities) are saddled 32 | event.setCanceled(true); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/features/modules/movement/FastSwimModule.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.features.modules.movement; 2 | 3 | import cope.cosmos.client.events.motion.movement.MotionEvent; 4 | import cope.cosmos.client.features.modules.Category; 5 | import cope.cosmos.client.features.modules.Module; 6 | import cope.cosmos.client.features.setting.Setting; 7 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 8 | 9 | /** 10 | * @author linustouchtips 11 | * @since 10/02/2022 12 | */ 13 | public class FastSwimModule extends Module { 14 | public static FastSwimModule INSTANCE; 15 | 16 | public FastSwimModule() { 17 | super("FastSwim", Category.MOVEMENT, "Allows you to swim faster"); 18 | INSTANCE = this; 19 | } 20 | 21 | // **************************** speeds **************************** 22 | 23 | public static Setting waterSpeed = new Setting<>("WaterSpeed", 0.0, 1.0, 3.0, 2) 24 | .setDescription("Speed while in water"); 25 | 26 | public static Setting lavaSpeed = new Setting<>("LavaSpeed", 0.0, 1.0, 3.0, 2) 27 | .setDescription("Speed while in lava"); 28 | 29 | // **************************** general **************************** 30 | 31 | public static Setting depthStrider = new Setting<>("DepthStrider", true) 32 | .setDescription("Takes into account the depth strider modifier"); 33 | 34 | @SubscribeEvent 35 | public void onMotion(MotionEvent event) { 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/features/modules/movement/ParkourModule.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.features.modules.movement; 2 | 3 | import cope.cosmos.asm.mixins.accessor.IEntity; 4 | import cope.cosmos.client.features.modules.Category; 5 | import cope.cosmos.client.features.modules.Module; 6 | import cope.cosmos.client.features.modules.exploits.PacketFlightModule; 7 | import cope.cosmos.util.player.PlayerUtil; 8 | 9 | /** 10 | * @author linustouchtips 11 | * @since 10/10/2022 12 | */ 13 | public class ParkourModule extends Module { 14 | public static ParkourModule INSTANCE; 15 | 16 | public ParkourModule() { 17 | super("Parkour", new String[] {"EdgeJump"}, Category.MOVEMENT, "Jumps at the edge of blocks"); 18 | INSTANCE = this; 19 | } 20 | 21 | @Override 22 | public void onUpdate() { 23 | 24 | // cannot jump in water 25 | if (PlayerUtil.isInLiquid()) { 26 | return; 27 | } 28 | 29 | // cannot jump while flying 30 | if (PlayerUtil.isFlying() || PacketFlightModule.INSTANCE.isEnabled()) { 31 | return; 32 | } 33 | 34 | // cannot jump while in web 35 | if (((IEntity) mc.player).getInWeb()) { 36 | return; 37 | } 38 | 39 | // check if on ground 40 | if (mc.player.onGround) { 41 | 42 | // check if player should jump 43 | if (!mc.player.isSneaking() && !mc.gameSettings.keyBindJump.isPressed()) { 44 | 45 | // check if player is at the edge of a block 46 | if (mc.world.getCollisionBoxes(mc.player, mc.player.getEntityBoundingBox().offset(0, -0.5, 0).expand(-0.001, 0, -0.001)).isEmpty()) { 47 | 48 | // jump 49 | mc.player.jump(); 50 | } 51 | } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/features/modules/movement/YawModule.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.features.modules.movement; 2 | 3 | import cope.cosmos.client.features.modules.Category; 4 | import cope.cosmos.client.features.modules.Module; 5 | 6 | /** 7 | * @author linustouchtips 8 | * @since 10/09/2022 9 | */ 10 | public class YawModule extends Module { 11 | public static YawModule INSTANCE; 12 | 13 | public YawModule() { 14 | super("Yaw", new String[] {"YawLock"}, Category.MOVEMENT, "Locks yaw to cardinal axis"); 15 | INSTANCE = this; 16 | } 17 | 18 | @Override 19 | public void onUpdate() { 20 | 21 | // rotation rounded to nearest cardinal direction 22 | float yaw = Math.round(mc.player.rotationYaw / 90F) * 90; 23 | 24 | // lock riding entity yaw 25 | if (mc.player.isRiding()) { 26 | mc.player.getRidingEntity().rotationYaw = yaw; 27 | } 28 | 29 | // lock yaw 30 | mc.player.rotationYaw = yaw; 31 | mc.player.rotationYawHead = yaw; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/features/modules/visual/CameraClipModule.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.features.modules.visual; 2 | 3 | import cope.cosmos.client.events.render.other.CameraClipEvent; 4 | import cope.cosmos.client.features.modules.Category; 5 | import cope.cosmos.client.features.modules.Module; 6 | import cope.cosmos.client.features.setting.Setting; 7 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 8 | 9 | /** 10 | * @author aesthetical, linustouchtips 11 | * @since 10/17/2021 12 | */ 13 | public class CameraClipModule extends Module { 14 | public static CameraClipModule INSTANCE; 15 | 16 | public CameraClipModule() { 17 | super("CameraClip", new String[] {"ViewClip"}, Category.VISUAL, "Clips your third person camera through blocks"); 18 | INSTANCE = this; 19 | } 20 | 21 | // **************************** general settings **************************** 22 | 23 | public static Setting distance = new Setting<>("Distance", 1.0, 5.0, 20.0, 0) 24 | .setAlias("Clip", "ClipDistance") 25 | .setDescription("How many blocks the camera should clip through"); 26 | 27 | @SubscribeEvent 28 | public void onCameraClip(CameraClipEvent event) { 29 | 30 | // override the vanilla camera clip distance 31 | event.setDistance(distance.getValue()); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/features/modules/visual/ExtraTabModule.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.features.modules.visual; 2 | 3 | import cope.cosmos.client.events.render.gui.TabListSizeEvent; 4 | import cope.cosmos.client.features.modules.Category; 5 | import cope.cosmos.client.features.modules.Module; 6 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 7 | 8 | /** 9 | * @author linustouchtips 10 | * @since 12/24/2021 11 | */ 12 | public class ExtraTabModule extends Module { 13 | public static ExtraTabModule INSTANCE; 14 | 15 | public ExtraTabModule() { 16 | super("ExtraTab", Category.VISUAL, "Extends the tablist's maximum length"); 17 | INSTANCE = this; 18 | } 19 | 20 | @SubscribeEvent 21 | public void onTabList(TabListSizeEvent event) { 22 | 23 | // remove limit on size 24 | event.setCanceled(true); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/features/modules/visual/FullBrightModule.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.features.modules.visual; 2 | 3 | import cope.cosmos.client.features.modules.Category; 4 | import cope.cosmos.client.features.modules.Module; 5 | import net.minecraft.init.MobEffects; 6 | import net.minecraft.potion.PotionEffect; 7 | 8 | /** 9 | * @author linustouchtips 10 | * @since 07/21/2021 11 | */ 12 | public class FullBrightModule extends Module { 13 | public static FullBrightModule INSTANCE; 14 | 15 | public FullBrightModule() { 16 | super("FullBright", Category.VISUAL, "Brightens up the world"); 17 | INSTANCE = this; 18 | } 19 | 20 | // previous brightness info 21 | private float previousBright; 22 | private int previousNightVision; 23 | 24 | @Override 25 | public void onEnable() { 26 | super.onEnable(); 27 | 28 | // save previous brightness 29 | previousBright = mc.gameSettings.gammaSetting; 30 | 31 | // save previous night vision 32 | if (mc.player.isPotionActive(MobEffects.NIGHT_VISION)) { 33 | previousNightVision = mc.player.getActivePotionEffect(MobEffects.NIGHT_VISION).getDuration(); 34 | } 35 | 36 | // apply brightness 37 | mc.gameSettings.gammaSetting = 100; 38 | } 39 | 40 | @Override 41 | public void onUpdate() { 42 | 43 | // apply night vision potion effect 44 | mc.player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION.setPotionName("FullBright"), 80950, 1, false, false)); 45 | } 46 | 47 | @Override 48 | public void onDisable() { 49 | super.onDisable(); 50 | 51 | // remove night vision 52 | mc.player.removePotionEffect(MobEffects.NIGHT_VISION); 53 | 54 | // reapply previous night vision 55 | if (previousNightVision > 0) { 56 | mc.player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, previousNightVision)); 57 | } 58 | 59 | // reset brightness 60 | mc.gameSettings.gammaSetting = previousBright; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/features/modules/visual/SkyboxModule.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.features.modules.visual; 2 | 3 | import cope.cosmos.client.events.render.world.RenderFogColorEvent; 4 | import cope.cosmos.client.events.render.world.RenderSkyEvent; 5 | import cope.cosmos.client.features.modules.Category; 6 | import cope.cosmos.client.features.modules.Module; 7 | import cope.cosmos.client.features.setting.Setting; 8 | import cope.cosmos.util.string.ColorUtil; 9 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 10 | 11 | /** 12 | * @author linustouchtips 13 | * @since 12/28/2021 14 | */ 15 | public class SkyboxModule extends Module { 16 | public static SkyboxModule INSTANCE; 17 | 18 | public SkyboxModule() { 19 | super("Skybox", Category.VISUAL, "Changes the skybox"); 20 | INSTANCE = this; 21 | } 22 | 23 | // **************************** general **************************** 24 | 25 | public static Setting sky = new Setting<>("Sky", true) 26 | .setDescription("Colors the sky"); 27 | 28 | public static Setting fog = new Setting<>("Fog", true) 29 | .setDescription("Colors the fog"); 30 | 31 | @SubscribeEvent 32 | public void onRenderSky(RenderSkyEvent event) { 33 | if (sky.getValue()) { 34 | 35 | // override sky color 36 | event.setColor(ColorUtil.getPrimaryColor()); 37 | event.setCanceled(true); 38 | } 39 | } 40 | 41 | @SubscribeEvent 42 | public void onRenderFogColor(RenderFogColorEvent event) { 43 | if (fog.getValue()) { 44 | 45 | // override fog color 46 | event.setColor(ColorUtil.getPrimaryColor()); 47 | event.setCanceled(true); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/features/modules/world/MultiTaskModule.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.features.modules.world; 2 | 3 | import cope.cosmos.client.events.entity.player.interact.DualInteractEvent; 4 | import cope.cosmos.client.features.modules.Category; 5 | import cope.cosmos.client.features.modules.Module; 6 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 7 | 8 | /** 9 | * @author linustouchtips 10 | * @since 12/30/2021 11 | */ 12 | public class MultiTaskModule extends Module { 13 | public static MultiTaskModule INSTANCE; 14 | 15 | public MultiTaskModule() { 16 | super("MultiTask", new String[] {"DualUse"}, Category.WORLD, "Allows you to use your offhand and mine at the same time"); 17 | INSTANCE = this; 18 | } 19 | 20 | @SubscribeEvent 21 | public void onDualInteract(DualInteractEvent event) { 22 | 23 | // prevent the client from knowing you are already interacting 24 | event.setCanceled(true); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/manager/Manager.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.manager; 2 | 3 | import cope.cosmos.client.features.Feature; 4 | import cope.cosmos.util.Wrapper; 5 | 6 | /** 7 | * @author linustouchtips 8 | * @since 06/08/2021 9 | */ 10 | public class Manager extends Feature implements Wrapper { 11 | 12 | public Manager(String name, String description) { 13 | super(name, description); 14 | } 15 | 16 | /** 17 | * Runs every update ticks (i.e. 20 times a second) 18 | */ 19 | public void onUpdate() { 20 | 21 | } 22 | 23 | /** 24 | * Runs every tick (i.e. 40 times a second) 25 | */ 26 | public void onTick() { 27 | 28 | } 29 | 30 | /** 31 | * Runs on the separate module thread (i.e. every cpu tick) 32 | */ 33 | public void onThread() { 34 | 35 | } 36 | 37 | /** 38 | * Runs on the game overlay tick (i.e. once every frame) 39 | */ 40 | public void onRender2D() { 41 | 42 | } 43 | 44 | /** 45 | * Runs on the global render tick (i.e. once every frame) 46 | */ 47 | public void onRender3D() { 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/manager/managers/AltManager.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.manager.managers; 2 | 3 | import cope.cosmos.client.manager.Manager; 4 | import cope.cosmos.client.ui.altgui.AltEntry; 5 | 6 | import java.util.HashSet; 7 | import java.util.Set; 8 | 9 | /** 10 | * @author Surge 11 | * @since 02/06/2022 12 | */ 13 | public class AltManager extends Manager { 14 | 15 | // List of alt entries 16 | private final Set altEntries = new HashSet<>(); 17 | 18 | public AltManager() { 19 | super("AltManager", "Manages client's saved alternate accounts"); 20 | } 21 | 22 | /** 23 | * Gets the index of alt entries 24 | * @param in The in 25 | * @return Returns alt entry 26 | */ 27 | public AltEntry indexOf(int in) { 28 | return (AltEntry) altEntries.toArray()[in]; 29 | } 30 | 31 | /** 32 | * Gets the alt entries 33 | * @return The alt entries 34 | */ 35 | public Set getAltEntries() { 36 | return altEntries; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/manager/managers/ChangelogManager.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.manager.managers; 2 | 3 | import cope.cosmos.client.manager.Manager; 4 | 5 | import java.io.BufferedReader; 6 | import java.io.InputStreamReader; 7 | import java.net.URL; 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | import java.util.stream.Collectors; 11 | 12 | /** 13 | * @author linustouchtips 14 | * @since 11/25/2021 15 | */ 16 | public class ChangelogManager extends Manager { 17 | 18 | // the changelog as a list of strings 19 | private final List changelog = new ArrayList<>(); 20 | 21 | public ChangelogManager() { 22 | super("ChangelogManager", "Manages the client changelog"); 23 | 24 | try { 25 | // the changelog from the git 26 | URL url = new URL("https://raw.githubusercontent.com/momentumdevelopment/cosmos/main/resources/changelog.json"); 27 | BufferedReader inputStream = new BufferedReader(new InputStreamReader(url.openStream())); 28 | 29 | // add all changelog lines 30 | changelog.addAll(inputStream.lines().collect(Collectors.toList())); 31 | 32 | } catch (Exception exception) { 33 | exception.printStackTrace(); 34 | } 35 | } 36 | 37 | /** 38 | * Gets the changelog 39 | * @return The changelog as a list of Strings 40 | */ 41 | public List getChangelog() { 42 | return changelog; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/manager/managers/ReloadManager.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.manager.managers; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.events.entity.EntityWorldEvent; 5 | import cope.cosmos.client.features.modules.Module; 6 | import cope.cosmos.client.manager.Manager; 7 | import cope.cosmos.util.Wrapper; 8 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * @author linustouchtips 14 | * @since 06/08/2021 15 | */ 16 | public class ReloadManager extends Manager implements Wrapper { 17 | public ReloadManager() { 18 | super("ReloadManager", "Reloads all modules when loading a new world"); 19 | Cosmos.EVENT_BUS.register(this); 20 | } 21 | 22 | @SubscribeEvent 23 | public void onEntitySpawn(EntityWorldEvent.EntitySpawnEvent event) { 24 | 25 | // on spawn 26 | if (event.getEntity().equals(mc.player)) { 27 | 28 | // previously enabled modules 29 | List enabledModules = getCosmos().getModuleManager().getModules(Module::isEnabled); 30 | 31 | // disable all modules 32 | getCosmos().getModuleManager().getAllModules().forEach(module -> { 33 | 34 | // exempt property prevents modules from being reloaded 35 | if (!module.isExempt()) { 36 | module.disable(false); 37 | } 38 | }); 39 | 40 | // re-enable previously enabled modules 41 | enabledModules.forEach(module -> { 42 | 43 | // exempt property prevents modules from being reloaded 44 | if (!module.isExempt()) { 45 | module.enable(false); 46 | } 47 | }); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/manager/managers/SocialManager.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.manager.managers; 2 | 3 | import cope.cosmos.client.manager.Manager; 4 | 5 | import java.util.Map; 6 | import java.util.concurrent.ConcurrentHashMap; 7 | 8 | /** 9 | * @author linustouchtips 10 | * @since 06/08/2021 11 | */ 12 | public class SocialManager extends Manager { 13 | 14 | // map of socials 15 | private final Map socials = new ConcurrentHashMap<>(); 16 | 17 | public SocialManager() { 18 | super("SocialManager", "Manages the client's social system"); 19 | } 20 | 21 | /** 22 | * Adds an entity to our socials list 23 | * @param socialName The name of the entity 24 | * @param social The relationship to the entity 25 | */ 26 | public void addSocial(String socialName, Relationship social) { 27 | socials.put(socialName, social); 28 | } 29 | 30 | /** 31 | * Removes an entity from our socials list 32 | * @param socialName The name of the entity 33 | */ 34 | public void removeSocial(String socialName) { 35 | socials.remove(socialName); 36 | } 37 | 38 | /** 39 | * Gets our socials list 40 | * @return The list of socials 41 | */ 42 | public Map getSocials() { 43 | return socials; 44 | } 45 | 46 | /** 47 | * Gets the relationship of an entity 48 | * @param socialName The name of the entity 49 | * @return The relationship to the entity 50 | */ 51 | public Relationship getSocial(String socialName) { 52 | return socials.getOrDefault(socialName, Relationship.NONE); 53 | } 54 | 55 | public enum Relationship { 56 | 57 | /** 58 | * This entity is our friend, don't target them :) 59 | */ 60 | FRIEND, 61 | 62 | /** 63 | * This entity is our enemy, prioritize them in combat >:( 64 | */ 65 | ENEMY, 66 | 67 | /** 68 | * We have no relationship to this entity 69 | */ 70 | NONE 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/shader/shaders/DotShader.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.shader.shaders; 2 | 3 | import cope.cosmos.client.shader.Shader; 4 | import cope.cosmos.util.string.ColorUtil; 5 | 6 | import java.awt.*; 7 | 8 | import static org.lwjgl.opengl.GL20.*; 9 | import static org.lwjgl.opengl.GL20.glUniform1f; 10 | 11 | /** 12 | * @author linustouchtips 13 | * @since 12/23/2021 14 | */ 15 | public class DotShader extends Shader { 16 | public DotShader() { 17 | super("/assets/cosmos/shaders/glsl/dot.frag"); 18 | } 19 | 20 | @Override 21 | public void setupConfiguration() { 22 | setupConfigurations("texture"); 23 | setupConfigurations("texelSize"); 24 | setupConfigurations("colorDot"); 25 | setupConfigurations("colorFilled"); 26 | setupConfigurations("divider"); 27 | setupConfigurations("radius"); 28 | setupConfigurations("maxSample"); 29 | } 30 | 31 | @Override 32 | public void updateConfiguration(int radius, Color color) { 33 | glUniform1i(getConfigurations("texture"), 0); 34 | glUniform2f(getConfigurations("texelSize"), 1F / mc.displayWidth, 1F / mc.displayHeight); 35 | glUniform4f(getConfigurations("colorFilled"), color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 100 / 255F); 36 | glUniform4f(getConfigurations("colorDot"), color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, color.getAlpha() / 255F); 37 | glUniform1f(getConfigurations("radius"), radius); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/shader/shaders/FillShader.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.shader.shaders; 2 | 3 | import cope.cosmos.client.shader.Shader; 4 | import cope.cosmos.util.string.ColorUtil; 5 | 6 | import java.awt.*; 7 | 8 | import static org.lwjgl.opengl.GL20.*; 9 | 10 | /** 11 | * @author linustouchtips, Surge 12 | * @since 12/22/2021 13 | */ 14 | public class FillShader extends Shader { 15 | public FillShader() { 16 | super("/assets/cosmos/shaders/glsl/fill.frag"); 17 | } 18 | 19 | @Override 20 | public void setupConfiguration() { 21 | setupConfigurations("texture"); 22 | setupConfigurations("texelSize"); 23 | setupConfigurations("color"); 24 | setupConfigurations("divider"); 25 | setupConfigurations("radius"); 26 | setupConfigurations("maxSample"); 27 | } 28 | 29 | @Override 30 | public void updateConfiguration(int radius, Color color) { 31 | glUniform1i(getConfigurations("texture"), 0); 32 | glUniform2f(getConfigurations("texelSize"), 1F / mc.displayWidth, 1F / mc.displayHeight); 33 | glUniform4f(getConfigurations("color"), color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, color.getAlpha() / 255F); 34 | glUniform1f(getConfigurations("radius"), radius); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/shader/shaders/OutlineShader.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.shader.shaders; 2 | 3 | import cope.cosmos.client.shader.Shader; 4 | import cope.cosmos.util.string.ColorUtil; 5 | 6 | import java.awt.*; 7 | 8 | import static org.lwjgl.opengl.GL20.*; 9 | 10 | /** 11 | * @author linustouchtips 12 | * @since 12/22/2021 13 | */ 14 | public class OutlineShader extends Shader { 15 | public OutlineShader() { 16 | super("/assets/cosmos/shaders/glsl/outline.frag"); 17 | } 18 | 19 | @Override 20 | public void setupConfiguration() { 21 | setupConfigurations("texture"); 22 | setupConfigurations("texelSize"); 23 | setupConfigurations("color"); 24 | setupConfigurations("divider"); 25 | setupConfigurations("radius"); 26 | setupConfigurations("maxSample"); 27 | } 28 | 29 | @Override 30 | public void updateConfiguration(int radius, Color color) { 31 | glUniform1i(getConfigurations("texture"), 0); 32 | glUniform2f(getConfigurations("texelSize"), 1F / mc.displayWidth, 1F / mc.displayHeight); 33 | glUniform4f(getConfigurations("color"), color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, color.getAlpha() / 255F); 34 | glUniform1f(getConfigurations("radius"), radius); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/shader/shaders/RainbowOutlineShader.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.shader.shaders; 2 | 3 | import cope.cosmos.client.shader.Shader; 4 | import cope.cosmos.util.string.ColorUtil; 5 | 6 | import java.awt.*; 7 | 8 | import static org.lwjgl.opengl.GL20.*; 9 | 10 | /** 11 | * @author linustouchtips 12 | * @since 12/22/2021 13 | */ 14 | public class RainbowOutlineShader extends Shader { 15 | public RainbowOutlineShader() { 16 | super("/assets/cosmos/shaders/glsl/rainbow_outline.frag"); 17 | } 18 | 19 | @Override 20 | public void setupConfiguration() { 21 | setupConfigurations("texture"); 22 | setupConfigurations("texelSize"); 23 | setupConfigurations("color"); 24 | setupConfigurations("radius"); 25 | setupConfigurations("rainbowStrength"); 26 | setupConfigurations("rainbowSpeed"); 27 | setupConfigurations("saturation"); 28 | } 29 | 30 | @Override 31 | public void updateConfiguration(int radius, Color color) { 32 | glUniform1i(getConfigurations("texture"), 0); 33 | glUniform2f(getConfigurations("texelSize"), 1F / mc.displayWidth, 1F / mc.displayHeight); 34 | glUniform4f(getConfigurations("color"), color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha()); 35 | glUniform1f(getConfigurations("radius"), radius); 36 | glUniform2f(getConfigurations("rainbowStrength"), -(1 / 300F), -(1 / 300F)); 37 | glUniform1f(getConfigurations("rainbowSpeed"), 0.4F); 38 | glUniform1f(getConfigurations("saturation"), 0.5F); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/ui/clickgui/screens/DrawableComponent.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.ui.clickgui.screens; 2 | 3 | import cope.cosmos.client.ui.clickgui.screens.configuration.component.ClickType; 4 | import cope.cosmos.client.ui.util.InterfaceWrapper; 5 | import cope.cosmos.util.Wrapper; 6 | 7 | /** 8 | * @author linustouchtips 9 | * @since 01/29/2022 10 | */ 11 | public abstract class DrawableComponent implements InterfaceWrapper, Wrapper { 12 | 13 | /** 14 | * Draws the feature 15 | */ 16 | public abstract void drawComponent(); 17 | 18 | /** 19 | * Runs when the feature is clicked 20 | * @param in The type of click 21 | */ 22 | public abstract void onClick(ClickType in); 23 | 24 | /** 25 | * Runs when a key on the keyboard is typed 26 | * @param in The key that was typed 27 | */ 28 | public abstract void onType(int in); 29 | 30 | /** 31 | * Runs when the mouse wheel is scrolled 32 | * @param in The scroll length 33 | */ 34 | public abstract void onScroll(int in); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/ui/clickgui/screens/configuration/component/ClickType.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.ui.clickgui.screens.configuration.component; 2 | 3 | import java.util.Arrays; 4 | 5 | /** 6 | * @author linustouchtips 7 | * @since 01/29/2022 8 | */ 9 | public enum ClickType { 10 | 11 | /** 12 | * Left mouse click 13 | */ 14 | LEFT(0), 15 | 16 | /** 17 | * Right mouse click 18 | */ 19 | RIGHT(1), 20 | 21 | /** 22 | * Middle mouse click 23 | */ 24 | MIDDLE(2), 25 | 26 | /** 27 | * First side button 28 | */ 29 | SIDE_TOP(3), 30 | 31 | /** 32 | * Second side button 33 | */ 34 | SIDE_BOTTOM(4); 35 | 36 | // button identity 37 | private final int identifier; 38 | 39 | ClickType(int identifier) { 40 | this.identifier = identifier; 41 | } 42 | 43 | /** 44 | * Gets the identifier of the click type 45 | * @return The identifier of the click type 46 | */ 47 | public int getIdentifier() { 48 | return identifier; 49 | } 50 | 51 | /** 52 | * Gets the click type based on the button identifier 53 | * @param in The button identifier 54 | * @return The click type associated with the button identifier 55 | */ 56 | public static ClickType getByIdentifier(int in) { 57 | return Arrays.stream(values()) 58 | .filter(value -> value.getIdentifier() == in) 59 | .findFirst() 60 | .orElse(null); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/ui/util/InterfaceWrapper.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.ui.util; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.ui.clickgui.ClickGUIScreen; 5 | 6 | /** 7 | * @author linustouchtips 8 | * @since 08/23/2022 9 | */ 10 | public interface InterfaceWrapper { 11 | 12 | /** 13 | * Checks if the mouse is over a region 14 | * @param x The lower x 15 | * @param y The lower y 16 | * @param width The upper x 17 | * @param height The upper y 18 | * @return Whether the mouse is over the given region 19 | */ 20 | default boolean isMouseOver(float x, float y, float width, float height) { 21 | return getMouse().getPosition().x >= x && getMouse().getPosition().y >= y && getMouse().getPosition().x <= (x + width) && getMouse().getPosition().y <= (y + height); 22 | } 23 | 24 | /** 25 | * Gets the mouse 26 | * @return The mouse 27 | */ 28 | default MousePosition getMouse() { 29 | return getGUI().getMouse(); 30 | } 31 | 32 | /** 33 | * Gets the scissor stack 34 | * @return The scissor stack 35 | */ 36 | default ScissorStack getScissorStack() { 37 | return getGUI().getScissorStack(); 38 | } 39 | 40 | /** 41 | * Gets the Click Gui screen 42 | * @return The Click Gui screen 43 | */ 44 | default ClickGUIScreen getGUI() { 45 | return Cosmos.INSTANCE.getClickGUI(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/client/ui/util/MousePosition.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.client.ui.util; 2 | 3 | import net.minecraft.util.math.Vec2f; 4 | 5 | public class MousePosition { 6 | 7 | private Vec2f mousePosition; 8 | private boolean leftClick, rightClick, leftHeld, rightHeld; 9 | 10 | public MousePosition(Vec2f mousePosition, boolean leftClick, boolean rightClick, boolean leftHeld, boolean rightHeld) { 11 | this.mousePosition = mousePosition; 12 | this.leftClick = leftClick; 13 | this.rightClick = rightClick; 14 | this.leftHeld = leftHeld; 15 | this.rightHeld = rightHeld; 16 | } 17 | 18 | public boolean isLeftClick() { 19 | return leftClick; 20 | } 21 | 22 | public void setLeftClick(boolean in) { 23 | leftClick = in; 24 | } 25 | 26 | public boolean isRightClick() { 27 | return rightClick; 28 | } 29 | 30 | public void setRightClick(boolean in) { 31 | rightClick = in; 32 | } 33 | 34 | public boolean isLeftHeld() { 35 | return leftHeld; 36 | } 37 | 38 | public void setLeftHeld(boolean in) { 39 | leftHeld = in; 40 | } 41 | 42 | public boolean isRightHeld() { 43 | return rightHeld; 44 | } 45 | 46 | public void setRightHeld(boolean in) { 47 | rightHeld = in; 48 | } 49 | 50 | public void setPosition(Vec2f in) { 51 | mousePosition = in; 52 | } 53 | 54 | public Vec2f getPosition() { 55 | return mousePosition; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/font/FontCache.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.font; 2 | 3 | import org.lwjgl.opengl.GL11; 4 | 5 | /** 6 | * @author LiquidBounce Development, linustouchitps 7 | * @since 05/25/2021 8 | */ 9 | public class FontCache { 10 | 11 | // cache our display list and last usage 12 | private int displayList; 13 | private long lastUsage; 14 | 15 | // whether the font cache is deleted, this is useful later when we are collecting garbage 16 | private boolean deleted; 17 | 18 | public FontCache(int displayList, long lastUsage) { 19 | this.displayList = displayList; 20 | this.lastUsage = lastUsage; 21 | } 22 | 23 | /** 24 | * Deletes display lists 25 | */ 26 | public void finalize() { 27 | if (!deleted) { 28 | GL11.glDeleteLists(displayList, 1); 29 | } 30 | } 31 | 32 | /** 33 | * Sets the display list 34 | * @param in The display list 35 | */ 36 | public void setDisplayList(int in) { 37 | displayList = in; 38 | } 39 | 40 | /** 41 | * Gets the display list 42 | * @return The display list 43 | */ 44 | public int getDisplayList() { 45 | return displayList; 46 | } 47 | 48 | /** 49 | * Sets the last usage 50 | * @param in The last usage 51 | */ 52 | public void setLastUsage(long in) { 53 | lastUsage = in; 54 | } 55 | 56 | /** 57 | * Gets the last usage 58 | * @return The last usage 59 | */ 60 | public long getLastUsage() { 61 | return lastUsage; 62 | } 63 | 64 | /** 65 | * Marks this cache as deleted 66 | */ 67 | public void delete() { 68 | deleted = true; 69 | } 70 | 71 | /** 72 | * Checks if this cache has been deleted 73 | * @return Whether this cache has been deleted 74 | */ 75 | public boolean isDeleted() { 76 | return deleted; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/util/Wrapper.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.util; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import net.minecraft.client.Minecraft; 5 | import org.apache.logging.log4j.LogManager; 6 | import org.apache.logging.log4j.Logger; 7 | 8 | /** 9 | * @author bon55, linustouchtips 10 | * @since 05/13/2021 11 | */ 12 | public interface Wrapper { 13 | 14 | // minecraft instance 15 | Minecraft mc = Minecraft.getMinecraft(); 16 | 17 | /** 18 | * Checks if the world and the player are not null (usually unsafe to run operations if these are null) 19 | * @return Whether the world and the player are not null 20 | */ 21 | default boolean nullCheck() { 22 | return mc.player != null && mc.world != null; 23 | } 24 | 25 | /** 26 | * Gets the client instance 27 | * @return The client instance 28 | */ 29 | default Cosmos getCosmos() { 30 | return Cosmos.INSTANCE; 31 | } 32 | 33 | /** 34 | * Gets the logger instance 35 | * @return The logger instance 36 | */ 37 | default Logger getLogger() { 38 | return LogManager.getLogger(Cosmos.NAME + " | " + Cosmos.VERSION); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/util/chat/ChatBuilder.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.util.chat; 2 | 3 | import cope.cosmos.util.Wrapper; 4 | import net.minecraft.util.text.ITextComponent; 5 | import net.minecraft.util.text.Style; 6 | import net.minecraft.util.text.TextComponentString; 7 | 8 | /** 9 | * @author milse113 10 | * @since 05/26/2021 11 | */ 12 | public class ChatBuilder implements Wrapper { 13 | 14 | // chat component 15 | private final ITextComponent textComponent = new TextComponentString(""); 16 | 17 | /** 18 | * Appends a message to the text component 19 | * @param message The message 20 | * @param style The style of the text 21 | * @return The current chat builder 22 | */ 23 | public ChatBuilder append(String message, Style style) { 24 | textComponent.appendSibling(new TextComponentString(message).setStyle(style)); 25 | return this; 26 | } 27 | 28 | /** 29 | * Sends the message to the chat 30 | */ 31 | public void push() { 32 | mc.player.sendMessage(textComponent); 33 | } 34 | 35 | /** 36 | * Gets the current chat component 37 | * @return The current chat component 38 | */ 39 | public ITextComponent component() { 40 | return textComponent; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/util/chat/ChatUtil.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.util.chat; 2 | 3 | /** 4 | * @author bon55 5 | * @since 05/05/2021 6 | */ 7 | public class ChatUtil { 8 | 9 | /** 10 | * Gets the client chat prefix 11 | * @return The client chat prefix 12 | */ 13 | public static String getPrefix() { 14 | return " "; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/util/combat/DamageUtil.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.util.combat; 2 | 3 | import cope.cosmos.util.Wrapper; 4 | import net.minecraft.world.World; 5 | 6 | /** 7 | * Calculates general damages 8 | * @author aesthetical, linustouchtips 9 | * @since 3/19/22 10 | */ 11 | public class DamageUtil implements Wrapper { 12 | 13 | /** 14 | * Gets the scaled damage based off of the difficulty 15 | * @param damage Damage done 16 | * @return The scaled damage based off of the difficulty 17 | */ 18 | public static float getScaledDamage(float damage) { 19 | World world = mc.world; 20 | if (world == null) { 21 | return damage; 22 | } 23 | 24 | // scale damage based on difficulty 25 | switch (mc.world.getDifficulty()) { 26 | case PEACEFUL: 27 | return 0; 28 | case EASY: 29 | return Math.min(damage / 2.0F + 1.0F, damage); 30 | case NORMAL: 31 | default: 32 | return damage; 33 | case HARD: 34 | return damage * 3.0F / 2.0F; 35 | } 36 | } 37 | 38 | /** 39 | * Checks whether the player can actually take damage 40 | * @return Whether the player can actually take damage 41 | */ 42 | public static boolean canTakeDamage() { 43 | return !mc.player.capabilities.isCreativeMode; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/util/entity/InterpolationUtil.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.util.entity; 2 | 3 | import cope.cosmos.util.Wrapper; 4 | import net.minecraft.entity.Entity; 5 | import net.minecraft.util.math.Vec3d; 6 | 7 | /** 8 | * @author linustouchtips 9 | * @since 05/08/2021 10 | */ 11 | public class InterpolationUtil implements Wrapper { 12 | 13 | /** 14 | * Gets the interpolated position of an entity (i.e. position based on render ticks) 15 | * @param entity The entity to get the position for 16 | * @param ticks The render ticks 17 | * @return The interpolated vector of an entity 18 | */ 19 | public static Vec3d getInterpolatedPosition(Entity entity, float ticks) { 20 | return new Vec3d(entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ) 21 | .add(new Vec3d(entity.posX - entity.lastTickPosX, entity.posY - entity.lastTickPosY, entity.posZ - entity.lastTickPosZ) 22 | .scale(ticks) 23 | ); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/util/render/FontUtil.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.util.render; 2 | 3 | import cope.cosmos.client.Cosmos; 4 | import cope.cosmos.client.features.modules.client.FontModule; 5 | import cope.cosmos.util.Wrapper; 6 | 7 | /** 8 | * @author linustouchtips 9 | * @since 04/18/2021 10 | */ 11 | public class FontUtil implements Wrapper { 12 | 13 | /** 14 | * Renders a given text 15 | * @param text The given text 16 | * @param x The x position 17 | * @param y The y position 18 | * @param color The color of the text 19 | * @return The color of the text 20 | */ 21 | public static int drawString(String text, float x, float y, int color) { 22 | return FontModule.INSTANCE.isEnabled() ? Cosmos.INSTANCE.getFontManager().getFontRenderer().drawString(text, x, y, color, false, FontModule.antiAlias.getValue()) : mc.fontRenderer.drawString(text, (int) x, (int) y, color); 23 | } 24 | 25 | /** 26 | * Renders a given text with a shadow 27 | * @param text The given text 28 | * @param x The x position 29 | * @param y The y position 30 | * @param color The color of the text 31 | * @return The color of the text 32 | */ 33 | public static int drawStringWithShadow(String text, float x, float y, int color) { 34 | return FontModule.INSTANCE.isEnabled() ? Cosmos.INSTANCE.getFontManager().getFontRenderer().drawStringWithShadow(text, x, y, color, FontModule.antiAlias.getValue()) : mc.fontRenderer.drawStringWithShadow(text, x, y, color); 35 | } 36 | 37 | /** 38 | * Gets a given text's width 39 | * @param text The given text 40 | * @return The given text's width 41 | */ 42 | public static int getStringWidth(String text) { 43 | return FontModule.INSTANCE.isEnabled() ? Cosmos.INSTANCE.getFontManager().getFontRenderer().getStringWidth(text) : mc.fontRenderer.getStringWidth(text); 44 | } 45 | 46 | /** 47 | * Gets the current font's height 48 | * @return The current font's height 49 | */ 50 | public static float getFontHeight() { 51 | return mc.fontRenderer.FONT_HEIGHT; 52 | } 53 | } -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/util/world/RaytraceUtil.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.util.world; 2 | 3 | import cope.cosmos.util.Wrapper; 4 | import net.minecraft.entity.Entity; 5 | import net.minecraft.util.math.BlockPos; 6 | import net.minecraft.util.math.Vec3d; 7 | 8 | /** 9 | * @author linustouchtips 10 | * @since 05/07/2021 11 | */ 12 | public class RaytraceUtil implements Wrapper { 13 | 14 | /** 15 | * Finds the visibility to a block 16 | * @param position The block to check 17 | * @param offset The NCP range bypass offset 18 | * @return The visibility to the block 19 | */ 20 | public static boolean isNotVisible(BlockPos position, double offset) { 21 | if (offset > 50 || offset < -50) { 22 | return false; 23 | } 24 | 25 | return mc.world.rayTraceBlocks(new Vec3d(mc.player.posX, mc.player.posY + mc.player.getEyeHeight(), mc.player.posZ), new Vec3d(position.getX() + 0.5, position.getY() + offset, position.getZ() + 0.5), false, true, false) != null; 26 | } 27 | 28 | /** 29 | * Finds the visibility to an entity 30 | * @param entity The entity to check 31 | * @param offset The NCP range bypass offset 32 | * @return The visibility to the entity 33 | */ 34 | public static boolean isNotVisible(Entity entity, double offset) { 35 | if (offset > 50 || offset < -50) { 36 | return false; 37 | } 38 | 39 | return mc.world.rayTraceBlocks(new Vec3d(mc.player.posX, mc.player.posY + mc.player.getEyeHeight(), mc.player.posZ), new Vec3d(entity.posX, entity.posY + offset, entity.posZ), false, true, false) != null; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/util/world/SneakBlocks.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.util.world; 2 | 3 | import net.minecraft.block.Block; 4 | import net.minecraft.init.Blocks; 5 | 6 | import java.util.Arrays; 7 | import java.util.List; 8 | 9 | /** 10 | * @author linustouchtips 11 | * @since 08/22/2022 12 | */ 13 | public class SneakBlocks { 14 | 15 | // list of blocks which need to be shift clicked to be placed on 16 | private static final List shiftBlocks = Arrays.asList( 17 | Blocks.ENDER_CHEST, 18 | Blocks.CHEST, 19 | Blocks.TRAPPED_CHEST, 20 | Blocks.CRAFTING_TABLE, 21 | Blocks.ANVIL, // :troll: 22 | Blocks.BREWING_STAND, 23 | Blocks.HOPPER, 24 | Blocks.DROPPER, 25 | Blocks.DISPENSER, 26 | Blocks.TRAPDOOR, 27 | Blocks.ENCHANTING_TABLE, 28 | Blocks.WHITE_SHULKER_BOX, 29 | Blocks.ORANGE_SHULKER_BOX, 30 | Blocks.MAGENTA_SHULKER_BOX, 31 | Blocks.LIGHT_BLUE_SHULKER_BOX, 32 | Blocks.YELLOW_SHULKER_BOX, 33 | Blocks.LIME_SHULKER_BOX, 34 | Blocks.PINK_SHULKER_BOX, 35 | Blocks.GRAY_SHULKER_BOX, 36 | Blocks.SILVER_SHULKER_BOX, 37 | Blocks.CYAN_SHULKER_BOX, 38 | Blocks.PURPLE_SHULKER_BOX, 39 | Blocks.BLUE_SHULKER_BOX, 40 | Blocks.BROWN_SHULKER_BOX, 41 | Blocks.GREEN_SHULKER_BOX, 42 | Blocks.RED_SHULKER_BOX, 43 | Blocks.BLACK_SHULKER_BOX 44 | // Blocks.COMMAND_BLOCK, 45 | // Blocks.CHAIN_COMMAND_BLOCK 46 | ); 47 | 48 | /** 49 | * Checks if the shift blocks list contains a given block 50 | * @param in The block to check 51 | * @return Whether the shift blocks list contains a given block 52 | */ 53 | public static boolean contains(Block in) { 54 | return shiftBlocks.contains(in); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/cope/cosmos/util/world/WorldUtil.java: -------------------------------------------------------------------------------- 1 | package cope.cosmos.util.world; 2 | 3 | import cope.cosmos.util.Wrapper; 4 | import net.minecraft.entity.player.EntityPlayer; 5 | 6 | /** 7 | * @author linustouchtips 8 | * @since 08/31/2022 9 | */ 10 | public class WorldUtil implements Wrapper { 11 | 12 | /** 13 | * Checks if a given player is a fakeplayer 14 | * @param in The given player 15 | * @return Whether the given player is a fakeplayer 16 | */ 17 | public static boolean isFakePlayer(EntityPlayer in) { 18 | 19 | // make sure the connection exists 20 | if (mc.getConnection() != null) { 21 | 22 | // check if player connection exists 23 | return mc.getConnection().getPlayerInfo(in.getUniqueID()) == null && in.getEntityId() > -100; 24 | } 25 | 26 | return false; 27 | } 28 | 29 | /** 30 | * Gets the current world's name 31 | * @return The current world's name 32 | */ 33 | public static String getWorldName() { 34 | 35 | // check world name 36 | if (!mc.isSingleplayer() && mc.getCurrentServerData() != null) { 37 | 38 | // world name 39 | return mc.getCurrentServerData().serverIP; 40 | } 41 | 42 | else { 43 | 44 | // server name 45 | return mc.world.getWorldInfo().getWorldName(); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/shaders/glsl/dot.frag: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | // texture info 4 | uniform sampler2D texture; 5 | uniform vec2 texelSize; 6 | 7 | // colors and width 8 | uniform vec4 colorDot; 9 | uniform vec4 colorFilled; 10 | uniform float radius; 11 | 12 | void main(void) { 13 | // Color for the entity model 14 | vec4 centerCol = texture2D(texture, gl_TexCoord[0].xy); 15 | 16 | // If a color is already assigned (alpha value is greater than 0), we want to overwrite it 17 | if (centerCol.a > 0) { 18 | // Dots have no alpha, so use dot color every 8 vertices. The '0' can be changed to a higher number to make the dots larger 19 | if (int(gl_FragCoord.x) - (8 * int(gl_FragCoord.x / 8)) == 0 && int(gl_FragCoord.y) - (8 * int(gl_FragCoord.y / 8)) == 0) { 20 | gl_FragColor = colorDot; 21 | } 22 | // Else we'll use our fill color 23 | else { 24 | gl_FragColor = colorFilled; 25 | } 26 | } else { 27 | // Closest radius distance 28 | float closest = radius * 2.0F + 2.0F; 29 | 30 | // Radius determines the width of the shader 31 | for (float x = -radius; x <= radius; x++) { 32 | for (float y = -radius; y <= radius; y++) { 33 | 34 | // The current color of the fragment based on the texture of the entity, we'll overwrite this color 35 | vec4 currentColor = texture2D(texture, gl_TexCoord[0].xy + vec2(texelSize.x * x, texelSize.y * y)); 36 | 37 | // gl_FragColor is the current color of the fragment, we'll update it according to our uniform (custom value) 38 | if (currentColor.a > 0) { 39 | float currentDist = sqrt(x * x + y * y); 40 | 41 | if (currentDist < closest) { 42 | closest = currentDist; 43 | } 44 | } 45 | } 46 | } 47 | 48 | // Color the area 49 | gl_FragColor = vec4(colorDot.x, colorDot.y, colorDot.z, max(0, (radius - (closest - 1)) / radius));; 50 | } 51 | } -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/shaders/glsl/fill.frag: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | // texture based on the entity, uv (1 / resolution) 4 | uniform sampler2D texture; 5 | uniform vec2 texelSize; 6 | 7 | // color and width 8 | uniform vec4 color; 9 | uniform float radius; 10 | 11 | void main(void) { 12 | // Colour for the entity model, each vertex is assigned a color 13 | vec4 centerCol = texture2D(texture, gl_TexCoord[0].xy); 14 | 15 | // If a colour is already assigned, make the colour transparent 16 | if (centerCol.a > 0) { 17 | gl_FragColor = vec4(color.x, color.y, color.z, 0.5F); 18 | } 19 | 20 | else { 21 | // Closest radius distance 22 | float closest = radius * 2.0F + 2.0F; 23 | 24 | // Radius determines the width of the shader 25 | for (float x = -radius; x <= radius; x++) { 26 | for (float y = -radius; y <= radius; y++) { 27 | 28 | // The current colour of the fragment based on the texture of the entity, we'll overwrite this colour 29 | vec4 currentColor = texture2D(texture, gl_TexCoord[0].xy + vec2(texelSize.x * x, texelSize.y * y)); 30 | 31 | // gl_FragColor is the current colour of the fragment, we'll update it according to our uniform (custom value) 32 | if (currentColor.a > 0) { 33 | float currentDist = sqrt(x * x + y * y); 34 | 35 | if (currentDist < closest) { 36 | closest = currentDist; 37 | } 38 | } 39 | } 40 | } 41 | 42 | // Colour the area 43 | gl_FragColor = vec4(color.x, color.y, color.z, max(0, (radius - (closest - 1)) / radius));; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/shaders/glsl/outline.frag: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | // texture based on the entity, uv (1 / resolution) 4 | uniform sampler2D texture; 5 | uniform vec2 texelSize; 6 | 7 | // color and width 8 | uniform vec4 color; 9 | uniform float radius; 10 | 11 | void main(void) { 12 | // color for the entity model, each vertex is assigned a color 13 | vec4 centerCol = texture2D(texture, gl_TexCoord[0].xy); 14 | 15 | // if a color is already assigned (alpha value is greater than 0), we don't want to overwrite it with our shader (i.e. shader should only apply to the outline of the entity) 16 | if (centerCol.a > 0) { 17 | gl_FragColor = vec4(0, 0, 0, 0); 18 | } 19 | 20 | else { 21 | // closest radius distance 22 | float closest = radius * 2.0F + 2.0F; 23 | 24 | // radius determines the width of the shader 25 | for (float x = -radius; x <= radius; x++) { 26 | for (float y = -radius; y <= radius; y++) { 27 | 28 | // the current color of the fragment based on the texture of the entity, we'll overwrite this color 29 | vec4 currentColor = texture2D(texture, gl_TexCoord[0].xy + vec2(texelSize.x * x, texelSize.y * y)); 30 | 31 | // gl_FragColor is the current color of the fragment, we'll update it according to our uniform (custom value) 32 | if (currentColor.a > 0) { 33 | float currentDist = sqrt(x * x + y * y); 34 | 35 | if (currentDist < closest) { 36 | closest = currentDist; 37 | } 38 | } 39 | } 40 | } 41 | 42 | // color the area 43 | gl_FragColor = vec4(color.x, color.y, color.z, max(0, (radius - (closest - 1)) / radius));; 44 | } 45 | } -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/shaders/glsl/vertex.vert: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | void main(void) { 4 | gl_TexCoord[0] = gl_MultiTexCoord0; 5 | gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/shaders/minecraft/blur.json: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [ 3 | "swap" 4 | ], 5 | "passes": [ 6 | { 7 | "name": "blur", 8 | "intarget": "minecraft:main", 9 | "outtarget": "swap", 10 | "uniforms": [ 11 | { 12 | "name": "BlurDir", 13 | "values": [ 1.0, 0.0 ] 14 | }, 15 | { 16 | "name": "Radius", 17 | "values": [ 20.0 ] 18 | } 19 | ] 20 | }, 21 | { 22 | "name": "blur", 23 | "intarget": "swap", 24 | "outtarget": "minecraft:main", 25 | "uniforms": [ 26 | { 27 | "name": "BlurDir", 28 | "values": [ 0.0, 1.0 ] 29 | }, 30 | { 31 | "name": "Radius", 32 | "values": [ 20.0 ] 33 | } 34 | ] 35 | } 36 | ] 37 | } -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/textures/cape/contributor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momentumdevelopment/cosmos/398a393008a47d223c6a7a422f7c2e04454b46df/src/main/resources/assets/cosmos/textures/cape/contributor.png -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/textures/cape/normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momentumdevelopment/cosmos/398a393008a47d223c6a7a422f7c2e04454b46df/src/main/resources/assets/cosmos/textures/cape/normal.png -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/textures/icons/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momentumdevelopment/cosmos/398a393008a47d223c6a7a422f7c2e04454b46df/src/main/resources/assets/cosmos/textures/icons/back.png -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/textures/icons/cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momentumdevelopment/cosmos/398a393008a47d223c6a7a422f7c2e04454b46df/src/main/resources/assets/cosmos/textures/icons/cancel.png -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/textures/icons/client.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momentumdevelopment/cosmos/398a393008a47d223c6a7a422f7c2e04454b46df/src/main/resources/assets/cosmos/textures/icons/client.png -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/textures/icons/combat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momentumdevelopment/cosmos/398a393008a47d223c6a7a422f7c2e04454b46df/src/main/resources/assets/cosmos/textures/icons/combat.png -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/textures/icons/dots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momentumdevelopment/cosmos/398a393008a47d223c6a7a422f7c2e04454b46df/src/main/resources/assets/cosmos/textures/icons/dots.png -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/textures/icons/dropdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momentumdevelopment/cosmos/398a393008a47d223c6a7a422f7c2e04454b46df/src/main/resources/assets/cosmos/textures/icons/dropdown.png -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/textures/icons/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momentumdevelopment/cosmos/398a393008a47d223c6a7a422f7c2e04454b46df/src/main/resources/assets/cosmos/textures/icons/info.png -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/textures/icons/misc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momentumdevelopment/cosmos/398a393008a47d223c6a7a422f7c2e04454b46df/src/main/resources/assets/cosmos/textures/icons/misc.png -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/textures/icons/movement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momentumdevelopment/cosmos/398a393008a47d223c6a7a422f7c2e04454b46df/src/main/resources/assets/cosmos/textures/icons/movement.png -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/textures/icons/player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momentumdevelopment/cosmos/398a393008a47d223c6a7a422f7c2e04454b46df/src/main/resources/assets/cosmos/textures/icons/player.png -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/textures/icons/visual.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momentumdevelopment/cosmos/398a393008a47d223c6a7a422f7c2e04454b46df/src/main/resources/assets/cosmos/textures/icons/visual.png -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/textures/icons/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momentumdevelopment/cosmos/398a393008a47d223c6a7a422f7c2e04454b46df/src/main/resources/assets/cosmos/textures/icons/warning.png -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/textures/imgs/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momentumdevelopment/cosmos/398a393008a47d223c6a7a422f7c2e04454b46df/src/main/resources/assets/cosmos/textures/imgs/logo.png -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/textures/imgs/logotransparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momentumdevelopment/cosmos/398a393008a47d223c6a7a422f7c2e04454b46df/src/main/resources/assets/cosmos/textures/imgs/logotransparent.png -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/textures/imgs/logotransparentnotext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momentumdevelopment/cosmos/398a393008a47d223c6a7a422f7c2e04454b46df/src/main/resources/assets/cosmos/textures/imgs/logotransparentnotext.png -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/textures/imgs/picker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momentumdevelopment/cosmos/398a393008a47d223c6a7a422f7c2e04454b46df/src/main/resources/assets/cosmos/textures/imgs/picker.png -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/textures/imgs/spacebg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momentumdevelopment/cosmos/398a393008a47d223c6a7a422f7c2e04454b46df/src/main/resources/assets/cosmos/textures/imgs/spacebg.png -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/textures/imgs/splash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momentumdevelopment/cosmos/398a393008a47d223c6a7a422f7c2e04454b46df/src/main/resources/assets/cosmos/textures/imgs/splash.jpg -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/textures/imgs/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momentumdevelopment/cosmos/398a393008a47d223c6a7a422f7c2e04454b46df/src/main/resources/assets/cosmos/textures/imgs/splash.png -------------------------------------------------------------------------------- /src/main/resources/assets/cosmos/textures/imgs/transparentlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momentumdevelopment/cosmos/398a393008a47d223c6a7a422f7c2e04454b46df/src/main/resources/assets/cosmos/textures/imgs/transparentlogo.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/sounds/click.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momentumdevelopment/cosmos/398a393008a47d223c6a7a422f7c2e04454b46df/src/main/resources/assets/minecraft/sounds/click.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/sounds/sounds.json: -------------------------------------------------------------------------------- 1 | { 2 | "click": { 3 | "category": "player", 4 | "subtitle": "click", 5 | "sounds": [ 6 | { 7 | "name": "cosmos:click.ogg", 8 | "stream": false 9 | } 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /src/main/resources/mcmod.info: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "modid": "cosmos", 4 | "name": "Cosmos", 5 | "description": "cope", 6 | "version": "1.5.0-beta", 7 | "mcversion": "1.12.2", 8 | "url": "https://github.com/momentumdevelopment/cosmos", 9 | "updateUrl": "https://github.com/momentumdevelopment/cosmos/releases", 10 | 11 | "authorList": [ 12 | "bon55", 13 | "linustouchtips", 14 | "doctor swag", 15 | "Hoosiers", 16 | "Sxmurai", 17 | "Surge", 18 | "Gopro336", 19 | "Unfidelity/milo", 20 | "Ethius", 21 | "Doogie13", 22 | "master7720", 23 | "Spartan", 24 | "perry", 25 | "Reap", 26 | "KilabGaming", 27 | "cattyn", 28 | "CrawLeyYou", 29 | "HausemasterIssue", 30 | "Gav06" 31 | ], 32 | 33 | "credits": "Thanks to SpongePowered's Mixin, Moandjiezana's TOMLJ, Minnced's Discord RPC, Mojang's Brigadier, Litarvan's OpenAuth", 34 | "logoFile": "/assets/cosmos/textures/imgs/logotransparentnotext.png", 35 | "screenshots": [], 36 | "dependencies": [] 37 | } 38 | ] 39 | -------------------------------------------------------------------------------- /src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "cosmos resources", 4 | "pack_format": 3, 5 | "_comment": "cope" 6 | } 7 | } 8 | --------------------------------------------------------------------------------