1
0
Commit Graph

11235 Commits

Author SHA1 Message Date
Tiger Wang
5123850db0
Fix Windows XP to 7 compatibility (#5167)
* Partially reverts 01a4e696b
* Unify thread names
- Remove use of GetThreadId API
2021-03-28 13:34:57 +01:00
IceCruelStuff
58d7b7e5c7
Update Copyright year (#5165) 2021-03-26 20:29:23 +00:00
Tiger Wang
90369deb5a
Change TimeOfDay to WorldDate (#5160)
* Change TimeOfDay to WorldDate

* Do not wrap at 20 minutes, continue incrementing
* Fixes #4737
* Fixes #5159
2021-03-20 20:58:19 +00:00
Tiger Wang
55ba39ca0e Don't send ping updates one packet at a time
* Use the batch update feature of the packet.
* Lengthen interval between time and ping update packets (ref. http://github.com/cuberite/cuberite/issues/4082#issuecomment-348675321).
2021-03-19 11:23:30 +00:00
Tiger Wang
e3fe9e5e93 Deduplicate WriteBlockEntity 2021-03-17 23:44:59 +00:00
Tiger Wang
edf9e39ed7 Mob heads, banners cannot be used
* Fixed UsedBy returning true, blocking block placement
2021-03-17 23:44:59 +00:00
Tiger Wang
5ca3a7c2e7 shared_ptr -> unique_ptr in generators 2021-03-17 23:44:42 +00:00
Tiger Wang
3e3c30496d Add heraldry names to banner pattern API docs 2021-03-15 11:07:54 +00:00
12xx12
243083e01a
Adding basic Banner functionality (#4806)
+ Added item and block for banners

Co-authored-by: 12xx12 <12xx12100@gmail.com>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2021-03-15 02:47:55 +00:00
Tiger Wang
ca5608c66c Derive HugeMushroom from the base handler
ConvertToPickups is already overridden.
2021-03-15 02:44:39 +00:00
Tiger Wang
61cc1c0190 Change Cobblestone block handler to default
Cobblestone shouldn't be handled with the Stone handler.
2021-03-15 02:44:39 +00: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
45591cbe7b
Properly deprecate more XYZ parameter'd functions (#5147)
* Fixes #5144
2021-03-15 02:28:18 +00:00
NiLSPACE
c729d7abde
Fixed some death messages showing up even when they are disabled. (#5153) 2021-03-11 21:26:35 +00:00
Tiger Wang
01a4e696b3
Do protocol decryption in-place (with CryptoAPI on Windows) (#5145) 2021-03-08 16:37:36 +00:00
12xx12
3daf253b7f
Some emplace_back replacements (#5149)
* replace push_back with emplace_back when a new object was created in the function call
2021-03-07 16:31:43 +00:00
Tiger Wang
d9a2b8611c
Mitigate MSVC crash (#5146)
Reference: http://ci.appveyor.com/project/Cuberite/cuberite/builds/38087390/job/p857ibg3x87naw36/messages
2021-03-06 12:59:39 +00:00
Tiger Wang
00e6239b20 Update Core 2021-03-06 01:30:55 +00:00
Mat
40b6758905
Add block handler for huge mushroom blocks (#5143) 2021-03-05 19:43:40 +01:00
12xx12
8405b8969f
Adding Boss bar (#5025)
+ Add boss bar

Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2021-03-05 15:08:30 +00:00
12xx12
4d6235c807
Add Mushrooms to Generator and fixed up the roofed forest (#5134)
* added generator for mushrooms and aded them to the biomes

* removed unused variable

* added nEwlY uDocUmEnTeD aPi sYmbOls...
2021-03-05 14:04:48 +01: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
5fa45182e8
fixed the crash on generating in the SinglePiceStructuresGen (#5136) 2021-03-05 14:28:36 +02:00
Tiger Wang
81e299f00c Mark UNREACHABLE with intrinsics 2021-02-20 17:46:02 +00:00
Tiger Wang
6aa1d13508 Clang 7? 2021-02-11 01:24:50 +00:00
Tiger Wang
2f1359a0f9 Fix march=native not being enabled
* LINUX doesn't exist apparently, use UNIX instead
+ Add some platform-specific logic to determine whether to use mcpu or march
- Remove duplicated compile option comments
+ Add STATUS level to messages
2021-02-11 01:24:50 +00:00
Tiger Wang
2a6d4ffcd8 Turn off SQLITE_ENABLE_JSON1 2021-02-11 01:24:50 +00:00
Tiger Wang
23745525e0 Update libevent, mbedtls 2021-02-10 10:30:32 +00:00
Tiger Wang
86cfb38211 MSVC warnings 2021-02-10 10:30:32 +00:00
12xx12
2481190d9c CompositeChat: use variants 2021-02-08 12:41:30 +00:00
Tiger Wang
7ad054b087 Explodinator performance optimisations
Thanks @lixfel (#4246)
2021-02-07 22:36:15 +00:00
Tiger Wang
5a8e75e6aa Explodinator: fix divide by zero 2021-02-07 22:36:15 +00:00
Tiger Wang
be2bf999c2 Fix #5118 2021-02-07 22:36:15 +00:00
dImrich
925f960ea2 Adds playerlist header and footer broadcasting (1.8-1.13) 2021-02-06 14:14:40 +00:00
Simerson
b1b7424c43
Creative mode hits immediately disappear boats (#5117)
Instant destroy boat in creative mode

+ boat one-shot in creative mode
+ Add boat instant destroy in creative
+ Instant break boat in creative
2021-01-28 22:39:40 +00:00
Tiger Wang
50a94f972d
Fix debug macro situation (#5114)
Use the standard NDEBUG.
2021-01-26 09:41:55 +00:00
Tiger Wang
19302eeb87 Redstone: inline -> static 2021-01-22 22:04:47 +00:00
Damián Imrich
4f3b699b27
End crystal placement (#5112)
* End crystal placement

* End crystal placement - fixed error and added some comments

* Removed unused includes

* Update src/Items/ItemEndCrystal.h

Co-authored-by: Alexander Harkness <me@bearbin.net>

* End Crystal placement, early-return pattern enforcement

* End crystal Item finish?

* Small changes

Fixed a crashbug in ender crystal destruction.
According to vanilla 1.16 testing, end crystals don't place if any entity intersects the box, not just other end crystals.
Check return value of SpawnEnderCrystal.
Add header in SeeMake.
Cafe Stile Redux.

* The stylechecker relies on CMakeLists

* There is another

Co-authored-by: Alexander Harkness <me@bearbin.net>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2021-01-22 17:06:26 +00:00
Damián Imrich
59e906ec6c
Implementation of totem of undying behaviour (#5111)
* notchian totem of undying

* ...

* ....

* Update src/Entities/Pawn.cpp

Co-authored-by: Alexander Harkness <me@bearbin.net>

* DeductTotem func

* fixed build errors

* Added myself to CONTRIBUTORS

* Small changes

Co-authored-by: Peter <peter@cassoviacode.com>
Co-authored-by: Alexander Harkness <me@bearbin.net>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2021-01-22 09:05:18 +00:00
Tiger Wang
49ef21d650 MultiVersionProtocol: fix two crashes
First one: add missing exception handler in ProcessProtocolIn

Second: remove faulty logic dealing with incomplete packets.

`a_Data = a_Data.substr(m_Buffer.GetUsedSpace() - m_Buffer.GetReadableSpace());`

was incorrect; it attempted to apply a length derived from m_Buffer to an unrelated a_Data. Its purpose was to give cProtocol the data the client sent, minus initial handshake bytes. However, we can use the knowledge that during initial handshake, there is no encryption and every byte can be written unchanged into m_Buffer, to just call cProtocol with a data length of zero. This will cause it to parse from m_Buffer - wherein we have already written everything the client sent - with no a_Data manipulation needed.

Additionally, removed UnsupportedButPingableProtocolException (use of exception as control flow) and encode this state as m_Protocol == nullptr, id est "no protocol for this unsupported version", which is then handled by cMultiVersionProtocol itself.
2021-01-19 09:54:58 +00:00
Tiger Wang
813176fbd1
cChunk: don't inherit from cChunkDef (#5106) 2021-01-18 16:09:10 +00:00
wereii
bdb45998c9
Fixed horse UI desync when taking saddle out (#5108)
due to overlooked fallthrough
2021-01-16 18:27:50 +00:00
Tiger Wang
054a89dd9e Clarify cClientHandle, cPlayer ownership semantics
+ A cPlayer, once created, has a strong pointer to the cClientHandle. The player ticks the clienthandle. If he finds the handle destroyed, he destroys himself in turn. Nothing else can kill the player.
* The client handle has a pointer to the player. Once a player is created, the client handle never outlasts the player, nor does it manage the player's lifetime. The pointer is always safe to use after FinishAuthenticate, which is also the point where cProtocol is put into the Game state that allows player manipulation.
+ Entities are once again never lost by constructing a chunk when they try to move into one that doesn't exist.
* Fixed a forgotten Super invocation in cPlayer::OnRemoveFromWorld.
* Fix SaveToDisk usage in destructor by only saving things cPlayer owns, instead of accessing cWorld.
2021-01-12 12:34:34 +00:00
Tiger Wang
9328afe65c Convert most calls to blocking GetHeight/GetBiomeAt to direct chunk accesses
* Hopefully fixes #5094
2021-01-11 16:39:56 +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
Varga Szabolcs
00c0a23ace
Fixed switch-ups regarding some slab and stair recipes (#5099) 2021-01-05 02:14:53 +00:00
Tiger Wang
16aeb84cd3
Fix potential destruction crashes (#5095)
* Fix potential destruction crashes

* Fix destructors accessing destroyted objects
* Fix cPlayer not destroying windows (Destroyed never called)
* Tentatively fixes #4608, fixes #3236, fixes #3262
- Remove cEntity::Destroyed() and replace with cEntity::OnRemoveFromWorld()

* Add missing call to OnRemoveFromWorld
2021-01-02 13:50:34 +00:00
Nir
4656f7486d
Fix version typo in CMakeLists.txt (#5098) 2021-01-02 11:35:40 +00:00
Tiger Wang
959b263093
Fix AppVeyor IA32 builds (#5096)
* Fix AppVeyor IA32 builds

> The default target platform name (architecture) is that of the host and is provided in the CMAKE_VS_PLATFORM_NAME_DEFAULT variable.

AppVeyor uses AMD64. Oops.

* del cmakecache

* -

* +
2020-12-31 19:43:02 +00:00
Tiger Wang
90ce4ed2b8 Command Blocks: fix a crash
* Don't store a temporary
2020-12-30 12:15:19 +00:00