1
0
Fork 0
Commit Graph

619 Commits

Author SHA1 Message Date
changyong guo 57690b81a2 Experience orb (#4259)
* Replace cWorld::FindClosesPlayer with cWorld::DoWithClosestPlayer
* Implement experience reward splitting into the orb sizes used in vanilla
* Modified speed calculation in cExpOrb::Tick to make the orbs fly towards the player

Fixes #4216
2018-08-02 15:59:10 +01:00
peterbell10 cdd8e42587
cWorld: Manually bind deprecated broadcast functions (#4265)
Ref: https://github.com/cuberite/cuberite/pull/4264#discussion_r204769193
2018-07-27 00:12:41 +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 c94d7184eb Broadcast refactor (#4264)
* Move Broadcast functions from cChunkMap to cBroadcaster

- Remove cBroadcastInterface in favour of cBroadcaster.

- cChunk: Remove broadcast functions.

* resurect broadcast interface

* Absorb cBroadcaster into cWorld.
Removes the need for forwarding the function calls.

* Improve const-correctness

* Use Int8 instead of char

+ Comment `ForClients` functions

* Improve comments

* Broadcaster: Rename ForClients functions
2018-07-24 22:30:49 +01:00
peterbell10 211cec621e
cBlockArea: Write all present data types by default (#4252)
cBlockArea::Write now defaults to use GetDataTypes() instead of assuming all data types are present.
Fixes cuberite/WorldEdit#130
2018-07-19 22:36:46 +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
peterbell10 86a8fdf3fe tolua++ bindings use nullptr. (#4219)
Fixes compilation with -Wzero-as-null-pointer-constant.
2018-04-27 23:22:41 +02:00
peterbell10 4f26f653e1
Add cPluginManager::GenericCallHook (#4027)
Replace repetitive CallHook functions with a generic implementation.
Also converts some loops to range-based for.

Related to #1134
2018-03-02 10:40:48 +00:00
peterbell10 cf75d7b2c5 cBlockInfo: Deprecate direct access to variables. (#4184) 2018-02-20 10:43:28 +00:00
peterbell10 d3c1c626f5
Deal with covered switches consistently (#4161)
* Fixes a number of "<function>: not all control paths return a value" warnings on MSVC.

* Introduces the UNREACHABLE global macro and uses it instead of conditionally compiled switch defaults.

* Move cNBTParseErrorCategory from FastNBT.h into FastNBT.cpp to prevent bad calls to message()
2018-02-04 23:07:12 +00:00
Bond-009 d3a3c6ad2c Removed cBlockInfo.m_IsSnowable (#4105)
* Removed cBlockInfo.m_IsSnowable

* Return IsSnowable from deprecated variable binding m_IsSnowable.
2018-01-23 21:07:06 +00:00
Alexander Harkness ad22922393 Rename cEntity swim states (#3996)
* Replace cEntity:m_IsSubmerged with m_IsHeadInWater
* Replace cEntity:m_IsSwimming with m_IsInWater
* Add API documentation for new symbols
* Apply SetSwimState to all entities, not just mobs and players
* Pickups now use IsOnFire to check if they are on fire before destruction

Fixes #3987
2018-01-14 18:44:45 +00:00
peterbell10 757231cc6e
Add the fmt library (#4065)
* Replaces AppendVPrintf with fmt::sprintf
* fmt::ArgList now used as a type safe alternative to varargs.
* Removed SIZE_T_FMT compatibility macros. fmt::sprintf is fully portable and supports %zu.
* Adds FLOG functions to log with fmt's native formatting style.
2018-01-03 17:41:16 +00:00
peterbell10 177273006e
cLuaState: Update `Push` for entities. (#4128)
Fixes #4127

Some classes were exported but were only pushed as a cEntity
meaning exported functions were inaccessible.
This brings cLuaState::Push(cEntity *) up to date with all exported entities.
2018-01-03 11:38:00 +00:00
peterbell10 832b394715 Fix Travis build (#4101)
Stop using gdb on osx - was breaking the build
Add clang 3.5 build as travis now defaults to 5.0
Fix unknown-warning-option errors on AppleClang
ProtoProxy: Use nullptr
UrlClientTest: add override to callback destructor
Update jsoncpp to use nullptr
2017-12-22 18:25:46 +00:00
bibo38 532731e6f4 Fixed Clang 5.0 compile errors (#4085)
* Fixed Clang 5.0 compile errors

* Fixed wrong comment

* Only disable warnings in Clang 5 or higher

* Added a CMake condition for the Clang 5 no-zero-as-null-pointer-constant warning

* Now using the use_nullptr branch of the Cuberite specific SQLiteCpp fork
2017-12-21 11:36:58 +00:00
Lukas Pioch c5f590d460 Removed UTF-8 BOM (#4033) 2017-09-19 10:34:08 +02: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
peterbell10 e225b7f826 Replace ItemCallbacks with lambdas (#3993) 2017-09-11 23:20:49 +02:00
LogicParrot 49c443896d Revert "Replace ItemCallbacks with lambdas (#3948)"
This reverts commit 496c337cdf.
2017-09-02 08:50:23 +01:00
peterbell10 496c337cdf Replace ItemCallbacks with lambdas (#3948) 2017-09-01 13:04:50 +02:00
Tiger Wang da0778dfaa Merge pull request #3969 from peterbell10/cuboid
cCuboid: restore default copy construct and assign
2017-08-30 15:04:09 +01:00
peterbell10 84941bcc9f Update mbedtls to 2.5.1 (#3964)
* Renaming changes:
  * macro prefix "POLARSSL" -> "MBEDTLS"
  * functions now prefixed with "mbedtls_"
  * rename PolarSSL++ -> mbedTLS++
  * rename polarssl submodule

* Use mbedtls' AES-CFB8 implementation.

* Add cSslConfig to wrap mbedtls_ssl_config

* Update cTCPLink and cBlockingSslClientSocket to use cSslConfig

* Use cSslConfig in cHTTPServer

* Use cSslConfig for cMojangAPI::SecureRequest

* CI Fixes

* Set -fomit-frame-pointer on the right target
2017-08-30 15:00:06 +01:00
peterbell10 3687ef397c Cleanup Vector3 constructors and Abs 2017-08-28 13:48:07 +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
Pablo Beltrán b18f6637b6 Fully implemented leashes (#3798) 2017-08-21 10:46:41 +02:00
peterbell10 b8dda388e0 Represent cItem::m_Lore as an AStringVector (#3882)
* Replace cItem::m_Lore with AStringVector

* Reword deprecation warning

* Fix lua bindings
2017-08-18 11:29:54 +01:00
Lane Kolbly 1ec85a2b2c Add cLuaWindow OnClicked Callback (#3901) 2017-08-17 16:27:43 +02:00
Lane Kolbly 7bdbfad1bb Changed int parameters to vector parameters in cCuboid and simulators (#3874) 2017-08-17 15:48:38 +02:00
Tiger Wang fdd4b6e7c4 Merge pull request #3897 from peterbell10/PlaceSound
cBlockInfo: Remove/deprecate place sound
2017-08-13 12:37:37 +01:00
peterbell10 9472380494 cBlockInfo: Deprecate place sound 2017-08-07 09:31:36 +01:00
Lukas Pioch 07f25253a2 Removed unneeded includes (#3902) 2017-08-06 20:57:44 +01:00
Dan Čermák 028ed77ca9 Fixed compilation for clang 4.0 & gcc 7.1 2017-08-04 11:17:39 +02:00
peterbell10 759618b035 Remove double includes part 2 (#3890) 2017-08-03 15:34:19 +02:00
Lukas Pioch 0397535fa7 Removed unused forward declarations (#3888) 2017-08-03 15:10:29 +02:00
Lukas Pioch 4691bc5a29 Removed double includes (#3885) 2017-08-02 19:57:20 +01:00
peterbell10 a56cfd1f42 Remove smart pointer macros 2017-07-21 14:41:51 +01:00
Lane Kolbly b61898c30c Lua plugin cColor (#3833) 2017-07-12 12:30:43 +02:00
peterbell10 d6ee1caf4c Remove double delete of PrepareChunk lua callback (#3844) 2017-07-12 11:56:01 +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
Lane Kolbly 10a3bd9d12 Changed Lua plugins to only execute files ending in .lua (#3831) 2017-07-07 08:42:35 +02:00
peterbell10 33527067ed Update tolua and export EffectID 2017-06-29 18:58:48 +02:00
Mattes D 399ea0bf1d cNetwork bindings: Use ApiParamError and CheckParam(Static)Self. 2017-06-26 10:52:59 +02:00
Mattes D e05ca49459 Moved ApiParamError into cLuaState. 2017-06-26 10:52:59 +02:00
Lukas Pioch 9c25520b69 Corrected APIDoc for cBlockArea and exported missing functions (#3808) 2017-06-26 09:02:06 +02:00
Lukas Pioch beda050341 Added check if datatype is present in block area (#3811) 2017-06-26 08:49:52 +02:00
Mattes D fe42538349 cBlockArea supports block entities. (#3795) 2017-06-24 11:58:06 +02:00
Mattes D ea6660721b NetworkSingleton: Fixed a throw warning in VS2017. (#3792)
Also fixed the misleading name.
2017-06-22 21:10:41 +02:00