Jump to content

[SOLVED][1.7.10]Ghost items drop


megabitus

Recommended Posts

Hi! I have a block that when I close the GUI I drop the items that are in slots, they drop but they leave ghost blocks, here is the code:

@Override
public void onContainerClosed(EntityPlayer entityplayer)
{
super.onContainerClosed(entityplayer);
for(int i = 0; i < TileEntityInterChest.INVENTORY_SIZE; i++)
{
ItemStack itemstack = craftMatrix.getStackInSlot(i);
if(itemstack != null)
{
entityplayer.entityDropItem(itemstack, 0.05F);
}
}
}

Can someone help me?

Woking at my first mod, Blocks & Items Revolution : https://github.com/megabitus98/Blocks-Items-Revolution

Link to comment
Share on other sites

I've tried to do like this

@Override
    public void onContainerClosed(EntityPlayer entityplayer)
    {
            super.onContainerClosed(entityplayer);
            for(int i = 0; i < TileEntityInterChest.INVENTORY_SIZE; i++)
            {
                ItemStack itemstack = craftMatrix.getStackInSlot(i);
                if(itemstack != null && worldObj.isRemote)
                {
                    entityplayer.entityDropItem(itemstack, 0.05F);
                }
            }
    }

But it crashes now:

 

[13:59:02] [server thread/ERROR]: Encountered an unexpected exception

net.minecraft.util.ReportedException: Ticking memory connection

at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:198) ~[NetworkSystem.class:?]

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:736) ~[MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:624) ~[MinecraftServer.class:?]

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) ~[integratedServer.class:?]

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:495) [MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:762) [MinecraftServer$2.class:?]

Caused by: java.lang.NullPointerException

at com.mega.bir.client.interfaces.machine.ContainerMachine.onContainerClosed(ContainerMachine.java:163) ~[ContainerMachine.class:?]

at net.minecraft.entity.player.EntityPlayerMP.closeContainer(EntityPlayerMP.java:894) ~[EntityPlayerMP.class:?]

at net.minecraft.network.NetHandlerPlayServer.processCloseWindow(NetHandlerPlayServer.java:936) ~[NetHandlerPlayServer.class:?]

at net.minecraft.network.play.client.C0DPacketCloseWindow.processPacket(C0DPacketCloseWindow.java:29) ~[C0DPacketCloseWindow.class:?]

at net.minecraft.network.play.client.C0DPacketCloseWindow.processPacket(C0DPacketCloseWindow.java:53) ~[C0DPacketCloseWindow.class:?]

at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:247) ~[NetworkManager.class:?]

at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) ~[NetworkSystem.class:?]

... 5 more

[13:59:02] [server thread/ERROR]: This crash report has been saved to: F:\Dropbox\Codding, Modding\Moding\1.7\Blocks-Items-Revolution\run\.\crash-reports\crash-2014-08-20_13.59.02-server.txt

[13:59:02] [server thread/INFO]: Stopping server

[13:59:02] [server thread/INFO]: Saving players

[13:59:02] [server thread/INFO]: Saving worlds

[13:59:02] [server thread/INFO]: Saving chunks for level 'New World'/Overworld

[13:59:02] [server thread/INFO]: Saving chunks for level 'New World'/Nether

[13:59:02] [server thread/INFO]: Saving chunks for level 'New World'/The End

[13:59:02] [server thread/INFO] [FML]: Unloading dimension 0

[13:59:02] [server thread/INFO] [FML]: Unloading dimension -1

[13:59:02] [server thread/INFO] [FML]: Unloading dimension 1

[13:59:02] [server thread/INFO] [FML]: Applying holder lookups

[13:59:02] [server thread/INFO] [FML]: Holder lookups applied

[13:59:02] [server thread/INFO] [FML]: The state engine was in incorrect state SERVER_STOPPING and forced into state SERVER_STOPPED. Errors may have been discarded.

[13:59:03] [Client thread/FATAL]: Reported exception thrown!

net.minecraft.util.ReportedException: Updating screen events

at net.minecraft.client.Minecraft.runTick(Minecraft.java:1745) ~[Minecraft.class:?]

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1039) ~[Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:961) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_67]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_67]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_67]

at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_67]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_67]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_67]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_67]

at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_67]

at GradleStart.bounce(GradleStart.java:107) [start/:?]

at GradleStart.startClient(GradleStart.java:100) [start/:?]

