mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 02:25:57 +01:00
Backport some forwarding methods to 1.19
This commit is contained in:
parent
f92fb4373f
commit
b6214c1bff
@ -213,6 +213,11 @@ public class CustomEntityRegistry extends DefaultedMappedRegistry<EntityType<?>>
|
|||||||
return minecraftClassMap.inverse().get(search);
|
return minecraftClassMap.inverse().get(search);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Registry<EntityType<?>> freeze() {
|
||||||
|
return wrapped.freeze();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MappedRegistry<EntityType<?>> get() {
|
public MappedRegistry<EntityType<?>> get() {
|
||||||
return wrapped;
|
return wrapped;
|
||||||
@ -326,11 +331,21 @@ public class CustomEntityRegistry extends DefaultedMappedRegistry<EntityType<?>>
|
|||||||
entityIds.put(entityClass, entityId);
|
entityIds.put(entityClass, entityId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Reference<EntityType<?>> register(ResourceKey<EntityType<?>> key, EntityType<?> type, Lifecycle lifecycle) {
|
||||||
|
return wrapped.register(key, type, lifecycle);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<ResourceKey<EntityType<?>>> registryKeySet() {
|
public Set<ResourceKey<EntityType<?>>> registryKeySet() {
|
||||||
return wrapped.registryKeySet();
|
return wrapped.registryKeySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Lifecycle registryLifecycle() {
|
||||||
|
return wrapped.registryLifecycle();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resetTags() {
|
public void resetTags() {
|
||||||
wrapped.resetTags();
|
wrapped.resetTags();
|
||||||
|
@ -26,6 +26,7 @@ import net.minecraft.core.HolderLookup.RegistryLookup;
|
|||||||
import net.minecraft.core.HolderOwner;
|
import net.minecraft.core.HolderOwner;
|
||||||
import net.minecraft.core.HolderSet.Named;
|
import net.minecraft.core.HolderSet.Named;
|
||||||
import net.minecraft.core.MappedRegistry;
|
import net.minecraft.core.MappedRegistry;
|
||||||
|
import net.minecraft.core.RegistrationInfo;
|
||||||
import net.minecraft.core.Registry;
|
import net.minecraft.core.Registry;
|
||||||
import net.minecraft.resources.ResourceKey;
|
import net.minecraft.resources.ResourceKey;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
@ -219,6 +220,11 @@ public class CustomEntityRegistry extends DefaultedMappedRegistry<EntityType<?>>
|
|||||||
return minecraftClassMap.inverse().get(search);
|
return minecraftClassMap.inverse().get(search);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Registry<EntityType<?>> freeze() {
|
||||||
|
return wrapped.freeze();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MappedRegistry<EntityType<?>> get() {
|
public MappedRegistry<EntityType<?>> get() {
|
||||||
return wrapped;
|
return wrapped;
|
||||||
@ -246,6 +252,11 @@ public class CustomEntityRegistry extends DefaultedMappedRegistry<EntityType<?>>
|
|||||||
return this.wrapped.getHolder(var0);
|
return this.wrapped.getHolder(var0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Optional<Reference<EntityType<?>>> getHolder(ResourceLocation var0) {
|
||||||
|
return this.wrapped.getHolder(var0);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId(EntityType key) {
|
public int getId(EntityType key) {
|
||||||
if (entityIds.containsKey(key))
|
if (entityIds.containsKey(key))
|
||||||
@ -272,6 +283,11 @@ public class CustomEntityRegistry extends DefaultedMappedRegistry<EntityType<?>>
|
|||||||
return this.wrapped.getOptional(var0);
|
return this.wrapped.getOptional(var0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Named<EntityType<?>> getOrCreateTag(TagKey<EntityType<?>> var0) {
|
||||||
|
return this.wrapped.getOrCreateTag(var0);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<Reference<EntityType<?>>> getRandom(RandomSource paramRandom) {
|
public Optional<Reference<EntityType<?>>> getRandom(RandomSource paramRandom) {
|
||||||
return wrapped.getRandom(paramRandom);
|
return wrapped.getRandom(paramRandom);
|
||||||
@ -317,21 +333,42 @@ public class CustomEntityRegistry extends DefaultedMappedRegistry<EntityType<?>>
|
|||||||
return wrapped.iterator();
|
return wrapped.iterator();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResourceKey<? extends Registry<EntityType<?>>> key() {
|
||||||
|
return wrapped.key();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<ResourceLocation> keySet() {
|
public Set<ResourceLocation> keySet() {
|
||||||
return wrapped.keySet();
|
return wrapped.keySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void put(int entityId, ResourceLocation key, EntityType entityClass) {
|
public void put(int entityId, ResourceLocation key, EntityType<?> entityClass) {
|
||||||
entities.put(key, entityClass);
|
entities.put(key, entityClass);
|
||||||
entityIds.put(entityClass, entityId);
|
entityIds.put(entityClass, entityId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Reference<EntityType<?>> register(ResourceKey<EntityType<?>> key, EntityType<?> type,
|
||||||
|
RegistrationInfo info) {
|
||||||
|
return wrapped.register(key, type, info);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Optional<RegistrationInfo> registrationInfo(ResourceKey<EntityType<?>> key) {
|
||||||
|
return wrapped.registrationInfo(key);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<ResourceKey<EntityType<?>>> registryKeySet() {
|
public Set<ResourceKey<EntityType<?>>> registryKeySet() {
|
||||||
return wrapped.registryKeySet();
|
return wrapped.registryKeySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Lifecycle registryLifecycle() {
|
||||||
|
return wrapped.registryLifecycle();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resetTags() {
|
public void resetTags() {
|
||||||
wrapped.resetTags();
|
wrapped.resetTags();
|
||||||
|
Loading…
Reference in New Issue
Block a user