Rename more custom entity fields

This commit is contained in:
libraryaddict 2020-04-19 08:23:35 +12:00
parent f10870b727
commit e29ad3ffde
No known key found for this signature in database
GPG Key ID: 052E4FBCD257AEA4
4 changed files with 7 additions and 7 deletions

View File

@ -596,7 +596,7 @@ public class DisguiseConfig {
for (String name : config.getConfigurationSection("Custom-Entities").getKeys(false)) {
try {
if (!name.matches("[a-zA-Z0-9_]+")) {
DisguiseUtilities.getLogger().severe("Invalid custom disguise name '" + name + "'");
DisguiseUtilities.getLogger().severe("Invalid modded disguise name '" + name + "'");
continue;
}
@ -640,7 +640,7 @@ public class DisguiseConfig {
ModdedEntity entity = new ModdedEntity(null, name, living, mod, version, requireMessage, 0);
ModdedManager.registerCustomEntity(
ModdedManager.registerModdedEntity(
new NamespacedKey(key.substring(0, key.indexOf(":")), key.substring(key.indexOf(":") + 1)),
entity, register);

View File

@ -17,7 +17,7 @@ public class ModdedDisguise extends TargetedDisguise {
private ModdedEntity moddedEntity;
public ModdedDisguise(String moddedEntityName) {
this(ModdedManager.getCustomEntity(moddedEntityName));
this(ModdedManager.getModdedEntity(moddedEntityName));
}
public ModdedDisguise(ModdedEntity moddedEntity) {

View File

@ -67,7 +67,7 @@ public class ModdedManager implements PluginMessageListener {
fmlHandshake = stream.toByteArray();
}
public static void registerCustomEntity(NamespacedKey name, ModdedEntity entity, boolean register) {
public static void registerModdedEntity(NamespacedKey name, ModdedEntity entity, boolean register) {
if (entities.keySet().stream().anyMatch(n -> n.toString().equalsIgnoreCase(name.toString()))) {
throw new IllegalArgumentException(name + " has already been registered");
}
@ -93,11 +93,11 @@ public class ModdedManager implements PluginMessageListener {
entities.put(name, entity);
}
public static ModdedEntity getCustomEntity(NamespacedKey name) {
public static ModdedEntity getModdedEntity(NamespacedKey name) {
return entities.get(name);
}
public static ModdedEntity getCustomEntity(String name) {
public static ModdedEntity getModdedEntity(String name) {
for (ModdedEntity entity : entities.values()) {
if (!entity.getName().equalsIgnoreCase(name)) {
continue;

View File

@ -647,7 +647,7 @@ public class DisguiseParser {
name = disguisePerm.toReadable();
if (disguisePerm.getType().isCustom()) {
ModdedEntity ent = ModdedManager.getCustomEntity(disguisePerm.toReadable());
ModdedEntity ent = ModdedManager.getModdedEntity(disguisePerm.toReadable());
if (ent == null) {
throw new DisguiseParseException(LibsMsg.PARSE_CANT_DISG_UNKNOWN);