mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-12-14 15:26:54 +01:00
Rename more custom entity fields
This commit is contained in:
parent
f10870b727
commit
e29ad3ffde
@ -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);
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user