Добавление сделки к существующей профессии жителя

Версия Minecraft
1.12.2
API
Forge
Есть предмет, который показывает определённые характеристики игрока. Предмет работает как и задумано. Хотелось бы сделать, чтобы его нужно было не крафтить, а покупать у жителя, в данном случае у священника. Как сделать, чтобы священники в деревнях предлагали этот предмет в числе прочих своих товаров? Все что удалось нагуглить годно только чтобы испортить мод, сделав его вообще нерабочим - настолько всё обрывочно и запутано.
 
156
7
63
Мне в своё время очень помогла разобраться в похожем вопросе ссылка на этот репо: BluSunrize/ImmersiveEngineering

Не помню, в какой теме, и кто её оставлял, но передаю по эстафете, так сказать. Тут даже более продвинутый вариант, с созданием новых профессий и цепочек товаров, но понять механику поможет.
 
Новые профессии мне создавать пока не надо, но посмотрю. Хотя читать исходники больших модов иногда ненамного проще, чем инструкцию от двигателя инопланетного корабля. Авторы модов очень любят создавать свои обёртки для того что имеется в Forge (и я их понимаю!), даже если не выносят их в отдельную либу.
 
Фрагмент кода из Immersive Engineering:
VillagerRegistry.VillagerCareer career_engineer = new VillagerRegistry.VillagerCareer(PROF_ENGINEER, ImmersiveEngineering.MODID+".engineer");
        career_engineer.addTrade(1,
                new EmeraldForItemstack(new ItemStack(IEContent.itemMaterial, 1, 0), new EntityVillager.PriceInfo(8, 16)),
                new ItemstackForEmerald(new ItemStack(IEContent.blockWoodenDecoration, 1, 1), new EntityVillager.PriceInfo(-10, -6)),
                new ItemstackForEmerald(new ItemStack(IEContent.blockClothDevice, 1, 1), new EntityVillager.PriceInfo(-3, -1))
        );

