Skip to content

Commit

Permalink
v0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
engsr6982 committed Jan 30, 2025
1 parent 57b8f2e commit ec693e0
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 29 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.4.1] - 2025-01-30

### Changed

- 适配 iListenAttentively v0.2.3

## [0.4.0] - 2025-01-27

### Changed
Expand All @@ -15,7 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- 暂时移除液体事件(事件库Bug
- 暂时移除液体事件(事件库 Bug

## [0.4.0-rc.2] - 2025-01-13

Expand All @@ -36,7 +42,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- 修复一些bug (记不清了)
- 修复一些 bug (记不清了)

## [0.3.1] - 2024-12-17

Expand Down
49 changes: 26 additions & 23 deletions src/EventListener.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "pland/utils/MC.h"
#include <functional>
#include <optional>
#include <unordered_set>


#include "ll/api/event/entity/ActorHurtEvent.h"
Expand All @@ -31,24 +32,24 @@
#include "ll/api/event/world/FireSpreadEvent.h"


#include "ila/event/minecraft/actor/ActorRideEvent.h"
#include "ila/event/minecraft/actor/ActorTriggerPressurePlateEvent.h"
#include "ila/event/minecraft/actor/ArmorStandSwapItemEvent.h"
#include "ila/event/minecraft/actor/MobHurtEffectEvent.h"
#include "ila/event/minecraft/actor/ProjectileCreateEvent.h"
#include "ila/event/minecraft/world/actor/ActorRideEvent.h"
#include "ila/event/minecraft/world/actor/ActorTriggerPressurePlateEvent.h"
#include "ila/event/minecraft/world/actor/ArmorStandSwapItemEvent.h"
#include "ila/event/minecraft/world/actor/MobHurtEffectEvent.h"
#include "ila/event/minecraft/world/actor/ProjectileCreateEvent.h"
// #include "ila/event/minecraft/level/SculkCatalystAbsorbExperienceEvent.h"
#include "ila/event/minecraft/player/PlayerAttackBlockEvent.h"
#include "ila/event/minecraft/player/PlayerDropItemEvent.h"
#include "ila/event/minecraft/player/PlayerOperatedItemFrameEvent.h"
#include "ila/event/minecraft/world/ExplosionEvent.h"
#include "ila/event/minecraft/world/FarmDecayEvent.h"
#include "ila/event/minecraft/world/LiquidTryFlowEvent.h"
#include "ila/event/minecraft/world/MossGrowthEvent.h"
#include "ila/event/minecraft/world/PistonPushEvent.h"
#include "ila/event/minecraft/world/RedstoneUpdateEvent.h"
#include "ila/event/minecraft/world/SculkBlockGrowthEvent.h"
#include "ila/event/minecraft/world/SculkSpreadEvent.h"
#include "ila/event/minecraft/world/WitherDestroyEvent.h"
#include "ila/event/minecraft/world/actor/player/PlayerAttackBlockEvent.h"
#include "ila/event/minecraft/world/actor/player/PlayerDropItemEvent.h"
#include "ila/event/minecraft/world/actor/player/PlayerOperatedItemFrameEvent.h"
#include "ila/event/minecraft/world/level/block/FarmDecayEvent.h"
#include "ila/event/minecraft/world/level/block/LiquidTryFlowEvent.h"
#include "ila/event/minecraft/world/level/block/MossGrowthEvent.h"
#include "ila/event/minecraft/world/level/block/SculkSpreadEvent.h"


ll::event::ListenerPtr mPlayerJoinEvent; // 玩家加入服务器
Expand Down Expand Up @@ -397,6 +398,11 @@ bool EventListener::setup() {

logger->debug("[AttackBlock] {}", ev.getPos().toString());

static std::unordered_set<string> whiteList = {
"minecraft:clock" //
};
if (whiteList.contains(player.getSelectedItem().getTypeName())) return true; // 白名单

auto land = db->getLandAt(ev.getPos(), player.getDimensionId());
if (PreCheck(land, player.getUuid().asString())) {
return true;
Expand Down Expand Up @@ -654,7 +660,7 @@ bool EventListener::setup() {

mMossFertilizerEvent =
bus->emplaceListener<ila::mc::MossGrowthBeforeEvent>([db, logger](ila::mc::MossGrowthBeforeEvent& ev) {
logger->debug("[MossSpread] {}", ev.getPos().toString());
// logger->debug("[MossSpread] {}", ev.getPos().toString());

auto const& pos = ev.getPos();

Expand All @@ -675,18 +681,15 @@ bool EventListener::setup() {

mLiquidFlowEvent =
bus->emplaceListener<ila::mc::LiquidTryFlowBeforeEvent>([db, logger](ila::mc::LiquidTryFlowBeforeEvent& ev) {
// auto& sou = ev.getPos();
auto& sou = ev.getPos();
// auto& from = ev.getFlowFromPos();
// logger->debug("[LiquidFlow] {} -> {}", sou.toString(), from.toString());

// auto land = db->getLandAt(sou, ev.blockSource().getDimensionId());
// if (land) {
// if (!land->getLandPermTableConst().allowLiquidFlow) {
// ev.cancel();
// return;
// }
// }
// ev.cancel();
auto land = db->getLandAt(sou, ev.blockSource().getDimensionId());
if (land && !land->getLandPermTableConst().allowLiquidFlow) {
ev.cancel();
return;
}
});

// mSculkCatalystAbsorbExperienceEvent = bus->emplaceListener<more_events::SculkCatalystAbsorbExperienceEvent>(
Expand Down Expand Up @@ -725,7 +728,7 @@ bool EventListener::setup() {

mSculkSpreadEvent =
bus->emplaceListener<ila::mc::SculkSpreadBeforeEvent>([db, logger](ila::mc::SculkSpreadBeforeEvent& ev) {
logger->debug("[SculkSpread] {} -> {}", ev.getSelfPos().toString(), ev.getTargetPos().toString());
// logger->debug("[SculkSpread] {} -> {}", ev.getSelfPos().toString(), ev.getTargetPos().toString());

auto sou = db->getLandAt(ev.getSelfPos(), ev.blockSource().getDimensionId());
auto tar = db->getLandAt(ev.getTargetPos(), ev.blockSource().getDimensionId());
Expand Down
6 changes: 3 additions & 3 deletions tooth.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"format_version": 2,
"tooth": "github.com/engsr6982/PLand",
"version": "0.4.0",
"version": "0.4.1",
"info": {
"name": "PLand - 领地系统",
"description": "基于 LeviLamina 的领地系统",
Expand All @@ -13,11 +13,11 @@
"pland"
]
},
"asset_url": "https://github.com/engsr6982/PLand/releases/download/v0.4.0/PLand-windows-x64.zip",
"asset_url": "https://github.com/engsr6982/PLand/releases/download/v0.4.1/PLand-windows-x64.zip",
"prerequisites": {
"github.com/LiteLDev/LeviLamina": ">=1.0.0-rc.3 <=1.1.0",
"github.com/LiteLDev/LegacyMoney": ">=0.9.0-rc.1",
"github.com/MiracleForest/iListenAttentively-Release": ">=0.2.2"
"github.com/MiracleForest/iListenAttentively-Release": ">=0.2.3"
},
"files": {
"place": [
Expand Down
2 changes: 1 addition & 1 deletion xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ end
add_requires("levibuildscript")
add_requires("exprtk 0.0.3")
add_requires("legacymoney 0.9.0-rc.1")
add_requires("ilistenattentively 0.2.2")
add_requires("ilistenattentively 0.2.3")
-- add_requireconfs("**.magic_enum", {override = true, version = "0.9.7"}) -- override ilistenattentively's magic_enum version
-- add_requireconfs("**.levilamina", {override = true, version = "1.0.0-rc.2", configs = {target_type = "server"}}) -- override ilistenattentively's levilamina version

Expand Down

0 comments on commit ec693e0

Please sign in to comment.