Jump to content

Custom Inventory not working correctly


Kwibble

Recommended Posts

Okay... So... It is working a * little * better. I am finding heaps of different bugs that were there before.

 

But here is an example of some of the problems.

https://onedrive.live.com/redir?resid=361B44D022EA75F6!253&authkey=!AL4JFYLRSZBE1qo&ithint=video%2c.mov

It appears that I can shift click... But it just 'phantomizes' the item and leaves the original in the slot you tried to move it from. I know this because I am getting errors saying that my IExtendedEntityProperties can't save because of null (I forgot to null check... Fixed that bit). But its good for error checking :P

We all stuff up sometimes... But I seem to be at the bottom of that pot.

Link to comment
Share on other sites

Do you know that default player inventory is mainly controlled from the client?

I think it is mainly related with this issue.

* For syncing inventory, Container#detectAndSendChanges will work.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Link to comment
Share on other sites

Just watched your video.

 

The only thing you show is the shift click problem.  If you drag the inventory with the cursor and drop it in place, does it work?

Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

It was hard to tell from my iphone.

 

I noticed in your code several referces to final and such that were unessesary.  Doubt that is the cause, but probably not a good idea.

Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

Well... Thats what copy paste gets you >.>

 

What I have done: COMPLETELY deleted everything to do with the GUI/what the GUI was for.

 

What I am going to do: Re implement it all so that it actually makes sense and works how it should... Then have another go at the GUI. Hopefully it could fix it (doubt it, but worth a shot).

We all stuff up sometimes... But I seem to be at the bottom of that pot.

Link to comment
Share on other sites

Now I have a very different and very interesting issue. ArrayIndexOutOfBounds :/

 

Crash Report:

---- Minecraft Crash Report ----
// On the bright side, I bought you a teddy bear!

Time: 7/2/14 4:22 PM
Description: Rendering screen

java.lang.ArrayIndexOutOfBoundsException: 4
at net.minecraft.entity.player.InventoryPlayer.getStackInSlot(InventoryPlayer.java:648)
at net.minecraft.inventory.Slot.getStack(Slot.java:88)
at net.minecraft.client.gui.inventory.GuiContainer.func_146977_a(GuiContainer.java:223)
at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:118)
at com.kwibble.dendri.client.gui.inventory.dendrikbelt.GuiTabMain.drawScreen(GuiTabMain.java:52)
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1145)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1025)
at net.minecraft.client.Minecraft.run(Minecraft.java:912)
at net.minecraft.client.main.Main.main(Main.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)


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

-- Head --
Stacktrace:
at net.minecraft.entity.player.InventoryPlayer.getStackInSlot(InventoryPlayer.java:648)
at net.minecraft.inventory.Slot.getStack(Slot.java:88)
at net.minecraft.client.gui.inventory.GuiContainer.func_146977_a(GuiContainer.java:223)
at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:118)
at com.kwibble.dendri.client.gui.inventory.dendrikbelt.GuiTabMain.drawScreen(GuiTabMain.java:52)

-- Screen render details --
Details:
Screen name: com.kwibble.dendri.client.gui.inventory.dendrikbelt.GuiTabMain
Mouse location: Scaled: (148, 48). Absolute: (300, 386)
Screen size: Scaled: (427, 240). Absolute: (854, 480). Scale factor of 2

