diff --git a/v1_13_R2/src/main/java/net/citizensnpcs/nms/v1_13_R2/util/CustomEntityRegistry.java b/v1_13_R2/src/main/java/net/citizensnpcs/nms/v1_13_R2/util/CustomEntityRegistry.java index f9bdc82f6..2bb87f059 100644 --- a/v1_13_R2/src/main/java/net/citizensnpcs/nms/v1_13_R2/util/CustomEntityRegistry.java +++ b/v1_13_R2/src/main/java/net/citizensnpcs/nms/v1_13_R2/util/CustomEntityRegistry.java @@ -5,6 +5,7 @@ import java.util.Map; import java.util.Random; import java.util.Set; import java.util.function.Supplier; +import java.util.stream.Stream; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; @@ -37,11 +38,26 @@ public class CustomEntityRegistry extends RegistryMaterials implements Supplier< return wrapped.a(paramRandom); } + @Override + public MinecraftKey b() { + return wrapped.b(); + } + @Override public boolean c(MinecraftKey paramK) { return wrapped.c(paramK); } + @Override + public boolean d() { + return wrapped.d(); + } + + @Override + public Stream> f() { + return wrapped.f(); + } + public EntityTypes findType(Class search) { for (Object type : wrapped) { if (((EntityTypes) type).c() == search) diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/util/CustomEntityRegistry.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/util/CustomEntityRegistry.java index f07fbf949..267b9aaa6 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/util/CustomEntityRegistry.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/util/CustomEntityRegistry.java @@ -6,6 +6,7 @@ import java.util.Optional; import java.util.Random; import java.util.Set; import java.util.function.Supplier; +import java.util.stream.Stream; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; @@ -25,6 +26,11 @@ public class CustomEntityRegistry extends RegistryBlocks implements Supplier> d() { + return wrapped.d(); + } + public EntityTypes findType(Class search) { return minecraftClassMap.inverse().get(search); /* diff --git a/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/util/CustomEntityRegistry.java b/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/util/CustomEntityRegistry.java index 532338abf..c6a58edab 100644 --- a/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/util/CustomEntityRegistry.java +++ b/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/util/CustomEntityRegistry.java @@ -6,6 +6,7 @@ import java.util.Optional; import java.util.Random; import java.util.Set; import java.util.function.Supplier; +import java.util.stream.Stream; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; @@ -25,6 +26,11 @@ public class CustomEntityRegistry extends RegistryBlocks implements Supplier> d() { + return wrapped.d(); + } + public EntityTypes findType(Class search) { return minecraftClassMap.inverse().get(search); /* diff --git a/v1_16_R3/src/main/java/net/citizensnpcs/nms/v1_16_R3/util/CustomEntityRegistry.java b/v1_16_R3/src/main/java/net/citizensnpcs/nms/v1_16_R3/util/CustomEntityRegistry.java index 2b56915a1..876ec6bc7 100644 --- a/v1_16_R3/src/main/java/net/citizensnpcs/nms/v1_16_R3/util/CustomEntityRegistry.java +++ b/v1_16_R3/src/main/java/net/citizensnpcs/nms/v1_16_R3/util/CustomEntityRegistry.java @@ -3,10 +3,12 @@ package net.citizensnpcs.nms.v1_16_R3.util; import java.lang.invoke.MethodHandle; import java.util.Iterator; import java.util.Map; +import java.util.Map.Entry; import java.util.Optional; import java.util.Random; import java.util.Set; import java.util.function.Supplier; +import java.util.stream.Stream; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; @@ -31,6 +33,11 @@ public class CustomEntityRegistry extends RegistryBlocks implements Supplier) key); } + @Override + public Set>, EntityTypes>> d() { + return wrapped.d(); + } + @Override public Object d(ResourceKey key) { return wrapped.d(key); } + @Override + public ResourceKey>> f() { + return wrapped.f(); + } + public EntityTypes findType(Class search) { return minecraftClassMap.inverse().get(search); /* @@ -75,6 +97,11 @@ public class CustomEntityRegistry extends RegistryBlocks implements Supplier> g() { + return wrapped.g(); + } + @Override public RegistryBlocks> get() { return wrapped; diff --git a/v1_17_R1/src/main/java/net/citizensnpcs/nms/v1_17_R1/util/CustomEntityRegistry.java b/v1_17_R1/src/main/java/net/citizensnpcs/nms/v1_17_R1/util/CustomEntityRegistry.java index 51700c265..789369450 100644 --- a/v1_17_R1/src/main/java/net/citizensnpcs/nms/v1_17_R1/util/CustomEntityRegistry.java +++ b/v1_17_R1/src/main/java/net/citizensnpcs/nms/v1_17_R1/util/CustomEntityRegistry.java @@ -7,6 +7,7 @@ import java.util.Optional; import java.util.Random; import java.util.Set; import java.util.function.Supplier; +import java.util.stream.Stream; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; @@ -162,6 +163,11 @@ public class CustomEntityRegistry extends DefaultedRegistry implements Supplier< return this.wrapped.containsKey(var0); } + @Override + public Lifecycle elementsLifecycle() { + return wrapped.elementsLifecycle(); + } + @Override public Set entrySet() { return (Set) wrapped.entrySet(); @@ -242,16 +248,31 @@ public class CustomEntityRegistry extends DefaultedRegistry implements Supplier< return (Iterator) wrapped.iterator(); } + @Override + public ResourceKey>> key() { + return wrapped.key(); + } + @Override public Set keySet() { return (Set) wrapped.keySet(); } + @Override + public Lifecycle lifecycle(Object type) { + return wrapped.lifecycle((EntityType) type); + } + public void put(int entityId, ResourceLocation key, EntityType entityClass) { entities.put(key, entityClass); entityIds.put(entityClass, entityId); } + @Override + public Stream stream() { + return wrapped.stream(); + } + private static final MethodHandle IREGISTRY_LIFECYCLE = NMS.getFirstGetter(Registry.class, Lifecycle.class); // replace regex // .*?> ([A-Z_]+).*?of\((.*?)::new.*?$ diff --git a/v1_18_R2/src/main/java/net/citizensnpcs/nms/v1_18_R2/util/CustomEntityRegistry.java b/v1_18_R2/src/main/java/net/citizensnpcs/nms/v1_18_R2/util/CustomEntityRegistry.java index ef11f1001..dab87c673 100644 --- a/v1_18_R2/src/main/java/net/citizensnpcs/nms/v1_18_R2/util/CustomEntityRegistry.java +++ b/v1_18_R2/src/main/java/net/citizensnpcs/nms/v1_18_R2/util/CustomEntityRegistry.java @@ -13,10 +13,14 @@ import java.util.stream.Stream; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; import com.google.common.collect.Maps; +import com.mojang.serialization.Codec; import com.mojang.serialization.Lifecycle; import net.citizensnpcs.util.NMS; import net.minecraft.core.DefaultedRegistry; +import net.minecraft.core.Holder; +import net.minecraft.core.Holder.Reference; +import net.minecraft.core.IdMap; import net.minecraft.core.MappedRegistry; import net.minecraft.core.Registry; import net.minecraft.resources.ResourceKey; @@ -152,6 +156,16 @@ public class CustomEntityRegistry extends DefaultedRegistry implements Supplier< this.wrapped = original; } + @Override + public IdMap>> asHolderIdMap() { + return wrapped.asHolderIdMap(); + } + + @Override + public void bindTags(Map var0) { + wrapped.bindTags(var0); + } + @Override public Object byId(int var0) { return this.wrapped.byId(var0); @@ -162,6 +176,11 @@ public class CustomEntityRegistry extends DefaultedRegistry implements Supplier< return this.wrapped.byIdOrThrow(var0); } + @Override + public Codec byNameCodec() { + return wrapped.byNameCodec(); + } + @Override public boolean containsKey(ResourceKey var0) { return this.wrapped.containsKey(var0); @@ -172,6 +191,16 @@ public class CustomEntityRegistry extends DefaultedRegistry implements Supplier< return this.wrapped.containsKey(var0); } + @Override + public Reference createIntrusiveHolder(Object type) { + return this.wrapped.createIntrusiveHolder((EntityType) type); + } + + @Override + public Lifecycle elementsLifecycle() { + return wrapped.elementsLifecycle(); + } + @Override public Set entrySet() { return (Set) wrapped.entrySet(); @@ -189,6 +218,11 @@ public class CustomEntityRegistry extends DefaultedRegistry implements Supplier< */ } + @Override + public Registry> freeze() { + return wrapped.freeze(); + } + @Override public DefaultedRegistry> get() { return wrapped; @@ -272,26 +306,56 @@ public class CustomEntityRegistry extends DefaultedRegistry implements Supplier< return wrapped.getTags(); } + @Override + public boolean isKnownTagName(TagKey key) { + return wrapped.isKnownTagName(key); + } + @Override public Iterator iterator() { return (Iterator) wrapped.iterator(); } + @Override + public ResourceKey>> key() { + return wrapped.key(); + } + @Override public Set keySet() { return (Set) wrapped.keySet(); } + @Override + public Lifecycle lifecycle() { + return wrapped.lifecycle(); + } + + @Override + public Lifecycle lifecycle(Object type) { + return wrapped.lifecycle((EntityType) type); + } + public void put(int entityId, ResourceLocation key, EntityType entityClass) { entities.put(key, entityClass); entityIds.put(entityClass, entityId); } + @Override + public void resetTags() { + wrapped.resetTags(); + } + @Override public int size() { return wrapped.size(); } + @Override + public Stream> stream() { + return wrapped.stream(); + } + private static final MethodHandle IREGISTRY_CUSTOM_HOLDER_PROVDER = NMS.getFirstGetter(MappedRegistry.class, Function.class); private static final MethodHandle IREGISTRY_LIFECYCLE = NMS.getFirstGetter(Registry.class, Lifecycle.class); diff --git a/v1_19_R3/src/main/java/net/citizensnpcs/nms/v1_19_R3/util/CustomEntityRegistry.java b/v1_19_R3/src/main/java/net/citizensnpcs/nms/v1_19_R3/util/CustomEntityRegistry.java index a7a20bff3..d2a295d3b 100644 --- a/v1_19_R3/src/main/java/net/citizensnpcs/nms/v1_19_R3/util/CustomEntityRegistry.java +++ b/v1_19_R3/src/main/java/net/citizensnpcs/nms/v1_19_R3/util/CustomEntityRegistry.java @@ -316,6 +316,11 @@ public class CustomEntityRegistry extends DefaultedMappedRegistry> return wrapped.iterator(); } + @Override + public ResourceKey>> key() { + return wrapped.key(); + } + @Override public Set keySet() { return wrapped.keySet();