use of org.spongepowered.common.interfaces.potion.IMixinPotion in project SpongeCommon by SpongePowered.
the class MixinPotion method onPotionRegister.
@SuppressWarnings({ "unchecked", "rawtypes" })
@Redirect(method = "registerPotions", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/registry/RegistryNamespaced;register(ILjava/lang/Object;Ljava/lang/Object;)V"))
private static void onPotionRegister(RegistryNamespaced registry, int id, Object location, Object potion) {
final ResourceLocation resource = (ResourceLocation) location;
final Potion mcPotion = (Potion) potion;
((IMixinPotion) mcPotion).setId(resource.toString().toLowerCase(Locale.ENGLISH));
PotionEffectTypeRegistryModule.getInstance().registerFromGameData(resource.toString(), (PotionEffectType) mcPotion);
registry.register(id, location, potion);
}
Aggregations