add readme for discord

This commit is contained in:
Protryon 2019-05-05 01:11:44 -07:00
parent 4aecba3204
commit 2b4222d72e
4 changed files with 11 additions and 6 deletions

View File

@ -1,6 +1,10 @@
# Basin
A high performance Minecraft server implementation written in C.
## Discord Server
Join the Discord server [here](https://discord.gg/3uW2QQV).
# Goals
* Pure performance: minimum resource usage for a full Minecraft server implementation
* Drop-in replacement: compatible with Spigot API plugins via JNI, standard Minecraft world format (Anvil)

View File

@ -1033,7 +1033,8 @@ void tick_entity(struct world* world, struct entity* entity) {
damageEntity(entity, 1., 0);
}
if (ei != NULL && ei->onTick != NULL) {
if ((*ei->onTick)(world, entity)) {
(*ei->onTick)(world, entity);
if (entity->despawn) {
return;
}
}

View File

@ -188,14 +188,11 @@ void tick_arrow(struct world* world, struct entity* entity) {
return 1;
}
}
//printf("hf2c = %f, %f, %f\n", entity->x, entity->y, entity->z);
if (entity->data.arrow.ticksInGround == 0) {
float dhz = sqrtf(entity->motX * entity->motX + entity->motZ * entity->motZ);
entity->yaw = atan2f(entity->motX, entity->motZ) * 180. / M_PI;
entity->pitch = atan2f(entity->motY, dhz) * 180. / M_PI;
//printf("desired %f, %f, %f\n", entity->pitch, entity->motY, dhz);
//printf("yaw = %f, last_yaw = %f\npitch = %f, last_pitch = %f\n", entity->yaw, entity->last_yaw, entity->pitch, entity->last_pitch);
if ((entity->last_yaw == 0. && entity->last_pitch == 0.)) {
entity->last_yaw = entity->yaw;
entity->last_pitch = entity->pitch;
@ -215,7 +212,7 @@ void tick_arrow(struct world* world, struct entity* entity) {
return 0;
}
int tick_itemstack(struct world* world, struct entity* entity) {
void tick_itemstack(struct world* world, struct entity* entity) {
if (entity->data.itemstack.delayBeforeCanPickup > 0) {
entity->data.itemstack.delayBeforeCanPickup--;
return 0;

View File

@ -888,7 +888,7 @@ void world_tick(struct world* world) {
pthread_rwlock_rdlock(&world->players->rwlock);
ITER_MAP(world->players) {
struct player* player = (struct player*) value;
player_tick(world, player);
player_tick(player);
tick_entity(world, player->entity); // might need to be moved into separate loop later
ITER_MAP_END();
}
@ -899,6 +899,9 @@ void world_tick(struct world* world) {
ITER_MAP(world->entities) {
struct entity* entity = (struct entity*) value;
if (entity->type != ENT_PLAYER) tick_entity(world, entity);
if (entity->despawn) {
pfree(entity->pool);
}
ITER_MAP_END();
}
pthread_rwlock_unlock(&world->entities->rwlock);