Насколько я понял, чтобы ванильный священник продавал "измеритель души" (название предварительное), нужно сделать что-то вроде:
Предполагаемый код:
career_cleric.addTrade(1, new ItemStackForEmerald(new ItemStack(ItemsRegistry.SOULMETER, 1), new EntityVillager.PriceInfo(-10, 6));
Только откуда взять career_cleric? Это должен быть самый обычный священник из тех что бывают в ванильном майне.
Java:
EntityVillager.PriceInfo(-10, -6)
- это диапазон цен в изумрудах?
 
В общем, сделал так:
Java:
public class Trades implements EntityVillager.ITradeList
{
   @Override
   public void addMerchantRecipe(IMerchant merchant, MerchantRecipeList recipeList, Random random)
   {
      recipeList.add(new MerchantRecipe(new ItemStack(Items.EMERALD,9),new ItemStack(ItemsRegistry.SOULMETER,1)));
   }
}

и, в ComminProxy:
Java:
public void init(FMLInitializationEvent event)
    {
        VillagerRegistry.VillagerProfession cleric=ForgeRegistries.VILLAGER_PROFESSIONS.getValue(new ResourceLocation("minecraft:cleric"));
        cleric.getCareer(1).addTrade(1,new Trades());
    }

Но получаю краш NullPointerException.
Код написал на основе этого:
[1.12] Custom villager trades?

Что я делаю неправильно?
 
709
9
106
Что я делаю неправильно?
Эту часть:

Java:
VillagerRegistry.VillagerProfession cleric=ForgeRegistries.VILLAGER_PROFESSIONS.getValue(new ResourceLocation("minecraft:cleric"));
cleric.getCareer(1).addTrade(1,new Trades());
перенеси в preInit.

Пока больше ничего. Скинь сам краш, разве что.
 
Переложил в preInit() но всё равно крашит:

Код:
[18:06:43] [main/INFO] [GradleStart]: Extra: []
[18:06:43] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/Alchemist/.gradle/caches/minecraft/assets, --assetIndex, 1.12, --accessToken{REDACTED}, --version, 1.12.2, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
[18:06:43] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[18:06:43] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[18:06:43] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
[18:06:43] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
[18:06:43] [main/INFO] [FML]: Forge Mod Loader version 14.23.5.2847 for Minecraft 1.12.2 loading
[18:06:43] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_131, running on Windows 7:amd64:6.1, installed at D:\Mineralia\jre-8u131-win64
[18:06:43] [main/ERROR] [FML]: Apache Maven library folder was not in the format expected. Using default libraries directory.
[18:06:43] [main/ERROR] [FML]: Full: C:\Users\Alchemist\.gradle\caches\modules-2\files-2.1\org.apache.maven\maven-artifact\3.5.3\7dc72b6d6d8a6dced3d294ed54c2cc3515ade9f4\maven-artifact-3.5.3.jar
[18:06:43] [main/ERROR] [FML]: Trimmed: c:/users/alchemist/.gradle/caches/modules-2/files-2.1/org.apache.maven/maven-artifact/3.5.3/
[18:06:44] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[18:06:44] [main/INFO] [FML]: Detected deobfuscated environment, loading log configs for colored console logs.
2020-10-26 18:06:46,878 main WARN Disabling terminal, you're running in an unsupported environment.
[18:06:46] [main/INFO] [FML]: Ignoring missing certificate for coremod FMLCorePlugin (net.minecraftforge.fml.relauncher.FMLCorePlugin), we are in deobf and it's a forge core plugin
[18:06:46] [main/INFO] [FML]: Ignoring missing certificate for coremod FMLForgePlugin (net.minecraftforge.classloading.FMLForgePlugin), we are in deobf and it's a forge core plugin
[18:06:46] [main/INFO] [FML]: Searching C:\Users\Alchemist\Desktop\GodsAndDemons\run\.\mods for mods
[18:06:46] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
[18:06:46] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin
[18:06:46] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
[18:06:46] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[18:06:46] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[18:06:46] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[18:06:46] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[18:06:46] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[18:06:46] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[18:06:54] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[18:06:54] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[18:06:54] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[18:06:54] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[18:06:54] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
[18:06:54] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
[18:06:54] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
[18:06:56] [Client thread/INFO] [minecraft/Minecraft]: Setting user: Player988
[18:07:09] [Client thread/WARN] [minecraft/GameSettings]: Skipping bad option: lastServer:
[18:07:09] [Client thread/INFO] [minecraft/Minecraft]: LWJGL Version: 2.9.4
[18:07:13] [Client thread/INFO] [FML]: -- System Details --
Details:
    Minecraft Version: 1.12.2
    Operating System: Windows 7 (amd64) version 6.1
    Java Version: 1.8.0_131, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 946414480 bytes (902 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML:
    Loaded coremods (and transformers):
    GL info: ' Vendor: 'NVIDIA Corporation' Version: '3.3.0' Renderer: 'GeForce 8600 GTS/PCIe/SSE2'
[18:07:13] [Client thread/INFO] [FML]: MinecraftForge v14.23.5.2847 Initialized
[18:07:13] [Client thread/INFO] [FML]: Starts to replace vanilla recipe ingredients with ore ingredients.
[18:07:13] [Client thread/INFO] [FML]: Invalid recipe found with multiple oredict ingredients in the same ingredient...
[18:07:13] [Client thread/INFO] [FML]: Replaced 1227 ore ingredients
[18:07:14] [Client thread/INFO] [FML]: Searching C:\Users\Alchemist\Desktop\GodsAndDemons\run\.\mods for mods
[18:07:18] [Client thread/INFO] [FML]: Forge Mod Loader has identified 5 mods to load
[18:07:19] [Client thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, godsanddemons] at CLIENT
[18:07:19] [Client thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, godsanddemons] at SERVER
[18:07:21] [Client thread/INFO] [minecraft/SimpleReloadableResourceManager]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Gods And Demons
[18:07:23] [Client thread/INFO] [FML]: Processing ObjectHolder annotations
[18:07:23] [Client thread/INFO] [FML]: Found 1169 ObjectHolder annotations
[18:07:23] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations
[18:07:23] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations
[18:07:23] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0
[18:07:23] [Client thread/WARN] [minecraft/EntityDataManager]: defineId called for: class net.minecraft.entity.player.EntityPlayer from class com.madalchemist.godsanddemons.PropertiesRegistry
[18:07:23] [Client thread/WARN] [minecraft/EntityDataManager]: defineId called for: class net.minecraft.entity.player.EntityPlayer from class com.madalchemist.godsanddemons.PropertiesRegistry
[18:07:23] [Client thread/WARN] [minecraft/EntityDataManager]: defineId called for: class net.minecraft.entity.player.EntityPlayer from class com.madalchemist.godsanddemons.PropertiesRegistry
[18:07:23] [Client thread/WARN] [minecraft/EntityDataManager]: defineId called for: class net.minecraft.entity.player.EntityPlayer from class com.madalchemist.godsanddemons.PropertiesRegistry
[18:07:23] [Forge Version Check/INFO] [forge.VersionCheck]: [forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
[18:07:23] [Client thread/WARN] [minecraft/EntityDataManager]: defineId called for: class net.minecraft.entity.player.EntityPlayer from class com.madalchemist.godsanddemons.PropertiesRegistry
[18:07:24] [Forge Version Check/INFO] [forge.VersionCheck]: [forge] Found status: OUTDATED Target: 14.23.5.2854
[18:07:24] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:629]: ---- Minecraft Crash Report ----
// There are four lights!

Time: 10/26/20 6:07 PM
Description: There was a severe problem during mod loading that has caused the game to fail

net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Gods And Demons (godsanddemons)
Caused by: java.lang.NullPointerException
    at com.madalchemist.godsanddemons.CommonProxy.preInit(CommonProxy.java:22)
    at com.madalchemist.godsanddemons.ClientProxy.preInit(ClientProxy.java:12)
    at com.madalchemist.godsanddemons.GodsAndDemons.preInit(GodsAndDemons.java:19)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:639)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
    at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
    at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
    at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
    at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
    at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
    at com.google.common.eventbus.EventBus.post(EventBus.java:217)
    at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219)
    at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
    at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
    at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
    at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
    at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
    at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
    at com.google.common.eventbus.EventBus.post(EventBus.java:217)
    at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136)
    at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:629)
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252)
    at net.minecraft.client.Minecraft.init(Minecraft.java:514)
    at net.minecraft.client.Minecraft.run(Minecraft.java:422)
    at net.minecraft.client.main.Main.main(Main.java:118)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
    at GradleStart.main(GradleStart.java:25)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- System Details --
