1
0
Fork 0
Commit Graph

46 Commits

Author SHA1 Message Date
Tiger Wang a999c5d845 More cProtocol cleanup
* Alpha sort functions
* Simplify hand handling
* Fix left handed mode client-side display
2021-04-12 22:35:07 +01:00
Tiger Wang 66c211c33a Unify multiprotocol entity animations 2021-04-12 22:35:07 +01:00
Tiger Wang 748b121703
Unify DoWithBlockEntity (#5168)
+ DoWith calls now broadcast the block entity and mark the chunk dirty
+ Add block entity change queue to synchronise BE updates with block updates
* Fixed a few incorrect assertions about BE type
- Remove manual overloads
2021-03-28 14:40:57 +01:00
Tiger Wang e3fe9e5e93 Deduplicate WriteBlockEntity 2021-03-17 23:44:59 +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 81e299f00c Mark UNREACHABLE with intrinsics 2021-02-20 17:46:02 +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
12xx12 e35519ec8a
Adding new monster types to enum and saving/loading for easier future implementation (#4941)
* added new monster types to enum
added string <-> enum conversion in namespace serializer
added loading functions
added to saving

* renamed zombie pigman to zombified piglins in enum

Co-authored-by: 12xx12 <12xx12100@gmail.com>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-11-22 23:41:13 +00:00
12xx12 36a67df105
Ender Crytal Fix and report proper cmake file for luabindingscheck fail (#5017)
* fixed network
fixed explosion
fixed ticking

added network broadcast to Setter method

added nullptr protection

using macros in 1.10 Protocol_1_10.cpp

revealed functions to LUA API

small fixups, typos, less functions used

fixed more doc

readded info that saving is done only if the beam is displayed

made the constructor transfer all needed members

fixed wrong commit

removed default parameters on SpawnEnderCrystal

fixed wrong metadata

moved call to destroy in the right place

fixed some typos

Fixed Ender Crystal

* fixed documentation

* fixed doc and added proper error message

* Parameters, arrows

* Parameters

Co-authored-by: 12xx12 <12xx12100@gmail.com>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-11-06 15:00:59 +00:00
12xx12 961d5eb420
Add beam target, configurable base visibility to Ender Crystals (#5010)
* Fixes #4990

Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-10-29 20:47:20 +00:00
Tiger Wang 82d251b71b Made cProtocol::Version, EntityMetadata enums less verbose 2020-08-21 00:53:09 +01:00
Tiger Wang 99f8c44342 1.14 connection support 2020-07-26 18:55:16 +01:00
Tiger Wang 07f3f7ec30 Remove some unused inclusions 2020-07-20 09:28:02 +01:00
Tiger Wang 5dd51e87e5 Inherit constructors, remove duplication 2020-07-19 20:49:29 +01:00
Tiger Wang 5141d05ba6 Delete duplicated status request handlers
Here we go again...
2020-07-18 19:23:10 +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 e205d4109b Made grass spreader prettier 2020-07-06 20:56:05 +01:00
peterbell10 13144a08e4
Enable some more clang-tidy linter checks (#4738)
* Avoid inefficient AString -> c_str() -> AString round trip

* Avoid redundant string init expressions

* Avoid unnecessary return, continue, etc.

* Add .clang-format to help with clang-tidy fix-its

* Avoid unnecessary passing by value

* Avoid unnecessary local copying

* Avoid copying in range-for loops

* Avoid over-complicated boolean expressions

* Some violations missed by my local clang-tidy

* Allow unnecessary continue statements

* Add brackets

* Another expression missed locally

* Move BindingsProcessor call into clang-tidy.sh and add space

* Fix pushd not found error

* Different grouping of CheckBlockInteractionRate
2020-05-14 22:15:35 +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
Tiger Wang eb3ca16921 Fix one definition rule violations 2020-05-04 13:29:56 +01:00
Tiger Wang 07ca095740
Improve entity position updates (#4701)
* Make puking pickups fly nicer

* Improve entity position updates

* Move determination of whether a delta is too big for a packet into the protocol handlers
+ Less jittery movement
+ Generalise CollectEntity to take any entity
2020-05-04 08:10:47 +00:00
Tiger Wang 0b9b7bc1a8 Unify entity spawn packet sending 2020-04-30 23:04:56 +01:00
Alexander Harkness 4b3043f627
Fix compilation, for real this time.
I should go to sleep now...
2020-04-10 01:01:07 +01:00
Bond-009 8438def87e
Add Zombie Villagers 2020-04-10 00:50:45 +01:00
Mat 60bcc06f43
Implement wither skeletons (#4563) 2020-04-04 13:44:17 +02:00
Mat 31ace87d28
Add protocol mob ID remapping (#4538) 2020-03-29 17:54:37 +02:00
Mat cff9f7571b
Use LastSentPos for mob spawn packet in 1.11+ (#4490) 2020-03-05 12:58:46 +02:00
Mattes D 2c804dd34a Protocol: Use logical outgoing packet types. 2019-09-10 09:45:28 +02:00
Bond-009 e0ca4d8399 Fix building with clang 8.0 (#4346) 2019-08-11 10:39:43 +01:00
peterbell10 950aeffff8
CheckBasicStyle: Check number of empty lines between functions (#4267)
Add check for number of empty lines between functions and fix the corresponding failures
2018-07-26 22:24:36 +01:00
peterbell10 a4dbb5c582
Prefer static_cast to reinterpret_cast (#4223)
* Change reinterpret_cast -> static_cast wherever possible
* Remove more unnecessary `const_cast`s.

reinterpret_casts should be avoided for the same reason as c-style casts - they don't do any type-checking. reinterpret_cast was mainly being used for down-casting in inheritance hierarchies but static_cast works just as well while also making sure that there is actually an inheritance relationship there.
2018-05-02 08:50:36 +01:00
9caihezi 4242431407 Rewrite cClientHandle::HandleRightClick (#4089)
* Add hand parameter to distinguish main hand/off hand.
* Add a new function cClientHandle::HandleUseItem to separate the functionality of using an item without a target block. This matches the protocol with client version >= 1.9
* Always actively update the status of a block if the placement fails (by out of reach or rejected by plugin).
* Do not call plugin callback CallHookPlayerRightClick(-1, 255, -1, -1, 0, 0, 0) when using item.
   The CallHookPlayerUsingItem will still be called.
   Now at most one of CallHookPlayerRightClick, CallHookPlayerUsingBlock,
   CallHookPlayerUsingItem and CallHookPlayerEating will be called based on
   the type of action (not including the used version of callbacks).
* Do not count using item as BlockInteractionsRate check (Using item takes time).
* Now we can open chests(etc.) when sneaking as long as the player's hand is empty.
   This is what vanilla server does.
2018-01-08 13:37:10 +00:00
peterbell10 307e7aaff5 Fix switch warnings (#4013)
* Fix switch warnings
  * Fix a variety of -Wswitch and -Wswitch-enum warnings
  * Remove unneeded -Wno-error flags

* Reorganise some eMonsterType switches
  * Alpha sort eMonsterType cases in WriteMobMetadata
    and in cNBTChunkSerializer::AddMonsterEntity
  * List all mob types in protocol 1.12 and NBTChunkSerializer

* cStructGenTrees::GetNumTrees: remove switch default

* cWSSAnvil::LoadOldMinecartFromNBT: Log unhandled minecart type
2017-09-14 09:48:57 +01:00
Lane Kolbly aebfbfb8c8 GetPacketID for protocol packet IDs (#3977)
* Added GetPacketId method to protocol, implemented for all protocols.

* Moved GetPacketID methods into a single file, alpha-sorted.

* Fixed 1.12.1 HandlePacket switch statement.

* Added SendLogin to the GetPacketId framework.

* Added SpawnObject to GetPacketId framework.

* Added missing sendEntityEquipment packet ID update for 1.12.1

* Added LeashEntity packet ID change to 1.12.1

* Alphabetized packet enum, added SpawnGlobalEntity to GetPacketId framework

* Fixed clang errors

* Indented cases, expanded comment for GetPacketId

* Changed dyslexic comment.
2017-09-02 17:46:57 +01:00
satoshinm 6bc5031517 Implement Forge protocol handshake support (#3869) 2017-08-27 23:10:20 +02:00
peterbell10 f4f2fc7c3d Add cUUID class (#3871) 2017-08-25 13:43:18 +01:00
mathiascode 02775e52c4 Minor changes (#3909) 2017-08-24 11:19:40 +02:00
Tiger Wang eb4432bb62 Tentative fix for player-limit race condition (#3862)
* Attempts to fix #2257

Derived from d233e9843148313c71fbaba96ccff660e47b07b1

* Changed player count type to int

* Clarified certain actions
2017-07-28 17:54:40 +01:00
Bond-009 6a19841121 Added basic ocelot behavior (#3829) 2017-07-12 12:42:02 +02:00
Lukas Pioch 885d828712 Added bed entity (#3823)
* Added bed entity

* Export cBedEntity to lua
* Set color of bed through item damage value
* Added bed entity to APIDoc
* NBT: Added loading and saving
* Crafting recipes for the colored beds
2017-07-07 09:31:45 +02:00
Lukas Pioch 4e0ae63ec2 Added WriteBlockEntity to 1.10 and 1.11 and fixed mob spawner 2017-06-09 12:16:44 +02:00
Lukas Pioch 73a3c4e3be Exported boat
- NBT: Added saving / loading of material
- Added the material in the item handler of the boat
- Drop the correct boat if destroyed
- APIDoc: Added desc and functions
2017-05-24 19:02:18 +02:00
peterbell10 f0a16e6d28 VarInt metadata written correctly for boats (#3709)
* Varint metadata written correctly for boats
2017-05-15 18:04:53 +02:00
Pokechu22 19094e7aa6 Add 1.11 entity metadata (#3601) 2017-03-03 10:59:17 +01:00
mathiascode c89b20695d Add 1.11.1/1.11.2 protocol (#3575) 2017-02-21 16:11:28 +01:00
Mattes D 0e3b3be766 Initial support for the 1.11 protocol. 2016-12-16 00:07:22 +01:00