Jump to content

Recommended Posts

Posted

For now my mod is for client. The informations about nearest village player can see in my own gui.

Crash report indicates that with second line of the code below something is wrong.

        BetterWorldHandler handler = new BetterWorldHandler();
        BetterVillageCollection vlgc = handler.villageCollectionObj;

Posted

For now my mod is for client. The informations about nearest village player can see in my own gui.

Crash report indicates that with second line of the code below something is wrong.

        BetterWorldHandler handler = new BetterWorldHandler();
        BetterVillageCollection vlgc = handler.villageCollectionObj;

 

diesieben07 has said before, we need those crash reports to help you...

Posted
at BetterWorld.village.VillageInfo.build(VillageInfo.java:150) ~[VillageInfo.class:?]
at BetterWorld.gui.GuiVillageControler.<init>(GuiVillageControler.java:29) ~[GuiVillageControler.class:?]
at BetterWorld.BetterWorldGuiHandler.getClientGuiElement(BetterWorldGuiHandler.java:26) ~[betterWorldGuiHandler.class:?]
at cpw.mods.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:263) ~[NetworkRegistry.class:?]
at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:93) ~[FMLNetworkHandler.class:?]
at BetterWorld.blocks.BlockVillageControler.onBlockActivated(BlockVillageControler.java:21) ~[blockVillageControler.class:?]
at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:380) ~[PlayerControllerMP.class:?]
at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1497) ~[Minecraft.class:?]
at net.minecraft.client.Minecraft.runTick(Minecraft.java:2010) ~[Minecraft.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:995) ~[Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:910) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_60]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_60]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_60]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_60]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]

Posted

from console

[22:12:52] [Client thread/FATAL]: Unreported exception thrown!
java.lang.NullPointerException
at BetterWorld.village.VillageInfo.build(VillageInfo.java:150) ~[VillageInfo.class:?]
at BetterWorld.gui.GuiVillageControler.<init>(GuiVillageControler.java:29) ~[GuiVillageControler.class:?]
at BetterWorld.BetterWorldGuiHandler.getClientGuiElement(BetterWorldGuiHandler.java:26) ~[betterWorldGuiHandler.class:?]
at cpw.mods.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:263) ~[NetworkRegistry.class:?]
at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:93) ~[FMLNetworkHandler.class:?]
at BetterWorld.blocks.BlockVillageControler.onBlockActivated(BlockVillageControler.java:21) ~[blockVillageControler.class:?]
at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:380) ~[PlayerControllerMP.class:?]
at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1497) ~[Minecraft.class:?]
at net.minecraft.client.Minecraft.runTick(Minecraft.java:2010) ~[Minecraft.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:995) ~[Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:910) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_60]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_60]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_60]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_60]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]
---- Minecraft Crash Report ----
// This doesn't make any sense!

Time: 20.07.14 22:12
Description: Unexpected error

java.lang.NullPointerException: Unexpected error
at BetterWorld.village.VillageInfo.build(VillageInfo.java:150)
at BetterWorld.gui.GuiVillageControler.<init>(GuiVillageControler.java:29)
at BetterWorld.BetterWorldGuiHandler.getClientGuiElement(BetterWorldGuiHandler.java:26)
at cpw.mods.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:263)
at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:93)
at BetterWorld.blocks.BlockVillageControler.onBlockActivated(BlockVillageControler.java:21)
at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:380)
at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1497)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:2010)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:995)
at net.minecraft.client.Minecraft.run(Minecraft.java:910)
at net.minecraft.client.main.Main.main(Main.java:112)
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: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 BetterWorld.village.VillageInfo.build(VillageInfo.java:150)
at BetterWorld.gui.GuiVillageControler.<init>(GuiVillageControler.java:29)
at BetterWorld.BetterWorldGuiHandler.getClientGuiElement(BetterWorldGuiHandler.java:26)
at cpw.mods.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:263)
at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:93)
at BetterWorld.blocks.BlockVillageControler.onBlockActivated(BlockVillageControler.java:21)
at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:380)
at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1497)