at GradleStart.main(GradleStart.java:65) [start/:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_67]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_67]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_67]

at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_67]

at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) [idea_rt.jar:?]

Caused by: java.lang.NullPointerException

at com.mega.bir.client.interfaces.machine.ContainerMachine.onContainerClosed(ContainerMachine.java:163) ~[ContainerMachine.class:?]

at net.minecraft.client.gui.inventory.GuiContainer.onGuiClosed(GuiContainer.java:733) ~[GuiContainer.class:?]

at net.minecraft.client.Minecraft.displayGuiScreen(Minecraft.java:847) ~[Minecraft.class:?]

at net.minecraft.client.entity.EntityPlayerSP.closeScreen(EntityPlayerSP.java:356) ~[EntityPlayerSP.class:?]

at net.minecraft.client.entity.EntityClientPlayerMP.closeScreenNoPacket(EntityClientPlayerMP.java:265) ~[EntityClientPlayerMP.class:?]

at net.minecraft.client.entity.EntityClientPlayerMP.closeScreen(EntityClientPlayerMP.java:256) ~[EntityClientPlayerMP.class:?]

at net.minecraft.client.gui.inventory.GuiContainer.keyTyped(GuiContainer.java:688) ~[GuiContainer.class:?]

at net.minecraft.client.gui.GuiScreen.handleKeyboardInput(GuiScreen.java:372) ~[GuiScreen.class:?]

at net.minecraft.client.gui.GuiScreen.handleInput(GuiScreen.java:323) ~[GuiScreen.class:?]

at net.minecraft.client.Minecraft.runTick(Minecraft.java:1731) ~[Minecraft.class:?]

... 21 more

---- Minecraft Crash Report ----

// Uh... Did I do that?

 

Time: 8/20/14 1:59 PM

Description: Updating screen events

 

java.lang.NullPointerException: Updating screen events

at com.mega.bir.client.interfaces.machine.ContainerMachine.onContainerClosed(ContainerMachine.java:163)

at net.minecraft.client.gui.inventory.GuiContainer.onGuiClosed(GuiContainer.java:733)

at net.minecraft.client.Minecraft.displayGuiScreen(Minecraft.java:847)

at net.minecraft.client.entity.EntityPlayerSP.closeScreen(EntityPlayerSP.java:356)

at net.minecraft.client.entity.EntityClientPlayerMP.closeScreenNoPacket(EntityClientPlayerMP.java:265)

at net.minecraft.client.entity.EntityClientPlayerMP.closeScreen(EntityClientPlayerMP.java:256)

at net.minecraft.client.gui.inventory.GuiContainer.keyTyped(GuiContainer.java:688)

at net.minecraft.client.gui.GuiScreen.handleKeyboardInput(GuiScreen.java:372)

at net.minecraft.client.gui.GuiScreen.handleInput(GuiScreen.java:323)

at net.minecraft.client.Minecraft.runTick(Minecraft.java:1731)

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1039)

at net.minecraft.client.Minecraft.run(Minecraft.java:961)

at net.minecraft.client.main.Main.main(Main.java:164)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at GradleStart.bounce(GradleStart.java:107)

at GradleStart.startClient(GradleStart.java:100)

at GradleStart.main(GradleStart.java:65)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)

 

 

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

---------------------------------------------------------------------------------------

 

-- Head --

Stacktrace:

at com.mega.bir.client.interfaces.machine.ContainerMachine.onContainerClosed(ContainerMachine.java:163)

at net.minecraft.client.gui.inventory.GuiContainer.onGuiClosed(GuiContainer.java:733)

at net.minecraft.client.Minecraft.displayGuiScreen(Minecraft.java:847)

at net.minecraft.client.entity.EntityPlayerSP.closeScreen(EntityPlayerSP.java:356)

at net.minecraft.client.entity.EntityClientPlayerMP.closeScreenNoPacket(EntityClientPlayerMP.java:265)

at net.minecraft.client.entity.EntityClientPlayerMP.closeScreen(EntityClientPlayerMP.java:256)

at net.minecraft.client.gui.inventory.GuiContainer.keyTyped(GuiContainer.java:688)

at net.minecraft.client.gui.GuiScreen.handleKeyboardInput(GuiScreen.java:372)

at net.minecraft.client.gui.GuiScreen.handleInput(GuiScreen.java:323)

 

