Compare commits

..

29 Commits

Author SHA1 Message Date
Qiuzhizhe
00db9f6602 Fix ItemActor::getItemStack() crash 2023-04-08 21:45:41 -07:00
Qiuzhizhe
acc469d6b2 Release v408.3.1 2023-03-26 07:00:35 -07:00
Qiuzhizhe
ac7733eeee Fix 指令在无作弊情况下不能使用 2023-03-26 06:50:43 -07:00
Qiuzhizhe
3159677ba0 Fix AuToTooth 2023-03-22 07:45:40 -07:00
Qiuzhizhe
d46e111e8d Release v408.3.0 2023-03-22 01:56:04 -07:00
Qiuzhizhe
a5080d62ee 添加自动提交Tooth脚本 2023-03-22 01:53:27 -07:00
Qiuzhizhe
bcf199e8d2 修正HitResult::getEntity函数 2023-03-20 07:03:22 -07:00
Qiuzhizhe
f4a3110d8f 修复SetDisplayObjectivePacket 2023-03-20 07:02:37 -07:00
Qiuzhizhe
6bd4535330 添加Potion::PotionTypePotion::PotionVariant成员 2023-03-20 07:02:14 -07:00
Qiuzhizhe
3f189db4ae 修复TransferPacket 2023-03-20 07:00:16 -07:00
Qiuzhizhe
683b6fd589 修复SetScorePacket 2023-03-20 06:59:39 -07:00
Qiuzhizhe
aa5fbcb521 粗心,漏和多写符号 2023-03-20 06:06:44 -07:00
Qiuzhizhe
70fc659ba2 去掉无用代码 2023-03-18 06:41:56 -07:00
Qiuzhizhe
b3c3b76551 修复ProjectileSpawn事件 2023-03-18 06:41:14 -07:00
Qiuzhizhe
4097c5417f 修复ProjectileHitEntity事件 2023-03-18 06:40:27 -07:00
Qiuzhizhe
84287a4e3a 修复MobHurt事件 2023-03-18 06:40:07 -07:00
Qiuzhizhe
e48832d224 修改遗漏的偏移量 2023-03-18 06:39:01 -07:00
Qiuzhizhe
1f2e7e5516 修复ProjectileHitBlock事件 2023-03-18 06:37:40 -07:00
Qiuzhizhe
d4632e915f 修复ContainerChange事件,可能有问题 2023-03-18 06:37:12 -07:00
Qiuzhizhe
b14f5fe505 修复BlockExploded事件 2023-03-18 06:36:37 -07:00
Qiuzhizhe
a73afd9fe9 修复PlayerDropItem事件 2023-03-18 06:35:08 -07:00
Qiuzhizhe
62950cbd21 部分补全LevelContainerModel 2023-03-18 06:33:39 -07:00
Qiuzhizhe
ac4ca933de 补全HitResult 2023-03-18 06:33:20 -07:00
Qiuzhizhe
68fe280544 补全Explosion 2023-03-17 22:30:48 -07:00
Qiuzhizhe
1d9372749e add ActorBlockSyncMessage 2023-03-17 22:30:13 -07:00
Qiuzhizhe
f24c726a81 规范Event里的变量命名 2023-03-17 22:29:15 -07:00
Qiuzhizhe
70f0717b59 大意了,没留意到SDK是没有ll头的 2023-03-06 07:19:50 -08:00
Qiuzhizhe
7007106d39 把偏移量集中 2023-03-05 00:33:15 -08:00
Qiuzhizhe
6d752996a5 Fix push SDK 2023-03-03 18:40:40 -08:00
55 changed files with 958 additions and 872 deletions

View File

