implement sheep shearing

* Added shearing sheeps

* Added empty line

* Changed comment in MobData to say what the middle 1 bit is used for

* Replaced if statements with a switch statement and early returns

* Send mob metadata to players that join

* Fixed mob metadata getting freed when exiting the switch statement

* remove currently unnecessary check

* use bitwise and in place of modulo

* style nitpicks

---------

Co-authored-by: p2r3 <p2r3@p2r3.com>
This commit is contained in:
SDFTDusername
2025-09-16 12:36:42 +02:00
committed by GitHub
parent 244c98552f
commit ba86dfd927
5 changed files with 102 additions and 7 deletions

View File

@@ -1179,7 +1179,9 @@ int cs_interact (int client_fd) {
// Ignore sneaking flag
recv_all(client_fd, recv_buffer, 1, false);
if (type == 1) {
if (type == 0) { // Interact
interactEntity(entity_id, client_fd);
} else if (type == 1) { // Attack
hurtEntity(entity_id, client_fd, D_generic, 1);
}