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

    • that happens every time I enter a new dimension.
    • This is the last line before the crash: [ebwizardry]: Synchronising spell emitters for PixelTraveler But I have no idea what this means
    • What in particular? I barely used that mod this time around, and it's never been a problem in the past.
    • Im trying to build my mod using shade since i use the luaj library however i keep getting this error Reason: Task ':reobfJar' uses this output of task ':shadowJar' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. So i try adding reobfJar.dependsOn shadowJar  Could not get unknown property 'reobfJar' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. my gradle file plugins { id 'eclipse' id 'idea' id 'maven-publish' id 'net.minecraftforge.gradle' version '[6.0,6.2)' id 'com.github.johnrengelman.shadow' version '7.1.2' id 'org.spongepowered.mixin' version '0.7.+' } apply plugin: 'net.minecraftforge.gradle' apply plugin: 'org.spongepowered.mixin' apply plugin: 'com.github.johnrengelman.shadow' version = mod_version group = mod_group_id base { archivesName = mod_id } // Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17. java.toolchain.languageVersion = JavaLanguageVersion.of(17) //jarJar.enable() println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}" minecraft { mappings channel: mapping_channel, version: mapping_version copyIdeResources = true runs { configureEach { workingDirectory project.file('run') property 'forge.logging.markers', 'REGISTRIES' property 'forge.logging.console.level', 'debug' arg "-mixin.config=derp.mixin.json" mods { "${mod_id}" { source sourceSets.main } } } client { // Comma-separated list of namespaces to load gametests from. Empty = all namespaces. property 'forge.enabledGameTestNamespaces', mod_id } server { property 'forge.enabledGameTestNamespaces', mod_id args '--nogui' } gameTestServer { property 'forge.enabledGameTestNamespaces', mod_id } data { workingDirectory project.file('run-data') args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') } } } sourceSets.main.resources { srcDir 'src/generated/resources' } repositories { flatDir { dirs './libs' } maven { url = "https://jitpack.io" } } configurations { shade implementation.extendsFrom shade } dependencies { minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" implementation 'org.luaj:luaj-jse-3.0.2' implementation fg.deobf("com.github.Virtuoel:Pehkui:${pehkui_version}") annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' minecraftLibrary 'luaj:luaj-jse:3.0.2' shade 'luaj:luaj-jse:3.0.2' } // Example for how to get properties into the manifest for reading at runtime. tasks.named('jar', Jar).configure { manifest { attributes([ 'Specification-Title' : mod_id, 'Specification-Vendor' : mod_authors, 'Specification-Version' : '1', // We are version 1 of ourselves 'Implementation-Title' : project.name, 'Implementation-Version' : project.jar.archiveVersion, 'Implementation-Vendor' : mod_authors, 'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), "TweakClass" : "org.spongepowered.asm.launch.MixinTweaker", "TweakOrder" : 0, "MixinConfigs" : "derp.mixin.json" ]) } rename 'mixin.refmap.json', 'derp.mixin-refmap.json' } shadowJar { archiveClassifier = '' configurations = [project.configurations.shade] finalizedBy 'reobfShadowJar' } assemble.dependsOn shadowJar reobf { re shadowJar {} } publishing { publications { mavenJava(MavenPublication) { artifact jar } } repositories { maven { url "file://${project.projectDir}/mcmodsrepo" } } } my entire project:https://github.com/kevin051606/DERP-Mod/tree/Derp-1.0-1.20
  • Topics

×
×
  • Create New...

Important Information

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