Краш при открытии container

Версия Minecraft
1.12.2
683
3
21
У меня случается краш при открытии контейнера весь код ванильной печки и поменял под себя только заменил onBlockActivated
Java:
    public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
    {
        if (worldIn.isRemote)
        {
            playerIn.openGui(Main.instance, Reference.GUI_DRUM_BLOCK, worldIn, pos.getX(), pos.getY(), pos.getZ());
           
        }
         
            return true;
         
     }
 
Краш-лог
---- Minecraft Crash Report ----
// Oops.

Time: 9/14/18 5:59 PM
Description: Unexpected error

java.lang.NullPointerException: Unexpected error
at net.minecraftforge.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:276)
at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:111)
at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2809)
at en.tiref.Mydecoratedworld.blocks.machines.DrumBlock.onBlockActivated(DrumBlock.java:163)
at net.minecraft.client.multiplayer.PlayerControllerMP.processRightClickBlock(PlayerControllerMP.java:455)
at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1692)
at net.minecraft.client.Minecraft.processKeyBinds(Minecraft.java:2379)
at net.minecraft.client.Minecraft.runTickKeyboard(Minecraft.java:2145)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1933)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1186)
at net.minecraft.client.Minecraft.run(Minecraft.java:441)
at net.minecraft.client.main.Main.main(Main.java:118)
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:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
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.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 net.minecraftforge.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:276)
at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:111)
at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2809)
at en.tiref.Mydecoratedworld.blocks.machines.DrumBlock.onBlockActivated(DrumBlock.java:163)
at net.minecraft.client.multiplayer.PlayerControllerMP.processRightClickBlock(PlayerControllerMP.java:455)
at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1692)
at net.minecraft.client.Minecraft.processKeyBinds(Minecraft.java:2379)
at net.minecraft.client.Minecraft.runTickKeyboard(Minecraft.java:2145)

-- Affected level --
Details:
Level name: MpServer
All players: 1 total; [EntityPlayerSP['Player592'/87, l='MpServer', x=-126.63, y=4.00, z=436.46]]
Chunk stats: MultiplayerChunkCache: 81, 81
Level seed: 0
Level generator: ID 01 - flat, ver 0. Features enabled: false
Level generator options:
Level spawn location: World: (-119,4,442), Chunk: (at 9,0,10 in -8,27; contains blocks -128,0,432 to -113,255,447), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
Level time: 5601 game time, 5601 day time
Level dimension: 0
Level storage version: 0x00000 - Unknown?
Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
Forced entities: 34 total; [EntityPig['Свинья'/12, l='MpServer', x=-162.09, y=4.00, z=395.45], EntitySlime['Слизень'/14, l='MpServer', x=-169.34, y=4.00, z=448.61], EntityCow['Корова'/15, l='MpServer', x=-170.29, y=4.00, z=463.18], EntityChicken['Курица'/16, l='MpServer', x=-170.17, y=4.00, z=452.77], EntitySlime['Слизень'/17, l='MpServer', x=-173.34, y=4.00, z=446.60], EntitySlime['Слизень'/18, l='MpServer', x=-163.31, y=4.67, z=478.68], EntitySlime['Слизень'/19, l='MpServer', x=-165.76, y=4.00, z=480.59], EntitySlime['Слизень'/20, l='MpServer', x=-167.08, y=4.07, z=478.89], EntitySlime['Слизень'/21, l='MpServer', x=-163.67, y=4.50, z=480.40], EntitySlime['Слизень'/22, l='MpServer', x=-163.51, y=4.15, z=477.69], EntityPlayerSP['Player592'/87, l='MpServer', x=-126.63, y=4.00, z=436.46], EntityChicken['Курица'/25, l='MpServer', x=-158.89, y=4.00, z=397.89], EntityChicken['Курица'/26, l='MpServer', x=-154.30, y=4.00, z=414.13], EntityDonkey['Осёл'/27, l='MpServer', x=-153.40, y=4.00, z=408.78], EntityDonkey['Осёл'/28, l='MpServer', x=-150.72, y=4.00, z=424.85], EntityChicken['Курица'/29, l='MpServer', x=-156.54, y=4.00, z=458.07], EntitySlime['Слизень'/30, l='MpServer', x=-158.49, y=4.77, z=474.76], EntitySlime['Слизень'/31, l='MpServer', x=-162.93, y=4.08, z=459.86], EntitySlime['Слизень'/32, l='MpServer', x=-153.27, y=4.21, z=478.90], EntitySlime['Слизень'/33, l='MpServer', x=-146.54, y=4.18, z=471.88], EntitySlime['Слизень'/34, l='MpServer', x=-155.09, y=4.95, z=480.37], EntitySlime['Слизень'/37, l='MpServer', x=-123.89, y=4.17, z=402.89], EntitySlime['Слизень'/38, l='MpServer', x=-128.13, y=4.00, z=413.08], EntitySlime['Слизень'/43, l='MpServer', x=-118.56, y=4.14, z=399.91], EntitySlime['Слизень'/44, l='MpServer', x=-115.19, y=4.00, z=410.17], EntitySlime['Слизень'/51, l='MpServer', x=-105.10, y=4.00, z=388.86], EntitySlime['Слизень'/53, l='MpServer', x=-101.97, y=4.00, z=411.59], EntitySlime['Слизень'/54, l='MpServer', x=-110.26, y=4.00, z=405.32], EntitySlime['Слизень'/55, l='MpServer', x=-102.42, y=4.32, z=444.61], EntitySlime['Слизень'/57, l='MpServer', x=-85.90, y=4.00, z=406.96], EntitySlime['Слизень'/58, l='MpServer', x=-86.73, y=4.00, z=415.43], EntitySlime['Слизень'/59, l='MpServer', x=-89.60, y=4.28, z=407.29], EntitySlime['Слизень'/60, l='MpServer', x=-83.30, y=4.09, z=409.15], EntitySlime['Слизень'/61, l='MpServer', x=-93.96, y=4.28, z=424.87]]
Retry entities: 0 total; []
Server brand: fml,forge
Server type: Integrated singleplayer server
Stacktrace:
at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:461)
at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2886)
at net.minecraft.client.Minecraft.run(Minecraft.java:470)
at net.minecraft.client.main.Main.main(Main.java:118)
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:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
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.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
at GradleStart.main(GradleStart.java:25)

