-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
re-write part 2 (only slight update)
- Loading branch information
Showing
10 changed files
with
189 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...in/java/io/github/axolotlclient/oldanimations/mixin/FishingBobberEntityRendererMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/main/java/io/github/axolotlclient/oldanimations/mixin/HeldItemRendererMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
src/main/java/io/github/axolotlclient/oldanimations/mixin/InGameHudMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
* For more information, see the LICENSE file. | ||
*/ | ||
|
||
package io.github.axolotlclient.oldanimations.mixin; | ||
|
||
import io.github.axolotlclient.oldanimations.OldAnimations; | ||
import net.minecraft.client.gui.hud.InGameHud; | ||
import net.minecraft.client.util.Window; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Unique; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.ModifyArg; | ||
import org.spongepowered.asm.mixin.injection.ModifyVariable; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(InGameHud.class) | ||
public abstract class InGameHudMixin { | ||
|
||
//todo: find a better way to do this :p | ||
@Unique | ||
private boolean bl; | ||
|
||
@ModifyVariable( | ||
method = "renderStatusBars", | ||
at = @At( | ||
value = "STORE", | ||
ordinal = 0 | ||
), | ||
index = 4 | ||
) | ||
private boolean axolotlclient$disableFlashingCheck(boolean value) { | ||
bl = value; /* heart flashing local*/ | ||
return false; | ||
} | ||
|
||
@ModifyArg( | ||
method = "renderStatusBars", | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lnet/minecraft/client/gui/hud/InGameHud;drawTexture(IIIIII)V", | ||
ordinal = 3 | ||
), | ||
index = 2 | ||
) | ||
private int axolotlclient$enableFlashingCheck(int par1) { | ||
return par1 + (isHeartFlashingEnabled() && bl ? 1 : 0) * 9; | ||
} | ||
|
||
@Inject(method = "renderStatusBars", at = @At("TAIL")) | ||
private void axolotlclient$releaseCapturedLocal(Window window, CallbackInfo ci) { | ||
bl = false; /* big brain time */ | ||
} | ||
|
||
@Unique | ||
private static boolean isHeartFlashingEnabled() { | ||
return OldAnimations.getInstance().enabled.get() && OldAnimations.getInstance().heartFlashing.get(); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/io/github/axolotlclient/oldanimations/mixin/LivingEntityRendererMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/main/java/io/github/axolotlclient/oldanimations/utils/ItemBlacklist.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
{ | ||
"required": true, | ||
"package": "io.github.axolotlclient.oldanimations.mixin", | ||
"compatibilityLevel": "JAVA_8", | ||
"client": [ | ||
"ArmorFeatureRendererMixin", | ||
"BiPedModelMixin", | ||
"DebugHudMixin", | ||
"FishingBobberEntityRendererMixin", | ||
"GameRendererMixin", | ||
"HeldItemRendererMixin", | ||
"ItemRendererMixin", | ||
"LivingEntityAccessor", | ||
"LivingEntityRendererMixin", | ||
"MinecraftClientAccessor", | ||
"MinecraftClientMixin" | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
"required": true, | ||
"package": "io.github.axolotlclient.oldanimations.mixin", | ||
"compatibilityLevel": "JAVA_8", | ||
"client": [ | ||
"ArmorFeatureRendererMixin", | ||
"BiPedModelMixin", | ||
"DebugHudMixin", | ||
"FishingBobberEntityRendererMixin", | ||
"GameRendererMixin", | ||
"HeldItemRendererMixin", | ||
"InGameHudMixin", | ||
"ItemRendererMixin", | ||
"LivingEntityAccessor", | ||
"LivingEntityRendererMixin", | ||
"MinecraftClientAccessor", | ||
"MinecraftClientMixin" | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
} | ||
} |