mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-27 15:33:18 +00:00
1.18.x Omnibus (#8239)
This commit is contained in:
1 parent
4011c3fb07
commit
34291c1fb2
89 files changed
+1014
-1192
No files matched your search
@@ -45,11 +45,11 @@ import net.minecraftforge.common.world.ForgeWorldPreset;
|
||||
/**
|
||||
* A class that exposes static references to all vanilla and Forge registries.
|
||||
* Created to have a central place to access the registries directly if modders need.
|
||||
* It is still advised that if you are registering things to go through {@link GameRegistry} register methods, but queries and iterations can use this.
|
||||
* It is still advised that if you are registering things to use {@link net.minecraftforge.event.RegistryEvent.Register} or {@link net.minecraftforge.registries.DeferredRegister}, but queries and iterations can use this.
|
||||
*/
|
||||
public class ForgeRegistries
|
||||
{
|
||||
static { init(); } // This must be above the fields so we guarantee it's run before findRegistry is called. Yay static inializers
|
||||
static { init(); } // This must be above the fields so we guarantee it's run before getRegistry is called. Yay static inializers
|
||||
|
||||
// Game objects
|
||||
public static final IForgeRegistry<Block> BLOCKS = RegistryManager.ACTIVE.getRegistry(Block.class);
|
||||
|
||||
@@ -172,14 +172,14 @@ public class ForgeRegistry<V extends IForgeRegistryEntry<V>> implements IForgeRe
|
||||
return tagFolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Codec<V> getCodec()
|
||||
{
|
||||
return this.codec;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void registerAll(@SuppressWarnings("unchecked") V... values)
|
||||
public void registerAll(V... values)
|
||||
{
|
||||
for (V value : values)
|
||||
register(value);
|
||||
|
||||
@@ -322,7 +322,6 @@ public class GameData
|
||||
LOGGER.debug(REGISTRIES, "Reverting complete");
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes") //Eclipse compiler generics issue.
|
||||
public static Stream<IModStateTransition.EventGenerator<?>> generateRegistryEvents() {
|
||||
List<ResourceLocation> keys = Lists.newArrayList(RegistryManager.ACTIVE.registries.keySet());
|
||||
keys.sort((o1, o2) -> String.valueOf(o1).compareToIgnoreCase(String.valueOf(o2)));
|
||||
|
||||
@@ -28,7 +28,8 @@ public interface IForgeRegistry<V extends IForgeRegistryEntry<V>> extends Iterab
|
||||
|
||||
void register(V value);
|
||||
|
||||
void registerAll(@SuppressWarnings("unchecked") V... values);
|
||||
@SuppressWarnings("unchecked")
|
||||
void registerAll(V... values);
|
||||
|
||||
boolean containsKey(ResourceLocation key);
|
||||
boolean containsValue(V value);
|
||||
|
||||
Reference in new issue
Block a user