diff --git a/src/main/java/net/minestom/server/particle/ParticleImpl.java b/src/main/java/net/minestom/server/particle/ParticleImpl.java index da23bdbe5..12580ceab 100644 --- a/src/main/java/net/minestom/server/particle/ParticleImpl.java +++ b/src/main/java/net/minestom/server/particle/ParticleImpl.java @@ -8,10 +8,7 @@ import java.util.Collection; record ParticleImpl(NamespaceID namespace, int id) implements Particle { private static final Registry.Container CONTAINER = Registry.createContainer(Registry.Resource.PARTICLES, - (namespace, object) -> { - final int id = ((Number) object.get("id")).intValue(); - return new ParticleImpl(NamespaceID.from(namespace), id); - }); + (namespace, object) -> new ParticleImpl(NamespaceID.from(namespace), ((Number) object.get("id")).intValue())); static Particle get(@NotNull String namespace) { return CONTAINER.get(namespace); diff --git a/src/main/java/net/minestom/server/potion/PotionTypeImpl.java b/src/main/java/net/minestom/server/potion/PotionTypeImpl.java index b1006b3be..1da528935 100644 --- a/src/main/java/net/minestom/server/potion/PotionTypeImpl.java +++ b/src/main/java/net/minestom/server/potion/PotionTypeImpl.java @@ -8,10 +8,7 @@ import java.util.Collection; record PotionTypeImpl(NamespaceID namespace, int id) implements PotionType { private static final Registry.Container CONTAINER = Registry.createContainer(Registry.Resource.POTION_TYPES, - (namespace, object) -> { - final int id = ((Number) object.get("id")).intValue(); - return new PotionTypeImpl(NamespaceID.from(namespace), id); - }); + (namespace, object) -> new PotionTypeImpl(NamespaceID.from(namespace), ((Number) object.get("id")).intValue())); static PotionType get(@NotNull String namespace) { return CONTAINER.get(namespace); diff --git a/src/main/java/net/minestom/server/sound/SoundEventImpl.java b/src/main/java/net/minestom/server/sound/SoundEventImpl.java index 4e9fac19e..8430feedd 100644 --- a/src/main/java/net/minestom/server/sound/SoundEventImpl.java +++ b/src/main/java/net/minestom/server/sound/SoundEventImpl.java @@ -8,10 +8,7 @@ import java.util.Collection; record SoundEventImpl(NamespaceID namespace, int id) implements SoundEvent { private static final Registry.Container CONTAINER = Registry.createContainer(Registry.Resource.SOUNDS, - (namespace, object) -> { - final int id = ((Number) object.get("id")).intValue(); - return new SoundEventImpl(NamespaceID.from(namespace), id); - }); + (namespace, object) -> new SoundEventImpl(NamespaceID.from(namespace), ((Number) object.get("id")).intValue())); static SoundEvent get(@NotNull String namespace) { return CONTAINER.get(namespace); diff --git a/src/main/java/net/minestom/server/statistic/StatisticTypeImpl.java b/src/main/java/net/minestom/server/statistic/StatisticTypeImpl.java index 7cc900b18..c53c9569b 100644 --- a/src/main/java/net/minestom/server/statistic/StatisticTypeImpl.java +++ b/src/main/java/net/minestom/server/statistic/StatisticTypeImpl.java @@ -8,10 +8,7 @@ import java.util.Collection; record StatisticTypeImpl(NamespaceID namespace, int id) implements StatisticType { private static final Registry.Container CONTAINER = Registry.createContainer(Registry.Resource.STATISTICS, - (namespace, object) -> { - final int id = ((Number) object.get("id")).intValue(); - return new StatisticTypeImpl(NamespaceID.from(namespace), id); - }); + (namespace, object) -> new StatisticTypeImpl(NamespaceID.from(namespace), ((Number) object.get("id")).intValue())); static StatisticType get(@NotNull String namespace) { return CONTAINER.get(namespace);