mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 03:25:18 +00:00
Regenerate patches with relative headers. This should lower conflicts in future PRs.
Convert Forge to use Official mappings. Mojang released their obfuscation mappings but we have not used them up until now due to wanting to get their license to be more explicitly permissive. It is clear that their intent is to allow us to use their names for developing mods like this. See the full wording, and our interpretation here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
This commit is contained in:
1 parent
802298d99d
commit
a95b968c13
832 files changed
+4464
-4373
No files matched your search
@@ -52,14 +52,14 @@ class NamespacedDefaultedWrapper<T extends IForgeRegistryEntry<T>> extends Defau
|
||||
}
|
||||
|
||||
@Override
|
||||
public <V extends T> V register(int id, RegistryKey<T> key, V value, Lifecycle lifecycle)
|
||||
public <V extends T> V registerMapping(int id, RegistryKey<T> key, V value, Lifecycle lifecycle)
|
||||
{
|
||||
if (locked)
|
||||
throw new IllegalStateException("Can not register to a locked registry. Modder should use Forge Register methods.");
|
||||
Validate.notNull(value);
|
||||
|
||||
if (value.getRegistryName() == null)
|
||||
value.setRegistryName(key.getLocation());
|
||||
value.setRegistryName(key.location());
|
||||
|
||||
int realId = this.delegate.add(id, value);
|
||||
if (realId != id && id != -1)
|
||||
@@ -71,15 +71,15 @@ class NamespacedDefaultedWrapper<T extends IForgeRegistryEntry<T>> extends Defau
|
||||
@Override
|
||||
public <V extends T> V register(RegistryKey<T> key, V value, Lifecycle lifecycle)
|
||||
{
|
||||
return register(-1, key, value, lifecycle);
|
||||
return registerMapping(-1, key, value, lifecycle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <V extends T> V validateAndRegister(OptionalInt id, RegistryKey<T> key, V value, Lifecycle lifecycle) {
|
||||
public <V extends T> V registerOrOverride(OptionalInt id, RegistryKey<T> key, V value, Lifecycle lifecycle) {
|
||||
int wanted = -1;
|
||||
if (id.isPresent() && getByValue(id.getAsInt()) != null)
|
||||
if (id.isPresent() && byId(id.getAsInt()) != null)
|
||||
wanted = id.getAsInt();
|
||||
return register(wanted, key, value, lifecycle);
|
||||
return registerMapping(wanted, key, value, lifecycle);
|
||||
}
|
||||
|
||||
// Reading Functions
|
||||
@@ -91,16 +91,16 @@ class NamespacedDefaultedWrapper<T extends IForgeRegistryEntry<T>> extends Defau
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public T getOrDefault(@Nullable ResourceLocation name)
|
||||
public T get(@Nullable ResourceLocation name)
|
||||
{
|
||||
return this.delegate.getValue(name); //getOrDefault
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public T getValueForKey(@Nullable RegistryKey<T> name)
|
||||
public T get(@Nullable RegistryKey<T> name)
|
||||
{
|
||||
return name == null ? null : this.delegate.getRaw(name.getLocation()); //get without default
|
||||
return name == null ? null : this.delegate.getRaw(name.location()); //get without default
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -124,7 +124,7 @@ class NamespacedDefaultedWrapper<T extends IForgeRegistryEntry<T>> extends Defau
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public T getByValue(int id)
|
||||
public T byId(int id)
|
||||
{
|
||||
return this.delegate.getValue(id);
|
||||
}
|
||||
@@ -142,7 +142,7 @@ class NamespacedDefaultedWrapper<T extends IForgeRegistryEntry<T>> extends Defau
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Map.Entry<RegistryKey<T>, T>> getEntries()
|
||||
public Set<Map.Entry<RegistryKey<T>, T>> entrySet()
|
||||
{
|
||||
return this.delegate.getEntries();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user