Jump to content

Recommended Posts

Posted

Hello,

i've tried to make a custom Gui with a Container and I followed the Tutorial in the Tutorials section of the MCForgeWiki (http://www.minecraftforge.net/wiki/Containers_and_GUIs)

I've made everything as in the Tutorial and didn't changed anything but the Names to get started.

 

But when I try to activate the Block I'm getting this Error:

 

2013-06-30 20:19:20 [iNFO] [sTDERR] net.minecraft.util.ReportedException: Ticking memory connection
2013-06-30 20:19:20 [iNFO] [sTDERR] 	at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:60)
2013-06-30 20:19:20 [iNFO] [sTDERR] 	at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:109)
2013-06-30 20:19:20 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:674)
2013-06-30 20:19:20 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:570)
2013-06-30 20:19:20 [iNFO] [sTDERR] 	at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:127)
2013-06-30 20:19:20 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:468)
2013-06-30 20:19:20 [iNFO] [sTDERR] 	at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
2013-06-30 20:19:20 [iNFO] [sTDERR] Caused by: java.lang.NullPointerException
2013-06-30 20:19:20 [iNFO] [sTDERR] 	at net.minecraft.inventory.Slot.getStack(Slot.java:88)
2013-06-30 20:19:20 [iNFO] [sTDERR] 	at net.minecraft.inventory.Container.getInventory(Container.java:68)
2013-06-30 20:19:20 [iNFO] [sTDERR] 	at net.minecraft.inventory.Container.addCraftingToCrafters(Container.java:54)
2013-06-30 20:19:20 [iNFO] [sTDERR] 	at cpw.mods.fml.common.network.NetworkRegistry.openRemoteGui(NetworkRegistry.java:321)
2013-06-30 20:19:20 [iNFO] [sTDERR] 	at cpw.mods.fml.common.network.FMLNetworkHandler.openGui(FMLNetworkHandler.java:347)
2013-06-30 20:19:20 [iNFO] [sTDERR] 	at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2388)
2013-06-30 20:19:20 [iNFO] [sTDERR] 	at busti2000.technica.block.SoulTableBlock.onBlockActivated(SoulTableBlock.java:85)
2013-06-30 20:19:20 [iNFO] [sTDERR] 	at net.minecraft.item.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:412)
2013-06-30 20:19:20 [iNFO] [sTDERR] 	at net.minecraft.network.NetServerHandler.handlePlace(NetServerHandler.java:553)
2013-06-30 20:19:20 [iNFO] [sTDERR] 	at net.minecraft.network.packet.Packet15Place.processPacket(Packet15Place.java:79)
2013-06-30 20:19:20 [iNFO] [sTDERR] 	at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:89)
2013-06-30 20:19:20 [iNFO] [sTDERR] 	at net.minecraft.network.NetServerHandler.networkTick(NetServerHandler.java:134)
2013-06-30 20:19:20 [iNFO] [sTDERR] 	at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:53)
2013-06-30 20:19:20 [iNFO] [sTDERR] 	... 6 more
2013-06-30 20:19:20 [sEVERE] [Minecraft-Server] Encountered an unexpected exception ReportedException
net.minecraft.util.ReportedException: Ticking memory connection
at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:60)
at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:109)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:674)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:570)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:127)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:468)
at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
Caused by: java.lang.NullPointerException
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:2388)
at busti2000.technica.block.SoulTableBlock.onBlockActivated(SoulTableBlock.java:85)
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)
... 6 more
2013-06-30 20:19:20 [sEVERE] [Minecraft-Server] This crash report has been saved to: C:\Users\Moritz\Desktop\mcp744\jars\.\crash-reports\crash-2013-06-30_20.19.20-server.txt
2013-06-30 20:19:20 [iNFO] [Minecraft-Server] Stopping server
2013-06-30 20:19:20 [iNFO] [Minecraft-Server] Saving players
2013-06-30 20:19:20 [iNFO] [Minecraft-Server] Saving worlds
2013-06-30 20:19:20 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Overworld
2013-06-30 20:19:20 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Nether
2013-06-30 20:19:20 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/The End
2013-06-30 20:19:20 [iNFO] [ForgeModLoader] Unloading dimension 0
2013-06-30 20:19:20 [iNFO] [ForgeModLoader] Unloading dimension -1
2013-06-30 20:19:20 [iNFO] [ForgeModLoader] Unloading dimension 1
2013-06-30 20:19:20 [sEVERE] [ForgeModLoader] Fatal errors were detected during the transition from SERVER_STARTED to SERVER_STOPPED. Loading cannot continue
2013-06-30 20:19:20 [sEVERE] [ForgeModLoader] 
mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available
FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available
Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available
Technica [Technica] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available
2013-06-30 20:19:20 [sEVERE] [ForgeModLoader] The ForgeModLoader state engine has become corrupted. Probably, a state was missed by and invalid modification to a base classForgeModLoader depends on. This is a critical error and not recoverable. Investigate any modifications to base classes outside ofForgeModLoader, especially Optifine, to see if there are fixes available.
2013-06-30 20:19:20 [iNFO] [sTDERR] Exception in thread "Server thread" java.lang.RuntimeException: The ForgeModLoader state engine is invalid
2013-06-30 20:19:20 [iNFO] [sTDERR] 	at cpw.mods.fml.common.LoadController.transition(LoadController.java:134)
2013-06-30 20:19:20 [iNFO] [sTDERR] 	at cpw.mods.fml.common.Loader.serverStopped(Loader.java:799)
2013-06-30 20:19:20 [iNFO] [sTDERR] 	at cpw.mods.fml.common.FMLCommonHandler.handleServerStopped(FMLCommonHandler.java:470)
2013-06-30 20:19:20 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:530)
2013-06-30 20:19:20 [iNFO] [sTDERR] 	at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
2013-06-30 20:19:21 [iNFO] [sTDERR] net.minecraft.util.ReportedException: Rendering screen
2013-06-30 20:19:21 [iNFO] [sTDERR] 	at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1030)
2013-06-30 20:19:21 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:867)
2013-06-30 20:19:21 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.run(Minecraft.java:756)
2013-06-30 20:19:21 [iNFO] [sTDERR] 	at java.lang.Thread.run(Unknown Source)
2013-06-30 20:19:21 [iNFO] [sTDERR] Caused by: java.lang.NullPointerException
2013-06-30 20:19:21 [iNFO] [sTDERR] 	at net.minecraft.inventory.Slot.getStack(Slot.java:88)
2013-06-30 20:19:21 [iNFO] [sTDERR] 	at net.minecraft.client.gui.inventory.GuiContainer.drawSlotInventory(GuiContainer.java:335)
2013-06-30 20:19:21 [iNFO] [sTDERR] 	at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:127)
2013-06-30 20:19:21 [iNFO] [sTDERR] 	at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1021)
2013-06-30 20:19:21 [iNFO] [sTDERR] 	... 3 more

 

 