-- Affected screen --

Details:

Screen name: com.mega.bir.client.interfaces.machine.GuiMachine

 

-- Affected level --

Details:

Level name: MpServer

All players: 1 total; [EntityClientPlayerMP['megabitus'/267, l='MpServer', x=186.68, y=70.62, z=131.87]]

Chunk stats: MultiplayerChunkCache: 1085, 1085

Level seed: 0

Level generator: ID 00 - default, ver 1. Features enabled: false

Level generator options:

Level spawn location: World: (256,64,128), Chunk: (at 0,4,0 in 16,8; contains blocks 256,0,128 to 271,255,143), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)

Level time: 90160 game time, 90160 day time

Level dimension: 0

Level storage version: 0x00000 - Unknown?

Level weather: Rain time: 0 (now: true), thunder time: 0 (now: false)

Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false

Forced entities: 92 total; [EntitySquid['Squid'/136, l='MpServer', x=248.50, y=60.16, z=190.22], EntityCreeper['Creeper'/3, l='MpServer', x=125.50, y=21.00, z=198.50], EntityCreeper['Creeper'/4, l='MpServer', x=120.50, y=21.00, z=195.50], EntitySkeleton['Skeleton'/5, l='MpServer', x=119.50, y=21.00, z=192.50], EntitySkeleton['Skeleton'/8, l='MpServer', x=135.53, y=18.00, z=201.38], EntitySquid['Squid'/128, l='MpServer', x=244.50, y=58.38, z=160.03], EntitySquid['Squid'/9, l='MpServer', x=156.50, y=52.38, z=136.34], EntityCreeper['Creeper'/11, l='MpServer', x=170.50, y=28.00, z=56.50], EntitySquid['Squid'/130, l='MpServer', x=247.69, y=61.38, z=195.47], EntityBat['Bat'/12, l='MpServer', x=175.89, y=22.64, z=52.51], EntitySquid['Squid'/132, l='MpServer', x=247.91, y=60.28, z=177.97], EntitySquid['Squid'/13, l='MpServer', x=172.49, y=54.00, z=135.34], EntityBat['Bat'/14, l='MpServer', x=178.44, y=17.10, z=199.50], EntityCreeper['Creeper'/152, l='MpServer', x=257.34, y=68.00, z=82.94], EntitySkeleton['Skeleton'/153, l='MpServer', x=264.69, y=66.00, z=97.78], EntitySkeleton['Skeleton'/154, l='MpServer', x=264.59, y=65.00, z=103.50], EntityPig['Pig'/155, l='MpServer', x=259.50, y=71.00, z=104.69], EntityCreeper['Creeper'/156, l='MpServer', x=265.41, y=65.00, z=105.00], EntityPig['Pig'/157, l='MpServer', x=263.91, y=67.00, z=122.97], EntitySpider['Spider'/23, l='MpServer', x=180.57, y=65.00, z=118.22], EntityCreeper['Creeper'/22, l='MpServer', x=183.00, y=66.00, z=123.56], EntityZombie['Zombie'/25, l='MpServer', x=186.53, y=46.00, z=155.94], EntitySkeleton['Skeleton'/24, l='MpServer', x=183.74, y=67.00, z=136.75], EntitySquid['Squid'/27, l='MpServer', x=191.06, y=57.63, z=169.94], EntityItem['item.tile.bir:interChest'/26, l='MpServer', x=182.81, y=58.13, z=148.81], EntitySquid['Squid'/29, l='MpServer', x=189.41, y=56.03, z=182.31], EntitySquid['Squid'/28, l='MpServer', x=185.81, y=57.25, z=173.50], EntitySquid['Squid'/31, l='MpServer', x=185.47, y=55.00, z=172.38], EntitySquid['Squid'/30, l='MpServer', x=182.75, y=58.00, z=187.91], EntityCreeper['Creeper'/34, l='MpServer', x=188.69, y=14.00, z=211.31], EntityZombie['Zombie'/32, l='MpServer', x=186.50, y=14.00, z=203.97], EntitySlime['Slime'/33, l='MpServer', x=183.22, y=16.00, z=195.22], EntityZombie['Zombie'/38, l='MpServer', x=197.63, y=19.00, z=53.06], EntityBat['Bat'/39, l='MpServer', x=198.17, y=20.83, z=51.60], EntityZombie['Zombie'/173, l='MpServer', x=261.63, y=35.00, z=210.06], EntitySpider['Spider'/42, l='MpServer', x=198.28, y=63.00, z=84.88], EntitySquid['Squid'/43, l='MpServer', x=203.28, y=50.00, z=104.25], EntityWitch['Witch'/41, l='MpServer', x=196.66, y=64.00, z=79.13], EntitySquid['Squid'/44, l='MpServer', x=207.50, y=50.34, z=111.28], EntityBat['Bat'/45, l='MpServer', x=199.75, y=45.10, z=161.75], EntityBat['Bat'/51, l='MpServer', x=217.57, y=22.74, z=51.89], EntityCreeper['Creeper'/55, l='MpServer', x=217.47, y=64.00, z=61.69], EntitySpider['Spider'/54, l='MpServer', x=211.50, y=65.00, z=60.28], EntityClientPlayerMP['megabitus'/267, l='MpServer', x=186.68, y=70.62, z=131.87], EntitySkeleton['Skeleton'/189, l='MpServer', x=262.73, y=62.30, z=139.65], EntitySquid['Squid'/59, l='MpServer', x=220.50, y=49.00, z=89.50], EntitySquid['Squid'/58, l='MpServer', x=220.09, y=49.00, z=90.66], EntitySpider['Spider'/57, l='MpServer', x=210.22, y=14.00, z=86.34], EntitySkeleton['Skeleton'/56, l='MpServer', x=210.22, y=14.17, z=86.34], EntitySquid['Squid'/63, l='MpServer', x=216.19, y=58.06, z=183.34], EntitySquid['Squid'/62, l='MpServer', x=215.56, y=57.38, z=182.19], EntityZombie['Zombie'/61, l='MpServer', x=221.50, y=26.00, z=165.50], EntitySquid['Squid'/60, l='MpServer', x=218.50, y=49.09, z=94.19], EntitySquid['Squid'/68, l='MpServer', x=214.50, y=49.00, z=190.50], EntitySquid['Squid'/69, l='MpServer', x=217.25, y=51.28, z=192.28], EntitySquid['Squid'/70, l='MpServer', x=222.59, y=54.38, z=195.69], EntitySquid['Squid'/71, l='MpServer', x=215.25, y=58.31, z=188.41], EntitySquid['Squid'/64, l='MpServer', x=216.56, y=58.34, z=188.06], EntitySquid['Squid'/65, l='MpServer', x=214.63, y=55.34, z=182.03], EntitySquid['Squid'/66, l='MpServer', x=208.78, y=51.09, z=180.63], EntitySquid['Squid'/67, l='MpServer', x=224.25, y=51.03, z=193.75], EntitySquid['Squid'/72, l='MpServer', x=222.25, y=59.34, z=194.84], EntitySquid['Squid'/73, l='MpServer', x=220.19, y=57.84, z=194.44], EntitySkeleton['Skeleton'/87, l='MpServer', x=232.00, y=17.00, z=63.50], EntitySquid['Squid'/93, l='MpServer', x=230.09, y=60.34, z=162.59], EntityBat['Bat'/92, l='MpServer', x=227.11, y=36.97, z=161.45], EntitySquid['Squid'/95, l='MpServer', x=226.94, y=56.28, z=164.25], EntitySquid['Squid'/94, l='MpServer', x=232.50, y=60.00, z=163.88], EntitySquid['Squid'/89, l='MpServer', x=232.44, y=58.91, z=157.41], EntityBat['Bat'/88, l='MpServer', x=244.56, y=26.40, z=79.50], EntitySquid['Squid'/91, l='MpServer', x=232.81, y=51.00, z=159.63], EntitySquid['Squid'/90, l='MpServer', x=239.81, y=59.25, z=156.16], EntitySquid['Squid'/100, l='MpServer', x=226.56, y=50.06, z=190.66], EntitySquid['Squid'/98, l='MpServer', x=242.09, y=61.34, z=165.72], EntitySquid['Squid'/99, l='MpServer', x=234.53, y=56.34, z=158.81], EntitySquid['Squid'/96, l='MpServer', x=232.84, y=56.34, z=176.06], EntitySquid['Squid'/97, l='MpServer', x=238.84, y=54.38, z=164.34], EntityWitch['Witch'/119, l='MpServer', x=254.41, y=76.00, z=65.47], EntityPig['Pig'/118, l='MpServer', x=255.50, y=71.00, z=75.06], EntityBat['Bat'/117, l='MpServer', x=240.93, y=28.36, z=79.49], EntityBat['Bat'/116, l='MpServer', x=243.75, y=26.10, z=75.50], EntityZombie['Zombie'/115, l='MpServer', x=244.44, y=24.00, z=79.22], EntityZombie['Zombie'/114, l='MpServer', x=243.34, y=24.00, z=73.34], EntitySquid['Squid'/127, l='MpServer', x=238.25, y=56.25, z=161.03], EntityZombie['Zombie'/5687, l='MpServer', x=191.50, y=18.00, z=52.50], EntitySquid['Squid'/126, l='MpServer', x=241.25, y=55.88, z=160.50], EntitySquid['Squid'/125, l='MpServer', x=247.50, y=60.13, z=156.34], EntityItem['item.tile.ice'/124, l='MpServer', x=242.13, y=55.13, z=115.19], EntityZombie['Zombie'/123, l='MpServer', x=260.58, y=67.00, z=92.56], EntityCow['Cow'/122, l='MpServer', x=253.31, y=65.00, z=110.16], EntitySkeleton['Skeleton'/121, l='MpServer', x=252.69, y=68.00, z=89.00], EntityZombie['Zombie'/120, l='MpServer', x=242.75, y=24.00, z=77.84]]