@ -231,10 +231,24 @@ jobs:
with: with:
path: build/ path: build/
- name: Push Tooth
working-directory: ${{env.GITHUB_WORKSPACE}}
if: github.event.inputs.status == 'stable'
run: |
cd Scripts
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
chmod +x ./UploadTooth.sh
./UploadTooth.sh ${{ github.event.inputs.tag }}
env:
REPO_KEY: ${{secrets.PUSH_TOKEN}}
USERNAME: github-actions[bot]
shell: bash
- name: Pack artifacts - name: Pack artifacts
run: | run: |
cd build/ cd build/
zip -9r LiteLoaderBDS.zip LiteLoaderBDS/* zip -9r LiteLoaderBDS-${{ github.event.inputs.tag }}.zip LiteLoaderBDS/*
zip -9r PDB.zip PDB/* zip -9r PDB.zip PDB/*
zip -9r Modules.zip PeEditor PreLoader LiteLoader ScriptEngine LLParticle LLPermission zip -9r Modules.zip PeEditor PreLoader LiteLoader ScriptEngine LLParticle LLPermission
shell: bash shell: bash
@ -247,7 +261,7 @@ jobs:
tag: ${{ github.event.inputs.tag }} tag: ${{ github.event.inputs.tag }}
bodyFile: RELEASE_NOTES.md bodyFile: RELEASE_NOTES.md
artifacts: | artifacts: |
build/LiteLoaderBDS.zip build/LiteLoaderBDS-${{ github.event.inputs.tag }}.zip
build/Modules.zip build/Modules.zip
build/PDB.zip build/PDB.zip
env: env:

View File

@ -5,8 +5,8 @@
#define LITELOADER_VERSION_RELEASE 2 #define LITELOADER_VERSION_RELEASE 2
#define LITELOADER_VERSION_MAJOR 408 #define LITELOADER_VERSION_MAJOR 408
#define LITELOADER_VERSION_MINOR 2 #define LITELOADER_VERSION_MINOR 3
#define LITELOADER_VERSION_REVISION 0 #define LITELOADER_VERSION_REVISION 1
#define LITELOADER_VERSION_ACTIONS 0 #define LITELOADER_VERSION_ACTIONS 0
#define LITELOADER_VERSION_STATUS LITELOADER_VERSION_DEV #define LITELOADER_VERSION_STATUS LITELOADER_VERSION_DEV

View File

@ -390,7 +390,7 @@
/*0*/ virtual ~DynamicCommand(); /*0*/ virtual ~DynamicCommand();
/*1*/ virtual void execute(class CommandOrigin const& origin, class CommandOutput& output) const; /*1*/ virtual void execute(class CommandOrigin const& origin, class CommandOutput& output) const;
LIAPI static std::unique_ptr<class DynamicCommandInstance> createCommand(std::string const& name, std::string const& description, CommandPermissionLevel permission = CommandPermissionLevel::GameMasters, CommandFlag flag1 = {(CommandFlagValue)0x80}, CommandFlag flag2 = {(CommandFlagValue)0}, HMODULE handle = GetCurrentModule()); LIAPI static std::unique_ptr<class DynamicCommandInstance> createCommand(std::string const& name, std::string const& description, CommandPermissionLevel permission = CommandPermissionLevel::GameMasters, CommandFlag flag1 = {(CommandFlagValue)4}, CommandFlag flag2 = {(CommandFlagValue)0}, HMODULE handle = GetCurrentModule());
LIAPI static std::unique_ptr<class DynamicCommandInstance> createCommand( LIAPI static std::unique_ptr<class DynamicCommandInstance> createCommand(
std::string const& name, std::string const& name,
std::string const& description, std::string const& description,
@ -399,7 +399,7 @@
std::vector<std::vector<std::string>>&& overloads, std::vector<std::vector<std::string>>&& overloads,
CallBackFn callback, CallBackFn callback,
CommandPermissionLevel permission = CommandPermissionLevel::GameMasters, CommandPermissionLevel permission = CommandPermissionLevel::GameMasters,
CommandFlag flag1 = {(CommandFlagValue)0x80}, CommandFlag flag1 = {(CommandFlagValue)0x40},
CommandFlag flag2 = {(CommandFlagValue)0}, CommandFlag flag2 = {(CommandFlagValue)0},
HMODULE handle = GetCurrentModule()); HMODULE handle = GetCurrentModule());
@ -412,7 +412,7 @@
std::vector<std::vector<std::string>>&& overloads, std::vector<std::vector<std::string>>&& overloads,
CallBackFn callback, CallBackFn callback,
CommandPermissionLevel permission = CommandPermissionLevel::GameMasters, CommandPermissionLevel permission = CommandPermissionLevel::GameMasters,
CommandFlag flag1 = {(CommandFlagValue)0x80}, CommandFlag flag1 = {(CommandFlagValue)0x40},
CommandFlag flag2 = {(CommandFlagValue)0}, CommandFlag flag2 = {(CommandFlagValue)0},
HMODULE handle = GetCurrentModule()) { HMODULE handle = GetCurrentModule()) {
return setup(createCommand(name, description, std::move(enums), std::move(params), std::move(overloads), std::move(callback), permission, flag1, flag2, handle)); return setup(createCommand(name, description, std::move(enums), std::move(params), std::move(overloads), std::move(callback), permission, flag1, flag2, handle));
@ -483,7 +483,7 @@
friend class DynamicCommand; friend class DynamicCommand;
LIAPI DynamicCommandInstance(std::string const& name, std::string const& description, CommandPermissionLevel permission = CommandPermissionLevel::GameMasters, CommandFlag flag = {(CommandFlagValue)0x80}, HMODULE handle = GetCurrentModule()); LIAPI DynamicCommandInstance(std::string const& name, std::string const& description, CommandPermissionLevel permission = CommandPermissionLevel::GameMasters, CommandFlag flag = {(CommandFlagValue)0x40}, HMODULE handle = GetCurrentModule());
LIAPI bool setBuilder(DynamicCommand::BuilderFn builder); LIAPI bool setBuilder(DynamicCommand::BuilderFn builder);
LIAPI DynamicCommand::BuilderFn initCommandBuilder(); LIAPI DynamicCommand::BuilderFn initCommandBuilder();

View File

@ -1,11 +1,15 @@
#pragma once #pragma once
#include "Global.h"
#include "utils/Hash.h"
#include <ModUtils/ModUtils.h>
#include <vector> #include <vector>
#include <string> #include <string>
#include <thread> #include <thread>
#include <ModUtils/ModUtils.h>
#include "Offset.h"
#include "Global.h"
#include "utils/Hash.h"
// The core api of the hook function // The core api of the hook function
//__declspec(dllimport) int HookFunction(void* oldfunc, void** poutold, void* newfunc); //__declspec(dllimport) int HookFunction(void* oldfunc, void** poutold, void* newfunc);
// Used to get a server-defined specific function by name // Used to get a server-defined specific function by name

View File

@ -0,0 +1,160 @@
#pragma once
#include <cstdint>
#include <utility>
/*
* 使_函数名_()使
* */
namespace ll{
namespace offset{
// ->header/llapi/mc
// Null
constexpr uint64_t ATTRIBUTE_getName = 0x8;
// BaseCommandBlock::_setCommand a4 is Command
constexpr uint64_t BASECOMMANDBLOCK_getCommand = 0x38;
// ItemStackBase::init(ItemStackBase*, BlockLegacy *, int) Line14
constexpr uint64_t BLOCKLEGAC_getBlockItemId = 0x10C;
// LevelChunk::_removeCallbacks Line28
constexpr uint64_t BLOCKLEGAC_getBlockEntityType = 0xA8;
// Null
constexpr uint64_t BLOCKSOURCE_getDimension = 0x20;
// BegGoal::canUse Line6
constexpr uint64_t BLOCKSOURCE_getDimensionConst = 0x328;
// DayLockCommand::execute Line91
constexpr uint64_t COMMANDOUTPUT_getSuccessCount = 0x28;
// Null
constexpr uint64_t COMPOUNDTAGVARIANT_getTagType = 0x28;
// ExplorationMapFunction::apply Line57
constexpr uint64_t DIMENSION_getBlockSourceFromMainChunkSource = 0x48;
// Null
constexpr uint64_t DIMENSION_getHeight = 0xCA;
// Player::checkSpawnBlock Line19
constexpr uint64_t DIMENSION_getDimensionId = 0xC0;
// ItemRegistry::registerItem Line25
constexpr uint64_t ITEM_getFullItemName = 0xD8;
// Null
constexpr uint64_t LEVEL_getSpawner = 0x7B0;
// CommandAreaFactory::_getArea Line156
constexpr uint64_t LEVELCHUNK_getLastTick = 0x90;
// lambda_b490644342a3912d59dc52eb79c3a67f_::operator() Line410
constexpr uint64_t MINECRAFT_getNetworkHandler = 0x18;
// mob::die Line83
constexpr uint64_t MOB_getDead = 0x73A;
// EffectCommand::execute Line247
constexpr uint64_t MOBEFFECT_getResourceName = 0x50;
// MobEffect::MobEffect Line43
constexpr uint64_t MOBEFFECT_getComponentName = 0x98;
// ScoreboardCommand::applyPlayerOperation Line186
constexpr uint64_t OBJECTIVE_getName = 0x40;
// Objective::serialize Line55
constexpr uint64_t OBJECTIVE_getDisplayName = 0x60;
// Null
constexpr uint64_t PACKET_OBJECTIVE_getDisplayName = 0x10;
// AddPlayerPacket::AddPlayerPacket Line58
constexpr uint64_t PLAYER_getDeviceId = 0x1EC0;
// Actor::onAboveBubbleColumn Line5 照抄的,不知行不行
constexpr uint64_t PLAYER_isFlying_1 = 0x8B4;
constexpr uint64_t PLAYER_isFlying_2 = 0x8B8;
constexpr uint64_t PLAYER_isFlying_3 = 0x914;
constexpr uint64_t PLAYER_isFlying_4 = 0x918;
// PropertiesSettings::PropertiesSettings Line550
constexpr uint64_t PROPERTIESSETTINGS_useOnlineAuthentication = 0x1A1;
// PropertiesSettings::PropertiesSettings Line518
constexpr uint64_t PROPERTIESSETTINGS_getLevelName = 0x20;
// Null
constexpr uint64_t RAKNET_getAdr = 0x8;
// ResourcePackRepository::_initializeWorldPackSource Line62
constexpr uint64_t RESOURCEPACKREPOSITORY_getPackSourceFactory = 0x170;
// ServerScoreboard::_unpackIdentityDefToScorePacket Line30~31 16+72
constexpr uint64_t SCOREBOARDIDENTITYREF_getIdentityType = 0x58;
// ->src/EventAPI
// Null
constexpr uint64_t EVENTAPI_PlayerInteractEntity_1 = 0x68;
// Null
constexpr uint64_t EVENTAPI_PlayerInteractEntity_2 = 0x70;
// Hopper::Hopper
constexpr uint64_t EVENTAPI_HopperSearchItem = 0x5;
// FillingContainer::FillingContainer a2
constexpr uint64_t EVENTAPI_PlayerDropItem = 0xF8;
// ->src/llapi/mc
// Null
constexpr uint64_t BIOMEAPI_getID = 0x78;
// Null
constexpr uint64_t BIOMEAPI_getName = 0x8;
// Null
constexpr uint64_t BLOCKAPI_getTileData = 0x8;
// Actor::_playFlySound Line7
constexpr uint64_t BLOCKAPI_getRuntimeId = 0x30;
// Null
constexpr uint64_t BLOCKLEGACYAPI_getRuntimeId = 0x80;
// Container::Container
constexpr uint64_t CONTAINERAPI_getTypeName= 0x8;
// Null
constexpr uint64_t GAMEMODEAPI_getPlayer= 0x8;
// Null
constexpr uint64_t HITRESULTAPI_getFacing= 0x1C;
// Null
constexpr uint64_t HITRESULTAPI_getPos= 0x2C;
// Null
constexpr uint64_t HITRESULTAPI_isHitLiquid= 0x50;
// Null
constexpr uint64_t HITRESULTAPI_getBlockPos= 0x20;
// Null
constexpr uint64_t HITRESULTAPI_getLiquidPos= 0x54;
// Null
constexpr uint64_t HITRESULTAPI_getLiquidFacing= 0x51;
// Player::take Line127
constexpr uint64_t ITEMACTORAPI_getItemStack= 0x620;
// ItemActor::NormalTick Line258
constexpr uint64_t ITEMACTORAPI_getDespawnTime = 0x6C4;
// ItemActor::NormalTick Line258 也许是?
constexpr uint64_t ITEMACTORAPI_getLatestSpawnTime = 0x6B0;
// Null
constexpr uint64_t ITEMSTACKAPI_getCount = 0x22;
// MovingBlockActor::load Line69
constexpr uint64_t LEVELAPI_getBlockPalettePtr = 0x7D0;
// ServerPlayer::isHostingPlayer
constexpr uint64_t PLAYERAPI_getNetworkIdentifier = 0x980;
// KickCommand::_kickPlayer Line116
constexpr uint64_t PLAYERAPI_getCertificate = 0xAB0;
// AddPlayerPacket::AddPlayerPacket Line59
constexpr uint64_t PLAYERAPI_getPlatform = 0x838;
// InventoryContainerModel::_getContainer 2928 + 176
constexpr uint64_t PLAYERAPI_getInventory = 0xC20;
// ServerNetworkHandler::_sendLevelData Line316
constexpr uint64_t PLAYERAPI_getSpawnPosition = 0x1C14;
// ServerNetworkHandler::_sendLevelData Line310
constexpr uint64_t PLAYERAPI_getSpawnDimension = 0x1C20;
// Null
constexpr uint64_t PLAYERAPI_getClientUUID = 0xAA0;
// ServerPlayer::sendNetworkPacket 参4
constexpr uint64_t PLAYERAPI_getClientSubId = 0xDC0;
// Null
constexpr uint64_t PLAYERAPI_crashClient = 0X38;
// TransferPacket::mServerPort
constexpr uint64_t PLAYERAPI_sendTransferPacket_port = 0X48;
// TransferPacket::mServerAddress
constexpr uint64_t PLAYERAPI_sendTransferPacket_address = 0X28;
// SetScorePacket::mType
constexpr uint64_t PLAYERAPI_sendSetScorePacket_type = 0X28;
// SetScorePacket::mScoreInfo
constexpr uint64_t PLAYERAPI_sendSetScorePacket_data = 0X30;
// Null
constexpr uint64_t PLAYERAPI_sendCommandRequestPacket_cmd = 0X30;
// Null
constexpr uint64_t RESOURCEPACKREPOSITORYAPI_setCustomResourcePackPath = 0x30;
// ->src/llapi/nbt
// Block::Block?
constexpr uint64_t COMPOUNDTAGAPI_fromBlock = 0x18;
}
}

View File

@ -12,7 +12,7 @@ class Attribute {
#define AFTER_EXTRA #define AFTER_EXTRA
public: public:
inline class HashedString const & getName() const{ inline class HashedString const & getName() const{
return dAccess<HashedString>(this, 8); return dAccess<HashedString>(this, ll::offset::ATTRIBUTE_getName);
} }
#undef AFTER_EXTRA #undef AFTER_EXTRA

View File

@ -13,7 +13,7 @@ class BaseCommandBlock {
public: public:
inline std::string const & getCommand() const{ inline std::string const & getCommand() const{
//BaseCommandBlock::_setCommand a4 is Command; //BaseCommandBlock::_setCommand a4 is Command;
return dAccess<std::string>(this,56); return dAccess<std::string>(this,ll::offset::BASECOMMANDBLOCK_getCommand);
}; };
#undef AFTER_EXTRA #undef AFTER_EXTRA
#ifndef DISABLE_CONSTRUCTOR_PREVENTION_BASECOMMANDBLOCK #ifndef DISABLE_CONSTRUCTOR_PREVENTION_BASECOMMANDBLOCK

View File

@ -163,7 +163,7 @@ public:
inline int getBlockItemId() const{ inline int getBlockItemId() const{
//ItemStackBase::init(ItemStackBase *this, const struct BlockLegacy *a2, int a3) Line14 //ItemStackBase::init(ItemStackBase *this, const struct BlockLegacy *a2, int a3) Line14
unsigned int id = dAccess<int>(this,268);//mID unsigned int id = dAccess<int>(this,ll::offset::BLOCKLEGAC_getBlockItemId);//mID
// unsigned int id = this->mID; // unsigned int id = this->mID;
if(id < 256u) if(id < 256u)
return id; return id;
@ -176,7 +176,7 @@ public:
} }
inline enum BlockActorType getBlockEntityType() const{ inline enum BlockActorType getBlockEntityType() const{
// LevelChunk::_removeCallbacks Line28 // LevelChunk::_removeCallbacks Line28
return dAccess<BlockActorType>(this,168); return dAccess<BlockActorType>(this,ll::offset::BLOCKLEGAC_getBlockEntityType);
//return this->mBlockEntityType; //return this->mBlockEntityType;
}; };

View File

@ -22,7 +22,7 @@ public:
// }; // };
LIAPI BlockInstance getBlockInstance(BlockPos); LIAPI BlockInstance getBlockInstance(BlockPos);
inline Dimension* getDimension() const{ inline Dimension* getDimension() const{
return dAccess< Dimension*>(this, 32); return dAccess< Dimension*>(this, ll::offset::BLOCKSOURCE_getDimension);
} }
inline AutomaticID<class Dimension, int> getDimensionId() const{ inline AutomaticID<class Dimension, int> getDimensionId() const{
//Dimension::onBlockEvent Line24 //Dimension::onBlockEvent Line24
@ -42,7 +42,7 @@ public:
} }
inline Dimension const & getDimensionConst() const{ inline Dimension const & getDimensionConst() const{
//BegGoal::canUse Line6 //BegGoal::canUse Line6
return dAccess<Dimension>(this,808); return dAccess<Dimension>(this,ll::offset::BLOCKSOURCE_getDimensionConst);
}; };
// inline short getHeightmap(class BlockPos const &bs) const{ // inline short getHeightmap(class BlockPos const &bs) const{
// auto levelchunk = getChunkAt(bs); // auto levelchunk = getChunkAt(bs);

View File

@ -23,13 +23,13 @@ public:
inline int getSuccessCount() const{ inline int getSuccessCount() const{
//DayLockCommand::execute Line91 //DayLockCommand::execute Line91
return dAccess<int>(this,0x28); return dAccess<int>(this,ll::offset::COMMANDOUTPUT_getSuccessCount);
}; };
inline void success(){ inline void success(){
int successCount = dAccess<int>(this,0x28); int successCount = dAccess<int>(this,ll::offset::COMMANDOUTPUT_getSuccessCount);
++successCount; ++successCount;
dAccess<int>(this,0x28) = successCount; dAccess<int>(this,ll::offset::COMMANDOUTPUT_getSuccessCount) = successCount;
}; };
inline bool empty() const{ inline bool empty() const{

View File

@ -12,7 +12,7 @@ class CompoundTagVariant {
#define AFTER_EXTRA #define AFTER_EXTRA
public: public:
inline Tag::Type getTagType() { inline Tag::Type getTagType() {
return dAccess<Tag::Type, 40>(this); return dAccess<Tag::Type, ll::offset::COMPOUNDTAGVARIANT_getTagType>(this);
} }
inline Tag* asTag() { inline Tag* asTag() {
return (Tag*)this; return (Tag*)this;

View File

@ -14,6 +14,11 @@ public:
DimensionHeightRange(short a):max(a){}; DimensionHeightRange(short a):max(a){};
}; };
struct ActorBlockSyncMessage{
ActorUniqueID mEntityUniqueID;
char mMessage[4];
};
#undef BEFORE_EXTRA #undef BEFORE_EXTRA
class Dimension { class Dimension {
@ -22,15 +27,15 @@ class Dimension {
public: public:
inline BlockSource& getBlockSourceFromMainChunkSource() const{ inline BlockSource& getBlockSourceFromMainChunkSource() const{
//ExplorationMapFunction::apply Line57 //ExplorationMapFunction::apply Line57
return *dAccess<BlockSource*>(this, 72); return *dAccess<BlockSource*>(this, ll::offset::DIMENSION_getBlockSourceFromMainChunkSource);
}; };
inline int getHeight(){ inline int getHeight(){
return dAccess<int>(this,202); return dAccess<int>(this,ll::offset::DIMENSION_getHeight);
}; };
inline AutomaticID<class Dimension, int> getDimensionId() const{ inline AutomaticID<class Dimension, int> getDimensionId() const{
//Player::moveSpawnView Line33 //Player::moveSpawnView Line33
//Player::checkSpawnBlock Line19 //Player::checkSpawnBlock Line19
return dAccess<AutomaticID<Dimension,int>>(this,192); return dAccess<AutomaticID<Dimension,int>>(this,ll::offset::DIMENSION_getDimensionId);
}; };
inline DimensionHeightRange const & getHeightRange() const{ inline DimensionHeightRange const & getHeightRange() const{
// 0为主世界1为下界2为末地 // 0为主世界1为下界2为末地

View File

@ -6,10 +6,24 @@
#define BEFORE_EXTRA #define BEFORE_EXTRA
#undef BEFORE_EXTRA #undef BEFORE_EXTRA
class Actor;
class BlockSource;
class Explosion { class Explosion {
#define AFTER_EXTRA #define AFTER_EXTRA
public:
Vec3 mPos;
float mRadius;
std::unordered_set<BlockPos> mToBlow;
bool mFire;
bool mBreaking;
bool mAllowUnderwater;
Actor *mSource;
BlockSource *mRegion;
float mMaxResistance;
std::optional<bool> mInWaterOverride;
char mRandom[64];
#undef AFTER_EXTRA #undef AFTER_EXTRA
#ifndef DISABLE_CONSTRUCTOR_PREVENTION_EXPLOSION #ifndef DISABLE_CONSTRUCTOR_PREVENTION_EXPLOSION

View File

@ -6,13 +6,14 @@
#define BEFORE_EXTRA #define BEFORE_EXTRA
// Include Headers or Declare Types Here // Include Headers or Declare Types Here
class Actor;
class StackResultStorageEntity; class StackResultStorageEntity;
enum class HitResultType:int { enum class HitResultType:int {
TILE=0, TILE = 0,
ENTITY, ENTITY = 0x1,
ENTITY_OUT_OF_RANGE, ENTITY_OUT_OF_RANGE = 0x2,
NO_HIT, NO_HIT = 0x3,
}; };
#undef BEFORE_EXTRA #undef BEFORE_EXTRA
@ -22,7 +23,6 @@ class HitResult {
#define AFTER_EXTRA #define AFTER_EXTRA
// Add Member There // Add Member There
//char filler[112];
Vec3 startPos; //0 Vec3 startPos; //0
Vec3 rayDir; //12 Vec3 rayDir; //12
HitResultType type; //24 HitResultType type; //24
@ -30,20 +30,18 @@ class HitResult {
BlockPos endBpos; //32 BlockPos endBpos; //32
Vec3 endPos; //44 Vec3 endPos; //44
uintptr_t actorRef; //56 uintptr_t actorRef; //56
uintptr_t unk64; bool mIsHitLiquid; //64
int unk72; FaceID liquidFace; //65
int unk76; //76 BlockPos liquidBpos; //68
bool hitLiquid; //80 Vec3 liquidPos; //80
FaceID liquidFace; //81 bool indirectHit; //92
BlockPos liquidBpos; //84
Vec3 liquidPos; //96
bool indirectHit; //108
//112
public: public:
inline bool __fastcall isHit() { inline bool isHit() {
return (unsigned int)(*((int*)this + 6) - 2) > 1; return (unsigned int)(this->type) > 3;
} };
inline Actor* getEntity() {
return (Actor*)(this->actorRef);
};
LIAPI FaceID getFacing(); LIAPI FaceID getFacing();
LIAPI Vec3 getPos(); LIAPI Vec3 getPos();
LIAPI bool isHitLiquid(); LIAPI bool isHitLiquid();

View File

@ -20,7 +20,7 @@ class Item {
public: public:
inline std::string const & getFullItemName() const{ inline std::string const & getFullItemName() const{
//ItemRegistry::registerItem Line25 //ItemRegistry::registerItem Line25
return dAccess<std::string>(this,216); return dAccess<std::string>(this,ll::offset::ITEM_getFullItemName);
}; };
#undef AFTER_EXTRA #undef AFTER_EXTRA
#ifndef DISABLE_CONSTRUCTOR_PREVENTION_ITEM #ifndef DISABLE_CONSTRUCTOR_PREVENTION_ITEM

View File

@ -143,7 +143,7 @@ public:
} }
inline Spawner& getSpawner() const{ inline Spawner& getSpawner() const{
return *dAccess<std::unique_ptr<Spawner>>(this,1968).get(); return *dAccess<std::unique_ptr<Spawner>>(this,ll::offset::LEVEL_getSpawner).get();
}; };
#undef AFTER_EXTRA #undef AFTER_EXTRA

View File

@ -42,7 +42,7 @@ struct HardcodedSpawningArea {
public: public:
struct Tick const & getLastTick() const{ struct Tick const & getLastTick() const{
//CommandAreaFactory::_getArea Line156 //CommandAreaFactory::_getArea Line156
return *dAccess<Tick*>(this, 144); return *dAccess<Tick*>(this, ll::offset::LEVELCHUNK_getLastTick);
}; };
inline int getHeightmap(const ChunkBlockPos *pos){ inline int getHeightmap(const ChunkBlockPos *pos){
//LevelChunk::_lightingCallbacks Line31 应该是这样的 //LevelChunk::_lightingCallbacks Line31 应该是这样的

View File

@ -11,7 +11,13 @@
class LevelContainerModel : public ContainerModel { class LevelContainerModel : public ContainerModel {
#define AFTER_EXTRA #define AFTER_EXTRA
char data[200];
public:
Player *mPlayer;
BlockPos mBlockPos;
BlockActorType mBlockEntityType;
ActorUniqueID mEntityUniqueId;
std::vector<Container *> initContainerList;
#undef AFTER_EXTRA #undef AFTER_EXTRA
#ifndef DISABLE_CONSTRUCTOR_PREVENTION_LEVELCONTAINERMODEL #ifndef DISABLE_CONSTRUCTOR_PREVENTION_LEVELCONTAINERMODEL
public: public:

View File

@ -14,7 +14,7 @@ class Minecraft {
public: public:
inline NetworkHandler & getNetworkHandler(){ inline NetworkHandler & getNetworkHandler(){
//lambda_b490644342a3912d59dc52eb79c3a67f_::operator() Line410 //lambda_b490644342a3912d59dc52eb79c3a67f_::operator() Line410
return dAccess<NetworkHandler>(this,24); return dAccess<NetworkHandler>(this,ll::offset::MINECRAFT_getNetworkHandler);
}; };
#undef AFTER_EXTRA #undef AFTER_EXTRA
#ifndef DISABLE_CONSTRUCTOR_PREVENTION_MINECRAFT #ifndef DISABLE_CONSTRUCTOR_PREVENTION_MINECRAFT

View File

@ -28,7 +28,7 @@ public:
} }
inline bool getDead(){ inline bool getDead(){
//mob::die Line83 //mob::die Line83
return dAccess<bool>(this,1850); return dAccess<bool>(this,ll::offset::MOB_getDead);
}; };
#undef AFTER_EXTRA #undef AFTER_EXTRA

View File

@ -53,11 +53,11 @@ public:
inline std::string const & getResourceName() const{ inline std::string const & getResourceName() const{
//EffectCommand::execute Line247 //EffectCommand::execute Line247
return dAccess<std::string>(this,80); return dAccess<std::string>(this,ll::offset::MOBEFFECT_getResourceName);
}; };
inline HashedString const & getComponentName() const{ inline HashedString const & getComponentName() const{
//MobEffect::MobEffect Line43; //MobEffect::MobEffect Line43;
return dAccess<HashedString>(this,152); return dAccess<HashedString>(this,ll::offset::MOBEFFECT_getComponentName);
}; };
#undef AFTER_EXTRA #undef AFTER_EXTRA

View File

@ -14,14 +14,14 @@ class Objective {
public: public:
inline std::string getName(){ inline std::string getName(){
//ScoreboardCommand::applyPlayerOperation Line186 //ScoreboardCommand::applyPlayerOperation Line186
return dAccess<std::string>(this, 64); return dAccess<std::string>(this, ll::offset::OBJECTIVE_getName);
}; };
LIAPI bool setDisplay(const std::string& slotName, ObjectiveSortOrder sort); LIAPI bool setDisplay(const std::string& slotName, ObjectiveSortOrder sort);
inline std::string const & getDisplayName() const{ inline std::string const & getDisplayName() const{
//Objective::serialize //Objective::serialize
return dAccess<std::string>(this,96); return dAccess<std::string>(this,ll::offset::OBJECTIVE_getDisplayName);
}; };
#undef AFTER_EXTRA #undef AFTER_EXTRA

View File

@ -39,7 +39,7 @@ public:
inline ServerPlayer* getPlayerFromPacket(ServerNetworkHandler* handler, NetworkIdentifier* netId) inline ServerPlayer* getPlayerFromPacket(ServerNetworkHandler* handler, NetworkIdentifier* netId)
{ {
return handler->getServerPlayer(*netId, dAccess<char>(this, 16)); return handler->getServerPlayer(*netId, dAccess<char>(this, ll::offset::PACKET_OBJECTIVE_getDisplayName));
} }
inline enum StreamReadResult _read(class ReadOnlyBinaryStream& binaryStream) inline enum StreamReadResult _read(class ReadOnlyBinaryStream& binaryStream)
{ {

View File

@ -184,11 +184,13 @@ public:
} }
inline std::string* getDeviceId(){ inline std::string* getDeviceId(){
//AddPlayerPacket::AddPlayerPacket Line58 //AddPlayerPacket::AddPlayerPacket Line58
return dAccess<std::string*>(this,7872); return dAccess<std::string*>(this,ll::offset::PLAYER_getDeviceId);
}; };
inline bool isFlying(){ inline bool isFlying(){
//Actor::onAboveBubbleColumn Line5 照抄的,不知行不行 //Actor::onAboveBubbleColumn Line5 照抄的,不知行不行
return (dAccess<int>(this,2228) == 1 || !dAccess<bool>(this,2232)) && (dAccess<int>(this, 2324) == 1 || !dAccess<bool>(this, 2328)); return (dAccess<int>(this,ll::offset::PLAYER_isFlying_1) == 1
|| !dAccess<bool>(this,ll::offset::PLAYER_isFlying_2))
&& (dAccess<int>(this, ll::offset::PLAYER_isFlying_3) == 1 || !dAccess<bool>(this, ll::offset::PLAYER_isFlying_4));
}; };
inline bool isHungry(){ inline bool isHungry(){
void* Player_HUNGER = dlsym("?HUNGER@Player@@2VAttribute@@B"); void* Player_HUNGER = dlsym("?HUNGER@Player@@2VAttribute@@B");

View File

@ -10,7 +10,42 @@
class Potion { class Potion {
#define AFTER_EXTRA #define AFTER_EXTRA
public:
enum PotionType{
Undefined_9 = 0xFFFFFFFF,
Regular = 0x0,
Splash_0 = 0x1,
Lingering = 0x2,
};
enum PotionVariant{
MOVESLOW = 0x0,
MOVESPEED = 0x1,
DIGSLOW = 0x2,
DIGSPEED = 0x3,
DAMAGEBOOST = 0x4,
HEAL = 0x5,
HARM = 0x6,
JUMP_0 = 0x7,
CONFUSION = 0x8,
REGEN = 0x9,
RESISTANCE = 0xA,
FIRERESISTANCE = 0xB,
WATERBREATH = 0xC,
INVISIBILITY = 0xD,
BLINDNESS = 0xE,
NIGHTVISION = 0xF,
HUNGER = 0x10,
WEAKNESS = 0x11,
POISON = 0x12,
WITHER = 0x13,
HEALTHBOOST = 0x14,
ABSORPTION = 0x15,
SATURATION = 0x16,
LEVITATION = 0x17,
TURTLEMASTER = 0x18,
SLOWFALL = 0x19,
BASE = 0x1A,
};
#undef AFTER_EXTRA #undef AFTER_EXTRA
#ifndef DISABLE_CONSTRUCTOR_PREVENTION_POTION #ifndef DISABLE_CONSTRUCTOR_PREVENTION_POTION
public: public:

View File

@ -13,11 +13,11 @@ class PropertiesSettings {
public: public:
inline bool useOnlineAuthentication(){ inline bool useOnlineAuthentication(){
//PropertiesSettings::PropertiesSettings Line550; //PropertiesSettings::PropertiesSettings Line550;
return dAccess<bool>(this, 417); return dAccess<bool>(this, ll::offset::PROPERTIESSETTINGS_useOnlineAuthentication);
} }
inline std::string getLevelName(){ inline std::string getLevelName(){
//PropertiesSettings::PropertiesSettings Line518 //PropertiesSettings::PropertiesSettings Line518
return dAccess<std::string>(this,32); return dAccess<std::string>(this,ll::offset::PROPERTIESSETTINGS_getLevelName);
} }
#undef AFTER_EXTRA #undef AFTER_EXTRA
#ifndef DISABLE_CONSTRUCTOR_PREVENTION_PROPERTIESSETTINGS #ifndef DISABLE_CONSTRUCTOR_PREVENTION_PROPERTIESSETTINGS

View File

@ -41,7 +41,7 @@ namespace RakNet {
RakPeer(RakPeer const&) = delete; RakPeer(RakPeer const&) = delete;
RakPeer(RakPeer&&) = delete; RakPeer(RakPeer&&) = delete;
SystemAddress getAdr(NetworkIdentifier const& ni) { SystemAddress getAdr(NetworkIdentifier const& ni) {
RakNetGUID const& guid = dAccess<RakNetGUID>(&ni, 8); RakNetGUID const& guid = dAccess<RakNetGUID>(&ni, ll::offset::RAKNET_getAdr);
return RakPeer::GetSystemAddressFromGuid(guid); return RakPeer::GetSystemAddressFromGuid(guid);
} }
MCAPI virtual SystemAddress GetSystemAddressFromGuid(struct RakNet::RakNetGUID) const; MCAPI virtual SystemAddress GetSystemAddressFromGuid(struct RakNet::RakNetGUID) const;

View File

@ -21,7 +21,7 @@ public:
inline class PackSourceFactory* getPackSourceFactory(){ inline class PackSourceFactory* getPackSourceFactory(){
//ResourcePackRepository::_initializeWorldPackSource Line62 //ResourcePackRepository::_initializeWorldPackSource Line62
return dAccess<PackSourceFactory*>(this, 46 * 8); return dAccess<PackSourceFactory*>(this, ll::offset::RESOURCEPACKREPOSITORY_getPackSourceFactory);
}; };
#undef AFTER_EXTRA #undef AFTER_EXTRA
#ifndef DISABLE_CONSTRUCTOR_PREVENTION_RESOURCEPACKREPOSITORY #ifndef DISABLE_CONSTRUCTOR_PREVENTION_RESOURCEPACKREPOSITORY

View File

@ -13,7 +13,7 @@ class ScoreboardIdentityRef {
public: public:
enum IdentityDefinition::Type getIdentityType(){ enum IdentityDefinition::Type getIdentityType(){
//ServerScoreboard::_unpackIdentityDefToScorePacket Line30~31 16+72 //ServerScoreboard::_unpackIdentityDefToScorePacket Line30~31 16+72
return dAccess<enum IdentityDefinition::Type>(this, 88); return dAccess<enum IdentityDefinition::Type>(this, ll::offset::SCOREBOARDIDENTITYREF_getIdentityType);
}; };
#undef AFTER_EXTRA #undef AFTER_EXTRA

View File

@ -11,7 +11,12 @@
class SetDisplayObjectivePacket : public Packet { class SetDisplayObjectivePacket : public Packet {
#define AFTER_EXTRA #define AFTER_EXTRA
public:
std::string mDisplaySlotName;
std::string mObjectiveName;
std::string mObjectiveDisplayName;
std::string mCriteriaName;
ObjectiveSortOrder mSortOrder;
#undef AFTER_EXTRA #undef AFTER_EXTRA
#ifndef DISABLE_CONSTRUCTOR_PREVENTION_SETDISPLAYOBJECTIVEPACKET #ifndef DISABLE_CONSTRUCTOR_PREVENTION_SETDISPLAYOBJECTIVEPACKET
public: public:

View File

@ -6,12 +6,18 @@
#define BEFORE_EXTRA #define BEFORE_EXTRA
enum ScorePacketType {
Change = 0x0,
Remove_2 = 0x1,
};
#undef BEFORE_EXTRA #undef BEFORE_EXTRA
class SetScorePacket : public Packet { class SetScorePacket : public Packet {
#define AFTER_EXTRA #define AFTER_EXTRA
public:
ScorePacketType mType;
std::vector<ScorePacketInfo> mScoreInfo;
#undef AFTER_EXTRA #undef AFTER_EXTRA
#ifndef DISABLE_CONSTRUCTOR_PREVENTION_SETSCOREPACKET #ifndef DISABLE_CONSTRUCTOR_PREVENTION_SETSCOREPACKET
public: public:

View File

@ -12,7 +12,9 @@ class TransferPacket : public Packet {
#define AFTER_EXTRA #define AFTER_EXTRA
// Add Member There // Add Member There
char filler[40]; public:
std::string mServerAddress;
int mServerPort;
#undef AFTER_EXTRA #undef AFTER_EXTRA
#ifndef DISABLE_CONSTRUCTOR_PREVENTION_TRANSFERPACKET #ifndef DISABLE_CONSTRUCTOR_PREVENTION_TRANSFERPACKET
public: public:

View File

@ -514,7 +514,7 @@ public:
static void setup(CommandRegistry* registry) { static void setup(CommandRegistry* registry) {
registry->registerCommand("addons", "LiteLoaderBDS Addons Helper (Restart required after addon changes)", registry->registerCommand("addons", "LiteLoaderBDS Addons Helper (Restart required after addon changes)",
CommandPermissionLevel::GameMasters, {(CommandFlagValue)0}, {(CommandFlagValue)0x80}); CommandPermissionLevel::GameMasters, {(CommandFlagValue)0}, {(CommandFlagValue)0x40});
vector<string> addonsList; vector<string> addonsList;
for (auto& addon : addons) for (auto& addon : addons)

View File

@ -118,7 +118,7 @@ public:
static void setup(CommandRegistry* registry) { static void setup(CommandRegistry* registry) {
registry->registerCommand( registry->registerCommand(
"tpdim", "Teleport to Dimension", CommandPermissionLevel::GameMasters, "tpdim", "Teleport to Dimension", CommandPermissionLevel::GameMasters,
{(CommandFlagValue)0}, {(CommandFlagValue)0x80}); {(CommandFlagValue)0}, {(CommandFlagValue)0x40});
registry->addEnum<DimensionType>("DimensionType", registry->addEnum<DimensionType>("DimensionType",
{ {
{"overworld", DimensionType::OverWorld}, {"overworld", DimensionType::OverWorld},
@ -312,7 +312,7 @@ public:
static void setup(CommandRegistry* registry) { static void setup(CommandRegistry* registry) {
// Register Cmd // Register Cmd
registry->registerCommand("ll", "LiteLoaderBDS plugin operations", registry->registerCommand("ll", "LiteLoaderBDS plugin operations",
CommandPermissionLevel::Console, {(CommandFlagValue)0}, {(CommandFlagValue)0x80}); CommandPermissionLevel::Console, {(CommandFlagValue)0}, {(CommandFlagValue)0x40});
// Register softenum // Register softenum
vector<string> pluginList; vector<string> pluginList;
@ -372,7 +372,7 @@ public:
static void setup(CommandRegistry* registry) { static void setup(CommandRegistry* registry) {
registry->registerCommand("version", "Get the version of this server", registry->registerCommand("version", "Get the version of this server",
CommandPermissionLevel::GameMasters, {(CommandFlagValue)0}, {(CommandFlagValue)0x80}); CommandPermissionLevel::GameMasters, {(CommandFlagValue)0}, {(CommandFlagValue)0x40});
registry->registerOverload<VersionCommand>("version"); registry->registerOverload<VersionCommand>("version");
} }
}; };

View File

@ -10,7 +10,7 @@ bool isUnlockCmdEnabled = true;
void LogCommandRegistration(std::string const& name, char const* description, enum CommandPermissionLevel perm, short flag1, short flag2); void LogCommandRegistration(std::string const& name, char const* description, enum CommandPermissionLevel perm, short flag1, short flag2);
TInstanceHook(void, "?registerCommand@CommandRegistry@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEBDW4CommandPermissionLevel@@UCommandFlag@@3@Z", TInstanceHook(void, "?registerCommand@CommandRegistry@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEBDW4CommandPermissionLevel@@UCommandFlag@@3@Z",
CommandRegistry, std::string const& name, char const* description, enum CommandPermissionLevel perm, short flag1, short flag2) { CommandRegistry, std::string const& name, char const* description, enum CommandPermissionLevel perm, unsigned char flag1, unsigned char flag2) {
// For #643 // For #643
if (name.find(' ') == std::string::npos) { // If no space inside if (name.find(' ') == std::string::npos) { // If no space inside
// Check whether command is already exists before registering // Check whether command is already exists before registering
@ -20,7 +20,7 @@ TInstanceHook(void, "?registerCommand@CommandRegistry@@QEAAXAEBV?$basic_string@D
} }
} }
if (ll::globalConfig.enableUnlockCmd) { if (ll::globalConfig.enableUnlockCmd) {
flag1 |= 0x80; flag2 |= 0x40;
} }
if (ll::globalConfig.debugMode) { if (ll::globalConfig.debugMode) {
LogCommandRegistration(name, description, perm, flag1, flag2); LogCommandRegistration(name, description, perm, flag1, flag2);

File diff suppressed because it is too large Load Diff

View File

@ -5,11 +5,11 @@
#include <llapi/HookAPI.h> #include <llapi/HookAPI.h>
int Biome::getId() const { int Biome::getId() const {
return dAccess<int, 120>(this); return dAccess<int, ll::offset::BIOMEAPI_getID>(this);
} }
std::string const& Biome::getName() const { std::string const& Biome::getName() const {
return dAccess<std::string, 8>(this); return dAccess<std::string, ll::offset::BIOMEAPI_getName>(this);
} }
// Biome* Biome::fromId(int id) { // Biome* Biome::fromId(int id) {

View File

@ -34,7 +34,7 @@ string Block::getTypeName() const {
unsigned short Block::getTileData() { unsigned short Block::getTileData() {
// 等待大佬改进 // 等待大佬改进
auto tileData = dAccess<unsigned short, 8>(this); auto tileData = dAccess<unsigned short, ll::offset::BLOCKAPI_getTileData>(this);
auto blk = &getLegacyBlock(); auto blk = &getLegacyBlock();
if (((BlockLegacy*)blk)->toBlock(tileData) == (Block*)this) { if (((BlockLegacy*)blk)->toBlock(tileData) == (Block*)this) {
@ -64,5 +64,5 @@ bool Block::setNbt(CompoundTag* nbt) {
unsigned int const & Block::getRuntimeId() const{ unsigned int const & Block::getRuntimeId() const{
// Actor::_playFlySound Line7 // Actor::_playFlySound Line7
return dAccess<unsigned int>(this, 48); return dAccess<unsigned int>(this, ll::offset::BLOCKAPI_getRuntimeId);
} }

View File

@ -13,7 +13,7 @@ Block* BlockLegacy::toBlock(unsigned short tileData) {
} }
string BlockLegacy::getTypeName() { string BlockLegacy::getTypeName() {
return dAccess<string, 128>(this); return dAccess<string, ll::offset::BLOCKLEGACYAPI_getRuntimeId>(this);
} }
bool BlockLegacy::applyBoneMeal(BlockSource* a1, BlockPos* a2) { bool BlockLegacy::applyBoneMeal(BlockSource* a1, BlockPos* a2) {

View File

@ -6,7 +6,7 @@
#include <llapi/HookAPI.h> #include <llapi/HookAPI.h>
LIAPI std::string Container::getTypeName() { LIAPI std::string Container::getTypeName() {
ContainerType type = dAccess<ContainerType>(this, 8); //IDA Container::Container ContainerType type = dAccess<ContainerType>(this, ll::offset::CONTAINERAPI_getTypeName); //IDA Container::Container
// ContainerType type = getContainerType(); // ContainerType type = getContainerType();
return std::string{magic_enum::enum_name(type)}; return std::string{magic_enum::enum_name(type)};
} }

View File

@ -3,5 +3,5 @@
#include <llapi/HookAPI.h> #include <llapi/HookAPI.h>
ServerPlayer* GameMode::getPlayer() { ServerPlayer* GameMode::getPlayer() {
return dAccess<ServerPlayer*, 8>(this); return dAccess<ServerPlayer*, ll::offset::GAMEMODEAPI_getPlayer>(this);
} }

View File

@ -2,13 +2,13 @@
#include <llapi/HookAPI.h> #include <llapi/HookAPI.h>
FaceID HitResult::getFacing() { FaceID HitResult::getFacing() {
return dAccess<FaceID>(this, 28); return dAccess<FaceID>(this, ll::offset::HITRESULTAPI_getFacing);
} }
Vec3 HitResult::getPos() { Vec3 HitResult::getPos() {
return dAccess<Vec3>(this, 44); return dAccess<Vec3>(this, ll::offset::HITRESULTAPI_getPos);
} }
bool HitResult::isHitLiquid() { bool HitResult::isHitLiquid() {
return dAccess<bool>(this, 80); return dAccess<bool>(this, ll::offset::HITRESULTAPI_isHitLiquid);
} }
// LIAPI bool HitResult::isEntity() { // LIAPI bool HitResult::isEntity() {
// return getHitResultType() == HitResultType::ENTITY; // return getHitResultType() == HitResultType::ENTITY;
@ -17,13 +17,13 @@ bool HitResult::isHitLiquid() {
// return getHitResultType() == HitResultType::TILE; // return getHitResultType() == HitResultType::TILE;
// } // }
BlockPos HitResult::getBlockPos() { BlockPos HitResult::getBlockPos() {
return dAccess<BlockPos>(this, 32); return dAccess<BlockPos>(this, ll::offset::HITRESULTAPI_getBlockPos);
} }
BlockPos HitResult::getLiquidPos() { BlockPos HitResult::getLiquidPos() {
return dAccess<BlockPos>(this, 84); return dAccess<BlockPos>(this, ll::offset::HITRESULTAPI_getLiquidPos);
} }
FaceID HitResult::getLiquidFacing() { FaceID HitResult::getLiquidFacing() {
return dAccess<FaceID>(this, 81); return dAccess<FaceID>(this, ll::offset::HITRESULTAPI_getLiquidFacing);
} }
// LIAPI Vec3 HitResult::getLiquidHitPos(); // LIAPI Vec3 HitResult::getLiquidHitPos();
// LIAPI HitResultType HitResult::getHitResultType() { // LIAPI HitResultType HitResult::getHitResultType() {

View File

@ -3,18 +3,18 @@
#include <llapi/HookAPI.h> #include <llapi/HookAPI.h>
ItemStack* ItemActor::getItemStack() { ItemStack* ItemActor::getItemStack() {
return (ItemStack*)((uintptr_t)this + 1568); // IDA Player::take Line127 return &dAccess<ItemStack>(this, ll::offset::ITEMACTORAPI_getItemStack); // IDA Player::take Line127
} }
int ItemActor::getDespawnTime() { int ItemActor::getDespawnTime() {
return dAccess<int, 433*4>(this); // ItemActor::NormalTick Line258 return dAccess<int, ll::offset::ITEMACTORAPI_getDespawnTime>(this); // ItemActor::NormalTick Line258
} }
bool ItemActor::setDespawnTime(int a1) { bool ItemActor::setDespawnTime(int a1) {
dAccess<int, 433*4>(this) = a1; dAccess<int, ll::offset::ITEMACTORAPI_getDespawnTime>(this) = a1;
return true; return true;
} }
int ItemActor::getLatestSpawnTime() { int ItemActor::getLatestSpawnTime() {
return dAccess<int, 428*4>(this); return dAccess<int, ll::offset::ITEMACTORAPI_getLatestSpawnTime>(this);
} }

View File

@ -84,7 +84,7 @@ int ItemStack::getAux() const {
int ItemStack::getCount() const { int ItemStack::getCount() const {
if (this->isNull()) if (this->isNull())
return 0; return 0;
return dAccess<unsigned char, 34>(this); return dAccess<unsigned char, ll::offset::ITEMSTACKAPI_getCount>(this);
} }
bool ItemStack::setItem(ItemStack* newItem) { bool ItemStack::setItem(ItemStack* newItem) {
@ -112,7 +112,7 @@ bool ItemStack::setNbt(CompoundTag* nbt) {
int ItemStackBase::getCount() const { int ItemStackBase::getCount() const {
if (this->isNull()) if (this->isNull())
return 0; return 0;
return dAccess<unsigned char, 34>(this); return dAccess<unsigned char, ll::offset::ITEMSTACKAPI_getCount>(this);
} }
// string ItemStack::getStandardName(const Localization& language) { // string ItemStack::getStandardName(const Localization& language) {

View File

@ -65,7 +65,7 @@ Block* Level::getBlock(const BlockPos& pos, BlockSource* blockSource) {
BlockPalette* Level::getBlockPalettePtr(){ BlockPalette* Level::getBlockPalettePtr(){
// MovingBlockActor::load Line69 // MovingBlockActor::load Line69
return dAccess<BlockPalette*>(Global<Level>,2000); return dAccess<BlockPalette*>(Global<Level>,ll::offset::LEVELAPI_getBlockPalettePtr);
}; };
// Return nullptr when failing to get block // Return nullptr when failing to get block

View File

@ -47,13 +47,13 @@ extern Logger logger;
NetworkIdentifier* Player::getNetworkIdentifier() const{ NetworkIdentifier* Player::getNetworkIdentifier() const{
//ServerPlayer::isHostingPlayer //ServerPlayer::isHostingPlayer
return dAccess<NetworkIdentifier*>(this, 2432); return dAccess<NetworkIdentifier*>(this, ll::offset::PLAYERAPI_getNetworkIdentifier);
} }
Certificate* Player::getCertificate() const{ Certificate* Player::getCertificate() const{
//KickCommand::_kickPlayer Line116 //KickCommand::_kickPlayer Line116
return dAccess<Certificate*>(this, 2736); return dAccess<Certificate*>(this, ll::offset::PLAYERAPI_getCertificate);
} }
std::string Player::getRealName() { std::string Player::getRealName() {
@ -99,12 +99,12 @@ string Player::getServerAddress() {
int Player::getPlatform(){ int Player::getPlatform(){
//AddPlayerPacket::AddPlayerPacket Line59 //AddPlayerPacket::AddPlayerPacket Line59
return dAccess<int>(this, 2104); return dAccess<int>(this, ll::offset::PLAYERAPI_getPlatform);
} }
Container & Player::getInventory(){ Container & Player::getInventory(){
//InventoryContainerModel::_getContainer 2928 + 176 //InventoryContainerModel::_getContainer 2928 + 176
return dAccess<Container>(this, 3104); return dAccess<Container>(this, ll::offset::PLAYERAPI_getInventory);
} }
enum CommandPermissionLevel Player::getPlayerPermissionLevel(){ enum CommandPermissionLevel Player::getPlayerPermissionLevel(){
@ -258,12 +258,12 @@ bool Player::transferServer(const string& address, unsigned short port) {
BlockPos const & Player::getSpawnPosition(){ BlockPos const & Player::getSpawnPosition(){
//ServerNetworkHandler::_sendLevelData Line316 //ServerNetworkHandler::_sendLevelData Line316
return dAccess<BlockPos>(this, 1797*4); return dAccess<BlockPos>(this, ll::offset::PLAYERAPI_getSpawnPosition);
} }
AutomaticID<Dimension, int> Player::getSpawnDimension(){ AutomaticID<Dimension, int> Player::getSpawnDimension(){
//ServerNetworkHandler::_sendLevelData Line310 //ServerNetworkHandler::_sendLevelData Line310
return dAccess<AutomaticID<Dimension, int>>(this, 1800*4); return dAccess<AutomaticID<Dimension, int>>(this, ll::offset::PLAYERAPI_getSpawnDimension);
} }
std::pair<BlockPos, int> Player::getRespawnPosition() { std::pair<BlockPos, int> Player::getRespawnPosition() {
@ -322,12 +322,12 @@ string Player::getXuid() const{
} }
mce::UUID Player::getClientUUID()const{ mce::UUID Player::getClientUUID()const{
return dAccess<mce::UUID>(this,2720); return dAccess<mce::UUID>(this,ll::offset::PLAYERAPI_getClientUUID);
}; };
unsigned char Player::getClientSubId() { unsigned char Player::getClientSubId() {
//ServerPlayer::sendNetworkPacket 参4 //ServerPlayer::sendNetworkPacket 参4
return dAccess<unsigned char>(this,3520); return dAccess<unsigned char>(this,ll::offset::PLAYERAPI_getClientSubId);
} }
float Player::getAvgPacketLoss() { float Player::getAvgPacketLoss() {
@ -442,7 +442,7 @@ size_t Player::getTotalXpNeededForLevel(int level) {
bool Player::crashClient() { bool Player::crashClient() {
auto pkt = MinecraftPackets::createPacket(MinecraftPacketIds::LevelChunk); auto pkt = MinecraftPackets::createPacket(MinecraftPacketIds::LevelChunk);
dAccess<bool, 56>(pkt.get()) = 1; dAccess<bool, ll::offset::PLAYERAPI_crashClient>(pkt.get()) = 1;
sendNetworkPacket(*pkt); sendNetworkPacket(*pkt);
return true; return true;
} }
@ -684,8 +684,8 @@ bool Player::sendUpdateBlockPacket(BlockPos const& bpos, const Block& block, Upd
bool Player::sendTransferPacket(const string& address, short port) const { bool Player::sendTransferPacket(const string& address, short port) const {
auto packet = MinecraftPackets::createPacket(0x55); auto packet = MinecraftPackets::createPacket(0x55);
dAccess<short>(packet.get(), 36) = port; dAccess<short>(packet.get(), ll::offset::PLAYERAPI_sendTransferPacket_port) = port;
dAccess<string>(packet.get(), 40) = address; dAccess<string>(packet.get(), ll::offset::PLAYERAPI_sendTransferPacket_address) = address;
sendNetworkPacket(*packet); sendNetworkPacket(*packet);
return true; return true;
} }
@ -698,8 +698,8 @@ bool Player::sendSetDisplayObjectivePacket(const string& title, const string& na
bool Player::sendSetScorePacket(char type, const vector<ScorePacketInfo>& data) { bool Player::sendSetScorePacket(char type, const vector<ScorePacketInfo>& data) {
auto packet = MinecraftPackets::createPacket(0x6c); auto packet = MinecraftPackets::createPacket(0x6c);
dAccess<char>(packet.get(), 48) = type; dAccess<char>(packet.get(), ll::offset::PLAYERAPI_sendSetScorePacket_type) = type;
dAccess<vector<ScorePacketInfo>>(packet.get(), 56) = data; dAccess<vector<ScorePacketInfo>>(packet.get(), ll::offset::PLAYERAPI_sendSetScorePacket_data) = data;
sendNetworkPacket(*packet); sendNetworkPacket(*packet);
return true; return true;
} }
@ -750,7 +750,7 @@ bool Player::sendSetScorePacket(char type, const vector<ScorePacketInfo>& data)
bool Player::sendCommandRequestPacket(const string& cmd) { bool Player::sendCommandRequestPacket(const string& cmd) {
auto packet = MinecraftPackets::createPacket(0x4d); auto packet = MinecraftPackets::createPacket(0x4d);
dAccess<string, 48>(packet.get()) = cmd; dAccess<string, ll::offset::PLAYERAPI_sendCommandRequestPacket_cmd>(packet.get()) = cmd;
Global<ServerNetworkHandler>->handle(*getNetworkIdentifier(), *((CommandRequestPacket*)packet.get())); Global<ServerNetworkHandler>->handle(*getNetworkIdentifier(), *((CommandRequestPacket*)packet.get()));
return true; return true;
} }

View File

@ -6,7 +6,7 @@
#include <llapi/HookAPI.h> #include <llapi/HookAPI.h>
void ResourcePackRepository::setCustomResourcePackPath(PackType type, const std::string& path) { void ResourcePackRepository::setCustomResourcePackPath(PackType type, const std::string& path) {
auto CompositePack = dAccess<CompositePackSource*>(this, 48); auto CompositePack = dAccess<CompositePackSource*>(this, ll::offset::RESOURCEPACKREPOSITORYAPI_setCustomResourcePackPath);
auto PackSourceFactory = getPackSourceFactory(); auto PackSourceFactory = getPackSourceFactory();
auto& DirectoryPackSource = PackSourceFactory->createDirectoryPackSource(Core::Path(path), type, PackOrigin::PackOrigin_Dev, 0); auto& DirectoryPackSource = PackSourceFactory->createDirectoryPackSource(Core::Path(path), type, PackOrigin::PackOrigin_Dev, 0);
CompositePack->addPackSource((PackSource*)&DirectoryPackSource); CompositePack->addPackSource((PackSource*)&DirectoryPackSource);

View File

@ -142,12 +142,12 @@ void CompoundTag::setItemStack(ItemStack* item) {
} }
std::unique_ptr<CompoundTag> CompoundTag::fromBlock(Block* block) { std::unique_ptr<CompoundTag> CompoundTag::fromBlock(Block* block) {
auto tag = (CompoundTag*)((uintptr_t)block + 24); //dAccess Block::Block auto tag = dAccess<CompoundTag*>(block, ll::offset::COMPOUNDTAGAPI_fromBlock); //dAccess Block::Block
return tag->clone(); return tag->clone();
} }
void CompoundTag::setBlock(Block* blk) { void CompoundTag::setBlock(Block* blk) {
auto tag = (CompoundTag*)((uintptr_t)blk + 24);//dAccess Block::Block auto tag = dAccess<CompoundTag*>(blk, ll::offset::COMPOUNDTAGAPI_fromBlock);//dAccess Block::Block
tag->deepCopy(*this); tag->deepCopy(*this);
} }

@ -1 +1 @@
Subproject commit 15e2c6d7149054f36f103de0a86d58e4548a506f Subproject commit 23548dcf6a1761c0fab3268e733ac84b2b7ccee6

View File

@ -1,19 +1,42 @@
# Release 408.2.0 # Release 408.3.0
![BDS 1.16.40.02](https://img.shields.io/badge/BDS-1.16.40.02-blue?style=for-the-badge)&emsp;![Protocol 408](https://img.shields.io/badge/Protocol-408-orange?style=for-the-badge) ![BDS 1.16.40.02](https://img.shields.io/badge/BDS-1.16.40.02-blue?style=for-the-badge)&emsp;![Protocol 408](https://img.shields.io/badge/Protocol-408-orange?style=for-the-badge)
v408.3.x 版本变更内容
## Added ## Added
* Null * 添加`ActorBlockSyncMessage`结构
* 添加`Potion::PotionType`成员
* 添加`Potion::PotionVariant`成员
## Changed ## Changed
* 重构文件结构 * 集中偏移量到一个头文件
* 更改LL命名空间至ll * 规范`EventAPI.h`里变量命名
* 添加SDK库![SDK-cpp](https://github.com/quizhizhe/LL-SDK-cpp-1.16.40) * 补全`Explosion`类
* 补全`HitResult`类
* 部分补全`LevelContainerModel`类
## Fixed ## Fixed
* Fix AttributeInstance class * 修复`PlayerDropItem`事件
* 修复`BlockExploded`事件
* 修复`ContainerChange`事件,未测试,可能有问题
* 修复`ProjectileHitBlock`事件
* 修复`MobHurt`事件
* 修复`ProjectileHitEntity`事件
* 修复`ProjectileSpawn`事件
* 修复`SetScorePacket`类
* 修复`TransferPacket`类
* 修复`SetDisplayObjectivePacket`类
* 修正`HitResult::getEntity`函数
**Full Changelog**: https://github.com/quizhizhe/LiteLoaderBDS-1.16.40/compare/408.1.0...408.2.0 v408.3.1
* 修复指令在无作弊情况下不能使用
## Other
* 已发布到Tooth库可使用[Lip](https://github.com/LiteLDev/Lip)或者[LipUI](https://github.com/LiteLDev/LipUI)进行安装
**Full Changelog**: https://github.com/quizhizhe/LiteLoaderBDS-1.16.40/compare/408.2.0...408.3.0

View File

@ -19,7 +19,7 @@ using namespace std;
bool RegisterCmd(const string& cmd, const string& describe, int cmdLevel) { bool RegisterCmd(const string& cmd, const string& describe, int cmdLevel) {
::Global<CommandRegistry>->registerCommand(cmd, describe.c_str(), (CommandPermissionLevel)cmdLevel, {(CommandFlagValue)0}, ::Global<CommandRegistry>->registerCommand(cmd, describe.c_str(), (CommandPermissionLevel)cmdLevel, {(CommandFlagValue)0},
{(CommandFlagValue)0x80}); {(CommandFlagValue)0x40});
return true; return true;
} }

View File

@ -87,7 +87,6 @@ ClassDefine<PlayerClass> PlayerClassBuilder =
.instanceProperty("isAdventure", &PlayerClass::isAdventure) .instanceProperty("isAdventure", &PlayerClass::isAdventure)
.instanceProperty("isGliding", &PlayerClass::isGliding) .instanceProperty("isGliding", &PlayerClass::isGliding)
.instanceProperty("isSurvival", &PlayerClass::isSurvival) .instanceProperty("isSurvival", &PlayerClass::isSurvival)
// .instanceProperty("isSpectator", &PlayerClass::isSpectator)
.instanceProperty("isRiding", &PlayerClass::isRiding) .instanceProperty("isRiding", &PlayerClass::isRiding)
.instanceProperty("isDancing", &PlayerClass::isDancing) .instanceProperty("isDancing", &PlayerClass::isDancing)
.instanceProperty("isCreative", &PlayerClass::isCreative) .instanceProperty("isCreative", &PlayerClass::isCreative)

View File

@ -33,7 +33,7 @@ echo.
if not exist LiteLoaderSDK/Header/ ( if not exist LiteLoaderSDK/Header/ (
echo [WARNING] LiteLoaderSDK files no found. Pulling from remote... echo [WARNING] LiteLoaderSDK files no found. Pulling from remote...
echo. echo.
git clone %LL_SDK_REMOTE_PATH% git clone %LL_SDK_REMOTE_PATH% LiteLoaderSDK
) )
cd LiteLoaderSDK cd LiteLoaderSDK

64
Scripts/UploadTooth.sh Normal file
View File

@ -0,0 +1,64 @@
#!/bin/bash
TOOTH_REMOTE_PATH=https://github.com/Tooth-Hub/LiteLoaderBDS-Legacy.git
cd ..
echo [INFO] Fetching LiteLoaderBDS-Legacy Tooth to GitHub ...
git config --global core.autocrlf false
# 获取标签
#now_tag=$(git describe --tags --always | cut -d "-" -f 1)
now_tag=$1
echo NOW_TAG $now_tag
echo [INFO] LiteLoaderBDS-Legacy Tooth Pulling from remote...
echo
git clone ${TOOTH_REMOTE_PATH} Tooth
# cd LiteLoaderBDS-Legacy
# git fetch --all
# git reset --hard origin/Protocol-408
# git checkout Protocol-408
# cd ..
echo
echo [INFO] Fetching LiteLoaderBDS-Legacy Tooth to GitHub finished
echo
# copy all from build/sdk to LiteLoaderSDK
cp -r build/LiteLoaderBDS/* Tooth
cd Tooth
vers=" \"version\": \"${now_tag:1}\","
#modify tooth.json
sed -i "4c\ ${vers}" ./tooth.json
now_status=$(git status . -s)
if [ "$now_status" ]; then
echo [INFO] Modified files found.
echo
git add .
git commit -m "${now_tag}"
git tag ${now_tag}
echo
echo [INFO] Pushing to origin...
echo
git push https://${USERNAME}:${REPO_KEY}@github.com/Tooth-Hub/LiteLoaderBDS-Legacy.git Protocol-408
git push --tags https://${USERNAME}:${REPO_KEY}@github.com/Tooth-Hub/LiteLoaderBDS-Legacy.git Protocol-408
cd ..
echo
echo [INFO] Upload finished.
echo
else
cd ..
echo
echo
echo [INFO] No modified files found.
echo [INFO] No need to Upgrade LiteLoaderBDS-Legacy.
fi

View File

@ -3,7 +3,6 @@ project(SymDBHelper)
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17)
set(CMAKE_BUILD_TYPE Release) set(CMAKE_BUILD_TYPE Release)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}/LiteLoader/Lib/)
add_definitions(-D"NDEBUG" -D"_LIB" -D"_UNICODE" -D"UNICODE") add_definitions(-D"NDEBUG" -D"_LIB" -D"_UNICODE" -D"UNICODE")
@ -13,4 +12,12 @@ add_compile_options(
) )
add_library(SymDBHelper STATIC SymDBHelper.cpp) add_library(SymDBHelper STATIC SymDBHelper.cpp)
target_link_libraries(SymDBHelper Demangler) target_link_libraries(SymDBHelper Demangler)
# use hardcode path to avoid the problem of different build path
add_custom_command(
TARGET SymDBHelper POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:SymDBHelper> ${CMAKE_BINARY_DIR}/sdk/lib/
COMMENT "Copying lib to sdk directory"
VERBATIM
)