diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ed04c1..eca6780 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,7 +65,7 @@ target_link_libraries(${MOD_API_NAME} ${PROJECT_SOURCE_DIR}/api/lib/detours.lib) ####################这里是具体功能########################## set(TRAPDOOR_VERSION 0.10.2) -set(MCBE_VERSION 1.18.2.03) +set(MCBE_VERSION 1.18.12.01) set(BETA OFF) set(TEST_NUMBER 1) add_definitions(-DTD_VERSION="${TRAPDOOR_VERSION}") diff --git a/api/entity/Item.cpp b/api/entity/Item.cpp index 779866f..6e95d8d 100644 --- a/api/entity/Item.cpp +++ b/api/entity/Item.cpp @@ -86,9 +86,9 @@ namespace trapdoor { using namespace SymHook; //右键代理类 -THook(void, Item_useOn_35e33f80, void *item, trapdoor::ItemStackBase *itemStack, +THook(void, Item_useOn_51392594, void *item, trapdoor::ItemStackBase *itemStack, trapdoor::Actor *player, int x, int y, int z, unsigned int facing, - float dx, float dy, float dz) { + trapdoor::Vec3 *v) { uint64_t gameTick = trapdoor::bdsMod->getTrapdoorTick(); // L_INFO("%.2f %.2f %.2f,tick = %llu", x, y, z, gameTick); trapdoor::RightClickCache targetCache{gameTick, x, y, z}; @@ -100,10 +100,10 @@ THook(void, Item_useOn_35e33f80, void *item, trapdoor::ItemStackBase *itemStack, if (playerCache != targetCache) { //响应右键事件 trapdoor::BlockPos pos(x, y, z); - const trapdoor::Vec3 vec3(dx, dy, dz); + const trapdoor::Vec3 vec3(v->x, v->y, v->z); trapdoor::bdsMod->useOnHook(player, itemStack->getItemName(), pos, facing, vec3); playerCache = targetCache; } - original(item, itemStack, player, x, y, z, facing, dx, dy, dz); + original(item, itemStack, player, x, y, z, facing, v); } diff --git a/api/lib/SymHook.h b/api/lib/SymHook.h index ee222f3..bf30571 100644 --- a/api/lib/SymHook.h +++ b/api/lib/SymHook.h @@ -5,14 +5,14 @@ namespace SymHook { // Actor::tryGetComponent<class UserEntityIdentifierComponent>(void) __ptr64 constexpr uint64_t Actor_tryGetComponent_UserEntityIdentifierComponent_4bafed89 = - 0x0056B130; + 0x005D8EC0; //[2]?_spawnStructureMob@Spawner@@AEAAXAEAVBlockSource@@AEBVBlockPos@@AEBUHardcodedSpawningArea@LevelChunk@@AEBVSpawnConditions@@@Z; // private: void __cdecl Spawner::_spawnStructureMob(class BlockSource & // __ptr64,class BlockPos const & __ptr64,struct // LevelChunk::HardcodedSpawningArea const & __ptr64,class SpawnConditions // const & __ptr64) __ptr64 - constexpr uint64_t Spawner_spawnStructureMob_98a1693e = 0x00F32970; + constexpr uint64_t Spawner_spawnStructureMob_98a1693e = 0x010C4710; //[3]?displayLocalizableMessage@CommandUtils@@YAX_NAEAVPlayer@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@4@@Z; // void __cdecl CommandUtils::displayLocalizableMessage(bool,class Player & @@ -23,72 +23,72 @@ namespace SymHook { // std::basic_string<char,struct std::char_traits<char>,class // std::allocator<char> > > > const & __ptr64) constexpr uint64_t CommandUtils_displayLocalizableMessage_24be62e9 = - 0x006E31B0; + 0x00760270; //[4]?explode@Explosion@@QEAAXXZ; // public: void __cdecl Explosion::explode(void) __ptr64 - constexpr uint64_t Explosion_explode_5adcea90 = 0x00FA6E70; + constexpr uint64_t Explosion_explode_5adcea90 = 0x0113B1D0; //[5]?fetchEntity@Level@@UEBAPEAVActor@@UActorUniqueID@@_N@Z; // public: virtual class Actor * __ptr64 __cdecl Level::fetchEntity(struct // ActorUniqueID,bool)const __ptr64 - constexpr uint64_t Level_fetchEntity_ff3466ce = 0x00F398C0; + constexpr uint64_t Level_fetchEntity_ff3466ce = 0x010CB9B0; //[6]?findNextSpawnBlockUnder@Spawner@@SA_NAEBVBlockSource@@AEAVBlockPos@@W4MaterialType@@W4SpawnBlockRequirements@@@Z; // public: static bool __cdecl Spawner::findNextSpawnBlockUnder(class // BlockSource const & __ptr64,class BlockPos & __ptr64,enum // MaterialType,enum SpawnBlockRequirements) - constexpr uint64_t Spawner_findNextSpawnBlockUnder_65b36c80 = 0x00F39930; + constexpr uint64_t Spawner_findNextSpawnBlockUnder_65b36c80 = 0x010CBA20; //[7]?forEachBlock@BlockTypeRegistry@@SAXV?$function@$$A6A_NAEBVBlockLegacy@@@Z@std@@@Z; // public: static void __cdecl BlockTypeRegistry::forEachBlock(class // std::function<bool __cdecl(class BlockLegacy const & __ptr64)>) - constexpr uint64_t BlockTypeRegistry_forEachBlock_7f891f2d = 0x00ED0360; + constexpr uint64_t BlockTypeRegistry_forEachBlock_7f891f2d = 0x010602D0; //[8]?forEachPlayer@Level@@UEAAXV?$function@$$A6A_NAEAVPlayer@@@Z@std@@@Z; // public: virtual void __cdecl Level::forEachPlayer(class // std::function<bool __cdecl(class Player & __ptr64)>) __ptr64 - constexpr uint64_t Level_forEachPlayer_71a4f564 = 0x00F3A960; + constexpr uint64_t Level_forEachPlayer_71a4f564 = 0x010CCA50; //[9]?getApproximateRadius@Village@@QEBAMXZ; // public: float __cdecl Village::getApproximateRadius(void)const __ptr64 - constexpr uint64_t Village_getApproximateRadius_626d2648 = 0x00D4F7D0; + constexpr uint64_t Village_getApproximateRadius_626d2648 = 0x00E708B0; //[10]?getBaseComponent@CircuitSceneGraph@@QEAAPEAVBaseCircuitComponent@@AEBVBlockPos@@@Z; // public: class BaseCircuitComponent * __ptr64 __cdecl // CircuitSceneGraph::getBaseComponent(class BlockPos const & __ptr64) // __ptr64 - constexpr uint64_t CircuitSceneGraph_getBaseComponent_c4a5dbac = 0x01088AB0; + constexpr uint64_t CircuitSceneGraph_getBaseComponent_c4a5dbac = 0x0123FE20; //[11]?getBedPOICount@Village@@QEBA_KXZ; // public: unsigned __int64 __cdecl Village::getBedPOICount(void)const // __ptr64 - constexpr uint64_t Village_getBedPOICount_016a7e2f = 0x00D4F8B0; + constexpr uint64_t Village_getBedPOICount_016a7e2f = 0x00E70990; //[12]?getBiome@BlockSource@@QEAAAEAVBiome@@AEBVBlockPos@@@Z; // public: class Biome & __ptr64 __cdecl BlockSource::getBiome(class // BlockPos const & __ptr64) __ptr64 - constexpr uint64_t BlockSource_getBiome_967864de = 0x00FAC8A0; + constexpr uint64_t BlockSource_getBiome_967864de = 0x01140960; //[13]?getBiomeType@Biome@@QEBA?AW4VanillaBiomeTypes@@XZ; // public: enum VanillaBiomeTypes __cdecl Biome::getBiomeType(void)const // __ptr64 - constexpr uint64_t Biome_getBiomeType_bb099b78 = 0x0102DF70; + constexpr uint64_t Biome_getBiomeType_bb099b78 = 0x011C40E0; //[14]?getBlock@BlockSource@@UEBAAEBVBlock@@AEBVBlockPos@@@Z; // public: virtual class Block const & __ptr64 __cdecl // BlockSource::getBlock(class BlockPos const & __ptr64)const __ptr64 - constexpr uint64_t BlockSource_getBlock_b39e5e5d = 0x00FACED0; + constexpr uint64_t BlockSource_getBlock_b39e5e5d = 0x01140F90; //[15]?getBlock@BlockSource@@UEBAAEBVBlock@@HHH@Z; // public: virtual class Block const & __ptr64 __cdecl // BlockSource::getBlock(int,int,int)const __ptr64 - constexpr uint64_t BlockSource_getBlock_6df88a51 = 0x00FACF70; + constexpr uint64_t BlockSource_getBlock_6df88a51 = 0x01141050; //[16]?getCommandPermissionLevel@Player@@UEBA?AW4CommandPermissionLevel@@XZ; // public: virtual enum CommandPermissionLevel __cdecl // Player::getCommandPermissionLevel(void)const __ptr64 - constexpr uint64_t Player_getCommandPermissionLevel_40b0e608 = 0x00B87610; + constexpr uint64_t Player_getCommandPermissionLevel_40b0e608 = 0x00C9D1A0; //[17]?getDebugText@Actor@@UEAAXAEAV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@@Z; // public: virtual void __cdecl Actor::getDebugText(class std::vector<class @@ -96,174 +96,175 @@ namespace SymHook { // std::allocator<char> >,class std::allocator<class // std::basic_string<char,struct std::char_traits<char>,class // std::allocator<char> > > > & __ptr64) __ptr64 - constexpr uint64_t Actor_getDebugText_f04fad6b = 0x00B41550; + constexpr uint64_t Actor_getDebugText_f04fad6b = 0x00C5AE30; //[18]?getDimension@Level@@UEBAPEAVDimension@@V?$AutomaticID@VDimension@@H@@@Z; // public: virtual class Dimension * __ptr64 __cdecl // Level::getDimension(class AutomaticID<class Dimension,int>)const __ptr64 - constexpr uint64_t Level_getDimension_6fab9459 = 0x00F3B720; + constexpr uint64_t Level_getDimension_6fab9459 = 0x010CD7E0; //[19]?getHash@NetworkIdentifier@@QEBA_KXZ; // public: unsigned __int64 __cdecl NetworkIdentifier::getHash(void)const // __ptr64 - constexpr uint64_t NetworkIdentifier_getHash_d932dec8 = 0x0060C350; + constexpr uint64_t NetworkIdentifier_getHash_d932dec8 = 0x00685120; //[20]?getMobToSpawn@BlockLegacy@@UEBAPEBVMobSpawnerData@@AEBVSpawnConditions@@AEAVBlockSource@@@Z; // public: virtual class MobSpawnerData const * __ptr64 __cdecl // BlockLegacy::getMobToSpawn(class SpawnConditions const & __ptr64,class // BlockSource & __ptr64)const __ptr64 - constexpr uint64_t BlockLegacy_getMobToSpawn_dd8ce374 = 0x010C4C20; + constexpr uint64_t BlockLegacy_getMobToSpawn_dd8ce374 = 0x01284490; //[21]?getName@ItemStackBase@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ; // public: class std::basic_string<char,struct std::char_traits<char>,class // std::allocator<char> > __cdecl ItemStackBase::getName(void)const __ptr64 - constexpr uint64_t ItemStackBase_getName_6d581a35 = 0x00C8F5F0; + constexpr uint64_t ItemStackBase_getName_6d581a35 = 0x011EE8B0; //[22]?getNameTag@Actor@@UEBAAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ; // public: virtual class std::basic_string<char,struct // std::char_traits<char>,class std::allocator<char> > const & __ptr64 // __cdecl Actor::getNameTag(void)const __ptr64 - constexpr uint64_t Actor_getNameTag_7044ab83 = 0x00B44790; + constexpr uint64_t Actor_getNameTag_7044ab83 = 0x00C5E270; //[23]?getPos@Actor@@UEBAAEBVVec3@@XZ; // public: virtual class Vec3 const & __ptr64 __cdecl // Actor::getPos(void)const __ptr64 - constexpr uint64_t Actor_getPos_cecb628b = 0x00B44CB0; + constexpr uint64_t Actor_getPos_cecb628b = 0x00C5E780; //[24]?getPosition@LevelChunk@@QEBAAEBVChunkPos@@XZ; // public: class ChunkPos const & __ptr64 __cdecl // LevelChunk::getPosition(void)const __ptr64 - constexpr uint64_t LevelChunk_getPosition_5b2499b2 = 0x00C8E100; + constexpr uint64_t LevelChunk_getPosition_5b2499b2 = 0x01198E10; //[25]?getRegion@Actor@@QEBAAEAVBlockSource@@XZ; // public: class BlockSource & __ptr64 __cdecl Actor::getRegion(void)const // __ptr64 - constexpr uint64_t Actor_getRegion_757c8f63 = 0x00B45000; + constexpr uint64_t Actor_getRegion_757c8f63 = 0x00C5EAC0; //[26]?getViewVector@Actor@@QEBA?AVVec3@@M@Z; // public: class Vec3 __cdecl Actor::getViewVector(float)const __ptr64 - constexpr uint64_t Actor_getViewVector_01c92121 = 0x00B46090; + constexpr uint64_t Actor_getViewVector_01c92121 = 0x00C5FBA0; //[27]?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@AEBVCommandRequestPacket@@@Z; // public: virtual void __cdecl ServerNetworkHandler::handle(class // NetworkIdentifier const & __ptr64,class CommandRequestPacket const & // __ptr64) __ptr64 - constexpr uint64_t ServerNetworkHandler_handle_1a4c2996 = 0x00642E10; + constexpr uint64_t ServerNetworkHandler_handle_1a4c2996 = 0x006BA9D0; //[28]?processPendingAdds@CircuitSceneGraph@@AEAAXXZ; // private: void __cdecl CircuitSceneGraph::processPendingAdds(void) __ptr64 constexpr uint64_t CircuitSceneGraph_processPendingAdds_9d2954e5 = - 0x0108AF00; + 0x01242330; //[29]?registerCommand@CommandRegistry@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEBDW4CommandPermissionLevel@@UCommandFlag@@3@Z; // public: void __cdecl CommandRegistry::registerCommand(class // std::basic_string<char,struct std::char_traits<char>,class // std::allocator<char> > const & __ptr64,char const * __ptr64,enum // CommandPermissionLevel,struct CommandFlag,struct CommandFlag) __ptr64 - constexpr uint64_t CommandRegistry_registerCommand_8574de98 = 0x006F60B0; + constexpr uint64_t CommandRegistry_registerCommand_8574de98 = 0x00772CF0; //[30]?removeComponent@CircuitSceneGraph@@AEAAXAEBVBlockPos@@@Z; // private: void __cdecl CircuitSceneGraph::removeComponent(class BlockPos // const & __ptr64) __ptr64 - constexpr uint64_t CircuitSceneGraph_removeComponent_1f06081d = 0x0108C3B0; + constexpr uint64_t CircuitSceneGraph_removeComponent_1f06081d = 0x012437C0; //[31]?setBlock@BlockSource@@QEAA_NHHHAEBVBlock@@H@Z; // public: bool __cdecl BlockSource::setBlock(int,int,int,class Block const // & __ptr64,int) __ptr64 - constexpr uint64_t BlockSource_setBlock_71ce9a25 = 0x00FBB0E0; + constexpr uint64_t BlockSource_setBlock_71ce9a25 = 0x0114FE30; //[32]?setItem@HopperBlockActor@@UEAAXHAEBVItemStack@@@Z; // public: virtual void __cdecl HopperBlockActor::setItem(int,class // ItemStack const & __ptr64) __ptr64 - constexpr uint64_t HopperBlockActor_setItem_c0e5f3ce = 0x0126A120; + constexpr uint64_t HopperBlockActor_setItem_c0e5f3ce = 0x01426E30; //[33]?setNameTag@Actor@@UEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; // public: virtual void __cdecl Actor::setNameTag(class // std::basic_string<char,struct std::char_traits<char>,class // std::allocator<char> > const & __ptr64) __ptr64 - constexpr uint64_t Actor_setNameTag_2f9772d3 = 0x00B61B80; + constexpr uint64_t Actor_setNameTag_2f9772d3 = 0x00C79850; //[34]?setPlayerGameType@ServerPlayer@@UEAAXW4GameType@@@Z; // public: virtual void __cdecl ServerPlayer::setPlayerGameType(enum // GameType) __ptr64 - constexpr uint64_t ServerPlayer_setPlayerGameType_058d8c73 = 0x006FBFE0; + constexpr uint64_t ServerPlayer_setPlayerGameType_058d8c73 = 0x00778A80; //[35]?spawnParticleEffect@Level@@UEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBVVec3@@PEAVDimension@@@Z; // public: virtual void __cdecl Level::spawnParticleEffect(class // std::basic_string<char,struct std::char_traits<char>,class // std::allocator<char> > const & __ptr64,class Vec3 const & __ptr64,class // Dimension * __ptr64) __ptr64 - constexpr uint64_t Level_spawnParticleEffect_52e7de09 = 0x00F48900; + constexpr uint64_t Level_spawnParticleEffect_52e7de09 = 0x010DB2D0; //[36]?tick@Actor@@QEAA_NAEAVBlockSource@@@Z; // public: bool __cdecl Actor::tick(class BlockSource & __ptr64) __ptr64 - constexpr uint64_t Actor_tick_8589defc = 0x00B692C0; + constexpr uint64_t Actor_tick_8589defc = 0x00C7E900; //[37]?tick@Dimension@@UEAAXXZ; // public: virtual void __cdecl Dimension::tick(void) __ptr64 - constexpr uint64_t Dimension_tick_39d89862 = 0x01010020; + constexpr uint64_t Dimension_tick_39d89862 = 0x011A4E00; //[38]?tick@LevelChunk@@QEAAXAEAVBlockSource@@AEBUTick@@@Z; // public: void __cdecl LevelChunk::tick(class BlockSource & __ptr64,struct // Tick const & __ptr64) __ptr64 - constexpr uint64_t LevelChunk_tick_9d729ccd = 0x010103C0; + constexpr uint64_t LevelChunk_tick_9d729ccd = 0x011A51A0; //[39]?tick@ServerLevel@@UEAAXXZ; // public: virtual void __cdecl ServerLevel::tick(void) __ptr64 - constexpr uint64_t ServerLevel_tick_86efb826 = 0x006FF1E0; + constexpr uint64_t ServerLevel_tick_86efb826 = 0x0077B3C0; //[40]?tick@Village@@QEAAXUTick@@AEAVBlockSource@@@Z; // public: void __cdecl Village::tick(struct Tick,class BlockSource & // __ptr64) __ptr64 - constexpr uint64_t Village_tick_2a1ecbf8 = 0x00D55DE0; + constexpr uint64_t Village_tick_2a1ecbf8 = 0x00E76EC0; //[41]?tickBlockEntities@LevelChunk@@QEAAXAEAVBlockSource@@@Z; // public: void __cdecl LevelChunk::tickBlockEntities(class BlockSource & // __ptr64) __ptr64 - constexpr uint64_t LevelChunk_tickBlockEntities_41f9b2ca = 0x01010DA0; + constexpr uint64_t LevelChunk_tickBlockEntities_41f9b2ca = 0x011A5BF0; //[42]?tickBlocks@LevelChunk@@QEAAXAEAVBlockSource@@@Z; // public: void __cdecl LevelChunk::tickBlocks(class BlockSource & __ptr64) // __ptr64 - constexpr uint64_t LevelChunk_tickBlocks_66280c26 = 0x010110F0; + constexpr uint64_t LevelChunk_tickBlocks_66280c26 = 0x011A5F40; //[43]?tickEntitySystems@Level@@UEAAXXZ; // public: virtual void __cdecl Level::tickEntitySystems(void) __ptr64 - constexpr uint64_t Level_tickEntitySystems_251e10ba = 0x00F4A920; + constexpr uint64_t Level_tickEntitySystems_251e10ba = 0x010DD490; //[44]?tickPendingTicks@BlockTickingQueue@@QEAA_NAEAVBlockSource@@AEBUTick@@H_N@Z; // public: bool __cdecl BlockTickingQueue::tickPendingTicks(class // BlockSource & __ptr64,struct Tick const & __ptr64,int,bool) __ptr64 - constexpr uint64_t BlockTickingQueue_tickPendingTicks_e4625213 = 0x00FBC900; + constexpr uint64_t BlockTickingQueue_tickPendingTicks_e4625213 = 0x01151750; //[45]?tickRedstone@Dimension@@UEAAXXZ; // public: virtual void __cdecl Dimension::tickRedstone(void) __ptr64 - constexpr uint64_t Dimension_tickRedstone_c8a7e6e5 = 0x010117D0; + constexpr uint64_t Dimension_tickRedstone_c8a7e6e5 = 0x011A66B0; //[46]?tickWorld@ServerPlayer@@UEAAXAEBUTick@@@Z; // public: virtual void __cdecl ServerPlayer::tickWorld(struct Tick const & // __ptr64) __ptr64 - constexpr uint64_t ServerPlayer_tickWorld_4b6718a8 = 0x006FF410; + constexpr uint64_t ServerPlayer_tickWorld_4b6718a8 = 0x0077B5F0; //[47]?toDebugString@Block@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ; // public: class std::basic_string<char,struct std::char_traits<char>,class // std::allocator<char> > __cdecl Block::toDebugString(void)const __ptr64 - constexpr uint64_t Block_toDebugString_522cb860 = 0x010CDA40; + constexpr uint64_t Block_toDebugString_522cb860 = 0x01290130; //[48]?tryGetStateFromLegacyData@BlockLegacy@@QEBAPEBVBlock@@G@Z; // public: class Block const * __ptr64 __cdecl // BlockLegacy::tryGetStateFromLegacyData(unsigned short)const __ptr64 constexpr uint64_t BlockLegacy_tryGetStateFromLegacyData_ad225111 = - 0x010CEA50; + 0x01291140; //[49]?updateNeighborsAt@BlockSource@@QEAAXAEBVBlockPos@@@Z; // public: void __cdecl BlockSource::updateNeighborsAt(class BlockPos const // & __ptr64) __ptr64 - constexpr uint64_t BlockSource_updateNeighborsAt_4c3f8cf7 = 0x00FBD5E0; + constexpr uint64_t BlockSource_updateNeighborsAt_4c3f8cf7 = 0x01152690; - //[50]?useOn@Item@@QEBA_NAEAVItemStack@@AEAVActor@@HHHEMMM@Z; + //[50]?useOn@Item@@QEBA_NAEAVItemStack@@AEAVActor@@HHHEAEBVVec3@@@Z; // public: bool __cdecl Item::useOn(class ItemStack & __ptr64,class Actor & - // __ptr64,int,int,int,unsigned char,float,float,float)const __ptr64 - constexpr uint64_t Item_useOn_35e33f80 = 0x00DD5C20; + // __ptr64,int,int,int,unsigned char,class Vec3 const & __ptr64)const + // __ptr64 + constexpr uint64_t Item_useOn_51392594 = 0x00F08660; } // namespace SymHook diff --git a/mod/function/HopperCounter.cpp b/mod/function/HopperCounter.cpp index 100d12c..92fe13e 100644 --- a/mod/function/HopperCounter.cpp +++ b/mod/function/HopperCounter.cpp @@ -91,7 +91,7 @@ namespace mod { } std::string stringBuilder; trapdoor::MessageBuilder builder; - builder.textF("Channel [%d]: Total %d items in %d gt (%.3f min(s))", + builder.textF("Channel [%d]: Total %d items in %d gt (%.3f min(s))\n", channel, n, gameTick, gameTick / 1200.0); for (const auto &i : counterList) { diff --git a/mod/spawn/SpawnHelper.cpp b/mod/spawn/SpawnHelper.cpp index 7086be4..e1dbbfa 100644 --- a/mod/spawn/SpawnHelper.cpp +++ b/mod/spawn/SpawnHelper.cpp @@ -54,15 +54,16 @@ namespace mod { this->verticalSpawnPositions.clear(); auto dim = player->getDimensionID(); this->dimensionID = dim; - int maxY = dim != 1 ? 255 : 127; + // 1.18后世界高度改了 + int maxY = dim != 1 ? 320 : 127; trapdoor::BlockPos topPos = {pos.x, maxY, pos.z}; do { findNextSpawnPosition(player->getBlockSource(), &topPos, 41); // L_INFO("find pos %d %d %d", topPos.x, topPos.y, topPos.z); - if (topPos.y > 0) + if (topPos.y > -64) this->verticalSpawnPositions.emplace_back(topPos.x, topPos.y, topPos.z); - } while (topPos.y > 0); + } while (topPos.y > -64); } void SpawnHelper::printSpawnProbability(trapdoor::Actor *player, @@ -70,7 +71,7 @@ namespace mod { uint32_t bright) const { if (!this->enable) return; auto dim = player->getDimensionID(); - int maxY = dim != 1 ? 255 : 127; + int maxY = dim != 1 ? 320 : 127; trapdoor::BlockPos topPos = {pos.x, maxY, pos.z}; bool isSurface = true; bool hasFound = false; diff --git a/tools/package/pack.py b/tools/package/pack.py deleted file mode 100644 index 4719a1d..0000000 --- a/tools/package/pack.py +++ /dev/null @@ -1,80 +0,0 @@ -import builtins -import os -from os import path -import zipfile - - -relative_dir = '../../' -build_dir_name = 'build' -build_dir = relative_dir+build_dir_name -lang_folders = 'lang/' -config_file = 'trapdoor-config.json' -other_files = ['../../changelog.md', '../../README.md', - '../../README_zh.md', '../../trapdoor-disclaimer.md', '../../LICENSE'] - - -# get dll files -dll_files = [] -for file in os.listdir(build_dir): - if file.endswith('.dll'): - dll_files.append(file) - -if len(dll_files) == 0: - input('warning: no valid files') - exit(0) -dll_files.sort() -tips = 'choose one to pack\n' -index = 0 -for file in reversed(dll_files): - tips += '[' + str(index) + '] : ' + file+'\n' - index += 1 - -# choose version -idx = 0 -if len(dll_files) > 1: - idx = input(tips) - idx = int(idx) - if idx < 0 or idx >= len(dll_files): - input('invalid files\n') - exit(0) - - -dll_file = dll_files[len(dll_files)-1-idx] - -full_dll_file_path = build_dir+'/' + dll_file -#os.system('upx '+full_dll_file_path) -# check lang and config.json -if not (path.exists(lang_folders) and path.exists(config_file)): - input('can not find land folder or config_file') - exit(0) - -# check other files -for other_file in other_files: - if not path.exists(other_file): - input('can not find file'+other_file+'\n') - exit(0) - -# get version -version = dll_file[:-4] -print('version is '+version) -print('begin packing...') - -# begin pack -# zip.write 第一个参数是要打包的文件,第二个参数是该文件在压缩包中的相对路径 -release_zip_file = zipfile.ZipFile(version + '.zip', 'w') -zip_root_path = './plugins/trapdoor/' -release_zip_file.write(build_dir+'/' + dll_file, arcname='./plugins/'+dll_file) -print('pack: ' + dll_file) -for file in os.listdir(lang_folders): - if file.endswith('.json'): - print('pack: ' + file) - release_zip_file.write( - lang_folders+file, arcname=zip_root_path+lang_folders+file) -for other_file in other_files: - other_file_name = other_file[5:] - print('pack: ' + other_file_name) - release_zip_file.write( - other_file, arcname=zip_root_path+'others/'+other_file_name) -release_zip_file.write(config_file, zip_root_path+config_file) -release_zip_file.close() -input('success pack release:' + version+'.zip\n') diff --git a/tools/package/trapdoor-config.json b/tools/package/trapdoor-config.json deleted file mode 100644 index 302f1a5..0000000 --- a/tools/package/trapdoor-config.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "EULA": true, - "commands": { - "/tick": { - "enable": true, - "permissionLevel": 1 - }, - "/village": { - "enable": true, - "permissionLevel": 0 - }, - "/prof": { - "enable": true, - "permissionLevel": 0 - }, - "/mspt": { - "enable": true, - "permissionLevel": 0 - }, - "/o": { - "enable": true, - "permissionLevel": 1 - }, - "/c": { - "enable": true, - "permissionLevel": 1 - }, - "/s": { - "enable": true, - "permissionLevel": 1 - }, - "/hsa": { - "enable": true, - "permissionLevel": 0 - }, - "/func": { - "enable": true, - "permissionLevel": 1 - }, - "/counter": { - "enable": true, - "permissionLevel": 1 - }, - "/td?": { - "enable": true, - "permissionLevel": 0 - }, - "/os": { - "enable": true, - "permissionLevel": 0 - }, - "/apicfg": { - "enable": true, - "permissionLevel": 1 - }, - "/draw": { - "enable": true, - "permissionLevel": 0 - }, - "/slime": { - "enable": true, - "permissionLevel": 0 - }, - "/backup": { - "enable": true, - "permissionLevel": 1 - }, - "/self": { - "enable": true, - "permissionLevel": 0 - }, - "/cl": { - "enable": true, - "permissionLevel": 0 - }, - "/dev": { - "enable": true, - "permissionLevel": 1 - }, - "/here": { - "enable": true, - "permissionLevel": 0 - }, - "/l": { - "enable": true, - "permissionLevel": 1 - }, - "/lang": { - "enable": true, - "permissionLevel": 1 - }, - "/spawn": { - "enable": true, - "permissionLevel": 0 - }, - "/fakeplayer": { - "enable": true, - "permissionLevel": 1 - }, - "/rs": { - "enable": true, - "permissionLevel": 1 - } - }, - "lowLevelVanillaCommands": [ - "stop", - "whitelist" - ], - "server": { - "levelName": "Bedrock level", - "lang": "zh_cn", - "ws": "ws://127.0.0.1:54321" - }, - "village": { - "bound": "red", - "spawn": "blue", - "poiQuery": "red", - "center": "minecraft:heart_particle" - }, - "functionsEnable": { - "hopperCounter": false, - "spawnHelper": false, - "cactusRotate": false, - "simpleDraw": false, - "playerStat": false - }, - "selfEnable": { - "chunkShow": true, - "distanceMeasure": true, - "redstoneStick": true - } -} \ No newline at end of file diff --git a/tools/sym/user_sym b/tools/sym/user_sym index d0ba083..086cfae 100644 --- a/tools/sym/user_sym +++ b/tools/sym/user_sym @@ -100,7 +100,8 @@ ?setItem@HopperBlockActor@@UEAAXHAEBVItemStack@@@Z #物品右键方块 -?useOn@Item@@QEBA_NAEAVItemStack@@AEAVActor@@HHHEMMM@Z +#?useOn@Item@@QEBA_NAEAVItemStack@@AEAVActor@@HHHEMMM@Z +?useOn@Item@@QEBA_NAEAVItemStack@@AEAVActor@@HHHEAEBVVec3@@@Z #获取红石原件 ?getBaseComponent@CircuitSceneGraph@@QEAAPEAVBaseCircuitComponent@@AEBVBlockPos@@@Z