mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 19:15:32 +00:00
Update to 1.18.2
Co-authored-by: sciwhiz12 <[email protected]> Co-authored-by: Marc Hermans <[email protected]> Co-authored-by: LexManos <[email protected]> Co-authored-by: Curle <[email protected]> Signed-off-by: SizableShrimp <[email protected]>
This commit is contained in:
1 parent
34291c1fb2
commit
425eff39ff
234 files changed
+2175
-3226
No files matched your search
@@ -8,9 +8,11 @@ package net.minecraftforge.registries;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraftforge.registries.IForgeRegistry.*;
|
||||
|
||||
@@ -30,6 +32,7 @@ public class RegistryBuilder<T extends IForgeRegistryEntry<T>>
|
||||
private List<CreateCallback<T>> createCallback = Lists.newArrayList();
|
||||
private List<ValidateCallback<T>> validateCallback = Lists.newArrayList();
|
||||
private List<BakeCallback<T>> bakeCallback = Lists.newArrayList();
|
||||
private Function<T, Holder.Reference<T>> vanillaHolder;
|
||||
private boolean saveToDisc = true;
|
||||
private boolean sync = true;
|
||||
private boolean allowOverrides = true;
|
||||
@@ -218,6 +221,12 @@ public class RegistryBuilder<T extends IForgeRegistryEntry<T>>
|
||||
return this;
|
||||
}
|
||||
|
||||
RegistryBuilder<T> vanillaHolder(Function<T, Holder.Reference<T>> func)
|
||||
{
|
||||
this.vanillaHolder = func;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IForgeRegistry<T> create()
|
||||
{
|
||||
if (hasWrapper)
|
||||
@@ -368,4 +377,9 @@ public class RegistryBuilder<T extends IForgeRegistryEntry<T>>
|
||||
{
|
||||
return legacyNames;
|
||||
}
|
||||
|
||||
Function<T, Holder.Reference<T>> getVanillaHolder()
|
||||
{
|
||||
return this.vanillaHolder;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user