-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
start moving species backend over to stacked textures
- Loading branch information
Showing
83 changed files
with
379 additions
and
170 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
38 changes: 38 additions & 0 deletions
38
src/main/java/com/parzivail/pswg/species/SpeciesGender.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,38 @@ | ||
package com.parzivail.pswg.species; | ||
|
||
import net.minecraft.util.Identifier; | ||
|
||
public enum SpeciesGender | ||
{ | ||
MALE("m"), | ||
FEMALE("f"); | ||
|
||
private final String slug; | ||
|
||
SpeciesGender(String slug) | ||
{ | ||
this.slug = slug; | ||
} | ||
|
||
public String getSlug() | ||
{ | ||
return slug; | ||
} | ||
|
||
public static SpeciesGender fromSlug(String genderedSlug) | ||
{ | ||
String[] parts = genderedSlug.split("_", 2); | ||
|
||
if (parts.length == 2 && parts[1].equals(FEMALE.slug)) | ||
return FEMALE; | ||
|
||
return MALE; | ||
} | ||
|
||
public static Identifier toSlug(SwgSpecies species) | ||
{ | ||
Identifier slug = species.getSlug(); | ||
SpeciesGender gender = species.getGender(); | ||
return new Identifier(slug.getNamespace(), slug.getPath() + '_' + gender.slug); | ||
} | ||
} |
Oops, something went wrong.