mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-28 21:15:51 +01:00
Use Key#namespaced in entity type enums (#3858)
This commit is contained in:
parent
0427aec4ab
commit
f92d241028
@ -26,6 +26,7 @@ import com.google.common.base.Preconditions;
|
||||
import com.viaversion.viaversion.api.protocol.Protocol;
|
||||
import com.viaversion.viaversion.util.EntityTypeUtil;
|
||||
import java.util.Locale;
|
||||
import com.viaversion.viaversion.util.Key;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public enum EntityTypes1_14 implements EntityType {
|
||||
@ -211,7 +212,7 @@ public enum EntityTypes1_14 implements EntityType {
|
||||
|
||||
EntityTypes1_14(final EntityType parent) {
|
||||
this.parent = parent;
|
||||
this.identifier = "minecraft:" + name().toLowerCase(Locale.ROOT);
|
||||
this.identifier = Key.namespaced(name().toLowerCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
EntityTypes1_14(final EntityType parent, @Nullable final String identifier) {
|
||||
|
@ -26,6 +26,7 @@ import com.google.common.base.Preconditions;
|
||||
import com.viaversion.viaversion.api.protocol.Protocol;
|
||||
import com.viaversion.viaversion.util.EntityTypeUtil;
|
||||
import java.util.Locale;
|
||||
import com.viaversion.viaversion.util.Key;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public enum EntityTypes1_15 implements EntityType {
|
||||
@ -212,7 +213,7 @@ public enum EntityTypes1_15 implements EntityType {
|
||||
|
||||
EntityTypes1_15(final EntityType parent) {
|
||||
this.parent = parent;
|
||||
this.identifier = "minecraft:" + name().toLowerCase(Locale.ROOT);
|
||||
this.identifier = Key.namespaced(name().toLowerCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
EntityTypes1_15(final EntityType parent, @Nullable final String identifier) {
|
||||
|
@ -26,6 +26,7 @@ import com.google.common.base.Preconditions;
|
||||
import com.viaversion.viaversion.api.protocol.Protocol;
|
||||
import com.viaversion.viaversion.util.EntityTypeUtil;
|
||||
import java.util.Locale;
|
||||
import com.viaversion.viaversion.util.Key;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public enum EntityTypes1_16 implements EntityType {
|
||||
@ -216,7 +217,7 @@ public enum EntityTypes1_16 implements EntityType {
|
||||
|
||||
EntityTypes1_16(final EntityType parent) {
|
||||
this.parent = parent;
|
||||
this.identifier = "minecraft:" + name().toLowerCase(Locale.ROOT);
|
||||
this.identifier = Key.namespaced(name().toLowerCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
EntityTypes1_16(final EntityType parent, @Nullable final String identifier) {
|
||||
|
@ -26,6 +26,7 @@ import com.google.common.base.Preconditions;
|
||||
import com.viaversion.viaversion.api.protocol.Protocol;
|
||||
import com.viaversion.viaversion.util.EntityTypeUtil;
|
||||
import java.util.Locale;
|
||||
import com.viaversion.viaversion.util.Key;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public enum EntityTypes1_16_2 implements EntityType {
|
||||
@ -219,7 +220,7 @@ public enum EntityTypes1_16_2 implements EntityType {
|
||||
|
||||
EntityTypes1_16_2(final EntityType parent) {
|
||||
this.parent = parent;
|
||||
this.identifier = "minecraft:" + name().toLowerCase(Locale.ROOT);
|
||||
this.identifier = Key.namespaced(name().toLowerCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
EntityTypes1_16_2(final EntityType parent, @Nullable final String identifier) {
|
||||
|
@ -26,6 +26,7 @@ import com.google.common.base.Preconditions;
|
||||
import com.viaversion.viaversion.api.protocol.Protocol;
|
||||
import com.viaversion.viaversion.util.EntityTypeUtil;
|
||||
import java.util.Locale;
|
||||
import com.viaversion.viaversion.util.Key;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public enum EntityTypes1_17 implements EntityType {
|
||||
@ -225,7 +226,7 @@ public enum EntityTypes1_17 implements EntityType {
|
||||
|
||||
EntityTypes1_17(final EntityType parent) {
|
||||
this.parent = parent;
|
||||
this.identifier = "minecraft:" + name().toLowerCase(Locale.ROOT);
|
||||
this.identifier = Key.namespaced(name().toLowerCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
EntityTypes1_17(final EntityType parent, @Nullable final String identifier) {
|
||||
|
@ -26,6 +26,7 @@ import com.google.common.base.Preconditions;
|
||||
import com.viaversion.viaversion.api.protocol.Protocol;
|
||||
import com.viaversion.viaversion.util.EntityTypeUtil;
|
||||
import java.util.Locale;
|
||||
import com.viaversion.viaversion.util.Key;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public enum EntityTypes1_19 implements EntityType {
|
||||
@ -230,7 +231,7 @@ public enum EntityTypes1_19 implements EntityType {
|
||||
|
||||
EntityTypes1_19(final EntityType parent) {
|
||||
this.parent = parent;
|
||||
this.identifier = "minecraft:" + name().toLowerCase(Locale.ROOT);
|
||||
this.identifier = Key.namespaced(name().toLowerCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
EntityTypes1_19(final EntityType parent, @Nullable final String identifier) {
|
||||
|
@ -26,6 +26,7 @@ import com.google.common.base.Preconditions;
|
||||
import com.viaversion.viaversion.api.protocol.Protocol;
|
||||
import com.viaversion.viaversion.util.EntityTypeUtil;
|
||||
import java.util.Locale;
|
||||
import com.viaversion.viaversion.util.Key;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public enum EntityTypes1_19_3 implements EntityType {
|
||||
@ -231,7 +232,7 @@ public enum EntityTypes1_19_3 implements EntityType {
|
||||
|
||||
EntityTypes1_19_3(final EntityType parent) {
|
||||
this.parent = parent;
|
||||
this.identifier = "minecraft:" + name().toLowerCase(Locale.ROOT);
|
||||
this.identifier = Key.namespaced(name().toLowerCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
EntityTypes1_19_3(final EntityType parent, @Nullable final String identifier) {
|
||||
|
@ -26,6 +26,7 @@ import com.google.common.base.Preconditions;
|
||||
import com.viaversion.viaversion.api.protocol.Protocol;
|
||||
import com.viaversion.viaversion.util.EntityTypeUtil;
|
||||
import java.util.Locale;
|
||||
import com.viaversion.viaversion.util.Key;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public enum EntityTypes1_19_4 implements EntityType {
|
||||
@ -238,7 +239,7 @@ public enum EntityTypes1_19_4 implements EntityType {
|
||||
|
||||
EntityTypes1_19_4(final EntityType parent) {
|
||||
this.parent = parent;
|
||||
this.identifier = "minecraft:" + name().toLowerCase(Locale.ROOT);
|
||||
this.identifier = Key.namespaced(name().toLowerCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
EntityTypes1_19_4(final EntityType parent, @Nullable final String identifier) {
|
||||
|
@ -26,6 +26,7 @@ import com.google.common.base.Preconditions;
|
||||
import com.viaversion.viaversion.api.protocol.Protocol;
|
||||
import com.viaversion.viaversion.util.EntityTypeUtil;
|
||||
import java.util.Locale;
|
||||
import com.viaversion.viaversion.util.Key;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public enum EntityTypes1_20_3 implements EntityType {
|
||||
@ -240,7 +241,7 @@ public enum EntityTypes1_20_3 implements EntityType {
|
||||
|
||||
EntityTypes1_20_3(final EntityType parent) {
|
||||
this.parent = parent;
|
||||
this.identifier = "minecraft:" + name().toLowerCase(Locale.ROOT);
|
||||
this.identifier = Key.namespaced(name().toLowerCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
EntityTypes1_20_3(final EntityType parent, @Nullable final String identifier) {
|
||||
|
@ -26,6 +26,7 @@ import com.google.common.base.Preconditions;
|
||||
import com.viaversion.viaversion.api.protocol.Protocol;
|
||||
import com.viaversion.viaversion.util.EntityTypeUtil;
|
||||
import java.util.Locale;
|
||||
import com.viaversion.viaversion.util.Key;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public enum EntityTypes1_20_5 implements EntityType {
|
||||
@ -246,7 +247,7 @@ public enum EntityTypes1_20_5 implements EntityType {
|
||||
|
||||
EntityTypes1_20_5(final EntityType parent) {
|
||||
this.parent = parent;
|
||||
this.identifier = "minecraft:" + name().toLowerCase(Locale.ROOT);
|
||||
this.identifier = Key.namespaced(name().toLowerCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
EntityTypes1_20_5(final EntityType parent, @Nullable final String identifier) {
|
||||
|
@ -1202,7 +1202,7 @@ public final class BlockItemPacketRewriter1_20_5 extends ItemRewriter<Clientboun
|
||||
|
||||
if (Key.stripMinecraftNamespace(id).equals("sweeping")) {
|
||||
// Renamed
|
||||
id = "minecraft:sweeping_edge";
|
||||
id = Key.namespaced("sweeping_edge");
|
||||
}
|
||||
|
||||
final int intId = Enchantments1_20_5.keyToId(id);
|
||||
|
Loading…
Reference in New Issue
Block a user