Краш в собственном моде

Версия Minecraft
1.6.4
Основа мода :
Java:
package assets.testmod.src;

import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import net.minecraft.block.Block;

@Mod(modid=ModInfo.MODID, name=ModInfo.NAME, version=ModInfo.VERSION)

public class TestMod {

public static final Block testBlock = new testBlock(2012).setUnlocalizedName("testBlock");
    @Mod.Instance(ModInfo.MODID)
    public static TestMod mod;
    @EventHandler
    public void preInit(FMLPreInitializationEvent event)
    {
    }
    @EventHandler
    public void init(FMLInitializationEvent event)
    {
        GameRegistry.registerBlock(testBlock);
        LanguageRegistry.addName(testBlock, "Test Block");
    }
    @EventHandler
    public void postInit(FMLPostInitializationEvent event)
    {
    }
    @EventHandler
    public void serverStarting(FMLServerStartingEvent event)
    {

    }
}

Сам блок:
Java:
package assets.testmod.src;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;

public class testBlock extends Block
{
    protected testBlock(int par1)
    {
        super(par1, Material.ground);
        this.setCreativeTab(CreativeTabs.tabBlock);
    }
    
    @SideOnly(Side.CLIENT)
    public void registerIcons(IconRegister ir)
    {
        this.blockIcon = ir.registerIcon(ModInfo.MODID + ":testBlock");
    }
}
В самом Eclipse при тестовом запуске все работает. Вне Eclipse - нет.
Вылетает после лого "Mojang".
 
Краш-лог
---- Minecraft Crash Report ----
// Why did you do that?

Time: 23.12.18 14:41
Description: Initializing game

java.lang.NoSuchFieldError: ground
at assets.testmod.src.testBlock.<init>(testBlock.java:14)
at assets.testmod.src.TestMod.<clinit>(TestMod.java:17)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:462)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:201)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:112)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:511)
at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:183)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:473)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:808)
at net.minecraft.client.main.Main.main(SourceFile:101)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:131)
at net.minecraft.launchwrapper.Launch.main(Launch.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.launcher.components.Game$4.run(Game.java:258)
at java.lang.Thread.run(Unknown Source)


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

-- Head --
Stacktrace:
at assets.testmod.src.testBlock.<init>(testBlock.java:14)
at assets.testmod.src.TestMod.<clinit>(TestMod.java:17)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:462)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:201)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:112)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:511)
at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:183)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:473)

-- Initialization --
Details:
Stacktrace:
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:808)
at net.minecraft.client.main.Main.main(SourceFile:101)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:131)
at net.minecraft.launchwrapper.Launch.main(Launch.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.launcher.components.Game$4.run(Game.java:258)
at java.lang.Thread.run(Unknown Source)

-- System Details --
Details:
Minecraft Version: 1.6.4
Operating System: Windows 7 (x86) version 6.1
Java Version: 1.8.0_191, Oracle Corporation
Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
Memory: 65835312 bytes (62 MB) / 152961024 bytes (145 MB) up to 1037959168 bytes (989 MB)
JVM Flags: 2 total; -Xmx1024m -XX:MaxPermSize=128m
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Suspicious classes: FML and Forge are installed
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v8.11 FML v6.4.49.965 Minecraft Forge 9.11.1.965 6 mods loaded, 6 mods active
mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed
FML{6.4.49.965} [Forge Mod Loader] (minecraftforge-9.11.1.965.jar) Unloaded->Constructed
Forge{9.11.1.965} [Minecraft Forge] (minecraftforge-9.11.1.965.jar) Unloaded->Constructed
CodeChickenCore{0.9.0.9} [CodeChicken Core] (minecraft.jar) Unloaded->Constructed
NotEnoughItems{1.6.1.9} [Not Enough Items] (NotEnoughItems-1.6.4-1.6.1.9-universal.jar) Unloaded->Constructed
testmod{1.0.0} [testmod] (Test2.jar) Unloaded
Launched Version: 1.6.4
LWJGL: 2.9.3
OpenGL: GeForce GTX 1060 6GB/PCIe/SSE2 GL version 4.6.0 NVIDIA 388.13, NVIDIA Corporation
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Pack: Default
Current Language: English (US)
Profiler Position: N/A (disabled)
Vec3 Pool Size: ~~ERROR~~ NullPointerException: null
Краш-лог:
---- Minecraft Crash Report ----
// Why did you do that?

Time: 23.12.18 14:41
Description: Initializing game

java.lang.NoSuchFieldError: ground
	at assets.testmod.src.testBlock.<init>(testBlock.java:14)
	at assets.testmod.src.TestMod.<clinit>(TestMod.java:17)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Unknown Source)
	at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:462)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
	at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
	at com.google.common.eventbus.EventBus.post(EventBus.java:267)
	at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:201)
	at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:181)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
	at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
	at com.google.common.eventbus.EventBus.post(EventBus.java:267)
	at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:112)
	at cpw.mods.fml.common.Loader.loadMods(Loader.java:511)
	at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:183)
	at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:473)
	at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:808)
	at net.minecraft.client.main.Main.main(SourceFile:101)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:131)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:27)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.launcher.components.Game$4.run(Game.java:258)
	at java.lang.Thread.run(Unknown Source)


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

-- Head --
Stacktrace:
	at assets.testmod.src.testBlock.<init>(testBlock.java:14)
	at assets.testmod.src.TestMod.<clinit>(TestMod.java:17)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Unknown Source)
	at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:462)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
	at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
	at com.google.common.eventbus.EventBus.post(EventBus.java:267)
	at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:201)
	at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:181)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
	at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
	at com.google.common.eventbus.EventBus.post(EventBus.java:267)
	at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:112)
	at cpw.mods.fml.common.Loader.loadMods(Loader.java:511)
	at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:183)
	at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:473)