-- System Details --
Details:
Minecraft Version: 1.12.2
Operating System: Windows XP (x86) version 5.1
Java Version: 1.8.0_101, Oracle Corporation
Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
Memory: 811256008 bytes (773 MB) / 1060372480 bytes (1011 MB) up to 1060372480 bytes (1011 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.4.2705 6 mods loaded, 6 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 |
|:--------- |:--------- |:------------ |:-------------------------------- |:--------- |
| UCHIJAAAA | minecraft | 1.12.2 | minecraft.jar | None |
| UCHIJAAAA | mcp | 9.42 | minecraft.jar | None |
| UCHIJAAAA | FML | 8.0.99.99 | forgeSrc-1.12.2-14.23.4.2705.jar | None |
| UCHIJAAAA | forge | 14.23.4.2705 | forgeSrc-1.12.2-14.23.4.2705.jar | None |
| UCHIJAAAA | mdw | 1.1.0 | bin | None |
| UCHIJAAAA | cjcore | 0.0.3.2 | cjcore-1.12-0.0.3.2.jar | None |

Loaded coremods (and transformers):
GL info: ' Vendor: 'ATI Technologies Inc.' Version: '3.3.11672 Compatibility Profile Context' Renderer: 'ATI Radeon 3000 Graphics'
Launched Version: 1.12.2
LWJGL: 2.9.4
OpenGL: ATI Radeon 3000 Graphics GL version 3.3.11672 Compatibility Profile Context, ATI Technologies Inc.
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: Русский (Россия)
Profiler Position: N/A (disabled)
CPU: 2x AMD Athlon(tm) II X2 240 Processor
Краш-лог:
---- Minecraft Crash Report ----
// Oops.

Time: 9/14/18 5:59 PM
Description: Unexpected error

java.lang.NullPointerException: Unexpected error
	at net.minecraftforge.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:276)
	at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:111)
	at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2809)
	at en.tiref.Mydecoratedworld.blocks.machines.DrumBlock.onBlockActivated(DrumBlock.java:163)
	at net.minecraft.client.multiplayer.PlayerControllerMP.processRightClickBlock(PlayerControllerMP.java:455)
	at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1692)
	at net.minecraft.client.Minecraft.processKeyBinds(Minecraft.java:2379)
	at net.minecraft.client.Minecraft.runTickKeyboard(Minecraft.java:2145)
	at net.minecraft.client.Minecraft.runTick(Minecraft.java:1933)
	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1186)
	at net.minecraft.client.Minecraft.run(Minecraft.java:441)
	at net.minecraft.client.main.Main.main(Main.java:118)
	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:135)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
	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.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 net.minecraftforge.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:276)
	at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:111)
	at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2809)
	at en.tiref.Mydecoratedworld.blocks.machines.DrumBlock.onBlockActivated(DrumBlock.java:163)
	at net.minecraft.client.multiplayer.PlayerControllerMP.processRightClickBlock(PlayerControllerMP.java:455)
	at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1692)
	at net.minecraft.client.Minecraft.processKeyBinds(Minecraft.java:2379)
	at net.minecraft.client.Minecraft.runTickKeyboard(Minecraft.java:2145)

