Tiger Wang
e23dcffaff
Make StatSerializer a namespace
2020-08-21 00:53:10 +01:00
Tiger Wang
8cca3db61b
Consolidate various Chunk serialisers under one roof
...
* Merge most into WriteSectionDataSeamless
2020-08-21 00:53:10 +01:00
Tiger Wang
2d28d681c7
Remove unused variables in ChestEntity/BlockEntityWithItems
2020-08-21 00:53:10 +01:00
Tiger Wang
82d251b71b
Made cProtocol::Version, EntityMetadata enums less verbose
2020-08-21 00:53:09 +01:00
Tiger Wang
9a9079d3da
Remove complex templated SendBlockChange
...
If we're sending enough blocks to have virtual calls be an issue, we should resend the chunk instead.
2020-08-21 00:53:09 +01:00
Tiger Wang
d8c8d0124d
Replace PowerData struct with PowerLevel
...
* We no longer need to track the powering block with the removal of SolidBlockHandler. PowerLevel is now just an unsigned char
2020-08-21 00:50:09 +01:00
Tiger Wang
03557e978e
cChunk's deleted copy constructor needs const
2020-08-21 00:50:09 +01:00
Tiger Wang
d1b0d0f5b5
Remove level of indirection in cChunk storage
...
- No more unique_ptr storage
2020-08-21 00:50:09 +01:00
Tiger Wang
3143d6ce67
Remove std::make_unique from redstone handler creation
2020-08-21 00:50:09 +01:00
Tiger Wang
6617d43983
Minor typo fixes
...
* Also DeMorgan'd Emerald ore condition
2020-08-21 00:50:09 +01:00
12xx12
70ab8d2f96
Adding block entity transmission to 1.13 ( #4829 )
...
+ Adding block entity transmission to 1.13
+ Added HandlePacketSetBeaconEffect
Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-08-19 20:46:03 +01:00
Tiger Wang
963ec77575
Add statistics upgrade mapping
2020-08-19 20:45:27 +01:00
Tiger Wang
f23402dacd
Add FileStream wrapper
2020-08-19 20:45:27 +01:00
Tiger Wang
dbc81c3548
Add statistics palette for 1.15 & 1.16
2020-08-19 20:45:27 +01:00
12xx12
7d0813ce8c
Add Statistics and Achievements for newer Network standards
2020-08-19 20:45:27 +01:00
12xx12
47f7727b7f
Add enhanced Gold generation in Mesa-Type Biomes ( #4821 )
...
* added enhanced gold generation in mesa-type-biomes
* fixed typo in comment
* added enhanced gold generation in mesa biomes - fixed small checkstyle errors
Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-08-12 07:20:38 +00:00
12xx12
a3594f22c2
Update FinishGen.cpp
2020-08-09 22:05:13 +00:00
12xx12
ec3de19c4e
small issues addressed in #4817 fixed because was merged to fast
2020-08-09 22:05:13 +00:00
ion232
1b17ec4ca9
Fix enderchest placement rotation
2020-08-09 21:08:48 +00:00
12xx12
fed03048ad
Adding Emeralds to generation ( #4817 )
...
* Adding Emeralds to generation
* fixed crash
* fixed documentation and changed function name to match others
* forgot to change the name in the doc
* removed debug output - sorry build servers
Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-08-09 20:49:40 +00:00
ion232
f65679d1d4
Fix arrows preventing block placement
2020-08-09 10:19:01 +00:00
Tiger Wang
40eba5244d
Remove the redstone solid block handler
...
- Remove cSolidBlockHandler
* Functionality now integrated into simulator dispatcher
* Fix door double open/close issues, arisen due to the top/bottom halves getting different power
+ Small migration to block states for redstone wire
2020-08-08 18:22:16 +01:00
Tiger Wang
2f79ab2e26
const-ify some Chunk functions
2020-08-08 12:09:40 +01:00
Alexander Harkness
b45d8bfc1e
Revert "Hotpatch optional for macOSX builds on buildserver"
...
This reverts commit 5e3f51f5ff
.
2020-08-06 12:36:41 +01:00
Mat
cb1f0a5af2
Update bed behavior ( #4545 )
2020-08-05 19:38:29 +00:00
12xx12
5176c22656
imprementing plugin message to send server brand ( #4786 )
...
* fixed issue #4773
Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-08-05 18:55:19 +00:00
Alexander Harkness
d6c5ac40a6
Fix big tree ring radius calculations. Ring radius now stays within range.
2020-08-05 18:41:19 +01:00
mBornand
4c0e7e0ab4
edit comment
2020-08-05 18:41:19 +01:00
mBornand
295d8e1a6c
update comment
2020-08-05 18:41:18 +01:00
mBornand
eaae8be44b
correct error
2020-08-05 18:41:18 +01:00
mBornand
ad05e9e3f4
correct error
2020-08-05 18:41:18 +01:00
mBornand
e9bf6edbeb
large conifers sapplings grow
2020-08-05 18:41:17 +01:00
mBornand
e7b37b7965
error in comment end
2020-08-05 18:41:17 +01:00
mBornand
987f6ddeaa
add Large conifers
2020-08-05 18:41:16 +01:00
Tiger Wang
d2156aab7c
WakeUpSimulators correct Y computation
...
+ Add Y validity check to SimulatorManager
2020-08-05 08:35:37 +01:00
Tiger Wang
c0d1cffe0b
Delete unreferenced variable
2020-08-05 08:35:37 +01:00
Tiger Wang
25906a3b87
Adjust incorrect palette inclusions
2020-08-05 08:35:37 +01:00
Tiger Wang
5ed4222dee
Delete redundant std::move in World loader
2020-08-05 08:35:36 +01:00
Alexander Harkness
5e3f51f5ff
Hotpatch optional for macOSX builds on buildserver
2020-08-04 23:01:39 +01:00
12xx12
781d648571
Code cleanup in cChunk.PlaceBlock() for checking if BlockEntity should be spawned ( #4812 )
...
* Changed switch for call in cChunk for call to function cBlockEntity to remove unnecessary confusions while implementing new BlockEntities
2020-08-04 19:01:36 +01:00
Tiger Wang
5bb6512435
Simply Y-check in door handler
2020-08-04 18:26:25 +01:00
Tiger Wang
766a950d20
Continue with placement when using iron doors
2020-08-04 18:18:37 +01:00
Tiger Wang
71ba18d6c6
Door drops respect player gamemode
...
* Rely on caller to handle converting to pickups, all OnBroken needs to do is to maintain the unity of the door
* Fixes #4797
* Fixes #4796
2020-08-04 18:15:18 +01:00
Tiger Wang
c3d6afe47e
Corrected wakeup sequences
...
* Pistons/Ice no longer need to FastSetBlock first (#4600 ), and the former don't drop items when broken in creative
- Begin migration away from stationary fluids
* Tick the chunk after applying a client's changed
* Broadcast pending blocks at the end of a tick
2020-08-04 18:15:18 +01:00
Tiger Wang
6bdd130aab
OnBroken/OnPlaced are for entity actions
...
* Call OnPlaced/OnBroken in PlaceBlock/DigBlock
- Remove unused Placing/Breaking handlers
* Have the blockhandler's Check handle neighbour updating, instead of QueueTickBlockNeighbors
2020-08-04 18:15:18 +01:00
Tiger Wang
adb86a75da
Do not GetBlock individually in simulators
...
* Have the simulator manager get the block and pass it on
+ Add new overload for WakeUp, called when the manager wakes face positions
2020-08-04 18:15:18 +01:00
Tiger Wang
b205d233bd
Use std::queue for the block tick queue
2020-08-02 15:52:06 +01:00
Tiger Wang
71ffa76847
Remove unused block tick related cChunk functions
2020-08-02 15:52:06 +01:00
Tiger Wang
225c2fa9f6
Always use relative coordinates in AddBlock
...
+ Pass block, use relatives
* Fixes everything immediately converting abs back to rel and getting block, when these data were already available
2020-08-02 15:52:06 +01:00
Tiger Wang
99856df686
Add WakeUp/AddBlock distinction
...
* WakeUp is for singular changes (block breaking for example). The simulator should check blocks around the position and discover other affected blocks as it sees fit
* AddBlock is for when you know a whole area is to be updated; chunk loading, or area wakeups for example
+ Prepares for correct handling of destroyed blocks after removal of SolidBlockHandler in the redstone simulator
2020-08-02 15:52:06 +01:00
Tiger Wang
6d7b83a69d
Do not impose redstone wakup penalty for all blocks
2020-08-02 15:52:06 +01:00
Tiger Wang
fd5191854d
Delegate simulator wakeup to cChunk
2020-08-02 15:52:06 +01:00
Tiger Wang
6c47f46c31
Ensure updating relatives calls the correct base case
...
* Fixed recursive base unintentionally scheduling the origin position for an update because it called the wrong function
2020-08-02 15:52:06 +01:00
Mattes D
46398f4671
Replaced cpp14::make_unique<> with std::make_unique<>.
2020-08-01 20:04:31 +01:00
12xx12
54e499c065
Added HandleCraftItem call to ShiftClickedResult to make sure achievements are awarded ( #4791 )
2020-08-01 20:23:01 +02:00
Tiger Wang
fb3d3dac1e
Correct Serialise393/477 version annotations
2020-07-28 00:08:57 +01:00
Tiger Wang
99f8c44342
1.14 connection support
2020-07-26 18:55:16 +01:00
Tiger Wang
1673c84978
Remove redundant ErasePowerData call
...
* Also fix a return that should've been continue
2020-07-26 16:08:20 +01:00
Tiger Wang
860eedd3d7
Toggleables: update simulators when changed
2020-07-26 16:07:37 +01:00
Tiger Wang
7d93742498
Clang Tidy fix
2020-07-26 16:06:57 +01:00
Tiger Wang
2e18e4f51c
Comparators: use <= in comparison mode
2020-07-26 14:16:46 +01:00
Tiger Wang
4e5ab02a58
Use SimulateChunk in redstone simulator
...
+ Improved performance, reduces bottleneck in chunkmap lookup
* Stop allocating and throwing away lots of small vectors in Update/GetValidSourcePositions return values
- Remove unused GetPowerLevel virtual
2020-07-26 14:16:46 +01:00
Tiger Wang
de06ae7add
Fix incorrect big flower translation
...
* Upgrade palette had incorrect values for upper half of large flowers
2020-07-26 01:23:01 +01:00
Tiger Wang
b30d70f09d
Call BlockEntityWithItems from ChestEntity slot changed handler
...
* Small degree of unification for what to do with the current entity
* Make sure to do necessary actions for both sides of a double chest
2020-07-26 00:02:07 +01:00
Tiger Wang
6d650d5f3c
Reduce unnecessary wakeups
...
- cSimulator no longer wakes up positions already woken by cChunk::SetBlock
2020-07-25 20:59:12 +01:00
Tiger Wang
e4c09ca87d
Use relative vectors in cChunk::DoWith
2020-07-25 20:31:48 +01:00
Tiger Wang
b6e4a986b6
Correct placement for tripwire hooks
...
487f9a2aa9 (r40900869)
2020-07-25 20:29:55 +01:00
Tiger Wang
bc01cd5e75
Redstone: check validity of GetBlock
2020-07-24 09:11:40 +01:00
Tiger Wang
4f217c450b
zh-cn translation in resource file
...
+ Add resource description
+ Add more descriptive flags
2020-07-23 21:17:50 +01:00
Tiger Wang
330626ab22
Update submodules
2020-07-23 00:32:47 +01:00
Tiger Wang
07f3f7ec30
Remove some unused inclusions
2020-07-20 09:28:02 +01:00
Tiger Wang
2f30e98dae
Remove GetProtocolVersion unneeded comments
2020-07-19 23:11:02 +01:00
Tiger Wang
3dae696b41
Remove ProtocolPalettes
2020-07-19 21:20:27 +01:00
Tiger Wang
5dd51e87e5
Inherit constructors, remove duplication
2020-07-19 20:49:29 +01:00
Tiger Wang
e2f15776c7
Remove Waterlogged value from registry
...
(apparently they're going to remove it, we don't want such a large breaking change)
* Also alpha sort ids, parameters
2020-07-19 20:27:26 +01:00
Tiger Wang
3f712ca9cf
Precompile unordered_map/set
...
+ Add inclusions to Globals.h
* Sort Globals.h
- Remove sys/stat.h from Globals.h
2020-07-19 19:58:53 +01:00
Tiger Wang
f4fe137ab5
Use 1.13.1 block palette
2020-07-19 17:02:14 +01:00
Tiger Wang
00f8c3a225
Implement "caching" in ChunkDataSerializer
...
+ When sending a chunk to multiple clients, group them by protocol version and send the same data
2020-07-19 16:29:49 +01:00
Tiger Wang
bedddfffbc
Reduce duplication in CompressPacket
...
- Remove line 1742 that wrote data which was then immediately cleared
* Store the compress/no compress threshold in a constant
- Remove adding a noncompressed header in SendPacket, CompressPacket handles everything now
2020-07-19 16:21:05 +01:00
Tiger Wang
c99ddbc376
1.13.1, 1.13.2 connection support
2020-07-19 00:43:33 +01:00
Tiger Wang
1b9b587734
Add 1.13.1 to 1.15.2 mappings
2020-07-19 00:43:33 +01:00
Tiger Wang
9c6b5a3ec9
Delete unused member
2020-07-18 19:23:10 +01:00
Tiger Wang
bc1b70dcde
Use cMultiVersionProtocol's buffer
2020-07-18 19:23:10 +01:00
Tiger Wang
5141d05ba6
Delete duplicated status request handlers
...
Here we go again...
2020-07-18 19:23:10 +01:00
Tiger Wang
7425305154
1.13 items support
...
+ Add 1.16 block and item definitions
2020-07-18 19:23:10 +01:00
Tiger Wang
951a0212d8
Move IsValidSocket out of global namespace
2020-07-18 14:20:31 +01:00
Mat
eb0f640fa0
Initial work on 1.13 entity metadata ( #4539 )
...
* Initial work on 1.13 entity metadata
* Largely complete metadata
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-07-17 19:33:02 +01:00
Tiger Wang
ff2c246de2
cProtocolRecognizer goes on a diet ( #4770 )
...
- Removed inheritance from cProtocol
2020-07-17 18:46:50 +01:00
Tiger Wang
d8406c7c58
SimplePlaceableItemHandler style
2020-07-14 18:28:06 +01:00
Tiger Wang
9d277f1d10
cWorld * -> cWorld ( #4771 )
...
* cWorld * -> cWorld
2020-07-14 17:57:30 +01:00
Tobias Wilken
36eab1b323
Introduce recipe book functionality ( #4493 )
...
* Introduce recipe book functionality
The recipe book helps especially new players. Missing it gives the
impression that cuberite is not as advanced as it is.
The handling of the recipe book uses the following functions:
- Unlock Recipes
(https://wiki.vg/index.php?title=Protocol&oldid=14204#Unlock_Recipes ) to
make recipes available and show the notification for new recipes.
Initialization is done on player login for known ones, the update is done
when new items are discovered.
- Craft Recipe Request
(https://wiki.vg/index.php?title=Protocol&oldid=14204#Craft_Recipe_Request )
when the user selects a recipe from the recipe book to fill the slots.
Known recipes are initialized on player login via `Unlock Recipes` with
`Action` 0.
As soon as a new recipe is discovered this is added via `Unlock Recipes`
with `Action` 1.
To be able to know and recognize new recipes the player class is
extended with `KnownItems` and `KnownRecipes`. As soon as a player
touches an item this is compared to the list of `KnownItems`, if the
item is unknown the recipes are checked for this item and the other
ingredients are checked with the list of `KnownItems`. If a full match
is discovered the recipe is unlocked with the client and stored in the
`KnownRecipes`.
To unlock recipes the recipe ID is sent to the client. A mapping file
(for protocol 1.12.2) translated the minecraft recipe names to ids. The
crafting.txt is extended with and minecraft recipe names is possible.
Limitations:
Only a single recipe is added to the crafting area. Multiple clicks or
shift click does not increase the number of builds.
Co-authored-by: peterbell10 <peterbell10@live.co.uk>
* Address first issues mentioned by @peterbell10
- Some linting
- Extract loading of recipe specific protocol mapping into a function
- Build `RecipeNameMap` only once
- Use `std::optional`
- Extract `LoadRecipe` from `Window`
* Start to implement new suggestions
* Update with suggestions from @peterbell10
* Some minor cleanup
* Update protocol packet IDs
* Remove unused include
* Include header in cmake
* Change a vector to integer counter
* Change dromedaryCase method names to PascalCase
* Address suggestions from @madmaxoft
* Read Protocol subdirectories to load recipe books
To load all recipebooks iterate over the `Protocol` subdirectories
to find mapping files.
Co-authored-by: peterbell10 <peterbell10@live.co.uk>
2020-07-14 17:56:42 +01:00
Tiger Wang
1c714312eb
Remove unnecessary includes
2020-07-12 23:41:54 +01:00
KrystilizeNevaDies
d0f38f52cb
Remove Schematic Chunk height limitation
2020-07-06 20:56:47 +01:00
Tiger Wang
3f33b0736e
Comment capitalisation
2020-07-06 20:56:05 +01:00
Tiger Wang
a24dd3a2ab
Use enum to represent light states
2020-07-06 20:56:05 +01:00
Tiger Wang
f49f90906c
Reduced packet spam when entities idle
...
* Try not to send look packets when nothing's changed.
2020-07-06 20:56:05 +01:00
Tiger Wang
e205d4109b
Made grass spreader prettier
2020-07-06 20:56:05 +01:00
Peter Bell
829f8d46f0
Update fmtlib to 7.0.0
2020-07-06 20:53:04 +01:00
MaxwellScroggs
5cdaf073be
cWindow: Convert XYZ to Vector3 ( #4764 )
2020-07-04 23:49:17 +02:00
Franklin Kong
868e28b44f
Merged trivial item handlers into cSimplePlaceableItemHandler ( #4766 )
...
- Remove unused files
Co-authored-by: aiugai <aiugai@umich.edu>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-06-26 21:34:22 +01:00