What did I do wrong? The only line of this Error that belongs to my mod is this:

2013-06-30 20:19:20 [iNFO] [sTDERR] at busti2000.technica.block.SoulTableBlock.onBlockActivated(SoulTableBlock.java:85)

but my Code is the Same as in the Tutorial just with the Name of my mod:

entityplayer.openGui(Technica.instance, 1, world, x, y, z);

 

What can I do to fix this Error?

Thanks for any Help

 

Busti

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Posted

IGuiHandler code, please.

The GuiHandler is probably correct since it's erroring in the container, which only gets opened after GuiHandler. (Conclusion: Post your Container, but it doesn't hurt to post the GuiHandler as well).

Well, my only guess is that he had his GUI IDs wrong. Ah well.

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

Posted

Here is the Code:

it should be as in the Tutorial.

 

 

Container:

package busti2000.technica.gui;

import busti2000.technica.tileentity.TileEntitySoulTable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;

public class ContainerSoulTable extends Container {

protected TileEntitySoulTable tileentity;

public ContainerSoulTable(EntityPlayer entityplayer, TileEntitySoulTable te) {

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                    this.addSlotToContainer(new Slot(tileentity, j + i * 3, 62 + j * 18, 17 + i * 18));
            }
            
        }
        this.bindPlayerInventory(entityplayer.inventory);
}

    protected void bindPlayerInventory(InventoryPlayer inventoryPlayer) {
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 9; j++) {
                addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9,
                    8 + j * 18, 84 + i * 18));
            }
            
        }
        
        for (int i = 0; i < 9; i++) {
            addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142));
        }
        
    }

@Override
public boolean canInteractWith(EntityPlayer entityplayer) {
	return tileentity.isUseableByPlayer(entityplayer);
}

 @Override
     public ItemStack transferStackInSlot(EntityPlayer entityplayer, int slot) {
	 ItemStack stack = null;
	 Slot slotObject = (Slot) inventorySlots.get(slot);

	 if (slotObject != null && slotObject.getHasStack()) {
		 ItemStack stackInSlot = slotObject.getStack();
		 stack = stackInSlot.copy();

		 if (slot < 9) {
                 if (!this.mergeItemStack(stackInSlot, 0, 35, true)) {
                     return null;
                 }
                 
		 }

             else if (!this.mergeItemStack(stackInSlot, 0, 9, false)) {
                 return null;
             }

             if (stackInSlot.stackSize == 0) {
                 slotObject.putStack(null);
             } else {
                 slotObject.onSlotChanged();
             }

             if (stackInSlot.stackSize == stack.stackSize) {
                 return null;
             }
             slotObject.onPickupFromSlot(entityplayer, stackInSlot);

	 }
	 return stack;
 }

}