Retry entities: 0 total; []

Server brand: fml,forge

Server type: Integrated singleplayer server

Stacktrace:

at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:417)

at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2568)

at net.minecraft.client.Minecraft.run(Minecraft.java:982)

at net.minecraft.client.main.Main.main(Main.java:164)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at GradleStart.bounce(GradleStart.java:107)

at GradleStart.startClient(GradleStart.java:100)

at GradleStart.main(GradleStart.java:65)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)

 

-- System Details --

Details:

Minecraft Version: 1.7.10

Operating System: Windows 8.1 (amd64) version 6.3

Java Version: 1.7.0_67, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 818458368 bytes (780 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94

FML: MCP v9.05 FML v7.10.25.1207 Minecraft Forge 10.13.0.1207 4 mods loaded, 4 mods active

mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

FML{7.10.25.1207} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.0.1207.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Forge{10.13.0.1207} [Minecraft Forge] (forgeSrc-1.7.10-10.13.0.1207.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

BiR{1.7.10-1.0} [blocks & Items Revolution] (Blocks-Items-Revolution) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Launched Version: 1.7.10

LWJGL: 2.9.1

OpenGL: AMD Radeon R7 200 Series GL version 4.4.12967 Compatibility Profile Context 14.200.1004.0, ATI Technologies Inc.

GL Caps: Using GL 1.3 multitexturing.

Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.

Anisotropic filtering is supported and maximum anisotropy is 16.

Shaders are available because OpenGL 2.1 is supported.

 

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)

Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

Anisotropic Filtering: On (16)

#@!@# Game crashed! Crash report saved to: #@!@# F:\Dropbox\Codding, Modding\Moding\1.7\Blocks-Items-Revolution\run\.\crash-reports\crash-2014-08-20_13.59.03-client.txt

AL lib: (EE) alc_cleanup: 1 device not closed

 

Process finished with exit code -1

 

 

And here is my entire class: https://github.com/megabitus98/Blocks-Items-Revolution/blob/master/src/main/java/com/mega/bir/client/interfaces/machine/ContainerMachine.java

Woking at my first mod, Blocks & Items Revolution : https://github.com/megabitus98/Blocks-Items-Revolution

Link to comment
Share on other sites

Use getStackInSlotOnClosing(), not getStackInSlot(). The former removes the items after returning them. The later doesn't.

The vanilla crafting table does exactly what you're trying to do and it took 5 seconds to look up.

 

From ContainerWorkbench:

    public void onContainerClosed(EntityPlayer p_75134_1_)
    {
        super.onContainerClosed(p_75134_1_);

        if (!this.worldObj.isRemote)
        {
            for (int i = 0; i < 9; ++i)
            {
                ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i);

                if (itemstack != null)
                {
                    p_75134_1_.dropPlayerItemWithRandomChoice(itemstack, false);
                }
            }
        }
    }

 

EDIT: And your error above is because you never actually set worldObj, so it is null... I sense a lot more errors in the future.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.