Console Spam of 'Player Joined Checking to see if house builder should be provided'
FoxBotGames opened this issue ยท 3 comments
1. Minecraft Version: 1.12.2
1. Forge Version: 14.23.4.2705
1. Mod Version: 1.3.0.23
Not an issue, just moreso an annoyance upon console spam when a player switches dimensions.
(see StructureEventHandler.java line 64)
I believe this is because you are having it trigger by a getWorld event and not a PlayerLoginEvent.
(here is where my newb at code comes in) The getWorld event happens when a player swaps dimensions because the client has to retrieve the new dimension's file save from the server. This then is triggering the mod to check if the player needs the starting house items which the console message for this is also triggered.
Many of the people in a modpack I have assisted in creating (see GrimCo Inc on GitHub) love to use fast transport between dimensions like GalacticCraft Planets so you can see how swapping back n forth between dimensions like a pet that cant decide if it wants to be inside or out can cause issues with the console being a tad full.... (This also happens going into any other dimension regardless of mod: Vanilla, GalacticCraft, Extra Utilities The Deep Dark, etc...)
((I am a minecraft modding code newb, so I dont know any of the full details. IE I might have had issues explaining WHY i think this is so.)) (Sorry for the poor excuse of an issue report, trying to cover a few bases)
The issue lies with EntityJoinWorld itself.
That event happens whenever any entity (and by any I many every single entity in the game. mobs, players, and items) joins/spawns into the world, which is why you quickly filter out remote instances and entities that are not Players. It will however still trigger multiple times if players are changing dimensions.
You could greatly reduce the number of times this fires by using PlayerLoggedInEvent.
Tinkers Construct does something similar with that event to give out it's book as do other mods that grant the player a starting inventory.
Good find you guys. I honestly haven't really looked at this event in a long time. Especially when and how much it was being called.
Using PlayerLoggedInEvent will greatly reduce the console spam that this mod is generating.
This update will also make the mod only print a message from this even when it is actually giving a player a starting item.
The message will look like this: {Player Name} joined the game for the first time. Giving them starting item.