mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 19:39:22 +00:00
Add forge registries for most vanilla registries
Made all registry names consistent with their vanilla counterparts Also added a system for legacy registry names, so no data will be lost Cleaned up formatting in GameData and ForgeRegistries
This commit is contained in:
1 parent
40f2276e88
commit
3385e62aa7
29 files changed
+523
-54
No files matched your search
@@ -19,7 +19,9 @@
|
||||
|
||||
package net.minecraftforge.registries;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
@@ -48,6 +50,7 @@ public class RegistryBuilder<T extends IForgeRegistryEntry<T>>
|
||||
private boolean allowModifications = false;
|
||||
private DummyFactory<T> dummyFactory;
|
||||
private MissingFactory<T> missingFactory;
|
||||
private Set<ResourceLocation> legacyNames = new HashSet<>();
|
||||
|
||||
public RegistryBuilder<T> setName(ResourceLocation name)
|
||||
{
|
||||
@@ -164,6 +167,17 @@ public class RegistryBuilder<T extends IForgeRegistryEntry<T>>
|
||||
this.allowModifications = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RegistryBuilder<T> legacyName(String name)
|
||||
{
|
||||
return legacyName(new ResourceLocation(name));
|
||||
}
|
||||
|
||||
public RegistryBuilder<T> legacyName(ResourceLocation name)
|
||||
{
|
||||
this.legacyNames.add(name);
|
||||
return this;
|
||||
}
|
||||
|
||||
public IForgeRegistry<T> create()
|
||||
{
|
||||
@@ -297,4 +311,9 @@ public class RegistryBuilder<T extends IForgeRegistryEntry<T>>
|
||||
{
|
||||
return sync;
|
||||
}
|
||||
|
||||
public Set<ResourceLocation> getLegacyNames()
|
||||
{
|
||||
return legacyNames;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user