Jump to content

Recommended Posts

Posted

Good day everybody.

Today i'm having problems with onItemRightClick.

Whenever player clicks on my item, it should disappear. But returning null causes these errors:

[12:43:52] [server thread/ERROR]: Encountered an unexpected exception
net.minecraft.util.ReportedException: Ticking memory connection
at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:198) ~[NetworkSystem.class:?]
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) ~[MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) ~[MinecraftServer.class:?]
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) ~[integratedServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) [MinecraftServer$2.class:?]
Caused by: java.lang.NullPointerException
at net.minecraft.server.management.ItemInWorldManager.tryUseItem(ItemInWorldManager.java:357) ~[itemInWorldManager.class:?]
at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:576) ~[NetHandlerPlayServer.class:?]
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:74) ~[C08PacketPlayerBlockPlacement.class:?]
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:122) ~[C08PacketPlayerBlockPlacement.class:?]
at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) ~[NetworkManager.class:?]
at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) ~[NetworkSystem.class:?]
... 5 more
[12:43:53] [server thread/ERROR]: This crash report has been saved to: C:\my\mcmodding\mods\armor sets\eclipse\.\crash-reports\crash-2015-12-20_12.43.52-server.txt
[12:43:53] [server thread/INFO]: Stopping server
[12:43:53] [server thread/INFO]: Saving players
[12:43:53] [server thread/INFO]: Saving worlds
[12:43:53] [server thread/INFO]: Saving chunks for level 'Test'/Overworld
[12:43:53] [server thread/INFO]: Saving chunks for level 'Test'/Nether
[12:43:53] [server thread/INFO]: Saving chunks for level 'Test'/The End
[12:43:53] [server thread/INFO] [FML]: Unloading dimension 0
[12:43:53] [server thread/INFO] [FML]: Unloading dimension -1
[12:43:53] [server thread/INFO] [FML]: Unloading dimension 1
[12:43:53] [server thread/INFO] [FML]: Applying holder lookups
[12:43:53] [server thread/INFO] [FML]: Holder lookups applied
[12:43:53] [server thread/INFO] [FML]: The state engine was in incorrect state SERVER_STOPPING and forced into state SERVER_STOPPED. Errors may have been discarded.
[12:43:54] [Client thread/FATAL]: Unreported exception thrown!
java.lang.NullPointerException
at net.minecraft.client.multiplayer.PlayerControllerMP.sendUseItem(PlayerControllerMP.java:440) ~[PlayerControllerMP.class:?]
at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1557) ~[Minecraft.class:?]
at net.minecraft.client.Minecraft.runTick(Minecraft.java:2044) ~[Minecraft.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1039) ~[Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:962) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_25]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_25]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_25]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_25]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]
at GradleStart.main(Unknown Source) [start/:?]
[12:43:54] [Client thread/INFO] [sTDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:388]: ---- Minecraft Crash Report ----
// Why is it breaking 

Time: 20.12.15 12:43
Description: Unexpected error

java.lang.NullPointerException: Unexpected error
at net.minecraft.client.multiplayer.PlayerControllerMP.sendUseItem(PlayerControllerMP.java:440)
at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1557)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:2044)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1039)
at net.minecraft.client.Minecraft.run(Minecraft.java:962)
at net.minecraft.client.main.Main.main(Main.java:164)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
at GradleStart.main(Unknown Source)


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

-- Head --
Stacktrace:
at net.minecraft.client.multiplayer.PlayerControllerMP.sendUseItem(PlayerControllerMP.java:440)
at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1557)