Details:
    Minecraft Version: 1.12.2
    Operating System: Windows 7 (amd64) version 6.1
    Java Version: 1.8.0_131, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 809397928 bytes (771 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: MCP 9.42 Powered by Forge 14.23.5.2847 5 mods loaded, 5 mods active
    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

    | State | ID            | Version                     | Source                           | Signature |
    |:----- |:------------- |:--------------------------- |:-------------------------------- |:--------- |
    | LCH   | minecraft     | 1.12.2                      | minecraft.jar                    | None      |
    | LCH   | mcp           | 9.42                        | minecraft.jar                    | None      |
    | LCH   | FML           | 8.0.99.99                   | forgeSrc-1.12.2-14.23.5.2847.jar | None      |
    | LCH   | forge         | 14.23.5.2847                | forgeSrc-1.12.2-14.23.5.2847.jar | None      |
    | LCE   | godsanddemons | 0.0001 super-early pre-test | bin                              | None      |

    Loaded coremods (and transformers):
    GL info: ' Vendor: 'NVIDIA Corporation' Version: '3.3.0' Renderer: 'GeForce 8600 GTS/PCIe/SSE2'
[18:07:24] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:629]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Alchemist\Desktop\GodsAndDemons\run\.\crash-reports\crash-2020-10-26_18.07.24-client.txt
Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
 
709
9
106
Замени:
Java:
VillagerRegistry.VillagerProfession cleric=ForgeRegistries.VILLAGER_PROFESSIONS.getValue(new ResourceLocation("minecraft:cleric"));
cleric.getCareer(1).addTrade(1,new Trades());

На:
Java:
VillagerProfession cleric = ForgeRegistries.VILLAGER_PROFESSIONS.getValue(new ResourceLocation("minecraft:cleric"));
VillagerCareer career = cleric.getCareer(1);
career.addTrade(1,new Trades());

Можешь ещё попробовать переместить эту регистрацию напрямую в Main (просто я эвентами регистрировал)
 
709
9
106
А вот на счёт эвентов можно поподробнее?
Я бы регистрировал так:

EventsHandler:
@SubscribeEvent
public void onRegisterVillagers(RegistryEvent.Register<VillagerProfession> event) {
  VillagerProfession cleric = ForgeRegistries.VILLAGER_PROFESSIONS.getValue(new ResourceLocation("minecraft:cleric"));
  VillagerCareer career = cleric.getCareer(1);
  career.addTrade(1, new Trades());
}

Или в init'e:

Main:
  ResourceLocation location = new ResourceLocation("minecraft", "cleric");
  VillagerRegistry.VillagerProfession profession = ForgeRegistries.VILLAGER_PROFESSIONS.getValue(location);
  if(!profession.getRegistryName().equals(location)) {
    Log.info("Could not find cleric profession!!!");
  } else {
    VillagerRegistry.VillagerCareer career = profession.getCareer(1);
    if(career.getName().equals("cleric")) {
      career.addTrade(4, new Trades());
      Log.info("Successfully registered");
    } else {
      Log.info("Could not find career");
    }
  }
 
В Main в смысле в главный класс мода? В preInit или куда? Код сейчас вот такой:

Trades.java:
package com.madalchemist.godsanddemons;

import java.util.Random;

import net.minecraft.entity.IMerchant;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.village.MerchantRecipe;
import net.minecraft.village.MerchantRecipeList;

public class Trades implements EntityVillager.ITradeList
{
   @Override
   public void addMerchantRecipe(IMerchant merchant, MerchantRecipeList recipeList, Random random)
   {
      recipeList.add(new MerchantRecipe(new ItemStack(Items.EMERALD,9),new ItemStack(ItemsRegistry.SOULMETER,1)));
   }
}

CommonProxy.java:
package com.madalchemist.godsanddemons;

import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import net.minecraftforge.fml.common.registry.VillagerRegistry;
import net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerCareer;
import net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession;

public class CommonProxy
{
    public void preInit(FMLPreInitializationEvent event)
    {
        MinecraftForge.EVENT_BUS.register(new EventsHandler());
        MinecraftForge.EVENT_BUS.register(new PropertiesRegistry());
        MinecraftForge.EVENT_BUS.register(new AttributeHandler());
        VillagerProfession cleric = ForgeRegistries.VILLAGER_PROFESSIONS.getValue(new ResourceLocation("minecraft:cleric"));
        VillagerCareer career = cleric.getCareer(1);
        career.addTrade(1,new Trades());
    }

    public void init(FMLInitializationEvent event)
    {

    }

    public void postInit(FMLPostInitializationEvent event) {

    }
}

Пробовал ту часть что в CommonProxy переставить в главный класс, но всё так же крашит, да и смысл? Там напрямую вызываются методы из CommonProxy а значит и этот код.
 
То, что в посте #13 крашит вот так (код просто скопипастил):
Код:
[19:42:35] [main/INFO] [GradleStart]: Extra: []
[19:42:35] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/Alchemist/.gradle/caches/minecraft/assets, --assetIndex, 1.12, --accessToken{REDACTED}, --version, 1.12.2, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
[19:42:36] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[19:42:36] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[19:42:36] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
[19:42:36] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
[19:42:36] [main/INFO] [FML]: Forge Mod Loader version 14.23.5.2847 for Minecraft 1.12.2 loading
[19:42:36] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_131, running on Windows 7:amd64:6.1, installed at D:\Mineralia\jre-8u131-win64
[19:42:36] [main/ERROR] [FML]: Apache Maven library folder was not in the format expected. Using default libraries directory.
[19:42:36] [main/ERROR] [FML]: Full: C:\Users\Alchemist\.gradle\caches\modules-2\files-2.1\org.apache.maven\maven-artifact\3.5.3\7dc72b6d6d8a6dced3d294ed54c2cc3515ade9f4\maven-artifact-3.5.3.jar
[19:42:36] [main/ERROR] [FML]: Trimmed: c:/users/alchemist/.gradle/caches/modules-2/files-2.1/org.apache.maven/maven-artifact/3.5.3/
[19:42:36] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[19:42:36] [main/INFO] [FML]: Detected deobfuscated environment, loading log configs for colored console logs.
2020-10-26 19:42:38,682 main WARN Disabling terminal, you're running in an unsupported environment.
[19:42:38] [main/INFO] [FML]: Ignoring missing certificate for coremod FMLCorePlugin (net.minecraftforge.fml.relauncher.FMLCorePlugin), we are in deobf and it's a forge core plugin
[19:42:38] [main/INFO] [FML]: Ignoring missing certificate for coremod FMLForgePlugin (net.minecraftforge.classloading.FMLForgePlugin), we are in deobf and it's a forge core plugin
[19:42:38] [main/INFO] [FML]: Searching C:\Users\Alchemist\Desktop\GodsAndDemons\run\.\mods for mods
[19:42:38] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
[19:42:38] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin
[19:42:38] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
[19:42:38] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[19:42:38] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[19:42:38] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[19:42:38] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[19:42:38] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[19:42:38] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[19:42:44] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[19:42:44] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[19:42:44] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[19:42:45] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[19:42:45] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
[19:42:45] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
[19:42:45] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
[19:42:46] [Client thread/INFO] [minecraft/Minecraft]: Setting user: Player0
[19:42:55] [Client thread/WARN] [minecraft/GameSettings]: Skipping bad option: lastServer:
[19:42:55] [Client thread/INFO] [minecraft/Minecraft]: LWJGL Version: 2.9.4
[19:42:57] [Client thread/INFO] [FML]: -- System Details --
Details:
    Minecraft Version: 1.12.2
    Operating System: Windows 7 (amd64) version 6.1
    Java Version: 1.8.0_131, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 880813912 bytes (840 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: 
    Loaded coremods (and transformers): 
    GL info: ' Vendor: 'NVIDIA Corporation' Version: '3.3.0' Renderer: 'GeForce 8600 GTS/PCIe/SSE2'
[19:42:58] [Client thread/INFO] [FML]: MinecraftForge v14.23.5.2847 Initialized
[19:42:58] [Client thread/INFO] [FML]: Starts to replace vanilla recipe ingredients with ore ingredients.
[19:42:58] [Client thread/INFO] [FML]: Invalid recipe found with multiple oredict ingredients in the same ingredient...
[19:42:58] [Client thread/INFO] [FML]: Replaced 1227 ore ingredients
[19:43:00] [Client thread/INFO] [FML]: Searching C:\Users\Alchemist\Desktop\GodsAndDemons\run\.\mods for mods
[19:43:03] [Client thread/INFO] [FML]: Forge Mod Loader has identified 5 mods to load
[19:43:04] [Client thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, godsanddemons] at CLIENT
[19:43:04] [Client thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, godsanddemons] at SERVER
[19:43:04] [Thread-3/INFO] [FML]: Using alternative sync timing : 200 frames of Display.update took 2687434120 nanos
[19:43:06] [Client thread/INFO] [minecraft/SimpleReloadableResourceManager]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Gods And Demons
[19:43:06] [Client thread/INFO] [FML]: Processing ObjectHolder annotations
[19:43:06] [Client thread/INFO] [FML]: Found 1169 ObjectHolder annotations
[19:43:06] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations
[19:43:06] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations
[19:43:06] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0
[19:43:06] [Client thread/WARN] [minecraft/EntityDataManager]: defineId called for: class net.minecraft.entity.player.EntityPlayer from class com.madalchemist.godsanddemons.PropertiesRegistry
[19:43:06] [Client thread/WARN] [minecraft/EntityDataManager]: defineId called for: class net.minecraft.entity.player.EntityPlayer from class com.madalchemist.godsanddemons.PropertiesRegistry
[19:43:06] [Client thread/WARN] [minecraft/EntityDataManager]: defineId called for: class net.minecraft.entity.player.EntityPlayer from class com.madalchemist.godsanddemons.PropertiesRegistry
[19:43:06] [Client thread/WARN] [minecraft/EntityDataManager]: defineId called for: class net.minecraft.entity.player.EntityPlayer from class com.madalchemist.godsanddemons.PropertiesRegistry
[19:43:06] [Client thread/WARN] [minecraft/EntityDataManager]: defineId called for: class net.minecraft.entity.player.EntityPlayer from class com.madalchemist.godsanddemons.PropertiesRegistry
[19:43:06] [Forge Version Check/INFO] [forge.VersionCheck]: [forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
[19:43:06] [Client thread/INFO] [FML]: Applying holder lookups
[19:43:06] [Client thread/INFO] [FML]: Holder lookups applied
[19:43:06] [Client thread/INFO] [FML]: Applying holder lookups
[19:43:06] [Client thread/INFO] [FML]: Holder lookups applied
[19:43:06] [Client thread/ERROR] [FML]: Exception caught during firing event net.minecraftforge.event.RegistryEvent$Register@1388c465:
java.lang.NullPointerException: null
    at com.madalchemist.godsanddemons.EventsHandler.onRegisterVillagers(EventsHandler.java:22) ~[EventsHandler.class:?]
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_20_EventsHandler_onRegisterVillagers_Register.invoke(.dynamic) ~[?:?]
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?]
    at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:144) ~[EventBus$1.class:?]
    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) [EventBus.class:?]
    at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:859) [GameData.class:?]
    at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:630) [Loader.class:?]
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252) [FMLClientHandler.class:?]
    at net.minecraft.client.Minecraft.init(Minecraft.java:514) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:422) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_131]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_131]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_131]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_131]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_131]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_131]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_131]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_131]
    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
    at GradleStart.main(GradleStart.java:25) [start/:?]
[19:43:06] [Client thread/ERROR] [FML]: Index: 3 Listeners:
[19:43:06] [Client thread/ERROR] [FML]: 0: NORMAL
[19:43:06] [Client thread/ERROR] [FML]: 1: net.minecraftforge.fml.common.eventhandler.EventBus$1@5b0af511
[19:43:06] [Client thread/ERROR] [FML]: 2: net.minecraftforge.fml.common.eventhandler.EventBus$1@fbd9b1f
[19:43:06] [Client thread/ERROR] [FML]: 3: net.minecraftforge.fml.common.eventhandler.EventBus$1@7f85482c
[19:43:07] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:629]: ---- Minecraft Crash Report ----
// Who set us up the TNT?

Time: 10/26/20 7:43 PM
Description: Initializing game

java.lang.NullPointerException: Initializing game
    at com.madalchemist.godsanddemons.EventsHandler.onRegisterVillagers(EventsHandler.java:22)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_20_EventsHandler_onRegisterVillagers_Register.invoke(.dynamic)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
    at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:144)
    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
    at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:859)
    at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:630)
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252)
    at net.minecraft.client.Minecraft.init(Minecraft.java:514)
    at net.minecraft.client.Minecraft.run(Minecraft.java:422)
    at net.minecraft.client.main.Main.main(Main.java:118)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
    at GradleStart.main(GradleStart.java:25)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Client thread
Stacktrace:
    at com.madalchemist.godsanddemons.EventsHandler.onRegisterVillagers(EventsHandler.java:22)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_20_EventsHandler_onRegisterVillagers_Register.invoke(.dynamic)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
    at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:144)
    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
    at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:859)
    at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:630)
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252)
    at net.minecraft.client.Minecraft.init(Minecraft.java:514)

-- Initialization --
Details:
Stacktrace:
    at net.minecraft.client.Minecraft.run(Minecraft.java:422)
    at net.minecraft.client.main.Main.main(Main.java:118)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
    at GradleStart.main(GradleStart.java:25)

-- System Details --
Details:
    Minecraft Version: 1.12.2
    Operating System: Windows 7 (amd64) version 6.1
    Java Version: 1.8.0_131, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 872379144 bytes (831 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: MCP 9.42 Powered by Forge 14.23.5.2847 5 mods loaded, 5 mods active
    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

    | State | ID            | Version                     | Source                           | Signature |
    |:----- |:------------- |:--------------------------- |:-------------------------------- |:--------- |
    | LCH   | minecraft     | 1.12.2                      | minecraft.jar                    | None      |
    | LCH   | mcp           | 9.42                        | minecraft.jar                    | None      |
    | LCH   | FML           | 8.0.99.99                   | forgeSrc-1.12.2-14.23.5.2847.jar | None      |
    | LCH   | forge         | 14.23.5.2847                | forgeSrc-1.12.2-14.23.5.2847.jar | None      |
    | LCH   | godsanddemons | 0.0001 super-early pre-test | bin                              | None      |

    Loaded coremods (and transformers): 
    GL info: ' Vendor: 'NVIDIA Corporation' Version: '3.3.0' Renderer: 'GeForce 8600 GTS/PCIe/SSE2'
    Launched Version: 1.12.2
    LWJGL: 2.9.4
    OpenGL: GeForce 8600 GTS/PCIe/SSE2 GL version 3.3.0, NVIDIA Corporation
    GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.

    Using VBOs: Yes
    Is Modded: Definitely; Client brand changed to 'fml,forge'
    Type: Client (map_client.txt)
    Resource Packs: 
    Current Language: English (US)
    Profiler Position: N/A (disabled)
    CPU: 2x AMD Athlon(tm) 64 X2 Dual Core Processor 5400+
[19:43:07] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:629]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Alchemist\Desktop\GodsAndDemons\run\.\crash-reports\crash-2020-10-26_19.43.07-client.txt
Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
 
709
9
106
Пробуй второе, можно будет найти где происходит ошибка.

CommonProxy.java:
public void init(FMLInitializationEvent event)
{
  ResourceLocation location = new ResourceLocation("minecraft", "cleric");
  VillagerRegistry.VillagerProfession profession = ForgeRegistries.VILLAGER_PROFESSIONS.getValue(location);
  if(!profession.getRegistryName().equals(location)) {
    Log.info("Could not find cleric profession!!!");
  } else {
    VillagerRegistry.VillagerCareer career = profession.getCareer(1);
    if(career.getName().equals("cleric")) {
      career.addTrade(4, new Trades());
      Log.info("Successfully registered");
    } else {
      Log.info("Could not find career");
    }
  }
}

крашит вот так
Это кстати, возможно значит, что ошибка где-то в классе Trades, точно не в их регистрации.
 
Последнее редактирование:
709
9
106
Вот это попробовал? Его надо в init твой запихнуть. Если попробуешь, скинь все логи потом, я посмотрю.

CommonProxy.java:
public void init(FMLInitializationEvent event)
{
  ResourceLocation location = new ResourceLocation("minecraft", "cleric");
  VillagerRegistry.VillagerProfession profession = ForgeRegistries.VILLAGER_PROFESSIONS.getValue(location);
  if(!profession.getRegistryName().equals(location)) {
    Log.info("Could not find cleric profession!!!");
  } else {
    VillagerRegistry.VillagerCareer career = profession.getCareer(1);
    if(career.getName().equals("cleric")) {
      career.addTrade(4, new Trades());
      Log.info("Successfully registered");
    } else {
      Log.info("Could not find career");
    }
  }
}
 
