-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
9 changed files
with
100 additions
and
106 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
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
17 changes: 17 additions & 0 deletions
17
...main/java/com/mineblock11/skinshuffle/mixin/accessor/DummyClientPlayerEntityAccessor.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,17 @@ | ||
package com.mineblock11.skinshuffle.mixin.accessor; | ||
|
||
import net.minecraft.util.Identifier; | ||
import nl.enjarai.cicada.api.cursed.DummyClientPlayerEntity; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.gen.Accessor; | ||
|
||
@Mixin(value = DummyClientPlayerEntity.class, remap = false) | ||
public interface DummyClientPlayerEntityAccessor { | ||
//? if >=1.20.4 { | ||
@Accessor(value = "skinTextures", remap = false) | ||
void setSkinTextures(net.minecraft.client.util.SkinTexturesSkinTextures skinTextures); | ||
//?} else { | ||
/*@Accessor(value = "skinIdentifier", remap = false) | ||
void setSkinIdentifier(Identifier skinIdentifier); | ||
*///?} | ||
} |
30 changes: 30 additions & 0 deletions
30
...ain/java/com/mineblock11/skinshuffle/mixin/screen/AccessibilityOnboardingScreenMixin.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,30 @@ | ||
package com.mineblock11.skinshuffle.mixin.screen; | ||
|
||
import com.mineblock11.skinshuffle.client.config.SkinPresetManager; | ||
import com.mineblock11.skinshuffle.util.NetworkingUtil; | ||
import com.mineblock11.skinshuffle.util.ToastHelper; | ||
import net.minecraft.client.gui.screen.AccessibilityOnboardingScreen; | ||
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.callback.CallbackInfo; | ||
|
||
@Mixin(AccessibilityOnboardingScreen.class) | ||
public class AccessibilityOnboardingScreenMixin { | ||
@Unique | ||
private static boolean appliedConfiguration = false; | ||
|
||
@Inject(method = "render", at = @At("HEAD")) | ||
public void refreshConfig(CallbackInfo ci) { | ||
if (!appliedConfiguration) { | ||
appliedConfiguration = true; | ||
SkinPresetManager.loadPresets(); | ||
SkinPresetManager.apply(); | ||
|
||
if(!NetworkingUtil.isLoggedIn()) { | ||
ToastHelper.showOfflineModeToast(); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.