Added rudimentary support for disguising Custom Entities and Modded Entities

Added the DisguiseType 'Unknown', obviously can't be used by players
Cleaned up code
This commit is contained in:
NavidK0
2015-07-07 11:30:12 -04:00
parent d30ffa1994
commit 27cc9cd70f
10 changed files with 53 additions and 22 deletions

View File

@@ -345,6 +345,9 @@ public abstract class BaseDisguiseCommand implements CommandExecutor {
throw new DisguiseParseException(ChatColor.RED + "Error! The disguise " + ChatColor.GREEN + args[0]
+ ChatColor.RED + " doesn't exist!");
}
if (disguiseType.isUnknown()) {
throw new DisguiseParseException(ChatColor.RED + "Error! You cannot disguise as " + ChatColor.GREEN + "Unknown!");
}
if (disguiseType.getEntityType() == null) {
throw new DisguiseParseException(ChatColor.RED + "Error! This version of minecraft does not have that disguise!");
}

View File

@@ -970,6 +970,7 @@ public class DisguiseUtilities {
/**
* Setup it so he can see himself when disguised
* @param disguise
*/
public static void setupFakeDisguise(final Disguise disguise) {
Entity e = disguise.getEntity();

View File

@@ -52,6 +52,7 @@ public class DisguiseValues {
private HashMap<Integer, Object> metaValues = new HashMap<>();
private Class nmsEntityClass;
@SuppressWarnings("LeakingThisInConstructor")
public DisguiseValues(DisguiseType type, Class classType, int entitySize, double maxHealth) {
values.put(type, this);
enumEntitySize = entitySize;