Permalink
Browse files

Convert entity types that don't match spawn egg material names

  • Loading branch information...
PseudoKnight committed Aug 16, 2018
1 parent 2dc42b4 commit 3edc300f5708d0ba539842689aecc18d49737049
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/main/java/com/laytonsmith/core/ObjectGenerator.java
@@ -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;
}

0 comments on commit 3edc300

Please sign in to comment.