Cull tile entities and throttle mob pathfinding to every 8 ticks.
The players won't see the difference on the pathfinding and the culling improves the performance by a lot in zones with a lot of tile entities
in TileEntityRenderDispatcher.cpp:
Calculate if the tile entities are visible in the camera. Early return if they are so they don't get rendered while the players don't look at those tile entities so .
in PathNavigation.cpp:
Do a simple modulo operation on the current number of ticks to test if its been 8 ticks since last operation. UpdatePath(); doesn't get executed if elapsed time isn't enough
Added many commands from Minecraft Java edition:
setblock
fill
seed
xp
gamemode spectator
summon
effect
difficulty
spawnpoint
setworldspawn
kick
enchant
All of the logic is contained inside of PlayerConnection.cpp along with the previous command handler, i also changed MobEffect.h to add a new helper for potion names -> ids.
And for spectator, a bunch of small changes inside server/client related file, along with the removal of the weird /spectator command which was added previously. I think it can still be refined because im not sure the invisibility thing is working.
Moved the whole logic to a new file (TooltipManager.cpp), and rewrote most of the logic to profit from object oriented programming. The side-effect is that the changes are scattered across entities, tiles and items because moving everything to OOP requires to add the tooltip to every .cpp file for every tile/item/entities (or their class, on plants for example which all use the tooltip IDS_TOOLTIPS_PLANT)
The issue with the default tooltips loop written by 4J is that:
Its running in the main Minecraft::tick loop and is more than a thousand lines long, polluting the function.
Not using C++'s full potential with object oriented programming, 4J decided to use a big switch case (probably because it could run better on hardware without branch prediction like the WiiU or Xbox 360 ?)
And seems to be better off in its own file than in the main Minecraft.cpp file
(This PR fixes [this issue](https://discord.com/channels/1482443865754701868/1534141325904183336) from the Discord server: )
Previously, when holding a piece of armor and right-clicking an interactable block (furnance, crafting table, levers, etc.) the armor would be equipped to the player.
This isn't the expected behavior. The interacted block should suppress any held item functionality (if not crouched)
This PR adds the "bool blockHandled" variable to the "handleUseItem" function. If the player interact with an interactable block, the variable is set to true.
This variable can be used for future packets added in this function
Reviewed-on: https://git.neolegacy.dev/neoStudiosLCE/neoLegacy/pulls/168
Co-authored-by: ACL <puffymono@gmail.com>
Co-committed-by: ACL <puffymono@gmail.com>
Thrown eggs used snowball particles when hitting a block, there wasn't any code for the correct particles either.
I added the new egg particles and assigned them to the thrown egg entity.
Before:

Now:

Reviewed-on: https://git.neolegacy.dev/neoStudiosLCE/neoLegacy/pulls/167
Co-authored-by: ACL <puffymono@gmail.com>
Co-committed-by: ACL <puffymono@gmail.com>
This PR adds some lines missing from the code inside where the game handles the hotbar inputs (1 to 9 keys). I copied the code that handles the scrollwheel hotbar input updates so it should work exactly the same.
This fixes some issues or bugs, such as the item name not appearing or the tutorial failing to track the current item.
---------
Co-authored-by: TheHuckle <1+thehuckle@noreply.neolegacy.dev>
Reviewed-on: https://git.neolegacy.dev/neoStudiosLCE/neoLegacy/pulls/8
Co-authored-by: ACL <puffymono@gmail.com>
Co-committed-by: ACL <puffymono@gmail.com>
fixes:
- treasure enchants being selectable within the enchantment table menu
- frost walker resemblance to decompiled legacy console edition
- enchantment table featuring hot-swappable abilities where the player could replace one tool with another whilst keeping the exact same potential enchantments in the enchant menu
fixes:
- grass path not being on the shovel's diggable list, hence the slow breaking speed whilst mining the block
- grass path AABB collisions, creating a discrepency between farmland + the grass path tile where the former could walk up more tiles than the latter