1
0
Fork 0
Commit Graph

47 Commits

Author SHA1 Message Date
Tiger Wang 81f63b6a09 Re-export SetBlockMeta
* Fixes #5195
2021-06-28 21:54:21 +01:00
Mat 5b440c3ca7
Replace invalid references in deprecation messages (#5235) 2021-06-07 07:49:45 +00:00
Tiger Wang 4cd49d7eca Fix sending incorrect date values on world change
Yak shave: make more things use cTickTime. Fix a couple of incorrect modulo-on-millisecond-value by making them use WorldTickAge.
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 45591cbe7b
Properly deprecate more XYZ parameter'd functions (#5147)
* Fixes #5144
2021-03-15 02:28:18 +00:00
Mattes D 46398f4671 Replaced cpp14::make_unique<> with std::make_unique<>. 2020-08-01 20:04:31 +01:00
Mattes D c9a9b3c9d0
Bindings: Allow coercion between Vector3 subtypes. (#4646)
In manually bound functions, allows one to use any Vector3<T> value, as well as a {x, y, z} table, in Lua as any Vector3<T> parameter.
Has example in Debuggers' /vector command.
Unfortunately doesn't work in auto-bindings.
2020-04-14 16:43:21 +02:00
Bond-009 ea386eaab1
Lock hopper when powered by redstone (#4347)
* Lock hopper when powered by redstone

* Add to manual bindings

* Add hopper API documentation

Co-authored-by: Mat <mail@mathias.is>
2020-03-27 12:03:28 +00:00
Mattes D a2ffa432b3 Separated chunk generator from world / plugin interfaces.
The generator now only takes care of servicing synchronous "GetChunk(X, Y)" and "GetBiomes(X, Y)" requests.
2019-09-06 16:12:33 +02:00
Lukas Pioch 528db6eea7 Added null check for position (#4366) 2019-08-11 00:32:22 +02:00
Mark Asp c00b365617 Check for nil in cWorld:SpawnSplitExperienceOrbs binding (#4354)
Adds explicit nil check for 'position' parameter to prevent crashes if invalid.

Fixes #4352
2019-07-28 14:09:51 +01:00
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 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
Lukas Pioch c5f590d460 Removed UTF-8 BOM (#4033) 2017-09-19 10:34:08 +02: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
peterbell10 f4f2fc7c3d Add cUUID class (#3871) 2017-08-25 13:43:18 +01: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
Mattes D d4aff474c2 cLuaState: Added template to push multiple values in a single call. (#3331) 2016-08-21 11:03:10 +02:00
ElNounch 787173351d Fix cWorld:QueueTask() Lua's binding
Manual binding expect three parameters : self, a number, a function
And then read self and a function...
Removing the extra check for the broken second argument
2016-08-17 23:27:26 +00:00
Mattes D 0f51f7e358 Fixed cWorld:ChunkStay bindings. (#3319)
Introduced new cLuaState::cOptionalCallback for representing optional callbacks (nil from Lua side).
Introduced new cLuaState::cStackTable class for easy access to Lua table's elements.

Fixes #3305.
2016-08-14 16:26:31 +02:00
Mattes D bf88312a16 Converted cLuaState::cCallbackPtr into a UniquePtr. 2016-06-27 20:51:53 +02:00
Mattes D 24853397ef LuaState: Implemented proper locking for cCallback. 2016-06-27 20:51:51 +02:00
Mattes D b7e1a66815 Changed world tasks to use cLuaState::cCallback. 2016-06-27 20:51:49 +02:00
Mattes D e3d34d9917 Revert "Lua callback" 2016-03-21 09:58:15 +01:00
Mattes D d0a04a7a82 Changed world tasks to use cLuaState::cCallback. 2016-03-17 19:29:02 +01:00
LogicParrot ca6ef58b1e Bulk clearing of whitespace 2016-02-05 23:50:18 +02:00
Arnaud Meuret e19109465d Fix typo (ammount) 2016-01-02 22:02:02 +01:00
Mattes D 086c8b1834 Revised the explosion-related Lua API and docs.
Fixes #2746.
2015-12-18 12:40:34 +01:00
Lukas Pioch 9749c3aac9 Implemented brewing 2015-11-03 18:00:55 +01:00
Mattes D 9da404ea2d Fixed a race condition between chunk loader and generator.
When using ChunkWorx to generate multiple chunks, the server would sometimes fail an assert because it would generate a chunk even when it was successfully loaded. This was caused by chunks queued in cWorld's m_SetChunkDataQueue and thus being marked as "InQueue" although they were already loaded.

Solved by adding a new parameter to chunk coord callbacks specifying whether the operation succeeded or failed, and using that instead of the chunk presence flag to decide whether to generate or not.
2015-10-04 14:06:37 +02:00
Tiger Wang a8bfe3a4c1 Prepared ScheduleTask for threading refactor
* Llama-ified and condensed Schedule/QueueTask
- Removed hackery done with piston animations
2015-09-25 18:56:49 +01:00
tycho b4f934b808 fixed cast 2015-09-24 15:54:32 +01:00
tycho 6e86d20f73 Add new "ForEach" function: ForEachLoadedChunk. 2015-09-24 15:54:32 +01:00
Julian Laubstein dd5201c29e Some warning fixes 2015-08-18 08:49:00 +02:00
Samuel Barney 804805d35a Silenced and fixed many warning messages across multiple files. 2015-07-29 09:49:30 -06:00
Hax52 9f1d1c058f Buttons no longer click on when already on. Buttons now play sound when clicking off. 2015-06-24 13:52:56 -05:00
tycho 06a74e45e2 Made cLightingThread own its callbacks 2015-05-30 11:11:17 +01:00
tycho 1577a080ee Merge branch 'master' into PreventNewWarnings 2015-05-23 11:31:03 +01:00
Alexander Harkness de5e056a88 TryGetHeight returns a bool
should fix #2099
2015-05-23 10:37:50 +01:00
tycho 480052c058 Added LuaState support for all integral types
All so added error handling for out of range values
2015-05-19 17:09:05 +01:00
Mattes D 15771e4759 Moved cWorld manual bindings out into a separate file. 2015-05-13 11:30:57 +02:00