Potion -> Effect from the last commit

This commit is contained in:
Camotoy 2021-10-11 21:16:17 -04:00
parent 02387dc6e2
commit 682e4b3edd
No known key found for this signature in database
GPG Key ID: 7EEFB66FE798081F
2 changed files with 4 additions and 4 deletions

View File

@ -56,7 +56,7 @@ import java.util.*;
@Translator(packet = ServerDeclareCommandsPacket.class)
public class JavaDeclareCommandsTranslator extends PacketTranslator<ServerDeclareCommandsPacket> {
private static final String[] ALL_POTION_IDENTIFIERS = EntityUtils.getAllPotionIdentifiers();
private static final String[] ALL_EFFECT_IDENTIFIERS = EntityUtils.getAllEffectIdentifiers();
private static final String[] ENUM_BOOLEAN = {"true", "false"};
private static final String[] VALID_COLORS;
private static final String[] VALID_SCOREBOARD_SLOTS;
@ -223,7 +223,7 @@ public class JavaDeclareCommandsTranslator extends PacketTranslator<ServerDeclar
case ENTITY_SUMMON -> EntityType.ALL_JAVA_IDENTIFIERS;
case COLOR -> VALID_COLORS;
case SCOREBOARD_SLOT -> VALID_SCOREBOARD_SLOTS;
case MOB_EFFECT -> ALL_POTION_IDENTIFIERS;
case MOB_EFFECT -> ALL_EFFECT_IDENTIFIERS;
default -> CommandParam.STRING;
};
}

View File

@ -40,9 +40,9 @@ import java.util.Locale;
public final class EntityUtils {
/**
* @return a new String array of all known potion identifiers
* @return a new String array of all known effect identifiers
*/
public static String[] getAllPotionIdentifiers() {
public static String[] getAllEffectIdentifiers() {
String[] identifiers = new String[Effect.VALUES.length];
for (int i = 0; i < Effect.VALUES.length; i++) {
identifiers[i] = "minecraft:" + Effect.VALUES[i].name().toLowerCase(Locale.ROOT);