mirror of
https://github.com/Zrips/Jobs.git
synced 2025-02-18 05:11:32 +01:00
Correct entity type check for 1.13+
This commit is contained in:
parent
aa84bde32d
commit
081edff7cb
@ -183,7 +183,31 @@ public class ConfigManager {
|
|||||||
myKey = myKey.split("-")[0];
|
myKey = myKey.split("-")[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
CMIMaterial material = CMIMaterial.get(myKey + (subType));
|
CMIMaterial material = null;
|
||||||
|
|
||||||
|
switch (actionType) {
|
||||||
|
case KILL:
|
||||||
|
case MILK:
|
||||||
|
case MMKILL:
|
||||||
|
case BREED:
|
||||||
|
case SHEAR:
|
||||||
|
case EXPLORE:
|
||||||
|
case CUSTOMKILL:
|
||||||
|
break;
|
||||||
|
case TNTBREAK:
|
||||||
|
case VTRADE:
|
||||||
|
case SMELT:
|
||||||
|
case REPAIR:
|
||||||
|
case PLACE:
|
||||||
|
case EAT:
|
||||||
|
case FISH:
|
||||||
|
case ENCHANT:
|
||||||
|
case DYE:
|
||||||
|
case DRINK:
|
||||||
|
case CRAFT:
|
||||||
|
case BREW:
|
||||||
|
case BREAK:
|
||||||
|
material = CMIMaterial.get(myKey + (subType));
|
||||||
|
|
||||||
if (material == null)
|
if (material == null)
|
||||||
material = CMIMaterial.get(myKey.replace(" ", "_").toUpperCase());
|
material = CMIMaterial.get(myKey.replace(" ", "_").toUpperCase());
|
||||||
@ -203,9 +227,11 @@ public class ConfigManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
|
||||||
if (actionType == ActionType.EXPLORE)
|
}
|
||||||
material = null;
|
|
||||||
|
|
||||||
c: if (material != null) {
|
c: if (material != null) {
|
||||||
|
|
||||||
@ -261,7 +287,7 @@ public class ConfigManager {
|
|||||||
} else if (actionType == ActionType.KILL || actionType == ActionType.TAME || actionType == ActionType.BREED || actionType == ActionType.MILK) {
|
} else if (actionType == ActionType.KILL || actionType == ActionType.TAME || actionType == ActionType.BREED || actionType == ActionType.MILK) {
|
||||||
|
|
||||||
// check entities
|
// check entities
|
||||||
EntityType entity = EntityType.fromName(myKey);
|
EntityType entity = EntityType.fromName(myKey.toUpperCase());
|
||||||
if (entity == null) {
|
if (entity == null) {
|
||||||
try {
|
try {
|
||||||
entity = EntityType.valueOf(myKey.toUpperCase());
|
entity = EntityType.valueOf(myKey.toUpperCase());
|
||||||
@ -278,43 +304,45 @@ public class ConfigManager {
|
|||||||
Jobs.getGCManager().setBreederFinder(true);
|
Jobs.getGCManager().setBreederFinder(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (entity == null) {
|
||||||
switch (myKey.toLowerCase()) {
|
switch (myKey.toLowerCase()) {
|
||||||
case "skeletonwither":
|
case "skeletonwither":
|
||||||
type = "SkeletonWither";
|
type = CMIEntityType.WITHER_SKELETON.getOneWordName();
|
||||||
id = 51;
|
id = 51;
|
||||||
meta = "1";
|
meta = "1";
|
||||||
break;
|
break;
|
||||||
case "skeletonstray":
|
case "skeletonstray":
|
||||||
type = "SkeletonStray";
|
type = CMIEntityType.STRAY.getOneWordName();
|
||||||
id = 51;
|
id = 51;
|
||||||
meta = "2";
|
meta = "2";
|
||||||
break;
|
break;
|
||||||
case "zombievillager":
|
case "zombievillager":
|
||||||
type = "ZombieVillager";
|
type = CMIEntityType.ZOMBIE_VILLAGER.getOneWordName();
|
||||||
id = 54;
|
id = 54;
|
||||||
meta = "1";
|
meta = "1";
|
||||||
break;
|
break;
|
||||||
case "zombiehusk":
|
case "zombiehusk":
|
||||||
type = "ZombieHusk";
|
type = CMIEntityType.HUSK.getOneWordName();
|
||||||
id = 54;
|
id = 54;
|
||||||
meta = "2";
|
meta = "2";
|
||||||
break;
|
break;
|
||||||
case "horseskeleton":
|
case "horseskeleton":
|
||||||
type = "HorseSkeleton";
|
type = CMIEntityType.SKELETON_HORSE.getOneWordName();
|
||||||
id = 100;
|
id = 100;
|
||||||
meta = "1";
|
meta = "1";
|
||||||
break;
|
break;
|
||||||
case "horsezombie":
|
case "horsezombie":
|
||||||
type = "HorseZombie";
|
type = CMIEntityType.ZOMBIE_HORSE.getOneWordName();
|
||||||
id = 100;
|
id = 100;
|
||||||
meta = "2";
|
meta = "2";
|
||||||
break;
|
break;
|
||||||
case "guardianelder":
|
case "guardianelder":
|
||||||
type = "GuardianElder";
|
type = CMIEntityType.ELDER_GUARDIAN.getOneWordName();
|
||||||
id = 68;
|
id = 68;
|
||||||
meta = "1";
|
meta = "1";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else if (actionType == ActionType.ENCHANT) {
|
} else if (actionType == ActionType.ENCHANT) {
|
||||||
Enchantment enchant = Enchantment.getByName(myKey);
|
Enchantment enchant = Enchantment.getByName(myKey);
|
||||||
@ -1029,6 +1057,8 @@ public class ConfigManager {
|
|||||||
Jobs.getGCManager().setBreederFinder(true);
|
Jobs.getGCManager().setBreederFinder(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Pre 1.13 checks for custom names
|
||||||
|
if (entity == null) {
|
||||||
switch (key.toLowerCase()) {
|
switch (key.toLowerCase()) {
|
||||||
case "skeletonwither":
|
case "skeletonwither":
|
||||||
type = CMIEntityType.WITHER_SKELETON.getOneWordName();
|
type = CMIEntityType.WITHER_SKELETON.getOneWordName();
|
||||||
@ -1066,6 +1096,7 @@ public class ConfigManager {
|
|||||||
meta = "1";
|
meta = "1";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else if (actionType == ActionType.ENCHANT) {
|
} else if (actionType == ActionType.ENCHANT) {
|
||||||
Enchantment enchant = Enchantment.getByName(myKey);
|
Enchantment enchant = Enchantment.getByName(myKey);
|
||||||
|
@ -20,22 +20,6 @@ public class v1_13 implements NMS {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRealType(Entity entity) {
|
public String getRealType(Entity entity) {
|
||||||
switch (entity.getType().name()) {
|
|
||||||
case "WITHER_SKELETON":
|
|
||||||
return "skeletonwither";
|
|
||||||
case "STRAY":
|
|
||||||
return "SkeletonStray";
|
|
||||||
case "ZOMBIE_VILLAGER":
|
|
||||||
return "ZombieVillager";
|
|
||||||
case "HUSK":
|
|
||||||
return "ZombieHusk";
|
|
||||||
case "SKELETON_HORSE":
|
|
||||||
return "HorseSkeleton";
|
|
||||||
case "ZOMBIE_HORSE":
|
|
||||||
return "HorseZombie";
|
|
||||||
case "ELDER_GUARDIAN":
|
|
||||||
return "GuardianElder";
|
|
||||||
}
|
|
||||||
return entity.getType().name();
|
return entity.getType().name();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user