1
0
Fork 0
Commit Graph

322 Commits

Author SHA1 Message Date
Mat f5d24746d6
Jukebox improvements (#4537)
* Add jukebox block handler

Co-authored-by: peterbell10 <peterbell10@live.co.uk>
2020-03-23 13:45:09 +00:00
Mat 49dd645aa6
Don't remove items twice (#4524)
* Don't remove items twice
2020-03-22 12:17:04 +02:00
Mat 646d3d6a2e
Remove leading slash from command block commands (#4502) 2020-03-19 20:06:25 +01:00
Mat aba329544f
Prevent container item duplication (#4476) 2020-03-04 15:12:15 +01:00
Mattes D 61904af626 Moved growing from cWorld / cChunk to cBlockHandler descendants. 2019-10-28 10:45:43 +01:00
NiLSPACE 241d97bbf9
Fixed crash in hopper while pulling items from blockentity above itself (#4412) 2019-10-04 15:50:47 +02:00
Mattes D 365cbc6e1c
Refactored more of Entities and BlockEntities to use Vector3. (#4403) 2019-09-29 14:59:24 +02:00
Bond-009 4de232bdae Wake up redstone simulator on slot changes for blockentities (#4348)
Fix #1898
Fix #2194
Fix #3063
2019-08-11 00:11:57 +01:00
peterbell10 4727ed2084 Add a formatting function for Vector3 (#4282)
* Vector3: Add custom fmt compatible formatter.

* cLuaState: Add fmt version of ApiParamError

* Use vector formatting in manual bindings

* Always log vectors with FLOG
2018-09-24 21:33:39 +01:00
peterbell10 ee84197014
Force all headers other than "Globals.h" to be included with relative paths (#4269)
Closes #4236

CMake now creates a header file in the build directory under the path "include/Globals.h" which just includes "src/Globals.h" with an absolute path. Then instead of adding "src/" to the include directories, it adds "include/".

#include "Globals.h" still works by including the build generated file and any other src-relative path will not work.
2018-08-29 01:51:25 +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 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 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
Bond-009 5badb9bcca cChunkInterface GetBlock, GetBlockMeta, GetBlockTypeMeta use vectors (#4050) 2017-11-20 11:13:11 +00:00
Bond-009 76a0971279 Fixed 2 small warnings (#4055) 2017-10-02 20:59:25 +01:00
Bond-009 10c5c1227e BroadcastBlockBreakAnimation and BroadcastBlockEntity use vectors (#4038) 2017-09-25 18:17:45 +02: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
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
Bond-009 104f9e127b Changed some int parameters to vector parameters (#3937) 2017-09-07 10:25:34 +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
peterbell10 f4f2fc7c3d Add cUUID class (#3871) 2017-08-25 13:43:18 +01:00
Bond-009 ad3192d696 Award player an achievement when creating a beacon (#3930) 2017-08-21 15:00:49 +01:00
peterbell10 5e81024f89 cBeaconEntity fix no world crash 2017-08-18 11:22:22 +01:00
Tiger Wang 72d7027861 Merge pull request #3489 from cuberite/EntityOwnership
* Changed entity ownership model to use smart pointers
2017-08-18 11:17:56 +01:00
Bond-009 05045860c2 Sitting cats block enderchests from opening (#3906) 2017-08-17 16:29:43 +02:00
Tiger Wang 4ef47aed62 Changed entity ownership model to use smart pointers 2017-08-07 19:24:16 +01:00
Lukas Pioch 4691bc5a29 Removed double includes (#3885) 2017-08-02 19:57:20 +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
Bond-009 7fd3899796 Added 1.12 blocks (#3760) 2017-06-30 10:46:58 +02:00
Mattes D fe42538349 cBlockArea supports block entities. (#3795) 2017-06-24 11:58:06 +02:00
Mattes D 0f21bda12c Fixed missing "override" 2017-06-16 16:20:33 +02:00
Mattes D 0dd1cd750b BlockEntities: Support cloning self. 2017-06-16 14:11:28 +02:00
peterbell10 360d8eade0 FastRandom rewrite (#3754) 2017-06-13 21:35:30 +02:00
Lukas Pioch 7922e6addb Fixes problems with windows:
- Changed cPlayer:OpenWindow to accept a ref, tolua adds a nil check
- Close open lua window in destructor, to avoid dangling pointers
2017-06-05 15:14:23 +02:00
peterbell10 36be4a89f8 Fixed double chests (#3741)
Normal and trapped chests next to each other don't open a double chest window.
Slot changes in the secondary chest are broadcast.
Placing a chest in +x of another updates the original chest's metadata.
2017-06-03 21:17:53 +02:00
peterbell10 ad4172d21c Minor cBrewingRecipes cleanup (#3731) 2017-05-28 20:08:23 +02:00
peterbell10 f261a03c14 Double chest window fix (#3735) 2017-05-28 20:07:38 +02:00
mathiascode de0c86a690 Broadcast mob head changes 2017-05-28 19:37:47 +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
Lukas Pioch e35ac1bfb9 Clang 5.0 fixes
- Added override keyword
- Removed inherited member variables
2017-05-21 12:19:06 +02:00
Pablo Beltrán 758622336e Fixed invisible chests (#3722)
Fixes #3479, #3403, #3696
2017-05-21 11:48:33 +02:00
Lukas Pioch 41bfb22834 Corrected brewingstand and added support for fuel 2017-05-08 06:30:54 +02:00
Marvin Kopf dbdcb85346 Added a nullptr check to cEntity::IsA (#3659)
Fixes #3603
2017-04-01 23:15:08 +02:00
Bond-009 9c9734282d Fireworks can be fired from a dispenser 2017-03-22 11:35:14 +01:00
mathiascode dae2adde65 Updated sounds and effect IDs (#3422) 2017-02-15 06:05:24 +01:00
mathiascode 4311f4a658 Added some blocks and items (#3503) 2017-02-14 11:13:55 +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
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
QUSpilPrgm 33cd7f4e75 - Add a activation flag to droppers and dispensers. Previously droppers and dispensers shot items with every block update.
- Fixes a range check inside cIncrementalRedstoneSimulator::Simulate
2016-06-15 10:33:49 +02:00
QUSpilPrgm 706257f8fb Update Dispensers and let them act more like in Vanilla
- Added code to make bonemeal, potions, minecarts, XP bottles and boats work inside dispensers
- Dispensers are now able to place TNT if the block is transparent but not air
- Added return value that indicates the success of pumpkin, melon, sugarcane and cactus growing functions
- Changed return value of "GrowRipePlant" so that it actually indicates if the block was able to grow
- Fixed "GrowSugarcane" and "GrowCactus" in "GrowRipePlant" so that it only grows them a single block
2016-06-03 15:45:49 +02:00
LogicParrot 7f5757eccf Reduced unnecessary block updates 2016-04-23 00:30:00 +03:00
LogicParrot 83459d0d89 Proper entity destruction in non-ticking chunks 2016-02-19 07:05:22 +02:00
LogicParrot ca6ef58b1e Bulk clearing of whitespace 2016-02-05 23:50:18 +02:00
bibo38 657b0ed007 Changed the format of the MobHead data to allow MobHeads working on MInecraft 1.8
The NBT format now carries the texture data and transmit it to the client.
See: http://minecraft.gamepedia.com/Head#Block_entity
Related to #2674
2016-01-11 17:55:32 +01: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
Gargaj f9008a4860 allow use failures to propagate from the entity/block to the player 2015-12-13 13:27:38 +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
worktycho 171867009e Fix memory leak
Fixes CID 132249
2015-11-08 22:34:52 +00:00
Lukas Pioch 9749c3aac9 Implemented brewing 2015-11-03 18:00:55 +01:00
Lukas Pioch 079bb7c016 Update Loops required for JsonCPP 2015-10-26 00:16:35 +00:00
Mattes D 9871c0b073 Added CircleCI for stylechecking.
This will allow us to remove the stylecheck from Travis builds, making them a bit faster, and having fast style checks
2015-09-17 11:20:10 +02:00
Tiger Wang 511334c500 Fixes #2485 2015-09-02 21:11:25 +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
hallucino 9c85ed5864 Spawn baby mobs 2015-07-16 22:49:55 +02:00
mmdk95 d3662e6589 Fixed DropSpenser sound #2333 2015-07-12 19:30:51 +02:00
Nounours Heureux 91833b7cb8 (Ender) Chests are obstructed by opaque blocks. 2015-07-07 12:29:52 +02:00
worktycho 106e06617a Merge pull request #2224 from cuberite/ChunkQueueCollapsing
Chunk queue collapsing: MK II
2015-07-04 14:43:00 +01:00
Tiger Wang 813ca04676 Fixes #2245
Whoops :/
2015-06-17 00:27:50 +01:00
tycho b259ab53fb Fixed override
This was causing a compile error in clang 3.6
2015-06-15 18:03:54 +01:00
Tiger Wang dd4b415051 Reinstate "Chunk queue collapsing"
This reinstates commit f36acb6835
     and reverts commit adfbc42c02.
2015-06-10 15:16:05 +01:00
Alexander Harkness 1e77f27191 Merge pull request #2144 from mc-server/comparators
Redstone improvements [SEE DESC]
2015-06-09 09:15:08 +01:00
worktycho adfbc42c02 Revert "Chunk queue collapsing" 2015-06-07 20:45:47 +01:00
Tiger Wang de5b1401f8 Comparators 2015-06-06 12:21:09 +01:00
tycho bfe52277b4 Rewrote ChunkSending queue for significantly improved performance 2015-06-05 22:31:21 +01:00
HaoTNN e82cd6e4eb Fixes multiple furnace issues, including from loading world storage 2015-06-03 02:19:22 -07:00
HaoTNN 3142598dee Merge branch 'master' of https://github.com/mc-server/MCServer 2015-06-02 16:08:57 -07:00
tycho b2fa71a32a Fix comments 2015-05-28 12:54:04 +01:00
tycho dae9e5792a Made -Weverything an error. 2015-05-24 12:56:56 +01:00
HaoTNN 2578afb244 Merge remote-tracking branch 'upstream/master' 2015-05-23 14:06:37 -07:00
tycho 81c0116cf1 Merge branch 'master' into PreventNewWarnings 2015-05-23 07:33:52 -07:00
Lukas Pioch e30b2ed487 Fixed missing overrides and added a ignore flag for reserved macro for clang version 3.6 and higher. 2015-05-23 16:28:37 +02:00
tycho 77f1f58c0a Make -Werror disabling file only
Ad fix a load of warnings
2015-05-19 19:32:10 +01:00
haotnn 6128e3f7cd Fixes lit furnace issue in #2051 2015-05-18 23:19:03 -07:00
Tiger Wang 30b17bcb97 Improved hoppers
* Fixes #1994
2015-05-11 22:58:27 +01:00
Mattes D c13b1931ff More style checking.
Spaces around some operators are checked.
2015-05-09 12:58:54 +02:00
Mattes D e5a7a730ed Merge pull request #1826 from mc-server/UnifyPacketizer
Unify packetizer
2015-03-24 13:09:41 +01:00
Mattes D cc069ccb2a Changed cEntity::m_UniqueID to UInt32. 2015-03-21 15:18:17 +01:00