Skip to content

Commit cecf9dd

Browse files
committed
support 1.18.2.03
1 parent 213763c commit cecf9dd

File tree

8 files changed

+53
-42
lines changed

8 files changed

+53
-42
lines changed

api/Offset.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace off {
3232

3333
// OK
3434
// Actor::getDimensionId
35-
constexpr uint64_t ACTOR_GET_DIMENSION_ID = 0xEC;
35+
constexpr uint64_t ACTOR_GET_DIMENSION_ID = 0xE4;
3636

3737
// OK
3838
// from ServerPlayer::isHostingPlayer

api/graphics/Particle.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,16 +192,20 @@ namespace trapdoor {
192192
player->getDimension());
193193
}
194194

195-
196195
void spawnRectangleParticle(const AABB &aabb, GRAPHIC_COLOR color,
197-
int dimType) {
196+
bool mark, int dimType) {
198197
auto p1 = aabb.p1, p2 = aabb.p2;
199198
auto dx = p2.x - p1.x;
200199
auto dy = p2.y - p1.y;
201200
auto dz = p2.z - p1.z;
202201
drawLine(p1, FACING::POS_X, dx, color, dimType);
203-
drawLine(p1, FACING::POS_Y, dy, color, dimType);
202+
if (mark) {
203+
drawLine(p1, FACING::POS_Y, dy, GRAPH_COLOR::WHITE, dimType);
204+
} else {
205+
drawLine(p1, FACING::POS_Y, dy, color, dimType);
206+
}
204207
drawLine(p1, FACING::POS_Z, dz, color, dimType);
208+
205209
Vec3 p3{p2.x, p1.y, p2.z};
206210
drawLine(p3, FACING::NEG_X, dx, color, dimType);
207211
drawLine(p3, FACING::POS_Y, dy, color, dimType);

api/graphics/Particle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace trapdoor {
2525
void spawnParticle(Vec3 p, std::string &type, int dimType = 0);
2626

2727
void spawnRectangleParticle(const AABB &aabb, GRAPHIC_COLOR color,
28-
int dimType = 0);
28+
bool mark, int dimType = 0);
2929

3030
void spawnChunkSurfaceParticle(const ChunkPos &pos, int dimID);
3131

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
- 支持1.18.2.03
55
- `self`群系显示恢复
6+
- 修复下界无法显示hsa的问题
7+
- 修复人在下界的时候显示为主世界的bug
8+
- 调整了HSA线框的颜色使其更清晰
69

710
# 1.18.1.02-0.9.90
811
2021-12-05

mod/spawn/HsaManager.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,22 +97,22 @@ namespace mod {
9797
for (const auto &hsa : this->hsaList) {
9898
switch (hsa.type) {
9999
case PillagerOutpost:
100-
color = trapdoor::GRAPHIC_COLOR::YELLOW;
100+
color = trapdoor::GRAPHIC_COLOR::BLUE;
101101
break;
102102
case SwampHut:
103-
color = trapdoor::GRAPHIC_COLOR::GREEN;
103+
color = trapdoor::GRAPHIC_COLOR::RED;
104104
break;
105105
case NetherFortress:
106-
color = trapdoor::GRAPHIC_COLOR::RED;
106+
color = trapdoor::GRAPHIC_COLOR::GREEN;
107107
break;
108108
case OceanMonument:
109-
color = trapdoor::GRAPHIC_COLOR::BLUE;
109+
color = trapdoor::GRAPHIC_COLOR::YELLOW;
110110
break;
111111
default:
112112
break;
113113
}
114114
trapdoor::spawnRectangleParticle(hsa.boundingBox.getSpawnArea(),
115-
color, hsa.dimensionID);
115+
color, true, hsa.dimensionID);
116116
}
117117
}
118118
this->gameTick = (this->gameTick + 1) % 80;

mod/spawn/SpawnHelper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ namespace mod {
3838
verticalSpawnPositions[0]};
3939
trapdoor::spawnRectangleParticle(boundingBox.toAABB(),
4040
trapdoor::GRAPHIC_COLOR::GREEN,
41-
dimensionID);
41+
false, dimensionID);
4242
}
4343
for (auto i = 1; i < verticalSpawnPositions.size(); i++) {
4444
trapdoor::BoundingBox boundingBox{verticalSpawnPositions[i],
4545
verticalSpawnPositions[i]};
4646
trapdoor::spawnRectangleParticle(boundingBox.toAABB(),
4747
trapdoor::GRAPHIC_COLOR::RED,
48-
dimensionID);
48+
false, dimensionID);
4949
}
5050
}
5151

mod/village/Village.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,20 +303,21 @@ namespace mod {
303303
if (village) {
304304
if (this->showBounds)
305305
trapdoor::spawnRectangleParticle(
306-
village->getBounds(), villageHelperConfig.boundColor);
306+
village->getBounds(), villageHelperConfig.boundColor,
307+
false);
307308
if (this->showVillageCenter)
308309
trapdoor::spawnParticle(
309310
village->getCenter() + Vec3(0.5f, 0.9f, 0.5f),
310311
villageHelperConfig.centerParticle);
311312
if (this->showGolemSpawnArea)
312313
trapdoor::spawnRectangleParticle(
313314
village->getGolemSpawnArea(),
314-
villageHelperConfig.spawnColor);
315+
villageHelperConfig.spawnColor, false);
315316

