Skip to content

Commit

Permalink
reapir (village n) command
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaohengying committed May 29, 2021
1 parent fa470a9 commit f1e9c42
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 26 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ target_link_libraries(${MOD_API_NAME} ${PROJECT_SOURCE_DIR}/api/lib/detours.lib)
#target_link_libraries(${MOD_API_NAME} ${PROJECT_SOURCE_DIR}/api/lib/sqlite3.lib)

####################这里是具体功能##########################
set(TRAPDOOR_VERSION 0.9.47)
set(TRAPDOOR_VERSION 0.9.48)
set(MCBE_VERSION 1.16.221.01)
set(BETA OFF)
set(TEST_NUMBER 1)
Expand Down
3 changes: 0 additions & 3 deletions api/tools/Message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ namespace trapdoor {
true, player, s, v);
}




}


6 changes: 0 additions & 6 deletions api/tools/Message.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@ namespace trapdoor {
});
}

// template<typename... Args>
// void evalMsg(const std::string &fmt, Args... args) {
// auto msg = format(fmt, args...);
// trapdoor::bdsMod->getLevel()->forEachPlayer(
// [&msg](Actor *player) { mcbe_sendMessage(msg, player); });
// }
}


Expand Down
13 changes: 11 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# 1.16.221-0.9.48

2021-05-29

# bug修复

- 修复`village n`显示的POI坐标不对的问题

## 1.16.221-0.9.46
支持1.16.221.02
如下功能无法使用或者有bug

支持1.16.221.02 如下功能无法使用或者有bug

- 信号源查看
- 禁止NC更新
- `village n` 指令显示的poi坐标不准确
Expand Down
2 changes: 1 addition & 1 deletion mod/village/POIInstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace mod {
//!这个类不要做任何修改
class POIInstance {
public:
char gap[0x80];
char gap[0x98];
trapdoor::BlockPos poiPos; //位置
uint64_t ownerCount = 0; //拥有者数量
uint64_t ownerCapacity = 0; //容量
Expand Down
28 changes: 15 additions & 13 deletions mod/village/Village.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ namespace mod {
const size_t BOUND_OFFSET = 104;
const size_t POPULATION_OFFSET = 22;
const size_t GOLEM_NUM_OFFSET = 30;
const size_t DWELLER_MAP_OFFSET = 160;
}

//get village population
Expand Down Expand Up @@ -128,19 +129,19 @@ namespace mod {
// this->showTimeStamp();
}

void Village::showTimeStamp() {
auto *dwellerList = reinterpret_cast<std::array<std::unordered_map<trapdoor::ActorUniqueID,
uint64_t, trapdoor::ActorUniqueIDHash>, 4> * >((char *) this + 152);
for (int i = 1; i < 4; i++) {
auto dwellers = dwellerList->operator[](i);
for (const auto &d:dwellers) {
auto actor = trapdoor::bdsMod->fetchEntity(d.first.uid, false);
if (actor) {
actor->setNameTag(std::to_string(d.second));
}
}
}
}
// void Village::showTimeStamp() {
// auto *dwellerList = reinterpret_cast<std::array<std::unordered_map<trapdoor::ActorUniqueID,
// uint64_t, trapdoor::ActorUniqueIDHash>, 4> * >((char *) this + 152);
// for (int i = 1; i < 4; i++) {
// auto dwellers = dwellerList->operator[](i);
// for (const auto &d:dwellers) {
// auto actor = trapdoor::bdsMod->fetchEntity(d.first.uid, false);
// if (actor) {
// actor->setNameTag(std::to_string(d.second));
// }
// }
// }
// }

std::string Village::getDebugInfo() {
using namespace trapdoor;
Expand Down Expand Up @@ -211,6 +212,7 @@ namespace mod {
return false;
}


void Village::removeAllTags() {
auto *map = reinterpret_cast<std::unordered_map<trapdoor::ActorUniqueID,
std::vector<std::weak_ptr<mod::POIInstance>>, trapdoor::ActorUniqueIDHash> *>((char *) this + 96);
Expand Down
Binary file removed package/trapdoor-0.9.47-1.16.221.01.zip
Binary file not shown.
Binary file added package/trapdoor-0.9.48-1.16.221.01.zip
Binary file not shown.

0 comments on commit f1e9c42

Please sign in to comment.