mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 18:45:29 +01:00
Implement a few more entity registry methods
This commit is contained in:
parent
27d7b2dee3
commit
4212921a98
@ -7,6 +7,7 @@ import java.util.Optional;
|
|||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
import com.google.common.collect.BiMap;
|
import com.google.common.collect.BiMap;
|
||||||
import com.google.common.collect.HashBiMap;
|
import com.google.common.collect.HashBiMap;
|
||||||
@ -263,6 +264,16 @@ public class CustomEntityRegistry extends DefaultedRegistry {
|
|||||||
return this.wrapped.getTag(var0);
|
return this.wrapped.getTag(var0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Stream getTagNames() {
|
||||||
|
return wrapped.getTagNames();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Stream getTags() {
|
||||||
|
return wrapped.getTags();
|
||||||
|
}
|
||||||
|
|
||||||
public MappedRegistry<EntityType<?>> getWrapped() {
|
public MappedRegistry<EntityType<?>> getWrapped() {
|
||||||
return wrapped;
|
return wrapped;
|
||||||
}
|
}
|
||||||
@ -282,6 +293,11 @@ public class CustomEntityRegistry extends DefaultedRegistry {
|
|||||||
entityIds.put(entityClass, entityId);
|
entityIds.put(entityClass, entityId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int size() {
|
||||||
|
return wrapped.size();
|
||||||
|
}
|
||||||
|
|
||||||
private static final MethodHandle IREGISTRY_CUSTOM_HOLDER_PROVDER = NMS.getFirstGetter(MappedRegistry.class,
|
private static final MethodHandle IREGISTRY_CUSTOM_HOLDER_PROVDER = NMS.getFirstGetter(MappedRegistry.class,
|
||||||
Function.class);
|
Function.class);
|
||||||
private static final MethodHandle IREGISTRY_LIFECYCLE = NMS.getFirstGetter(Registry.class, Lifecycle.class);
|
private static final MethodHandle IREGISTRY_LIFECYCLE = NMS.getFirstGetter(Registry.class, Lifecycle.class);
|
||||||
|
@ -5,6 +5,7 @@ import java.util.Iterator;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
import com.google.common.collect.BiMap;
|
import com.google.common.collect.BiMap;
|
||||||
import com.google.common.collect.HashBiMap;
|
import com.google.common.collect.HashBiMap;
|
||||||
@ -247,11 +248,6 @@ public class CustomEntityRegistry extends DefaultedMappedRegistry {
|
|||||||
return this.wrapped.getOptional(var0);
|
return this.wrapped.getOptional(var0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EntityType getOrThrow(ResourceKey key) {
|
|
||||||
return wrapped.getOrThrow(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional getRandom(RandomSource paramRandom) {
|
public Optional getRandom(RandomSource paramRandom) {
|
||||||
return wrapped.getRandom(paramRandom);
|
return wrapped.getRandom(paramRandom);
|
||||||
@ -267,6 +263,16 @@ public class CustomEntityRegistry extends DefaultedMappedRegistry {
|
|||||||
return this.wrapped.getTag(var0);
|
return this.wrapped.getTag(var0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Stream getTagNames() {
|
||||||
|
return wrapped.getTagNames();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Stream getTags() {
|
||||||
|
return wrapped.getTags();
|
||||||
|
}
|
||||||
|
|
||||||
public MappedRegistry<EntityType<?>> getWrapped() {
|
public MappedRegistry<EntityType<?>> getWrapped() {
|
||||||
return wrapped;
|
return wrapped;
|
||||||
}
|
}
|
||||||
@ -291,6 +297,11 @@ public class CustomEntityRegistry extends DefaultedMappedRegistry {
|
|||||||
return (Set) wrapped.registryKeySet();
|
return (Set) wrapped.registryKeySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int size() {
|
||||||
|
return wrapped.size();
|
||||||
|
}
|
||||||
|
|
||||||
private static final MethodHandle IREGISTRY_HOLDER_PROVDER = NMS.getGetter(MappedRegistry.class, "m");
|
private static final MethodHandle IREGISTRY_HOLDER_PROVDER = NMS.getGetter(MappedRegistry.class, "m");
|
||||||
private static final MethodHandle IREGISTRY_LIFECYCLE = NMS.getFirstGetter(MappedRegistry.class, Lifecycle.class);
|
private static final MethodHandle IREGISTRY_LIFECYCLE = NMS.getFirstGetter(MappedRegistry.class, Lifecycle.class);
|
||||||
// replace regex .*?> ([A-Z_]+).*?of\((.*?)::new.*?$ minecraftClassMap.put(EntityType.\1, \2.class);
|
// replace regex .*?> ([A-Z_]+).*?of\((.*?)::new.*?$ minecraftClassMap.put(EntityType.\1, \2.class);
|
||||||
|
Loading…
Reference in New Issue
Block a user