-- Affected level --
Details:
Level name: MpServer
All players: 1 total; [EntityClientPlayerMP['Kwibble'/247, l='MpServer', x=150.11, y=72.62, z=216.79]]
Chunk stats: MultiplayerChunkCache: 225, 225
Level seed: 0
Level generator: ID 00 - default, ver 1. Features enabled: false
Level generator options: 
Level spawn location: World: (212,64,252), Chunk: (at 4,4,12 in 13,15; contains blocks 208,0,240 to 223,255,255), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
Level time: 164742 game time, 7673 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: 45 total; [EntityPig['Pig'/69, l='MpServer', x=124.50, y=76.00, z=140.69], EntityPig['Pig'/139, l='MpServer', x=224.19, y=69.00, z=174.53], EntityChicken['Chicken'/70, l='MpServer', x=119.03, y=68.00, z=168.72], EntityChicken['Chicken'/71, l='MpServer', x=117.16, y=70.00, z=185.53], EntityBat['Bat'/64, l='MpServer', x=105.07, y=42.67, z=252.05], EntityPig['Pig'/140, l='MpServer', x=224.25, y=72.00, z=185.97], EntityChicken['Chicken'/76, l='MpServer', x=136.44, y=70.00, z=175.75], EntityPig['Pig'/129, l='MpServer', x=211.38, y=82.00, z=200.03], EntityClientPlayerMP['Kwibble'/247, l='MpServer', x=150.11, y=72.62, z=216.79], EntityPig['Pig'/77, l='MpServer', x=130.75, y=73.00, z=161.53], EntityBat['Bat'/128, l='MpServer', x=210.06, y=16.43, z=171.59], EntityBat['Bat'/78, l='MpServer', x=130.02, y=33.30, z=241.75], EntityChicken['Chicken'/79, l='MpServer', x=131.38, y=62.30, z=285.75], EntityBat['Bat'/72, l='MpServer', x=131.25, y=16.80, z=233.65], EntityBat['Bat'/87, l='MpServer', x=152.43, y=18.55, z=222.98], EntityChicken['Chicken'/94, l='MpServer', x=164.05, y=68.00, z=211.93], EntityBat['Bat'/88, l='MpServer', x=156.78, y=22.10, z=229.78], EntityChicken['Chicken'/31, l='MpServer', x=72.44, y=76.00, z=296.53], EntityBat['Bat'/110, l='MpServer', x=177.47, y=26.10, z=232.47], EntityBat['Bat'/43, l='MpServer', x=93.38, y=24.10, z=139.25], EntityPig['Pig'/108, l='MpServer', x=185.94, y=66.00, z=207.16], EntityPig['Pig'/109, l='MpServer', x=188.97, y=66.00, z=214.03], EntityPig['Pig'/106, l='MpServer', x=180.56, y=74.00, z=155.31], EntityPig['Pig'/46, l='MpServer', x=93.84, y=68.00, z=145.44], EntityChicken['Chicken'/47, l='MpServer', x=81.56, y=73.00, z=147.44], EntityPig['Pig'/107, l='MpServer', x=185.50, y=77.00, z=186.31], EntityPig['Pig'/44, l='MpServer', x=87.25, y=64.00, z=139.53], EntityPig['Pig'/51, l='MpServer', x=94.53, y=65.00, z=206.50], EntityPig['Pig'/50, l='MpServer', x=90.50, y=63.00, z=189.80], EntityChicken['Chicken'/118, l='MpServer', x=198.72, y=64.38, z=214.19], EntityPig['Pig'/49, l='MpServer', x=96.53, y=67.00, z=171.69], EntityPig['Pig'/117, l='MpServer', x=199.66, y=81.00, z=177.50], EntityBat['Bat'/48, l='MpServer', x=85.44, y=17.89, z=172.58], EntityPig['Pig'/53, l='MpServer', x=93.03, y=64.00, z=208.50], EntitySheep['Sheep'/52, l='MpServer', x=92.91, y=63.00, z=217.41], EntitySheep['Sheep'/59, l='MpServer', x=108.56, y=64.00, z=163.44], EntityBat['Bat'/127, l='MpServer', x=210.58, y=16.05, z=163.13], EntityPig['Pig'/126, l='MpServer', x=219.25, y=74.00, z=151.69], EntityPig['Pig'/58, l='MpServer', x=99.78, y=67.00, z=148.50], EntitySheep['Sheep'/57, l='MpServer', x=101.06, y=68.00, z=141.56], EntityBat['Bat'/125, l='MpServer', x=215.41, y=18.10, z=148.72], EntitySheep['Sheep'/63, l='MpServer', x=98.53, y=67.00, z=237.56], EntityItem['item.item.porkchopRaw'/62, l='MpServer', x=99.88, y=41.13, z=204.88], EntityPig['Pig'/61, l='MpServer', x=104.19, y=46.00, z=194.63], EntityChicken['Chicken'/60, l='MpServer', x=104.59, y=65.00, z=170.56]]
Retry entities: 0 total; []
Server brand: fml,forge
Server type: Integrated singleplayer server
Stacktrace:
at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:412)
at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2524)
at net.minecraft.client.Minecraft.run(Minecraft.java:933)
at net.minecraft.client.main.Main.main(Main.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

-- System Details --
Details:
Minecraft Version: 1.7.2
Operating System: Mac OS X (x86_64) version 10.8.5
Java Version: 1.6.0_65, Apple Inc.
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Apple Inc.
Memory: 891961120 bytes (850 MB) / 1065025536 bytes (1015 MB) up to 1065025536 bytes (1015 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 11555 (647080 bytes; 0 MB) allocated, 589 (32984 bytes; 0 MB) used
IntCache: cache: 11, tcache: 0, allocated: 13, tallocated: 95
FML: MCP v9.03 FML v7.2.211.1121 Minecraft Forge 10.12.2.1121 4 mods loaded, 4 mods active
mcp{9.03} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
FML{7.2.211.1121} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.2.1121.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Forge{10.12.2.1121} [Minecraft Forge] (forgeSrc-1.7.2-10.12.2.1121.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
dendri{1.7.2_0.0.1} [Dendri] (ModuleDendri) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Launched Version: 1.7
LWJGL: 2.9.1
OpenGL: Intel HD Graphics 4000 OpenGL Engine GL version 2.1 INTEL-8.16.74, Intel Inc.
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: 777 (43512 bytes; 0 MB) allocated, 141 (7896 bytes; 0 MB) used
Anisotropic Filtering: Off (1)
#@!@# Game crashed! Crash report saved to: #@!@# /Volumes/Data/Users/102676/Developer/IDEA/MinecraftModding/MCCLIENT/./crash-reports/crash-2014-07-02_16.22.40-client.txt
Disconnected from the target VM, address: '127.0.0.1:52997', transport: 'socket'
AL lib: (EE) alc_cleanup: 1 device not closed

Process finished with exit code 255

 

But what is really confusing me is this. Here is the inventorySlots list:

41
Slot 0: com.kwibble.dendri.inventory.SlotDendrikBelt@460cb578
Slot 1: com.kwibble.dendri.inventory.dendrikbelt.SlotMistBottle@6c5dfd35
Slot 2: com.kwibble.dendri.inventory.dendrikbelt.SlotMistBottle@e9ada28
Slot 3: com.kwibble.dendri.inventory.dendrikbelt.SlotMistBottle@58687f95
Slot 4: com.kwibble.dendri.inventory.dendrikbelt.SlotMistBottle@34903c8b
Slot 5: net.minecraft.inventory.Slot@6976e4a2
Slot 6: net.minecraft.inventory.Slot@7c9c7dc5
Slot 7: net.minecraft.inventory.Slot@605506d
Slot 8: net.minecraft.inventory.Slot@46e32731
Slot 9: net.minecraft.inventory.Slot@6b222652
Slot 10: net.minecraft.inventory.Slot@f020871
Slot 11: net.minecraft.inventory.Slot@4e783a69
Slot 12: net.minecraft.inventory.Slot@3742ebbe
Slot 13: net.minecraft.inventory.Slot@a83234a
Slot 14: net.minecraft.inventory.Slot@2781d4aa
Slot 15: net.minecraft.inventory.Slot@3cb0f929
Slot 16: net.minecraft.inventory.Slot@6b611e0
Slot 17: net.minecraft.inventory.Slot@1b4f8c91
Slot 18: net.minecraft.inventory.Slot@3959199
Slot 19: net.minecraft.inventory.Slot@5089d5a5
Slot 20: net.minecraft.inventory.Slot@9296cf2
Slot 21: net.minecraft.inventory.Slot@7eaf8890
Slot 22: net.minecraft.inventory.Slot@362ee6ea
Slot 23: net.minecraft.inventory.Slot@413a2870
Slot 24: net.minecraft.inventory.Slot@5134f284
Slot 25: net.minecraft.inventory.Slot@6b1de1c2
Slot 26: net.minecraft.inventory.Slot@76d0be7e
Slot 27: net.minecraft.inventory.Slot@28a7f23
Slot 28: net.minecraft.inventory.Slot@52a0d422
Slot 29: net.minecraft.inventory.Slot@3cc72e8f
Slot 30: net.minecraft.inventory.Slot@38c1cd75
Slot 31: net.minecraft.inventory.Slot@3b97d96f
Slot 32: net.minecraft.inventory.Slot@6e4424f9
Slot 33: net.minecraft.inventory.Slot@3bd78ffd
Slot 34: net.minecraft.inventory.Slot@452e49bc
Slot 35: net.minecraft.inventory.Slot@61eaf91f
Slot 36: net.minecraft.inventory.Slot@9899472
Slot 37: net.minecraft.inventory.Slot@2770cd42
Slot 38: net.minecraft.inventory.Slot@5eb3bc48
Slot 39: net.minecraft.inventory.Slot@6a0e4b8a
Slot 40: net.minecraft.inventory.Slot@5081876b

 

As you can see my custom slot is at index 4. But it is trying to read from the player's inventory. Any ideas/suggestions?

We all stuff up sometimes... But I seem to be at the bottom of that pot.

Link to comment
Share on other sites

Okay, so I tried tweaking my Container class a bit... And I am getting the same problem as above. I have removed all my custom slots to see if I still get the index error, and of course I am...

 

Here is my current container code (ignore commented out lines):

package com.kwibble.dendri.inventory.dendrikbelt;

import com.kwibble.dendri.entity.player.PlayerInformation;
import com.kwibble.dendri.inventory.SlotDendrikBelt;
import com.kwibble.dendri.item.ItemDendrikBelt;
import com.kwibble.dendri.item.ItemMistBottle;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;

/**
* Created by Kwibble on 2/07/14.
*/
public class ContainerTabMain extends Container
{
private static final int INV_START = 0, INV_END = INV_START+26,
		HOTBAR_START = INV_END+1, HOTBAR_END = HOTBAR_START+8;

public ContainerTabMain(EntityPlayer player)
{
	PlayerInformation playerinfo = PlayerInformation.forPlayer(player);

//		playerinfo.setInventoryDendrikBelt(new InventoryDendrikBelt(player));
//		InventoryDendrikBelt beltInventory = playerinfo.getInventoryDendrikBelt();

	int i, j;

//		this.addSlotToContainer(new SlotDendrikBelt(beltInventory, 0, 62, );

//		for (i = 0; i < 4; ++i)
//		{
//			int x = 27;
//			int y = 0;
//			if (i > 0)
//			{
//				x = 28;
//				y = 1;
//			}
//			this.addSlotToContainer(new SlotMistBottle(beltInventory, 1 + i, 68 + (i * x) - y, 45));
//		}

	for (i = 0; i < 3; ++i)
	{
		for (j = 0; j < 9; ++j)
		{
			this.addSlotToContainer(new Slot(player.inventory, (j + (i + 1) * 9) + 5, 8 + j * 18, 84 + i * 18));
		}
	}

	for (i = 0; i < 9; ++i)
	{
		this.addSlotToContainer(new Slot(player.inventory, (i + 5), 8 + i * 18, 142));
	}
}

@Override
public boolean canInteractWith(EntityPlayer var1)
{
	return true;
}

@Override
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int slot_position)
{
	// Setup Variables
	ItemStack stack_return = null;
	// Get Current Slot
	Slot slot = (Slot)this.inventorySlots.get(slot_position);
	// Check to see if slot exists and if it has an item
	if (slot != null && slot.getHasStack())
	{
		// Get Current itemstack
		ItemStack stack_active = slot.getStack();
		// Put is stack memory
		stack_return = stack_active.copy();
//			if (stack_return.getItem() instanceof ItemDendrikBelt && !( (Slot) this.inventorySlots.get(0) ).getHasStack())
//			{
//				// Check for spot
//				if (!this.mergeItemStack(stack_active, 0, 1, false))
//				{
//					return null;
//				}
////				// Test for mist bottles
//			} else if (stack_return.getItem() instanceof ItemMistBottle && slot_position >= 1 && slot_position < INV_START) {
//				// Check for spot
//				if (!this.mergeItemStack(stack_active, 1, 5, false))
//				{
//					return null;
//				}
//				// Test for main inventory
	    if (slot_position >= INV_START && slot_position < INV_END + 1) {

			if (!this.mergeItemStack(stack_active, HOTBAR_START, HOTBAR_END, false)) {
				return null;
			}
			// Test for main bar
		}
		else if (slot_position >= HOTBAR_START && slot_position < HOTBAR_END + 1) {
			if (!this.mergeItemStack(stack_active, INV_START, INV_END, false)) {
				return null;
			}
			// Try and just combine in inventory
		} else if (!this.mergeItemStack(stack_active, INV_START, HOTBAR_END, false)) {
			return null;
		}
		// Check for zero size
		if (stack_active.stackSize == 0) {
			// Correct it to null
			slot.putStack(null);
		} else {
			// Notify of Change
			slot.onSlotChanged();
		}
		// Check for no change
		if (stack_active.stackSize == stack_return.stackSize) {
			return null;
		}
		// Notify that picking it up
		slot.onPickupFromSlot(par1EntityPlayer, stack_active);
	}
	// Return what is left
	return stack_return;
}
}

We all stuff up sometimes... But I seem to be at the bottom of that pot.

Link to comment
Share on other sites

And now instead I am getting a NPE:

---- Minecraft Crash Report ----
// I'm sorry, Dave.

Time: 6/07/14 2:48 PM
Description: Rendering item

java.lang.NullPointerException: Rendering item
at net.minecraft.item.ItemStack.getItemDamage(ItemStack.java:266)
at net.minecraft.client.renderer.entity.RenderItem.renderItemIntoGUI(RenderItem.java:415)
at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:560)
at net.minecraft.client.gui.inventory.GuiContainer.func_146977_a(GuiContainer.java:291)
at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:118)
at com.kwibble.dendri.client.gui.inventory.dendrikbelt.GuiTabMain.drawScreen(GuiTabMain.java:47)
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1145)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1024)
at net.minecraft.client.Minecraft.run(Minecraft.java:912)
at net.minecraft.client.main.Main.main(Main.java:112)
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)


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

-- Head --
Stacktrace:
at net.minecraft.item.ItemStack.getItemDamage(ItemStack.java:266)
at net.minecraft.client.renderer.entity.RenderItem.renderItemIntoGUI(RenderItem.java:415)

-- Item being rendered --
Details:
Item Type: null
Item Aux: ~~ERROR~~ NullPointerException: null
Item NBT: null
Item Foil: ~~ERROR~~ NullPointerException: null
Stacktrace:
at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:560)
at net.minecraft.client.gui.inventory.GuiContainer.func_146977_a(GuiContainer.java:291)
at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:118)
at com.kwibble.dendri.client.gui.inventory.dendrikbelt.GuiTabMain.drawScreen(GuiTabMain.java:47)

-- Screen render details --
Details:
Screen name: com.kwibble.dendri.client.gui.inventory.dendrikbelt.GuiTabMain
Mouse location: Scaled: (213, 119). Absolute: (427, 240)
Screen size: Scaled: (427, 240). Absolute: (854, 480). Scale factor of 2

-- Affected level --
Details:
Level name: MpServer
All players: 1 total; [EntityClientPlayerMP['Kwibble'/348, l='MpServer', x=154.01, y=72.62, z=212.71]]
Chunk stats: MultiplayerChunkCache: 225, 225
Level seed: 0
Level generator: ID 00 - default, ver 1. Features enabled: false
Level generator options: 
Level spawn location: World: (212,64,252), Chunk: (at 4,4,12 in 13,15; contains blocks 208,0,240 to 223,255,255), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
Level time: 78933 game time, 1067 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: 114 total; [EntityCreeper['Creeper'/29, l='MpServer', x=78.03, y=37.00, z=134.38], EntityPig['Pig'/33, l='MpServer', x=77.66, y=74.00, z=233.47], EntitySlime['Slime'/46, l='MpServer', x=82.69, y=40.00, z=134.69], EntitySheep['Sheep'/47, l='MpServer', x=83.88, y=70.00, z=143.53], EntityPig['Pig'/51, l='MpServer', x=89.13, y=64.00, z=225.03], EntityChicken['Chicken'/50, l='MpServer', x=80.53, y=69.00, z=212.47], EntityCreeper['Creeper'/49, l='MpServer', x=84.34, y=21.00, z=158.00], EntityCreeper['Creeper'/48, l='MpServer', x=88.50, y=22.00, z=158.50], EntityPig['Pig'/52, l='MpServer', x=88.44, y=90.00, z=273.47], EntityBat['Bat'/63, l='MpServer', x=99.52, y=31.00, z=141.46], EntityZombie['Zombie'/62, l='MpServer', x=115.13, y=33.00, z=156.50], EntityZombie['Zombie'/61, l='MpServer', x=108.78, y=33.00, z=154.50], EntityZombie['Zombie'/60, l='MpServer', x=107.66, y=33.00, z=155.53], EntityPig['Pig'/68, l='MpServer', x=97.03, y=68.00, z=205.28], EntitySkeleton['Skeleton'/69, l='MpServer', x=100.50, y=21.00, z=238.50], EntityCreeper['Creeper'/70, l='MpServer', x=96.50, y=19.00, z=236.50], EntityCreeper['Creeper'/71, l='MpServer', x=99.03, y=19.00, z=234.56], EntityCreeper['Creeper'/64, l='MpServer', x=105.97, y=20.00, z=160.53], EntityCreeper['Creeper'/65, l='MpServer', x=98.28, y=18.00, z=170.50], EntityPig['Pig'/66, l='MpServer', x=102.72, y=66.00, z=164.06], EntityCreeper['Creeper'/67, l='MpServer', x=104.50, y=45.00, z=194.69], EntityPig['Pig'/72, l='MpServer', x=106.53, y=72.00, z=239.47], EntityPig['Pig'/73, l='MpServer', x=101.50, y=69.00, z=242.31], EntityZombie['Zombie'/85, l='MpServer', x=114.00, y=33.00, z=155.63], EntityZombie['Zombie'/84, l='MpServer', x=113.31, y=33.00, z=154.72], EntityCreeper['Creeper'/87, l='MpServer', x=125.50, y=41.00, z=168.50], EntityCreeper['Creeper'/86, l='MpServer', x=114.56, y=14.00, z=169.97], EntityZombie['Zombie'/83, l='MpServer', x=119.26, y=28.00, z=137.69], EntityChicken['Chicken'/82, l='MpServer', x=127.47, y=73.00, z=137.34], EntityChicken['Chicken'/93, l='MpServer', x=117.44, y=71.00, z=189.44], EntitySkeleton['Skeleton'/92, l='MpServer', x=119.50, y=31.00, z=182.91], EntityZombie['Zombie'/95, l='MpServer', x=121.97, y=20.00, z=239.47], EntitySheep['Sheep'/94, l='MpServer', x=118.94, y=72.00, z=192.09], EntityBat['Bat'/89, l='MpServer', x=123.20, y=34.24, z=166.03], EntityZombie['Zombie'/88, l='MpServer', x=124.31, y=34.00, z=160.88], EntityChicken['Chicken'/91, l='MpServer', x=114.56, y=66.00, z=163.63], EntityPig['Pig'/90, l='MpServer', x=121.50, y=74.00, z=162.25], EntityZombie['Zombie'/102, l='MpServer', x=140.50, y=47.00, z=133.50], EntityZombie['Zombie'/100, l='MpServer', x=135.50, y=47.00, z=135.50], EntityZombie['Zombie'/101, l='MpServer', x=135.50, y=47.00, z=133.50], EntitySheep['Sheep'/98, l='MpServer', x=127.56, y=73.00, z=247.34], EntitySkeleton['Skeleton'/96, l='MpServer', x=125.91, y=16.00, z=230.50], EntityChicken['Chicken'/97, l='MpServer', x=124.41, y=76.00, z=227.56], EntitySpider['Spider'/110, l='MpServer', x=143.63, y=19.00, z=246.06], EntitySkeleton['Skeleton'/111, l='MpServer', x=139.56, y=30.00, z=249.13], EntitySkeleton['Skeleton'/108, l='MpServer', x=134.63, y=15.00, z=243.66], EntitySkeleton['Skeleton'/109, l='MpServer', x=143.16, y=20.00, z=240.59], EntityCreeper['Creeper'/106, l='MpServer', x=137.72, y=14.00, z=221.50], EntitySkeleton['Skeleton'/107, l='MpServer', x=132.31, y=14.00, z=236.38], EntityChicken['Chicken'/104, l='MpServer', x=131.53, y=74.00, z=145.47], EntityClientPlayerMP['Kwibble'/348, l='MpServer', x=154.01, y=72.62, z=212.71], EntityChicken['Chicken'/105, l='MpServer', x=138.47, y=71.00, z=161.53], EntityBat['Bat'/114, l='MpServer', x=140.25, y=50.10, z=279.25], EntityZombie['Zombie'/113, l='MpServer', x=128.28, y=32.00, z=242.25], EntityZombie['Zombie'/112, l='MpServer', x=140.48, y=34.00, z=245.00], EntityCreeper['Creeper'/137, l='MpServer', x=149.69, y=20.00, z=244.00], EntitySkeleton['Skeleton'/136, l='MpServer', x=149.03, y=20.00, z=245.38], EntityZombie['Zombie'/139, l='MpServer', x=158.69, y=44.79, z=275.69], EntitySkeleton['Skeleton'/138, l='MpServer', x=153.50, y=45.00, z=270.50], EntityCreeper['Creeper'/140, l='MpServer', x=152.94, y=48.00, z=282.44], EntityCow['Cow'/129, l='MpServer', x=159.09, y=74.00, z=153.19], EntityPig['Pig'/128, l='MpServer', x=152.97, y=71.00, z=134.91], EntityPig['Pig'/131, l='MpServer', x=145.88, y=72.00, z=181.16], EntitySheep['Sheep'/130, l='MpServer', x=141.69, y=72.00, z=143.22], EntityCreeper['Creeper'/133, l='MpServer', x=146.59, y=21.00, z=239.50], EntitySpider['Spider'/132, l='MpServer', x=152.50, y=18.00, z=222.97], EntitySkeleton['Skeleton'/135, l='MpServer', x=149.38, y=48.00, z=228.38], EntityCreeper['Creeper'/134, l='MpServer', x=158.56, y=22.00, z=233.03], EntityCreeper['Creeper'/152, l='MpServer', x=171.41, y=29.00, z=256.00], EntityBat['Bat'/153, l='MpServer', x=164.06, y=29.10, z=256.25], EntityBat['Bat'/148, l='MpServer', x=168.09, y=33.58, z=136.41], EntityChicken['Chicken'/149, l='MpServer', x=168.41, y=74.00, z=141.59], EntityPig['Pig'/150, l='MpServer', x=169.47, y=67.00, z=228.78], EntityCreeper['Creeper'/151, l='MpServer', x=160.59, y=21.00, z=231.38], EntitySkeleton['Skeleton'/171, l='MpServer', x=189.50, y=63.00, z=168.50], EntitySkeleton['Skeleton'/170, l='MpServer', x=176.69, y=25.00, z=168.63], EntityBat['Bat'/169, l='MpServer', x=186.10, y=26.05, z=132.10], EntityBat['Bat'/168, l='MpServer', x=188.50, y=26.10, z=148.34], EntityPig['Pig'/175, l='MpServer', x=187.31, y=77.00, z=174.09], EntityZombie['Zombie'/174, l='MpServer', x=185.56, y=31.00, z=184.09], EntityPig['Pig'/173, l='MpServer', x=187.53, y=82.00, z=174.66], EntitySkeleton['Skeleton'/172, l='MpServer', x=190.31, y=68.00, z=160.50], EntityCreeper['Creeper'/167, l='MpServer', x=189.50, y=24.00, z=153.50], EntityCreeper['Creeper'/166, l='MpServer', x=189.47, y=22.00, z=135.66], EntitySkeleton['Skeleton'/190, l='MpServer', x=205.09, y=21.00, z=162.41], EntityEnderman['Enderman'/191, l='MpServer', x=200.50, y=23.00, z=165.44], EntityEnderman['Enderman'/189, l='MpServer', x=198.69, y=26.25, z=153.44], EntityBat['Bat'/178, l='MpServer', x=191.15, y=42.39, z=274.29], EntityBat['Bat'/179, l='MpServer', x=183.49, y=43.37, z=290.00], EntityPig['Pig'/176, l='MpServer', x=185.34, y=68.00, z=201.53], EntitySpider['Spider'/177, l='MpServer', x=183.22, y=28.00, z=269.56], EntityPig['Pig'/207, l='MpServer', x=214.22, y=74.00, z=169.91], EntityBat['Bat'/206, l='MpServer', x=211.70, y=14.00, z=163.53], EntityPig['Pig'/201, l='MpServer', x=215.03, y=76.00, z=294.03], EntityPig['Pig'/200, l='MpServer', x=199.25, y=74.00, z=249.47], EntityPig['Pig'/197, l='MpServer', x=205.50, y=72.00, z=194.50], EntityBat['Bat'/196, l='MpServer', x=201.35, y=21.00, z=194.25], EntityPig['Pig'/199, l='MpServer', x=201.66, y=68.00, z=207.25], EntityPig['Pig'/198, l='MpServer', x=204.44, y=68.00, z=210.16], EntityCreeper['Creeper'/193, l='MpServer', x=200.50, y=24.00, z=162.13], EntityZombie['Zombie'/192, l='MpServer', x=200.31, y=23.00, z=167.13], EntityZombie['Zombie'/195, l='MpServer', x=207.50, y=21.00, z=186.50], EntityPig['Pig'/194, l='MpServer', x=201.69, y=78.00, z=168.22], EntityPig['Pig'/212, l='MpServer', x=219.06, y=75.00, z=233.22], EntityCreeper['Creeper'/213, l='MpServer', x=211.03, y=24.00, z=253.59], EntityPig['Pig'/214, l='MpServer', x=212.94, y=74.00, z=258.94], EntityPig['Pig'/215, l='MpServer', x=208.59, y=70.00, z=265.19], EntityChicken['Chicken'/208, l='MpServer', x=212.47, y=73.00, z=170.47], EntityChicken['Chicken'/209, l='MpServer', x=223.63, y=71.00, z=194.44], EntityPig['Pig'/210, l='MpServer', x=211.38, y=82.00, z=200.03], EntityChicken['Chicken'/211, l='MpServer', x=208.59, y=75.00, z=234.47], EntityPig['Pig'/228, l='MpServer', x=224.97, y=72.00, z=273.19], EntitySkeleton['Skeleton'/227, l='MpServer', x=230.50, y=61.00, z=272.09], EntityPig['Pig'/224, l='MpServer', x=228.50, y=76.00, z=137.31]]
Retry entities: 0 total; []
Server brand: fml,forge
Server type: Integrated singleplayer server
Stacktrace:
at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:412)
at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2523)
at net.minecraft.client.Minecraft.run(Minecraft.java:934)
at net.minecraft.client.main.Main.main(Main.java:112)
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)

 

Here is the updated code... Again:

https://gist.github.com/anonymous/c1e8a7fcc68d4ccf81bc

(Quite literally just made a constructor param for InventoryPlayer)

We all stuff up sometimes... But I seem to be at the bottom of that pot.

Link to comment
Share on other sites

Well, finally got rid of all crash reports...

 

Now I have it all semi-functioning. Items will randomly spaz about, you have to click the slot four slots to the right of the one you want... All in all, absolutely nothing wrong! (read with: extreme sarcasm)

 

Here is the updated code: https://gist.github.com/Kwibble/db0772be041a16f1145a

 

I honestly have no clue really what's different and what's made it start working that little bit better than before :/

We all stuff up sometimes... But I seem to be at the bottom of that pot.

Link to comment
Share on other sites

The reason you have to click 4 to the right is what i have been trying to get across several times.

 

You have the position of the slot in the GUI wrong.

 

n you container class, it if really is 4 slots (exactly) to the right, move the position you are specifying to the left 4 slots.  Probably a distance of 4x18 but it really depends what your graphic looks like.

 

The best way is to open up Gimp, find something that is in the right place, look at coords and determine how to change it.

Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

But the slots are all in the right place...? They white-ish/grey box that appears when you hover over a slot is in the correct position for every slot. I will try this, but it doesn't make any sense...

We all stuff up sometimes... But I seem to be at the bottom of that pot.

Link to comment
Share on other sites

Hold on that then. 

 

These graphic line ups can be tough.

 

So the item appears in the right box, the white hover thing is in the right box.

 

However, you have to click to the right of the item by 4 boxes to pick it up?

Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

Hold on that then. 

 

These graphic line ups can be tough.

 

So the item appears in the right box, the white hover thing is in the right box.

 

However, you have to click to the right of the item by 4 boxes to pick it up?

 

Pretty much, yep. But sometimes when you click on an "item" the all the items in the inventory spaz and move slots. Or they spaz and you end up holding some random item from your inventory.

We all stuff up sometimes... But I seem to be at the bottom of that pot.

Link to comment
Share on other sites

Let's try again.  Fingers crossed.

 

this.addSlotToContainer(new Slot(player.inventory, (j + (i + 1) * 9) + 5, 8 + j * 18, 84 + i * 18));

 

"(j + (i + 1) * 9) + 5" is wrong.  Should be "j + (i + 1) * 9".  The 5 is going to put it in the wrong place in your inventory.

 

Same thing with

 

this.addSlotToContainer(new Slot(player.inventory, (i + 5), 8 + i * 18, 142));

 

"(i + 5)" should just be "i". 

 

this is probably why you are off and having issues with out of bounds.  You are setting places in the players inventory that do not exists.  Why were you adding the 5?

 

Don't worry about the transferinventory part yet.  That is always painful and only matters when you shift click.

 

 

Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

Yeah, that +5 was when I was seriously being stupid... I don't have that anymore. And if you looked at my gist, you would have seen that I don't have that +5 there anymore.

We all stuff up sometimes... But I seem to be at the bottom of that pot.

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.