-- Affected level --
Details:
	Level name: MpServer
	All players: 1 total; [EntityPlayerSP['Player592'/87, l='MpServer', x=-126.63, y=4.00, z=436.46]]
	Chunk stats: MultiplayerChunkCache: 81, 81
	Level seed: 0
	Level generator: ID 01 - flat, ver 0. Features enabled: false
	Level generator options: 
	Level spawn location: World: (-119,4,442), Chunk: (at 9,0,10 in -8,27; contains blocks -128,0,432 to -113,255,447), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
	Level time: 5601 game time, 5601 day time
	Level dimension: 0
	Level storage version: 0x00000 - Unknown?
	Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
	Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
	Forced entities: 34 total; [EntityPig['Свинья'/12, l='MpServer', x=-162.09, y=4.00, z=395.45], EntitySlime['Слизень'/14, l='MpServer', x=-169.34, y=4.00, z=448.61], EntityCow['Корова'/15, l='MpServer', x=-170.29, y=4.00, z=463.18], EntityChicken['Курица'/16, l='MpServer', x=-170.17, y=4.00, z=452.77], EntitySlime['Слизень'/17, l='MpServer', x=-173.34, y=4.00, z=446.60], EntitySlime['Слизень'/18, l='MpServer', x=-163.31, y=4.67, z=478.68], EntitySlime['Слизень'/19, l='MpServer', x=-165.76, y=4.00, z=480.59], EntitySlime['Слизень'/20, l='MpServer', x=-167.08, y=4.07, z=478.89], EntitySlime['Слизень'/21, l='MpServer', x=-163.67, y=4.50, z=480.40], EntitySlime['Слизень'/22, l='MpServer', x=-163.51, y=4.15, z=477.69], EntityPlayerSP['Player592'/87, l='MpServer', x=-126.63, y=4.00, z=436.46], EntityChicken['Курица'/25, l='MpServer', x=-158.89, y=4.00, z=397.89], EntityChicken['Курица'/26, l='MpServer', x=-154.30, y=4.00, z=414.13], EntityDonkey['Осёл'/27, l='MpServer', x=-153.40, y=4.00, z=408.78], EntityDonkey['Осёл'/28, l='MpServer', x=-150.72, y=4.00, z=424.85], EntityChicken['Курица'/29, l='MpServer', x=-156.54, y=4.00, z=458.07], EntitySlime['Слизень'/30, l='MpServer', x=-158.49, y=4.77, z=474.76], EntitySlime['Слизень'/31, l='MpServer', x=-162.93, y=4.08, z=459.86], EntitySlime['Слизень'/32, l='MpServer', x=-153.27, y=4.21, z=478.90], EntitySlime['Слизень'/33, l='MpServer', x=-146.54, y=4.18, z=471.88], EntitySlime['Слизень'/34, l='MpServer', x=-155.09, y=4.95, z=480.37], EntitySlime['Слизень'/37, l='MpServer', x=-123.89, y=4.17, z=402.89], EntitySlime['Слизень'/38, l='MpServer', x=-128.13, y=4.00, z=413.08], EntitySlime['Слизень'/43, l='MpServer', x=-118.56, y=4.14, z=399.91], EntitySlime['Слизень'/44, l='MpServer', x=-115.19, y=4.00, z=410.17], EntitySlime['Слизень'/51, l='MpServer', x=-105.10, y=4.00, z=388.86], EntitySlime['Слизень'/53, l='MpServer', x=-101.97, y=4.00, z=411.59], EntitySlime['Слизень'/54, l='MpServer', x=-110.26, y=4.00, z=405.32], EntitySlime['Слизень'/55, l='MpServer', x=-102.42, y=4.32, z=444.61], EntitySlime['Слизень'/57, l='MpServer', x=-85.90, y=4.00, z=406.96], EntitySlime['Слизень'/58, l='MpServer', x=-86.73, y=4.00, z=415.43], EntitySlime['Слизень'/59, l='MpServer', x=-89.60, y=4.28, z=407.29], EntitySlime['Слизень'/60, l='MpServer', x=-83.30, y=4.09, z=409.15], EntitySlime['Слизень'/61, l='MpServer', x=-93.96, y=4.28, z=424.87]]
	Retry entities: 0 total; []
	Server brand: fml,forge
	Server type: Integrated singleplayer server
