1
0
mirror of https://github.com/p2r3/bareiron.git synced 2025-10-02 07:35:08 +02:00

handle breaking columns of blocks

This commit is contained in:
p2r3
2025-08-21 00:41:20 +03:00
parent 48b03f9e04
commit b6b091f600
3 changed files with 62 additions and 22 deletions

View File

@@ -438,24 +438,10 @@ int cs_playerAction (int client_fd) {
int sequence = readVarInt(client_fd);
sc_acknowledgeBlockChange(client_fd, sequence);
if ((action == 0 && GAMEMODE == 1)) {
// block was mined in creative
makeBlockChange(x, y, z, 0);
} else if (action == 2) {
// block was mined in survival
PlayerData *player;
if (getPlayerData(client_fd, &player)) return 1;
uint8_t block = getBlockAt(x, y, z);
uint16_t item = getMiningResult(client_fd, block);
makeBlockChange(x, y, z, 0);
if (item) {
PlayerData *player;
if (getPlayerData(client_fd, &player)) return 1;
givePlayerItem(player, item, 1);
}
}
handlePlayerAction(player, action, x, y, z);
return 0;