-- Affected level --
Details:
Level name: MpServer
All players: 1 total; [EntityClientPlayerMP['Player894'/185, l='MpServer', x=-639,81, y=5,62, z=147,50]]
Chunk stats: MultiplayerChunkCache: 190, 190
Level seed: 0
Level generator: ID 01 - flat, ver 0. Features enabled: false
Level generator options: 
Level spawn location: World: (76,4,-83), Chunk: (at 12,0,13 in 4,-6; contains blocks 64,0,-96 to 79,255,-81), Region: (0,-1; contains chunks 0,-32 to 31,-1, blocks 0,0,-512 to 511,255,-1)
Level time: 41908 game time, 18151 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: 60 total; [EntityItem['item.item.rottenFlesh'/143, l='MpServer', x=-652,13, y=9,13, z=161,88], EntityVillager['Villager'/142, l='MpServer', x=-644,34, y=5,00, z=168,59], EntityVillager['Villager'/152, l='MpServer', x=-634,30, y=7,00, z=173,69], EntityVillager['Villager'/153, l='MpServer', x=-635,00, y=6,50, z=173,70], EntityVillager['Villager'/154, l='MpServer', x=-637,69, y=5,00, z=160,56], EntityVillager['Villager'/155, l='MpServer', x=-635,63, y=6,00, z=173,64], EntityVillager['Villager'/156, l='MpServer', x=-637,31, y=5,00, z=161,50], EntityWarior['entity.ModelWarior.name'/157, l='MpServer', x=-642,55, y=4,00, z=164,97], EntityVillager['Villager'/158, l='MpServer', x=-662,69, y=5,00, z=169,69], EntityVillager['Villager'/159, l='MpServer', x=-661,50, y=5,00, z=168,50], EntityArrow['arrow'/144, l='MpServer', x=-651,56, y=6,05, z=170,50], EntityArrow['arrow'/145, l='MpServer', x=-651,41, y=6,05, z=169,97], EntityArrow['arrow'/146, l='MpServer', x=-651,78, y=6,05, z=169,97], EntityArrow['arrow'/147, l='MpServer', x=-651,78, y=6,05, z=169,97], EntityArrow['arrow'/148, l='MpServer', x=-651,78, y=6,05, z=169,97], EntityXPOrb['Experience Orb'/149, l='MpServer', x=-20917,00, y=158,43, z=5355,00], EntityXPOrb['Experience Orb'/150, l='MpServer', x=-20878,00, y=158,43, z=5418,00], EntityVillager['Villager'/151, l='MpServer', x=-641,38, y=5,00, z=161,69], EntityBat['Bat'/171, l='MpServer', x=-649,19, y=6,10, z=132,75], EntityVillager['Villager'/170, l='MpServer', x=-677,31, y=5,00, z=169,31], EntityItem['item.item.carrots'/169, l='MpServer', x=-675,41, y=5,13, z=172,50], EntityItem['item.item.doorWood'/168, l='MpServer', x=-689,47, y=5,13, z=190,72], EntityBat['Bat'/175, l='MpServer', x=-648,75, y=7,71, z=133,40], EntityBat['Bat'/174, l='MpServer', x=-649,19, y=6,10, z=132,75], EntityVillager['Villager'/173, l='MpServer', x=-648,64, y=5,00, z=132,92], EntityVillager['Villager'/172, l='MpServer', x=-647,49, y=5,00, z=133,42], EntityBat['Bat'/163, l='MpServer', x=-662,75, y=6,10, z=181,25], EntityVillager['Villager'/162, l='MpServer', x=-665,67, y=5,00, z=172,31], EntityVillager['Villager'/161, l='MpServer', x=-661,84, y=5,00, z=172,50], EntityVillager['Villager'/160, l='MpServer', x=-663,03, y=5,00, z=172,50], EntityBat['Bat'/167, l='MpServer', x=-665,81, y=7,10, z=177,69], EntityVillager['Villager'/166, l='MpServer', x=-664,16, y=5,00, z=191,38], EntityVillager['Villager'/165, l='MpServer', x=-662,58, y=5,00, z=184,58], EntityVillager['Villager'/164, l='MpServer', x=-662,50, y=5,00, z=181,34], EntityItem['item.item.potato'/186, l='MpServer', x=-671,03, y=5,13, z=145,19], EntityClientPlayerMP['Player894'/185, l='MpServer', x=-639,81, y=5,62, z=147,50], EntityItem['item.item.rottenFlesh'/184, l='MpServer', x=-654,31, y=4,13, z=152,66], EntityItem['item.item.wheat'/190, l='MpServer', x=-674,38, y=5,13, z=149,25], EntityItem['item.item.potato'/191, l='MpServer', x=-673,13, y=5,13, z=145,84], EntityItem['item.item.seeds'/188, l='MpServer', x=-676,34, y=5,13, z=142,63], EntityItem['item.item.seeds'/189, l='MpServer', x=-673,09, y=5,13, z=131,03], EntityBat['Bat'/178, l='MpServer', x=-625,53, y=7,10, z=139,66], EntityVillager['Villager'/179, l='MpServer', x=-664,12, y=5,00, z=132,42], EntityBolt['entity.Bolt.name'/176, l='MpServer', x=-648,25, y=6,05, z=134,19], EntityBat['Bat'/177, l='MpServer', x=-627,75, y=7,10, z=139,25], EntityVillager['Villager'/180, l='MpServer', x=-663,11, y=5,00, z=132,35], EntityBat['Bat'/205, l='MpServer', x=-581,50, y=4,01, z=135,53], EntityBat['Bat'/204, l='MpServer', x=-608,37, y=6,80, z=220,61], EntityBat['Bat'/206, l='MpServer', x=-571,86, y=8,33, z=159,93], EntityItem['item.item.seeds'/201, l='MpServer', x=-624,72, y=5,13, z=192,91], EntityBat['Bat'/200, l='MpServer', x=-655,81, y=7,10, z=183,47], EntityBat['Bat'/203, l='MpServer', x=-591,38, y=8,40, z=221,72], EntityItem['item.item.wheat'/202, l='MpServer', x=-623,97, y=5,13, z=196,91], EntityVillager['Villager'/197, l='MpServer', x=-683,44, y=5,00, z=176,84], EntityBat['Bat'/196, l='MpServer', x=-683,25, y=7,10, z=176,25], EntityVillager['Villager'/198, l='MpServer', x=-684,44, y=5,00, z=176,31], EntityBat['Bat'/193, l='MpServer', x=-683,25, y=7,10, z=176,59], EntityItem['item.item.potato'/192, l='MpServer', x=-676,88, y=4,13, z=144,47], EntityBat['Bat'/195, l='MpServer', x=-684,25, y=8,10, z=177,69], EntityBat['Bat'/194, l='MpServer', x=-683,25, y=7,10, z=176,25]]
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:2522)
at net.minecraft.client.Minecraft.run(Minecraft.java:939)
at net.minecraft.client.main.Main.main(Main.java:112)
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:134)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

 

and from crash file

---- Minecraft Crash Report ----
// Daisy, daisy...

Time: 20.07.14 22:12
Description: Unexpected error

java.lang.NullPointerException: Unexpected error
at BetterWorld.village.VillageInfo.build(VillageInfo.java:150)
at BetterWorld.gui.GuiVillageControler.<init>(GuiVillageControler.java:29)
at BetterWorld.BetterWorldGuiHandler.getClientGuiElement(BetterWorldGuiHandler.java:26)
at cpw.mods.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:263)
at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:93)
at BetterWorld.blocks.BlockVillageControler.onBlockActivated(BlockVillageControler.java:21)
at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:380)
at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1497)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:2010)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:995)
at net.minecraft.client.Minecraft.run(Minecraft.java:910)
at net.minecraft.client.main.Main.main(Main.java:112)
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: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 BetterWorld.village.VillageInfo.build(VillageInfo.java:150)
at BetterWorld.gui.GuiVillageControler.<init>(GuiVillageControler.java:29)
at BetterWorld.BetterWorldGuiHandler.getClientGuiElement(BetterWorldGuiHandler.java:26)
at cpw.mods.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:263)
at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:93)
at BetterWorld.blocks.BlockVillageControler.onBlockActivated(BlockVillageControler.java:21)
at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:380)
at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1497)

