-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
99 additions
and
87 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
69 changes: 1 addition & 68 deletions
69
src/main/java/band/kessokuteatime/bounced/mixin/SplashTextAnimator.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
78 changes: 78 additions & 0 deletions
78
src/main/java/band/kessokuteatime/bounced/mixin/Trigger.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,78 @@ | ||
package band.kessokuteatime.bounced.mixin; | ||
|
||
|
||
import band.kessokuteatime.bounced.Bounced; | ||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.client.gui.screen.AccessibilityOnboardingScreen; | ||
import net.minecraft.client.gui.screen.Screen; | ||
import net.minecraft.client.gui.screen.TitleScreen; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
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.callback.CallbackInfo; | ||
|
||
/** | ||
* This class is responsible for triggering the title animation before the title screen is rendered. | ||
*/ | ||
@Mixin(MinecraftClient.class) | ||
public class Trigger { | ||
@Inject(method = "setScreen", at = @At("TAIL")) | ||
private void trigger(Screen screen, CallbackInfo ci) { | ||
if (!(screen instanceof TitleScreen || screen instanceof AccessibilityOnboardingScreen)) Bounced.push(); | ||
} | ||
} | ||
|
||
/** | ||
* This class is responsible for triggering the title animation when the game starts for the first time. | ||
*/ | ||
@Mixin(AccessibilityOnboardingScreen.class) | ||
class AccessibilityOnboardingTrigger { | ||
@Inject(method = "init", at = @At("RETURN")) | ||
private void init(CallbackInfo ci) { | ||
Bounced.init(); | ||
} | ||
|
||
/** | ||
* Triggers and restarts the animation. | ||
*/ | ||
@ModifyArg( | ||
method = "render", | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lnet/minecraft/client/gui/RotatingCubeMapRenderer;render(FF)V" | ||
), index = 1 | ||
) | ||
private float trigger(float progress) { | ||
Bounced.resetWhen(progress > 0.9); | ||
Bounced.update(); | ||
return progress; | ||
} | ||
} | ||
|
||
/** | ||
* This class is responsible for triggering the animation and animating the splash text. | ||
*/ | ||
@Mixin(TitleScreen.class) | ||
class TitleScreenTrigger { | ||
@Inject(method = "init", at = @At("RETURN")) | ||
private void init(CallbackInfo ci) { | ||
Bounced.init(); | ||
} | ||
|
||
/** | ||
* Triggers and restarts the animation. | ||
*/ | ||
@ModifyArg( | ||
method = "render", | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lnet/minecraft/client/gui/RotatingCubeMapRenderer;render(FF)V" | ||
), index = 1 | ||
) | ||
private float trigger(float progress) { | ||
Bounced.resetWhen(progress > 0.9); | ||
Bounced.update(); | ||
return progress; | ||
} | ||
} |
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,18 +1,19 @@ | ||
{ | ||
"required": true, | ||
"minVersion": "0.8", | ||
"package": "band.kessokuteatime.bounced.mixin", | ||
"compatibilityLevel": "JAVA_17", | ||
"mixins": [ | ||
], | ||
"client": [ | ||
"AccessibilityOnboardingTrigger", | ||
"LogoDrawerAnimator", | ||
"SplashTextAnimator", | ||
"SplashTextTranslator", | ||
"Trigger" | ||
], | ||
"injectors": { | ||
"defaultRequire": 0 | ||
} | ||
"required": true, | ||
"minVersion": "0.8", | ||
"package": "band.kessokuteatime.bounced.mixin", | ||
"compatibilityLevel": "JAVA_17", | ||
"mixins": [ | ||
], | ||
"client": [ | ||
"AccessibilityOnboardingTrigger", | ||
"LogoDrawerAnimator", | ||
"SplashTextAnimator", | ||
"SplashTextTranslator", | ||
"TitleScreenTrigger", | ||
"Trigger" | ||
], | ||
"injectors": { | ||
"defaultRequire": 0 | ||
} | ||
} |
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