316317
if (this->showPOIRange)
317318
trapdoor::spawnRectangleParticle(
318319
village->getPOIRange(),
319-
villageHelperConfig.poiQueryColor);
320+
villageHelperConfig.poiQueryColor, false);
320321

321322
if (this->showDwellerStatus) this->showVillagerStatus();
322323
}

tools/package/pack.py

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,72 +6,75 @@
66

77
relative_dir = '../../'
88
build_dir_name = 'build'
9-
build_dir = relative_dir+build_dir_name
9+
build_dir = relative_dir+build_dir_name
1010
lang_folders = 'lang/'
1111
config_file = 'trapdoor-config.json'
12-
other_files = ['../../changelog.md','../../README.md','../../README_zh.md','../../trapdoor-disclaimer.md','../../LICENSE']
12+
other_files = ['../../changelog.md', '../../README.md',
13+
'../../README_zh.md', '../../trapdoor-disclaimer.md', '../../LICENSE']
1314

1415

15-
#get dll files
16+
# get dll files
1617
dll_files = []
17-
for file in os.listdir(build_dir):
18-
if file.endswith('.dll'):
19-
dll_files.append(file)
18+
for file in os.listdir(build_dir):
19+
if file.endswith('.dll'):
20+
dll_files.append(file)
2021

2122
if len(dll_files) == 0:
2223
input('warning: no valid files')
2324
exit(0)
2425
dll_files.sort()
2526
tips = 'choose one to pack\n'
2627
index = 0
27-
for file in reversed(dll_files):
28-
tips += '['+ str(index)+ '] : '+ file+'\n'
28+
for file in reversed(dll_files):
29+
tips += '[' + str(index) + '] : ' + file+'\n'
2930
index += 1
3031

31-
#choose version
32+
# choose version
3233
idx = 0
33-
if len(dll_files) > 1:
34-
idx = input(tips)
34+
if len(dll_files) > 1:
35+
idx = input(tips)
3536
idx = int(idx)
36-
if idx <0 or idx >= len(dll_files):
37+
if idx < 0 or idx >= len(dll_files):
3738
input('invalid files\n')
3839
exit(0)
3940

4041

4142
dll_file = dll_files[len(dll_files)-1-idx]
4243

43-
full_dll_file_path = build_dir+'/'+ dll_file
44-
os.system('upx '+full_dll_file_path)
45-
## check lang and config.json
46-
if not (path.exists(lang_folders) and path.exists(config_file)):
44+
full_dll_file_path = build_dir+'/' + dll_file
45+
#os.system('upx '+full_dll_file_path)
46+
# check lang and config.json
47+
if not (path.exists(lang_folders) and path.exists(config_file)):
4748
input('can not find land folder or config_file')
4849
exit(0)
4950

50-
## check other files
51+
# check other files
5152
for other_file in other_files:
5253
if not path.exists(other_file):
5354
input('can not find file'+other_file+'\n')
5455
exit(0)
5556

56-
#get version
57+
# get version
5758
version = dll_file[:-4]
5859
print('version is '+version)
5960
print('begin packing...')
6061

61-
#begin pack
62-
#zip.write 第一个参数是要打包的文件,第二个参数是该文件在压缩包中的相对路径
63-
release_zip_file = zipfile.ZipFile(version +'.zip','w')
64-
zip_root_path='./plugins/trapdoor/'
65-
release_zip_file.write(build_dir+'/'+ dll_file,arcname= './plugins/'+dll_file)
62+
# begin pack
63+
# zip.write 第一个参数是要打包的文件,第二个参数是该文件在压缩包中的相对路径
64+
release_zip_file = zipfile.ZipFile(version + '.zip', 'w')
65+
zip_root_path = './plugins/trapdoor/'
66+
release_zip_file.write(build_dir+'/' + dll_file, arcname='./plugins/'+dll_file)
6667
print('pack: ' + dll_file)
67-
for file in os.listdir(lang_folders):
68+
for file in os.listdir(lang_folders):
6869
if file.endswith('.json'):
6970
print('pack: ' + file)
70-
release_zip_file.write(lang_folders+file,arcname=zip_root_path+lang_folders+file)
71+
release_zip_file.write(
72+
lang_folders+file, arcname=zip_root_path+lang_folders+file)
7173
for other_file in other_files:
7274
other_file_name = other_file[5:]
7375
print('pack: ' + other_file_name)
74-
release_zip_file.write(other_file,arcname=zip_root_path+'others/'+other_file_name)
75-
release_zip_file.write(config_file,zip_root_path+config_file)
76+
release_zip_file.write(
77+
other_file, arcname=zip_root_path+'others/'+other_file_name)
78+
release_zip_file.write(config_file, zip_root_path+config_file)
7679
release_zip_file.close()
7780
input('success pack release:' + version+'.zip\n')

0 commit comments

Comments
 (0)