mirror of
https://github.com/FabricMC/fabric.git
synced 2024-11-24 08:38:17 -05:00
Throw the exception when a duplicate registry entry is found. (#3991)
* Actually throw the exception when a duplicate registry entry is found. * Improve mixin
This commit is contained in:
parent
176f90366d
commit
66911b8fa5
1 changed files with 7 additions and 0 deletions
|
@ -25,6 +25,7 @@ import java.util.Set;
|
|||
|
||||
import com.google.common.collect.BiMap;
|
||||
import com.google.common.collect.HashBiMap;
|
||||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||
import com.mojang.serialization.Lifecycle;
|
||||
import it.unimi.dsi.fastutil.ints.Int2IntMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
|
||||
|
@ -379,4 +380,10 @@ public abstract class SimpleRegistryMixin<T> implements MutableRegistry<T>, Rema
|
|||
fabric_prevEntries = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Actually throw the exception when a duplicate is found.
|
||||
@ModifyExpressionValue(method = "add", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Util;throwOrPause(Ljava/lang/Throwable;)Ljava/lang/Throwable;"))
|
||||
private <E extends Throwable> E throwOnDuplicate(E t) throws E {
|
||||
throw t;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue