197 Commits

Author SHA1 Message Date
f9050e6e02
Pulled in upstream commits up-to 3ec51bcb9f9277e955ec400063c88d54e7ae690b 2025-06-12 12:34:38 -04:00
0d51f729eb
Fixed Tests 2025-06-12 11:54:40 -04: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
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
Mattes D
4f5a9327c2 Fixed UrlClientTest's Github CA. 2024-03-13 23:40:20 +01:00
21f58bdbcb
Merge commit 'f673e59b217471128ce66454358bd8f7c41481df' into pullstream 2024-02-14 06:16:30 -05:00
4ab992ed31
Merge commit 'd9b2833e272fa1018058786edef45a42cbe4ecc0' into pullstream 2024-02-14 06:14:52 -05:00
11c57356a4
Merge commit '800f1c0bc5bd4632bd0f246c756283cc47d31a34' into pullstream 2024-02-14 06:10:31 -05:00
a0518dc0a0
Merge commit 'c9522fb740200ccef6230cec452c48efb31e5394#diff-8d3ef4ba02861ab7342677303e0ef793dc2063ed69dbafe1a17e886b24499aab' into pullstream
This commit was done specially since it interfaces heavily with Lua.

First it was diffed out in a standard cuberite repo so we can tell what was changed,
and we apply this diff to a basic cuberite repo right before the commit was made.

I then promptly reverted lua changes that would conflict with applying
the patch. I also had to remove whole sections from the patchfile
afterwards but it was made easier having the actual repo with the
patches applied able to remake the diff as needed before i removed the
bigger sections.

Somehow it all worked out.
2024-02-14 05:48:18 -05:00
Mattes D
f673e59b21 UrlClientTest: Added tests for root CA verification. 2023-05-19 16:25:12 +02:00
Mattes D
d9b2833e27 UrlClientTest: Added timeout to all tests. 2023-05-19 16:25:12 +02:00
x12xx12x
800f1c0bc5 Auth SSL Fixes
- Fixed Login Breaking bug
- Auth and MojangAPI now use UrlClient
- fixed bug in UrlClient where one letter was missing in the HTTP Header
- added function to verify Urls from config files and error handling on bad Urls in config for Auth
2023-05-19 16:25:12 +02:00
Mattes D
c9522fb740 Removed all Printf-family functions from StringUtils.
Replaced them with fmt::format calls, including changes to the format strings. Also changed the format strings to use FMT_STRING, so that the format is checked compile-time against the arguments.
Also fixed code-style violations already present in the code.
2023-05-16 23:50:37 +02:00
6c4b2e9186
Implement GPL3+ and Apache2.0 Dual License.
Commit is being made to allow additions of GPL3+ code previously
un-addable. With these changes, contributions back to cuberite are
possible with the backporting exemtion, as well as adding stuff in
minetest with minetest code properly being read through and implimented
to upgrade it to GPL3 from GPL2.

project still has Apache2.0 license and credits to all its contributers, but now has the freedom of GPL3+ and all the code that can be implimented and shared with it.
2023-03-20 11:49:56 -04:00
Debucquoy Anthony tonitch
16f3355bbb
rework of the color code with & and standard codes (#5416)
* adding build* to gitignore and tags for ctags

* Notation Changes

* Adding & Parser

* Avoid crash when & as first character

* Looking for @ in the rest of the project

* Formating style

* Modifying test to reflect new behaviours

* Adding a check for the first part

* fixup! Adding & Parser

style changes

* Update APIDesk.lua

* Update src/CompositeChat.cpp

Co-authored-by: x12xx12x <44411062+12xx12@users.noreply.github.com>

* explaination on the antishlash with ampersand

* adding old deprecated formating

* Update src/CompositeChat.cpp

Co-authored-by: x12xx12x <44411062+12xx12@users.noreply.github.com>

* Update src/CompositeChat.cpp

* Update src/CompositeChat.cpp

Co-authored-by: Debucquoy <debucqquoy.anthony@gmail.com>
Co-authored-by: x12xx12x <44411062+12xx12@users.noreply.github.com>
2022-10-25 13:42:04 +02:00
Bond_009
b14874978a Fix WriteXZYPosition64 and add tests 2022-01-14 17:24:59 +00:00
Rorkh
4c5d9d38f4 Only nether-native mobs can see through lava 2021-10-02 21:18:18 +01:00
Tiger Wang
028a5735c5
Spectation: add dedicated pathway for spectator mode (#5303)
* Spectation: add dedicated pathway for spectator mode

+ Sync player rotation with spectated entity.
+ Add dedicated infrastructure to cPlayer for handling spectation, instead of misusing entity riding.
* Avoid infinite recursion when exiting spectation, fixes #5296

* AttachTo: Change parameter to reference
2021-09-29 22:17:03 +00:00
Tiger Wang
ecc8ffbd80 Compile the entire Lua stack as C++
* Fixes #5216
2021-06-25 10:17:53 +01:00
Tiger Wang
a62b2b1be2
Move item placement into item handlers (#5184)
* Move item placement into item handlers

+ Add appropriate CanBeAt checks in cPlayer::PlaceBlocks, into which all placement handlers call.
* Partly addresses #5157
* Fixes #4878
* Fixes #2919
* Fixes #4629
* Fixes #4239
* Fixes #4849

Co-authored-by: changyong guo <guo1487@163.com>
Co-authored-by: Xotheus <shady3300@outlook.com>
Co-authored-by: Krist Pregracke <krist@tiger-scm.com>

* Review fixes

* Update APIDesc.lua

* Rename

Co-authored-by: changyong guo <guo1487@163.com>
Co-authored-by: Xotheus <shady3300@outlook.com>
Co-authored-by: Krist Pregracke <krist@tiger-scm.com>
2021-05-05 13:25:10 +00:00
Tiger Wang
34bf5c0d9d Rename files to match code 2021-05-04 16:11:56 +01:00
Tiger Wang
6e80f7544d Update entity sizes 2021-04-12 22:35:07 +01:00
Tiger Wang
04cb4996e2 Update the minimodules 2021-04-12 14:09:18 +01:00
Damián Imrich
befe132861
cPieceModifier interface and cPieceModifierRandomizeBlocks class (#5122) 2021-04-08 12:24:59 +02:00
12xx12
d78bcac150
Obsidian pillars, end fountain, not Ender dragon spawning (#4993)
* added generator for obsidian pillars and central fountain which then is used for the exit portal

* checkstyle

* checkstyle the second

* fixed clang
removed magic number
added Clamp

* make the pillars configurable

* fixed clang
added warning if there was a unknown value if the tower should have a cage or not

* forgot to cancel on unkwon value

* fixed clang this time maybe

* added new generator to generator test

* fixed test

* added prefab generation for end fountain

* fixed checkstyle and updated the prefab

* added ender dragon spawning
made the fountain positioning dynamic
removed fountain placement functions

* added enderdragon stuff to testing

* pls compile

* added changes suggested by @peterbell10

* fixed clang

* added debug for further research on the ARM build

* ok - it wasn't my tower placement

* checking in setup

* readded the fountain schematic

* removed finisher

* readded generator

* removed generator trigger - kept ini file access

* using cChunkDef function to calculate abs pos of endercrystal

* yes, I know it's unused...

* commented everything in the ComposableGenerator.cpp
 - so only the new class in compiled in but not called at all

* don't compile in the new generator at all
(removed from CMakeLists.txt)

* readded the new generator

* readded the new generator

* removed debug output

* made the towers generate acrocc chunk borders

* fixed bad merge

* fixed clang

* fixed clang

* generate the dragon 20 blocks above terrain

* trying to fixed weird undefined reference

* maybe this fixes the weird behaviour

* takes chunk width as parameter now

* added new comments with info to generated structures
removed ender dragon spawning
removed chunkwidth from parameter

* fixed linker

* maybe fixed linking. tried with gc and clang

* fixed ender crystal

* fixed test

* updated output strings

* fixed build

* fixed up test

* fixed test compile

* fixed test - cant get the tests to show up

* removed the semicolon

* maybe this is the fix?

* at this point i have no idea - in MVSC it works

* removed the ender dragon

Co-authored-by: 12xx12 <12xx12100@gmail.com>
2021-04-08 12:18:18 +02:00
Tiger Wang
125df19477
Do not fake a tool when converting to pickups (#5170)
* When the cause of destruction was world-induced (CanBeAt check failed) there is no tool. Pass the nullptr directly to ConvertToPickups and let it handle it.
* Fixes #4795
- Remove unused a_Digger parameter to ConvertToPickups.
2021-03-28 14:41:34 +01:00
Tiger Wang
de76503d5c Remove DoesDropOnUnsuitable
This is only overridden false in Vines and Snow. It is called when a CanBeAt check fails, to determine whether DropBlockAsPickups is called. However, Vines and Snow already drop nothing without the right tool, so this function is superfluous.
2021-03-15 02:44:39 +00:00
Tiger Wang
868cd94ee9
Prepare ChunkData for BlockState storage (#5105)
* Rename ChunkData Creatable test

* Add missing Y-check in RedstoneWireHandler

* Remove ChunkDef.h dependency in Scoreboard

* Prepare ChunkData for BlockState storage

+ Split chunk block, meta, block & sky light storage
+ Load the height map from disk
- Reduce duplicated code in ChunkData
- Remove saving MCSBiomes, there aren't any
- Remove the allocation pool, ref #4315, #3864

* fixed build

* fixed test

* fixed the debug compile

Co-authored-by: 12xx12 <44411062+12xx12@users.noreply.github.com>
2021-03-05 14:03:55 +01:00
12xx12
2481190d9c CompositeChat: use variants 2021-02-08 12:41:30 +00:00
Tiger Wang
50a94f972d
Fix debug macro situation (#5114)
Use the standard NDEBUG.
2021-01-26 09:41:55 +00:00
Tiger Wang
eeb63b8901
zlib -> libdeflate (#5085)
+ Use libdeflate
+ Use std::byte
* Fix passing temporary to string_view
+ Emulate make_unique_for_overwrite
2021-01-11 16:39:43 +00:00
Tiger Wang
742e27ad2f Remove unused Temporary namespace
- Remove unused temporary mapping generation at startup
2020-12-21 00:11:34 +00:00
12xx12
14a00d0051
changing cComposite Chat to newer c++ standart (#5028)
* upgraded to new C++ for loops and fixed errors

* readded delete instruction

* now using unique ptr

* added test for text only (that was causing an error for me)

* using unique ptr constructor

* added move constructor and deleted copy constructor

* fixed deconstuctor
http prefixes are constexpr and std::string_view

* fixed whitespace

Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-11-11 22:38:51 +01:00
Tiger Wang
64442b05f8
cBlockInfo: further cleanup (#5001)
* cBlockInfo: further cleanup

+ Use switch statements instead of lookup in dynamically initialised arrays
- Remove some deprecated bindings

* Update Stubs removing references to BlockInfoArray
2020-10-18 15:37:07 +00:00
Tiger Wang
a145980795
Fix Android builds (#4998)
Construct paths relative to the Cuberite sources with PROJECT_SOURCE_DIR, instead of wherever the first CMakeLists.txt file happened to be with CMAKE_SOURCE_DIR.

In Android's case, the latter was in a folder called android/ but that's not the root of the source tree, so any file path built off that root was wrong. This caused file-specific warnings exclusions to fail to apply.
2020-10-15 09:35:44 +00:00
Tiger Wang
c158569af3 Remove unused Temporary namespace 2020-09-25 14:51:57 +01:00
Tiger Wang
c53a0ba5f6 Unify block entity pickup conversion
- Removed normal BlockHandler knowledge of block entities during conversion
+ Added cBlockEntity::ConvertToPickups that handles it
2020-09-25 09:07:01 +00:00
Tiger Wang
68cced73af
BlockHandler initialisation is a constant expression (#4891)
* BlockHandler initialisation is a constant expression

If we can't make it all namespaces, this is the next best I guess.

+ Tag handlers constexpr, const as needed
+ Inherit constructors
* Privatise handler functions

* More constexpr

Co-authored-by: Alexander Harkness <me@bearbin.net>
2020-09-20 13:50:52 +00:00
12xx12
c18fe8aa45
Adding Generator For Single Piece Structures (#4830)
* the beginning of a magnificent work - added basic files and classes without functionality

* fixed checkstyle

* added imports

* moved imports

* - Adding SinglePieceStructureGen
- Adding a cPrefabChestStructure to generate Chests with contents
- Added the options and calls to the ComposableGenerator

* moved Globals to .h file

* removed the chest thingy from the code (for now)

* Update SinglePieceStructureGen.cpp

* readded whitespace

* renamed to SinglePieceStructuresGen for consistency
added new classes to test

* fixed small things (mostly style and cleanup)
removed loottables

* added small changes suggested by madmaxoft

* small change to documentation

* added check for allowed biomes

* check only the biome of the origin position

* fixed error on IsBiomeAllowed

* added new cubesets

* updated structures for with sponging

* updated biome names

* updated metadata to prevent crashing
removed debug output

* updated structures with sponging

* added sponging to deserterWell to make it disappear in sand

* small change in meta

* rename DesertTemple -> DesertPyramid

* minor style changes

Co-authored-by: 12xx12 <12xx12100@gmail.com>
Co-authored-by: Alexander Harkness <me@bearbin.net>
2020-09-17 22:20:50 +00:00
Tiger Wang
c3d2956ba5
BlockHandler: no dynamic allocation (#4862)
* BlockHandler: no dynamic allocation
2020-09-17 14:51:42 +01:00
Tiger Wang
501702065b Fixup test block handler stubs 2020-08-04 18:39:47 +01:00
Mattes D
46398f4671 Replaced cpp14::make_unique<> with std::make_unique<>. 2020-08-01 20:04:31 +01:00
Tiger Wang
6317176d7e More CMake cleanup 2020-07-12 22:00:07 +01:00
Peter Bell
ad935ef40f Update libevent to 2.1.12-stable 2020-07-06 20:53:04 +01:00
Tiger Wang
9e8598fb1c
Upgrade to C++17 [CMake] (#4717)
* Make our CMake slightly less insane
2020-05-16 20:59:10 +01:00
peterbell10
154df6b09d
Cleanup unneeded globals (#4736) 2020-05-10 16:16:38 +00:00
peterbell10
e6634ed26c
Update submodules (#4727)
Closes #4708

This updates jsoncpp, mbedtls, TCLAP and SQLiteCpp to their latest stable release. A few additional changes were needed:

* jsoncpp deprecated Reader, FastWriter and StyledWriter which I've replaced
  with some helper functions in JsonUtils.cpp

* SQLiteCpp changed how it builds with external sqlite libraries, now expecting
  them to be installed. The simplest path was to remove sqlite from cuberite's
  submodule and just use SQLiteCpp's internal version.
2020-05-09 15:51:15 +01:00
peterbell10
8e2dfce84b
Require semi-colon at end of function-like macros (#4719) 2020-05-05 20:39:59 +00:00
Mattes D
487f9a2aa9
Vector3 in Handlers (#4680)
Refactored all cBlockHandler and cItemHandler descendants to use Vector3.
2020-04-21 22:19:22 +02:00
Mattes D
26ac146f41
More Vector3 in cBlockHandler (#4644)
* cBlockHandler.OnUpdate uses Vector3 params.

Also slightly changed how block ticking works.
2020-04-17 10:36:37 +01:00