Stacktrace:
	at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:461)
	at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2886)
	at net.minecraft.client.Minecraft.run(Minecraft.java:470)
	at net.minecraft.client.main.Main.main(Main.java:118)
	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:135)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
	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.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
	at GradleStart.main(GradleStart.java:25)

-- System Details --
Details:
	Minecraft Version: 1.12.2
	Operating System: Windows XP (x86) version 5.1
	Java Version: 1.8.0_101, Oracle Corporation
	Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
	Memory: 811256008 bytes (773 MB) / 1060372480 bytes (1011 MB) up to 1060372480 bytes (1011 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.4.2705 6 mods loaded, 6 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 |
	|:--------- |:--------- |:------------ |:-------------------------------- |:--------- |
	| UCHIJAAAA | minecraft | 1.12.2       | minecraft.jar                    | None      |
	| UCHIJAAAA | mcp       | 9.42         | minecraft.jar                    | None      |
	| UCHIJAAAA | FML       | 8.0.99.99    | forgeSrc-1.12.2-14.23.4.2705.jar | None      |
	| UCHIJAAAA | forge     | 14.23.4.2705 | forgeSrc-1.12.2-14.23.4.2705.jar | None      |
	| UCHIJAAAA | mdw       | 1.1.0        | bin                              | None      |
	| UCHIJAAAA | cjcore    | 0.0.3.2      | cjcore-1.12-0.0.3.2.jar          | None      |

	Loaded coremods (and transformers): 
	GL info: ' Vendor: 'ATI Technologies Inc.' Version: '3.3.11672 Compatibility Profile Context' Renderer: 'ATI Radeon 3000 Graphics'
	Launched Version: 1.12.2
	LWJGL: 2.9.4
	OpenGL: ATI Radeon 3000 Graphics GL version 3.3.11672 Compatibility Profile Context, ATI Technologies Inc.
	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: Русский (Россия)
	Profiler Position: N/A (disabled)
	CPU: 2x AMD Athlon(tm) II X2 240 Processor
Решение
немного обидно но тут привыкнешь -.-
Сорян, если сильно задел. Эта ирония не из злого умысла, а чтобы сподвигнуть тебя идти другими, хорошими путями, в частности научиться анализировать баг-репорты

нигде, и где мне его вызвать и как?
Регистрировать тайлы нужно во время init-стадии загрузки мода, из соответствующего метода в прокси можно вызвать
683
3
21
Java:
package en.tiref.Mydecoratedworld.inventory.Gui;

import en.tiref.Mydecoratedworld.inventory.container.ContainerDrum;
import en.tiref.Mydecoratedworld.inventory.tileentity.TileEntityDrum;
import en.tiref.Mydecoratedworld.util.Reference;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.IGuiHandler;

public class GuiHandler implements IGuiHandler
{
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
    if(ID == Reference.GUI_DRUM_BLOCK) return new ContainerDrum(player.inventory, (TileEntityDrum)world.getTileEntity(new BlockPos(x,y,z)));
    return null;
}
@Override
    public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
   {
    if(ID == Reference.GUI_DRUM_BLOCK) return new GuiDrum(player.inventory, (TileEntityDrum)world.getTileEntity(new BlockPos(x,y,z)));
        return null;
    }
}
 
