├── .github └── workflows │ └── build.yml ├── .gitignore ├── LICENSE-GPL ├── LICENSE-LESSER ├── README.md ├── build.gradle.kts ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── root.gradle.kts ├── settings.gradle.kts ├── src ├── dummy │ └── java │ │ ├── club │ │ └── sk1er │ │ │ └── patcher │ │ │ └── config │ │ │ └── PatcherConfig.java │ │ ├── dulkirmod │ │ └── config │ │ │ ├── Config.java │ │ │ └── DulkirConfig.java │ │ └── org │ │ └── polyfrost │ │ └── damagetint │ │ └── config │ │ └── DamageTintConfig.java └── main │ ├── java │ └── org │ │ └── polyfrost │ │ └── overflowanimations │ │ ├── ModDetectorPlugin.java │ │ ├── command │ │ └── OldAnimationsCommand.java │ │ ├── config │ │ ├── ItemPositionAdvancedSettings.java │ │ └── OldAnimationsSettings.java │ │ ├── gui │ │ └── PleaseMigrateDulkirModGui.java │ │ ├── hooks │ │ ├── AnimationExportUtils.java │ │ ├── DebugCrosshairHook.java │ │ ├── DebugOverlayHook.java │ │ ├── DroppedItemHook.java │ │ ├── DulkirConfigData.java │ │ ├── HitColorHook.java │ │ ├── OverflowConfigData.java │ │ ├── PatcherConfigHook.java │ │ ├── PotionColors.java │ │ ├── SmoothSneakHook.java │ │ ├── SwingHook.java │ │ ├── TabOverlayHook.java │ │ └── TransformTypeHook.java │ │ ├── mixin │ │ ├── EntityLivingBaseMixin.java │ │ ├── EntityMixin.java │ │ ├── EntityOtherPlayerMPMixin.java │ │ ├── EntityPickupFXMixin.java │ │ ├── EntityPlayerMixin.java │ │ ├── EntityRendererMixin.java │ │ ├── ForgeHooksClientMixin.java │ │ ├── GuiIngameForgeMixin.java │ │ ├── GuiIngameMixin.java │ │ ├── GuiOverlayDebugMixin.java │ │ ├── GuiPlayerTabOverlayMixin.java │ │ ├── ItemMixin.java │ │ ├── ItemModelMesherMixin.java │ │ ├── ItemPotionMixin.java │ │ ├── ItemRendererMixin.java │ │ ├── ItemRendererMixin_CustomPositions.java │ │ ├── ItemStackMixin.java │ │ ├── LayerArmorBaseMixin.java │ │ ├── LayerArmorBaseMixin_New.java │ │ ├── LayerHeldItemMixin.java │ │ ├── MinecraftMixin.java │ │ ├── ModelBipedMixin.java │ │ ├── NetHandlerPlayClientMixin.java │ │ ├── OnlineIndicatorMixin.java │ │ ├── PlayerControllerMPMixin.java │ │ ├── PotionHelperMixin.java │ │ ├── RenderEntityItemMixin.java │ │ ├── RenderEntityItemMixin_CustomPositions.java │ │ ├── RenderFireballMixin.java │ │ ├── RenderFishMixin.java │ │ ├── RenderItemMixin.java │ │ ├── RenderSnowballMixin.java │ │ ├── RenderSnowballMixin_CustomPositions.java │ │ ├── RendererLivingEntityMixin.java │ │ ├── compat │ │ │ ├── DulkirConfigMixin.java │ │ │ └── ItemCustomizeManagerMixin.java │ │ ├── interfaces │ │ │ ├── EntityLivingBaseInvoker.java │ │ │ ├── GuiPlayerTabOverlayInvoker.java │ │ │ ├── ItemRendererInvoker.java │ │ │ ├── RenderItemInvoker.java │ │ │ └── RendererLivingEntityInvoker.java │ │ └── layers │ │ │ ├── LayerArmorBaseMixin.java │ │ │ ├── LayerCapeMixin.java │ │ │ ├── LayerEnderDragonEyesMixin.java │ │ │ ├── LayerEndermanEyesMixin.java │ │ │ ├── LayerSaddleMixin.java │ │ │ ├── LayerSheepWoolMixin.java │ │ │ ├── LayerSlimeGelMixin.java │ │ │ ├── LayerSpiderEyesMixin.java │ │ │ ├── LayerWolfCollarMixin.java │ │ │ └── RendererLivingEntityMixin.java │ │ └── util │ │ └── MathUtils.java │ ├── kotlin │ └── org │ │ └── polyfrost │ │ └── overflowanimations │ │ ├── OverflowAnimations.kt │ │ ├── hooks │ │ ├── GlintModelHook.kt │ │ └── SkullModelHook.kt │ │ └── init │ │ └── CustomModelBakery.kt │ └── resources │ ├── assets │ ├── minecraft │ │ └── textures │ │ │ └── items │ │ │ ├── skull_creeper.png │ │ │ ├── skull_skeleton.png │ │ │ ├── skull_steve.png │ │ │ ├── skull_wither.png │ │ │ └── skull_zombie.png │ └── overflowanimations │ │ └── models │ │ └── item │ │ ├── bottle_drinkable_empty.json │ │ ├── bottle_overlay.json │ │ ├── bottle_splash_empty.json │ │ ├── skull_char.json │ │ ├── skull_creeper.json │ │ ├── skull_skeleton.json │ │ ├── skull_wither.json │ │ └── skull_zombie.json │ ├── mcmod.info │ ├── mixins.overflowanimations.json │ └── overflowanimations_dark.svg └── versions └── mainProject /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | # Build Workflow 2 | 3 | name: Build 4 | 5 | on: 6 | pull_request: 7 | workflow_dispatch: 8 | push: 9 | 10 | concurrency: 11 | group: ${{ github.head_ref || format('{0}-{1}', github.ref, github.run_number) }} 12 | cancel-in-progress: true 13 | 14 | jobs: 15 | build: 16 | name: Build 17 | 18 | runs-on: ubuntu-latest 19 | 20 | steps: 21 | - name: Checkout 22 | uses: actions/checkout@v2 23 | with: 24 | fetch-depth: 0 25 | 26 | - name: Set up JDK 17 27 | uses: actions/setup-java@v2 28 | with: 29 | java-version: 17 30 | distribution: temurin 31 | cache: 'gradle' 32 | 33 | - uses: actions/cache@v2 34 | with: 35 | path: | 36 | ~/.gradle/caches 37 | ~/.gradle/wrapper 38 | **/loom-cache 39 | **/prebundled-jars 40 | key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} 41 | restore-keys: | 42 | ${{ runner.os }}-gradle- 43 | - name: Chmod Gradle 44 | run: chmod +x ./gradlew 45 | 46 | - name: Build 47 | run: ./gradlew build --no-daemon 48 | 49 | - name: Upload Build Artifacts 50 | uses: actions/upload-artifact@v2 51 | with: 52 | name: artifacts 53 | path: versions/**/build/libs/ -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # vscode 2 | .vscode 3 | 4 | # fleet 5 | .fleet 6 | 7 | # eclipse 8 | eclipse 9 | bin 10 | *.launch 11 | .settings 12 | .metadata 13 | .classpath 14 | .project 15 | 16 | # idea 17 | out 18 | classes 19 | *.ipr 20 | *.iws 21 | *.iml 22 | .idea 23 | 24 | # gradle 25 | build 26 | .gradle 27 | 28 | #Netbeans 29 | .nb-gradle 30 | .nb-gradle-properties 31 | 32 | # other 33 | run 34 | .DS_Store 35 | Thumbs.db 36 | 37 | .mixin.out 38 | -------------------------------------------------------------------------------- /LICENSE-LESSER: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Overflow Animations V2 2 | 3 | ![Compact Powered by OneConfig](https://polyfrost.org/img/compact_vector.svg) 4 | ![Dev Workflow Status](https://img.shields.io/github/v/release/Polyfrost/OverflowAnimationsV2.svg?style=for-the-badge&color=1452cc&label=release) 5 | 6 | ## [Download (Modrinth)](https://modrinth.com/mod/animations) 7 | 8 | Extremely precise and advanced old animations mod for 1.8.9. 9 | 10 | Originally a fork of Sk1erLLC's OldAnimations mod, it has turned into a much larger mod with essentially full 1.7 parity, animations from ancient and modern Minecraft, custom animations, and much more! 11 | 12 | # Features 13 | 14 |
15 | All features from Sk1er's Old Animations Mod (1.7 Animations) 16 | 17 | * Old Eating 18 | * Old Rod Position 19 | * Old Bow Position 20 | * Old Blockhitting 21 | * Old Swing Animation 22 | * Old Sneak Animation 23 | * Armor turning red when hit 24 | * Old health 25 | * Old blocking 26 | * Old item held 27 | * Punching a block while doing stuff 28 | * 1.7 Debug 29 | * Old Eating Animation 30 | 31 | *The "Old Debug Hitbox" feature has been removed as [PolyHitbox](https://github.com/Polyfrost/PolyHitbox) has the same functionality.* 32 | 33 |
34 | 35 |
36 | Additional features from 1.7 37 | 38 | * Old 2D/Fast Dropped Items 39 | * Accurate First/Third Person Item Positions 40 | * Old Held Item Lighting 41 | * Old Projectiles 42 | * Old Item Pickup Animation 43 | * Old Debug and Tab Menu Styles 44 | * Replace cast fishing rod texture with the texture of a stick! 45 | * More features not seen in other old animation mods! 46 | 47 |
48 | 49 |
50 | Modern animations 51 | 52 | * Modern Armor Enchantment Glint 53 | * Show Bow Pullback / Fishing Cast GUI Animation 54 | * Modern Backwards Walk Animation 55 | 56 |
57 | 58 |
59 | Bug Fixes 60 | 61 | * Head Yaw Fixes (Fixes MC-105139) 62 | * Block Breaking Fixes (Fixes MC-255057) 63 | 64 |
65 | 66 |
67 | Quality of Life 68 | 69 | * Disable Hurt Camera Shake 70 | * Allow Particles to No-Clip 71 | * Allow Punching the Ground in Adventure Mode 72 | * Old Lunar/CheatBreaker Block-Hit Position 73 | 74 |
75 | 76 | ## Custom Item Properties 77 | ###### Includes Custom Positions for: Swing, Eating/Drinking, Sword Block, Dropped Items, Projectiles, Fireballs, and the Fishing Rod Line. 78 | 79 |
80 | Customization of Item Postions 81 | 82 | * Custom Item X Position 83 | * Custom Item Y Position 84 | * Custom Item Z Position 85 | * Custom Item Rotation Yaw 86 | * Custom Item Rotation Pitch 87 | * Custom Item Rotation Roll 88 | * Custom Item Scale 89 | 90 |
91 | 92 | 93 |
94 | Customization of Item Swing Speed 95 | 96 | * Ignore Mining Fatigue Slowness 97 | * Custom Mining Fatigue Speed 98 | * Ignore Haste Speed 99 | * Custom Haste Speed 100 | 101 |
102 | 103 |
104 | Customization of Item Re-equip Animation 105 | 106 | * Disable Item Re-equip Animation 107 | * Item Re-equip Animation Speed 108 | * Only Play Re-equip Animation Upon Switching Slots 109 | 110 |
111 | 112 | ## Licensing 113 | 114 | This mod is currently licensed under version 3 of the GNU Lesser General Public License. 115 | 116 | #### Trademark usage 117 | 118 | The GNU LGPL does not grant any license or rights to use Polyfrost or OneConfig trademarks and logos for publicity purposes without written authorization. You may use these trademarks, however, to describe the origin of the mod, or under fair use. 119 | 120 | #### Contribution licensing 121 | 122 | Contributions to this repository will be automatically licensed under the licensing for the repository at that time (currently version 3 of the LGPL), as defined in Subsection D6 of the GitHub Terms of Service. If you wish to license your contributions to another LGPL-compatible license, please let us know prior. 123 | 124 | ## Links and support 125 | * Did you run into a bug? [Open a bug report](https://polyfrost.org/discord) 126 | * Have a feature idea? [Join our discord community](https://polyfrost.org/discord) 127 | -------------------------------------------------------------------------------- /build.gradle.kts: -------------------------------------------------------------------------------- 1 | @file:Suppress("UnstableApiUsage", "PropertyName") 2 | 3 | import org.polyfrost.gradle.util.noServerRunConfigs 4 | import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar 5 | 6 | // Adds support for kotlin, and adds the Polyfrost Gradle Toolkit 7 | // which we use to prepare the environment. 8 | plugins { 9 | kotlin("jvm") 10 | id("org.polyfrost.multi-version") 11 | id("org.polyfrost.defaults.repo") 12 | id("org.polyfrost.defaults.java") 13 | id("org.polyfrost.defaults.loom") 14 | id("com.github.johnrengelman.shadow") 15 | id("net.kyori.blossom") version "1.3.2" 16 | id("signing") 17 | java 18 | } 19 | 20 | // Gets the mod name, version and id from the `gradle.properties` file. 21 | val mod_name: String by project 22 | val mod_version: String by project 23 | val mod_id: String by project 24 | val mod_archives_name: String by project 25 | 26 | // Replaces the variables in `ExampleMod.java` to the ones specified in `gradle.properties`. 27 | blossom { 28 | replaceToken("@VER@", mod_version) 29 | replaceToken("@NAME@", mod_name) 30 | replaceToken("@ID@", mod_id) 31 | } 32 | 33 | // Sets the mod version to the one specified in `gradle.properties`. Make sure to change this following semver! 34 | version = mod_version 35 | // Sets the group, make sure to change this to your own. It can be a website you own backwards or your GitHub username. 36 | // e.g. com.github. or com. 37 | group = "org.polyfrost" 38 | 39 | // Sets the name of the output jar (the one you put in your mods folder and send to other people) 40 | // It outputs all versions of the mod into the `build` directory. 41 | base { 42 | archivesName.set("$mod_archives_name-$platform") 43 | } 44 | 45 | // Configures the Polyfrost Loom, our plugin fork to easily set up the programming environment. 46 | loom { 47 | // Removes the server configs from IntelliJ IDEA, leaving only client runs. 48 | // If you're developing a server-side mod, you can remove this line. 49 | noServerRunConfigs() 50 | 51 | // Adds the tweak class if we are building legacy version of forge as per the documentation (https://docs.polyfrost.org) 52 | if (project.platform.isLegacyForge) { 53 | runConfigs { 54 | "client" { 55 | programArgs("--tweakClass", "cc.polyfrost.oneconfig.loader.stage0.LaunchWrapperTweaker") 56 | property("fml.coreMods.load", "org.polyfrost.overflowanimations.ModDetectorPlugin") 57 | property("mixin.debug.export", "true") 58 | } 59 | } 60 | } 61 | // Configures the mixins if we are building for forge, useful for when we are dealing with cross-platform projects. 62 | if (project.platform.isForge) { 63 | forge { 64 | mixinConfig("mixins.${mod_id}.json") 65 | } 66 | } 67 | // Configures the name of the mixin "refmap" using an experimental loom api. 68 | mixin.defaultRefmapName.set("mixins.${mod_id}.refmap.json") 69 | } 70 | 71 | // Creates the shade/shadow configuration, so we can include libraries inside our mod, rather than having to add them separately. 72 | val shade: Configuration by configurations.creating { 73 | configurations.implementation.get().extendsFrom(this) 74 | } 75 | 76 | // Configures the output directory for when building from the `src/resources` directory. 77 | sourceSets { 78 | val dummy by creating 79 | main { 80 | dummy.compileClasspath += compileClasspath 81 | compileClasspath += dummy.output 82 | output.setResourcesDir(java.classesDirectory) 83 | } 84 | } 85 | 86 | // Adds the Polyfrost maven repository so that we can get the libraries necessary to develop the mod. 87 | repositories { 88 | maven("https://repo.polyfrost.org/releases") 89 | } 90 | 91 | // Configures the libraries/dependencies for your mod. 92 | dependencies { 93 | // Adds the OneConfig library, so we can develop with it. 94 | modCompileOnly("cc.polyfrost:oneconfig-$platform:0.2.2-alpha+") 95 | 96 | modRuntimeOnly("me.djtheredstoner:DevAuth-${if (platform.isFabric) "fabric" else if (platform.isLegacyForge) "forge-legacy" else "forge-latest"}:1.1.2") 97 | 98 | // If we are building for legacy forge, includes the launch wrapper with `shade` as we configured earlier. 99 | if (platform.isLegacyForge) { 100 | compileOnly("org.spongepowered:mixin:0.7.11-SNAPSHOT") 101 | shade("cc.polyfrost:oneconfig-wrapper-launchwrapper:1.0.0-beta17") 102 | } 103 | } 104 | 105 | tasks { 106 | // Processes the `src/resources/mcmod.info or fabric.mod.json` and replaces 107 | // the mod id, name and version with the ones in `gradle.properties` 108 | processResources { 109 | inputs.property("id", mod_id) 110 | inputs.property("name", mod_name) 111 | val java = if (project.platform.mcMinor >= 18) { 112 | 17 // If we are playing on version 1.18, set the java version to 17 113 | } else { 114 | // Else if we are playing on version 1.17, use java 16. 115 | if (project.platform.mcMinor == 17) 116 | 16 117 | else 118 | 8 // For all previous versions, we **need** java 8 (for Forge support). 119 | } 120 | val compatLevel = "JAVA_${java}" 121 | inputs.property("java", java) 122 | inputs.property("java_level", compatLevel) 123 | inputs.property("version", mod_version) 124 | inputs.property("mcVersionStr", project.platform.mcVersionStr) 125 | filesMatching(listOf("mcmod.info", "mixins.${mod_id}.json", "mods.toml")) { 126 | expand( 127 | mapOf( 128 | "id" to mod_id, 129 | "name" to mod_name, 130 | "java" to java, 131 | "java_level" to compatLevel, 132 | "version" to mod_version, 133 | "mcVersionStr" to project.platform.mcVersionStr 134 | ) 135 | ) 136 | } 137 | filesMatching("fabric.mod.json") { 138 | expand( 139 | mapOf( 140 | "id" to mod_id, 141 | "name" to mod_name, 142 | "java" to java, 143 | "java_level" to compatLevel, 144 | "version" to mod_version, 145 | "mcVersionStr" to project.platform.mcVersionStr.substringBeforeLast(".") + ".x" 146 | ) 147 | ) 148 | } 149 | } 150 | 151 | // Configures the resources to include if we are building for forge or fabric. 152 | withType(Jar::class.java) { 153 | if (project.platform.isFabric) { 154 | exclude("mcmod.info", "mods.toml") 155 | } else { 156 | exclude("fabric.mod.json") 157 | if (project.platform.isLegacyForge) { 158 | exclude("mods.toml") 159 | } else { 160 | exclude("mcmod.info") 161 | } 162 | } 163 | } 164 | 165 | // Configures our shadow/shade configuration, so we can 166 | // include some dependencies within our mod jar file. 167 | named("shadowJar") { 168 | archiveClassifier.set("dev") // TODO: machete gets confused by the `dev` prefix. 169 | configurations = listOf(shade) 170 | duplicatesStrategy = DuplicatesStrategy.EXCLUDE 171 | } 172 | 173 | remapJar { 174 | inputFile.set(shadowJar.get().archiveFile) 175 | archiveClassifier.set("") 176 | } 177 | 178 | jar { 179 | // Sets the jar manifest attributes. 180 | if (platform.isLegacyForge) { 181 | manifest.attributes += mapOf( 182 | "ModSide" to "CLIENT", // We aren't developing a server-side mod, so this is fine. 183 | "ForceLoadAsMod" to true, // We want to load this jar as a mod, so we force Forge to do so. 184 | "FMLCorePluginContainsFMLMod" to "Yes, yes it does", 185 | "FMLCorePlugin" to "org.polyfrost.overflowanimations.ModDetectorPlugin", 186 | "TweakOrder" to "0", // Makes sure that the OneConfig launch wrapper is loaded as soon as possible. 187 | "MixinConfigs" to "mixins.${mod_id}.json", // We want to use our mixin configuration, so we specify it here. 188 | "TweakClass" to "cc.polyfrost.oneconfig.loader.stage0.LaunchWrapperTweaker" // Loads the OneConfig launch wrapper. 189 | ) 190 | } 191 | dependsOn(shadowJar) 192 | archiveClassifier.set("") 193 | enabled = false 194 | } 195 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | mod_name = OverflowAnimations 2 | mod_id = overflowanimations 3 | mod_version = 2.2.5 4 | mod_archives_name=OverflowAnimations 5 | 6 | # Gradle Configuration -- DO NOT TOUCH THESE VALUES. 7 | polyfrost.defaults.loom=3 8 | org.gradle.daemon=true 9 | org.gradle.parallel=true 10 | org.gradle.configureoncommand=true 11 | org.gradle.parallel.threads=4 12 | org.gradle.jvmargs=-Xmx2G -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Polyfrost/OverflowAnimationsV2/5b95a9f8c3c7198aa461f19854914b9d2442fa26/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-8.8-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME% 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38 | 39 | @rem Find java.exe 40 | if defined JAVA_HOME goto findJavaFromJavaHome 41 | 42 | set JAVA_EXE=java.exe 43 | %JAVA_EXE% -version >NUL 2>&1 44 | if %ERRORLEVEL% equ 0 goto execute 45 | 46 | echo. 1>&2 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 48 | echo. 1>&2 49 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 50 | echo location of your Java installation. 1>&2 51 | 52 | goto fail 53 | 54 | :findJavaFromJavaHome 55 | set JAVA_HOME=%JAVA_HOME:"=% 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57 | 58 | if exist "%JAVA_EXE%" goto execute 59 | 60 | echo. 1>&2 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 62 | echo. 1>&2 63 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 64 | echo location of your Java installation. 1>&2 65 | 66 | goto fail 67 | 68 | :execute 69 | @rem Setup the command line 70 | 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 72 | 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if %ERRORLEVEL% equ 0 goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | set EXIT_CODE=%ERRORLEVEL% 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 87 | exit /b %EXIT_CODE% 88 | 89 | :mainEnd 90 | if "%OS%"=="Windows_NT" endlocal 91 | 92 | :omega 93 | -------------------------------------------------------------------------------- /root.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | kotlin("jvm") version "1.9.10" apply false 3 | id("org.polyfrost.multi-version.root") 4 | id("com.github.johnrengelman.shadow") version "8.1.1" apply false 5 | } 6 | 7 | preprocess { 8 | "1.8.9-forge"(10809, "srg") {} 9 | } -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | @file:Suppress("PropertyName") 2 | 3 | pluginManagement { 4 | repositories { 5 | gradlePluginPortal() 6 | mavenCentral() 7 | maven("https://repo.polyfrost.org/releases") // Adds the Polyfrost maven repository to get Polyfrost Gradle Toolkit 8 | } 9 | plugins { 10 | val pgtVersion = "0.6.5" // Sets the default versions for Polyfrost Gradle Toolkit 11 | id("org.polyfrost.multi-version.root") version pgtVersion 12 | } 13 | } 14 | 15 | plugins { 16 | id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.+" 17 | } 18 | 19 | val mod_name: String by settings 20 | 21 | // Configures the root project Gradle name based on the value in `gradle.properties` 22 | rootProject.name = mod_name 23 | rootProject.buildFileName = "root.gradle.kts" 24 | 25 | // Adds all of our build target versions to the classpath if we need to add version-specific code. 26 | listOf( 27 | "1.8.9-forge" 28 | ).forEach { version -> 29 | include(":$version") 30 | project(":$version").apply { 31 | projectDir = file("versions/$version") 32 | buildFileName = "../../build.gradle.kts" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/dummy/java/club/sk1er/patcher/config/PatcherConfig.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.config; 2 | 3 | public class PatcherConfig { 4 | 5 | public static boolean parallaxFix; 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/dummy/java/dulkirmod/config/Config.java: -------------------------------------------------------------------------------- 1 | package dulkirmod.config; 2 | 3 | public class Config { 4 | public static final Config INSTANCE = new Config(); 5 | 6 | private static boolean customAnimations; 7 | private static float customSize; 8 | private static boolean doesScaleSwing; 9 | private static float customX; 10 | private static float customY; 11 | private static float customZ; 12 | private static float customYaw; 13 | private static float customPitch; 14 | private static float customRoll; 15 | private static float customSpeed; 16 | private static boolean ignoreHaste; 17 | private static int drinkingSelector; 18 | 19 | public final boolean getCustomAnimations() { 20 | return customAnimations; 21 | } 22 | 23 | public final void setCustomAnimations(boolean bl) { 24 | customAnimations = bl; 25 | } 26 | 27 | public final float getCustomSize() { 28 | return customSize; 29 | } 30 | 31 | public final void setCustomSize(float f) { 32 | customSize = f; 33 | } 34 | 35 | public final boolean getDoesScaleSwing() { 36 | return doesScaleSwing; 37 | } 38 | 39 | public final void setDoesScaleSwing(boolean bl) { 40 | doesScaleSwing = bl; 41 | } 42 | 43 | public final float getCustomX() { 44 | return customX; 45 | } 46 | 47 | public final void setCustomX(float f) { 48 | customX = f; 49 | } 50 | 51 | public final float getCustomY() { 52 | return customY; 53 | } 54 | 55 | public final void setCustomY(float f) { 56 | customY = f; 57 | } 58 | 59 | public final float getCustomZ() { 60 | return customZ; 61 | } 62 | 63 | public final void setCustomZ(float f) { 64 | customZ = f; 65 | } 66 | 67 | public final float getCustomYaw() { 68 | return customYaw; 69 | } 70 | 71 | public final void setCustomYaw(float f) { 72 | customYaw = f; 73 | } 74 | 75 | public final float getCustomPitch() { 76 | return customPitch; 77 | } 78 | 79 | public final void setCustomPitch(float f) { 80 | customPitch = f; 81 | } 82 | 83 | public final float getCustomRoll() { 84 | return customRoll; 85 | } 86 | 87 | public final void setCustomRoll(float f) { 88 | customRoll = f; 89 | } 90 | 91 | public final float getCustomSpeed() { 92 | return customSpeed; 93 | } 94 | 95 | public final void setCustomSpeed(float f) { 96 | customSpeed = f; 97 | } 98 | 99 | public final boolean getIgnoreHaste() { 100 | return ignoreHaste; 101 | } 102 | 103 | public final void setIgnoreHaste(boolean bl) { 104 | ignoreHaste = bl; 105 | } 106 | 107 | public final int getDrinkingSelector() { 108 | return drinkingSelector; 109 | } 110 | 111 | public final void setDrinkingSelector(int n) { 112 | drinkingSelector = n; 113 | } 114 | 115 | public final void demoButton() {} 116 | } 117 | -------------------------------------------------------------------------------- /src/dummy/java/dulkirmod/config/DulkirConfig.java: -------------------------------------------------------------------------------- 1 | package dulkirmod.config; 2 | 3 | public class DulkirConfig { 4 | public static final DulkirConfig INSTANCE = new DulkirConfig(); 5 | private static boolean customAnimations; 6 | private static float customSize; 7 | private static boolean doesScaleSwing; 8 | private static float customX; 9 | private static float customY; 10 | private static float customZ; 11 | private static float customYaw; 12 | private static float customPitch; 13 | private static float customRoll; 14 | private static float customSpeed; 15 | private static boolean ignoreHaste; 16 | private static int drinkingSelector; 17 | 18 | public final boolean getCustomAnimations() { 19 | return customAnimations; 20 | } 21 | 22 | public final void setCustomAnimations(boolean bl) { 23 | customAnimations = bl; 24 | } 25 | 26 | public final float getCustomSize() { 27 | return customSize; 28 | } 29 | 30 | public final void setCustomSize(float f) { 31 | customSize = f; 32 | } 33 | 34 | public final boolean getDoesScaleSwing() { 35 | return doesScaleSwing; 36 | } 37 | 38 | public final void setDoesScaleSwing(boolean bl) { 39 | doesScaleSwing = bl; 40 | } 41 | 42 | public final float getCustomX() { 43 | return customX; 44 | } 45 | 46 | public final void setCustomX(float f) { 47 | customX = f; 48 | } 49 | 50 | public final float getCustomY() { 51 | return customY; 52 | } 53 | 54 | public final void setCustomY(float f) { 55 | customY = f; 56 | } 57 | 58 | public final float getCustomZ() { 59 | return customZ; 60 | } 61 | 62 | public final void setCustomZ(float f) { 63 | customZ = f; 64 | } 65 | 66 | public final float getCustomYaw() { 67 | return customYaw; 68 | } 69 | 70 | public final void setCustomYaw(float f) { 71 | customYaw = f; 72 | } 73 | 74 | public final float getCustomPitch() { 75 | return customPitch; 76 | } 77 | 78 | public final void setCustomPitch(float f) { 79 | customPitch = f; 80 | } 81 | 82 | public final float getCustomRoll() { 83 | return customRoll; 84 | } 85 | 86 | public final void setCustomRoll(float f) { 87 | customRoll = f; 88 | } 89 | 90 | public final float getCustomSpeed() { 91 | return customSpeed; 92 | } 93 | 94 | public final void setCustomSpeed(float f) { 95 | customSpeed = f; 96 | } 97 | 98 | public final boolean getIgnoreHaste() { 99 | return ignoreHaste; 100 | } 101 | 102 | public final void setIgnoreHaste(boolean bl) { 103 | ignoreHaste = bl; 104 | } 105 | 106 | public final int getDrinkingSelector() { 107 | return drinkingSelector; 108 | } 109 | 110 | public final void setDrinkingSelector(int n) { 111 | drinkingSelector = n; 112 | } 113 | 114 | public final void demoButton() {} 115 | } 116 | -------------------------------------------------------------------------------- /src/dummy/java/org/polyfrost/damagetint/config/DamageTintConfig.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.damagetint.config; 2 | 3 | import cc.polyfrost.oneconfig.config.core.OneColor; 4 | 5 | public class DamageTintConfig { 6 | 7 | public static OneColor color; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/ModDetectorPlugin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations; 2 | 3 | import com.google.gson.JsonObject; 4 | import com.google.gson.JsonParser; 5 | import com.google.gson.stream.MalformedJsonException; 6 | import net.minecraft.launchwrapper.Launch; 7 | import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin; 8 | 9 | import javax.swing.*; 10 | import java.io.File; 11 | import java.io.InputStream; 12 | import java.lang.reflect.Method; 13 | import java.util.Map; 14 | import java.util.zip.ZipEntry; 15 | import java.util.zip.ZipFile; 16 | 17 | public class ModDetectorPlugin implements IFMLLoadingPlugin { 18 | 19 | public ModDetectorPlugin() { 20 | try { 21 | File modsFolder = new File(Launch.minecraftHome, "mods"); 22 | File[] modFolder = modsFolder.listFiles((dir, name) -> name.endsWith(".jar")); 23 | if (modFolder != null) { 24 | final JsonParser PARSER = new JsonParser(); 25 | File oldFile = null; 26 | for (File file : modFolder) { 27 | try { 28 | try (ZipFile mod = new ZipFile(file)) { 29 | ZipEntry entry = mod.getEntry("mcmod.info"); 30 | if (entry != null) { 31 | try (InputStream inputStream = mod.getInputStream(entry)) { 32 | byte[] availableBytes = new byte[inputStream.available()]; 33 | inputStream.read(availableBytes, 0, inputStream.available()); 34 | JsonObject modInfo = PARSER.parse(new String(availableBytes)).getAsJsonArray().get(0).getAsJsonObject(); 35 | if (!modInfo.has("modid") || !modInfo.has("version")) { 36 | continue; 37 | } 38 | 39 | String modid = modInfo.get("modid").getAsString(); 40 | if (modid.equals("sk1er_old_animations")) { 41 | oldFile = file; 42 | break; 43 | } 44 | } 45 | } 46 | } 47 | } catch (MalformedJsonException | IllegalStateException ignored) { 48 | } catch (Exception e) { 49 | e.printStackTrace(); 50 | } 51 | } 52 | if (oldFile != null) { 53 | if (!oldFile.delete()) { 54 | oldFile.deleteOnExit(); 55 | try { 56 | UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 57 | } catch (Exception e) { 58 | e.printStackTrace(); 59 | } 60 | 61 | final JFrame frame = new JFrame(); 62 | frame.setUndecorated(true); 63 | frame.setAlwaysOnTop(true); 64 | frame.setLocationRelativeTo(null); 65 | frame.setVisible(true); 66 | 67 | JOptionPane.showMessageDialog( 68 | frame, 69 | "You have both Sk1er Old Animations and Overflow Animations installed.\n" + 70 | "Please remove Sk1er Old Animations from your mod folder, as OverflowAnimations replaces it.\n" + 71 | "It is in " + oldFile.getAbsolutePath(), 72 | "Sk1er Old Animations detected!", JOptionPane.ERROR_MESSAGE 73 | ); 74 | try { 75 | Method exit = Class.forName("java.lang.Shutdown").getDeclaredMethod("exit", int.class); 76 | exit.setAccessible(true); 77 | exit.invoke(null, 1); 78 | } catch (Exception e) { 79 | e.printStackTrace(); 80 | System.exit(1); 81 | } 82 | } else { 83 | try { 84 | UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 85 | } catch (Exception e) { 86 | e.printStackTrace(); 87 | } 88 | 89 | final JFrame frame = new JFrame(); 90 | frame.setUndecorated(true); 91 | frame.setAlwaysOnTop(true); 92 | frame.setLocationRelativeTo(null); 93 | frame.setVisible(true); 94 | 95 | JOptionPane.showMessageDialog( 96 | frame, 97 | "You had both Sk1er Old Animations and Overflow Animations installed, so Overflow Animations removed Sk1er OAM.\n" + 98 | "This is because OverflowAnimations replaces it.\n" + 99 | "Close this and restart your game.", 100 | "Sk1er Old Animations detected!", JOptionPane.ERROR_MESSAGE 101 | ); 102 | try { 103 | Method exit = Class.forName("java.lang.Shutdown").getDeclaredMethod("exit", int.class); 104 | exit.setAccessible(true); 105 | exit.invoke(null, 1); 106 | } catch (Exception e) { 107 | e.printStackTrace(); 108 | System.exit(1); 109 | } 110 | } 111 | } 112 | } 113 | 114 | } catch (Exception ignored) { 115 | 116 | } 117 | } 118 | 119 | @Override 120 | public String[] getASMTransformerClass() { 121 | return new String[0]; 122 | } 123 | 124 | @Override 125 | public String getModContainerClass() { 126 | return null; 127 | } 128 | 129 | @Override 130 | public String getSetupClass() { 131 | return null; 132 | } 133 | 134 | @Override 135 | public void injectData(Map map) { 136 | 137 | } 138 | 139 | @Override 140 | public String getAccessTransformerClass() { 141 | return null; 142 | } 143 | } -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/command/OldAnimationsCommand.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.command; 2 | 3 | import cc.polyfrost.oneconfig.utils.commands.annotations.Command; 4 | import cc.polyfrost.oneconfig.utils.commands.annotations.Main; 5 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 6 | 7 | @Command(value = "overflowanimations", aliases = {"oam", "oldanimations", "animations"}, description = "Overflow Animations") 8 | public class OldAnimationsCommand { 9 | @Main 10 | public void handle() { 11 | OldAnimationsSettings.INSTANCE.openGui(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/gui/PleaseMigrateDulkirModGui.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.gui; 2 | 3 | import cc.polyfrost.oneconfig.gui.OneConfigGui; 4 | import cc.polyfrost.oneconfig.gui.elements.BasicButton; 5 | import cc.polyfrost.oneconfig.libs.universal.UResolution; 6 | import cc.polyfrost.oneconfig.renderer.NanoVGHelper; 7 | import cc.polyfrost.oneconfig.renderer.font.Fonts; 8 | import cc.polyfrost.oneconfig.utils.InputHandler; 9 | import cc.polyfrost.oneconfig.utils.color.ColorPalette; 10 | import cc.polyfrost.oneconfig.utils.color.ColorUtils; 11 | import cc.polyfrost.oneconfig.utils.gui.GuiUtils; 12 | import cc.polyfrost.oneconfig.utils.gui.OneUIScreen; 13 | import org.polyfrost.overflowanimations.OverflowAnimations; 14 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 15 | import org.polyfrost.overflowanimations.hooks.AnimationExportUtils; 16 | 17 | public class PleaseMigrateDulkirModGui extends OneUIScreen { 18 | private static final int GRAY_800 = ColorUtils.getColor(21, 22, 23, 255); 19 | private static final int WHITE_90 = ColorUtils.getColor(255, 255, 255, 229); 20 | private static final String TRANSFER = "Transfer"; 21 | private static final String CANCEL = "Cancel"; 22 | private final BasicButton transferButton = new BasicButton( 23 | -1, 24 | 40, 25 | TRANSFER, 26 | 2, 27 | ColorPalette.PRIMARY 28 | ); 29 | private final BasicButton cancelButton = new BasicButton( 30 | -1, 31 | 40, 32 | CANCEL, 33 | 2, 34 | ColorPalette.PRIMARY_DESTRUCTIVE 35 | ); 36 | private int ticks = 0; 37 | 38 | @Override 39 | public void draw(long vg, float partialTicks, InputHandler inputHandler) { 40 | if (ticks < 10) { 41 | ticks++; 42 | if (ticks == 10) { 43 | markAsViewed(); 44 | } 45 | } 46 | if (transferButton.getWidth() == -1) { 47 | transferButton.setWidth((int) (NanoVGHelper.INSTANCE.getTextWidth(vg, TRANSFER, 14f, Fonts.MEDIUM) + 40)); 48 | transferButton.setClickAction(() -> { 49 | markAsViewed(); 50 | AnimationExportUtils.transferDulkirConfig(); 51 | GuiUtils.displayScreen(null); 52 | }); 53 | } 54 | if (cancelButton.getWidth() == -1) { 55 | cancelButton.setWidth((int) (NanoVGHelper.INSTANCE.getTextWidth(vg, CANCEL, 14f, Fonts.MEDIUM) + 40)); 56 | cancelButton.setClickAction(() -> { 57 | cancelButton.setText("Confirm"); 58 | cancelButton.setWidth((int) (NanoVGHelper.INSTANCE.getTextWidth(vg, "Confirm", 14f, Fonts.MEDIUM) + 40)); 59 | cancelButton.setClickAction(() -> { 60 | markAsViewed(); 61 | cancelButton.setText(CANCEL); 62 | cancelButton.setWidth((int) (NanoVGHelper.INSTANCE.getTextWidth(vg, CANCEL, 14f, Fonts.MEDIUM) + 40)); 63 | GuiUtils.displayScreen(null); 64 | }); 65 | }); 66 | } 67 | float scale = OneConfigGui.getScaleFactor(); 68 | int x = (int) ((UResolution.getWindowWidth() - 600 * scale) / 2f / scale); 69 | int y = (int) ((UResolution.getWindowHeight() - 240 * scale) / 2f / scale); 70 | NanoVGHelper.INSTANCE.scale(vg, scale, scale); 71 | inputHandler.scale(scale, scale); 72 | 73 | NanoVGHelper.INSTANCE.drawRoundedRect(vg, x, y, 600, 240, GRAY_800, 20); 74 | NanoVGHelper.INSTANCE.drawCenteredText(vg, "OverflowAnimations", x + 300, y + 40, WHITE_90, 28, Fonts.MEDIUM); 75 | NanoVGHelper.INSTANCE.drawCenteredText(vg, "OverflowAnimations now replaces DulkirMod's animations feature.", x + 300, y + 100, WHITE_90, 16, Fonts.REGULAR); 76 | NanoVGHelper.INSTANCE.drawCenteredText(vg, "Would you like to import your DulkirMod config?", x + 300, y + 120, WHITE_90, 16, Fonts.REGULAR); 77 | NanoVGHelper.INSTANCE.drawCenteredText(vg, "(You can transfer your config later in the settings)", x + 300, y + 140, WHITE_90, 12, Fonts.REGULAR); 78 | 79 | transferButton.draw(vg, x + 300 - transferButton.getWidth(), y + 180, inputHandler); 80 | cancelButton.draw(vg, x + 300 + 10, y + 180, inputHandler); 81 | } 82 | 83 | private void markAsViewed() { 84 | OverflowAnimations.doTheFunnyDulkirThing = false; 85 | OldAnimationsSettings.didTheFunnyDulkirThingElectricBoogaloo = true; 86 | OldAnimationsSettings.INSTANCE.save(); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/hooks/DebugCrosshairHook.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.hooks; 2 | 3 | import cc.polyfrost.oneconfig.libs.universal.UResolution; 4 | import net.minecraft.client.Minecraft; 5 | import net.minecraft.client.renderer.GlStateManager; 6 | import net.minecraft.client.renderer.Tessellator; 7 | import net.minecraft.client.renderer.WorldRenderer; 8 | import net.minecraft.client.renderer.vertex.DefaultVertexFormats; 9 | import net.minecraft.entity.Entity; 10 | import org.lwjgl.opengl.GL11; 11 | import org.polyfrost.overflowanimations.util.MathUtils; 12 | 13 | public class DebugCrosshairHook { 14 | 15 | public static void renderDirections(float partialTicks, Minecraft mc) { 16 | GlStateManager.pushMatrix(); 17 | GlStateManager.translate((float)(UResolution.getScaledWidth() / 2), (float)(UResolution.getScaledHeight() / 2), 100); 18 | Entity entity = mc.getRenderViewEntity(); 19 | GlStateManager.rotate(MathUtils.interp(entity.prevRotationPitch, entity.rotationPitch, partialTicks), -1.0F, 0.0F, 0.0F); 20 | GlStateManager.rotate(MathUtils.interp(entity.prevRotationYaw , entity.rotationYaw, partialTicks), 0.0F, 1.0F, 0.0F); 21 | GlStateManager.scale(-1.0F, -1.0F, -1.0F); 22 | GlStateManager.disableTexture2D(); 23 | GlStateManager.depthMask(false); 24 | 25 | Tessellator tessellator = Tessellator.getInstance(); 26 | WorldRenderer worldRenderer = tessellator.getWorldRenderer(); 27 | 28 | GL11.glLineWidth(4.0F); 29 | worldRenderer.begin(1, DefaultVertexFormats.POSITION_COLOR); 30 | worldRenderer.pos(0.0, 0.0, 0.0).color(0, 0, 0, 255).endVertex(); 31 | worldRenderer.pos(10, 0.0, 0.0).color(0, 0, 0, 255).endVertex(); 32 | worldRenderer.pos(0.0, 0.0, 0.0).color(0, 0, 0, 255).endVertex(); 33 | worldRenderer.pos(0.0, 10, 0.0).color(0, 0, 0, 255).endVertex(); 34 | worldRenderer.pos(0.0, 0.0, 0.0).color(0, 0, 0, 255).endVertex(); 35 | worldRenderer.pos(0.0, 0.0, 10).color(0, 0, 0, 255).endVertex(); 36 | tessellator.draw(); 37 | 38 | GL11.glLineWidth(2.0F); 39 | worldRenderer.begin(1, DefaultVertexFormats.POSITION_COLOR); 40 | worldRenderer.pos(0.0, 0.0, 0.0).color(255, 0, 0, 255).endVertex(); 41 | worldRenderer.pos(10, 0.0, 0.0).color(255, 0, 0, 255).endVertex(); 42 | worldRenderer.pos(0.0, 0.0, 0.0).color(0, 255, 0, 255).endVertex(); 43 | worldRenderer.pos(0.0, 10, 0.0).color(0, 255, 0, 255).endVertex(); 44 | worldRenderer.pos(0.0, 0.0, 0.0).color(127, 127, 255, 255).endVertex(); 45 | worldRenderer.pos(0.0, 0.0, 10).color(127, 127, 255, 255).endVertex(); 46 | tessellator.draw(); 47 | 48 | GL11.glLineWidth(1.0F); 49 | GlStateManager.depthMask(true); 50 | GlStateManager.enableTexture2D(); 51 | GlStateManager.popMatrix(); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/hooks/DebugOverlayHook.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.hooks; 2 | 3 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 4 | import com.google.common.collect.Lists; 5 | import net.minecraft.client.Minecraft; 6 | import net.minecraft.client.renderer.chunk.RenderChunk; 7 | import net.minecraft.entity.Entity; 8 | import net.minecraft.util.BlockPos; 9 | import net.minecraft.util.EnumFacing; 10 | import net.minecraft.util.MathHelper; 11 | import net.minecraft.world.EnumSkyBlock; 12 | import net.minecraft.world.chunk.Chunk; 13 | import net.minecraftforge.fml.common.FMLCommonHandler; 14 | 15 | import java.util.List; 16 | 17 | /** 18 | * This is obviously quite an intrusive overwrite, so we put it in a hook so other mods can inject into it easier. 19 | */ 20 | public class DebugOverlayHook { 21 | private static float overflowEyeHeight; 22 | 23 | public static List getDebugInfoLeft() { 24 | final Minecraft mc = Minecraft.getMinecraft(); 25 | BlockPos blockpos = new BlockPos(mc.getRenderViewEntity().posX, mc.getRenderViewEntity().getEntityBoundingBox().minY, mc.getRenderViewEntity().posZ); 26 | Entity entity = mc.getRenderViewEntity(); 27 | EnumFacing enumfacing = entity.getHorizontalFacing(); 28 | Chunk chunk = mc.theWorld.getChunkFromBlockCoords(blockpos); 29 | 30 | List list = Lists.newArrayList("Minecraft 1.8.9 (" + Minecraft.getDebugFPS() + " fps" + ", " + RenderChunk.renderChunksUpdated + " chunk updates)", mc.renderGlobal.getDebugInfoRenders(), mc.renderGlobal.getDebugInfoEntities(), "P: " + mc.effectRenderer.getStatistics() + ". T: " + mc.theWorld.getDebugLoadedEntities(), mc.theWorld.getProviderName(), "", String.format("x: %.5f (%d) // c: %d (%d)", mc.thePlayer.posX, MathHelper.floor_double(mc.thePlayer.posX), MathHelper.floor_double(mc.thePlayer.posX) >> 4, MathHelper.floor_double(mc.thePlayer.posX) & 15), String.format("y: %.3f (feet pos, %.3f eyes pos)", mc.thePlayer.getEntityBoundingBox().minY, mc.thePlayer.posY + (OldAnimationsSettings.smoothSneaking && OldAnimationsSettings.INSTANCE.enabled ? overflowEyeHeight : mc.thePlayer.getEyeHeight())), String.format("z: %.5f (%d) // c: %d (%d)", mc.thePlayer.posZ, MathHelper.floor_double(mc.thePlayer.posZ), MathHelper.floor_double(mc.thePlayer.posZ) >> 4, MathHelper.floor_double(mc.thePlayer.posZ) & 15), "f: " + (MathHelper.floor_double((double) (mc.thePlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + " (" + enumfacing.toString().toUpperCase() + ") / " + MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw), String.format("ws: %.3f, fs: %.3f, g: %b, fl: %.0f", mc.thePlayer.capabilities.getWalkSpeed(), mc.thePlayer.capabilities.getFlySpeed(), mc.thePlayer.onGround, mc.thePlayer.posY), String.format("lc: " + chunk.getLightSubtracted(blockpos, 0) + " b: " + chunk.getBiome(blockpos, mc.theWorld.getWorldChunkManager()).biomeName) + " bl: " + chunk.getLightFor(EnumSkyBlock.BLOCK, blockpos) + " sl: " + chunk.getLightFor(EnumSkyBlock.SKY, blockpos) + " rl: " + chunk.getLightSubtracted(blockpos, 0)); 31 | 32 | if (mc.entityRenderer != null && mc.entityRenderer.isShaderActive()) { 33 | list.add("shader: " + mc.entityRenderer.getShaderGroup().getShaderGroupName()); 34 | } 35 | return list; 36 | } 37 | 38 | public static List getDebugInfoRight() { 39 | long i = Runtime.getRuntime().maxMemory(); 40 | long j = Runtime.getRuntime().totalMemory(); 41 | long k = Runtime.getRuntime().freeMemory(); 42 | long l = j - k; 43 | List list = Lists.newArrayList(String.format("Used memory: % 2d%% (%03dMB) of %03dMB", l * 100L / i, bytesToMb(l), bytesToMb(i)), String.format("Allocated memory: % 2d%% (%03dMB)", j * 100L / i, bytesToMb(j)), ""); 44 | list.addAll(FMLCommonHandler.instance().getBrandings(false)); 45 | return list; 46 | } 47 | 48 | public static void setOverflowEyeHeight(float eyeHeight) { 49 | overflowEyeHeight = eyeHeight; 50 | } 51 | 52 | private static long bytesToMb(long bytes) { 53 | return bytes / 1024L / 1024L; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/hooks/DroppedItemHook.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.hooks; 2 | 3 | import org.polyfrost.overflowanimations.OverflowAnimations; 4 | 5 | public class DroppedItemHook { 6 | 7 | public static boolean isItemDropped; 8 | 9 | public static boolean isItemPhysicsAndEntityDropped() { 10 | return OverflowAnimations.isItemPhysics && isItemDropped; 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/hooks/DulkirConfigData.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.hooks; 2 | 3 | public final class DulkirConfigData { 4 | private final float size; 5 | private final boolean scaleSwing; 6 | private final float x; 7 | private final float y; 8 | private final float z; 9 | private final float yaw; 10 | private final float pitch; 11 | private final float roll; 12 | private final float speed; 13 | private final boolean ignoreHaste; 14 | private final int drinkingFix; 15 | 16 | public DulkirConfigData(float size, boolean scaleSwing, float x, float y, float z, float yaw, float pitch, float roll, float speed, boolean ignoreHaste, int drinkingFix) { 17 | this.size = size; 18 | this.scaleSwing = scaleSwing; 19 | this.x = x; 20 | this.y = y; 21 | this.z = z; 22 | this.yaw = yaw; 23 | this.pitch = pitch; 24 | this.roll = roll; 25 | this.speed = speed; 26 | this.ignoreHaste = ignoreHaste; 27 | this.drinkingFix = drinkingFix; 28 | } 29 | 30 | public float getSize() { 31 | return this.size; 32 | } 33 | 34 | public boolean getScaleSwing() { 35 | return this.scaleSwing; 36 | } 37 | 38 | public float getX() { 39 | return this.x; 40 | } 41 | 42 | public float getY() { 43 | return this.y; 44 | } 45 | 46 | public float getZ() { 47 | return this.z; 48 | } 49 | 50 | public float getYaw() { 51 | return this.yaw; 52 | } 53 | 54 | public float getPitch() { 55 | return this.pitch; 56 | } 57 | 58 | public float getRoll() { 59 | return this.roll; 60 | } 61 | 62 | public float getSpeed() { 63 | return this.speed; 64 | } 65 | 66 | public boolean getIgnoreHaste() { 67 | return this.ignoreHaste; 68 | } 69 | 70 | public int getDrinkingFix() { 71 | return this.drinkingFix; 72 | } 73 | 74 | public String toString() { 75 | return "ConfigData(size=" + this.size + ", scaleSwing=" + this.scaleSwing + ", x=" + this.x + ", y=" + this.y + ", z=" + this.z + ", yaw=" + this.yaw + ", pitch=" + this.pitch + ", roll=" + this.roll + ", speed=" + this.speed + ", ignoreHaste=" + this.ignoreHaste + ", drinkingFix=" + this.drinkingFix + ')'; 76 | } 77 | 78 | public int hashCode() { 79 | int result = Float.hashCode(this.size); 80 | int n = this.scaleSwing ? 1 : 0; 81 | if (n != 0) { 82 | n = 1; 83 | } 84 | result = result * 31 + n; 85 | result = result * 31 + Float.hashCode(this.x); 86 | result = result * 31 + Float.hashCode(this.y); 87 | result = result * 31 + Float.hashCode(this.z); 88 | result = result * 31 + Float.hashCode(this.yaw); 89 | result = result * 31 + Float.hashCode(this.pitch); 90 | result = result * 31 + Float.hashCode(this.roll); 91 | result = result * 31 + Float.hashCode(this.speed); 92 | int n2 = this.ignoreHaste ? 1 : 0; 93 | if (n2 != 0) { 94 | n2 = 1; 95 | } 96 | result = result * 31 + n2; 97 | result = result * 31 + Integer.hashCode(this.drinkingFix); 98 | return result; 99 | } 100 | 101 | public boolean equals(Object other) { 102 | if (this == other) { 103 | return true; 104 | } 105 | if (!(other instanceof DulkirConfigData)) { 106 | return false; 107 | } 108 | DulkirConfigData configData = (DulkirConfigData) other; 109 | if (Float.compare(this.size, configData.size) != 0) { 110 | return false; 111 | } 112 | if (this.scaleSwing != configData.scaleSwing) { 113 | return false; 114 | } 115 | if (Float.compare(this.x, configData.x) != 0) { 116 | return false; 117 | } 118 | if (Float.compare(this.y, configData.y) != 0) { 119 | return false; 120 | } 121 | if (Float.compare(this.z, configData.z) != 0) { 122 | return false; 123 | } 124 | if (Float.compare(this.yaw, configData.yaw) != 0) { 125 | return false; 126 | } 127 | if (Float.compare(this.pitch, configData.pitch) != 0) { 128 | return false; 129 | } 130 | if (Float.compare(this.roll, configData.roll) != 0) { 131 | return false; 132 | } 133 | if (Float.compare(this.speed, configData.speed) != 0) { 134 | return false; 135 | } 136 | if (this.ignoreHaste != configData.ignoreHaste) { 137 | return false; 138 | } 139 | return this.drinkingFix == configData.drinkingFix; 140 | } 141 | } -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/hooks/HitColorHook.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.hooks; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.client.renderer.GlStateManager; 5 | import net.minecraft.client.renderer.entity.RendererLivingEntity; 6 | import net.minecraft.entity.EntityLivingBase; 7 | import org.polyfrost.damagetint.config.DamageTintConfig; 8 | import org.polyfrost.overflowanimations.OverflowAnimations; 9 | import org.polyfrost.overflowanimations.mixin.interfaces.RendererLivingEntityInvoker; 10 | 11 | public class HitColorHook { 12 | 13 | public static void renderHitColorPre(EntityLivingBase entitylivingbaseIn, boolean bl, float partialTicks, RendererLivingEntity instance) { 14 | float brightness = entitylivingbaseIn.getBrightness(partialTicks); 15 | int i = ((RendererLivingEntityInvoker) instance).invokeGetColorMultiplier(entitylivingbaseIn, brightness, partialTicks); 16 | boolean flag = (i >> 24 & 0xFF) > 0; 17 | 18 | boolean isDT = OverflowAnimations.isDamageTintPresent; 19 | float red = isDT ? DamageTintConfig.color.getRed() / 255.0F : brightness; 20 | float green = isDT ? DamageTintConfig.color.getGreen() / 255.0F : 0.0F; 21 | float blue = isDT ? DamageTintConfig.color.getBlue() / 255.0F : 0.0F; 22 | float alpha = isDT ? DamageTintConfig.color.getAlpha() / 255.0F : 0.4F; 23 | 24 | Minecraft.getMinecraft().entityRenderer.disableLightmap(); 25 | if (flag || bl) { 26 | GlStateManager.disableTexture2D(); 27 | GlStateManager.disableAlpha(); 28 | GlStateManager.enableBlend(); 29 | GlStateManager.blendFunc(770, 771); 30 | GlStateManager.depthFunc(514); 31 | GlStateManager.color(red, green, blue, alpha); 32 | } 33 | } 34 | 35 | public static void renderHitColorPost(boolean bl) { 36 | if (bl) { 37 | GlStateManager.depthFunc(515); 38 | GlStateManager.disableBlend(); 39 | GlStateManager.enableAlpha(); 40 | GlStateManager.enableTexture2D(); 41 | } 42 | Minecraft.getMinecraft().entityRenderer.enableLightmap(); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/hooks/OverflowConfigData.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.hooks; 2 | 3 | import org.polyfrost.overflowanimations.config.ItemPositionAdvancedSettings; 4 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 5 | 6 | public class OverflowConfigData { 7 | 8 | public float itemPositionX = 0.0F; 9 | 10 | public float itemPositionY = 0.0F; 11 | 12 | public float itemPositionZ = 0.0F; 13 | 14 | public float itemRotationYaw = 0.0F; 15 | 16 | public float itemRotationPitch = 0.0F; 17 | 18 | public float itemRotationRoll = 0.0F; 19 | 20 | public float itemScale = 0.0F; 21 | 22 | // Swing Position Customization 23 | public float itemSwingPositionX = 0.0F; 24 | 25 | public float itemSwingPositionY = 0.0F; 26 | 27 | public float itemSwingPositionZ = 0.0F; 28 | 29 | public float itemSwingSpeed = 0.0F; 30 | 31 | public float itemSwingSpeedHaste = 0.0F; 32 | 33 | public float itemSwingSpeedFatigue = 0.0F; 34 | 35 | public boolean shouldScaleSwing = false; 36 | 37 | // Eating/Drinking Position 38 | public float consumePositionX = 0.0F; 39 | 40 | public float consumePositionY = 0.0F; 41 | 42 | public float consumePositionZ = 0.0F; 43 | 44 | public float consumeRotationYaw = 0.0F; 45 | 46 | public float consumeRotationPitch = 0.0F; 47 | 48 | public float consumeRotationRoll = 0.0F; 49 | 50 | public float consumeScale = 0.0F; 51 | 52 | public float consumeIntensity = 0.0F; 53 | 54 | public float consumeSpeed = 0.0F; 55 | 56 | public boolean shouldScaleEat = false; 57 | 58 | // Sword Block Position 59 | public float blockedPositionX = 0.0F; 60 | 61 | public float blockedPositionY = 0.0F; 62 | 63 | public float blockedPositionZ = 0.0F; 64 | 65 | public float blockedRotationYaw = 0.0F; 66 | 67 | public float blockedRotationPitch = 0.0F; 68 | 69 | public float blockedRotationRoll = 0.0F; 70 | 71 | public float blockedScale = 0.0F; 72 | 73 | // Projectiles Position 74 | public float projectilePositionX = 0.0F; 75 | 76 | public float projectilePositionY = 0.0F; 77 | 78 | public float projectilePositionZ = 0.0F; 79 | 80 | public float projectileRotationYaw = 0.0F; 81 | 82 | public float projectileRotationPitch = 0.0F; 83 | 84 | public float projectileRotationRoll = 0.0F; 85 | 86 | public float projectileScale = 0.0F; 87 | 88 | public OverflowConfigData() { 89 | OldAnimationsSettings settings = OldAnimationsSettings.INSTANCE; 90 | ItemPositionAdvancedSettings advanced = OldAnimationsSettings.advancedSettings; 91 | itemPositionX = settings.itemPositionX; 92 | itemPositionY = settings.itemPositionY; 93 | itemPositionZ = settings.itemPositionZ; 94 | itemRotationYaw = settings.itemRotationYaw; 95 | itemRotationPitch = settings.itemRotationPitch; 96 | itemRotationRoll = settings.itemRotationRoll; 97 | itemScale = settings.itemScale; 98 | itemSwingPositionX = advanced.itemSwingPositionX; 99 | itemSwingPositionY = advanced.itemSwingPositionY; 100 | itemSwingPositionZ = advanced.itemSwingPositionZ; 101 | itemSwingSpeed = settings.itemSwingSpeed; 102 | itemSwingSpeedHaste = settings.itemSwingSpeedHaste; 103 | itemSwingSpeedFatigue = settings.itemSwingSpeedFatigue; 104 | shouldScaleSwing = settings.swingSetting == 1; 105 | consumePositionX = advanced.consumePositionX; 106 | consumePositionY = advanced.consumePositionY; 107 | consumePositionZ = advanced.consumePositionZ; 108 | consumeRotationYaw = advanced.consumeRotationYaw; 109 | consumeRotationPitch = advanced.consumeRotationPitch; 110 | consumeRotationRoll = advanced.consumeRotationRoll; 111 | consumeScale = advanced.consumeScale; 112 | consumeIntensity = advanced.consumeIntensity; 113 | consumeSpeed = advanced.consumeSpeed; 114 | shouldScaleEat = ItemPositionAdvancedSettings.shouldScaleEat; 115 | blockedPositionX = advanced.blockedPositionX; 116 | blockedPositionY = advanced.blockedPositionY; 117 | blockedPositionZ = advanced.blockedPositionZ; 118 | blockedRotationYaw = advanced.blockedRotationYaw; 119 | blockedRotationPitch = advanced.blockedRotationPitch; 120 | blockedRotationRoll = advanced.blockedRotationRoll; 121 | blockedScale = advanced.blockedScale; 122 | projectilePositionX = advanced.projectilePositionX; 123 | projectilePositionY = advanced.projectilePositionY; 124 | projectilePositionZ = advanced.projectilePositionZ; 125 | projectileRotationYaw = advanced.projectileRotationYaw; 126 | projectileRotationPitch = advanced.projectileRotationPitch; 127 | projectileRotationRoll = advanced.projectileRotationRoll; 128 | projectileScale = advanced.projectileScale; 129 | } 130 | } -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/hooks/PatcherConfigHook.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.hooks; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import org.polyfrost.overflowanimations.OverflowAnimations; 5 | 6 | public class PatcherConfigHook { 7 | public static boolean isParallaxFixEnabled() { 8 | return OverflowAnimations.isPatcherPresent && PatcherConfig.parallaxFix; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/hooks/PotionColors.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.hooks; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | public class PotionColors { 7 | 8 | public static final Map POTION_COLORS; 9 | 10 | public static boolean shouldReload; 11 | 12 | public static void reloadColor() { 13 | shouldReload = true; 14 | } 15 | 16 | static { 17 | POTION_COLORS = new HashMap() {{ 18 | put(1, 3402751); 19 | put(2, 9154528); 20 | put(3, 14270531); 21 | put(4, 4866583); 22 | put(5, 16762624); 23 | put(6, 16262179); 24 | put(7, 11101546); 25 | put(8, 16646020); 26 | put(9, 5578058); 27 | put(10, 13458603); 28 | put(11, 9520880); 29 | put(12, 0xFF9900); 30 | put(13, 10017472); 31 | put(14, 0xF6F6F6); 32 | put(15, 2039587); 33 | put(16, 12779366); 34 | put(17, 5797459); 35 | put(18, 0x484D48); 36 | put(19, 8889187); 37 | put(20, 7561558); 38 | put(21, 16284963); 39 | put(22, 0x2552A5); 40 | put(23, 16262179); 41 | }}; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/hooks/SmoothSneakHook.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.hooks; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 5 | 6 | public class SmoothSneakHook { 7 | 8 | private static float sneakingHeight; 9 | 10 | public static void setSneakingHeight(float sneakingHeight) { 11 | SmoothSneakHook.sneakingHeight = sneakingHeight; 12 | } 13 | 14 | public static float getSmoothSneak() { 15 | if (OldAnimationsSettings.smoothSneaking && OldAnimationsSettings.INSTANCE.enabled) { 16 | return sneakingHeight; 17 | } else { 18 | return Minecraft.getMinecraft().getRenderViewEntity().getEyeHeight(); 19 | } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/hooks/SwingHook.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.hooks; 2 | 3 | import org.polyfrost.overflowanimations.mixin.interfaces.EntityLivingBaseInvoker; 4 | import net.minecraft.client.Minecraft; 5 | 6 | public class SwingHook { 7 | 8 | public static void swingItem() { 9 | final Minecraft mc = Minecraft.getMinecraft(); 10 | if (!mc.thePlayer.isSwingInProgress || 11 | mc.thePlayer.swingProgressInt >= ((EntityLivingBaseInvoker) mc.thePlayer).getArmSwingAnimation() / 2 || 12 | mc.thePlayer.swingProgressInt < 0) { 13 | mc.thePlayer.swingProgressInt = -1; 14 | mc.thePlayer.isSwingInProgress = true; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/hooks/TabOverlayHook.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.hooks; 2 | 3 | import org.polyfrost.overflowanimations.mixin.interfaces.GuiPlayerTabOverlayInvoker; 4 | import com.google.common.collect.Ordering; 5 | import net.minecraft.client.Minecraft; 6 | import net.minecraft.client.gui.FontRenderer; 7 | import net.minecraft.client.gui.GuiPlayerTabOverlay; 8 | import net.minecraft.client.gui.ScaledResolution; 9 | import net.minecraft.client.network.NetHandlerPlayClient; 10 | import net.minecraft.client.network.NetworkPlayerInfo; 11 | import net.minecraft.client.renderer.GlStateManager; 12 | import net.minecraft.scoreboard.Score; 13 | import net.minecraft.scoreboard.ScoreObjective; 14 | import net.minecraft.scoreboard.ScorePlayerTeam; 15 | import net.minecraft.util.EnumChatFormatting; 16 | 17 | import java.util.List; 18 | 19 | import static net.minecraft.client.gui.Gui.drawRect; 20 | 21 | /** 22 | * This is obviously quite an intrusive overwrite, so we put it in a hook so other mods can inject into it easier. 23 | */ 24 | public class TabOverlayHook { 25 | public static void renderOldTab(GuiPlayerTabOverlay instance, ScoreObjective var37, Ordering field_175252_a) { 26 | FontRenderer var8 = Minecraft.getMinecraft().fontRendererObj; 27 | NetHandlerPlayClient nethandlerplayclient = Minecraft.getMinecraft().thePlayer.sendQueue; 28 | List var42 = field_175252_a.sortedCopy(nethandlerplayclient.getPlayerInfoMap()); 29 | int var15 = Minecraft.getMinecraft().thePlayer.sendQueue.currentServerMaxPlayers; 30 | int var16 = var15; 31 | ScaledResolution scaledresolution = new ScaledResolution(Minecraft.getMinecraft()); 32 | int var17; 33 | int var6 = scaledresolution.getScaledWidth(); 34 | int var21; 35 | int var22; 36 | int var23; 37 | for (var17 = 1; var16 > 20; var16 = (var15 + var17 - 1) / var17) { 38 | ++var17; 39 | } 40 | int var46 = 300 / var17; 41 | if (var46 > 150) { 42 | var46 = 150; 43 | } 44 | int var19 = (var6 - var17 * var46) / 2; 45 | byte var47 = 10; 46 | drawRect(var19 - 1, var47 - 1, var19 + var46 * var17, var47 + 9 * var16, Integer.MIN_VALUE); 47 | GuiPlayerTabOverlayInvoker accessor = (GuiPlayerTabOverlayInvoker) instance; 48 | for (var21 = 0; var21 < var15; ++var21) { 49 | var22 = var19 + var21 % var17 * var46; 50 | var23 = var47 + var21 / var17 * 9; 51 | drawRect(var22, var23, var22 + var46 - 1, var23 + 8, 553648127); 52 | GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); 53 | GlStateManager.enableAlpha(); 54 | if (var21 < var42.size()) { 55 | NetworkPlayerInfo var48 = var42.get(var21); 56 | ScorePlayerTeam var49 = Minecraft.getMinecraft().theWorld.getScoreboard().getPlayersTeam(var48.getGameProfile().getName()); 57 | String var50 = ScorePlayerTeam.formatPlayerName(var49, var48.getGameProfile().getName()); 58 | var8.drawStringWithShadow(var50, var22, var23, 16777215); 59 | if (var37 != null) { 60 | int var27 = var22 + var8.getStringWidth(var50) + 5; 61 | int var28 = var22 + var46 - 12 - 5; 62 | if (var28 - var27 > 5) { 63 | Score var29 = var37.getScoreboard().getValueFromObjective(var48.getGameProfile().getName(), var37); 64 | String var30 = EnumChatFormatting.YELLOW + String.valueOf(var29.getScorePoints()); 65 | var8.drawStringWithShadow(var30, var28 - var8.getStringWidth(var30), var23, 16777215); 66 | } 67 | } 68 | accessor.invokeDrawPing(50, var22 + var46 - 52, var23, var48); 69 | } 70 | } 71 | GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); 72 | GlStateManager.disableLighting(); 73 | GlStateManager.enableAlpha(); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/hooks/TransformTypeHook.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.hooks; 2 | 3 | import net.minecraft.client.renderer.block.model.ItemCameraTransforms; 4 | 5 | import java.util.EnumSet; 6 | 7 | public class TransformTypeHook { 8 | 9 | public static ItemCameraTransforms.TransformType transform; 10 | private static final EnumSet cameraTypes = 11 | EnumSet.of( 12 | ItemCameraTransforms.TransformType.GROUND, 13 | ItemCameraTransforms.TransformType.FIXED 14 | ); 15 | 16 | 17 | public static boolean shouldBeSprite() { 18 | return shouldNotHaveGlint() || isRenderingInGUI(); 19 | } 20 | 21 | public static boolean isRenderingInGUI() { 22 | return transform == ItemCameraTransforms.TransformType.GUI; 23 | } 24 | 25 | public static boolean shouldNotHaveGlint() { 26 | return cameraTypes.contains(TransformTypeHook.transform); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/EntityLivingBaseMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import net.minecraft.entity.Entity; 4 | import net.minecraft.entity.EntityLivingBase; 5 | import net.minecraft.potion.Potion; 6 | import net.minecraft.potion.PotionEffect; 7 | import net.minecraft.util.MathHelper; 8 | import net.minecraft.world.World; 9 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 10 | import org.spongepowered.asm.mixin.Mixin; 11 | import org.spongepowered.asm.mixin.Shadow; 12 | import org.spongepowered.asm.mixin.Unique; 13 | import org.spongepowered.asm.mixin.injection.At; 14 | import org.spongepowered.asm.mixin.injection.Inject; 15 | import org.spongepowered.asm.mixin.injection.ModifyArg; 16 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 17 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 18 | 19 | @Mixin(value = EntityLivingBase.class, priority = 980) 20 | public abstract class EntityLivingBaseMixin extends Entity { 21 | 22 | public EntityLivingBaseMixin(World worldIn) { 23 | super(worldIn); 24 | } 25 | 26 | @Shadow public abstract boolean isPotionActive(Potion potionIn); 27 | @Shadow public abstract PotionEffect getActivePotionEffect(Potion potionIn); 28 | @Shadow public float swingProgress; 29 | @Shadow public float renderYawOffset; 30 | @Shadow public float rotationYawHead; 31 | @Unique protected float overflowAnimations$newHeadYaw; 32 | @Unique protected int overflowAnimations$headYawLerpWeight; 33 | 34 | @Inject(method = "setRotationYawHead", at = @At("HEAD"), cancellable = true) 35 | public void overflowAnimations$setAsNewHeadYaw(float rotation, CallbackInfo ci) { 36 | if (!OldAnimationsSettings.INSTANCE.enabled || !OldAnimationsSettings.headYawFix) return; 37 | ci.cancel(); 38 | overflowAnimations$newHeadYaw = MathHelper.wrapAngleTo180_float(rotation); 39 | overflowAnimations$headYawLerpWeight = 3; 40 | } 41 | 42 | @Inject(method = "onLivingUpdate", at = @At("HEAD")) 43 | public void overflowAnimations$updateHeadYaw(CallbackInfo ci) { 44 | if (!OldAnimationsSettings.INSTANCE.enabled || !OldAnimationsSettings.headYawFix) return; 45 | if (overflowAnimations$headYawLerpWeight <= 0) return; 46 | rotationYawHead += MathHelper.wrapAngleTo180_float(overflowAnimations$newHeadYaw - rotationYawHead) / overflowAnimations$headYawLerpWeight; 47 | rotationYawHead = MathHelper.wrapAngleTo180_float(rotationYawHead); 48 | overflowAnimations$headYawLerpWeight--; 49 | } 50 | 51 | //todo: hook swing speed 52 | @Inject(method = "getArmSwingAnimationEnd()I", at = @At("HEAD"), cancellable = true) 53 | public void overflowAnimations$modifySwingSpeed(CallbackInfoReturnable cir) { 54 | OldAnimationsSettings settings = OldAnimationsSettings.INSTANCE; 55 | if (!OldAnimationsSettings.globalPositions || !settings.enabled) return; 56 | int length = 6; 57 | if (isPotionActive(Potion.digSpeed) && !OldAnimationsSettings.ignoreHaste) { 58 | length -= (1 + getActivePotionEffect(Potion.digSpeed).getAmplifier()); 59 | cir.setReturnValue(Math.max((int) (length * Math.exp(-settings.itemSwingSpeedHaste)), 1)); 60 | } else if (isPotionActive(Potion.digSlowdown) && !OldAnimationsSettings.ignoreFatigue) { 61 | length += (1 + getActivePotionEffect(Potion.digSlowdown).getAmplifier()) * 2; 62 | cir.setReturnValue(Math.max((int) (length * Math.exp(-settings.itemSwingSpeedFatigue)), 1)); 63 | } else { 64 | cir.setReturnValue(Math.max((int) (length * Math.exp(-settings.itemSwingSpeed)), 1)); 65 | } 66 | } 67 | 68 | //todo: see if i can write this better 69 | @ModifyArg(method = "onUpdate", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/EntityLivingBase;updateDistance(FF)F"), index = 0) 70 | public float overflowAnimations$modifyYaw(float p_1101461) { 71 | double d0 = posX - prevPosX; 72 | double d1 = posZ - prevPosZ; 73 | float f = (float)(d0 * d0 + d1 * d1); 74 | float h = renderYawOffset; 75 | if (f > 0.0025000002F) { 76 | float f1 = (float) MathHelper.atan2(d1, d0) * 180.0F / 3.1415927F - 90.0F; 77 | float g = MathHelper.abs(MathHelper.wrapAngleTo180_float(rotationYaw) - f1); 78 | h = f1 - (95.0F < g && g < 265.0F ? 180.0F : 0.0F); 79 | } 80 | if (swingProgress > 0.0F) { 81 | h = rotationYaw; 82 | } 83 | return OldAnimationsSettings.modernMovement ? h : p_1101461; 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/EntityMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import cc.polyfrost.oneconfig.libs.universal.UMinecraft; 4 | import net.minecraft.entity.Entity; 5 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 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(Entity.class) 13 | public class EntityMixin { 14 | 15 | @Shadow 16 | public double motionZ; 17 | 18 | @Shadow 19 | public double motionX; 20 | 21 | @Shadow 22 | public float rotationYaw; 23 | 24 | @Inject(method = "setVelocity", at = @At("HEAD")) 25 | private void directionalHurtCam(double x, double y, double z, CallbackInfo ci) { 26 | if (!OldAnimationsSettings.damageTilt) return; 27 | if ((Entity) (Object) this == UMinecraft.getPlayer()) { 28 | float result = (float) (Math.atan2(z - motionZ, x - motionX) * (180D / Math.PI) - (double) rotationYaw); 29 | if (Float.isFinite(result)) { 30 | UMinecraft.getPlayer().attackedAtYaw = result; 31 | } 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/EntityOtherPlayerMPMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import net.minecraft.client.entity.EntityOtherPlayerMP; 4 | import net.minecraft.util.MathHelper; 5 | import net.minecraft.world.World; 6 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 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(value = EntityOtherPlayerMP.class, priority = 980) 13 | public abstract class EntityOtherPlayerMPMixin extends EntityLivingBaseMixin { 14 | public EntityOtherPlayerMPMixin(World worldIn) { 15 | super(worldIn); 16 | } 17 | 18 | @Inject(method = "onLivingUpdate", at = @At("HEAD")) 19 | public void overflowAnimations$updateHeadYaw(CallbackInfo ci) { 20 | if (!OldAnimationsSettings.INSTANCE.enabled || !OldAnimationsSettings.headYawFix) return; 21 | if (overflowAnimations$headYawLerpWeight <= 0) return; 22 | rotationYawHead += MathHelper.wrapAngleTo180_float(overflowAnimations$newHeadYaw - rotationYawHead) / overflowAnimations$headYawLerpWeight; 23 | rotationYawHead = MathHelper.wrapAngleTo180_float(rotationYawHead); 24 | overflowAnimations$headYawLerpWeight--; 25 | } 26 | } -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/EntityPickupFXMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import net.minecraft.client.particle.EntityPickupFX; 4 | import net.minecraft.client.renderer.WorldRenderer; 5 | import net.minecraft.entity.Entity; 6 | import org.objectweb.asm.Opcodes; 7 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 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(EntityPickupFX.class) 15 | public class EntityPickupFXMixin { 16 | 17 | @Shadow private float field_174841_aA; 18 | @Shadow private Entity field_174843_ax; 19 | 20 | @Inject(method = "renderParticle", at = @At(value = "FIELD", opcode = Opcodes.GETFIELD, target = "Lnet/minecraft/client/particle/EntityPickupFX;field_174841_aA:F")) 21 | private void overflowAnimations$factorInEyeHeight(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ, CallbackInfo ci) { 22 | if (!OldAnimationsSettings.INSTANCE.enabled) { return; } 23 | if (OldAnimationsSettings.oldPickup) { 24 | field_174841_aA = (field_174843_ax.getEyeHeight() / 2); 25 | } 26 | field_174841_aA += OldAnimationsSettings.INSTANCE.pickupPosition; 27 | } 28 | 29 | @Inject(method = "renderParticle", at = @At("HEAD"), cancellable = true) 30 | private void overflowAnimations$disableCollectParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ, CallbackInfo ci) { 31 | if (OldAnimationsSettings.disablePickup && OldAnimationsSettings.INSTANCE.enabled) { 32 | ci.cancel(); 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/EntityPlayerMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.client.gui.inventory.GuiChest; 5 | import net.minecraft.entity.item.EntityItem; 6 | import net.minecraft.entity.player.EntityPlayer; 7 | import net.minecraft.item.ItemStack; 8 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 9 | import org.polyfrost.overflowanimations.hooks.SwingHook; 10 | import org.spongepowered.asm.mixin.Mixin; 11 | import org.spongepowered.asm.mixin.injection.At; 12 | import org.spongepowered.asm.mixin.injection.Inject; 13 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 14 | 15 | @Mixin(EntityPlayer.class) 16 | public class EntityPlayerMixin { 17 | 18 | @Inject(method = "dropItem", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/EntityPlayer;getEyeHeight()F")) 19 | public void overflowAnimations$dropItemSwing(ItemStack droppedItem, boolean dropAround, boolean traceItem, CallbackInfoReturnable cir) { 20 | if (OldAnimationsSettings.modernDropSwing && OldAnimationsSettings.INSTANCE.enabled && Minecraft.getMinecraft().theWorld.isRemote) { 21 | if (OldAnimationsSettings.modernDropSwingFix && Minecraft.getMinecraft().currentScreen instanceof GuiChest) { return; } 22 | SwingHook.swingItem(); 23 | } 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/EntityRendererMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import net.minecraft.client.renderer.GlStateManager; 4 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 5 | import org.polyfrost.overflowanimations.hooks.DebugCrosshairHook; 6 | import org.polyfrost.overflowanimations.hooks.DebugOverlayHook; 7 | import net.minecraft.client.Minecraft; 8 | import net.minecraft.client.renderer.EntityRenderer; 9 | import net.minecraft.entity.Entity; 10 | import org.polyfrost.overflowanimations.hooks.SmoothSneakHook; 11 | import org.polyfrost.overflowanimations.util.MathUtils; 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.Unique; 16 | import org.spongepowered.asm.mixin.injection.*; 17 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 18 | 19 | @Mixin(value = EntityRenderer.class, priority = 1001) 20 | public abstract class EntityRendererMixin { 21 | 22 | @Shadow private Minecraft mc; 23 | 24 | @Shadow public abstract void setupOverlayRendering(); 25 | 26 | @Unique 27 | @Final 28 | private final Minecraft overflowAnimations$mc = Minecraft.getMinecraft(); 29 | @Unique 30 | private float overflow$height; 31 | @Unique 32 | private float overflow$previousHeight; 33 | 34 | @Inject(method = "setupCameraTransform", at = @At("HEAD")) 35 | protected void overflowAnimations$getInterpolatedEyeHeight(float partialTicks, int pass, CallbackInfo ci) { 36 | if (!OldAnimationsSettings.INSTANCE.enabled) { return; } 37 | float interpEyeHeight = MathUtils.interp(overflow$previousHeight, overflow$height, partialTicks); 38 | SmoothSneakHook.setSneakingHeight(interpEyeHeight); 39 | } 40 | 41 | @ModifyVariable(method = "orientCamera", at = @At(value = "STORE", ordinal = 0), index = 3) 42 | public float overflowAnimations$modifyEyeHeight(float eyeHeight) { 43 | return SmoothSneakHook.getSmoothSneak(); 44 | } 45 | 46 | @ModifyArg(method = "renderWorldDirections", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;translate(FFF)V"), index = 1) 47 | public float overflowAnimations$syncCrossHair(float x) { 48 | return SmoothSneakHook.getSmoothSneak(); 49 | } 50 | 51 | @Inject(method = "renderWorldDirections", at = @At("HEAD"), cancellable = true) 52 | public void overflowAnimations$renderCrosshair(float partialTicks, CallbackInfo ci) { 53 | if ((OldAnimationsSettings.INSTANCE.debugCrosshairMode != 1) && OldAnimationsSettings.INSTANCE.enabled) 54 | ci.cancel(); 55 | } 56 | 57 | @Inject(method = "updateRenderer", at = @At("HEAD")) 58 | private void overflowAnimations$interpolateHeight(CallbackInfo ci) { 59 | if (!OldAnimationsSettings.INSTANCE.enabled) { return; } 60 | Entity entity = overflowAnimations$mc.getRenderViewEntity(); 61 | float eyeHeight = entity.getEyeHeight(); 62 | overflow$previousHeight = overflow$height; 63 | 64 | if (OldAnimationsSettings.longerUnsneak) { 65 | if (eyeHeight < overflow$height) 66 | overflow$height = eyeHeight; 67 | else 68 | overflow$height += (eyeHeight - overflow$height) * 0.5f; 69 | } else { 70 | overflow$height = eyeHeight; 71 | } 72 | DebugOverlayHook.setOverflowEyeHeight(overflow$height); 73 | } 74 | 75 | @Inject(method = "hurtCameraEffect", at = @At("HEAD"), cancellable = true) 76 | public void overflowAnimations$cancelHurtCamera(float partialTicks, CallbackInfo ci) { 77 | if (OldAnimationsSettings.noHurtCam && OldAnimationsSettings.INSTANCE.enabled) 78 | ci.cancel(); 79 | } 80 | 81 | @Redirect(method = "setupViewBobbing", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;rotate(FFFF)V", ordinal = 2)) 82 | public void overflowAnimations$modernBobbing(float angle, float x, float y, float z) { 83 | if (!OldAnimationsSettings.modernBobbing || !OldAnimationsSettings.INSTANCE.enabled) { 84 | GlStateManager.rotate(angle, x, y, z); 85 | } 86 | } 87 | 88 | @Inject(method = "updateCameraAndRender", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiIngame;renderGameOverlay(F)V")) 89 | private void draw(float partialTicks, long nanoTime, CallbackInfo ci) { 90 | if (OldAnimationsSettings.INSTANCE.debugCrosshairMode == 2 && 91 | OldAnimationsSettings.INSTANCE.enabled && mc.gameSettings.showDebugInfo && !mc.thePlayer.hasReducedDebug() && 92 | !mc.gameSettings.reducedDebugInfo) { 93 | setupOverlayRendering(); 94 | DebugCrosshairHook.renderDirections(partialTicks, mc); 95 | } 96 | } 97 | 98 | } 99 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/ForgeHooksClientMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import org.polyfrost.overflowanimations.hooks.TransformTypeHook; 4 | import net.minecraft.client.renderer.block.model.ItemCameraTransforms; 5 | import net.minecraft.client.resources.model.IBakedModel; 6 | import net.minecraftforge.client.ForgeHooksClient; 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(value = ForgeHooksClient.class, remap = false) 13 | public class ForgeHooksClientMixin { 14 | 15 | @Inject(method = "handleCameraTransforms", at = @At("HEAD")) 16 | private static void overflowAnimations$getCameraPerspective(IBakedModel model, ItemCameraTransforms.TransformType cameraTransformType, CallbackInfoReturnable cir) { 17 | TransformTypeHook.transform = cameraTransformType; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/GuiIngameForgeMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.client.gui.FontRenderer; 5 | import net.minecraft.client.gui.GuiIngame; 6 | import net.minecraft.client.gui.ScaledResolution; 7 | import net.minecraftforge.client.GuiIngameForge; 8 | import org.objectweb.asm.Opcodes; 9 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 10 | import org.polyfrost.overflowanimations.hooks.DebugCrosshairHook; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.Shadow; 13 | import org.spongepowered.asm.mixin.injection.At; 14 | import org.spongepowered.asm.mixin.injection.Inject; 15 | import org.spongepowered.asm.mixin.injection.ModifyVariable; 16 | import org.spongepowered.asm.mixin.injection.Redirect; 17 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 18 | 19 | @Mixin(GuiIngameForge.class) 20 | public class GuiIngameForgeMixin extends GuiIngame { 21 | 22 | @Shadow(remap = false) private ScaledResolution res; 23 | 24 | public GuiIngameForgeMixin(Minecraft minecraft) { 25 | super(minecraft); 26 | } 27 | 28 | @Redirect(method = "renderHUDText", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/client/GuiIngameForge;drawRect(IIIII)V")) 29 | private void overflowAnimations$cancelBackgroundDrawing(int left, int top, int right, int bottom, int color) { 30 | if (!OldAnimationsSettings.INSTANCE.enabled || !(OldAnimationsSettings.INSTANCE.debugScreenMode == 0 || 31 | OldAnimationsSettings.INSTANCE.debugScreenMode == 2)) { 32 | GuiIngameForge.drawRect(left, top, right, bottom, color); 33 | } 34 | } 35 | 36 | @Redirect(method = "renderHUDText", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/FontRenderer;drawString(Ljava/lang/String;III)I")) 37 | private int overflowAnimations$removeShadow(FontRenderer fontRenderer, String text, int x, int y, int color) { 38 | return fontRenderer.drawString(text, x, y, color, (OldAnimationsSettings.INSTANCE.debugScreenMode == 0 || OldAnimationsSettings.INSTANCE.debugScreenMode == 2) 39 | && OldAnimationsSettings.INSTANCE.enabled); 40 | } 41 | 42 | @ModifyVariable(method = "renderHealth", at = @At(value = "LOAD", ordinal = 1), index = 5, remap = false) 43 | private boolean overflowAnimations$cancelFlash(boolean original) { 44 | return (!OldAnimationsSettings.oldHealth || !OldAnimationsSettings.INSTANCE.enabled) && original; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/GuiIngameMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import net.minecraft.client.gui.GuiIngame; 4 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 9 | 10 | @Mixin(value = GuiIngame.class, priority = 1001) 11 | public class GuiIngameMixin { 12 | 13 | @Inject(method = "showCrosshair", at = @At("HEAD"), cancellable = true) 14 | public void overflowAnimations$renderCrosshair(CallbackInfoReturnable cir) { 15 | if (OldAnimationsSettings.INSTANCE.debugCrosshairMode == 0 && OldAnimationsSettings.INSTANCE.enabled) { 16 | cir.setReturnValue(true); 17 | } 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/GuiOverlayDebugMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 4 | import org.polyfrost.overflowanimations.hooks.DebugOverlayHook; 5 | import net.minecraft.client.gui.GuiOverlayDebug; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 10 | 11 | import java.util.List; 12 | 13 | @Mixin(GuiOverlayDebug.class) 14 | public abstract class GuiOverlayDebugMixin { 15 | 16 | @Inject(method = "call", at = @At("HEAD"), cancellable = true) 17 | public void overflowAnimations$oldDebugLeft(CallbackInfoReturnable> cir) { 18 | if (OldAnimationsSettings.INSTANCE.debugScreenMode == 0 && OldAnimationsSettings.INSTANCE.enabled) { 19 | cir.setReturnValue(DebugOverlayHook.getDebugInfoLeft()); 20 | } 21 | } 22 | 23 | @Inject(method = "getDebugInfoRight", at = @At("HEAD"), cancellable = true) 24 | public void overflowAnimations$oldDebugRight(CallbackInfoReturnable> cir) { 25 | if (OldAnimationsSettings.INSTANCE.debugScreenMode == 0 && OldAnimationsSettings.INSTANCE.enabled) { 26 | cir.setReturnValue(DebugOverlayHook.getDebugInfoRight()); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/GuiPlayerTabOverlayMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 4 | import org.polyfrost.overflowanimations.hooks.TabOverlayHook; 5 | import com.google.common.collect.Ordering; 6 | import net.minecraft.client.gui.GuiPlayerTabOverlay; 7 | import net.minecraft.client.network.NetworkPlayerInfo; 8 | import net.minecraft.scoreboard.ScoreObjective; 9 | import net.minecraft.scoreboard.Scoreboard; 10 | import org.spongepowered.asm.mixin.Final; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.Shadow; 13 | import org.spongepowered.asm.mixin.injection.At; 14 | import org.spongepowered.asm.mixin.injection.Inject; 15 | import org.spongepowered.asm.mixin.injection.ModifyVariable; 16 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 17 | 18 | @Mixin(value = GuiPlayerTabOverlay.class, priority = 999) 19 | public abstract class GuiPlayerTabOverlayMixin { 20 | 21 | @Shadow 22 | @Final 23 | private static Ordering field_175252_a; 24 | 25 | @Inject(method = "renderPlayerlist", at = @At("HEAD"), cancellable = true) 26 | public void overflowAnimations$renderOldTab(int width, Scoreboard scoreboardIn, ScoreObjective var37, CallbackInfo ci) { 27 | if (OldAnimationsSettings.INSTANCE.tabMode == 0 && OldAnimationsSettings.INSTANCE.enabled) { 28 | ci.cancel(); 29 | TabOverlayHook.renderOldTab(((GuiPlayerTabOverlay) (Object) this), var37, field_175252_a); 30 | } 31 | } 32 | 33 | @ModifyVariable(method = "renderPlayerlist", at = @At("STORE"), index = 11) 34 | private boolean overflowAnimations$disablePlayerHead(boolean original) { 35 | return (OldAnimationsSettings.INSTANCE.tabMode != 2 || !OldAnimationsSettings.INSTANCE.enabled) && original; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/ItemMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.client.gui.inventory.GuiContainer; 5 | import net.minecraft.item.Item; 6 | import net.minecraft.item.ItemStack; 7 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 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 | @Mixin(Item.class) 14 | public class ItemMixin { 15 | 16 | @Inject(method = "shouldCauseReequipAnimation", at = @At("HEAD"), cancellable = true, remap = false) 17 | public void overflowAnimations$modifyReequip(ItemStack oldStack, ItemStack newStack, boolean slotChanged, CallbackInfoReturnable cir) { 18 | if (OldAnimationsSettings.INSTANCE.enabled) { 19 | if (OldAnimationsSettings.INSTANCE.itemSwitchMode == 0) { 20 | cir.setReturnValue(false); 21 | } else if (OldAnimationsSettings.fixReequip && OldAnimationsSettings.INSTANCE.itemSwitchMode != 1 && !slotChanged) { 22 | cir.setReturnValue(false); 23 | } else if (OldAnimationsSettings.INSTANCE.itemSwitchMode == 1) { 24 | cir.setReturnValue(!OldAnimationsSettings.fixReequip || slotChanged || Minecraft.getMinecraft().currentScreen instanceof GuiContainer); 25 | } 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/ItemModelMesherMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import net.minecraft.client.renderer.ItemModelMesher; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | 6 | @Mixin(ItemModelMesher.class) 7 | public class ItemModelMesherMixin { 8 | 9 | // @Inject( 10 | // method = "getItemModel(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/client/resources/model/IBakedModel;", 11 | // at = @At( 12 | // value = "HEAD" 13 | // ), 14 | // cancellable = true 15 | // ) 16 | // private void overflowanimations$useCustomBlockModel(ItemStack stack, CallbackInfoReturnable cir) { 17 | // if (stack == null) return; 18 | // if (!OldAnimationsSettings.oldSkulls || !OldAnimationsSettings.INSTANCE.enabled) return; 19 | // if (stack.getItem() instanceof ItemSkull) { 20 | // cir.setReturnValue(SkullModelHook.INSTANCE.getSkullModel(stack)); 21 | // } 22 | // } 23 | 24 | } -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/ItemPotionMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import net.minecraft.item.ItemPotion; 4 | import net.minecraft.item.ItemStack; 5 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 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(ItemPotion.class) 13 | public abstract class ItemPotionMixin { 14 | 15 | @Shadow public abstract int getColorFromDamage(int meta); 16 | 17 | @Inject(method = "getColorFromItemStack", at = @At("HEAD"), cancellable = true) 18 | public void overflowAnimations$allowPotColors(ItemStack stack, int renderPass, CallbackInfoReturnable cir) { 19 | if (OldAnimationsSettings.coloredBottles && OldAnimationsSettings.INSTANCE.enabled) { 20 | cir.setReturnValue(getColorFromDamage(stack.getMetadata())); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/ItemRendererMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.client.entity.AbstractClientPlayer; 5 | import net.minecraft.client.entity.EntityPlayerSP; 6 | import net.minecraft.client.renderer.GlStateManager; 7 | import net.minecraft.client.renderer.ItemRenderer; 8 | import net.minecraft.client.renderer.entity.RenderItem; 9 | import net.minecraft.entity.player.EntityPlayer; 10 | import net.minecraft.item.ItemStack; 11 | import net.minecraft.item.ItemSword; 12 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 13 | import org.spongepowered.asm.mixin.*; 14 | import org.spongepowered.asm.mixin.injection.*; 15 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 16 | 17 | @Mixin(ItemRenderer.class) 18 | public abstract class ItemRendererMixin { 19 | 20 | @Shadow @Final private Minecraft mc; 21 | @Shadow private int equippedItemSlot; 22 | @Shadow private ItemStack itemToRender; 23 | @Shadow @Final private RenderItem itemRenderer; 24 | @Shadow protected abstract void rotateWithPlayerRotations(EntityPlayerSP entityplayerspIn, float partialTicks); 25 | @Unique private static float overflowAnimations$f1 = 0.0F; 26 | 27 | @ModifyVariable( 28 | method = "renderItemInFirstPerson", 29 | at = @At( 30 | value = "STORE" 31 | ), 32 | index = 4 33 | ) 34 | private float overflowAnimations$captureF1(float f1) { 35 | overflowAnimations$f1 = f1; 36 | return f1; 37 | } 38 | 39 | @ModifyArg(method = "renderItemInFirstPerson", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/ItemRenderer;transformFirstPersonItem(FF)V"), 40 | slice = @Slice( 41 | from = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/ItemRenderer;performDrinking(Lnet/minecraft/client/entity/AbstractClientPlayer;F)V"), 42 | to = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/ItemRenderer;doBowTransformations(FLnet/minecraft/client/entity/AbstractClientPlayer;)V") 43 | ), index = 1 44 | ) 45 | private float overflowAnimations$useF1(float swingProgress) { 46 | if (OldAnimationsSettings.oldBlockhitting && OldAnimationsSettings.INSTANCE.enabled) { 47 | return overflowAnimations$f1; 48 | } 49 | return swingProgress; 50 | } 51 | 52 | @Inject(method = "doBowTransformations", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;scale(FFF)V")) 53 | private void overflowAnimations$preBowTransform(float partialTicks, AbstractClientPlayer clientPlayer, CallbackInfo ci) { 54 | if (OldAnimationsSettings.firstTransformations && !OldAnimationsSettings.lunarPositions && OldAnimationsSettings.INSTANCE.enabled) { 55 | GlStateManager.rotate(-335.0F, 0.0F, 0.0F, 1.0F); 56 | GlStateManager.rotate(-50.0F, 0.0F, 1.0F, 0.0F); 57 | GlStateManager.translate(0.0F, 0.5F, 0.0F); 58 | } 59 | } 60 | 61 | @Inject(method = "doBowTransformations", at = @At(value = "TAIL")) 62 | private void overflowAnimations$postBowTransform(float partialTicks, AbstractClientPlayer clientPlayer, CallbackInfo ci) { 63 | if (OldAnimationsSettings.firstTransformations && !OldAnimationsSettings.lunarPositions && OldAnimationsSettings.INSTANCE.enabled) { 64 | GlStateManager.translate(0.0F, -0.5F, 0.0F); 65 | GlStateManager.rotate(50.0F, 0.0F, 1.0F, 0.0F); 66 | GlStateManager.rotate(335.0F, 0.0F, 0.0F, 1.0F); 67 | } 68 | } 69 | 70 | @Inject(method = "renderItemInFirstPerson", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/ItemRenderer;renderItem(Lnet/minecraft/entity/EntityLivingBase;Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/renderer/block/model/ItemCameraTransforms$TransformType;)V")) 71 | private void overflowAnimations$firstPersonItemPositions(float partialTicks, CallbackInfo ci) { 72 | if (OldAnimationsSettings.INSTANCE.enabled && !OldAnimationsSettings.lunarPositions && !itemRenderer.shouldRenderItemIn3D(itemToRender)) { 73 | if ((OldAnimationsSettings.fishingRodPosition && itemToRender.getItem().shouldRotateAroundWhenRendering())) { 74 | GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F); 75 | overflowAnimations$itemTransforms(); 76 | } else if (OldAnimationsSettings.firstTransformations && !(itemToRender.getItem() instanceof ItemSword && OldAnimationsSettings.lunarBlockhit)) { 77 | overflowAnimations$itemTransforms(); 78 | } 79 | } 80 | } 81 | 82 | @Redirect(method = "renderItemInFirstPerson", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/ItemRenderer;rotateWithPlayerRotations(Lnet/minecraft/client/entity/EntityPlayerSP;F)V")) 83 | private void overflowAnimations$removeRotations(ItemRenderer instance, EntityPlayerSP entityPlayerSP, float v) { 84 | if (!OldAnimationsSettings.oldItemRotations || !OldAnimationsSettings.INSTANCE.enabled) { 85 | rotateWithPlayerRotations(entityPlayerSP, v); 86 | } 87 | } 88 | 89 | @Unique 90 | private static void overflowAnimations$itemTransforms() { 91 | float scale = 1.5F / 1.7F; 92 | GlStateManager.scale(scale, scale, scale); 93 | GlStateManager.rotate(5.0F, 0.0F, 1.0F, 0.0F); 94 | GlStateManager.translate(-0.29F, 0.149F, -0.0328F); 95 | } 96 | 97 | @ModifyConstant(method = "updateEquippedItem", constant = @Constant(floatValue = 0.4F)) 98 | private float overflowAnimations$changeEquipSpeed(float original) { 99 | return OldAnimationsSettings.INSTANCE.enabled ? OldAnimationsSettings.INSTANCE.reequipSpeed : original; 100 | } 101 | 102 | @Inject(method = "resetEquippedProgress", at = @At(value = "HEAD"), cancellable = true) 103 | private void overflowAnimations$disableReEquip1(CallbackInfo ci) { 104 | if (OldAnimationsSettings.INSTANCE.itemSwitchMode == 0 && OldAnimationsSettings.INSTANCE.enabled) { 105 | ci.cancel(); 106 | } 107 | } 108 | 109 | @Inject(method = "resetEquippedProgress2", at = @At(value = "HEAD"), cancellable = true) 110 | private void overflowAnimations$disableReEquip2(CallbackInfo ci) { 111 | if (OldAnimationsSettings.INSTANCE.itemSwitchMode == 0 && OldAnimationsSettings.INSTANCE.enabled) { 112 | ci.cancel(); 113 | } 114 | } 115 | 116 | @ModifyVariable( 117 | method = "updateEquippedItem", 118 | at = @At( 119 | value = "STORE", 120 | ordinal = 3 121 | ), 122 | index = 3 123 | ) 124 | public boolean overflowAnimations$disableReEquip(boolean flag) { 125 | if (OldAnimationsSettings.INSTANCE.itemSwitchMode == 0 && OldAnimationsSettings.INSTANCE.enabled) { 126 | EntityPlayer entityplayer = this.mc.thePlayer; 127 | this.itemToRender = entityplayer.inventory.getCurrentItem(); 128 | this.equippedItemSlot = entityplayer.inventory.currentItem; 129 | return false; 130 | } 131 | return flag; 132 | } 133 | 134 | } 135 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/ItemStackMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.item.ItemStack; 5 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 6 | import org.polyfrost.overflowanimations.mixin.interfaces.ItemRendererInvoker; 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(ItemStack.class) 13 | public abstract class ItemStackMixin { 14 | 15 | @Inject(method = "getIsItemStackEqual", at = @At("RETURN"), cancellable = true) 16 | public void overflowAnimations$modifyReequip(ItemStack p_179549_1_, CallbackInfoReturnable cir) { 17 | Minecraft mc = Minecraft.getMinecraft(); 18 | if (OldAnimationsSettings.INSTANCE.itemSwitchMode == 1 && OldAnimationsSettings.INSTANCE.enabled) { 19 | int currentItem = mc.thePlayer.inventory.currentItem; 20 | int equippedProgress = ((ItemRendererInvoker) mc.getItemRenderer()).getEquippedItemSlot(); 21 | cir.setReturnValue(cir.getReturnValue() && equippedProgress == currentItem); 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/LayerArmorBaseMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import net.minecraft.client.model.ModelBase; 4 | import net.minecraft.client.renderer.entity.RendererLivingEntity; 5 | import net.minecraft.client.renderer.entity.layers.LayerArmorBase; 6 | import net.minecraft.client.renderer.entity.layers.LayerRenderer; 7 | import net.minecraft.entity.EntityLivingBase; 8 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 9 | import org.polyfrost.overflowanimations.mixin.interfaces.RendererLivingEntityInvoker; 10 | import org.spongepowered.asm.mixin.Final; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.Shadow; 13 | import org.spongepowered.asm.mixin.Unique; 14 | import org.spongepowered.asm.mixin.injection.*; 15 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 16 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 17 | 18 | @Mixin(LayerArmorBase.class) 19 | public abstract class LayerArmorBaseMixin implements LayerRenderer { 20 | 21 | @Shadow @Final private RendererLivingEntity renderer; 22 | @Unique private static ModelBase overflowAnimations$t = null; 23 | 24 | @ModifyVariable( 25 | method = "renderLayer", at = @At(value = "STORE"), 26 | index = 12 27 | ) 28 | private T overflowAnimations$captureT(T t) { 29 | overflowAnimations$t = t; 30 | return t; 31 | } 32 | 33 | @Inject(method = "renderLayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelBase;render(Lnet/minecraft/entity/Entity;FFFFFF)V", shift = At.Shift.AFTER)) 34 | public void overflowAnimations$addRender(EntityLivingBase entitylivingbaseIn, float p_177182_2_, float p_177182_3_, float partialTicks, float p_177182_5_, float p_177182_6_, float p_177182_7_, float scale, int armorSlot, CallbackInfo ci) { 35 | if (OldAnimationsSettings.INSTANCE.armorDamageTintStyle == 3 && OldAnimationsSettings.INSTANCE.enabled && ((RendererLivingEntityInvoker) renderer).invokeSetDoRenderBrightness(entitylivingbaseIn, partialTicks)) { 36 | overflowAnimations$t.render(entitylivingbaseIn, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, scale); 37 | ((RendererLivingEntityInvoker) renderer).invokeUnsetBrightness(); 38 | } 39 | } 40 | 41 | @Inject(method = "shouldCombineTextures", at = @At(value = "HEAD"), cancellable = true) 42 | public void overflowAnimations$allowCombine(CallbackInfoReturnable cir) { 43 | cir.setReturnValue((OldAnimationsSettings.INSTANCE.armorDamageTintStyle == 2 || OldAnimationsSettings.INSTANCE.armorDamageTintStyle == 4) && OldAnimationsSettings.INSTANCE.enabled); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/LayerArmorBaseMixin_New.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 4 | import net.minecraft.client.model.ModelBase; 5 | import net.minecraft.client.renderer.OpenGlHelper; 6 | import net.minecraft.client.renderer.entity.layers.LayerArmorBase; 7 | import net.minecraft.client.renderer.entity.layers.LayerRenderer; 8 | import net.minecraft.entity.EntityLivingBase; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.Unique; 11 | import org.spongepowered.asm.mixin.injection.At; 12 | import org.spongepowered.asm.mixin.injection.Inject; 13 | import org.spongepowered.asm.mixin.injection.ModifyArgs; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | import org.spongepowered.asm.mixin.injection.invoke.arg.Args; 16 | 17 | /** 18 | * Modified from Skyblockcatia under MIT License 19 | * ... 20 | */ 21 | @Mixin(LayerArmorBase.class) 22 | public abstract class LayerArmorBaseMixin_New implements LayerRenderer { 23 | 24 | @Inject(method = "renderGlint(Lnet/minecraft/entity/EntityLivingBase;Lnet/minecraft/client/model/ModelBase;FFFFFFF)V", at = @At(value = "INVOKE", target = "net/minecraft/client/renderer/GlStateManager.color(FFFF)V", ordinal = 0)) 25 | private void overflowAnimations$renderNewArmorGlintPre(EntityLivingBase entitylivingbaseIn, T modelbaseIn, float p_177183_3_, float p_177183_4_, float p_177183_5_, float p_177183_6_, float p_177183_7_, float p_177183_8_, float p_177183_9_, CallbackInfo info) { 26 | if (OldAnimationsSettings.enchantmentGlintNew && OldAnimationsSettings.INSTANCE.enabled) { 27 | float light = 240.0F; 28 | OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, light, light); 29 | } 30 | } 31 | 32 | @Inject(method = "renderGlint(Lnet/minecraft/entity/EntityLivingBase;Lnet/minecraft/client/model/ModelBase;FFFFFFF)V", at = @At(value = "INVOKE", target = "net/minecraft/client/model/ModelBase.render(Lnet/minecraft/entity/Entity;FFFFFF)V")) 33 | private void overflowAnimations$renderNewArmorGlintPost(EntityLivingBase entitylivingbaseIn, T modelbaseIn, float p_177183_3_, float p_177183_4_, float partialTicks, float p_177183_6_, float p_177183_7_, float p_177183_8_, float scale, CallbackInfo ci) { 34 | if (OldAnimationsSettings.enchantmentGlintNew && OldAnimationsSettings.INSTANCE.enabled) { 35 | int i = entitylivingbaseIn.getBrightnessForRender(partialTicks); 36 | int j = i % 65536; 37 | int k = i / 65536; 38 | OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j, k); 39 | } 40 | } 41 | 42 | @ModifyArgs(method = "renderGlint(Lnet/minecraft/entity/EntityLivingBase;Lnet/minecraft/client/model/ModelBase;FFFFFFF)V", at = @At(value = "INVOKE", target = "net/minecraft/client/renderer/GlStateManager.color(FFFF)V", ordinal = 1)) 43 | private void overflowAnimations$newArmorGlintColor(Args args) { 44 | if (OldAnimationsSettings.enchantmentGlintNew && OldAnimationsSettings.INSTANCE.enabled) { 45 | int rgb = overflowAnimations$getRGB((int) (((float) args.get(0)) * 255), (int) (((float) args.get(1)) * 255), (int) (((float) args.get(2)) * 255), (int) (((float) args.get(3)) * 255)); 46 | if (rgb == -8372020 || rgb == -10473317) { 47 | args.set(0, 0.5608F); 48 | args.set(1, 0.3408F); 49 | args.set(2, 0.8608F); 50 | args.set(3, 1.0F); 51 | } 52 | } 53 | } 54 | 55 | @Unique 56 | private static int overflowAnimations$getRGB(int r, int g, int b, int a) { 57 | return ((a & 0xFF) << 24) | 58 | ((r & 0xFF) << 16) | 59 | ((g & 0xFF) << 8) | 60 | ((b & 0xFF)); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/LayerHeldItemMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.client.entity.AbstractClientPlayer; 5 | import net.minecraft.client.renderer.GlStateManager; 6 | import net.minecraft.client.renderer.entity.layers.LayerHeldItem; 7 | import net.minecraft.entity.EntityLivingBase; 8 | import net.minecraft.entity.player.EntityPlayer; 9 | import net.minecraft.init.Items; 10 | import net.minecraft.item.*; 11 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 12 | import org.spongepowered.asm.mixin.Mixin; 13 | import org.spongepowered.asm.mixin.Unique; 14 | import org.spongepowered.asm.mixin.injection.At; 15 | import org.spongepowered.asm.mixin.injection.Inject; 16 | import org.spongepowered.asm.mixin.injection.ModifyArg; 17 | import org.spongepowered.asm.mixin.injection.Redirect; 18 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 19 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 20 | import org.spongepowered.asm.mixin.injection.callback.LocalCapture; 21 | 22 | @Mixin(LayerHeldItem.class) 23 | public abstract class LayerHeldItemMixin { 24 | 25 | @Unique 26 | public ItemStack simpliefied$itemStack; 27 | 28 | @Inject(method = "doRenderLayer", at = @At(value = "HEAD")) 29 | private void overflowAnimations$hookHeldItem(EntityLivingBase entitylivingbaseIn, float f, float g, float partialTicks, float h, float i, float j, float scale, CallbackInfo ci) { 30 | simpliefied$itemStack = entitylivingbaseIn.getHeldItem(); 31 | } 32 | 33 | @Inject(method = "doRenderLayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelBiped;postRenderArm(F)V")) 34 | private void overflowAnimations$applyOldSneaking(EntityLivingBase entitylivingbaseIn, float f, float g, float partialTicks, float h, float i, float j, float scale, CallbackInfo ci) { 35 | if (OldAnimationsSettings.INSTANCE.enabled && entitylivingbaseIn.isSneaking()) { 36 | GlStateManager.translate(0.0F, 0.2F, 0.0F); 37 | } 38 | } 39 | 40 | @Redirect(method = "doRenderLayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/EntityLivingBase;isSneaking()Z")) 41 | private boolean overflowAnimations$cancelNewSneaking(EntityLivingBase instance) { 42 | return instance.isSneaking() && !OldAnimationsSettings.INSTANCE.enabled; 43 | } 44 | 45 | @Inject(method = "doRenderLayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;getItem()Lnet/minecraft/item/Item;"), locals = LocalCapture.CAPTURE_FAILHARD) 46 | private void overflowAnimations$changeItemToStick(EntityLivingBase entitylivingbaseIn, float f, float g, float partialTicks, float h, float i, float j, float scale, CallbackInfo ci, ItemStack itemStack) { 47 | if (entitylivingbaseIn instanceof EntityPlayer && ((EntityPlayer)entitylivingbaseIn).fishEntity != null) { 48 | simpliefied$itemStack = new ItemStack(Items.stick, 0); 49 | } 50 | } 51 | 52 | @Redirect(method = "doRenderLayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;getItem()Lnet/minecraft/item/Item;")) 53 | private Item overflowAnimations$replaceStack(ItemStack instance) { 54 | return OldAnimationsSettings.fishingStick && OldAnimationsSettings.INSTANCE.enabled ? simpliefied$itemStack.getItem() : instance.getItem(); 55 | } 56 | 57 | @Inject(method = "doRenderLayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/ItemRenderer;renderItem(Lnet/minecraft/entity/EntityLivingBase;Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/renderer/block/model/ItemCameraTransforms$TransformType;)V"), locals = LocalCapture.CAPTURE_FAILHARD) 58 | private void overflowAnimations$thirdPersonItemPositions(EntityLivingBase entitylivingbaseIn, float f, float g, float partialTicks, float h, float i, float j, float s, CallbackInfo ci, ItemStack stack, Item item) { 59 | if (OldAnimationsSettings.INSTANCE.enabled) { 60 | if (OldAnimationsSettings.thirdPersonBlock && entitylivingbaseIn instanceof AbstractClientPlayer && ((AbstractClientPlayer) entitylivingbaseIn).isBlocking()) { 61 | GlStateManager.translate(0.05F, 0.0F, -0.1F); 62 | GlStateManager.rotate(-50.0F, 0.0F, 1.0F, 0.0F); 63 | GlStateManager.rotate(-10.0F, 1.0F, 0.0F, 0.0F); 64 | GlStateManager.rotate(-60.0F, 0.0F, 0.0F, 1.0F); 65 | } 66 | if (OldAnimationsSettings.thirdTransformations && (entitylivingbaseIn instanceof EntityPlayer || !OldAnimationsSettings.entityTransforms) 67 | && !Minecraft.getMinecraft().getRenderItem().shouldRenderItemIn3D(stack) && !(stack.getItem() instanceof ItemSkull || stack.getItem() instanceof ItemBanner)) { 68 | float scale = 1.5F * 0.625F; 69 | if (item instanceof ItemBow) { 70 | GlStateManager.rotate(-12.0F, 0.0f, 1.0f, 0.0f); 71 | GlStateManager.rotate(-7.0F, 1.0f, 0.0f, 0.0f); 72 | GlStateManager.rotate(10.0F, 0.0f, 0.0f, 1.0f); 73 | GlStateManager.rotate(1.0F, 0.0f, 1.0f, 0.0f); 74 | GlStateManager.rotate(-4.5F, 1.0f, 0.0f, 0.0f); 75 | GlStateManager.rotate(-1.5F, 0.0f, 0.0f, 1.0f); 76 | GlStateManager.translate(0.022F, -0.01F, -0.108F); 77 | GlStateManager.scale(scale, scale, scale); 78 | } else if (item.isFull3D()) { 79 | if (item.shouldRotateAroundWhenRendering()) { 80 | GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F); 81 | } 82 | GlStateManager.scale(scale / 0.85F, scale / 0.85F, scale / 0.85F); 83 | GlStateManager.rotate(-2.4F, 0.0F, 1.0F, 0.0F); 84 | GlStateManager.rotate(-20.0F, 1.0F, 0.0F, 0.0F); 85 | GlStateManager.rotate(4.5F, 0.0F, 0.0F, 1.0F); 86 | GlStateManager.translate(-0.013F, 0.01F, 0.125F); 87 | } else { 88 | scale = 1.5F * 0.375F; 89 | GlStateManager.scale(scale / 0.55, scale / 0.55, scale / 0.55); 90 | GlStateManager.rotate(-195.0F, 0.0F, 1.0F, 0.0F); 91 | GlStateManager.rotate(-168.0F, 1.0F, 0.0F, 0.0F); 92 | GlStateManager.rotate(15.0F, 0.0F, 0.0F, 1.0F); 93 | GlStateManager.translate(-0.047F, -0.28F, 0.038F); 94 | } 95 | } 96 | } 97 | } 98 | 99 | @ModifyArg(method = "doRenderLayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/ItemRenderer;renderItem(Lnet/minecraft/entity/EntityLivingBase;Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/renderer/block/model/ItemCameraTransforms$TransformType;)V")) 100 | private ItemStack overflowAnimations$replaceStack2(ItemStack heldStack) { 101 | return OldAnimationsSettings.fishingStick && OldAnimationsSettings.INSTANCE.enabled ? simpliefied$itemStack : heldStack; 102 | } 103 | 104 | @Inject(method = "shouldCombineTextures", at = @At(value = "HEAD"), cancellable = true) 105 | public void overflowAnimations$allowCombine(CallbackInfoReturnable cir) { 106 | cir.setReturnValue(OldAnimationsSettings.damageHeldItems && OldAnimationsSettings.INSTANCE.enabled); 107 | } 108 | 109 | } 110 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/MinecraftMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.client.entity.EntityPlayerSP; 5 | import net.minecraft.client.multiplayer.PlayerControllerMP; 6 | import net.minecraft.client.multiplayer.WorldClient; 7 | import net.minecraft.client.particle.EffectRenderer; 8 | import net.minecraft.client.renderer.EntityRenderer; 9 | import net.minecraft.client.settings.GameSettings; 10 | import net.minecraft.enchantment.EnchantmentHelper; 11 | import net.minecraft.entity.EntityLivingBase; 12 | import net.minecraft.item.EnumAction; 13 | import net.minecraft.potion.Potion; 14 | import net.minecraft.util.BlockPos; 15 | import net.minecraft.util.MovingObjectPosition; 16 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 17 | import org.polyfrost.overflowanimations.hooks.SwingHook; 18 | import org.spongepowered.asm.mixin.Mixin; 19 | import org.spongepowered.asm.mixin.Shadow; 20 | import org.spongepowered.asm.mixin.injection.At; 21 | import org.spongepowered.asm.mixin.injection.Inject; 22 | import org.spongepowered.asm.mixin.injection.Redirect; 23 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 24 | 25 | @Mixin(Minecraft.class) 26 | public abstract class MinecraftMixin { 27 | 28 | @Shadow 29 | public MovingObjectPosition objectMouseOver; 30 | @Shadow 31 | public EffectRenderer effectRenderer; 32 | @Shadow 33 | public EntityPlayerSP thePlayer; 34 | @Shadow 35 | public WorldClient theWorld; 36 | @Shadow 37 | private int leftClickCounter; 38 | 39 | @Shadow public GameSettings gameSettings; 40 | 41 | @Shadow public EntityRenderer entityRenderer; 42 | 43 | @Inject(method = "sendClickBlockToController", at = @At("HEAD")) 44 | public void overflowAnimations$blockHitAnimation(boolean leftClick, CallbackInfo ci) { 45 | if (OldAnimationsSettings.oldBlockhitting && OldAnimationsSettings.punching && OldAnimationsSettings.INSTANCE.enabled && gameSettings.keyBindUseItem.isKeyDown()) { 46 | if (leftClickCounter <= 0 && leftClick && objectMouseOver != null 47 | //todo: fix the logic 48 | && ((thePlayer.isUsingItem() && objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) || !OldAnimationsSettings.adventurePunching)) { 49 | BlockPos posBlock = objectMouseOver.getBlockPos(); 50 | if (!theWorld.isAirBlock(posBlock)) { 51 | if ((thePlayer.isAllowEdit() || !OldAnimationsSettings.adventureParticles) && OldAnimationsSettings.punchingParticles) { 52 | effectRenderer.addBlockHitEffects(posBlock, objectMouseOver.sideHit); 53 | } 54 | if ((thePlayer.isAllowEdit() || !OldAnimationsSettings.adventureBlockHit)) { 55 | SwingHook.swingItem(); 56 | } 57 | } 58 | } 59 | } 60 | } 61 | 62 | @Inject(method = "clickMouse", at = @At(value = "TAIL")) 63 | public void overflowAnimations$onHitParticles(CallbackInfo ci) { 64 | if (OldAnimationsSettings.visualSwing && OldAnimationsSettings.INSTANCE.enabled && leftClickCounter > 0) { 65 | if (objectMouseOver != null && objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && 66 | !objectMouseOver.entityHit.hitByEntity(thePlayer) && objectMouseOver.entityHit instanceof EntityLivingBase) { 67 | if (thePlayer.fallDistance > 0.0F && !thePlayer.onGround && !thePlayer.isOnLadder() && 68 | !thePlayer.isInWater() && !thePlayer.isPotionActive(Potion.blindness) && thePlayer.ridingEntity == null) { 69 | thePlayer.onCriticalHit(objectMouseOver.entityHit); 70 | } 71 | if (EnchantmentHelper.getModifierForCreature(thePlayer.getHeldItem(), 72 | ((EntityLivingBase)objectMouseOver.entityHit).getCreatureAttribute()) > 0.0F) { 73 | thePlayer.onEnchantmentCritical(objectMouseOver.entityHit); 74 | } 75 | } 76 | SwingHook.swingItem(); 77 | } 78 | } 79 | 80 | @Redirect(method = "rightClickMouse", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/multiplayer/PlayerControllerMP;getIsHittingBlock()Z")) 81 | public boolean overflowAnimations$enabledRightClick(PlayerControllerMP instance) { 82 | return (!OldAnimationsSettings.oldBlockhitting || !OldAnimationsSettings.INSTANCE.enabled) && instance.getIsHittingBlock(); 83 | } 84 | 85 | @Inject(method = "runTick", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/settings/KeyBinding;isPressed()Z", ordinal = 7)) 86 | public void overflowAnimations$fakeBlockHit(CallbackInfo ci) { 87 | if (OldAnimationsSettings.fakeBlockHit && OldAnimationsSettings.INSTANCE.enabled) { 88 | while (gameSettings.keyBindAttack.isPressed()) { 89 | SwingHook.swingItem(); 90 | } 91 | } 92 | } 93 | 94 | @Inject(method = "runTick", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/entity/EntityPlayerSP;dropOneItem(Z)Lnet/minecraft/entity/item/EntityItem;", shift = At.Shift.AFTER)) 95 | public void overflowAnimations$dropItemSwing(CallbackInfo ci) { 96 | if (OldAnimationsSettings.modernDropSwing && OldAnimationsSettings.INSTANCE.enabled && thePlayer.getHeldItem() != null) { 97 | SwingHook.swingItem(); 98 | } 99 | } 100 | 101 | @Inject(method = "rightClickMouse", at = @At(value = "HEAD")) 102 | public void overflowAnimations$funnyFidgetyThing(CallbackInfo ci) { 103 | if (OldAnimationsSettings.funnyFidget && OldAnimationsSettings.INSTANCE.enabled && thePlayer != null && thePlayer.getHeldItem() != null && thePlayer.getHeldItem().getItemUseAction() != EnumAction.NONE) { 104 | entityRenderer.itemRenderer.resetEquippedProgress(); 105 | } 106 | } 107 | 108 | } 109 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/ModelBipedMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import net.minecraft.client.model.ModelBiped; 4 | import net.minecraft.client.model.ModelRenderer; 5 | import net.minecraft.entity.Entity; 6 | import net.minecraft.util.MathHelper; 7 | import org.objectweb.asm.Opcodes; 8 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.Shadow; 11 | import org.spongepowered.asm.mixin.injection.*; 12 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 13 | 14 | @Mixin(ModelBiped.class) 15 | public class ModelBipedMixin { 16 | 17 | @Shadow public ModelRenderer bipedRightArm; 18 | @Shadow public ModelRenderer bipedLeftArm; 19 | 20 | @Inject( 21 | method = "setRotationAngles", 22 | at = @At(value = "FIELD", opcode = Opcodes.PUTFIELD, target = "Lnet/minecraft/client/model/ModelRenderer;rotateAngleY:F", shift = At.Shift.AFTER), 23 | slice = @Slice( 24 | from = @At(value = "FIELD", opcode = Opcodes.GETFIELD, target = "Lnet/minecraft/client/model/ModelBiped;heldItemRight:I", ordinal = 0), 25 | to = @At(value = "FIELD", opcode = Opcodes.GETFIELD, target = "Lnet/minecraft/client/model/ModelBiped;heldItemRight:I", ordinal = 2) 26 | ) 27 | ) 28 | private void overflowAnimations$reAssignArmPosition(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn, CallbackInfo ci) { 29 | if (!OldAnimationsSettings.oldArmPosition || !OldAnimationsSettings.INSTANCE.enabled) { return; } 30 | bipedRightArm.rotateAngleY = 0.0f; 31 | } 32 | 33 | @Redirect(method = "setRotationAngles", at = @At(value = "FIELD", opcode = Opcodes.PUTFIELD, target = "Lnet/minecraft/client/model/ModelRenderer;rotateAngleZ:F", ordinal = 0)) 34 | private void overflowAnimations$removeField(ModelRenderer instance, float value) { 35 | if (!OldAnimationsSettings.wackyArms || !OldAnimationsSettings.INSTANCE.enabled) { 36 | bipedRightArm.rotateAngleZ = 0.0f; 37 | } 38 | } 39 | 40 | @Redirect(method = "setRotationAngles", at = @At(value = "FIELD", opcode = Opcodes.PUTFIELD, target = "Lnet/minecraft/client/model/ModelRenderer;rotateAngleZ:F", ordinal = 1)) 41 | private void overflowAnimations$removeField2(ModelRenderer instance, float value) { 42 | if (!OldAnimationsSettings.wackyArms || !OldAnimationsSettings.INSTANCE.enabled) { 43 | bipedLeftArm.rotateAngleZ = 0.0f; 44 | } 45 | } 46 | 47 | @Redirect(method = "setRotationAngles", at = @At(value = "FIELD", opcode = Opcodes.PUTFIELD, target = "Lnet/minecraft/client/model/ModelRenderer;rotateAngleZ:F", ordinal = 2)) 48 | private void overflowAnimations$removeField3(ModelRenderer instance, float value) { 49 | if (!OldAnimationsSettings.wackyArms || !OldAnimationsSettings.INSTANCE.enabled) { 50 | bipedRightArm.rotateAngleZ = 0.0f; 51 | } 52 | } 53 | 54 | @Inject(method = "setRotationAngles", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/MathHelper;cos(F)F", ordinal = 2)) 55 | private void overflowAnimations$wackyArms(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn, CallbackInfo ci) { 56 | if (OldAnimationsSettings.wackyArms && OldAnimationsSettings.INSTANCE.enabled) { 57 | bipedRightArm.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float) Math.PI) * 2.0F * limbSwingAmount; 58 | bipedRightArm.rotateAngleZ = (MathHelper.cos(limbSwing * 0.2312F) + 1.0F) * 1.0F * limbSwingAmount; 59 | bipedLeftArm.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 2.0F * limbSwingAmount; 60 | bipedLeftArm.rotateAngleZ = (MathHelper.cos(limbSwing * 0.2812F) - 1.0F) * 1.0F * limbSwingAmount; 61 | } 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/NetHandlerPlayClientMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import net.minecraft.client.network.NetHandlerPlayClient; 4 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.Constant; 7 | import org.spongepowered.asm.mixin.injection.ModifyConstant; 8 | 9 | @Mixin(NetHandlerPlayClient.class) 10 | public abstract class NetHandlerPlayClientMixin { 11 | 12 | @ModifyConstant(method = "handleSpawnExperienceOrb", constant = @Constant(doubleValue = 32.0D)) 13 | private double overflowAnimations$oldXPOrbs(double original) { 14 | return OldAnimationsSettings.oldXPOrbs && OldAnimationsSettings.INSTANCE.enabled ? original / 32.0D : original; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/OnlineIndicatorMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 4 | import org.spongepowered.asm.mixin.Dynamic; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.Pseudo; 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 | @Pseudo 12 | @Mixin(targets = "gg.essential.handlers.OnlineIndicator", remap = false) 13 | public class OnlineIndicatorMixin { 14 | 15 | @Dynamic("Essential") 16 | @Inject(method = "drawTabIndicator", at = @At("HEAD"), cancellable = true, remap = false) 17 | private static void overflowAnimations$removeTabIndicator(CallbackInfo ci) { 18 | if (OldAnimationsSettings.INSTANCE.tabMode == 2 && OldAnimationsSettings.INSTANCE.enabled) 19 | ci.cancel(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/PlayerControllerMPMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import net.minecraft.client.multiplayer.PlayerControllerMP; 4 | import net.minecraft.util.BlockPos; 5 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 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.ModifyArg; 10 | import org.spongepowered.asm.mixin.injection.Redirect; 11 | 12 | @Mixin(PlayerControllerMP.class) 13 | public abstract class PlayerControllerMPMixin { 14 | 15 | @Shadow protected abstract boolean isHittingPosition(BlockPos pos); 16 | @Shadow public abstract boolean getIsHittingBlock(); 17 | 18 | @ModifyArg(method = {"clickBlock", "onPlayerDamageBlock"}, at = @At(value = "INVOKE", target = "Lnet/minecraft/client/multiplayer/WorldClient;sendBlockBreakProgress(ILnet/minecraft/util/BlockPos;I)V"), index = 2) 19 | public int overflowAnimations$fixDelay(int par1) { 20 | return par1 + (OldAnimationsSettings.modernBreak && OldAnimationsSettings.INSTANCE.enabled ? 1 : 0); 21 | } 22 | 23 | @Redirect(method = "onPlayerDamageBlock", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/multiplayer/PlayerControllerMP;isHittingPosition(Lnet/minecraft/util/BlockPos;)Z")) 24 | public boolean overflowAnimations$fixLogic(PlayerControllerMP instance, BlockPos pos) { 25 | return OldAnimationsSettings.breakFix && OldAnimationsSettings.INSTANCE.enabled ? isHittingPosition(pos) && getIsHittingBlock() : isHittingPosition(pos); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/PotionHelperMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import net.minecraft.potion.*; 4 | import net.minecraft.util.IntegerCache; 5 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 6 | import org.polyfrost.overflowanimations.hooks.PotionColors; 7 | import org.spongepowered.asm.mixin.*; 8 | import org.spongepowered.asm.mixin.injection.*; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 10 | 11 | import java.util.Collection; 12 | import java.util.Map; 13 | 14 | import static net.minecraft.potion.PotionHelper.calcPotionLiquidColor; 15 | import static net.minecraft.potion.PotionHelper.getPotionEffects; 16 | 17 | @Mixin(value = PotionHelper.class) 18 | public class PotionHelperMixin { 19 | 20 | @Shadow 21 | @Final 22 | private static Map DATAVALUE_COLORS; 23 | 24 | @Redirect(method = "calcPotionLiquidColor", at = @At(value = "INVOKE", target = "Lnet/minecraft/potion/Potion;getLiquidColor()I")) 25 | private static int overflowAnimations$recolorPotions(Potion instance, Collection collection) { 26 | if (OldAnimationsSettings.modernPotColors && OldAnimationsSettings.INSTANCE.enabled) { 27 | for (PotionEffect potionEffect : collection) { 28 | return PotionColors.POTION_COLORS.get(potionEffect.getPotionID()); 29 | } 30 | } 31 | return instance.getLiquidColor(); 32 | } 33 | 34 | @Inject(method = "getLiquidColor", at = @At("HEAD")) 35 | private static void overflowAnimations$checkColor(int dataValue, boolean bypassCache, CallbackInfoReturnable cir) { 36 | if (PotionColors.shouldReload) { 37 | PotionColors.shouldReload = false; 38 | DATAVALUE_COLORS.clear(); 39 | for (int i : PotionColors.POTION_COLORS.values()) { 40 | int color = calcPotionLiquidColor(getPotionEffects(i, false)); 41 | Integer integer = IntegerCache.getInteger(i); 42 | DATAVALUE_COLORS.put(integer, color); 43 | } 44 | } 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/RenderEntityItemMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.client.renderer.GlStateManager; 5 | import net.minecraft.client.renderer.entity.Render; 6 | import net.minecraft.client.renderer.entity.RenderEntityItem; 7 | import net.minecraft.client.renderer.entity.RenderManager; 8 | import net.minecraft.client.resources.model.IBakedModel; 9 | import net.minecraft.entity.item.EntityItem; 10 | import org.polyfrost.overflowanimations.OverflowAnimations; 11 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 12 | import org.polyfrost.overflowanimations.hooks.DroppedItemHook; 13 | import org.spongepowered.asm.mixin.Mixin; 14 | import org.spongepowered.asm.mixin.Unique; 15 | import org.spongepowered.asm.mixin.injection.At; 16 | import org.spongepowered.asm.mixin.injection.Inject; 17 | import org.spongepowered.asm.mixin.injection.ModifyArg; 18 | import org.spongepowered.asm.mixin.injection.ModifyVariable; 19 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 20 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 21 | 22 | @Mixin(RenderEntityItem.class) 23 | public abstract class RenderEntityItemMixin extends Render { 24 | 25 | // @Shadow @Final private RenderItem itemRenderer; 26 | @Unique 27 | private boolean overflowanimations$isGui3d; 28 | 29 | // @Unique 30 | // private ItemStack overflowanimations$stack = null; 31 | 32 | protected RenderEntityItemMixin(RenderManager renderManager) { 33 | super(renderManager); 34 | } 35 | 36 | @Inject( 37 | method = "doRender(Lnet/minecraft/entity/item/EntityItem;DDDFF)V", 38 | at = @At( 39 | value = "HEAD" 40 | ) 41 | ) 42 | private void overflowAnimations$setHook(EntityItem entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) { 43 | DroppedItemHook.isItemDropped = true; 44 | } 45 | 46 | @Inject( 47 | method = "doRender(Lnet/minecraft/entity/item/EntityItem;DDDFF)V", 48 | at = @At( 49 | value = "TAIL" 50 | ) 51 | ) 52 | private void overflowAnimations$setHook2(EntityItem entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) { 53 | DroppedItemHook.isItemDropped = false; 54 | } 55 | 56 | @ModifyVariable(method = "func_177077_a", at = @At("STORE"), ordinal = 0) 57 | private boolean overflowAnimations$hookGui3d(boolean isGui3d) { 58 | overflowanimations$isGui3d = isGui3d; 59 | return isGui3d; 60 | } 61 | 62 | @ModifyArg(method = "func_177077_a", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;rotate(FFFF)V"), index = 0) 63 | private float overflowAnimations$apply2dItem(float angle) { 64 | if (!overflowanimations$isGui3d && OldAnimationsSettings.itemSprites && OldAnimationsSettings.INSTANCE.enabled && !OverflowAnimations.isItemPhysics) { 65 | return 180.0F - renderManager.playerViewY; 66 | 67 | } 68 | return angle; 69 | } 70 | 71 | @Inject(method = "func_177077_a", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;rotate(FFFF)V", shift = At.Shift.AFTER)) 72 | private void overflowAnimations$fix2dRotation(EntityItem itemIn, double p_177077_2_, double p_177077_4_, double p_177077_6_, float p_177077_8_, IBakedModel p_177077_9_, CallbackInfoReturnable cir) { 73 | if (!overflowanimations$isGui3d && OldAnimationsSettings.itemSprites && OldAnimationsSettings.INSTANCE.enabled && OldAnimationsSettings.rotationFix && !OverflowAnimations.isItemPhysics) { 74 | GlStateManager.rotate(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F); 75 | } 76 | } 77 | 78 | // @ModifyVariable( 79 | // method = "doRender(Lnet/minecraft/entity/item/EntityItem;DDDFF)V", 80 | // at = @At( 81 | // value = "STORE" 82 | // ), 83 | // index = 10 84 | // ) 85 | // private ItemStack overflowAnimations$captureStack(ItemStack stack) { 86 | // overflowanimations$stack = stack; 87 | // return stack; 88 | // } 89 | // 90 | // @ModifyArg( 91 | // method = "doRender(Lnet/minecraft/entity/item/EntityItem;DDDFF)V", 92 | // at = @At( 93 | // value = "INVOKE", 94 | // target = "Lnet/minecraft/client/renderer/entity/RenderItem;renderItem(Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/resources/model/IBakedModel;)V" 95 | // ), 96 | // index = 1 97 | // ) 98 | // private IBakedModel overflowAnimations$swapToCustomModel(IBakedModel model) { 99 | // if (!OldAnimationsSettings.INSTANCE.enabled || !OldAnimationsSettings.oldPotionsDropped) return model; 100 | // if (overflowanimations$stack.getItem() instanceof ItemPotion) { 101 | // return CustomModelBakery.BOTTLE_OVERLAY.getBakedModel(); 102 | // } 103 | // return model; 104 | // } 105 | // 106 | // @Inject( 107 | // method = "doRender(Lnet/minecraft/entity/item/EntityItem;DDDFF)V", 108 | // at = @At( 109 | // value = "INVOKE", 110 | // target = "Lnet/minecraft/client/renderer/entity/RenderItem;renderItem(Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/resources/model/IBakedModel;)V", 111 | // shift = At.Shift.AFTER 112 | // ) 113 | // ) 114 | // private void overflowAnimations$renderCustomBottle(EntityItem entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) { 115 | // if (!OldAnimationsSettings.INSTANCE.enabled || !OldAnimationsSettings.oldPotionsDropped) return; 116 | // if (entity.getEntityItem().getItem() instanceof ItemPotion) { 117 | // itemRenderer.renderItem(new ItemStack(Items.glass_bottle), overflowAnimations$getBottleModel(entity.getEntityItem())); 118 | // } 119 | // } 120 | // 121 | // @Unique 122 | // private IBakedModel overflowAnimations$getBottleModel(ItemStack stack) { 123 | // return ItemPotion.isSplash(stack.getMetadata()) ? CustomModelBakery.BOTTLE_SPLASH_EMPTY.getBakedModel() : CustomModelBakery.BOTTLE_DRINKABLE_EMPTY.getBakedModel(); 124 | // } 125 | 126 | } 127 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/RenderEntityItemMixin_CustomPositions.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import net.minecraft.client.renderer.GlStateManager; 4 | import net.minecraft.client.renderer.entity.RenderEntityItem; 5 | import net.minecraft.client.resources.model.IBakedModel; 6 | import net.minecraft.entity.item.EntityItem; 7 | import org.polyfrost.overflowanimations.config.ItemPositionAdvancedSettings; 8 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 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(RenderEntityItem.class) 15 | public class RenderEntityItemMixin_CustomPositions { 16 | 17 | @Inject(method = "func_177077_a", at = @At("TAIL")) 18 | public void overflowAnimations$droppedItemTransforms(EntityItem itemIn, double p_177077_2_, double p_177077_4_, double p_177077_6_, float p_177077_8_, IBakedModel p_177077_9_, CallbackInfoReturnable cir) { 19 | OldAnimationsSettings settings = OldAnimationsSettings.INSTANCE; 20 | ItemPositionAdvancedSettings advanced = OldAnimationsSettings.advancedSettings; 21 | if (OldAnimationsSettings.globalPositions && settings.enabled) { 22 | GlStateManager.translate( 23 | advanced.droppedPositionX, 24 | advanced.droppedPositionY, 25 | advanced.droppedPositionZ 26 | ); 27 | GlStateManager.rotate(advanced.droppedRotationPitch, 1.0f, 0.0f, 0.0f); 28 | GlStateManager.rotate(advanced.droppedRotationYaw, 0.0f, 1.0f, 0.0f); 29 | GlStateManager.rotate(advanced.droppedRotationRoll, 0.0f, 0.0f, 1.0f); 30 | GlStateManager.scale( 31 | 1.0f * Math.exp(advanced.droppedScale), 32 | 1.0f * Math.exp(advanced.droppedScale), 33 | 1.0f * Math.exp(advanced.droppedScale) 34 | ); 35 | } 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/RenderFireballMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.client.renderer.GlStateManager; 5 | import net.minecraft.client.renderer.block.model.ItemCameraTransforms; 6 | import net.minecraft.client.renderer.entity.Render; 7 | import net.minecraft.client.renderer.entity.RenderFireball; 8 | import net.minecraft.client.renderer.entity.RenderItem; 9 | import net.minecraft.client.renderer.entity.RenderManager; 10 | import net.minecraft.entity.projectile.EntityFireball; 11 | import net.minecraft.init.Items; 12 | import net.minecraft.item.ItemStack; 13 | import org.polyfrost.overflowanimations.config.ItemPositionAdvancedSettings; 14 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 15 | import org.spongepowered.asm.mixin.Mixin; 16 | import org.spongepowered.asm.mixin.injection.At; 17 | import org.spongepowered.asm.mixin.injection.Inject; 18 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 19 | 20 | @Mixin(RenderFireball.class) 21 | public abstract class RenderFireballMixin extends Render { 22 | 23 | protected RenderFireballMixin(RenderManager renderManager) { 24 | super(renderManager); 25 | } 26 | 27 | @Inject(method = "doRender(Lnet/minecraft/entity/projectile/EntityFireball;DDDFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;scale(FFF)V", shift = At.Shift.AFTER), cancellable = true) 28 | public void overflowAnimations$changeToModel(EntityFireball entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) { 29 | OldAnimationsSettings settings = OldAnimationsSettings.INSTANCE; 30 | ItemPositionAdvancedSettings advanced = OldAnimationsSettings.advancedSettings; 31 | if (!settings.enabled) { 32 | return; 33 | } 34 | if (OldAnimationsSettings.globalPositions) { 35 | GlStateManager.translate( 36 | advanced.fireballPositionX, 37 | advanced.fireballPositionY, 38 | advanced.fireballPositionZ 39 | ); 40 | GlStateManager.rotate(advanced.fireballRotationPitch, 1.0f, 0.0f, 0.0f); 41 | GlStateManager.rotate(advanced.fireballRotationYaw, 0.0f, 1.0f, 0.0f); 42 | GlStateManager.rotate(advanced.fireballRotationRoll, 0.0f, 0.0f, 1.0f); 43 | GlStateManager.scale( 44 | 1.0f * Math.exp(advanced.fireballScale), 45 | 1.0f * Math.exp(advanced.fireballScale), 46 | 1.0f * Math.exp(advanced.fireballScale) 47 | ); 48 | } 49 | if (OldAnimationsSettings.fireballModel) { 50 | RenderItem instance = Minecraft.getMinecraft().getRenderItem(); 51 | ItemStack stack = new ItemStack(Items.fire_charge, 1, 0); 52 | GlStateManager.rotate(180.0F - this.renderManager.playerViewY, 0.0f, 1.0f, 0.0f); 53 | GlStateManager.rotate(-this.renderManager.playerViewX, 1.0f, 0.0f, 0.0f); 54 | instance.renderItem(stack, ItemCameraTransforms.TransformType.GROUND); 55 | GlStateManager.disableRescaleNormal(); 56 | GlStateManager.popMatrix(); 57 | super.doRender(entity, x, y, z, entityYaw, partialTicks); 58 | ci.cancel(); 59 | } 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/RenderFishMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.client.renderer.entity.RenderFish; 5 | import net.minecraft.entity.player.EntityPlayer; 6 | import net.minecraft.entity.projectile.EntityFishHook; 7 | import net.minecraft.util.Vec3; 8 | import org.lwjgl.opengl.GL11; 9 | import org.polyfrost.overflowanimations.config.ItemPositionAdvancedSettings; 10 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 11 | import org.polyfrost.overflowanimations.hooks.PatcherConfigHook; 12 | import org.polyfrost.overflowanimations.hooks.SmoothSneakHook; 13 | import org.spongepowered.asm.mixin.Mixin; 14 | import org.spongepowered.asm.mixin.Unique; 15 | import org.spongepowered.asm.mixin.injection.*; 16 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 17 | 18 | @Mixin(value = RenderFish.class, priority = 2000) 19 | public class RenderFishMixin { 20 | 21 | @ModifyVariable(method = "doRender(Lnet/minecraft/entity/projectile/EntityFishHook;DDDFF)V", at = @At(value = "STORE", ordinal = 0), index = 23) 22 | private Vec3 overflowAnimations$modifyLinePosition(Vec3 vec3) { 23 | if (!OldAnimationsSettings.INSTANCE.enabled) { return vec3; } 24 | ItemPositionAdvancedSettings advanced = OldAnimationsSettings.advancedSettings; 25 | double fov = Minecraft.getMinecraft().gameSettings.fovSetting; 26 | double decimalFov = fov / 110; 27 | boolean isParallaxOffset = PatcherConfigHook.isParallaxFixEnabled(); 28 | double xCoord = vec3.xCoord; 29 | double yCoord = vec3.yCoord; 30 | double zCoord = vec3.zCoord; 31 | if (OldAnimationsSettings.fishingRodPosition && !OldAnimationsSettings.fixRod) { 32 | xCoord = -0.5D + (isParallaxOffset ? -0.1D : 0.0D); 33 | yCoord = 0.03D; 34 | zCoord = 0.8D; 35 | } else if (OldAnimationsSettings.fixRod) { 36 | xCoord = (-decimalFov + (decimalFov / 2.5) - (decimalFov / 8)) + 0.16 + (isParallaxOffset ? 0.15D : 0.0D); 37 | yCoord = 0.0D; 38 | zCoord = 0.4D; 39 | } 40 | if (ItemPositionAdvancedSettings.customRodLine) { 41 | xCoord = advanced.fishingLinePositionX; 42 | yCoord = advanced.fishingLinePositionY; 43 | zCoord = advanced.fishingLinePositionZ; 44 | } 45 | return new Vec3(xCoord, yCoord, zCoord); 46 | } 47 | 48 | @ModifyConstant(method = "doRender(Lnet/minecraft/entity/projectile/EntityFishHook;DDDFF)V", 49 | constant = @Constant(doubleValue = 0.8D) 50 | ) 51 | public double overflowAnimations$moveLinePosition(double constant) { 52 | return overflowAnimations$moveVecLine(constant); 53 | } 54 | 55 | @Redirect(method = "doRender(Lnet/minecraft/entity/projectile/EntityFishHook;DDDFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/EntityPlayer;getEyeHeight()F")) 56 | public float overflowAnimations$modifyEyeHeight(EntityPlayer instance) { 57 | return SmoothSneakHook.getSmoothSneak(); 58 | } 59 | 60 | @Inject(method = "doRender(Lnet/minecraft/entity/projectile/EntityFishHook;DDDFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/WorldRenderer;begin(ILnet/minecraft/client/renderer/vertex/VertexFormat;)V", ordinal = 1)) 61 | private void overflowAnimations$modifyLineThickness(EntityFishHook entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) { 62 | if (!OldAnimationsSettings.INSTANCE.enabled) { return; } 63 | GL11.glLineWidth(1.0f + OldAnimationsSettings.INSTANCE.rodThickness); 64 | } 65 | 66 | @Unique 67 | private double overflowAnimations$moveVecLine(double constant) { 68 | return OldAnimationsSettings.fishingStick && OldAnimationsSettings.INSTANCE.enabled ? 0.85D : constant; 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/RenderSnowballMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import net.minecraft.client.renderer.GlStateManager; 4 | import net.minecraft.client.renderer.entity.Render; 5 | import net.minecraft.client.renderer.entity.RenderManager; 6 | import net.minecraft.client.renderer.entity.RenderSnowball; 7 | import net.minecraft.entity.Entity; 8 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 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.ModifyArg; 13 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 14 | 15 | @Mixin(RenderSnowball.class) 16 | public abstract class RenderSnowballMixin extends Render { 17 | public RenderSnowballMixin(RenderManager renderManager) { 18 | super(renderManager); 19 | } 20 | 21 | @ModifyArg(method = "doRender", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;rotate(FFFF)V", ordinal = 0), index = 0) 22 | private float overflowAnimations$fixRotationY(float original) { 23 | return (OldAnimationsSettings.itemSprites || OldAnimationsSettings.oldProjectiles) && OldAnimationsSettings.INSTANCE.enabled ? 24 | 180.0F + original : original; 25 | } 26 | 27 | @ModifyArg(method = "doRender", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;rotate(FFFF)V", ordinal = 1), index = 0) 28 | private float overflowAnimations$fixRotationX(float original) { 29 | return ((OldAnimationsSettings.itemSprites || OldAnimationsSettings.oldProjectiles) && OldAnimationsSettings.INSTANCE.enabled ? -1F : 1F) * original; 30 | } 31 | 32 | @Inject(method = "doRender", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/entity/RenderItem;renderItem(Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/renderer/block/model/ItemCameraTransforms$TransformType;)V")) 33 | public void overflowAnimations$shiftProjectile(T entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) { 34 | if (OldAnimationsSettings.oldProjectiles && OldAnimationsSettings.INSTANCE.enabled) { 35 | GlStateManager.translate(0.0F, 0.25F, 0.0F); 36 | } 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/RenderSnowballMixin_CustomPositions.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import net.minecraft.client.renderer.GlStateManager; 4 | import net.minecraft.client.renderer.entity.Render; 5 | import net.minecraft.client.renderer.entity.RenderManager; 6 | import net.minecraft.client.renderer.entity.RenderSnowball; 7 | import net.minecraft.entity.Entity; 8 | import org.polyfrost.overflowanimations.config.ItemPositionAdvancedSettings; 9 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 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(RenderSnowball.class) 16 | public abstract class RenderSnowballMixin_CustomPositions extends Render { 17 | public RenderSnowballMixin_CustomPositions(RenderManager renderManager) { 18 | super(renderManager); 19 | } 20 | 21 | 22 | @Inject(method = "doRender", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/entity/RenderSnowball;bindTexture(Lnet/minecraft/util/ResourceLocation;)V", shift = At.Shift.AFTER)) 23 | public void overflowAnimations$projectileTransforms(T entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) { 24 | OldAnimationsSettings settings = OldAnimationsSettings.INSTANCE; 25 | ItemPositionAdvancedSettings advanced = OldAnimationsSettings.advancedSettings; 26 | if (OldAnimationsSettings.globalPositions && settings.enabled) { 27 | GlStateManager.translate( 28 | advanced.projectilePositionX, 29 | advanced.projectilePositionY, 30 | advanced.projectilePositionZ 31 | ); 32 | GlStateManager.rotate(advanced.projectileRotationPitch, 1.0f, 0.0f, 0.0f); 33 | GlStateManager.rotate(advanced.projectileRotationYaw, 0.0f, 1.0f, 0.0f); 34 | GlStateManager.rotate(advanced.projectileRotationRoll, 0.0f, 0.0f, 1.0f); 35 | GlStateManager.scale( 36 | 1.0f * Math.exp(advanced.projectileScale), 37 | 1.0f * Math.exp(advanced.projectileScale), 38 | 1.0f * Math.exp(advanced.projectileScale) 39 | ); 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/RendererLivingEntityMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.client.entity.EntityPlayerSP; 5 | import net.minecraft.client.renderer.GlStateManager; 6 | import net.minecraft.client.renderer.entity.Render; 7 | import net.minecraft.client.renderer.entity.RenderManager; 8 | import net.minecraft.client.renderer.entity.RendererLivingEntity; 9 | import net.minecraft.entity.EntityLivingBase; 10 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 11 | import org.polyfrost.overflowanimations.hooks.SmoothSneakHook; 12 | import org.spongepowered.asm.mixin.Mixin; 13 | import org.spongepowered.asm.mixin.Unique; 14 | import org.spongepowered.asm.mixin.injection.At; 15 | import org.spongepowered.asm.mixin.injection.Inject; 16 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 17 | 18 | @Mixin(RendererLivingEntity.class) 19 | public abstract class RendererLivingEntityMixin extends Render { 20 | 21 | protected RendererLivingEntityMixin(RenderManager renderManager) { 22 | super(renderManager); 23 | } 24 | 25 | @Inject(method = "doRender(Lnet/minecraft/entity/EntityLivingBase;DDDFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;translate(FFF)V")) 26 | public void overflowAnimations$movePlayerModel(T entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) { 27 | if (OldAnimationsSettings.smoothModelSneak && OldAnimationsSettings.INSTANCE.enabled && 28 | entity instanceof EntityPlayerSP && entity.getName().equals(Minecraft.getMinecraft().thePlayer.getName())) { 29 | if (entity.isSneaking()) { 30 | GlStateManager.translate(0.0F, -0.2F, 0.0F); 31 | } 32 | GlStateManager.translate(0.0F, 1.62F - SmoothSneakHook.getSmoothSneak(), 0.0F); 33 | } 34 | } 35 | 36 | @Inject(method = "rotateCorpse", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;rotate(FFFF)V", shift = At.Shift.AFTER)) 37 | public void overflowAnimations$rotateCorpse(T bat, float p_77043_2_, float p_77043_3_, float partialTicks, CallbackInfo ci) { 38 | boolean player = bat.getName().equals(Minecraft.getMinecraft().thePlayer.getName()); 39 | if (OldAnimationsSettings.INSTANCE.enabled) { 40 | if (OldAnimationsSettings.dinnerBoneMode && player) { 41 | overflowAnimations$dinnerboneRotation(bat); 42 | } else if (OldAnimationsSettings.dinnerBoneModeEntities && !player) { 43 | overflowAnimations$dinnerboneRotation(bat); 44 | } 45 | } 46 | } 47 | 48 | @Unique 49 | private static void overflowAnimations$dinnerboneRotation(EntityLivingBase entity) { 50 | GlStateManager.translate(0.0f, entity.height + 0.1f, 0.0f); 51 | GlStateManager.rotate(180.0f, 0.0f, 0.0f, 1.0f); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/compat/DulkirConfigMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin.compat; 2 | 3 | import cc.polyfrost.oneconfig.config.Config; 4 | import cc.polyfrost.oneconfig.config.annotations.Exclude; 5 | import cc.polyfrost.oneconfig.config.data.Mod; 6 | import org.spongepowered.asm.mixin.Dynamic; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.Pseudo; 9 | import org.spongepowered.asm.mixin.Unique; 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 | @Pseudo 15 | @Mixin(targets = "dulkirmod.config.DulkirConfig") 16 | public class DulkirConfigMixin extends Config { 17 | 18 | @Unique 19 | @Exclude 20 | private static final String overflow$USE_OVERFLOW = "Please use OverflowAnimations' Custom Item Positions instead of Dulkir's, as it is more compatible with old animations and has more features. You can find it in the OneConfig Mods menu. You can use the Dulkir export buttons and import it into OverflowAnimations directly. For more info, please join the Polyfrost Discord server: discord.gg/polyfrost."; 21 | 22 | public DulkirConfigMixin(Mod modData, String configFile) { 23 | super(modData, configFile); 24 | } 25 | 26 | @Dynamic("DulkirMod") 27 | @Inject(method = "init", at = @At("RETURN")) 28 | private void onInit(CallbackInfo ci) { 29 | addDependency("customAnimations", overflow$USE_OVERFLOW, () -> false); 30 | addDependency("customSize", overflow$USE_OVERFLOW, () -> false); 31 | addDependency("doesScaleSwing", overflow$USE_OVERFLOW, () -> false); 32 | addDependency("customX", overflow$USE_OVERFLOW, () -> false); 33 | addDependency("customY", overflow$USE_OVERFLOW, () -> false); 34 | addDependency("customZ", overflow$USE_OVERFLOW, () -> false); 35 | addDependency("customYaw", overflow$USE_OVERFLOW, () -> false); 36 | addDependency("customPitch", overflow$USE_OVERFLOW, () -> false); 37 | addDependency("customRoll", overflow$USE_OVERFLOW, () -> false); 38 | addDependency("customSpeed", overflow$USE_OVERFLOW, () -> false); 39 | addDependency("ignoreHaste", overflow$USE_OVERFLOW, () -> false); 40 | addDependency("drinkingSelector", overflow$USE_OVERFLOW, () -> false); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/compat/ItemCustomizeManagerMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin.compat; 2 | 3 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 4 | import org.spongepowered.asm.mixin.Dynamic; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.Pseudo; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.ModifyArg; 9 | import org.spongepowered.asm.mixin.injection.ModifyArgs; 10 | import org.spongepowered.asm.mixin.injection.invoke.arg.Args; 11 | 12 | @Pseudo 13 | @Mixin(targets = { 14 | "io.github.moulberry.notenoughupdates.miscfeatures.ItemCustomizeManager", 15 | "io.github.moulberry.notenoughupdates.miscgui.itemcustomization.ItemCustomizeManager" /* NEU 2.3.1+ */ 16 | }) 17 | public class ItemCustomizeManagerMixin { 18 | 19 | @Dynamic 20 | @ModifyArg( 21 | method = "renderEffect", 22 | at = @At( 23 | value = "INVOKE", 24 | target = "Lnet/minecraft/client/renderer/GlStateManager;translate(FFF)V" 25 | ), 26 | index = 0 27 | ) 28 | private static float overflowAnimations$modifySpeed(float x) { 29 | if (OldAnimationsSettings.enchantmentGlint && OldAnimationsSettings.INSTANCE.enabled) { 30 | x *= 64.0F; 31 | } 32 | return x; 33 | } 34 | 35 | @Dynamic 36 | @ModifyArgs( 37 | method = "renderEffect", 38 | at = @At( 39 | value = "INVOKE", 40 | target = "Lnet/minecraft/client/renderer/GlStateManager;scale(FFF)V" 41 | ) 42 | ) 43 | private static void overflowAnimations$modifyScale(Args args) { 44 | if (!OldAnimationsSettings.enchantmentGlint || !OldAnimationsSettings.INSTANCE.enabled) return; 45 | for (int i : new int[]{0, 1, 2}) { 46 | args.set(i, 1 / (float) args.get(i)); 47 | } 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/interfaces/EntityLivingBaseInvoker.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin.interfaces; 2 | 3 | import net.minecraft.entity.EntityLivingBase; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Invoker; 6 | 7 | @Mixin(EntityLivingBase.class) 8 | public interface EntityLivingBaseInvoker { 9 | 10 | @Invoker("getArmSwingAnimationEnd") 11 | int getArmSwingAnimation(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/interfaces/GuiPlayerTabOverlayInvoker.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin.interfaces; 2 | 3 | import net.minecraft.client.gui.GuiPlayerTabOverlay; 4 | import net.minecraft.client.network.NetworkPlayerInfo; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Invoker; 7 | 8 | @Mixin(GuiPlayerTabOverlay.class) 9 | public interface GuiPlayerTabOverlayInvoker { 10 | @Invoker("drawPing") 11 | void invokeDrawPing(int i, int j, int k, NetworkPlayerInfo networkPlayerInfoIn); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/interfaces/ItemRendererInvoker.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin.interfaces; 2 | 3 | import net.minecraft.client.renderer.ItemRenderer; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(ItemRenderer.class) 8 | public interface ItemRendererInvoker { 9 | 10 | @Accessor int getEquippedItemSlot(); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/interfaces/RenderItemInvoker.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin.interfaces; 2 | 3 | import net.minecraft.client.renderer.entity.RenderItem; 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(RenderItem.class) 9 | public interface RenderItemInvoker { 10 | 11 | @Invoker void invokeSetupGuiTransform(int xPosition, int yPosition, boolean isGui3d); 12 | 13 | } -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/interfaces/RendererLivingEntityInvoker.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin.interfaces; 2 | 3 | import net.minecraft.client.renderer.entity.RendererLivingEntity; 4 | import net.minecraft.entity.EntityLivingBase; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Invoker; 7 | 8 | @Mixin(RendererLivingEntity.class) 9 | public interface RendererLivingEntityInvoker { 10 | 11 | @Invoker 12 | boolean invokeSetDoRenderBrightness(EntityLivingBase entitylivingbaseIn, float partialTicks); 13 | 14 | @Invoker 15 | void invokeUnsetBrightness(); 16 | 17 | @Invoker 18 | int invokeGetColorMultiplier(EntityLivingBase entitylivingbaseIn, float lightBrightness, float partialTickTime); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerArmorBaseMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin.layers; 2 | 3 | import net.minecraft.client.model.ModelBase; 4 | import net.minecraft.client.renderer.entity.RendererLivingEntity; 5 | import net.minecraft.client.renderer.entity.layers.LayerArmorBase; 6 | import net.minecraft.client.renderer.entity.layers.LayerRenderer; 7 | import net.minecraft.entity.EntityLivingBase; 8 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 9 | import org.polyfrost.overflowanimations.hooks.HitColorHook; 10 | import org.spongepowered.asm.mixin.Final; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.Shadow; 13 | import org.spongepowered.asm.mixin.injection.At; 14 | import org.spongepowered.asm.mixin.injection.Inject; 15 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 16 | 17 | @Mixin(LayerArmorBase.class) 18 | public abstract class LayerArmorBaseMixin implements LayerRenderer { 19 | 20 | @Shadow public abstract T getArmorModel(int armorSlot); 21 | 22 | @Shadow @Final private RendererLivingEntity renderer; 23 | 24 | @Inject(method = "renderLayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelBase;render(Lnet/minecraft/entity/Entity;FFFFFF)V", ordinal = 1, shift = At.Shift.AFTER)) 25 | public void overflowAnimations$renderHitColor(EntityLivingBase entitylivingbaseIn, float p_177182_2_, float p_177182_3_, float partialTicks, float p_177182_5_, float p_177182_6_, float p_177182_7_, float scale, int armorSlot, CallbackInfo ci) { 26 | if (OldAnimationsSettings.INSTANCE.armorDamageTintStyle == 1 && OldAnimationsSettings.INSTANCE.enabled) { 27 | T t = this.getArmorModel(armorSlot); 28 | boolean bl = entitylivingbaseIn.hurtTime > 0 || entitylivingbaseIn.deathTime > 0; 29 | HitColorHook.renderHitColorPre(entitylivingbaseIn, bl, partialTicks, renderer); 30 | if (bl) { 31 | t.render(entitylivingbaseIn, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, scale); 32 | } 33 | HitColorHook.renderHitColorPost(bl); 34 | } 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerCapeMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin.layers; 2 | 3 | import net.minecraft.client.renderer.entity.layers.LayerCape; 4 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 9 | 10 | @Mixin(LayerCape.class) 11 | public class LayerCapeMixin { 12 | 13 | @Inject(method = "shouldCombineTextures", at = @At(value = "HEAD"), cancellable = true) 14 | public void overflowAnimations$allowCombine(CallbackInfoReturnable cir) { 15 | cir.setReturnValue(OldAnimationsSettings.damageCape && OldAnimationsSettings.INSTANCE.enabled); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerEnderDragonEyesMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin.layers; 2 | 3 | import net.minecraft.client.renderer.entity.RenderDragon; 4 | import net.minecraft.client.renderer.entity.layers.LayerEnderDragonEyes; 5 | import net.minecraft.entity.boss.EntityDragon; 6 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 7 | import org.polyfrost.overflowanimations.hooks.HitColorHook; 8 | import org.spongepowered.asm.mixin.Final; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.Shadow; 11 | import org.spongepowered.asm.mixin.injection.At; 12 | import org.spongepowered.asm.mixin.injection.Inject; 13 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 14 | 15 | @Mixin(LayerEnderDragonEyes.class) 16 | public abstract class LayerEnderDragonEyesMixin { 17 | 18 | @Shadow @Final private RenderDragon dragonRenderer; 19 | 20 | @Inject(method = "doRenderLayer(Lnet/minecraft/entity/boss/EntityDragon;FFFFFFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelBase;render(Lnet/minecraft/entity/Entity;FFFFFF)V", shift = At.Shift.AFTER)) 21 | public void overflowAnimations$renderHitColor(EntityDragon entitylivingbaseIn, float f, float g, float partialTicks, float h, float i, float j, float scale, CallbackInfo ci) { 22 | if (OldAnimationsSettings.INSTANCE.armorDamageTintStyle == 1 && OldAnimationsSettings.INSTANCE.enabled) { 23 | boolean bl = entitylivingbaseIn.hurtTime > 0 || entitylivingbaseIn.deathTime > 0; 24 | HitColorHook.renderHitColorPre(entitylivingbaseIn, bl, partialTicks, dragonRenderer); 25 | if (bl) { 26 | dragonRenderer.getMainModel().render(entitylivingbaseIn, f, g, h, i, j, scale); 27 | } 28 | HitColorHook.renderHitColorPost(bl); 29 | } 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerEndermanEyesMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin.layers; 2 | 3 | import net.minecraft.client.renderer.entity.RenderEnderman; 4 | import net.minecraft.client.renderer.entity.layers.LayerEndermanEyes; 5 | import net.minecraft.entity.monster.EntityEnderman; 6 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 7 | import org.polyfrost.overflowanimations.hooks.HitColorHook; 8 | import org.spongepowered.asm.mixin.Final; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.Shadow; 11 | import org.spongepowered.asm.mixin.injection.At; 12 | import org.spongepowered.asm.mixin.injection.Inject; 13 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 14 | 15 | @Mixin(LayerEndermanEyes.class) 16 | public abstract class LayerEndermanEyesMixin { 17 | 18 | @Shadow @Final private RenderEnderman endermanRenderer; 19 | 20 | @Inject(method = "doRenderLayer(Lnet/minecraft/entity/monster/EntityEnderman;FFFFFFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelBase;render(Lnet/minecraft/entity/Entity;FFFFFF)V", shift = At.Shift.AFTER)) 21 | public void overflowAnimations$renderHitColor(EntityEnderman entitylivingbaseIn, float f, float g, float partialTicks, float h, float i, float j, float scale, CallbackInfo ci) { 22 | if (OldAnimationsSettings.INSTANCE.armorDamageTintStyle == 1 && OldAnimationsSettings.INSTANCE.enabled) { 23 | boolean bl = entitylivingbaseIn.hurtTime > 0 || entitylivingbaseIn.deathTime > 0; 24 | HitColorHook.renderHitColorPre(entitylivingbaseIn, bl, partialTicks, endermanRenderer); 25 | if (bl) { 26 | endermanRenderer.getMainModel().render(entitylivingbaseIn, f, g, h, i, j, scale); 27 | } 28 | HitColorHook.renderHitColorPost(bl); 29 | } 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerSaddleMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin.layers; 2 | 3 | import net.minecraft.client.model.ModelPig; 4 | import net.minecraft.client.renderer.entity.RenderPig; 5 | import net.minecraft.client.renderer.entity.layers.LayerSaddle; 6 | import net.minecraft.entity.passive.EntityPig; 7 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 8 | import org.polyfrost.overflowanimations.hooks.HitColorHook; 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(LayerSaddle.class) 17 | public abstract class LayerSaddleMixin { 18 | 19 | @Shadow @Final private ModelPig pigModel; 20 | 21 | @Shadow @Final private RenderPig pigRenderer; 22 | 23 | @Inject(method = "doRenderLayer(Lnet/minecraft/entity/passive/EntityPig;FFFFFFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelPig;render(Lnet/minecraft/entity/Entity;FFFFFF)V", shift = At.Shift.AFTER)) 24 | public void overflowAnimations$renderHitColor(EntityPig var1, float var2, float var3, float var4, float var5, float var6, float var7, float var8, CallbackInfo ci) { 25 | if (OldAnimationsSettings.INSTANCE.armorDamageTintStyle == 1 && OldAnimationsSettings.INSTANCE.enabled) { 26 | boolean bl = var1.hurtTime > 0 || var1.deathTime > 0; 27 | HitColorHook.renderHitColorPre(var1, bl, var4, pigRenderer); 28 | if (bl) { 29 | pigModel.render(var1, var2, var3, var5, var6, var7, var8); 30 | } 31 | HitColorHook.renderHitColorPost(bl); 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerSheepWoolMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin.layers; 2 | 3 | import net.minecraft.client.model.ModelSheep1; 4 | import net.minecraft.client.renderer.entity.RenderSheep; 5 | import net.minecraft.client.renderer.entity.layers.LayerSheepWool; 6 | import net.minecraft.entity.passive.EntitySheep; 7 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 8 | import org.polyfrost.overflowanimations.hooks.HitColorHook; 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(LayerSheepWool.class) 17 | public abstract class LayerSheepWoolMixin { 18 | 19 | @Shadow @Final private ModelSheep1 sheepModel; 20 | 21 | @Shadow @Final private RenderSheep sheepRenderer; 22 | 23 | @Inject(method = "doRenderLayer(Lnet/minecraft/entity/passive/EntitySheep;FFFFFFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelSheep1;render(Lnet/minecraft/entity/Entity;FFFFFF)V", shift = At.Shift.AFTER)) 24 | public void overflowAnimations$renderHitColor(EntitySheep entitylivingbaseIn, float f, float g, float partialTicks, float h, float i, float j, float scale, CallbackInfo ci) { 25 | if (OldAnimationsSettings.INSTANCE.armorDamageTintStyle == 1 && OldAnimationsSettings.INSTANCE.enabled) { 26 | boolean bl = entitylivingbaseIn.hurtTime > 0 || entitylivingbaseIn.deathTime > 0; 27 | HitColorHook.renderHitColorPre(entitylivingbaseIn, bl, partialTicks, sheepRenderer); 28 | if (bl) { 29 | sheepModel.render(entitylivingbaseIn, f, g, h, i, j, scale); 30 | } 31 | HitColorHook.renderHitColorPost(bl); 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerSlimeGelMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin.layers; 2 | 3 | import net.minecraft.client.model.ModelBase; 4 | import net.minecraft.client.renderer.entity.RenderSlime; 5 | import net.minecraft.client.renderer.entity.layers.LayerSlimeGel; 6 | import net.minecraft.entity.monster.EntitySlime; 7 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 8 | import org.polyfrost.overflowanimations.hooks.HitColorHook; 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(LayerSlimeGel.class) 17 | public abstract class LayerSlimeGelMixin { 18 | 19 | @Shadow @Final private ModelBase slimeModel; 20 | 21 | @Shadow @Final private RenderSlime slimeRenderer; 22 | 23 | @Inject(method = "doRenderLayer(Lnet/minecraft/entity/monster/EntitySlime;FFFFFFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelBase;render(Lnet/minecraft/entity/Entity;FFFFFF)V", shift = At.Shift.AFTER), cancellable = true) 24 | public void overflowAnimations$renderHitColor(EntitySlime var1, float f, float g, float partialTicks, float h, float i, float j, float scale, CallbackInfo ci) { 25 | if (OldAnimationsSettings.INSTANCE.armorDamageTintStyle == 1 && OldAnimationsSettings.INSTANCE.enabled) { 26 | boolean bl = var1.hurtTime > 0 || var1.deathTime > 0; 27 | HitColorHook.renderHitColorPre(var1, bl, partialTicks, slimeRenderer); 28 | if (bl) { 29 | slimeModel.render(var1, f, g, h, i, j, scale); 30 | } 31 | HitColorHook.renderHitColorPost(bl); 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerSpiderEyesMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin.layers; 2 | 3 | import net.minecraft.client.renderer.entity.RenderSpider; 4 | import net.minecraft.client.renderer.entity.layers.LayerSpiderEyes; 5 | import net.minecraft.entity.monster.EntitySpider; 6 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 7 | import org.polyfrost.overflowanimations.hooks.HitColorHook; 8 | import org.spongepowered.asm.mixin.Final; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.Shadow; 11 | import org.spongepowered.asm.mixin.injection.At; 12 | import org.spongepowered.asm.mixin.injection.Inject; 13 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 14 | 15 | @Mixin(LayerSpiderEyes.class) 16 | public abstract class LayerSpiderEyesMixin { 17 | 18 | @Shadow @Final private RenderSpider spiderRenderer; 19 | 20 | @Inject(method = "doRenderLayer(Lnet/minecraft/entity/monster/EntitySpider;FFFFFFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelBase;render(Lnet/minecraft/entity/Entity;FFFFFF)V", shift = At.Shift.AFTER)) 21 | public void overflowAnimations$renderHitColor(EntitySpider entitylivingbaseIn, float f, float g, float partialTicks, float h, float i, float j, float scale, CallbackInfo ci) { 22 | if (OldAnimationsSettings.INSTANCE.armorDamageTintStyle == 1 && OldAnimationsSettings.INSTANCE.enabled) { 23 | boolean bl = entitylivingbaseIn.hurtTime > 0 || entitylivingbaseIn.deathTime > 0; 24 | HitColorHook.renderHitColorPre(entitylivingbaseIn, bl, partialTicks, spiderRenderer); 25 | if (bl) { 26 | spiderRenderer.getMainModel().render(entitylivingbaseIn, f, g, h, i, j, scale); 27 | } 28 | HitColorHook.renderHitColorPost(bl); 29 | } 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerWolfCollarMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin.layers; 2 | 3 | import net.minecraft.client.renderer.entity.RenderWolf; 4 | import net.minecraft.client.renderer.entity.layers.LayerWolfCollar; 5 | import net.minecraft.entity.passive.EntityWolf; 6 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 7 | import org.polyfrost.overflowanimations.hooks.HitColorHook; 8 | import org.spongepowered.asm.mixin.Final; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.Shadow; 11 | import org.spongepowered.asm.mixin.injection.At; 12 | import org.spongepowered.asm.mixin.injection.Inject; 13 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 14 | 15 | @Mixin(LayerWolfCollar.class) 16 | public abstract class LayerWolfCollarMixin { 17 | 18 | @Shadow @Final private RenderWolf wolfRenderer; 19 | 20 | @Inject(method = "doRenderLayer(Lnet/minecraft/entity/passive/EntityWolf;FFFFFFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelBase;render(Lnet/minecraft/entity/Entity;FFFFFF)V", shift = At.Shift.AFTER)) 21 | public void overflowAnimations$renderHitColor(EntityWolf entitylivingbaseIn, float f, float g, float partialTicks, float h, float i, float j, float scale, CallbackInfo ci) { 22 | if (OldAnimationsSettings.INSTANCE.armorDamageTintStyle == 1 && OldAnimationsSettings.INSTANCE.enabled) { 23 | boolean bl = entitylivingbaseIn.hurtTime > 0 || entitylivingbaseIn.deathTime > 0; 24 | HitColorHook.renderHitColorPre(entitylivingbaseIn, bl, partialTicks, wolfRenderer); 25 | if (bl) { 26 | wolfRenderer.getMainModel().render(entitylivingbaseIn, f, g, h, i, j, scale); 27 | } 28 | HitColorHook.renderHitColorPost(bl); 29 | } 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/mixin/layers/RendererLivingEntityMixin.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.mixin.layers; 2 | 3 | import net.minecraft.client.model.ModelBase; 4 | import net.minecraft.client.renderer.entity.Render; 5 | import net.minecraft.client.renderer.entity.RenderManager; 6 | import net.minecraft.client.renderer.entity.RendererLivingEntity; 7 | import net.minecraft.entity.EntityLivingBase; 8 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings; 9 | import org.polyfrost.overflowanimations.hooks.HitColorHook; 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.ModifyArg; 15 | import org.spongepowered.asm.mixin.injection.Redirect; 16 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 17 | 18 | @Mixin(RendererLivingEntity.class) 19 | public abstract class RendererLivingEntityMixin extends Render { 20 | 21 | @Shadow protected ModelBase mainModel; 22 | @Shadow protected abstract boolean setBrightness(T entitylivingbaseIn, float partialTicks, boolean combineTextures); 23 | @Shadow protected abstract float handleRotationFloat(T livingBase, float partialTicks); 24 | @Shadow protected abstract float interpolateRotation(float par1, float par2, float par3); 25 | @Shadow protected abstract boolean setDoRenderBrightness(T entityLivingBaseIn, float partialTicks); 26 | 27 | protected RendererLivingEntityMixin(RenderManager renderManager) { 28 | super(renderManager); 29 | } 30 | 31 | @Redirect(method = "doRender(Lnet/minecraft/entity/EntityLivingBase;DDDFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/entity/RendererLivingEntity;setDoRenderBrightness(Lnet/minecraft/entity/EntityLivingBase;F)Z")) 32 | public boolean overflowAnimations$disableBrightness(RendererLivingEntity instance, T entityLivingBaseIn, float partialTicks) { 33 | return (OldAnimationsSettings.INSTANCE.armorDamageTintStyle != 1 || !OldAnimationsSettings.INSTANCE.enabled) && setDoRenderBrightness(entityLivingBaseIn, partialTicks); 34 | } 35 | 36 | @Redirect(method = "renderLayers", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/entity/RendererLivingEntity;setBrightness(Lnet/minecraft/entity/EntityLivingBase;FZ)Z")) 37 | public boolean overflowAnimations$disableLayerBrightness(RendererLivingEntity instance, T f2, float f3, boolean f4) { 38 | return (OldAnimationsSettings.INSTANCE.armorDamageTintStyle != 1 || !OldAnimationsSettings.INSTANCE.enabled) && setBrightness(f2, f3, f4); 39 | } 40 | 41 | @Inject(method = "doRender(Lnet/minecraft/entity/EntityLivingBase;DDDFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;depthMask(Z)V")) 42 | public void overflowAnimations$renderHitColor(T entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) { 43 | if (OldAnimationsSettings.INSTANCE.armorDamageTintStyle == 1 && OldAnimationsSettings.INSTANCE.enabled) { 44 | float f = interpolateRotation(entity.prevRenderYawOffset, entity.renderYawOffset, partialTicks); 45 | float f1 = interpolateRotation(entity.prevRotationYawHead, entity.rotationYawHead, partialTicks); 46 | float f2 = f1 - f; 47 | float f7 = entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks; 48 | float f8 = handleRotationFloat(entity, partialTicks); 49 | float f5 = entity.prevLimbSwingAmount + (entity.limbSwingAmount - entity.prevLimbSwingAmount) * partialTicks; 50 | float f6 = entity.limbSwing - entity.limbSwingAmount * (1.0f - partialTicks); 51 | if (entity.isChild()) { 52 | f6 *= 3.0f; 53 | } 54 | if (f5 > 1.0f) { 55 | f5 = 1.0f; 56 | } 57 | boolean bl = entity.hurtTime > 0 || entity.deathTime > 0; 58 | HitColorHook.renderHitColorPre(entity, bl, partialTicks, (RendererLivingEntity) (Object) this); 59 | if (bl) { 60 | mainModel.render(entity, f6, f5, f8, f2, f7, 0.0625f); 61 | } 62 | HitColorHook.renderHitColorPost(bl); 63 | } 64 | } 65 | 66 | @ModifyArg( 67 | method = "setBrightness", 68 | at = @At( 69 | value = "INVOKE", 70 | target = "Ljava/nio/FloatBuffer;put(F)Ljava/nio/FloatBuffer;", 71 | ordinal = 3 72 | ), 73 | index = 0 74 | ) 75 | private float overflowAnimations$orangesHitColor(float f) { 76 | if (OldAnimationsSettings.INSTANCE.armorDamageTintStyle == 4 && OldAnimationsSettings.INSTANCE.enabled) 77 | return 0.5f; /* not sure where he got this value from ?!? */ 78 | return f; 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /src/main/java/org/polyfrost/overflowanimations/util/MathUtils.java: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.util; 2 | 3 | public class MathUtils { 4 | 5 | public static float interp(float previous, float current, float partialTick) { 6 | return previous + (current - previous) * partialTick; 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/kotlin/org/polyfrost/overflowanimations/OverflowAnimations.kt: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations 2 | 3 | import cc.polyfrost.oneconfig.events.EventManager 4 | import cc.polyfrost.oneconfig.events.event.RenderEvent 5 | import cc.polyfrost.oneconfig.events.event.Stage 6 | import cc.polyfrost.oneconfig.libs.eventbus.Subscribe 7 | import cc.polyfrost.oneconfig.libs.universal.UDesktop 8 | import cc.polyfrost.oneconfig.utils.Notifications 9 | import cc.polyfrost.oneconfig.utils.commands.CommandManager 10 | import cc.polyfrost.oneconfig.utils.gui.GuiUtils 11 | import dulkirmod.config.Config 12 | import dulkirmod.config.DulkirConfig 13 | import net.minecraft.client.Minecraft 14 | import net.minecraftforge.fml.common.Loader 15 | import net.minecraftforge.fml.common.Mod 16 | import net.minecraftforge.fml.common.event.FMLInitializationEvent 17 | import net.minecraftforge.fml.common.event.FMLLoadCompleteEvent 18 | import net.minecraftforge.fml.common.event.FMLPostInitializationEvent 19 | import org.polyfrost.overflowanimations.command.OldAnimationsCommand 20 | import org.polyfrost.overflowanimations.config.OldAnimationsSettings 21 | import org.polyfrost.overflowanimations.gui.PleaseMigrateDulkirModGui 22 | import java.net.URI 23 | 24 | @Mod( 25 | modid = OverflowAnimations.MODID, 26 | name = OverflowAnimations.NAME, 27 | version = OverflowAnimations.VERSION, 28 | modLanguageAdapter = "cc.polyfrost.oneconfig.utils.KotlinLanguageAdapter" 29 | ) 30 | object OverflowAnimations { 31 | 32 | const val MODID: String = "@ID@" 33 | const val NAME: String = "@NAME@" 34 | const val VERSION: String = "@VER@" 35 | 36 | @JvmField 37 | var isPatcherPresent: Boolean = false 38 | @JvmField 39 | var doTheFunnyDulkirThing = false 40 | @JvmField 41 | var oldDulkirMod: Boolean = false 42 | private var customCrosshair = false 43 | @JvmField 44 | var isDamageTintPresent: Boolean = false 45 | @JvmField 46 | var isItemPhysics: Boolean = false 47 | @JvmField 48 | var isNEUPresent: Boolean = false; 49 | 50 | // @Mod.EventHandler 51 | // fun preInit(event: FMLPreInitializationEvent) { 52 | // CustomModelBakery 53 | // } 54 | 55 | @Mod.EventHandler 56 | fun init(event: FMLInitializationEvent) { 57 | OldAnimationsSettings.INSTANCE.preload() 58 | CommandManager.INSTANCE.registerCommand(OldAnimationsCommand()) 59 | EventManager.INSTANCE.register(this) 60 | } 61 | 62 | @Mod.EventHandler 63 | fun postInit(event: FMLPostInitializationEvent) { 64 | if (Loader.isModLoaded("dulkirmod")) { 65 | doTheFunnyDulkirThing = true 66 | } 67 | isPatcherPresent = Loader.isModLoaded("patcher") 68 | customCrosshair = Loader.isModLoaded("custom-crosshair-mod") 69 | isDamageTintPresent = Loader.isModLoaded("damagetint") 70 | isItemPhysics = Loader.isModLoaded("itemphysic") 71 | isNEUPresent = Loader.isModLoaded("notenoughupdates") 72 | } 73 | 74 | @Mod.EventHandler 75 | fun onLoad(event: FMLLoadCompleteEvent) { 76 | if (customCrosshair) { 77 | OldAnimationsSettings.smoothModelSneak = false 78 | OldAnimationsSettings.INSTANCE.save() 79 | Notifications.INSTANCE.send("OverflowAnimations", "Custom Crosshair Mod has been detected, which is written poorly and causes major issues with OverflowAnimations. Disabling Smooth Model Sneak. If you want a better crosshair mod, please click here to use PolyCrosshair instead.", 5000f, Runnable { 80 | UDesktop.browse(URI("https://modrinth.com/mod/crosshair")) 81 | }) 82 | } 83 | } 84 | 85 | @Subscribe 86 | private fun onTick(event: RenderEvent) { 87 | if (event.stage == Stage.START && Minecraft.getMinecraft().currentScreen == null && Minecraft.getMinecraft().theWorld != null && Minecraft.getMinecraft().thePlayer != null && doTheFunnyDulkirThing && !OldAnimationsSettings.didTheFunnyDulkirThingElectricBoogaloo) { 88 | try { 89 | Class.forName("dulkirmod.config.DulkirConfig") 90 | if (DulkirConfig.INSTANCE.customAnimations) { 91 | dulkirTrollage() 92 | } 93 | } catch (e: ClassNotFoundException) { 94 | oldDulkirMod = true 95 | if (Config.INSTANCE.customAnimations) { 96 | dulkirTrollage() 97 | } 98 | } 99 | } 100 | } 101 | 102 | private fun dulkirTrollage() { 103 | GuiUtils.displayScreen(PleaseMigrateDulkirModGui()) 104 | } 105 | 106 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/polyfrost/overflowanimations/hooks/GlintModelHook.kt: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.hooks 2 | 3 | import cc.polyfrost.oneconfig.utils.dsl.mc 4 | import net.minecraft.client.Minecraft 5 | import net.minecraft.client.renderer.GlStateManager 6 | import net.minecraft.client.renderer.Tessellator 7 | import net.minecraft.client.renderer.WorldRenderer 8 | import net.minecraft.client.renderer.texture.TextureAtlasSprite 9 | import net.minecraft.client.renderer.texture.TextureMap 10 | import net.minecraft.client.renderer.vertex.DefaultVertexFormats 11 | import net.minecraft.client.resources.model.IBakedModel 12 | import net.minecraft.client.resources.model.SimpleBakedModel 13 | import net.minecraft.util.EnumFacing 14 | import net.minecraft.util.ResourceLocation 15 | import org.lwjgl.opengl.GL11 16 | import org.polyfrost.overflowanimations.mixin.interfaces.RenderItemInvoker 17 | 18 | object GlintModelHook { 19 | 20 | private val glintMap = hashMapOf() 21 | 22 | fun getGlint(model: IBakedModel): IBakedModel = 23 | glintMap.computeIfAbsent(HashedModel(model)) { 24 | SimpleBakedModel.Builder(model, JustUV).makeBakedModel() 25 | } 26 | 27 | data class HashedModel(val data: List) { 28 | constructor(model: IBakedModel) : this( 29 | (EnumFacing.entries.flatMap { face -> model.getFaceQuads(face) } + model.generalQuads).flatMap { it.vertexData.slice(0..2) } 30 | ) 31 | } 32 | 33 | object JustUV : TextureAtlasSprite("uv") { 34 | override fun getInterpolatedU(u: Double) = -u.toFloat() / 16f 35 | override fun getInterpolatedV(v: Double) = v.toFloat() / 16f 36 | } 37 | 38 | fun renderGlintGui(x: Int, y: Int, glintTexture: ResourceLocation) { 39 | val red = 128 / 255f 40 | val green = 64 / 255f 41 | val blue = 204 / 255f 42 | val alpha = 255 / 255f 43 | 44 | val tessellator = Tessellator.getInstance() 45 | val worldrenderer = tessellator.worldRenderer 46 | 47 | val currentTime = Minecraft.getSystemTime() 48 | val twentyPixels = 20.0 / 256.0 49 | val a = (currentTime % 3000L) / 3000.0 50 | val b = (currentTime % 4873L) / 4873.0 51 | 52 | GlStateManager.enableRescaleNormal() 53 | GlStateManager.depthFunc(GL11.GL_GEQUAL) 54 | GlStateManager.disableLighting() 55 | GlStateManager.depthMask(false) 56 | mc.textureManager.bindTexture(glintTexture) 57 | GlStateManager.enableAlpha() 58 | GlStateManager.alphaFunc(516, 0.1f) 59 | GlStateManager.enableBlend() 60 | GlStateManager.tryBlendFuncSeparate(772, 1, 0, 0) 61 | GlStateManager.color(red, green, blue, alpha) 62 | 63 | GlStateManager.pushMatrix() 64 | 65 | (mc.renderItem as RenderItemInvoker).invokeSetupGuiTransform(x, y, false) 66 | 67 | GlStateManager.scale(0.5f, 0.5f, 0.5f) 68 | GlStateManager.translate(-0.5f, -0.5f, -0.5f) 69 | 70 | worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX) 71 | drawVertices(worldrenderer, a, twentyPixels) 72 | drawVertices(worldrenderer, b - twentyPixels, twentyPixels) 73 | tessellator.draw() 74 | 75 | GlStateManager.popMatrix() 76 | 77 | GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0) 78 | GlStateManager.depthMask(true) 79 | GlStateManager.enableLighting() 80 | GlStateManager.depthFunc(GL11.GL_LEQUAL) 81 | GlStateManager.disableAlpha() 82 | GlStateManager.disableRescaleNormal() 83 | GlStateManager.disableLighting() 84 | mc.textureManager.bindTexture(TextureMap.locationBlocksTexture) 85 | } 86 | 87 | private fun drawVertices(worldrenderer: WorldRenderer, uOffset: Double, twentyPixels: Double) { 88 | worldrenderer.run { 89 | pos(0.0, 0.0, 0.0).tex(uOffset + twentyPixels * 4.0, twentyPixels).endVertex() 90 | pos(1.0, 0.0, 0.0).tex(uOffset + twentyPixels * 5.0, twentyPixels).endVertex() 91 | pos(1.0, 1.0, 0.0).tex(uOffset + twentyPixels, 0.0).endVertex() 92 | pos(0.0, 1.0, 0.0).tex(uOffset, 0.0).endVertex() 93 | } 94 | } 95 | 96 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/polyfrost/overflowanimations/hooks/SkullModelHook.kt: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.hooks 2 | 3 | object SkullModelHook { 4 | 5 | // fun getSkullModel(stack: ItemStack): IBakedModel { 6 | // return when (stack.metadata) { 7 | // 0 -> CustomModelBakery.SKULL_SKELETON.bakedModel 8 | // 1 -> CustomModelBakery.SKULL_WITHER.bakedModel 9 | // 2 -> CustomModelBakery.SKULL_ZOMBIE.bakedModel 10 | // 4 -> CustomModelBakery.SKULL_CREEPER.bakedModel 11 | // else -> CustomModelBakery.SKULL_CHAR.bakedModel 12 | // } 13 | // } 14 | 15 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/polyfrost/overflowanimations/init/CustomModelBakery.kt: -------------------------------------------------------------------------------- 1 | package org.polyfrost.overflowanimations.init 2 | 3 | import net.minecraft.client.renderer.texture.TextureMap 4 | import net.minecraft.client.renderer.vertex.DefaultVertexFormats 5 | import net.minecraft.client.resources.model.IBakedModel 6 | import net.minecraft.util.ResourceLocation 7 | import net.minecraftforge.client.event.ModelBakeEvent 8 | import net.minecraftforge.client.event.TextureStitchEvent 9 | import net.minecraftforge.client.model.IModel 10 | import net.minecraftforge.client.model.ModelLoader 11 | import net.minecraftforge.client.model.ModelLoaderRegistry 12 | import net.minecraftforge.common.MinecraftForge 13 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent 14 | import org.polyfrost.overflowanimations.OverflowAnimations 15 | 16 | enum class CustomModelBakery(modelPath: String) { 17 | 18 | BOTTLE_OVERLAY("item/bottle_overlay"), 19 | BOTTLE_DRINKABLE_EMPTY("item/bottle_drinkable_empty"), 20 | BOTTLE_SPLASH_EMPTY("item/bottle_splash_empty"), 21 | SKULL_CHAR("item/skull_char"), 22 | SKULL_CREEPER("item/skull_creeper"), 23 | SKULL_SKELETON("item/skull_skeleton"), 24 | SKULL_WITHER("item/skull_wither"), 25 | SKULL_ZOMBIE("item/skull_zombie"); 26 | 27 | private val resourceLocation = ResourceLocation(OverflowAnimations.MODID, modelPath) 28 | private lateinit var loadedModel: IModel 29 | lateinit var bakedModel: IBakedModel 30 | private set 31 | 32 | private fun stitch(map: TextureMap) { 33 | loadedModel = ModelLoaderRegistry.getModel(resourceLocation).apply { textures.forEach { map.registerSprite(it) } } 34 | } 35 | 36 | private fun bake() { 37 | bakedModel = loadedModel.bake(loadedModel.defaultState, DefaultVertexFormats.ITEM, ModelLoader.defaultTextureGetter()) 38 | } 39 | 40 | companion object { 41 | 42 | init { 43 | MinecraftForge.EVENT_BUS.register(this) 44 | } 45 | 46 | @SubscribeEvent 47 | fun onStitch(event: TextureStitchEvent.Pre) { 48 | CustomModelBakery.entries.forEach { it.stitch(event.map) } 49 | } 50 | 51 | @SubscribeEvent 52 | fun onBake(event: ModelBakeEvent) { 53 | CustomModelBakery.entries.forEach { it.bake() } 54 | } 55 | } 56 | 57 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/textures/items/skull_creeper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Polyfrost/OverflowAnimationsV2/5b95a9f8c3c7198aa461f19854914b9d2442fa26/src/main/resources/assets/minecraft/textures/items/skull_creeper.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/textures/items/skull_skeleton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Polyfrost/OverflowAnimationsV2/5b95a9f8c3c7198aa461f19854914b9d2442fa26/src/main/resources/assets/minecraft/textures/items/skull_skeleton.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/textures/items/skull_steve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Polyfrost/OverflowAnimationsV2/5b95a9f8c3c7198aa461f19854914b9d2442fa26/src/main/resources/assets/minecraft/textures/items/skull_steve.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/textures/items/skull_wither.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Polyfrost/OverflowAnimationsV2/5b95a9f8c3c7198aa461f19854914b9d2442fa26/src/main/resources/assets/minecraft/textures/items/skull_wither.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/textures/items/skull_zombie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Polyfrost/OverflowAnimationsV2/5b95a9f8c3c7198aa461f19854914b9d2442fa26/src/main/resources/assets/minecraft/textures/items/skull_zombie.png -------------------------------------------------------------------------------- /src/main/resources/assets/overflowanimations/models/item/bottle_drinkable_empty.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "builtin/generated", 3 | "textures": { 4 | "layer0": "items/potion_bottle_drinkable" 5 | }, 6 | "display": { 7 | "thirdperson": { 8 | "rotation": [ -90, 0, 0 ], 9 | "translation": [ 0, 1, -3 ], 10 | "scale": [ 0.55, 0.55, 0.55 ] 11 | }, 12 | "firstperson": { 13 | "rotation": [ 0, -135, 25 ], 14 | "translation": [ 0, 4, 2 ], 15 | "scale": [ 1.7, 1.7, 1.7 ] 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/resources/assets/overflowanimations/models/item/bottle_overlay.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "builtin/generated", 3 | "textures": { 4 | "layer0": "items/potion_overlay" 5 | }, 6 | "display": { 7 | "thirdperson": { 8 | "rotation": [ -90, 0, 0 ], 9 | "translation": [ 0, 1, -3 ], 10 | "scale": [ 0.55, 0.55, 0.55 ] 11 | }, 12 | "firstperson": { 13 | "rotation": [ 0, -135, 25 ], 14 | "translation": [ 0, 4, 2 ], 15 | "scale": [ 1.7, 1.7, 1.7 ] 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/resources/assets/overflowanimations/models/item/bottle_splash_empty.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "builtin/generated", 3 | "textures": { 4 | "layer0": "items/potion_bottle_splash" 5 | }, 6 | "display": { 7 | "thirdperson": { 8 | "rotation": [ -90, 0, 0 ], 9 | "translation": [ 0, 1, -3 ], 10 | "scale": [ 0.55, 0.55, 0.55 ] 11 | }, 12 | "firstperson": { 13 | "rotation": [ 0, -135, 25 ], 14 | "translation": [ 0, 4, 2 ], 15 | "scale": [ 1.7, 1.7, 1.7 ] 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/resources/assets/overflowanimations/models/item/skull_char.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "builtin/generated", 3 | "textures": { 4 | "layer0": "items/skull_steve" 5 | }, 6 | "display": { 7 | "thirdperson": { 8 | "rotation": [ -90, 0, 0 ], 9 | "translation": [ 0, 1, -3 ], 10 | "scale": [ 0.55, 0.55, 0.55 ] 11 | }, 12 | "firstperson": { 13 | "rotation": [ 0, -135, 25 ], 14 | "translation": [ 0, 4, 2 ], 15 | "scale": [ 1.7, 1.7, 1.7 ] 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/resources/assets/overflowanimations/models/item/skull_creeper.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "builtin/generated", 3 | "textures": { 4 | "layer0": "items/skull_creeper" 5 | }, 6 | "display": { 7 | "thirdperson": { 8 | "rotation": [ -90, 0, 0 ], 9 | "translation": [ 0, 1, -3 ], 10 | "scale": [ 0.55, 0.55, 0.55 ] 11 | }, 12 | "firstperson": { 13 | "rotation": [ 0, -135, 25 ], 14 | "translation": [ 0, 4, 2 ], 15 | "scale": [ 1.7, 1.7, 1.7 ] 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/resources/assets/overflowanimations/models/item/skull_skeleton.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "builtin/generated", 3 | "textures": { 4 | "layer0": "items/skull_skeleton" 5 | }, 6 | "display": { 7 | "thirdperson": { 8 | "rotation": [ -90, 0, 0 ], 9 | "translation": [ 0, 1, -3 ], 10 | "scale": [ 0.55, 0.55, 0.55 ] 11 | }, 12 | "firstperson": { 13 | "rotation": [ 0, -135, 25 ], 14 | "translation": [ 0, 4, 2 ], 15 | "scale": [ 1.7, 1.7, 1.7 ] 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/resources/assets/overflowanimations/models/item/skull_wither.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "builtin/generated", 3 | "textures": { 4 | "layer0": "items/skull_wither" 5 | }, 6 | "display": { 7 | "thirdperson": { 8 | "rotation": [ -90, 0, 0 ], 9 | "translation": [ 0, 1, -3 ], 10 | "scale": [ 0.55, 0.55, 0.55 ] 11 | }, 12 | "firstperson": { 13 | "rotation": [ 0, -135, 25 ], 14 | "translation": [ 0, 4, 2 ], 15 | "scale": [ 1.7, 1.7, 1.7 ] 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/resources/assets/overflowanimations/models/item/skull_zombie.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "builtin/generated", 3 | "textures": { 4 | "layer0": "items/skull_zombie" 5 | }, 6 | "display": { 7 | "thirdperson": { 8 | "rotation": [ -90, 0, 0 ], 9 | "translation": [ 0, 1, -3 ], 10 | "scale": [ 0.55, 0.55, 0.55 ] 11 | }, 12 | "firstperson": { 13 | "rotation": [ 0, -135, 25 ], 14 | "translation": [ 0, 4, 2 ], 15 | "scale": [ 1.7, 1.7, 1.7 ] 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/resources/mcmod.info: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "modid": "${id}", 4 | "name": "${name}", 5 | "description": "Replaces animations & visuals removed in 1.8 with their old 1.7 visuals while also offering a plethora of extra features!", 6 | "version": "${version}", 7 | "mcversion": "${mcVersionStr}", 8 | "url": "", 9 | "updateUrl": "", 10 | "authorList": [ 11 | "Polyfrost", 12 | "Sk1erLLC", 13 | "Microextent", 14 | "Dulkir", 15 | "Anyone who helped test this mod <3" 16 | ], 17 | "credits": "", 18 | "logoFile": "", 19 | "screenshots": [], 20 | "dependencies": [] 21 | } 22 | ] 23 | -------------------------------------------------------------------------------- /src/main/resources/mixins.overflowanimations.json: -------------------------------------------------------------------------------- 1 | { 2 | "compatibilityLevel": "JAVA_8", 3 | "minVersion": "0.7", 4 | "package": "org.polyfrost.overflowanimations.mixin", 5 | "refmap": "mixins.${id}.refmap.json", 6 | "verbose": true, 7 | "client": [ 8 | "EntityLivingBaseMixin", 9 | "EntityMixin", 10 | "EntityOtherPlayerMPMixin", 11 | "EntityPickupFXMixin", 12 | "EntityPlayerMixin", 13 | "EntityRendererMixin", 14 | "ForgeHooksClientMixin", 15 | "GuiIngameForgeMixin", 16 | "GuiIngameMixin", 17 | "GuiOverlayDebugMixin", 18 | "GuiPlayerTabOverlayMixin", 19 | "ItemMixin", 20 | "ItemModelMesherMixin", 21 | "ItemPotionMixin", 22 | "ItemRendererMixin", 23 | "ItemRendererMixin_CustomPositions", 24 | "ItemStackMixin", 25 | "LayerArmorBaseMixin", 26 | "LayerArmorBaseMixin_New", 27 | "LayerHeldItemMixin", 28 | "MinecraftMixin", 29 | "ModelBipedMixin", 30 | "NetHandlerPlayClientMixin", 31 | "OnlineIndicatorMixin", 32 | "PlayerControllerMPMixin", 33 | "PotionHelperMixin", 34 | "RenderEntityItemMixin", 35 | "RenderEntityItemMixin_CustomPositions", 36 | "RendererLivingEntityMixin", 37 | "RenderFireballMixin", 38 | "RenderFishMixin", 39 | "RenderItemMixin", 40 | "RenderSnowballMixin", 41 | "RenderSnowballMixin_CustomPositions", 42 | "compat.DulkirConfigMixin", 43 | "compat.ItemCustomizeManagerMixin", 44 | "interfaces.EntityLivingBaseInvoker", 45 | "interfaces.GuiPlayerTabOverlayInvoker", 46 | "interfaces.ItemRendererInvoker", 47 | "interfaces.RendererLivingEntityInvoker", 48 | "interfaces.RenderItemInvoker", 49 | "layers.LayerArmorBaseMixin", 50 | "layers.LayerCapeMixin", 51 | "layers.LayerEnderDragonEyesMixin", 52 | "layers.LayerEndermanEyesMixin", 53 | "layers.LayerSaddleMixin", 54 | "layers.LayerSheepWoolMixin", 55 | "layers.LayerSlimeGelMixin", 56 | "layers.LayerSpiderEyesMixin", 57 | "layers.LayerWolfCollarMixin", 58 | "layers.RendererLivingEntityMixin" 59 | ] 60 | } -------------------------------------------------------------------------------- /src/main/resources/overflowanimations_dark.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /versions/mainProject: -------------------------------------------------------------------------------- 1 | 1.8.9-forge --------------------------------------------------------------------------------