mirror of
https://github.com/zyllian/classics.git
synced 2025-01-18 03:32:41 -08:00
properly restrict placement/breaking of bedrock
This commit is contained in:
parent
8bdb6e4ee5
commit
947fd1271f
1 changed files with 8 additions and 1 deletions
|
@ -229,7 +229,8 @@ async fn handle_stream_inner(
|
||||||
let block =
|
let block =
|
||||||
data.level.get_block(x as usize, y as usize, z as usize);
|
data.level.get_block(x as usize, y as usize, z as usize);
|
||||||
// check if bedrock
|
// check if bedrock
|
||||||
if block == 0x07
|
// TODO: genericize this
|
||||||
|
if (block == 0x07 || block_type == 0x07)
|
||||||
&& data
|
&& data
|
||||||
.players
|
.players
|
||||||
.iter()
|
.iter()
|
||||||
|
@ -238,6 +239,12 @@ async fn handle_stream_inner(
|
||||||
})
|
})
|
||||||
.unwrap_or_default() != PlayerType::Operator
|
.unwrap_or_default() != PlayerType::Operator
|
||||||
{
|
{
|
||||||
|
reply_queue.push_back(ServerPacket::SetBlock {
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
z,
|
||||||
|
block_type: block,
|
||||||
|
});
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let packet = ServerPacket::SetBlock {
|
let packet = ServerPacket::SetBlock {
|
||||||
|
|
Loading…
Add table
Reference in a new issue