ataranlen / civcraft

MineTexas Civcraft
https://www.minetexas.com/
GNU General Public License v2.0
19 stars 38 forks source link

Server lags #183

Closed TheLegionCrazy closed 4 years ago

TheLegionCrazy commented 5 years ago

Sooo. I looked at some of the item components. And I saw that you are using some shit line: player.updateInventory()

On updateInventory call it serializing many-many stacks: image image

Don't use it. Use: player.setItemInMainHand(player.getItemInMainHand());

For example, if 10 players will place War Camp, it'll create big lags

ataranlen commented 5 years ago

It would be better to link the actual lines in code, especially since Searching is disabled on forks on github.

TheLegionCrazy commented 5 years ago

https://github.com/ataranlen/civcraft/blob/1.8-dev/civcraft/src/com/avrgaming/civcraft/listener/CustomItemManager.java#L610 (most calls are here)