Skip to content

Commit

Permalink
Convert entity types that don't match spawn egg material names
Browse files Browse the repository at this point in the history
  • Loading branch information
PseudoKnight committed Aug 16, 2018
1 parent 2dc42b4 commit 3edc300
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/com/laytonsmith/core/ObjectGenerator.java
Expand Up @@ -317,7 +317,15 @@ public MCItemStack item(Construct i, Target t, boolean legacy) {
if(meta instanceof CArray && ((CArray) meta).containsKey("spawntype")) {
Construct spawntype = ((CArray) meta).get("spawntype", t);
if(!(spawntype instanceof CNull)) {
MCMaterial newmaterial = StaticLayer.GetMaterial(spawntype.val().toUpperCase() + "_SPAWN_EGG");
MCMaterial newmaterial;
String entityName = spawntype.val().toUpperCase();
if(entityName.equals("MUSHROOM_COW")) {
newmaterial = StaticLayer.GetMaterial("MOOSHROOM_SPAWN_EGG");
} else if(entityName.equals("PIG_ZOMBIE")) {
newmaterial = StaticLayer.GetMaterial("ZOMBIE_PIGMAN_SPAWN_EGG");
} else {
newmaterial = StaticLayer.GetMaterial(entityName + "_SPAWN_EGG");
}
if(newmaterial != null) {
material = newmaterial;
}
Expand Down

0 comments on commit 3edc300

Please sign in to comment.