-- Affected level --
Details:
Level name: MpServer
All players: 1 total; [EntityClientPlayerMP['Player716'/613, l='MpServer', x=-1090,79, y=68,62, z=-177,77]]
Chunk stats: MultiplayerChunkCache: 605, 605
Level seed: 0
Level generator: ID 00 - default, ver 1. Features enabled: false
Level generator options: 
Level spawn location: World: (-1082,64,-193), Chunk: (at 6,4,15 in -68,-13; contains blocks -1088,0,-208 to -1073,255,-193), Region: (-3,-1; contains chunks -96,-32 to -65,-1, blocks -1536,0,-512 to -1025,255,-1)
Level time: 55862 game time, 85249 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: 237 total; [EntityCreeper['Creeper'/49, l='MpServer', x=-1170,03, y=18,00, z=-232,50], EntityCreeper['Creeper'/83, l='MpServer', x=-1158,50, y=20,00, z=-247,00], EntityCreeper['Creeper'/84, l='MpServer', x=-1160,44, y=22,00, z=-243,97], EntitySquid['Squid'/90, l='MpServer', x=-1151,88, y=47,19, z=-237,34], EntityClientPlayerMP['Player716'/613, l='MpServer', x=-1090,79, y=68,62, z=-177,77], EntityZombie['Zombie'/109, l='MpServer', x=-1167,50, y=12,00, z=-135,50], EntityCreeper['Creeper'/110, l='MpServer', x=-1162,00, y=14,00, z=-136,44], EntitySquid['Squid'/112, l='MpServer', x=-1151,13, y=39,31, z=-117,03], EntitySquid['Squid'/113, l='MpServer', x=-1152,47, y=36,00, z=-118,34], EntitySquid['Squid'/131, l='MpServer', x=-1144,94, y=44,34, z=-236,63], EntitySquid['Squid'/132, l='MpServer', x=-1136,03, y=43,78, z=-213,09], EntitySquid['Squid'/133, l='MpServer', x=-1145,22, y=37,00, z=-211,88], EntitySquid['Squid'/134, l='MpServer', x=-1144,16, y=46,34, z=-219,88], EntitySquid['Squid'/135, l='MpServer', x=-1141,03, y=45,34, z=-217,16], EntitySquid['Squid'/136, l='MpServer', x=-1143,31, y=43,88, z=-226,72], EntitySquid['Squid'/137, l='MpServer', x=-1135,81, y=39,03, z=-207,63], EntitySquid['Squid'/138, l='MpServer', x=-1136,66, y=47,34, z=-207,66], EntitySquid['Squid'/139, l='MpServer', x=-1140,31, y=47,34, z=-207,75], EntitySquid['Squid'/140, l='MpServer', x=-1141,38, y=47,34, z=-180,50], EntitySquid['Squid'/141, l='MpServer', x=-1150,69, y=55,97, z=-183,22], EntitySquid['Squid'/142, l='MpServer', x=-1149,19, y=42,19, z=-165,59], EntitySquid['Squid'/143, l='MpServer', x=-1142,94, y=45,91, z=-165,06], EntitySquid['Squid'/144, l='MpServer', x=-1132,88, y=41,34, z=-174,75], EntitySquid['Squid'/145, l='MpServer', x=-1151,66, y=49,28, z=-176,03], EntitySquid['Squid'/146, l='MpServer', x=-1154,38, y=45,03, z=-153,88], EntitySquid['Squid'/147, l='MpServer', x=-1148,72, y=49,34, z=-150,78], EntitySquid['Squid'/148, l='MpServer', x=-1141,41, y=43,25, z=-115,97], EntitySquid['Squid'/149, l='MpServer', x=-1144,16, y=40,94, z=-124,69], EntitySquid['Squid'/154, l='MpServer', x=-1129,16, y=44,91, z=-234,34], EntitySquid['Squid'/155, l='MpServer', x=-1128,69, y=48,16, z=-233,81], EntitySquid['Squid'/156, l='MpServer', x=-1124,41, y=44,34, z=-215,09], EntitySquid['Squid'/157, l='MpServer', x=-1132,66, y=48,38, z=-219,97], EntitySquid['Squid'/158, l='MpServer', x=-1136,88, y=52,78, z=-209,50], EntitySquid['Squid'/159, l='MpServer', x=-1132,63, y=56,88, z=-214,94], EntitySquid['Squid'/160, l='MpServer', x=-1119,25, y=59,34, z=-206,75], EntitySquid['Squid'/161, l='MpServer', x=-1117,91, y=43,81, z=-197,09], EntitySquid['Squid'/162, l='MpServer', x=-1125,72, y=52,34, z=-203,50], EntitySquid['Squid'/163, l='MpServer', x=-1116,69, y=54,06, z=-198,94], EntitySquid['Squid'/164, l='MpServer', x=-1137,94, y=62,16, z=-209,09], EntitySquid['Squid'/165, l='MpServer', x=-1134,75, y=57,34, z=-204,66], EntitySquid['Squid'/166, l='MpServer', x=-1131,31, y=60,19, z=-211,03], EntitySquid['Squid'/167, l='MpServer', x=-1126,19, y=50,38, z=-194,44], EntitySquid['Squid'/168, l='MpServer', x=-1127,38, y=48,31, z=-205,53], EntitySquid['Squid'/169, l='MpServer', x=-1120,66, y=46,38, z=-172,31], EntitySquid['Squid'/170, l='MpServer', x=-1120,63, y=48,31, z=-173,13], EntitySquid['Squid'/171, l='MpServer', x=-1119,16, y=41,91, z=-182,41], EntitySquid['Squid'/172, l='MpServer', x=-1124,97, y=47,38, z=-176,84], EntitySquid['Squid'/173, l='MpServer', x=-1123,28, y=48,72, z=-191,34], EntitySquid['Squid'/174, l='MpServer', x=-1116,16, y=41,78, z=-169,56], EntitySquid['Squid'/175, l='MpServer', x=-1126,41, y=42,91, z=-174,31], EntitySquid['Squid'/176, l='MpServer', x=-1121,53, y=51,38, z=-157,66], EntitySquid['Squid'/177, l='MpServer', x=-1126,41, y=48,22, z=-173,84], EntitySquid['Squid'/189, l='MpServer', x=-1104,22, y=54,34, z=-223,44], EntityEnderman['Enderman'/190, l='MpServer', x=-1109,38, y=20,00, z=-208,50], EntitySquid['Squid'/191, l='MpServer', x=-1099,41, y=47,38, z=-219,59], EntitySquid['Squid'/192, l='MpServer', x=-1102,88, y=49,25, z=-218,50], EntitySquid['Squid'/193, l='MpServer', x=-1110,72, y=57,81, z=-216,28], EntitySquid['Squid'/194, l='MpServer', x=-1113,97, y=50,28, z=-212,84], EntitySquid['Squid'/195, l='MpServer', x=-1110,34, y=47,03, z=-215,31], EntitySquid['Squid'/196, l='MpServer', x=-1117,53, y=51,88, z=-219,47], EntitySquid['Squid'/197, l='MpServer', x=-1114,69, y=60,13, z=-213,09], EntitySquid['Squid'/198, l='MpServer', x=-1109,03, y=54,09, z=-211,31], EntitySquid['Squid'/199, l='MpServer', x=-1119,31, y=52,28, z=-212,38], EntitySquid['Squid'/200, l='MpServer', x=-1114,44, y=54,25, z=-201,16], EntitySquid['Squid'/201, l='MpServer', x=-1116,03, y=55,16, z=-206,72], EntitySquid['Squid'/202, l='MpServer', x=-1113,18, y=47,41, z=-185,45], EntitySquid['Squid'/203, l='MpServer', x=-1107,48, y=47,21, z=-186,53], EntitySquid['Squid'/204, l='MpServer', x=-1124,47, y=44,94, z=-185,50], EntitySquid['Squid'/205, l='MpServer', x=-1116,22, y=42,91, z=-174,94], EntitySquid['Squid'/206, l='MpServer', x=-1119,59, y=46,34, z=-166,69], EntitySquid['Squid'/207, l='MpServer', x=-1114,94, y=43,84, z=-165,09], EntitySquid['Squid'/208, l='MpServer', x=-1118,50, y=45,28, z=-171,66], EntitySquid['Squid'/209, l='MpServer', x=-1116,31, y=47,34, z=-171,75], EntitySquid['Squid'/210, l='MpServer', x=-1124,28, y=46,31, z=-166,41], EntitySquid['Squid'/211, l='MpServer', x=-1119,16, y=47,34, z=-171,03], EntitySquid['Squid'/212, l='MpServer', x=-1113,50, y=43,25, z=-172,09], EntitySquid['Squid'/213, l='MpServer', x=-1112,84, y=44,84, z=-151,81], EntitySquid['Squid'/214, l='MpServer', x=-1106,19, y=47,34, z=-152,34], EntitySquid['Squid'/215, l='MpServer', x=-1108,03, y=46,72, z=-154,56], EntitySquid['Squid'/216, l='MpServer', x=-1118,50, y=46,38, z=-132,19], EntitySquid['Squid'/217, l='MpServer', x=-1107,13, y=44,28, z=-128,78], EntitySquid['Squid'/218, l='MpServer', x=-1104,16, y=43,38, z=-138,72], EntitySquid['Squid'/219, l='MpServer', x=-1102,69, y=40,00, z=-139,91], EntitySquid['Squid'/220, l='MpServer', x=-1100,75, y=37,91, z=-128,91], EntitySquid['Squid'/221, l='MpServer', x=-1110,69, y=40,34, z=-130,63], EntitySquid['Squid'/222, l='MpServer', x=-1105,13, y=46,25, z=-118,19], EntitySquid['Squid'/251, l='MpServer', x=-1100,72, y=51,31, z=-239,94], EntityCreeper['Creeper'/252, l='MpServer', x=-1102,50, y=31,00, z=-185,00], EntitySpider['Spider'/253, l='MpServer', x=-1101,19, y=32,00, z=-184,22], EntityCreeper['Creeper'/254, l='MpServer', x=-1094,50, y=31,00, z=-165,50], EntityCreeper['Creeper'/255, l='MpServer', x=-1090,50, y=31,00, z=-166,50], EntitySpider['Spider'/256, l='MpServer', x=-1087,53, y=25,00, z=-164,00], EntityBat['Bat'/257, l='MpServer', x=-1097,31, y=33,10, z=-170,31], EntityCreeper['Creeper'/258, l='MpServer', x=-1089,03, y=28,00, z=-151,63], EntitySquid['Squid'/259, l='MpServer', x=-1084,75, y=42,34, z=-150,06], EntitySquid['Squid'/260, l='MpServer', x=-1096,89, y=45,36, z=-159,50], EntityCreeper['Creeper'/261, l='MpServer', x=-1088,53, y=27,00, z=-138,69], EntityCreeper['Creeper'/262, l='MpServer', x=-1088,56, y=26,00, z=-133,00], EntityZombie['Zombie'/263, l='MpServer', x=-1088,47, y=26,00, z=-134,97], EntitySquid['Squid'/264, l='MpServer', x=-1091,28, y=41,34, z=-125,44], EntitySquid['Squid'/265, l='MpServer', x=-1098,69, y=46,34, z=-136,50], EntitySquid['Squid'/266, l='MpServer', x=-1088,72, y=40,09, z=-129,53], EntitySquid['Squid'/267, l='MpServer', x=-1099,91, y=51,13, z=-138,47], EntitySquid['Squid'/268, l='MpServer', x=-1082,13, y=49,34, z=-137,50], EntitySquid['Squid'/269, l='MpServer', x=-1106,84, y=47,88, z=-132,03], EntitySquid['Squid'/270, l='MpServer', x=-1103,63, y=37,25, z=-119,53], EntitySquid['Squid'/271, l='MpServer', x=-1099,06, y=43,16, z=-121,50], EntitySquid['Squid'/272, l='MpServer', x=-1093,41, y=46,94, z=-122,97], EntitySquid['Squid'/273, l='MpServer', x=-1089,94, y=49,34, z=-124,91], EntitySquid['Squid'/302, l='MpServer', x=-1081,75, y=52,34, z=-235,47], EntityBat['Bat'/307, l='MpServer', x=-1083,47, y=22,43, z=-226,40], EntityWitch['Witch'/308, l='MpServer', x=-1074,91, y=19,00, z=-206,50], EntityWitch['Witch'/309, l='MpServer', x=-1084,37, y=18,00, z=-205,91], EntityEnderman['Enderman'/310, l='MpServer', x=-1085,72, y=26,00, z=-156,75], EntityZombie['Zombie'/311, l='MpServer', x=-1080,25, y=24,00, z=-145,41], EntitySkeleton['Skeleton'/312, l='MpServer', x=-1082,44, y=26,00, z=-146,06], EntityBat['Bat'/313, l='MpServer', x=-1086,33, y=26,53, z=-157,39], EntitySquid['Squid'/314, l='MpServer', x=-1084,94, y=41,19, z=-155,50], EntitySquid['Squid'/315, l='MpServer', x=-1071,66, y=47,25, z=-155,50], EntitySquid['Squid'/316, l='MpServer', x=-1080,84, y=43,19, z=-151,94], EntitySquid['Squid'/317, l='MpServer', x=-1085,25, y=46,28, z=-156,99], EntitySquid['Squid'/318, l='MpServer', x=-1072,99, y=47,35, z=-158,96], EntitySquid['Squid'/319, l='MpServer', x=-1083,13, y=40,00, z=-143,47], EntitySquid['Squid'/320, l='MpServer', x=-1082,47, y=49,97, z=-142,06], EntityZombie['Zombie'/321, l='MpServer', x=-1073,91, y=24,00, z=-141,66], EntitySkeleton['Skeleton'/322, l='MpServer', x=-1072,53, y=25,00, z=-143,09], EntityCreeper['Creeper'/323, l='MpServer', x=-1087,44, y=26,00, z=-134,88], EntitySquid['Squid'/324, l='MpServer', x=-1075,09, y=44,34, z=-132,78], EntitySquid['Squid'/325, l='MpServer', x=-1086,34, y=44,31, z=-137,97], EntitySquid['Squid'/326, l='MpServer', x=-1090,06, y=46,28, z=-138,50], EntitySquid['Squid'/327, l='MpServer', x=-1088,91, y=34,34, z=-127,50], EntitySquid['Squid'/328, l='MpServer', x=-1089,53, y=41,34, z=-144,16], EntitySquid['Squid'/329, l='MpServer', x=-1090,88, y=48,34, z=-145,56], EntityZombie['Zombie'/330, l='MpServer', x=-1086,44, y=23,00, z=-126,22], EntitySquid['Squid'/331, l='MpServer', x=-1078,03, y=40,34, z=-117,16], EntitySquid['Squid'/332, l='MpServer', x=-1075,78, y=42,31, z=-119,22], EntitySquid['Squid'/333, l='MpServer', x=-1076,66, y=43,09, z=-126,59], EntitySquid['Squid'/334, l='MpServer', x=-1076,56, y=40,38, z=-118,63], EntitySquid['Squid'/335, l='MpServer', x=-1083,66, y=51,31, z=-123,28], EntitySquid['Squid'/336, l='MpServer', x=-1082,91, y=48,13, z=-127,19], EntitySquid['Squid'/337, l='MpServer', x=-1081,38, y=51,34, z=-118,53], EntitySquid['Squid'/338, l='MpServer', x=-1086,75, y=43,78, z=-112,16], EntitySquid['Squid'/339, l='MpServer', x=-1078,97, y=48,38, z=-116,44], EntityZombie['Zombie'/340, l='MpServer', x=-1072,38, y=11,00, z=-104,09], EntitySquid['Squid'/358, l='MpServer', x=-1060,75, y=46,78, z=-238,81], EntitySquid['Squid'/360, l='MpServer', x=-1063,38, y=38,06, z=-237,56], EntitySquid['Squid'/361, l='MpServer', x=-1063,25, y=44,34, z=-233,06], EntitySquid['Squid'/362, l='MpServer', x=-1063,94, y=43,06, z=-242,50], EntitySquid['Squid'/363, l='MpServer', x=-1052,66, y=45,69, z=-240,69], EntitySquid['Squid'/364, l='MpServer', x=-1058,56, y=49,38, z=-237,72], EntityBat['Bat'/365, l='MpServer', x=-1068,54, y=38,30, z=-189,75], EntityBat['Bat'/366, l='MpServer', x=-1067,65, y=37,62, z=-185,26], EntityBat['Bat'/367, l='MpServer', x=-1068,18, y=37,92, z=-188,31], EntitySquid['Squid'/368, l='MpServer', x=-1060,59, y=48,13, z=-187,38], EntityBat['Bat'/369, l='MpServer', x=-1071,44, y=33,12, z=-169,14], EntitySquid['Squid'/370, l='MpServer', x=-1063,44, y=42,16, z=-163,03], EntitySquid['Squid'/371, l='MpServer', x=-1071,50, y=41,78, z=-159,56], EntitySquid['Squid'/372, l='MpServer', x=-1067,50, y=43,16, z=-174,03], EntitySquid['Squid'/373, l='MpServer', x=-1052,81, y=46,00, z=-159,72], EntitySquid['Squid'/374, l='MpServer', x=-1059,56, y=46,34, z=-167,56], EntitySquid['Squid'/375, l='MpServer', x=-1069,64, y=44,91, z=-163,35], EntitySkeleton['Skeleton'/376, l='MpServer', x=-1069,41, y=25,00, z=-156,31], EntitySkeleton['Skeleton'/377, l='MpServer', x=-1067,69, y=24,00, z=-144,69], EntitySquid['Squid'/378, l='MpServer', x=-1066,56, y=52,31, z=-147,97], EntitySquid['Squid'/379, l='MpServer', x=-1064,97, y=49,31, z=-127,53], EntitySquid['Squid'/381, l='MpServer', x=-1067,63, y=45,31, z=-130,50], EntitySquid['Squid'/382, l='MpServer', x=-1054,63, y=37,88, z=-119,50], EntitySquid['Squid'/383, l='MpServer', x=-1066,47, y=51,34, z=-118,84], EntitySquid['Squid'/384, l='MpServer', x=-1053,31, y=48,31, z=-126,25], EntityZombie['Zombie'/386, l='MpServer', x=-1064,50, y=11,00, z=-103,50], EntityCreeper['Creeper'/387, l='MpServer', x=-1063,03, y=11,00, z=-106,56], EntityCreeper['Creeper'/388, l='MpServer', x=-1071,13, y=11,00, z=-100,78], EntityBat['Bat'/389, l='MpServer', x=-1060,47, y=13,10, z=-101,34], EntitySquid['Squid'/403, l='MpServer', x=-1050,69, y=42,84, z=-239,13], EntitySquid['Squid'/406, l='MpServer', x=-1045,13, y=42,34, z=-239,91], EntitySquid['Squid'/409, l='MpServer', x=-1046,50, y=53,31, z=-237,28], EntitySquid['Squid'/410, l='MpServer', x=-1042,63, y=39,34, z=-233,09], EntitySquid['Squid'/411, l='MpServer', x=-1057,44, y=44,16, z=-232,63], EntitySquid['Squid'/413, l='MpServer', x=-1050,81, y=36,34, z=-182,44], EntitySquid['Squid'/414, l='MpServer', x=-1050,06, y=41,34, z=-184,50], EntitySquid['Squid'/415, l='MpServer', x=-1053,59, y=38,94, z=-179,94], EntitySquid['Squid'/416, l='MpServer', x=-1056,50, y=40,72, z=-185,28], EntitySquid['Squid'/417, l='MpServer', x=-1049,28, y=41,06, z=-185,78], EntitySquid['Squid'/418, l='MpServer', x=-1044,97, y=45,34, z=-184,31], EntitySquid['Squid'/419, l='MpServer', x=-1050,25, y=51,28, z=-174,97], EntitySquid['Squid'/420, l='MpServer', x=-1047,50, y=31,72, z=-163,03], EntitySquid['Squid'/421, l='MpServer', x=-1052,94, y=42,75, z=-166,47], EntitySquid['Squid'/422, l='MpServer', x=-1047,34, y=50,38, z=-165,31], EntitySquid['Squid'/423, l='MpServer', x=-1055,03, y=51,31, z=-156,88], EntitySquid['Squid'/424, l='MpServer', x=-1055,34, y=55,31, z=-174,25], EntitySquid['Squid'/425, l='MpServer', x=-1058,06, y=50,31, z=-151,19], EntitySquid['Squid'/426, l='MpServer', x=-1046,34, y=45,03, z=-134,88], EntitySquid['Squid'/427, l='MpServer', x=-1050,78, y=40,06, z=-142,50], EntitySquid['Squid'/428, l='MpServer', x=-1053,53, y=43,13, z=-132,16], EntitySquid['Squid'/429, l='MpServer', x=-1055,59, y=42,38, z=-132,34], EntitySquid['Squid'/430, l='MpServer', x=-1048,56, y=39,38, z=-138,63], EntitySquid['Squid'/431, l='MpServer', x=-1050,84, y=42,16, z=-139,75], EntitySquid['Squid'/432, l='MpServer', x=-1053,50, y=48,88, z=-146,59], EntitySquid['Squid'/433, l='MpServer', x=-1044,09, y=53,34, z=-134,31], EntityZombie['Zombie'/434, l='MpServer', x=-1053,06, y=12,00, z=-119,31], EntityCreeper['Creeper'/435, l='MpServer', x=-1054,59, y=11,00, z=-119,06], EntityCreeper['Creeper'/436, l='MpServer', x=-1042,47, y=13,00, z=-114,06], EntitySquid['Squid'/437, l='MpServer', x=-1044,63, y=39,88, z=-116,22], EntitySquid['Squid'/438, l='MpServer', x=-1051,09, y=41,81, z=-121,25], EntitySquid['Squid'/440, l='MpServer', x=-1049,50, y=40,38, z=-129,88], EntitySquid['Squid'/441, l='MpServer', x=-1038,53, y=51,38, z=-123,50], EntitySquid['Squid'/442, l='MpServer', x=-1045,38, y=49,34, z=-114,56], EntitySquid['Squid'/443, l='MpServer', x=-1050,72, y=48,34, z=-123,97], EntityZombie['Zombie'/444, l='MpServer', x=-1051,47, y=12,00, z=-107,06], EntitySpider['Spider'/445, l='MpServer', x=-1043,28, y=14,00, z=-110,94], EntityCreeper['Creeper'/453, l='MpServer', x=-1035,50, y=20,00, z=-256,50], EntitySquid['Squid'/456, l='MpServer', x=-1025,50, y=43,13, z=-238,81], EntitySquid['Squid'/457, l='MpServer', x=-1026,34, y=51,31, z=-232,88], EntitySquid['Squid'/458, l='MpServer', x=-1032,56, y=54,38, z=-230,31], EntitySquid['Squid'/461, l='MpServer', x=-1029,50, y=54,13, z=-198,47], EntitySquid['Squid'/462, l='MpServer', x=-1030,38, y=57,22, z=-194,78], EntityBat['Bat'/463, l='MpServer', x=-1033,11, y=22,78, z=-174,64], EntitySquid['Squid'/464, l='MpServer', x=-1029,31, y=35,03, z=-176,50], EntitySpider['Spider'/465, l='MpServer', x=-1030,81, y=20,00, z=-153,53], EntitySquid['Squid'/466, l='MpServer', x=-1033,75, y=42,91, z=-136,41], EntitySquid['Squid'/467, l='MpServer', x=-1033,69, y=41,34, z=-134,31], EntitySquid['Squid'/468, l='MpServer', x=-1032,72, y=49,38, z=-140,50], EntitySquid['Squid'/469, l='MpServer', x=-1039,47, y=36,28, z=-129,03], EntitySquid['Squid'/470, l='MpServer', x=-1038,63, y=40,03, z=-119,19], EntitySquid['Squid'/471, l='MpServer', x=-1033,19, y=52,03, z=-120,25], EntitySquid['Squid'/472, l='MpServer', x=-1041,88, y=47,09, z=-124,88], EntitySquid['Squid'/473, l='MpServer', x=-1035,19, y=46,19, z=-115,06], EntitySquid['Squid'/474, l='MpServer', x=-1035,50, y=46,34, z=-111,78], EntitySquid['Squid'/477, l='MpServer', x=-1036,03, y=52,31, z=-131,22], EntityCreeper['Creeper'/497, l='MpServer', x=-1012,50, y=12,00, z=-199,63], EntitySkeleton['Skeleton'/503, l='MpServer', x=-1023,47, y=23,00, z=-185,13], EntitySkeleton['Skeleton'/505, l='MpServer', x=-1023,99, y=14,51, z=-167,48], EntityCreeper['Creeper'/507, l='MpServer', x=-1022,69, y=17,00, z=-148,74], EntityCreeper['Creeper'/508, l='MpServer', x=-1012,31, y=14,00, z=-157,56], EntitySkeleton['Skeleton'/509, l='MpServer', x=-1013,25, y=14,00, z=-157,50], EntitySkeleton['Skeleton'/510, l='MpServer', x=-1012,53, y=19,00, z=-148,06], EntityCreeper['Creeper'/511, l='MpServer', x=-1021,06, y=17,00, z=-153,53]]
Retry entities: 0 total; []
Server brand: fml,forge
Server type: Integrated singleplayer server
Stacktrace:
at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:415)
at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2566)
at net.minecraft.client.Minecraft.run(Minecraft.java:991)
at net.minecraft.client.main.Main.main(Main.java:164)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
at GradleStart.main(Unknown Source)