-- Affected level --
Details:
Level name: MpServer
All players: 1 total; [EntityClientPlayerMP['Player894'/185, l='MpServer', x=-639,81, y=5,62, z=147,50]]
Chunk stats: MultiplayerChunkCache: 190, 190
Level seed: 0
Level generator: ID 01 - flat, ver 0. Features enabled: false
Level generator options: 
Level spawn location: World: (76,4,-83), Chunk: (at 12,0,13 in 4,-6; contains blocks 64,0,-96 to 79,255,-81), Region: (0,-1; contains chunks 0,-32 to 31,-1, blocks 0,0,-512 to 511,255,-1)
Level time: 41908 game time, 18151 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: 60 total; [EntityItem['item.item.rottenFlesh'/143, l='MpServer', x=-652,13, y=9,13, z=161,88], EntityVillager['Villager'/142, l='MpServer', x=-644,34, y=5,00, z=168,59], EntityVillager['Villager'/152, l='MpServer', x=-634,30, y=7,00, z=173,69], EntityVillager['Villager'/153, l='MpServer', x=-635,00, y=6,50, z=173,70], EntityVillager['Villager'/154, l='MpServer', x=-637,69, y=5,00, z=160,56], EntityVillager['Villager'/155, l='MpServer', x=-635,63, y=6,00, z=173,64], EntityVillager['Villager'/156, l='MpServer', x=-637,31, y=5,00, z=161,50], EntityWarior['entity.ModelWarior.name'/157, l='MpServer', x=-642,55, y=4,00, z=164,97], EntityVillager['Villager'/158, l='MpServer', x=-662,69, y=5,00, z=169,69], EntityVillager['Villager'/159, l='MpServer', x=-661,50, y=5,00, z=168,50], EntityArrow['arrow'/144, l='MpServer', x=-651,56, y=6,05, z=170,50], EntityArrow['arrow'/145, l='MpServer', x=-651,41, y=6,05, z=169,97], EntityArrow['arrow'/146, l='MpServer', x=-651,78, y=6,05, z=169,97], EntityArrow['arrow'/147, l='MpServer', x=-651,78, y=6,05, z=169,97], EntityArrow['arrow'/148, l='MpServer', x=-651,78, y=6,05, z=169,97], EntityXPOrb['Experience Orb'/149, l='MpServer', x=-20917,00, y=158,43, z=5355,00], EntityXPOrb['Experience Orb'/150, l='MpServer', x=-20878,00, y=158,43, z=5418,00], EntityVillager['Villager'/151, l='MpServer', x=-641,38, y=5,00, z=161,69], EntityBat['Bat'/171, l='MpServer', x=-649,19, y=6,10, z=132,75], EntityVillager['Villager'/170, l='MpServer', x=-677,31, y=5,00, z=169,31], EntityItem['item.item.carrots'/169, l='MpServer', x=-675,41, y=5,13, z=172,50], EntityItem['item.item.doorWood'/168, l='MpServer', x=-689,47, y=5,13, z=190,72], EntityBat['Bat'/175, l='MpServer', x=-648,75, y=7,71, z=133,40], EntityBat['Bat'/174, l='MpServer', x=-649,19, y=6,10, z=132,75], EntityVillager['Villager'/173, l='MpServer', x=-648,64, y=5,00, z=132,92], EntityVillager['Villager'/172, l='MpServer', x=-647,49, y=5,00, z=133,42], EntityBat['Bat'/163, l='MpServer', x=-662,75, y=6,10, z=181,25], EntityVillager['Villager'/162, l='MpServer', x=-665,67, y=5,00, z=172,31], EntityVillager['Villager'/161, l='MpServer', x=-661,84, y=5,00, z=172,50], EntityVillager['Villager'/160, l='MpServer', x=-663,03, y=5,00, z=172,50], EntityBat['Bat'/167, l='MpServer', x=-665,81, y=7,10, z=177,69], EntityVillager['Villager'/166, l='MpServer', x=-664,16, y=5,00, z=191,38], EntityVillager['Villager'/165, l='MpServer', x=-662,58, y=5,00, z=184,58], EntityVillager['Villager'/164, l='MpServer', x=-662,50, y=5,00, z=181,34], EntityItem['item.item.potato'/186, l='MpServer', x=-671,03, y=5,13, z=145,19], EntityClientPlayerMP['Player894'/185, l='MpServer', x=-639,81, y=5,62, z=147,50], EntityItem['item.item.rottenFlesh'/184, l='MpServer', x=-654,31, y=4,13, z=152,66], EntityItem['item.item.wheat'/190, l='MpServer', x=-674,38, y=5,13, z=149,25], EntityItem['item.item.potato'/191, l='MpServer', x=-673,13, y=5,13, z=145,84], EntityItem['item.item.seeds'/188, l='MpServer', x=-676,34, y=5,13, z=142,63], EntityItem['item.item.seeds'/189, l='MpServer', x=-673,09, y=5,13, z=131,03], EntityBat['Bat'/178, l='MpServer', x=-625,53, y=7,10, z=139,66], EntityVillager['Villager'/179, l='MpServer', x=-664,12, y=5,00, z=132,42], EntityBolt['entity.Bolt.name'/176, l='MpServer', x=-648,25, y=6,05, z=134,19], EntityBat['Bat'/177, l='MpServer', x=-627,75, y=7,10, z=139,25], EntityVillager['Villager'/180, l='MpServer', x=-663,11, y=5,00, z=132,35], EntityBat['Bat'/205, l='MpServer', x=-581,50, y=4,01, z=135,53], EntityBat['Bat'/204, l='MpServer', x=-608,37, y=6,80, z=220,61], EntityBat['Bat'/206, l='MpServer', x=-571,86, y=8,33, z=159,93], EntityItem['item.item.seeds'/201, l='MpServer', x=-624,72, y=5,13, z=192,91], EntityBat['Bat'/200, l='MpServer', x=-655,81, y=7,10, z=183,47], EntityBat['Bat'/203, l='MpServer', x=-591,38, y=8,40, z=221,72], EntityItem['item.item.wheat'/202, l='MpServer', x=-623,97, y=5,13, z=196,91], EntityVillager['Villager'/197, l='MpServer', x=-683,44, y=5,00, z=176,84], EntityBat['Bat'/196, l='MpServer', x=-683,25, y=7,10, z=176,25], EntityVillager['Villager'/198, l='MpServer', x=-684,44, y=5,00, z=176,31], EntityBat['Bat'/193, l='MpServer', x=-683,25, y=7,10, z=176,59], EntityItem['item.item.potato'/192, l='MpServer', x=-676,88, y=4,13, z=144,47], EntityBat['Bat'/195, l='MpServer', x=-684,25, y=8,10, z=177,69], EntityBat['Bat'/194, l='MpServer', x=-683,25, y=7,10, z=176,25]]
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:2522)
at net.minecraft.client.Minecraft.run(Minecraft.java:939)
at net.minecraft.client.main.Main.main(Main.java:112)
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:134)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

 

class which makes informations from villages

public static VillageInfo build() {

    Minecraft mc = FMLClientHandler.instance().getClient();
        if(mc == null || mc.thePlayer == null){         
            return null;
        }

	EntityPlayer player = mc.thePlayer;

        WorldServer worldServer = DimensionManager.getWorld(player.dimension);

        if(worldServer == null)
        {
            return null;
        }

        VillageInfo ret = new VillageInfo();
        BetterWorldHandler handler = new BetterWorldHandler();

        BetterVillageCollection vlgc = handler.villageCollectionObj;
        BetterVillage closestVillage = vlgc.findNearestVillage(
                MathHelper.floor_double(player.posX),
                MathHelper.floor_double(player.posY),
                MathHelper.floor_double(player.posZ), 32);

        if(closestVillage == null){
            ret.villageFound = false;
            return ret;
        }

        ret.numGolems = getNumGolems(worldServer, closestVillage);
        ret.numWariors = getNumWariors(worldServer, closestVillage);
        ChunkCoordinates center = closestVillage.getCenter();
        ret.centerX = center.posX;
        ret.centerY = center.posY;
        ret.centerZ = center.posZ;
        ret.numDoors = closestVillage.getNumVillageDoors();
        ret.numVillagers = closestVillage.getNumVillagers();
        ret.radius = closestVillage.getVillageRadius();
        ret.reputation = closestVillage.getReputationForPlayer(player.getCommandSenderName());
        ret.areBreeding = closestVillage.isMatingSeason();
        ret.id = closestVillage.hashCode();
        ret.villageFound = true;
        return ret;
    }   

 

