Skip to content

Commit e48e742

Browse files
committed
fix: fix DefaultEntitySystemsCollection.h
1 parent 0643cc6 commit e48e742

14 files changed

Lines changed: 170 additions & 131 deletions

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ Upon its first run, LeviOptimize will generate configuration files in `mod/LeviO
4949

5050
- **`optHopperItem`**: Enhances TPS by optimizing item transfers between hoppers and containers.
5151
- **`optMovingBlock`**: Improves FPS and TPS by optimizing block entities' processing during piston movements.
52-
- **`fixChunkLeak`**: Addresses the issue of chunks remaining loaded after players leave.
5352
- **`optSeenPercent`**: Caches "SeenPercent" values to improve TPS, with a note of caution regarding potential hash collisions.
54-
- **`optPushEntity`**: Improves server performance by reducing TPS drops from entity cramming with two key options:
53+
- **`optPushEntity`**: Improves server performance by reducing TPS drops from entity cramming with three key options:
54+
- `disableVec0Push`: Stops entities from being squeezed when their collision vector is zero, enhancing performance without altering gameplay significantly.
55+
- `maxPushTimes`: Sets a limit on the number of times entities can be pushed per tick, with `-1` indicating this limit is disabled by default. Adjust carefully to avoid negatively impacting gameplay.
56+
- `unlimitedPlayerPush`: No longer limit the pushes related to players, and it is only effect when the `maxPushTimes` is enabled.
5557

5658
## Contributing
5759

README.zh.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Minecraft基岩版服务器(BDS)的性能优化插件,旨在通过解决
99

1010
- [安全性](#安全性)
1111
- [安装](#安装)
12-
- [使用Lip](#使用lip)
13-
- [手动安装](#手动安装)
12+
- [使用Lip](#使用lip)
13+
- [手动安装](#手动安装)
1414
- [使用](#使用)
1515
- [命令](#命令)
1616
- [特性](#特性)
@@ -51,10 +51,16 @@ lip install github.com/LiteLDev/LeviOptimize
5151

5252
- **`optHopperItem`**:通过优化漏斗和容器之间的物品传输来提高TPS。
5353
- **`optMovingBlock`**:通过优化活塞运动过程中的方块实体处理来提高FPS和TPS。
54-
- **`fixChunkLeak`**:修复玩家离开后区块未卸载的问题。
5554
- **`optSeenPercent`**:缓存特定坐标及其相应边界框内的“SeenPercent”值,以提高TPS。由于存在哈希冲突可能导致性能下降的可能性,实际效果不确定。
5655
- **`optPushEntity`**:
57-
通过减少实体拥挤导致的TPS下降,提升服务器性能,主要包括两个配置选项:
56+
通过减少实体拥挤导致的TPS下降,提升服务器性能,主要包括三个配置选项:
57+
- `disableVec0Push`:
58+
当实体碰撞向量为零时阻止实体被挤压,无需显著改变游戏玩法即可提高性能。
59+
- `maxPushTimes`:
60+
限制实体每刻被推动的次数,`-1`表示此限制默认关闭。谨慎调整以避免影响原生特性。
61+
- `unlimitedPlayerPush`:
62+
不再限制与玩家相关的推动,只在`maxPushTimes`启用时生效。
63+
5864

5965
## 贡献
6066

File renamed without changes.
File renamed without changes.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// TODO: Delete this file after bump LeviLamina to 1.26.10.4
2+
#pragma once
3+
4+
#include "mc/_HeaderOutputPredefine.h"
5+
#include "mc/deps/ecs/systems/ComponentInfo.h"
6+
#include "mc/deps/ecs/systems/IEntitySystemsCollection.h"
7+
#include "mc/deps/ecs/systems/ISystem.h"
8+
#include "mc/deps/ecs/systems/InternalSystemInfo.h"
9+
#include "mc/deps/ecs/systems/SystemTiming.h"
10+
11+
class DefaultEntitySystemsCollection : public IEntitySystemsCollection {
12+
public:
13+
struct ECSTiming {
14+
int mCount{0}; // this+0x0
15+
std::chrono::nanoseconds mTime{0}; // this+0x4
16+
};
17+
struct TickingSystemsInCategory {
18+
Bedrock::typeid_t<struct SystemCategory> mCategory; // this+0x0
19+
std::vector<uint> mSystems{}; // this+0x8
20+
std::vector<ECSTiming> mTimings{}; // this+0x20
21+
};
22+
23+
std::vector<std::shared_ptr<ISystem>> mAllSystems; // this+0x8
24+
std::vector<InternalSystemInfo> mAllSystemsInfo; // this+0x20
25+
std::vector<TickingSystemsInCategory> mTickingSystemCategories; // this+0x38
26+
std::vector<TickingSystemsInCategory> mSingleTickingSystemCategories; // this+0x50
27+
entt::dense_map<uint, ComponentInfo> mAllComponentsInfo; // this+0x68
28+
std::mutex mTimingMutex; // this+0xa0
29+
};

src/levioptimize/features/HopperItemOpt.cpp renamed to src/features/HopperItemOpt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <expected>
22

33
#include "features.h"
4-
#include "levioptimize/LeviOptimize.h"
4+
#include "LeviOptimize.h"
55
#include "ll/api/memory/Hook.h"
66
#include "mc/world/item/ItemStack.h"
77
#include "mc/world/level/BlockSource.h"
File renamed without changes.

src/levioptimize/features/PushEntityOpt.cpp renamed to src/features/PushEntityOpt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <expected>
22

33
#include "features.h"
4-
#include "levioptimize/LeviOptimize.h"
4+
#include "LeviOptimize.h"
55
#include "ll/api/memory/Hook.h"
66
#include "mc/deps/core/math/Vec3.h"
77
#include "mc/world/actor/Actor.h"

0 commit comments

Comments
 (0)