DimensionManager.registerDimension now returns the DimensionType instance for convienance.

You can still access others in DimensionType.getByName()
Fixed ForgeRegistry rappers not forwarding isEmpty.
This commit is contained in:
LexManos committed 2019-03-06 21:01:12 -08:00
1 parent 3003e33074
commit 47e6b34d2b
5 files changed
+23 -2

No files matched your search

@@ -190,6 +190,12 @@ public class ForgeRegistry<V extends IForgeRegistryEntry<V>> implements IForgeRe
return this.names.containsValue(value);
}
@Override
public boolean isEmpty()
{
return this.names.isEmpty();
}
@Override
public V getValue(ResourceLocation key)
{
@@ -44,6 +44,7 @@ public interface IForgeRegistry<V extends IForgeRegistryEntry<V>> extends Iterab
boolean containsKey(ResourceLocation key);
boolean containsValue(V value);
boolean isEmpty();
@Nullable V getValue(ResourceLocation key);
@Nullable ResourceLocation getKey(V value);
@@ -133,6 +133,12 @@ class NamespacedDefaultedWrapper<V extends IForgeRegistryEntry<V>> extends Regis
return this.delegate.getDefaultKey();
}
@Override
public boolean isEmpty()
{
return this.delegate.isEmpty();
}
//internal
@Override
public void lock(){ this.locked = true; }
@@ -121,6 +121,12 @@ class NamespacedWrapper<V extends IForgeRegistryEntry<V>> extends RegistryNamesp
return values.stream().skip(random.nextInt(values.size())).findFirst().orElse(null);
}
@Override
public boolean isEmpty()
{
return this.delegate.isEmpty();
}
//internal
@Override
public void lock(){ this.locked = true; }