Jump to content

[Resolved][1.5.2] TileEntity container not doing anything upon right click


Recommended Posts

Posted

So in my friend and I's mod there is this machine that acts sort of like a crafting table but just for our mod items. Problem is it doesn't do anything upon a right click:

 

 

BlockScientificAssembler.java

 

  Reveal hidden contents

 

 

TileScientificAssembler.java

 

  Reveal hidden contents

 

ContainerScientificAssembler.java

 

  Reveal hidden contents

 

GuiScientificAssembler.java

 

  Reveal hidden contents

 

GuiHandler.java

 

  Reveal hidden contents

 

 

Right now we just want to get the block into an inventory, then do all the crafting logic.

If it helps I'll be commiting all of this stuff to our GitHub repository. https://github.com/DarthFeder/DiscoveryCraft

Also, there are no errors that I can see, it just doesn't do anything upon a right click of the block. and I have checked that it is a tile entity by pushing it with a piston, it checks out.

 

Edit: Sorry forgot to add the main class:

 

 

  Reveal hidden contents

 

 

Posted

I found an error: 2013-07-23 22:58:39 [sEVERE] [ForgeModLoader] A TileEntity type mods.minecraft.darth.dc.tileentity.TileScientificAssembler has throw an exception trying to write state. It will not persist. Report this to the mod author

java.lang.RuntimeException: class mods.minecraft.darth.dc.tileentity.TileScientificAssembler is missing a mapping! This is a bug!

at net.minecraft.tileentity.TileEntity.writeToNBT(TileEntity.java:105)

at mods.minecraft.darth.dc.tileentity.TileScientificAssembler.writeToNBT(TileScientificAssembler.java:133)

at net.minecraft.world.chunk.storage.AnvilChunkLoader.writeChunkToNBT(AnvilChunkLoader.java:316)

at net.minecraft.world.chunk.storage.AnvilChunkLoader.saveChunk(AnvilChunkLoader.java:127)

at net.minecraft.world.gen.ChunkProviderServer.safeSaveChunk(ChunkProviderServer.java:232)

at net.minecraft.world.gen.ChunkProviderServer.saveChunks(ChunkProviderServer.java:284)

at net.minecraft.world.WorldServer.saveAllChunks(WorldServer.java:906)

at net.minecraft.server.MinecraftServer.saveAllWorlds(MinecraftServer.java:345)

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:577)

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:127)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:469)

at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)

 

Posted

Thought TileDC.java would be good

 

  Reveal hidden contents

 

 

And BlockDC.java

 

 

  Reveal hidden contents

 

 

if you need any more classes check out the repo.

 

 

Posted

if you println right at the begining of "onBlockActivate" method, does it show ?

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

if (!world.isRemote)
            {
                TileScientificAssembler tile = (TileScientificAssembler) world.getBlockTileEntity(x, y, z);

                if (tile != null){
                	
                    player.openGui(DiscoveryCraft.instance, GuiIDs.ASSEMBLER1, world, x, y, z);
                    System.out.println(tile.toString());
                }
            }

 

btw this says that the gui will only be opened server side

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

Alright, I figured out why it wasn't doing anything, but now I have a crash that is stumping me.

 

---- Minecraft Crash Report ----
// Shall we play a game?

Time: 7/24/13 3:19 PM
Description: Ticking memory connection

java.lang.ArrayIndexOutOfBoundsException: 4
at net.minecraft.entity.player.InventoryPlayer.getStackInSlot(InventoryPlayer.java:635)
at net.minecraft.inventory.Slot.getStack(Slot.java:88)
at net.minecraft.inventory.Container.getInventory(Container.java:68)
at net.minecraft.inventory.Container.addCraftingToCrafters(Container.java:54)
at cpw.mods.fml.common.network.NetworkRegistry.openRemoteGui(NetworkRegistry.java:321)
at cpw.mods.fml.common.network.FMLNetworkHandler.openGui(FMLNetworkHandler.java:347)
at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2396)
at mods.minecraft.darth.dc.block.BlockScientificAssembler.onBlockActivated(BlockScientificAssembler.java:84)
at net.minecraft.item.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:412)
at net.minecraft.network.NetServerHandler.handlePlace(NetServerHandler.java:553)
at net.minecraft.network.packet.Packet15Place.processPacket(Packet15Place.java:79)
at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:89)
at net.minecraft.network.NetServerHandler.networkTick(NetServerHandler.java:134)
at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:53)
at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:109)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:675)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:571)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:127)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:469)
at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)


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

-- System Details --
Details:
Minecraft Version: 1.5.2
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_15, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 356614072 bytes (340 MB) / 457244672 bytes (436 MB) up to 3806593024 bytes (3630 MB)
JVM Flags: 0 total; 
AABB Pool Size: 3814 (213584 bytes; 0 MB) allocated, 3699 (207144 bytes; 0 MB) used
Suspicious classes: FML and Forge are installed
IntCache: cache: 0, tcache: 0, allocated: 1, tallocated: 63
FML: MCP v7.51 FML v5.2.6.696 Minecraft Forge 7.8.0.696 5 mods loaded, 5 mods active
mcp{7.44} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
FML{5.2.6.696} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Forge{7.8.0.696} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
CC{pralpha1} [CookingCraft] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
DC{pre1} [DiscoveryCraft] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Profiler Position: N/A (disabled)
Vec3 Pool Size: 1216 (68096 bytes; 0 MB) allocated, 1052 (58912 bytes; 0 MB) used
Player Count: 1 / 8; [EntityPlayerMP['Player703'/297, l='Test World', x=41.35, y=72.00, z=325.34]]
Type: Integrated Server (map_client.txt)
Is Modded: Definitely; Client brand changed to 'fml,forge'

 

you can see full changes I made at the github repo

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.