-- System Details --
Details:
Minecraft Version: 1.7.10
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.8.0_25, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 698013096 bytes (665 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94
FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1492 8 mods loaded, 8 mods active
States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
UCHIJAAAA	mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) 
UCHIJAAAA	FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1492-1.7.10.jar) 
UCHIJAAAA	Forge{10.13.4.1492} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1492-1.7.10.jar) 
UCHIJAAAA	CodeChickenCore{1.0.6.43} [CodeChicken Core] (minecraft.jar) 
UCHIJAAAA	NotEnoughItems{1.0.4.105} [Not Enough Items] (NotEnoughItems-1.7.10-1.0.4.105-universal.jar) 
UCHIJAAAA	Baubles{1.0.1.10} [baubles] (Baubles-deobf-1.7.10-1.0.1.10.jar) 
UCHIJAAAA	excore{1.3.1} [EXCore] (bin) 
UCHIJAAAA	armorsets{2.0} [Armor Sets] (bin) 
GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.4.13084 Compatibility Profile Context 14.301.1001.0' Renderer: 'AMD Radeon HD 8570D'
Launched Version: 1.7.10
LWJGL: 2.9.1
OpenGL: AMD Radeon HD 8570D GL version 4.4.13084 Compatibility Profile Context 14.301.1001.0, ATI Technologies Inc.
GL Caps: Using GL 1.3 multitexturing.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Anisotropic filtering is supported and maximum anisotropy is 16.
Shaders are available because OpenGL 2.1 is supported.

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: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Anisotropic Filtering: Off (1)
[12:43:54] [Client thread/INFO] [sTDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:398]: #@!@# Game crashed! Crash report saved to: #@!@# C:\my\mcmodding\mods\armor sets\eclipse\.\crash-reports\crash-2015-12-20_12.43.54-client.txt
AL lib: (EE) alc_cleanup: 1 device not closed
Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

