Commit Graph

11492 Commits

Author SHA1 Message Date
Super Ewald
3c1cc4a513
feat: add detached flag to run in foreground with detached stdin (#5592)
* 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
2025-01-03 14:45:00 +00:00
Jason N. White
54269d78b2
Update LICENSE, fix license year (#5602)
Signed-off-by: JasonnnW3000 <sufssl04@gmail.com>
2025-01-01 14:20:14 +00:00
CoolPuppyKid
b92dc1cda3
Added Log That Says The Port (#5593)
* added logging that says the port

* fixed my little oversight

* removed useless level.dat
2024-12-10 23:54:19 +00:00
CoolPuppyKid
4b2b02a8ba
Fixed Weird Tp Fail Damage (#5591)
* Fixed Weird Tp Fail Damage

* i added a ; by mistake

* Update CONTRIBUTORS

* fixed my name
2024-12-04 00:22:37 +01:00
peterbell10
05c9e06be1
Remove blocking GetHeight (#4689)
* 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>
2024-11-30 11:16:53 +00:00
Alexander Harkness
c0f6c97dce
Manually specify UTF-8 encoding for Cuberite.rc (#5589) 2024-11-11 14:33:13 +00:00
Angus
5e258c6d95
Move monster speed to monsters.ini (#4500)
* 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>
2024-11-10 11:28:39 +00:00
x12xx12x
44cb43f13c
Fix Block Entity Placement in Generation (#5060)
* 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>
2024-11-09 23:07:11 +00:00
x12xx12x
e17f6906ef
fixes for api changes in embedtls (#5540)
* 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>
2024-11-08 00:19:47 +00:00
hle0
33b9c5dc6d
Fix cChunkMap issues below with coords below y=0 (#5397)
* 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>
2024-11-07 23:05:47 +00:00
Alexander Harkness
8ca73f1929
Remove simple template-id from constructors for Vector3 template. (#5586)
This was removed from the C++ standard in C++20; annoying warnings are produced by modern C++ compilers.

https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#2237
2024-11-07 21:10:44 +01:00
Alexander Harkness
ab62fc3988
Clean up CanBeAt Functions (#5587)
* Use cChunkDef::IsValidHeight for CanBeAt functions, and related helpers.

* Add mixins for SolidSurfaceUnderneat and DirtLikeUnderneath

* Minor fixes after change review.
2024-11-07 21:03:21 +01:00
NiLSPACE
a99c3ec2b8
Added code to export definitions for a lua-language-server (#5475)
* 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
2024-11-04 22:43:20 +00:00
Filip
fa908f577d
Temp fix for disappearing chunk sections in 1.14 (#5560)
* 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>
2024-11-04 10:01:31 +01:00
Ash
d82a6afd9e
Overhaul endian handling in ByteBuffer and FastNBT (#5543)
* 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>
2024-11-03 16:33:40 +01:00
NiLSPACE
b31cfb4c36
Make biomal composition gen respect the shapegen when placing bedrock (#5579) 2024-11-03 12:08:21 +00:00
Alexander Harkness
4b90000b8c
Update Cuberite Root CA Cert - ISRG X1 Root now used.
IdenTrust cross-signature has expired, so the root has changed.     https://blog.cloudflare.com/upcoming-lets-encrypt-certificate-chain-change-and-impact-for-cloudflare-customers/
2024-11-01 23:23:52 +00:00
sleirsgoevy
7e4abd7dd0
Fix player respawn for 1.8 clients (#5535)
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.
2024-11-01 22:20:13 +00:00
mjagdis
4e3b272af7
Save changed maps every 5 minutes (#5557)
* 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>
2024-11-01 22:19:34 +00:00
mjagdis
352134ba9e
Convert double to ints with floor rather than truncating (#5572)
Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
2024-11-01 22:18:50 +00:00
mjagdis
2bafab7233
Fix access to uninitialized space (#5576)
* 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>
2024-11-01 22:17:27 +00:00
mjagdis
65b7040c5e
Make wall banners actually placeable (#5574)
Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
2024-11-01 22:16:53 +00:00
Victor
0325de7dac
Uninitialised value fix (#5570) 2024-09-08 23:18:28 +02:00
mjagdis
5f4d2f004b
The second value in Rotation is pitch not roll (#5573)
Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
2024-07-02 23:51:03 +02:00
mjagdis
b7de59de89
Preserve banner names across place and pick up (#5565)
* 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>
2024-06-30 20:09:42 +02:00
mjagdis
c6c32bc2ed
Send metadata for item frames (#5568)
Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
2024-06-30 12:12:03 +00:00
mjagdis
a66a67c2ab
Set TCP_NODELAY on connections (#5558)
* 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>
2024-05-31 14:04:51 +03:00
NiLSPACE
64e97c8d16
Fixed dumpinfo plugin not finding Info.lua file if the plugin folder and name don't match (#5563)
Co-authored-by: Niels <niels.breuker@outlook.com>
2024-05-27 10:42:07 +02:00
mjagdis
81d40127c1
Fix filename template for saved maps (#5556)
* 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>
2024-05-12 22:10:38 +00:00
Mat
09859af405
cibuild.sh: enable verbose ccache output 2024-05-13 00:14:53 +03:00
NiLSPACE
884e3e97a6
Added extra possible Info.lua parameter that describes the dependencies (#5554) 2024-04-10 19:52:31 +02:00
NiLSPACE
cc6459bf0e
Moved end generator back to 3d perlin noise (#5552)
* 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
2024-04-09 15:11:26 +02:00
Mattes D
ed0b090383 Plugin InfoDump: Fall back to gPluginInfo if g_PluginInfo not found. 2024-03-20 12:35:13 +01:00
Mattes D
5fd7cc3646 Plugin InfoReg: Read the info from param 2024-03-17 21:12:43 +01:00
Mattes D
bc4975a864 Re-enable -rdynamic so that Lua modules can load Lua API from exe.
This fixes debugging Lua plugins from ZeroBraneStudio on Linux.
2024-03-15 00:24:05 +01:00
Mattes D
7b8f6eb951 Reverted moving Lua to C++. 2024-03-15 00:24:05 +01:00
Mattes D
cc6a866aa6 Fix build under clang-15. 2024-03-14 15:48:38 +01:00
Mattes D
6aec10feab Enable build under newer clang versions. 2024-03-14 08:47:20 +01:00
Mattes D
4f5a9327c2 Fixed UrlClientTest's Github CA. 2024-03-13 23:40:20 +01:00
dyexlzc
20d5cf0bfc
fix minecart bugs. (#5516)
* fix minecart bugs.

* Replace magical number in minecart

---------

Co-authored-by: dyexlzc <dyexlzc@gmail.com>
2023-11-20 10:12:52 +00:00
sleirsgoevy
ca705be264
Fix empty chunk serializer for protocol 47 (#5514)
(Minecraft 1.8)

Co-authored-by: Sergey Lisov <sleirsgoevy@gmial.com>
2023-10-18 20:32:02 +00:00
Spongecade
ebeb164d2b
Update Minecraft Wiki links to new domain (#5532)
* Update Minecraft Wiki links to new domain

* Added Spongecade to contributors

* Sorted Spongecade
2023-09-27 20:07:42 +02:00
KingCol13
1d4e036e39
Only enable werror for debug (#5501) 2023-09-27 17:56:25 +00:00
LhAllant
02cb4ef41e
Changed large apple tree probability (#5523) 2023-09-26 21:59:33 +00:00
Debucquoy Anthony tonitch
7db4e20fd7
adding endermite (#5460)
* 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>
2023-09-26 21:54:37 +00:00
Mat
a819f37fa1 Update Core 2023-09-26 21:11:04 +03:00
bariscodefx
eda440e0db
Update MCS_CLIENT_VERSIONS (#5529)
* Update MCS_CLIENT_VERSIONS

* Update remaining protocol version macros.

---------

Co-authored-by: Alexander Harkness <me@bearbin.net>
2023-08-21 13:49:46 +02:00
x12xx12x
770d838f37
Added that ds_store file to gitignore (#5521)
* Added that ds_store file to gitignore

* Update .gitignore

Co-authored-by: Janmm14 <Janmm14@users.noreply.github.com>

---------

Co-authored-by: Alexander Harkness <me@bearbin.net>
Co-authored-by: Janmm14 <Janmm14@users.noreply.github.com>
2023-08-15 07:52:42 +00:00
Bond-009
f2c41d1227
Fix tools build on FreeBSD (#5525)
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.
```
2023-08-12 14:41:52 +00:00
Mattes D
7e83dd073e Fixed a wrong format string.
Thanks to dyexlzc for noticing.
2023-06-21 12:08:14 +02:00