and code in my gui for getting info. from class up

//int population is showing by the gui

public GuiVillageControler()
{
	VillageInfo tmp = VillageInfo.build();
	this.population = tmp.getNumVillagers();
}

 

 

Posted

at BetterWorld.village.VillageInfo.build(VillageInfo.java:150)

Can you post which line this is in your class?

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

Seems like

handler.[b]villageCollectionObj[/b]

is null. How do you initialize this field?

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted
public class BetterWorldHandler
{
public BetterWorldHandler()
{

}

public BetterVillageCollection villageCollectionObj;

@SubscribeEvent
public void someEventMethod(WorldEvent event) 
{	               
        BetterVillageCollection villagecollection = (BetterVillageCollection)event.world.perWorldStorage.loadData(BetterVillageCollection.class, "bettervillages");
        
        if (villagecollection == null)
        {
            this.villageCollectionObj = new BetterVillageCollection(event.world);
            event.world.perWorldStorage.setData("bettervillages", this.villageCollectionObj);
        }
        else
        {
            this.villageCollectionObj = villagecollection;
            this.villageCollectionObj.func_82566_a(event.world);
        }
}

}

Posted

I think you are trying to get the villageCollectionObj before the WorldEvent has been posted, thus it hasn't been initialised and is null, so you get a NPE.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

  • 2 weeks later...
Posted

I have fixed the error.

Now I can open my GUI without crash but still sth doesn't work because despite my block is in center of some village, no stats shows in gui.

 

Now I am trying to find the wrong code, probably sth is wrong with searching doors.

 

Searching for a long time I have noticed that Vanilla village has additional code in the WorldServer.class