So i tried using

player.setCurrentItemOrArmor(0, null);

and returing old item stack

But it works one time in two. Sometimes it disappears, sometimes it stays.

Here's my code:

	@Override
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) {
	if(hasPlayerItems(player)){
		ItemStack newItemstack = new ItemStack(this);
		ItemStack[] playerItems = getPlayerItems(player);
		setItems(newItemstack, playerItems);
		ItemStack[] items = getItems(itemstack);
		for(int i = 0; i < Math.min(items.length, playerItems.length); i++){
			playerItems[i] = items[i];
		}
		setPlayerItems(player, playerItems);
		return newItemstack;
	} else {
		ItemStack[] items = getItems(itemstack);
		ItemStack[] playerItems = getPlayerItems(player);
		for(int i = 0; i < Math.min(items.length, playerItems.length); i++){
			playerItems[i] = items[i];
		}
		setPlayerItems(player, playerItems);
		player.setCurrentItemOrArmor(0, null);
		return itemstack;
	}
}

Why for others returning null works (i read some topics and for them null works)? Why second way glitches? What am i missing?

Any help is appreciated.

 

Thanks for help!

If you have any questions - just ask!

Posted

The fuck is all of that code doing? Creating a new stack, then calling a method you didn't show us, then calling another method, then looping over an array...

 

If you want the item to disappear when right-clicked, do this:

 

@Override
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) {
	return null;
}

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

The fuck is all of that code doing? Creating a new stack, then calling a method you didn't show us, then calling another method, then looping over an array...

 

If you want the item to disappear when right-clicked, do this:

 

@Override
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) {
	return null;
}

Nope :(. Crash. Exactly the one that is shown in crash part. Even if i leave only

return null;

it crashes.

Posted

This is actually a bug in vanilla 1.7.10 it seems. It tries to check for null on the return value of

onItemRightClick

but the check is broken. So instead of returning

null

return the ItemStack you get passed in but set it's stackSize to 0. It will be nulled out.

I'll try that. Is it only 1.7.10 bug and i can without problems return null in 1.8?

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.