Да, засунул этот код в init в главный класс - и вот что выкинуло:
Код:
[21:45:36] [main/INFO] [GradleStart]: Extra: []
[21:45:36] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/Alchemist/.gradle/caches/minecraft/assets, --assetIndex, 1.12, --accessToken{REDACTED}, --version, 1.12.2, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
[21:45:36] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[21:45:36] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[21:45:36] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
[21:45:36] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
[21:45:36] [main/INFO] [FML]: Forge Mod Loader version 14.23.5.2847 for Minecraft 1.12.2 loading
[21:45:36] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_131, running on Windows 7:amd64:6.1, installed at D:\Mineralia\jre-8u131-win64
[21:45:36] [main/ERROR] [FML]: Apache Maven library folder was not in the format expected. Using default libraries directory.
[21:45:36] [main/ERROR] [FML]: Full: C:\Users\Alchemist\.gradle\caches\modules-2\files-2.1\org.apache.maven\maven-artifact\3.5.3\7dc72b6d6d8a6dced3d294ed54c2cc3515ade9f4\maven-artifact-3.5.3.jar
[21:45:36] [main/ERROR] [FML]: Trimmed: c:/users/alchemist/.gradle/caches/modules-2/files-2.1/org.apache.maven/maven-artifact/3.5.3/
[21:45:37] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[21:45:37] [main/INFO] [FML]: Detected deobfuscated environment, loading log configs for colored console logs.
2020-10-26 21:45:39,484 main WARN Disabling terminal, you're running in an unsupported environment.
[21:45:39] [main/INFO] [FML]: Ignoring missing certificate for coremod FMLCorePlugin (net.minecraftforge.fml.relauncher.FMLCorePlugin), we are in deobf and it's a forge core plugin
[21:45:39] [main/INFO] [FML]: Ignoring missing certificate for coremod FMLForgePlugin (net.minecraftforge.classloading.FMLForgePlugin), we are in deobf and it's a forge core plugin
[21:45:39] [main/INFO] [FML]: Searching C:\Users\Alchemist\Desktop\GodsAndDemons\run\.\mods for mods
[21:45:39] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
[21:45:39] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin
[21:45:39] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
[21:45:39] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[21:45:39] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[21:45:39] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[21:45:39] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[21:45:39] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[21:45:39] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[21:45:45] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[21:45:45] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[21:45:45] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[21:45:46] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[21:45:46] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
[21:45:46] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
[21:45:46] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
[21:45:48] [Client thread/INFO] [minecraft/Minecraft]: Setting user: Player438
[21:45:57] [Client thread/WARN] [minecraft/GameSettings]: Skipping bad option: lastServer:
[21:45:57] [Client thread/INFO] [minecraft/Minecraft]: LWJGL Version: 2.9.4
[21:45:59] [Client thread/INFO] [FML]: -- System Details --
Details:
    Minecraft Version: 1.12.2
    Operating System: Windows 7 (amd64) version 6.1
    Java Version: 1.8.0_131, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 909214200 bytes (867 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: 
    Loaded coremods (and transformers): 
    GL info: ' Vendor: 'NVIDIA Corporation' Version: '3.3.0' Renderer: 'GeForce 8600 GTS/PCIe/SSE2'
[21:45:59] [Client thread/INFO] [FML]: MinecraftForge v14.23.5.2847 Initialized
[21:46:00] [Client thread/INFO] [FML]: Starts to replace vanilla recipe ingredients with ore ingredients.
[21:46:00] [Client thread/INFO] [FML]: Invalid recipe found with multiple oredict ingredients in the same ingredient...
[21:46:00] [Client thread/INFO] [FML]: Replaced 1227 ore ingredients
[21:46:03] [Client thread/INFO] [FML]: Searching C:\Users\Alchemist\Desktop\GodsAndDemons\run\.\mods for mods
[21:46:07] [Client thread/INFO] [FML]: Forge Mod Loader has identified 5 mods to load
[21:46:08] [Client thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, godsanddemons] at CLIENT
[21:46:08] [Client thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, godsanddemons] at SERVER
[21:46:09] [Thread-3/INFO] [FML]: Using alternative sync timing : 200 frames of Display.update took 1543023000 nanos
[21:46:10] [Client thread/INFO] [minecraft/SimpleReloadableResourceManager]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Gods And Demons
[21:46:10] [Client thread/INFO] [FML]: Processing ObjectHolder annotations
[21:46:10] [Client thread/INFO] [FML]: Found 1169 ObjectHolder annotations
[21:46:10] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations
[21:46:10] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations
[21:46:10] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0
[21:46:11] [Client thread/WARN] [minecraft/EntityDataManager]: defineId called for: class net.minecraft.entity.player.EntityPlayer from class com.madalchemist.godsanddemons.PropertiesRegistry
[21:46:11] [Client thread/WARN] [minecraft/EntityDataManager]: defineId called for: class net.minecraft.entity.player.EntityPlayer from class com.madalchemist.godsanddemons.PropertiesRegistry
[21:46:11] [Client thread/WARN] [minecraft/EntityDataManager]: defineId called for: class net.minecraft.entity.player.EntityPlayer from class com.madalchemist.godsanddemons.PropertiesRegistry
[21:46:11] [Client thread/WARN] [minecraft/EntityDataManager]: defineId called for: class net.minecraft.entity.player.EntityPlayer from class com.madalchemist.godsanddemons.PropertiesRegistry
[21:46:11] [Client thread/WARN] [minecraft/EntityDataManager]: defineId called for: class net.minecraft.entity.player.EntityPlayer from class com.madalchemist.godsanddemons.PropertiesRegistry
[21:46:11] [Forge Version Check/INFO] [forge.VersionCheck]: [forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
[21:46:11] [Client thread/INFO] [FML]: Applying holder lookups
[21:46:11] [Client thread/INFO] [FML]: Holder lookups applied
[21:46:11] [Client thread/INFO] [FML]: Applying holder lookups
[21:46:11] [Client thread/INFO] [FML]: Holder lookups applied
[21:46:11] [Client thread/ERROR] [FML]: Exception caught during firing event net.minecraftforge.event.RegistryEvent$Register@6ef7e510:
java.lang.NullPointerException: null
    at com.madalchemist.godsanddemons.EventsHandler.onRegisterVillagers(EventsHandler.java:22) ~[EventsHandler.class:?]
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_20_EventsHandler_onRegisterVillagers_Register.invoke(.dynamic) ~[?:?]
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?]
    at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:144) ~[EventBus$1.class:?]
    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) [EventBus.class:?]
    at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:859) [GameData.class:?]
    at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:630) [Loader.class:?]
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252) [FMLClientHandler.class:?]
    at net.minecraft.client.Minecraft.init(Minecraft.java:514) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:422) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_131]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_131]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_131]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_131]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_131]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_131]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_131]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_131]
    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
    at GradleStart.main(GradleStart.java:25) [start/:?]
[21:46:11] [Client thread/ERROR] [FML]: Index: 3 Listeners:
[21:46:11] [Client thread/ERROR] [FML]: 0: NORMAL
[21:46:11] [Client thread/ERROR] [FML]: 1: net.minecraftforge.fml.common.eventhandler.EventBus$1@56e0e953
[21:46:11] [Client thread/ERROR] [FML]: 2: net.minecraftforge.fml.common.eventhandler.EventBus$1@5ace2ce3
[21:46:11] [Client thread/ERROR] [FML]: 3: net.minecraftforge.fml.common.eventhandler.EventBus$1@39c821c6
[21:46:11] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:629]: ---- Minecraft Crash Report ----
// Don't be sad, have a hug! <3

Time: 10/26/20 9:46 PM
Description: Initializing game

java.lang.NullPointerException: Initializing game
    at com.madalchemist.godsanddemons.EventsHandler.onRegisterVillagers(EventsHandler.java:22)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_20_EventsHandler_onRegisterVillagers_Register.invoke(.dynamic)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
    at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:144)
    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
    at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:859)
    at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:630)
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252)
    at net.minecraft.client.Minecraft.init(Minecraft.java:514)
    at net.minecraft.client.Minecraft.run(Minecraft.java:422)
    at net.minecraft.client.main.Main.main(Main.java:118)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
    at GradleStart.main(GradleStart.java:25)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Client thread