129
6
18
Попробуй, только на сервере так же сделай.
Java:
TileEntityDrum tile = (TileEntityDrum)world.getTileEntity(new BlockPos(x,y,z));
if (tile != null) return new GuiDrum(player.inventory, (TileEntityDrum)world.getTileEntity(new BlockPos(x,y,z)));
Если не будет открываться, знач предмет не имеет тайла(скорее всего).
 
7,099
324
1,510
Это для методов getGuiElement
 
683
3
21
ну теперь он просто не открывается и ещё что-то в консоль пишет:
Код:
[15:41:21] [Server thread/ERROR] [FML]: A TileEntity type en.tiref.Mydecoratedworld.inventory.tileentity.TileEntityDrum has throw an exception trying to write state. It will not persist. Report this to the mod author
java.lang.RuntimeException: class en.tiref.Mydecoratedworld.inventory.tileentity.TileEntityDrum is missing a mapping! This is a bug!
    at net.minecraft.tileentity.TileEntity.writeInternal(TileEntity.java:89) ~[TileEntity.class:?]
    at net.minecraft.tileentity.TileEntity.writeToNBT(TileEntity.java:80) ~[TileEntity.class:?]
    at net.minecraft.tileentity.TileEntityLockable.writeToNBT(TileEntityLockable.java:22) ~[TileEntityLockable.class:?]
    at en.tiref.Mydecoratedworld.inventory.tileentity.TileEntityDrum.writeToNBT(TileEntityDrum.java:168) ~[TileEntityDrum.class:?]
    at net.minecraft.world.chunk.storage.AnvilChunkLoader.writeChunkToNBT(AnvilChunkLoader.java:414) [AnvilChunkLoader.class:?]
    at net.minecraft.world.chunk.storage.AnvilChunkLoader.saveChunk(AnvilChunkLoader.java:185) [AnvilChunkLoader.class:?]
    at net.minecraft.world.gen.ChunkProviderServer.saveChunkData(ChunkProviderServer.java:214) [ChunkProviderServer.class:?]
    at net.minecraft.world.gen.ChunkProviderServer.saveChunks(ChunkProviderServer.java:242) [ChunkProviderServer.class:?]
    at net.minecraft.world.WorldServer.saveAllChunks(WorldServer.java:1061) [WorldServer.class:?]
    at net.minecraft.server.MinecraftServer.saveAllWorlds(MinecraftServer.java:468) [MinecraftServer.class:?]
    at net.minecraft.server.integrated.IntegratedServer.saveAllWorlds(IntegratedServer.java:274) [IntegratedServer.class:?]
    at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:766) [MinecraftServer.class:?]
    at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:192) [IntegratedServer.class:?]
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:592) [MinecraftServer.class:?]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_101]
 
683
3
21
И ещё добавил сверху onBlockActivated , @Override.
но он не открываеться
и ещё вот код блока
public class BlockFurnace extends BlockContainer
{
public static final PropertyDirection FACING = BlockHorizontal.FACING;
private final boolean isBurning;
private static boolean keepInventory;

protected BlockFurnace(boolean isBurning)
{
super(Material.ROCK);
this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
this.isBurning = isBurning;
}

/**
* Get the Item that this Block should drop when harvested.
*/
public Item getItemDropped(IBlockState state, Random rand, int fortune)
{
return Item.getItemFromBlock(Blocks.FURNACE);
}

/**
* Called after the block is set in the Chunk data, but before the Tile Entity is set
*/
public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state)
{
this.setDefaultFacing(worldIn, pos, state);
}

