1
0
Fork 0
Commit Graph

187 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 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
Alex Sweet a0896c63d7 Smelting Gives Experience (#4094)
* Smelting Exp

Smelting now gives experience

* Furnace.txt update

Exp rewards are entered in furnace.txt, Reward calculation is now done
is the furnaceentity class

* furnace.txt update

Changed alignment tabs to spaces
Included documentation of exp in recipe

* Updated StringToFloat

changed strtod to strtof

* Explicit Float to Int

* Reworked Smelting Rewards

* No C casts

-Adds new function to the api
-Sets reward counter to 0 in furnace constructor

* Style and exp lock removed

-Fixed  style mistakes accoring to PR notes
-XP isn't locked to a single player anymore

* No Smelter API

-Removed SetLastSmelter and GetLastSmelter
-Fixed comments
-Fixed log reward amounts
2018-04-11 07:46:11 +01:00
peterbell10 f0c735e846
A player's inventory is always opened by its owner. (#4176)
Fixes #4093

Window updates are only broadcast to players in the m_OpenedBy list. Normally players are added after sending a window open packet but no packet is sent for a player's inventory. This meant broadcasts were never sent for the inventory window.
2018-01-28 17:24:59 +00:00
peterbell10 a72891fbb0
cWindow: Fix slot area priority when double click stacking. (#4086)
Fixes #4084
2018-01-15 11:35:27 +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 0bacda3269 Implement horse inventory (#4053)
* Implement horse inventory

* Fix sign conversions

* Add API doc for ItemCategory::IsHorseArmor

* Improve HandleOpenHorseInventory comment and style fixes.
2017-10-21 17:56:09 +01:00
Lane Kolbly 30c8470a52 Changed BroadcastSoundEffect, SendSoundEffect, and CastThunderbolt parameters to vectors (#3959)
* Made BroadcastSoundEffect take vector parameters.

* Added docs for new vectored methods

* Removed old code

* Fixed lua warnings

* Made old BroadcastSoundEffect not an override.

* m_Block to m_BlockPos, used Vector3d constructor where prettier.

* a_Block to a_BlockPos

* Changed thunderbolt a_Block to a_BlockPos
2017-09-19 15:12:54 +01: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
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
Lukas Pioch 743a50014a Replaced includes with forward declarations 2017-08-13 12:31:10 +01:00
Lukas Pioch 4691bc5a29 Removed double includes (#3885) 2017-08-02 19:57:20 +01:00
Lane Kolbly 790e15f2e6 Added anvil enchantment handling. (#3857)
+ Added anvil enchantment handling.
2017-07-28 18:00:20 +01:00
peterbell10 41d016cf5b Handle middle mouse drag (#3847) 2017-07-13 15:43:48 +02:00
peterbell10 360d8eade0 FastRandom rewrite (#3754) 2017-06-13 21:35:30 +02:00
Pablo Beltrán 84bdba345d Off-hand/shield slot functional, save and load slot, bow + arrow functional (#3725)
Fixes #3714.
2017-05-24 08:09:58 +02:00
Lukas Pioch e35ac1bfb9 Clang 5.0 fixes
- Added override keyword
- Removed inherited member variables
2017-05-21 12:19:06 +02:00
Lukas Pioch 41bfb22834 Corrected brewingstand and added support for fuel 2017-05-08 06:30:54 +02:00
mathiascode dae2adde65 Updated sounds and effect IDs (#3422) 2017-02-15 06:05:24 +01:00
Mattes D cbff1378fd Fixed bindings for cBlockArea:Read and Write. (#3568)
The original bindings accepted nil as the World param, causing a crash.
2017-02-05 16:00:38 +01:00
Mattes D 0bffa29358 Removed ClientHandle.h dependencies from common headers. 2016-11-18 20:00:04 +01:00
bibo38 cb640ffea4 Spectators added (#2852) 2016-10-12 14:38:45 +02:00
Mattes D d2e8643607 Fixed type-casting-related warnings. 2016-08-24 22:26:53 +02:00
Mattes D 8eaa8613da CMake: Remove needless minimum version specifications. 2016-07-18 22:11:42 +02:00
Mattes D f8e1df2476 Updated API documentation. 2016-07-18 22:11:40 +02:00
Mattes D fb4c3fc4d9 Changed cLuaWindow callbacks to use cLuaState::cCallback. 2016-06-27 20:51:50 +02:00
Mattes D e3d34d9917 Revert "Lua callback" 2016-03-21 09:58:15 +01:00
Mattes D af200dfaae Changed cLuaWindow callbacks to use cLuaState::cCallback. 2016-03-17 19:29:03 +01:00
LogicParrot ca6ef58b1e Bulk clearing of whitespace 2016-02-05 23:50:18 +02:00
Mathias 89f3dec7ac Updated old forum links 2016-01-31 02:25:03 +02:00
Mattes D 80e1eb37dd Renamed leftover strings to Cuberite / Server, as needed.
Also upgraded the user setting file for MSVC to 2013.
2016-01-01 21:05:09 +01:00
Tiger Wang 5b62c4c314 Reorganised the redstone simulator
-> Many thanks to @worktycho for the idea, and @Haxi52 for the implementation plan!
* Uses classes and inheritance now
* Speed should be improved
2015-12-18 13:17:38 +00:00
Lukas Pioch d620dcdd08 Moved variables into scope, removed unused variables and fixed variables 2015-12-17 10:48:36 +01:00
Dave Tucker 83870f9fc0 Add enum for Sound and Particle Effects
Fixes #2603

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2015-11-24 13:21:40 +00:00
Lukas Pioch 9749c3aac9 Implemented brewing 2015-11-03 18:00:55 +01:00
Mattes D 6e4122e551 Unified the doxy-comment format. 2015-07-31 16:49:10 +02:00
Samuel Barney 804805d35a Silenced and fixed many warning messages across multiple files. 2015-07-29 09:49:30 -06:00
Mattes D 97beb2a350 Fixed custom recipes result clientside bug.
Fixes #2345.
2015-07-26 13:30:25 +02:00
tycho b2fa71a32a Fix comments 2015-05-28 12:54:04 +01:00
tycho e19693e529 Merge branch 'master' into PreventNewWarnings
Conflicts:
	src/Inventory.cpp
2015-05-28 11:05:41 +01:00
Alexander Harkness da4a76bb50 Merge pull request #2061 from mc-server/fixes
Fixes
2015-05-27 12:21:17 +01:00
Tiger Wang 10c9e66aad Fixes #2041 2015-05-24 13:37:36 +01:00
tycho dae9e5792a Made -Weverything an error. 2015-05-24 12:56:56 +01:00
tycho 81c0116cf1 Merge branch 'master' into PreventNewWarnings 2015-05-23 07:33:52 -07:00