-
Notifications
You must be signed in to change notification settings - Fork 37
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
20 changed files
with
85 additions
and
78 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
22 changes: 15 additions & 7 deletions
22
src/main/java/com/minelittlepony/api/pony/DefaultPonySkinHelper.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 |
---|---|---|
@@ -1,20 +1,28 @@ | ||
package com.minelittlepony.api.pony; | ||
|
||
import net.minecraft.client.util.DefaultSkinHelper; | ||
import net.minecraft.util.Identifier; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
import com.minelittlepony.api.config.PonyLevel; | ||
import com.minelittlepony.client.MineLittlePony; | ||
|
||
import java.util.*; | ||
|
||
public final class DefaultPonySkinHelper { | ||
public static final Identifier STEVE = new Identifier("minelittlepony", "textures/entity/player/wide/steve_pony.png"); | ||
|
||
private static final Map<Identifier, Identifier> SKINS = new HashMap<>(); | ||
@Deprecated | ||
public static final Identifier ALEX = new Identifier("minelittlepony", "textures/entity/player/slim/alex_pony.png"); | ||
|
||
public static Identifier getPonySkin(Identifier original) { | ||
return SKINS.computeIfAbsent(original, DefaultPonySkinHelper::computePonySkin); | ||
return original.getPath().contains("steve") ? STEVE : ALEX; | ||
} | ||
|
||
private static Identifier computePonySkin(Identifier original) { | ||
return new Identifier("minelittlepony", original.getPath().replace(".png", "_pony.png")); | ||
@Deprecated | ||
public static Identifier getPonySkin(UUID profileId, boolean slimArms) { | ||
if (MineLittlePony.getInstance().getConfig().ponyLevel.get() != PonyLevel.PONIES) { | ||
return DefaultSkinHelper.getTexture(profileId); | ||
} | ||
boolean alex = (profileId.hashCode() & 1) == 1; | ||
return new Identifier("minelittlepony", "textures/entity/player/" + (slimArms ? "slim" : "wide") + "/" + (alex ? "alex" : "steve") + "_pony.png"); | ||
} | ||
} |
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
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
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
Oops, something went wrong.