* feat: add detached flag to run in foreground with detached stdin
* adjust contributors
* fix code style
* ref: move detached cin check to handleinput
* Update CONTRIBUTORS
* WIP: Remove blocking GetHeight
* Make CheckBasicStyle.lua happy
* Update comment and style
* Update lua bindings and docs
* Rework chunk loading in GenerateRandomSpawn
Explicitly use chunk stays instead of relying on chunks loaded by
`cSpawnPrepare` to not unload.
* Fix variable shadowing
* Update to C++17
* Add note about empty chunks to IsWeatherWetAtXYZ API docs
* Cleanup, fix some of the remaining merge issues.
---------
Co-authored-by: Alexander Harkness <me@bearbin.net>
* Add walking and running speed to monsters.ini
* Add entry to CONTRIBUTORS
* Add SetRelativeRunSpeed to APIDesc.lua
* Fix typo
* Remove unnecessary cast
Co-Authored-By: peterbell10 <peterbell10@live.co.uk>
* Use relative walk speed as a modifier to base walk and run speeds
* Rename Default to Base in Walk/Run Speeds
* Update docs.
---------
Co-authored-by: peterbell10 <peterbell10@live.co.uk>
Co-authored-by: Alexander Harkness <me@bearbin.net>
* block area in chunk desc now handles block entities
some minor changes
block entities validate and correct their position when put into the world
* fixed checkstyle
* Fixed Build
* Removed Empty File
---------
Co-authored-by: 12xx12 <12xx12100@gmail.com>
Co-authored-by: Alexander Harkness <me@bearbin.net>
* fixes for api changes in embedtls
* Use mbedtls 2.28.9
* Update mbedtls to point to merged master commit.
* Fix indentation style.
---------
Co-authored-by: Alexander Harkness <me@bearbin.net>
* return false in cChunkMap::GetBlockTypeMeta if requested height is invalid
* add checks to users of cWorld::GetBlockTypeMeta
* add checks for invalid height to cChunkMap::GetBlock and cChunkMap::GetBlockMeta
* add hle0 to CONTRIBUTORS
* Fix merge conflict with isValidHeight
* Add initialisation contract and fulfil it.
---------
Co-authored-by: Alexander Harkness <me@bearbin.net>
* Use cChunkDef::IsValidHeight for CanBeAt functions, and related helpers.
* Add mixins for SolidSurfaceUnderneat and DirtLikeUnderneath
* Minor fixes after change review.
* Added code to export definitions for a lua-language-server
* Renamed VSCode -> LLS
* Fixed global variables/functions in APIDump being part of API docs
* Added article explaining how to configure lua-language-server
* Temp fix for dissapearing section in 1.13 and 1.14 versions
Previously the value for nonEmptyBlocks in each chunk section was -1. This was probably set with the intention to set it to the max value. However, the game also interprets the value as signed. meaning when a block is placed the value is incremented to 0. But when the nonEmptyBlocks value is 0 the game treats that section as empty and stops rendering blocks in it.
This patch makes sure that the value sent is 4096, the amount of blocks in any section. This will probably lead to the inverse bug where the game will treat empty sections as non-empty.
* Use named constant for section size rather than magic number.
---------
Co-authored-by: Alexander Harkness <me@bearbin.net>
* Overhaul endian handling in ByteBuffer and FastNBT
Rather than juggling "swapped" and "unswapped" versions of integers, different library functions, #defines, etc., simply always read everything byte-by-byte.
This works regardless of host CPU endian, got optimised down to either a normal load or a byteswap on every compiler I tested - only 1 instruction on most CPU architectures.
This commit introduces a "Bytes" array type to keep endian-sensitive data seperate from host data, alongside the needed C++ template machinery for it to work seamlessly. This approach is a little bit safer as well since you get length- and type-checking for most callsites.
* Remove remaining references to old-style endianness conversion, remove functions themselves.
---------
Co-authored-by: Alexander Harkness <me@bearbin.net>
1.8 clients seem to dislike "resurrecting" a dead player entity, doing
so results in the player entering a glitched state where its nickname
is displayed on the feet and they can't be attacked by melee. Destroying
and recreating the client-side entity at respawn time seems to fix the
glitch, and does not seem to affect more modern clients.
* Save maps every 5 minutes
Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
* Only save maps with changes
Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
* Maps created with non-default values are immediately dirty
Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
* Apply suggestions from code review
* Fix spacing for clang-tidy
---------
Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
Co-authored-by: Alexander Harkness <me@bearbin.net>
* Fix access to uninitialized space
Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
* Same fix to other noise generate functions
Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
* Skip the last Cell.Move
Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
* Add comments
Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
---------
Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
* Preserve banner names across place and pick up
Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
* Update src/BlockEntities/BannerEntity.h
---------
Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
Co-authored-by: Alexander Harkness <me@bearbin.net>
* Set TCP_NODELAY on connections
Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
* Windows wants a char * not a void * :-(
Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
* And clang objects to old style casts
Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
---------
Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
* Fix filename template for saved maps
Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
* First patch - added to CONTRIBUTORS
Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
---------
Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
* Moved end generator back to 3d perlin noise
* Replaced magic numbers where constants are available
* Use auto instead of NOISE_DATATYPE
Fixed redeclaration of distanceFromSpawn variable
Renamed EndGenIslandFlatness optoin to EndGenIslandThickness
* First Draft of adding endermite
* Update src/Mobs/Endermite.h
Co-authored-by: x12xx12x <44411062+12xx12@users.noreply.github.com>
* Adding Protocols + SpawnEgg
TODO: don't forget to put the endermite in core plugin for the summon
command
* Adding endermite to monster.ini
* Adding 5% change of spawning endermite when throwing enderpearl
* Spawn endermite at last position instead of Hit Position + .cache to .gitignore
* fixup! Spawn endermite at last position instead of Hit Position + .cache to .gitignore
* destroy endermite if 2 min, not if name is set
* Syntax
* Adding Enderman targeting endermite + fixing syntax
* Fixing compile error + return error [but crash on enderman spawn]
* Fix crash but enderman doesn't target
* Enderman targeting endermite finished
* checking style because i'm a noob at git...
* fixup! checking style because i'm a noob at git...
* Added endermite egg meta to docs
* Final touches
Removed unnecesary imports
fixed callback to run only in sight distance and actually check sigtlines
* Fixed error after not pulling branch
---------
Co-authored-by: x12xx12x <44411062+12xx12@users.noreply.github.com>
Co-authored-by: Debucquoy <debucqquoy.anthony@gmail.com>
Regession from #5085
```
[ 79%] Building CXX object Tools/ProtoProxy/CMakeFiles/ProtoProxy.dir/Connection.cpp.o
/home/bond/dev/cuberite/Tools/ProtoProxy/Connection.cpp:337:26: error: use of undeclared identifier 'AF_INET'
m_ServerSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
^
/home/bond/dev/cuberite/Tools/ProtoProxy/Connection.cpp:337:35: error: use of undeclared identifier 'SOCK_STREAM'
m_ServerSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
^
/home/bond/dev/cuberite/Tools/ProtoProxy/Connection.cpp:337:48: error: use of undeclared identifier 'IPPROTO_TCP'
m_ServerSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
^
/home/bond/dev/cuberite/Tools/ProtoProxy/Connection.cpp:342:2: error: unknown type name 'sockaddr_in'
sockaddr_in localhost;
^
/home/bond/dev/cuberite/Tools/ProtoProxy/Connection.cpp:343:25: error: use of undeclared identifier 'AF_INET'
localhost.sin_family = AF_INET;
^
/home/bond/dev/cuberite/Tools/ProtoProxy/Connection.cpp:346:53: error: unknown type name 'sockaddr'
if (connect(m_ServerSocket, reinterpret_cast<const sockaddr *>(&localhost), sizeof(localhost)) != 0)
^
/home/bond/dev/cuberite/Tools/ProtoProxy/Connection.cpp:362:29: error: use of undeclared identifier 'recv'
int res = static_cast<int>(recv(m_ServerSocket, Buffer, sizeof(Buffer), 0)); // recv returns int on windows, ssize_t on linux
^
/home/bond/dev/cuberite/Tools/ProtoProxy/Connection.cpp:402:29: error: use of undeclared identifier 'recv'
int res = static_cast<int>(recv(m_ClientSocket, Buffer, sizeof(Buffer), 0)); // recv returns int on Windows, ssize_t on Linux
^
/home/bond/dev/cuberite/Tools/ProtoProxy/Connection.cpp:451:29: error: use of undeclared identifier 'send'
int res = static_cast<int>(send(a_Socket, reinterpret_cast<const char *>(a_Data.data()), a_Data.size(), 0)); // Windows uses int for a_Size, Linux uses size_t; but Windows doesn't complain. Return type is int on Windows and ssize_t on Linux
^
[ 79%] Building CXX object CMakeFiles/Cuberite.dir/Unity/unity_38_cxx.cxx.o
9 errors generated.
```