Stacktrace:
    at com.madalchemist.godsanddemons.EventsHandler.onRegisterVillagers(EventsHandler.java:22)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_20_EventsHandler_onRegisterVillagers_Register.invoke(.dynamic)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
    at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:144)
    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
    at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:859)
    at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:630)
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252)
    at net.minecraft.client.Minecraft.init(Minecraft.java:514)

-- Initialization --
Details:
Stacktrace:
    at net.minecraft.client.Minecraft.run(Minecraft.java:422)
    at net.minecraft.client.main.Main.main(Main.java:118)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
    at GradleStart.main(GradleStart.java:25)

-- System Details --
Details:
    Minecraft Version: 1.12.2
    Operating System: Windows 7 (amd64) version 6.1
    Java Version: 1.8.0_131, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 922925696 bytes (880 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: MCP 9.42 Powered by Forge 14.23.5.2847 5 mods loaded, 5 mods active
    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

    | State | ID            | Version                     | Source                           | Signature |
    |:----- |:------------- |:--------------------------- |:-------------------------------- |:--------- |
    | LCH   | minecraft     | 1.12.2                      | minecraft.jar                    | None      |
    | LCH   | mcp           | 9.42                        | minecraft.jar                    | None      |
    | LCH   | FML           | 8.0.99.99                   | forgeSrc-1.12.2-14.23.5.2847.jar | None      |
    | LCH   | forge         | 14.23.5.2847                | forgeSrc-1.12.2-14.23.5.2847.jar | None      |
    | LCH   | godsanddemons | 0.0001 super-early pre-test | bin                              | None      |

    Loaded coremods (and transformers): 
    GL info: ' Vendor: 'NVIDIA Corporation' Version: '3.3.0' Renderer: 'GeForce 8600 GTS/PCIe/SSE2'
    Launched Version: 1.12.2
    LWJGL: 2.9.4
    OpenGL: GeForce 8600 GTS/PCIe/SSE2 GL version 3.3.0, NVIDIA Corporation
    GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.

    Using VBOs: Yes
    Is Modded: Definitely; Client brand changed to 'fml,forge'
    Type: Client (map_client.txt)
    Resource Packs: 
    Current Language: English (US)
    Profiler Position: N/A (disabled)
    CPU: 2x AMD Athlon(tm) 64 X2 Dual Core Processor 5400+
[21:46:11] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:629]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Alchemist\Desktop\GodsAndDemons\run\.\crash-reports\crash-2020-10-26_21.46.11-client.txt
Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
 
709
9
106
Верни всё как было в твоём ответе #7...

Потом просто замени своё
Java:
public void init(FMLInitializationEvent event)
{
    VillagerRegistry.VillagerProfession cleric=ForgeRegistries.VILLAGER_PROFESSIONS.getValue(new ResourceLocation("minecraft:cleric"));
    cleric.getCareer(1).addTrade(1,new Trades());
}

на это:
Java:
public void init(FMLInitializationEvent event)
{
  VillagerRegistry.VillagerProfession profession = ForgeRegistries.VILLAGER_PROFESSIONS.getValue(new ResourceLocation("minecraft", "cleric"));
  if(!profession.getRegistryName().equals(new ResourceLocation("minecraft", "cleric"))) {
    Log.info("Could not find cleric profession!!!");
  } else {
    VillagerRegistry.VillagerCareer career = profession.getCareer(1);
    if(career.getName().equals("cleric")) {
      career.addTrade(1, new Trades());
      Log.info("Successfully registered");
    } else {
      Log.info("Could not find career");
    }
  }
}
и запусти, пришли лог. Оно так-то должно работать. Там просто дебажиться. (т.e. не отличаеться от твоего, по идее должно выбивать тот же NPE, только уже с дебагом происходящего)
 
Так оно логов не пишет... Тупо крашит без обьяснения. Но я попробовал поместить код в EventsHandler и переделать его, чтобы выловить место где запарывается через try и catch... Вот что в итоге вышло:
Код (часть которая должна выполняться после краша выпилена)::
    @SubscribeEvent
    public void onRegisterVillagers(RegistryEvent.Register<VillagerProfession> event) {
        ResourceLocation location = new ResourceLocation("minecraft", "cleric");
        try {
        System.out.println("\nTrying to register profession for \"minecraft:cleric\"...");
        profession = ForgeRegistries.VILLAGER_PROFESSIONS.getValue(location);
        } catch(NullPointerException e) {
            System.out.println("\nCannot register profession!");
        } finally {
            System.out.println("\nSuccessfully registered profession!");
        }
        try {
            System.out.printf("\nProfession=%s\n", profession.getRegistryName().toString());
        } catch(Exception e) {
            System.out.printf("\nException: %s", e.toString());
        }
Фрагмент лога::
[22:42:24] [Client thread/INFO] [STDOUT]: [com.madalchemist.godsanddemons.EventsHandler:onRegisterVillagers:28]:
Trying to register profession for "minecraft:cleric"...
[22:42:24] [Client thread/INFO] [STDOUT]: [com.madalchemist.godsanddemons.EventsHandler:onRegisterVillagers:33]:
Successfully registered profession!

Exception: java.lang.NullPointerException[22:42:24] [Client thread/INFO] [FML]: Applying holder lookups
[22:42:24] [Client thread/INFO] [FML]: Holder lookups applied
 
Сверху