Gui Handler:

package busti2000.technica.gui;

import busti2000.technica.tileentity.TileEntitySoulTable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.IGuiHandler;

public class GuiHandler implements IGuiHandler {

public GuiHandler() {
	// TODO Auto-generated constructor stub
}

@Override
public Object getServerGuiElement(int ID, EntityPlayer entityplayer, World world, int x, int y, int z) {
	TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
	if(tileEntity instanceof TileEntitySoulTable){
            return new ContainerSoulTable(entityplayer, (TileEntitySoulTable) tileEntity);
        }
	return null;
}

@Override
public Object getClientGuiElement(int ID, EntityPlayer entityplayer, World world, int x, int y, int z) {
	TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
        if(tileEntity instanceof TileEntitySoulTable){
            return new GuiSoulTable(entityplayer, (TileEntitySoulTable) tileEntity);
        }
	return null;
}

}

 

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hello, I have this same problem. Did you manage to find a solution? Any help would be appreciated. Thanks.
    • log: https://mclo.gs/QJg3wYX as stated in the title, my game freezes upon loading into the server after i used a far-away waystone in it. The modpack i'm using is better minecraft V18. Issue only comes up in this specific server, singleplayer and other servers are A-okay. i've already experimented with removing possible culprits like modernfix and various others to no effect. i've also attempted a full reinstall of the modpack profile. Issue occurs shortly after the 'cancel' button dissapears on the 'loading world' section of the loading screen.   thanks in advance.
    • You would have better results asking a more specific question. What have you done? What exactly do you need help with? Please also read the FAQ regarding posting logs.
    • Hi, this is my second post with the same content as no one answered this and it's been a long time since I made the last post, I want to make a client-only mod, everything is ok, but when I use shaders, none of the textures rendered in RenderLevelStageEvent nor the crow entity model are rendered, I want them to be visible, because it's a horror themed mod I've already tried it with different shaders, but it didn't work with any of them and I really want to add support for shaders Here is how i render the crow model in the CrowEntityRenderer<CrowEntity>, by the time i use this method, i know is not the right method but i don't think this is the cause of the problem, the renderType i'm using is entityCutout @Override public void render(CrowEntity p_entity, float entityYaw, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource, int packedLight) { super.render(p_entity, entityYaw, partialTick, poseStack, bufferSource, packedLight); ClientEventHandler.getClient().crow.renderToBuffer(poseStack, bufferSource.getBuffer(ClientEventHandler.getClient().crow .renderType(TEXTURE)), packedLight, OverlayTexture.NO_OVERLAY, Utils.rgb(255, 255, 255)); } Here renderLevelStage @Override public void renderWorld(RenderLevelStageEvent e) { horrorEvents.draw(e); } Here is how i render every event public void draw(RenderLevelStageEvent e) { for (HorrorEvent event : currentHorrorEvents) { event.tick(e.getPartialTick()); event.draw(e); } } Here is how i render the crow model on the event @Override public void draw(RenderLevelStageEvent e) { if(e.getStage() == RenderLevelStageEvent.Stage.AFTER_ENTITIES) { float arcProgress = getArcProgress(0.25f); int alpha = (int) Mth.lerp(arcProgress, 0, 255); int packedLight = LevelRenderer.getLightColor(Minecraft.getInstance().level, blockPos); VertexConsumer builder = ClientEventHandler.bufferSource.getBuffer(crow); Crow<CreepyBirdHorrorEvent> model = ClientEventHandler .getClient().crow; model.setupAnim(this); RenderHelper.renderModelInWorld(model, position, offset, e.getCamera(), e.getPoseStack(), builder, packedLight, OverlayTexture.NO_OVERLAY, alpha); builder = ClientEventHandler.bufferSource.getBuffer(eyes); RenderHelper.renderModelInWorld(model, position, offset, e.getCamera(), e.getPoseStack(), builder, 15728880, OverlayTexture.NO_OVERLAY, alpha); } } How i render the model public static void renderModelInWorld(Model model, Vector3f pos, Vector3f offset, Camera camera, PoseStack matrix, VertexConsumer builder, int light, int overlay, int alpha) { matrix.pushPose(); Vec3 cameraPos = camera.getPosition(); double finalX = pos.x - cameraPos.x + offset.x; double finalY = pos.y - cameraPos.y + offset.y; double finalZ = pos.z - cameraPos.z + offset.z; matrix.pushPose(); matrix.translate(finalX, finalY, finalZ); matrix.mulPose(Axis.XP.rotationDegrees(180f)); model.renderToBuffer(matrix, builder, light, overlay, Utils .rgba(255, 255, 255, alpha)); matrix.popPose(); matrix.popPose(); } Thanks in advance
  • Topics

×
×
  • Create New...

Important Information

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