public void tick()
{
...
        this.theProfiler.endStartSection("village");
        this.villageCollectionObj.tick();
...

I must try to code the second line somehow.

Posted

I made TickHandler and now my village tick() as it should.Now I am sure that sth is wrong with doors. The size of doorslist is 0.

Do you know why my code needs some changes despite it is the same as Vanilla?

Posted

If I think that client doesn't know population of village or number of doors, only server does so you need to get that from server side. You see, gui you open is on client side so if you get village info from gui (not from container for example which is in server side) you won't get correct info.

Posted

My GUI works fine.Doing tests I have noticed that village can't create, that's why in GUI is only 0.

Searching more I have found that villageList = 0 and here is my question. Does enybody know why despite Vanilla code there is so much problems with village?

 

I am stuck with some strange problem with villagerPositionsList, maybe because it's a black hole.

In that stage I need to fine some person who knows about village code everything or very much.

  • 2 weeks later...
Posted

No one wants to help me privately so I am passed on this topic. :(

 

So, to create village nearby doors must be detected.To detect doors chunk coordinates must be gathered from villagerPositionsList

Here are the methods in which coordinates are saved to list.

The problem is that these methods looks like dead end.Does somebody know what must be changed or is it realy the DEAD END?

 

I fink that I don't need any help.I changed method in which doors are detected.Now I can get cords of nearest villages, so my code works :)

Thanks for good help and time spent to help with my project.Today I corect few things and in my GUI I can see info about village.Now my target is to search what makes strange lags and embark on with project.

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

    • Version 1.19 - Forge 41.0.63 I want to create a wolf entity that I can ride, so far it seems to be working, but the problem is that when I get on the wolf, I can’t control it. I then discovered that the issue is that the server doesn’t detect that I’m riding the wolf, so I’m struggling with synchronization. However, it seems to not be working properly. As I understand it, the server receives the packet but doesn’t register it correctly. I’m a bit new to Java, and I’ll try to provide all the relevant code and prints *The comments and prints are translated by chatgpt since they were originally in Spanish* Thank you very much in advance No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. MountableWolfEntity package com.vals.valscraft.entity; import com.vals.valscraft.network.MountSyncPacket; import com.vals.valscraft.network.NetworkHandler; import net.minecraft.client.Minecraft; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.ai.attributes.AttributeSupplier; import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.animal.Wolf; import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.Entity; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; import net.minecraft.world.phys.Vec3; import net.minecraftforge.event.TickEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.network.PacketDistributor; public class MountableWolfEntity extends Wolf { private boolean hasSaddle; private static final EntityDataAccessor<Byte> DATA_ID_FLAGS = SynchedEntityData.defineId(MountableWolfEntity.class, EntityDataSerializers.BYTE); public MountableWolfEntity(EntityType<? extends Wolf> type, Level level) { super(type, level); this.hasSaddle = false; } @Override protected void defineSynchedData() { super.defineSynchedData(); this.entityData.define(DATA_ID_FLAGS, (byte)0); } public static AttributeSupplier.Builder createAttributes() { return Wolf.createAttributes() .add(Attributes.MAX_HEALTH, 20.0) .add(Attributes.MOVEMENT_SPEED, 0.3); } @Override public InteractionResult mobInteract(Player player, InteractionHand hand) { ItemStack itemstack = player.getItemInHand(hand); if (itemstack.getItem() == Items.SADDLE && !this.hasSaddle()) { if (!player.isCreative()) { itemstack.shrink(1); } this.setSaddle(true); return InteractionResult.SUCCESS; } else if (!level.isClientSide && this.hasSaddle()) { player.startRiding(this); MountSyncPacket packet = new MountSyncPacket(true); // 'true' means the player is mounted NetworkHandler.CHANNEL.sendToServer(packet); // Ensure the server handles the packet return InteractionResult.SUCCESS; } return InteractionResult.PASS; } @Override public void travel(Vec3 travelVector) { if (this.isVehicle() && this.getControllingPassenger() instanceof Player) { System.out.println("The wolf has a passenger."); System.out.println("The passenger is a player."); Player player = (Player) this.getControllingPassenger(); // Ensure the player is the controller this.setYRot(player.getYRot()); this.yRotO = this.getYRot(); this.setXRot(player.getXRot() * 0.5F); this.setRot(this.getYRot(), this.getXRot()); this.yBodyRot = this.getYRot(); this.yHeadRot = this.yBodyRot; float forward = player.zza; float strafe = player.xxa; if (forward <= 0.0F) { forward *= 0.25F; } this.flyingSpeed = this.getSpeed() * 0.1F; this.setSpeed((float) this.getAttributeValue(Attributes.MOVEMENT_SPEED) * 1.5F); this.setDeltaMovement(new Vec3(strafe, travelVector.y, forward).scale(this.getSpeed())); this.calculateEntityAnimation(this, false); } else { // The wolf does not have a passenger or the passenger is not a player System.out.println("No player is mounted, or the passenger is not a player."); super.travel(travelVector); } } public boolean hasSaddle() { return this.hasSaddle; } public void setSaddle(boolean hasSaddle) { this.hasSaddle = hasSaddle; } @Override protected void dropEquipment() { super.dropEquipment(); if (this.hasSaddle()) { this.spawnAtLocation(Items.SADDLE); this.setSaddle(false); } } @SubscribeEvent public static void onServerTick(TickEvent.ServerTickEvent event) { if (event.phase == TickEvent.Phase.START) { MinecraftServer server = net.minecraftforge.server.ServerLifecycleHooks.getCurrentServer(); if (server != null) { for (ServerPlayer player : server.getPlayerList().getPlayers()) { if (player.isPassenger() && player.getVehicle() instanceof MountableWolfEntity) { MountableWolfEntity wolf = (MountableWolfEntity) player.getVehicle(); System.out.println("Tick: " + player.getName().getString() + " is correctly mounted on " + wolf); } } } } } private boolean lastMountedState = false; @Override public void tick() { super.tick(); if (!this.level.isClientSide) { // Only on the server boolean isMounted = this.isVehicle() && this.getControllingPassenger() instanceof Player; // Only print if the state changed if (isMounted != lastMountedState) { if (isMounted) { Player player = (Player) this.getControllingPassenger(); // Verify the passenger is a player System.out.println("Server: Player " + player.getName().getString() + " is now mounted."); } else { System.out.println("Server: The wolf no longer has a passenger."); } lastMountedState = isMounted; } } } @Override public void addPassenger(Entity passenger) { super.addPassenger(passenger); if (passenger instanceof Player) { Player player = (Player) passenger; if (!this.level.isClientSide && player instanceof ServerPlayer) { // Send the packet to the server to indicate the player is mounted NetworkHandler.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new MountSyncPacket(true)); } } } @Override public void removePassenger(Entity passenger) { super.removePassenger(passenger); if (passenger instanceof Player) { Player player = (Player) passenger; if (!this.level.isClientSide && player instanceof ServerPlayer) { // Send the packet to the server to indicate the player is no longer mounted NetworkHandler.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new MountSyncPacket(false)); } } } @Override public boolean isControlledByLocalInstance() { Entity entity = this.getControllingPassenger(); return entity instanceof Player; } @Override public void positionRider(Entity passenger) { if (this.hasPassenger(passenger)) { double xOffset = Math.cos(Math.toRadians(this.getYRot() + 90)) * 0.4; double zOffset = Math.sin(Math.toRadians(this.getYRot() + 90)) * 0.4; passenger.setPos(this.getX() + xOffset, this.getY() + this.getPassengersRidingOffset() + passenger.getMyRidingOffset(), this.getZ() + zOffset); } } } MountSyncPacket package com.vals.valscraft.network; import com.vals.valscraft.entity.MountableWolfEntity; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import net.minecraftforge.network.NetworkEvent; import java.util.function.Supplier; public class MountSyncPacket { private final boolean isMounted; public MountSyncPacket(boolean isMounted) { this.isMounted = isMounted; } public void encode(FriendlyByteBuf buffer) { buffer.writeBoolean(isMounted); } public static MountSyncPacket decode(FriendlyByteBuf buffer) { return new MountSyncPacket(buffer.readBoolean()); } public void handle(NetworkEvent.Context context) { context.enqueueWork(() -> { ServerPlayer player = context.getSender(); // Get the player from the context if (player != null) { // Verifies if the player has dismounted if (!isMounted) { Entity vehicle = player.getVehicle(); if (vehicle instanceof MountableWolfEntity wolf) { // Logic to remove the player as a passenger wolf.removePassenger(player); System.out.println("Server: Player " + player.getName().getString() + " is no longer mounted."); } } } }); context.setPacketHandled(true); // Marks the packet as handled } } networkHandler package com.vals.valscraft.network; import com.vals.valscraft.valscraft; import net.minecraft.resources.ResourceLocation; import net.minecraftforge.network.NetworkRegistry; import net.minecraftforge.network.simple.SimpleChannel; import net.minecraftforge.network.NetworkEvent; import java.util.function.Supplier; public class NetworkHandler { private static final String PROTOCOL_VERSION = "1"; public static final SimpleChannel CHANNEL = NetworkRegistry.newSimpleChannel( new ResourceLocation(valscraft.MODID, "main"), () -> PROTOCOL_VERSION, PROTOCOL_VERSION::equals, PROTOCOL_VERSION::equals ); public static void init() { int packetId = 0; // Register the mount synchronization packet CHANNEL.registerMessage( packetId++, MountSyncPacket.class, MountSyncPacket::encode, MountSyncPacket::decode, (msg, context) -> msg.handle(context.get()) // Get the context with context.get() ); } }  
    • Do you use features of inventory profiles next (ipnext) or is there a change without it?
    • Remove rubidium - you are already using embeddium, which is a fork of rubidium
  • Topics

×
×
  • Create New...

Important Information

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