Список деревень

perevodchik

Каменная лига
Сообщения
2
Лучшие ответы
0
Симпатии
0
#1
Версия Minecraft
1.12.2
Подтверждение
Я максимально подробно описал проблему, включая исходный код файлов, краш лог, изображения и другую информацию, которая может помочь пользователям форума решить мой вопрос!
Всем привет. Когда вызываю event.getWorld().getVillageCollection().getVillageList() крашается майнкрафт, и кидает ошибку
[16:45:54] [main/FATAL] [minecraft/Minecraft]: Unreported exception thrown!
java.lang.NullPointerException: null
 
Краш-лог:
[16:45:52] [main/ERROR] [FML]: Exception caught during firing event net.minecraftforge.event.entity.player.PlayerInteractEvent$RightClickBlock@e9226e:
java.lang.NullPointerException: null
	at perevodchik.event.EventListener.rightClickBlock(EventListener.java:60) ~[EventListener.class:?]
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_17_EventListener_rightClickBlock_RightClickBlock.invoke(.dynamic) ~[?:?]
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?]
	at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) [EventBus.class:?]
	at net.minecraftforge.common.ForgeHooks.onRightClickBlock(ForgeHooks.java:1124) [ForgeHooks.class:?]
	at net.minecraft.client.multiplayer.PlayerControllerMP.processRightClickBlock(PlayerControllerMP.java:430) [PlayerControllerMP.class:?]
	at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1693) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.processKeyBinds(Minecraft.java:2380) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.runTickKeyboard(Minecraft.java:2146) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.runTick(Minecraft.java:1934) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1187) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:441) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
	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 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:25) [start/:?]
[16:45:52] [main/ERROR] [FML]: Index: 1 Listeners:
[16:45:52] [main/ERROR] [FML]: 0: NORMAL
[16:45:52] [main/ERROR] [FML]: 1: ASM: perevodchik.event.EventListener@1bd41d8 rightClickBlock(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$RightClickBlock;)V
[16:45:52] [Server thread/INFO] [net.minecraft.server.MinecraftServer]: Stopping server
[16:45:52] [Server thread/INFO] [net.minecraft.server.MinecraftServer]: Saving players
[16:45:52] [Server thread/INFO] [net.minecraft.server.MinecraftServer]: Saving worlds
[16:45:52] [Server thread/INFO] [net.minecraft.server.MinecraftServer]: Saving chunks for level 'Новый мир'/overworld
[16:45:53] [Server thread/INFO] [FML]: Unloading dimension 0
[16:45:54] [Server thread/INFO] [FML]: Applying holder lookups
[16:45:54] [Server thread/INFO] [FML]: Holder lookups applied
[16:45:54] [main/FATAL] [net.minecraft.client.Minecraft]: Unreported exception thrown!
java.lang.NullPointerException: null
	at perevodchik.event.EventListener.rightClickBlock(EventListener.java:60) ~[EventListener.class:?]
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_17_EventListener_rightClickBlock_RightClickBlock.invoke(.dynamic) ~[?:?]
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?]
	at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) ~[EventBus.class:?]
	at net.minecraftforge.common.ForgeHooks.onRightClickBlock(ForgeHooks.java:1124) ~[ForgeHooks.class:?]
	at net.minecraft.client.multiplayer.PlayerControllerMP.processRightClickBlock(PlayerControllerMP.java:430) ~[PlayerControllerMP.class:?]
	at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1693) ~[Minecraft.class:?]
	at net.minecraft.client.Minecraft.processKeyBinds(Minecraft.java:2380) ~[Minecraft.class:?]
	at net.minecraft.client.Minecraft.runTickKeyboard(Minecraft.java:2146) ~[Minecraft.class:?]
	at net.minecraft.client.Minecraft.runTick(Minecraft.java:1934) ~[Minecraft.class:?]
	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1187) ~[Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:441) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
	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 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:25) [start/:?]
[16:45:54] [main/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:629]: ---- Minecraft Crash Report ----
// Oh - I know what I did wrong!

Time: 12/6/18 4:45 PM
Description: Unexpected error

java.lang.NullPointerException: Unexpected error
	at perevodchik.event.EventListener.rightClickBlock(EventListener.java:60)
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_17_EventListener_rightClickBlock_RightClickBlock.invoke(.dynamic)
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
	at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
	at net.minecraftforge.common.ForgeHooks.onRightClickBlock(ForgeHooks.java:1124)
	at net.minecraft.client.multiplayer.PlayerControllerMP.processRightClickBlock(PlayerControllerMP.java:430)
	at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1693)
	at net.minecraft.client.Minecraft.processKeyBinds(Minecraft.java:2380)
	at net.minecraft.client.Minecraft.runTickKeyboard(Minecraft.java:2146)
	at net.minecraft.client.Minecraft.runTick(Minecraft.java:1934)
	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1187)
	at net.minecraft.client.Minecraft.run(Minecraft.java:441)
	at net.minecraft.client.main.Main.main(Main.java:118)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
	at GradleStart.main(GradleStart.java:25)

BlesseNtumble

Железная лига
Сообщения
696
Лучшие ответы
26
Симпатии
60
#2
Ну вероятно что лист пустой...
Он вроде заполняется в момент генерации деревни... т.е надо полетать, поискать деревни.
А в принте проверку на null сделать.
 
Сверху