mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 11:59:25 +00:00
Update forge mappings to 20201028-1.16.3 (#7435)
This commit is contained in:
1 parent
6e0e67b14d
commit
53eedb0f10
93 files changed
+598
-588
No files matched your search
@@ -155,7 +155,7 @@ public class ForgeRegistries
|
||||
|
||||
private static <T> RegistryKey<Registry<T>> key(String name)
|
||||
{
|
||||
return RegistryKey.func_240904_a_(new ResourceLocation(name));
|
||||
return RegistryKey.getOrCreateRootKey(new ResourceLocation(name));
|
||||
}
|
||||
private static void init() {}
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ public class ForgeRegistry<V extends IForgeRegistryEntry<V>> implements IForgeRe
|
||||
ForgeRegistry(RegistryManager stage, ResourceLocation name, RegistryBuilder<V> builder)
|
||||
{
|
||||
this.name = name;
|
||||
this.key = RegistryKey.func_240904_a_(name);
|
||||
this.key = RegistryKey.getOrCreateRootKey(name);
|
||||
this.builder = builder;
|
||||
this.stage = stage;
|
||||
this.superType = builder.getType();
|
||||
@@ -373,7 +373,7 @@ public class ForgeRegistry<V extends IForgeRegistryEntry<V>> implements IForgeRe
|
||||
}
|
||||
|
||||
this.names.put(key, value);
|
||||
this.keys.put(RegistryKey.func_240903_a_(this.key, key), value);
|
||||
this.keys.put(RegistryKey.getOrCreateKey(this.key, key), value);
|
||||
this.ids.put(idToUse, value);
|
||||
this.availabilityMap.set(idToUse);
|
||||
this.owners.put(new OverrideOwner(owner == null ? key.getPath() : owner, key), value);
|
||||
|
||||
@@ -186,15 +186,15 @@ public class GameData
|
||||
|
||||
private static <T extends IForgeRegistryEntry<T>> RegistryBuilder<T> makeRegistry(RegistryKey<? extends Registry<T>> key, Class<T> type)
|
||||
{
|
||||
return new RegistryBuilder<T>().setName(key.func_240901_a_()).setType(type).setMaxID(MAX_VARINT).addCallback(new NamespacedWrapper.Factory<T>());
|
||||
return new RegistryBuilder<T>().setName(key.getLocation()).setType(type).setMaxID(MAX_VARINT).addCallback(new NamespacedWrapper.Factory<T>());
|
||||
}
|
||||
private static <T extends IForgeRegistryEntry<T>> RegistryBuilder<T> makeRegistry(RegistryKey<? extends Registry<T>> key, Class<T> type, int min, int max)
|
||||
{
|
||||
return new RegistryBuilder<T>().setName(key.func_240901_a_()).setType(type).setIDRange(min, max).hasWrapper();
|
||||
return new RegistryBuilder<T>().setName(key.getLocation()).setType(type).setIDRange(min, max).hasWrapper();
|
||||
}
|
||||
private static <T extends IForgeRegistryEntry<T>> RegistryBuilder<T> makeRegistry(RegistryKey<? extends Registry<T>> key, Class<T> type, String _default)
|
||||
{
|
||||
return new RegistryBuilder<T>().setName(key.func_240901_a_()).setType(type).setMaxID(MAX_VARINT).hasWrapper().setDefaultKey(new ResourceLocation(_default));
|
||||
return new RegistryBuilder<T>().setName(key.getLocation()).setType(type).setMaxID(MAX_VARINT).hasWrapper().setDefaultKey(new ResourceLocation(_default));
|
||||
}
|
||||
|
||||
public static <T extends IForgeRegistryEntry<T>> SimpleRegistry<T> getWrapper(RegistryKey<? extends Registry<T>> key, Lifecycle lifecycle)
|
||||
@@ -318,7 +318,7 @@ public class GameData
|
||||
RegistryManager.ACTIVE.registries.forEach((name, reg) -> reg.bake());
|
||||
// the id mapping has reverted, fire remap events for those that care about id changes
|
||||
if (fireEvents) {
|
||||
fireRemapEvent(ImmutableMap.of(), true);
|
||||
fireRemapEvent(ImmutableMap.of(), true);
|
||||
ObjectHolderRegistry.applyObjectHolders();
|
||||
}
|
||||
|
||||
@@ -341,11 +341,11 @@ public class GameData
|
||||
keys.sort((o1, o2) -> String.valueOf(o1).compareToIgnoreCase(String.valueOf(o2)));
|
||||
|
||||
//Move Blocks to first, and Items to second.
|
||||
keys.remove(BLOCKS.func_240901_a_());
|
||||
keys.remove(ITEMS.func_240901_a_());
|
||||
keys.remove(BLOCKS.getLocation());
|
||||
keys.remove(ITEMS.getLocation());
|
||||
|
||||
keys.add(0, BLOCKS.func_240901_a_());
|
||||
keys.add(1, ITEMS.func_240901_a_());
|
||||
keys.add(0, BLOCKS.getLocation());
|
||||
keys.add(1, ITEMS.getLocation());
|
||||
|
||||
final Function<ResourceLocation, ? extends RegistryEvent.Register<?>> registerEventGenerator = rl -> RegistryManager.ACTIVE.getRegistry(rl).getRegisterEvent(rl);
|
||||
return keys.stream().map(rl -> ModLoadingStage.EventGenerator.fromFunction(mc -> registerEventGenerator.apply(rl)));
|
||||
@@ -392,7 +392,7 @@ public class GameData
|
||||
{
|
||||
LOGGER.debug(REGISTRIES, "Registering custom tag type for: {}", registryName);
|
||||
customTagTypes.add(registryName);
|
||||
TagRegistryManager.func_242196_a(registryName, tagCollectionSupplier -> tagCollectionSupplier.getCustomTypeCollection(registryName));
|
||||
TagRegistryManager.create(registryName, tagCollectionSupplier -> tagCollectionSupplier.getCustomTypeCollection(registryName));
|
||||
}
|
||||
}
|
||||
ForgeTagHandler.setCustomTagTypes(customTagTypes);
|
||||
@@ -565,7 +565,7 @@ public class GameData
|
||||
public void onValidate(IForgeRegistryInternal<Attribute> owner, RegistryManager stage, int id, ResourceLocation key, Attribute obj)
|
||||
{
|
||||
// some stuff hard patched in can cause this to derp if it's JUST vanilla, so skip
|
||||
if (stage!=RegistryManager.VANILLA) GlobalEntityTypeAttributes.func_233834_a_();
|
||||
if (stage!=RegistryManager.VANILLA) GlobalEntityTypeAttributes.validateEntityAttributes();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ class NamespacedDefaultedWrapper<T extends IForgeRegistryEntry<T>> extends Defau
|
||||
Validate.notNull(value);
|
||||
|
||||
if (value.getRegistryName() == null)
|
||||
value.setRegistryName(key.func_240901_a_());
|
||||
value.setRegistryName(key.getLocation());
|
||||
|
||||
int realId = this.delegate.add(id, value);
|
||||
if (realId != id && id != -1)
|
||||
@@ -75,7 +75,7 @@ class NamespacedDefaultedWrapper<T extends IForgeRegistryEntry<T>> extends Defau
|
||||
}
|
||||
|
||||
@Override
|
||||
public <V extends T> V func_241874_a(OptionalInt id, RegistryKey<T> key, V value, Lifecycle lifecycle) {
|
||||
public <V extends T> V validateAndRegister(OptionalInt id, RegistryKey<T> key, V value, Lifecycle lifecycle) {
|
||||
int wanted = -1;
|
||||
if (id.isPresent() && getByValue(id.getAsInt()) != null)
|
||||
wanted = id.getAsInt();
|
||||
@@ -84,7 +84,7 @@ class NamespacedDefaultedWrapper<T extends IForgeRegistryEntry<T>> extends Defau
|
||||
|
||||
// Reading Functions
|
||||
@Override
|
||||
public Optional<T> func_241873_b(@Nullable ResourceLocation name)
|
||||
public Optional<T> getOptional(@Nullable ResourceLocation name)
|
||||
{
|
||||
return Optional.ofNullable( this.delegate.getRaw(name)); //get without default
|
||||
}
|
||||
@@ -98,9 +98,9 @@ class NamespacedDefaultedWrapper<T extends IForgeRegistryEntry<T>> extends Defau
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public T func_230516_a_(@Nullable RegistryKey<T> name)
|
||||
public T getValueForKey(@Nullable RegistryKey<T> name)
|
||||
{
|
||||
return name == null ? null : this.delegate.getRaw(name.func_240901_a_()); //get without default
|
||||
return name == null ? null : this.delegate.getRaw(name.getLocation()); //get without default
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -142,7 +142,7 @@ class NamespacedDefaultedWrapper<T extends IForgeRegistryEntry<T>> extends Defau
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Map.Entry<RegistryKey<T>, T>> func_239659_c_()
|
||||
public Set<Map.Entry<RegistryKey<T>, T>> getEntries()
|
||||
{
|
||||
return this.delegate.getEntries();
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ class NamespacedWrapper<T extends IForgeRegistryEntry<T>> extends SimpleRegistry
|
||||
Validate.notNull(value);
|
||||
|
||||
if (value.getRegistryName() == null)
|
||||
value.setRegistryName(key.func_240901_a_());
|
||||
value.setRegistryName(key.getLocation());
|
||||
|
||||
int realId = this.delegate.add(id, value);
|
||||
if (realId != id && id != -1)
|
||||
@@ -73,7 +73,7 @@ class NamespacedWrapper<T extends IForgeRegistryEntry<T>> extends SimpleRegistry
|
||||
}
|
||||
|
||||
@Override
|
||||
public <V extends T> V func_241874_a(OptionalInt id, RegistryKey<T> key, V value, Lifecycle lifecycle) {
|
||||
public <V extends T> V validateAndRegister(OptionalInt id, RegistryKey<T> key, V value, Lifecycle lifecycle) {
|
||||
int wanted = -1;
|
||||
if (id.isPresent() && getByValue(id.getAsInt()) != null)
|
||||
wanted = id.getAsInt();
|
||||
@@ -89,16 +89,16 @@ class NamespacedWrapper<T extends IForgeRegistryEntry<T>> extends SimpleRegistry
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<T> func_241873_b(@Nullable ResourceLocation name)
|
||||
public Optional<T> getOptional(@Nullable ResourceLocation name)
|
||||
{
|
||||
return Optional.ofNullable( this.delegate.getRaw(name)); //get without default
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public T func_230516_a_(@Nullable RegistryKey<T> name)
|
||||
public T getValueForKey(@Nullable RegistryKey<T> name)
|
||||
{
|
||||
return name == null ? null : this.delegate.getRaw(name.func_240901_a_()); //get without default
|
||||
return name == null ? null : this.delegate.getRaw(name.getLocation()); //get without default
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -140,7 +140,7 @@ class NamespacedWrapper<T extends IForgeRegistryEntry<T>> extends SimpleRegistry
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Map.Entry<RegistryKey<T>, T>> func_239659_c_()
|
||||
public Set<Map.Entry<RegistryKey<T>, T>> getEntries()
|
||||
{
|
||||
return this.delegate.getEntries();
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public class RegistryManager
|
||||
|
||||
public <V extends IForgeRegistryEntry<V>> ForgeRegistry<V> getRegistry(RegistryKey<? extends Registry<V>> key)
|
||||
{
|
||||
return getRegistry(key.func_240901_a_());
|
||||
return getRegistry(key.getLocation());
|
||||
}
|
||||
|
||||
public <V extends IForgeRegistryEntry<V>> IForgeRegistry<V> getRegistry(Class<? super V> cls)
|
||||
|
||||
Reference in new issue
Block a user