-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New config option, fix classload error outside of dev
Signed-off-by: roadhog360 <[email protected]>
- Loading branch information
1 parent
0161a0a
commit 2802a9e
Showing
6 changed files
with
99 additions
and
50 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
42 changes: 42 additions & 0 deletions
42
src/main/java/roadhog360/simpleskinbackport/core/PlayerSkin.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,42 @@ | ||
package roadhog360.simpleskinbackport.core; | ||
|
||
import net.minecraft.util.ResourceLocation; | ||
|
||
public class PlayerSkin { | ||
private final boolean slim; | ||
private final String domain; | ||
private final String skinName; | ||
/** | ||
* Lazy loaded and cached. We need to do this since class loading order with mixins is an annoying bitch | ||
*/ | ||
private ResourceLocation resource; | ||
|
||
public PlayerSkin(boolean slim, String domain, String skinName) { | ||
this.slim = slim; | ||
this.domain = domain; | ||
this.skinName = skinName; | ||
} | ||
|
||
public PlayerSkin(boolean slim, String skinName) { | ||
this(slim, null, skinName); | ||
} | ||
|
||
public ResourceLocation getResource() { | ||
if(resource == null) { | ||
resource = new ResourceLocation(domain, "textures/entity/player/" + (slim ? "slim" : "wide") + "/" + skinName + ".png"); | ||
} | ||
return resource; | ||
} | ||
|
||
public boolean isSlim() { | ||
return slim; | ||
} | ||
|
||
public String getDomain() { | ||
return domain; | ||
} | ||
|
||
public String getSkinName() { | ||
return skinName; | ||
} | ||
} |
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