Skip to content

Commit cfc837e

Browse files
committed
fix: fix onProjectileHitBlock & onProjectileHitEntity #108
1 parent 9c81c2d commit cfc837e

8 files changed

+34
-18
lines changed

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.7.4] - 2024-05-02
9+
10+
### Changed
11+
12+
- Make onPlaceBlock returning placing face
13+
14+
### Fixed
15+
16+
- Fix truePos pre calculation
17+
- Fix onProjectileHitBlock & onProjectileHitEntity #108
18+
819
## [0.7.3] - 2024-05-01
920

1021
### Fixed
@@ -334,6 +345,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
334345
[#110]: https://github.com/LiteLDev/LegacyScriptEngine/issues/110
335346
[#115]: https://github.com/LiteLDev/LegacyScriptEngine/issues/115
336347

348+
[0.7.4]: https://github.com/LiteLDev/LegacyScriptEngine/compare/v0.7.3...v0.7.4
337349
[0.7.3]: https://github.com/LiteLDev/LegacyScriptEngine/compare/v0.7.2...v0.7.3
338350
[0.7.2]: https://github.com/LiteLDev/LegacyScriptEngine/compare/v0.7.1...v0.7.2
339351
[0.7.1]: https://github.com/LiteLDev/LegacyScriptEngine/compare/v0.7.0...v0.7.1

manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "native",
55
"description": "A plugin engine for running LLSE plugins on LeviLamina",
66
"author": "LiteLDev",
7-
"version": "0.7.3",
7+
"version": "0.7.4",
88
"dependencies": [
99
{
1010
"name": "LegacyMoney"

src/legacy/events/EventHooks.cpp

+14-10
Original file line numberDiff line numberDiff line change
@@ -1006,11 +1006,13 @@ LL_TYPE_INSTANCE_HOOK(
10061006
HitResult const& res
10071007
) {
10081008
IF_LISTENED(EVENT_TYPES::onProjectileHitEntity) {
1009-
CallEventVoid(
1010-
EVENT_TYPES::onProjectileHitEntity,
1011-
EntityClass::newEntity(res.getEntity()),
1012-
EntityClass::newEntity(&owner)
1013-
);
1009+
if (res.getEntity()) {
1010+
CallEventVoid(
1011+
EVENT_TYPES::onProjectileHitEntity,
1012+
EntityClass::newEntity(res.getEntity()),
1013+
EntityClass::newEntity(&owner)
1014+
);
1015+
}
10141016
}
10151017
IF_LISTENED_END(EVENT_TYPES::onProjectileHitEntity);
10161018
origin(owner, res);
@@ -1027,11 +1029,13 @@ LL_TYPE_INSTANCE_HOOK(
10271029
Actor const& projectile
10281030
) {
10291031
IF_LISTENED(EVENT_TYPES::onProjectileHitBlock) {
1030-
CallEventVoid(
1031-
EVENT_TYPES::onProjectileHitBlock,
1032-
BlockClass::newBlock(this, &pos, &region),
1033-
EntityClass::newEntity(&const_cast<Actor&>(projectile))
1034-
);
1032+
if (pos != BlockPos::ZERO && !this->isAir()) {
1033+
CallEventVoid(
1034+
EVENT_TYPES::onProjectileHitBlock,
1035+
BlockClass::newBlock(this, &pos, &region),
1036+
EntityClass::newEntity(&const_cast<Actor&>(projectile))
1037+
);
1038+
}
10351039
}
10361040
IF_LISTENED_END(EVENT_TYPES::onProjectileHitBlock);
10371041
origin(region, pos, projectile);

tooth.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"format_version": 2,
33
"tooth": "github.com/LiteLDev/LegacyScriptEngine",
4-
"version": "0.7.3",
4+
"version": "0.7.4",
55
"info": {
66
"name": "LegacyScriptEngine",
77
"description": "A plugin engine for running LLSE plugins on LeviLamina",
@@ -12,7 +12,7 @@
1212
]
1313
},
1414
"dependencies": {
15-
"gitea.litebds.com/LiteLDev/legacy-script-engine-lua": "0.7.3",
16-
"gitea.litebds.com/LiteLDev/legacy-script-engine-quickjs": "0.7.3"
15+
"gitea.litebds.com/LiteLDev/legacy-script-engine-lua": "0.7.4",
16+
"gitea.litebds.com/LiteLDev/legacy-script-engine-quickjs": "0.7.4"
1717
}
1818
}

tooth.lua.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"format_version": 2,
33
"tooth": "gitea.litebds.com/LiteLDev/legacy-script-engine-lua",
4-
"version": "0.7.3",
4+
"version": "0.7.4",
55
"info": {
66
"name": "LegacyScriptEngine with Lua backend",
77
"description": "A plugin engine for running LLSE plugins on LeviLamina",

tooth.nodejs.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"format_version": 2,
33
"tooth": "gitea.litebds.com/LiteLDev/legacy-script-engine-nodejs",
4-
"version": "0.7.3",
4+
"version": "0.7.4",
55
"info": {
66
"name": "LegacyScriptEngine with NodeJs backend",
77
"description": "A plugin engine for running LLSE plugins on LeviLamina",

tooth.python.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"format_version": 2,
33
"tooth": "gitea.litebds.com/LiteLDev/legacy-script-engine-python",
4-
"version": "0.7.3",
4+
"version": "0.7.4",
55
"info": {
66
"name": "LegacyScriptEngine with Python backend",
77
"description": "A plugin engine for running LLSE plugins on LeviLamina",

tooth.quickjs.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"format_version": 2,
33
"tooth": "gitea.litebds.com/LiteLDev/legacy-script-engine-quickjs",
4-
"version": "0.7.3",
4+
"version": "0.7.4",
55
"info": {
66
"name": "LegacyScriptEngine with QuickJs backend",
77
"description": "A plugin engine for running LLSE plugins on LeviLamina",

0 commit comments

Comments
 (0)