private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state)
{
if (!worldIn.isRemote)
{
IBlockState iblockstate = worldIn.getBlockState(pos.north());
IBlockState iblockstate1 = worldIn.getBlockState(pos.south());
IBlockState iblockstate2 = worldIn.getBlockState(pos.west());
IBlockState iblockstate3 = worldIn.getBlockState(pos.east());
EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);

if (enumfacing == EnumFacing.NORTH && iblockstate.isFullBlock() && !iblockstate1.isFullBlock())
{
enumfacing = EnumFacing.SOUTH;
}
else if (enumfacing == EnumFacing.SOUTH && iblockstate1.isFullBlock() && !iblockstate.isFullBlock())
{
enumfacing = EnumFacing.NORTH;
}
else if (enumfacing == EnumFacing.WEST && iblockstate2.isFullBlock() && !iblockstate3.isFullBlock())
{
enumfacing = EnumFacing.EAST;
}
else if (enumfacing == EnumFacing.EAST && iblockstate3.isFullBlock() && !iblockstate2.isFullBlock())
{
enumfacing = EnumFacing.WEST;
}

worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2);
}
}

@SideOnly(Side.CLIENT)
@SuppressWarnings("incomplete-switch")
public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand)
{
if (this.isBurning)
{
EnumFacing enumfacing = (EnumFacing)stateIn.getValue(FACING);
double d0 = (double)pos.getX() + 0.5D;
double d1 = (double)pos.getY() + rand.nextDouble() * 6.0D / 16.0D;
double d2 = (double)pos.getZ() + 0.5D;
double d3 = 0.52D;
double d4 = rand.nextDouble() * 0.6D - 0.3D;

if (rand.nextDouble() < 0.1D)
{
worldIn.playSound((double)pos.getX() + 0.5D, (double)pos.getY(), (double)pos.getZ() + 0.5D, SoundEvents.BLOCK_FURNACE_FIRE_CRACKLE, SoundCategory.BLOCKS, 1.0F, 1.0F, false);
}

switch (enumfacing)
{
case WEST:
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 - 0.52D, d1, d2 + d4, 0.0D, 0.0D, 0.0D);
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 - 0.52D, d1, d2 + d4, 0.0D, 0.0D, 0.0D);
break;
case EAST:
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + 0.52D, d1, d2 + d4, 0.0D, 0.0D, 0.0D);
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + 0.52D, d1, d2 + d4, 0.0D, 0.0D, 0.0D);
break;
case NORTH:
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 - 0.52D, 0.0D, 0.0D, 0.0D);
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 - 0.52D, 0.0D, 0.0D, 0.0D);
break;
case SOUTH:
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 + 0.52D, 0.0D, 0.0D, 0.0D);
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 + 0.52D, 0.0D, 0.0D, 0.0D);
}
}
}

/**
* Called when the block is right clicked by a player.
*/
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
{
if (worldIn.isRemote)
{
return true;
}
else
{
TileEntity tileentity = worldIn.getTileEntity(pos);

if (tileentity instanceof TileEntityFurnace)
{
playerIn.displayGUIChest((TileEntityFurnace)tileentity);
playerIn.addStat(StatList.FURNACE_INTERACTION);
}

return true;
}
}

public static void setState(boolean active, World worldIn, BlockPos pos)
{
IBlockState iblockstate = worldIn.getBlockState(pos);
TileEntity tileentity = worldIn.getTileEntity(pos);
keepInventory = true;

if (active)
{
worldIn.setBlockState(pos, Blocks.LIT_FURNACE.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
worldIn.setBlockState(pos, Blocks.LIT_FURNACE.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
}
else
{
worldIn.setBlockState(pos, Blocks.FURNACE.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
worldIn.setBlockState(pos, Blocks.FURNACE.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
}

keepInventory = false;

if (tileentity != null)
{
tileentity.validate();
worldIn.setTileEntity(pos, tileentity);
}
}

/**
* Returns a new instance of a block's tile entity class. Called on placing the block.
*/
public TileEntity createNewTileEntity(World worldIn, int meta)
{
return new TileEntityFurnace();
}

/**
* Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the
* IBlockstate
*/
public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
{
return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite());
}

/**
* Called by ItemBlocks after a block is set in the world, to allow post-place logic
*/
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
{
worldIn.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing().getOpposite()), 2);

if (stack.hasDisplayName())
{
TileEntity tileentity = worldIn.getTileEntity(pos);

if (tileentity instanceof TileEntityFurnace)
{
((TileEntityFurnace)tileentity).setCustomInventoryName(stack.getDisplayName());
}
}
}

/**
* Called serverside after this block is replaced with another in Chunk, but before the Tile Entity is updated
*/
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
{
if (!keepInventory)
{
TileEntity tileentity = worldIn.getTileEntity(pos);

if (tileentity instanceof TileEntityFurnace)
{
InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityFurnace)tileentity);
worldIn.updateComparatorOutputLevel(pos, this);
}
}