-- Initialization --
Details:
Stacktrace:
	at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:808)
	at net.minecraft.client.main.Main.main(SourceFile:101)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:131)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:27)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.launcher.components.Game$4.run(Game.java:258)
	at java.lang.Thread.run(Unknown Source)

-- System Details --
Details:
	Minecraft Version: 1.6.4
	Operating System: Windows 7 (x86) version 6.1
	Java Version: 1.8.0_191, Oracle Corporation
	Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
	Memory: 65835312 bytes (62 MB) / 152961024 bytes (145 MB) up to 1037959168 bytes (989 MB)
	JVM Flags: 2 total; -Xmx1024m -XX:MaxPermSize=128m
	AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
	Suspicious classes: FML and Forge are installed
	IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
	FML: MCP v8.11 FML v6.4.49.965 Minecraft Forge 9.11.1.965 6 mods loaded, 6 mods active
	mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed
	FML{6.4.49.965} [Forge Mod Loader] (minecraftforge-9.11.1.965.jar) Unloaded->Constructed
	Forge{9.11.1.965} [Minecraft Forge] (minecraftforge-9.11.1.965.jar) Unloaded->Constructed
	CodeChickenCore{0.9.0.9} [CodeChicken Core] (minecraft.jar) Unloaded->Constructed
	NotEnoughItems{1.6.1.9} [Not Enough Items] (NotEnoughItems-1.6.4-1.6.1.9-universal.jar) Unloaded->Constructed
	testmod{1.0.0} [testmod] (Test2.jar) Unloaded
	Launched Version: 1.6.4
	LWJGL: 2.9.3
	OpenGL: GeForce GTX 1060 6GB/PCIe/SSE2 GL version 4.6.0 NVIDIA 388.13, NVIDIA Corporation
	Is Modded: Definitely; Client brand changed to 'fml,forge'
	Type: Client (map_client.txt)
	Resource Pack: Default
	Current Language: English (US)
	Profiler Position: N/A (disabled)
	Vec3 Pool Size: ~~ERROR~~ NullPointerException: null
Последнее редактирование модератором:
Не видит поле ground. "Вне eclipse" бывает из-за того, что он не преобразовался до концы нужного вида:
Либо из-за того что не было последовательно использовано recompile, а затем reobfuscate. (С gradle нет такой проблемы.)
Либо использовались не те class'ы (есть которые после recompile, а затем reobfuscate, а есть от eclipse).
Либо испортились сами исходники, что не могут полностью преобразоваться к ванильному коду.
 
Не видит поле ground. "Вне eclipse" бывает из-за того, что он не преобразовался до концы нужного вида:
Либо из-за того что не было последовательно использовано recompile, а затем reobfuscate. (С gradle нет такой проблемы.)
Либо использовались не те class'ы (есть которые после recompile, а затем reobfuscate, а есть от eclipse).
Либо испортились сами исходники, что не могут полностью преобразоваться к ванильному коду.
Тогда как можно грамотно все упаковать в мод?
 
Я уже не помню.
0. До того как пользоваться исходниками Minecraft их нужно сделать только для чтение.
1. Создав код для мода, нужно
последовательно использовано recompile, а затем reobfuscate.
Это я про батники.
2. В папке "\mcp\reobf\minecraft\" запаковать твои классы, рекомендуеться в zip архив, желательно с помощью WinRar.
3. И добавить в этот архив папку assets из "\mcp\src\minecraft\".
Это если использовать не gradle. А если ты используешь, то вводишь команду "gradlew build" в командную строчку и уже будет готовый мод в папке "\build\libs\".
 
Не видит поле ground. "Вне eclipse" бывает из-за того, что он не преобразовался до концы нужного вида:
Либо из-за того что не было последовательно использовано recompile, а затем reobfuscate. (С gradle нет такой проблемы.)
Либо использовались не те class'ы (есть которые после recompile, а затем reobfuscate, а есть от eclipse).
Либо испортились сами исходники, что не могут полностью преобразоваться к ванильному коду.
И такой вопрос: eclipse content assist problem как решить? . Моя же тема, но с новой ошибкой. Это произошло внезапно. Я выключил комп и это случилось. Что мне с этим делать?
 
Я уже не помню.
0. До того как пользоваться исходниками Minecraft их нужно сделать только для чтение.
1. Создав код для мода, нужно

Это я про батники.
2. В папке "\mcp\reobf\minecraft\" запаковать твои классы, рекомендуеться в zip архив, желательно с помощью WinRar.
3. И добавить в этот архив папку assets из "\mcp\src\minecraft\".
Это если использовать не gradle. А если ты используешь, то вводишь команду "gradlew build" в командную строчку и уже будет готовый мод в папке "\build\libs\".
После ваших советов. Можно как-нибудь поподробнее, как засунуть это все в архив правильно?
 

Вложения

  • crash-2018-12-25_01_16_33-client.txt
    4.8 KB · Просмотры: 1
Код:
java.lang.IllegalArgumentException: duplicate key: TestMod
Код:
    TestMod{1.0.0} [TestMod] (Uwe.zip) 
    TestMod{1.0.0} [TestMod] (Uwe.zip)
У тебя типа два мода в одном архиве. А как подробно написать, как это "засунуть это все в архив", я не знаю.
 
Назад
Сверху