forked from EXTERNAL/bareiron
optimize block changes struct
This commit is contained in:
@@ -42,7 +42,7 @@ extern uint32_t rng_seed;
|
||||
|
||||
typedef struct {
|
||||
short x;
|
||||
short y;
|
||||
uint8_t y;
|
||||
short z;
|
||||
uint8_t block;
|
||||
} BlockChange;
|
||||
|
@@ -330,7 +330,7 @@ int givePlayerItem (PlayerData *player, uint16_t item, uint8_t count) {
|
||||
|
||||
}
|
||||
|
||||
uint8_t getBlockChange (short x, short y, short z) {
|
||||
uint8_t getBlockChange (short x, uint8_t y, short z) {
|
||||
for (int i = 0; i < block_changes_count; i ++) {
|
||||
if (block_changes[i].block == 0xFF) continue;
|
||||
if (
|
||||
@@ -342,7 +342,7 @@ uint8_t getBlockChange (short x, short y, short z) {
|
||||
return 0xFF;
|
||||
}
|
||||
|
||||
void makeBlockChange (short x, short y, short z, uint8_t block) {
|
||||
void makeBlockChange (short x, uint8_t y, short z, uint8_t block) {
|
||||
|
||||
// Transmit block update to all in-game clients
|
||||
for (int i = 0; i < MAX_PLAYERS; i ++) {
|
||||
|
@@ -42,8 +42,8 @@ int givePlayerItem (PlayerData *player, uint16_t item, uint8_t count);
|
||||
uint8_t serverSlotToClientSlot (int window_id, uint8_t slot);
|
||||
uint8_t clientSlotToServerSlot (int window_id, uint8_t slot);
|
||||
|
||||
uint8_t getBlockChange (short x, short y, short z);
|
||||
void makeBlockChange (short x, short y, short z, uint8_t block);
|
||||
uint8_t getBlockChange (short x, uint8_t y, short z);
|
||||
void makeBlockChange (short x, uint8_t y, short z, uint8_t block);
|
||||
|
||||
uint16_t getMiningResult (int client_fd, uint8_t block);
|
||||
|
||||
|
Reference in New Issue
Block a user