Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
OEOTYAN committed Mar 23, 2023
1 parent e59c1cd commit 3eb8ebf
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions core/command/allCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ namespace worldedit {
auto xuid = player->getXuid();
auto& playerData = getPlayersData(xuid);
if (results["bool"].get<bool>()) {
playerData.updateArg = 3;
playerData.updateArg = 1;
output.trSuccess("worldedit.neighberupdate.on");
} else {
playerData.updateArg = 2;
playerData.updateArg = 0;
output.trSuccess("worldedit.neighberupdate.off");
}
},
Expand Down
10 changes: 6 additions & 4 deletions core/data/PlayerData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ namespace worldedit {
// if (be != nullptr) {
// clearBlockEntity(be);
// }
auto& dim = blockSource->getDimension();
if (updateExArg % 2 == 1) {
res |= blockSource->setExtraBlock(pos, *BedrockBlocks::mAir, updateArg);
res |= blockSource->setBlock(pos, *block, updateArg, nullptr, nullptr);
Expand All @@ -127,18 +128,19 @@ namespace worldedit {
res |= blockSource->setExtraBlock(pos, *exblock, updateArg);
}
if (res) {
blockSource->getDimension().forEachPlayer([&](Player& player) -> bool {
dim.forEachPlayer([&](Player& player) -> bool {
player.sendUpdateBlockPacket(pos, *block, UpdateBlockFlags::BlockUpdateAll,
UpdateBlockLayer::UpdateBlockDefault);
player.sendUpdateBlockPacket(pos, *exblock, UpdateBlockFlags::BlockUpdateAll,
UpdateBlockLayer::UpdateBlockLiquid);
return true;
});
}
} else {
res |= blockSource->setExtraBlock(pos, *StaticVanillaBlocks::mFlowingWater, updateArg);
res |= blockSource->setBlock(pos, *block, updateArg, nullptr, nullptr);
res |= blockSource->setExtraBlock(pos, *StaticVanillaBlocks::mFlowingWater, updateArg + 2);
res |= blockSource->setBlock(pos, *block, updateArg + 2, nullptr, nullptr);
}
} else {
auto& dim = blockSource->getDimension();
ChunkBlockPos cpos(pos, dim.getMinHeight());
SubChunkPos scpos(pos);
LevelChunk* chunk = blockSource->getChunkAt(pos);
Expand Down
2 changes: 1 addition & 1 deletion core/data/PlayerData.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace worldedit {
public:
std::string xuid = "";
int maxHistoryLength = 20;
int updateArg = 2;
int updateArg = 0;
int updateExArg = 1;

BlockPos mainPos;
Expand Down
3 changes: 3 additions & 0 deletions core/store/BlockListPattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,9 @@ namespace worldedit {
}
i2++;
}
for(auto& ssss : tmpSNBTs){
logger().info("{}",ssss);
}
rawBlockIter.block = Block::create(CompoundTag::fromSNBT(tmpSNBTs[0]).get());
if (tmpSNBTs.size() > 1) {
rawBlockIter.exBlock = Block::create(CompoundTag::fromSNBT(tmpSNBTs[1]).get());
Expand Down

0 comments on commit 3eb8ebf

Please sign in to comment.