super.breakBlock(worldIn, pos, state);
}

public boolean hasComparatorInputOverride(IBlockState state)
{
return true;
}

public int getComparatorInputOverride(IBlockState blockState, World worldIn, BlockPos pos)
{
return Container.calcRedstone(worldIn.getTileEntity(pos));
}

public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state)
{
return new ItemStack(Blocks.FURNACE);
}

/**
* The type of render function called. MODEL for mixed tesr and static model, MODELBLOCK_ANIMATED for TESR-only,
* LIQUID for vanilla liquids, INVISIBLE to skip all rendering
*/
public EnumBlockRenderType getRenderType(IBlockState state)
{
return EnumBlockRenderType.MODEL;
}

/**
* Convert the given metadata into a BlockState for this Block
*/
public IBlockState getStateFromMeta(int meta)
{
EnumFacing enumfacing = EnumFacing.getFront(meta);

if (enumfacing.getAxis() == EnumFacing.Axis.Y)
{
enumfacing = EnumFacing.NORTH;
}

return this.getDefaultState().withProperty(FACING, enumfacing);
}

/**
* Convert the BlockState into the correct metadata value
*/
public int getMetaFromState(IBlockState state)
{
return ((EnumFacing)state.getValue(FACING)).getIndex();
}

/**
* Returns the blockstate with the given rotation from the passed blockstate. If inapplicable, returns the passed
* blockstate.
*/
public IBlockState withRotation(IBlockState state, Rotation rot)
{
return state.withProperty(FACING, rot.rotate((EnumFacing)state.getValue(FACING)));
}

/**
* Returns the blockstate with the given mirror of the passed blockstate. If inapplicable, returns the passed
* blockstate.
*/
public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
{
return state.withRotation(mirrorIn.toRotation((EnumFacing)state.getValue(FACING)));
}

protected BlockStateContainer createBlockState()
{
return new BlockStateContainer(this, new IProperty[] {FACING});
}
}
 
7,099
324
1,510
А сам то читать краш пробовал?
Там говорится, что тайл не зареган
class en.tiref.Mydecoratedworld.inventory.tileentity.TileEntityDrum is missing a mapping!


Report this to the mod author
Таким авторам бессмысленно че-то репортить -_-
 
683
3
21
Там говорится, что тайл не зареган
Java:
package en.tiref.Mydecoratedworld.util.handlers;

import en.tiref.Mydecoratedworld.inventory.tileentity.TileEntityDrum;
import en.tiref.Mydecoratedworld.util.Reference;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class TileEntityHandler
{
    public static void registerTileEntities()
    {
        GameRegistry.registerTileEntity(TileEntityDrum.class, new ResourceLocation(Reference.MOD_ID + ":drum_block"));
    }
}
 
3,005
192
592
Вопрос, который должен быть раз 100...
"А где ты его вызываешь?"
Если у тебя есть "чудо" классы с 1-им методом, то скидывай иерархию до "preInit/init/postInit".
 
7,099
324
1,510
немного обидно но тут привыкнешь -.-
Сорян, если сильно задел. Эта ирония не из злого умысла, а чтобы сподвигнуть тебя идти другими, хорошими путями, в частности научиться анализировать баг-репорты

нигде, и где мне его вызвать и как?
Регистрировать тайлы нужно во время init-стадии загрузки мода, из соответствующего метода в прокси можно вызвать
 
Сверху