mirror of
https://github.com/FabricMC/fabric.git
synced 2025-07-28 15:09:35 -04:00
Fix crash when replacing SimpleRegistry contents (#2504)
* Fix crash when replacing SimpleRegistry contents
* Called .value() two more times
(cherry picked from commit 726b65209a
)
This commit is contained in:
parent
5d58937841
commit
bb2e04773e
1 changed files with 2 additions and 2 deletions
|
@ -153,8 +153,8 @@ public abstract class MixinIdRegistry<T> extends Registry<T> implements Remappab
|
|||
} else {
|
||||
RegistryEntry.Reference<T> oldObject = idToEntry.get(registryId.getValue());
|
||||
|
||||
if (oldObject != null && oldObject != object) {
|
||||
int oldId = entryToRawId.getInt(oldObject);
|
||||
if (oldObject != null && oldObject.value() != null && oldObject.value() != object) {
|
||||
int oldId = entryToRawId.getInt(oldObject.value());
|
||||
|
||||
if (oldId != id && checkDuplicateKeys) {
|
||||
throw new RuntimeException("Attempted to register ID " + registryId + " at different raw IDs (" + oldId + ", " + id + ")! If you're trying to override an item, use .set(), not .register()!");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue