-
-
Save anonymous/e1663ecee92313896e45 to your computer and use it in GitHub Desktop.
Got a problem by rightclicking the Item :/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package NLexicon.items; | |
import net.minecraft.client.renderer.texture.IconRegister; | |
import net.minecraft.creativetab.CreativeTabs; | |
import net.minecraft.entity.player.EntityPlayer; | |
import net.minecraft.inventory.IInventory; | |
import net.minecraft.item.Item; | |
import net.minecraft.item.ItemStack; | |
import net.minecraft.world.World; | |
import NLexicon.Lex_Main; | |
import cpw.mods.fml.common.network.FMLNetworkHandler; | |
import cpw.mods.fml.relauncher.Side; | |
import cpw.mods.fml.relauncher.SideOnly; | |
public class Lex_ItemLexicon extends Item implements IInventory { | |
public Lex_ItemLexicon(int id) { | |
super(id); | |
setCreativeTab(CreativeTabs.tabTools); | |
setMaxStackSize(1); | |
} | |
private static ItemStack[] slots = new ItemStack[1]; | |
@SideOnly(Side.CLIENT) | |
public void registerIcons(IconRegister iconRegister) | |
{ | |
this.itemIcon = iconRegister.registerIcon(Lex_Main.modid + ":" + this.getUnlocalizedName().substring(5)); | |
} | |
// public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) | |
// { | |
// if (!itemstack.equals(Lex_Main.lexicon)) return null; | |
// FMLNetworkHandler.openGui(player, Lex_Main.instance, Lex_Main.guiIdLexicon, world, (int) player.posX, (int) player.posY, (int) player.posZ); | |
// return itemstack; | |
// } | |
public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player) | |
{ | |
if (item != player.inventory.getCurrentItem()) return null; | |
player.openGui(Lex_Main.instance, Lex_Main.guiIdLexicon, world, (int)player.posX, (int)player.posY, (int)player.posZ); | |
return item; | |
} | |
public int getSizeInventory() { | |
return this.slots.length; | |
} | |
public ItemStack getStackInSlot(int slot) { | |
return slots[slot]; | |
} | |
public ItemStack decrStackSize(int i, int j) { | |
return null; | |
} | |
public ItemStack getStackInSlotOnClosing(int slot) { | |
return this.slots[slot] = null; | |
} | |
public void setInventorySlotContents(int slot, ItemStack itemstack) { | |
this.slots[slot] = null; | |
this.slots[slot] = itemstack.copy(); | |
} | |
public String getInvName() { | |
return null; | |
} | |
public boolean isInvNameLocalized() { | |
return false; | |
} | |
public int getInventoryStackLimit() { | |
return 64; | |
} | |
public void onInventoryChanged() { | |
} | |
public boolean isUseableByPlayer(EntityPlayer entityplayer) { | |
return true; | |
} | |
public void openChest() { | |
} | |
public void closeChest() { | |
} | |
public boolean isItemValidForSlot(int i, ItemStack itemstack) { | |
return true; | |
} | |
} | |
-=(*/ ERRORS BY RIGHT CLICKING THE ITEM *\)=- | |
---- Minecraft Crash Report ---- | |
// Quite honestly, I wouldn't worry myself about that. | |
Time: 09.11.13 17:25 | |
Description: Ticking memory connection | |
java.lang.ArrayIndexOutOfBoundsException: 4 | |
at net.minecraft.entity.player.InventoryPlayer.getStackInSlot(InventoryPlayer.java:658) | |
at net.minecraft.inventory.Slot.getStack(Slot.java:91) | |
at net.minecraft.inventory.Container.getInventory(Container.java:69) | |
at net.minecraft.inventory.Container.addCraftingToCrafters(Container.java:55) | |
at cpw.mods.fml.common.network.NetworkRegistry.openRemoteGui(NetworkRegistry.java:321) | |
at cpw.mods.fml.common.network.FMLNetworkHandler.openGui(FMLNetworkHandler.java:352) | |
at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2480) | |
at NLexicon.items.Lex_ItemLexicon.onItemRightClick(Lex_ItemLexicon.java:41) | |
at net.minecraft.item.ItemStack.useItemRightClick(ItemStack.java:176) | |
at net.minecraft.item.ItemInWorldManager.tryUseItem(ItemInWorldManager.java:353) | |
at net.minecraft.network.NetServerHandler.handlePlace(NetServerHandler.java:540) | |
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:141) | |
at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:54) | |
at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:109) | |
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:689) | |
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:585) | |
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:129) | |
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482) | |
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: | |
--------------------------------------------------------------------------------------- | |
-- Head -- | |
Stacktrace: | |
at net.minecraft.entity.player.InventoryPlayer.getStackInSlot(InventoryPlayer.java:658) | |
at net.minecraft.inventory.Slot.getStack(Slot.java:91) | |
at net.minecraft.inventory.Container.getInventory(Container.java:69) | |
at net.minecraft.inventory.Container.addCraftingToCrafters(Container.java:55) | |
at cpw.mods.fml.common.network.NetworkRegistry.openRemoteGui(NetworkRegistry.java:321) | |
at cpw.mods.fml.common.network.FMLNetworkHandler.openGui(FMLNetworkHandler.java:352) | |
at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2480) | |
at NLexicon.items.Lex_ItemLexicon.onItemRightClick(Lex_ItemLexicon.java:41) | |
at net.minecraft.item.ItemStack.useItemRightClick(ItemStack.java:176) | |
at net.minecraft.item.ItemInWorldManager.tryUseItem(ItemInWorldManager.java:353) | |
at net.minecraft.network.NetServerHandler.handlePlace(NetServerHandler.java:540) | |
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:141) | |
-- Ticking connection -- | |
Details: | |
Connection: net.minecraft.network.NetServerHandler@51330b8a | |
Stacktrace: | |
at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:54) | |
at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:109) | |
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:689) | |
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:585) | |
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:129) | |
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482) | |
at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) | |
-- System Details -- | |
Details: | |
Minecraft Version: 1.6.2 | |
Operating System: Windows 7 (amd64) version 6.1 | |
Java Version: 1.7.0_40, Oracle Corporation | |
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation | |
Memory: 746220752 bytes (711 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB) | |
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M | |
AABB Pool Size: 3534 (197904 bytes; 0 MB) allocated, 3371 (188776 bytes; 0 MB) used | |
Suspicious classes: FML and Forge are installed | |
IntCache: cache: 1, tcache: 0, allocated: 2, tallocated: 62 | |
FML: MCP v8.04 FML v6.2.62.871 Minecraft Forge 9.10.1.871 6 mods loaded, 6 mods active | |
mcp{8.04} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available | |
FML{6.2.62.871} [Forge Mod Loader] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available | |
Forge{9.10.1.871} [Minecraft Forge] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available | |
lexicon{Development 0.0.1} [Minecraft Lexicon] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available | |
nomatter{Development 0.0.1} [No Matter] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available | |
NM_TCon_CrossoverAddon{Development 0.0.1} [IC², TCon & NM Crossover Addon] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available | |
Profiler Position: N/A (disabled) | |
Vec3 Pool Size: 620 (34720 bytes; 0 MB) allocated, 584 (32704 bytes; 0 MB) used | |
Player Count: 1 / 8; [EntityPlayerMP['Player384'/304, l='New World', x=-252,91, y=64,00, z=183,19]] | |
Type: Integrated Server (map_client.txt) | |
Is Modded: Definitely; Client brand changed to 'fml,forge' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment