1
0
Commit Graph

464 Commits

Author SHA1 Message Date
Mattes D
61904af626 Moved growing from cWorld / cChunk to cBlockHandler descendants. 2019-10-28 10:45:43 +01:00
Mattes D
221cc4ec5c
Refactored block-to-pickup conversion. (#4417) 2019-10-16 10:06:34 +02:00
Mattes D
365cbc6e1c
Refactored more of Entities and BlockEntities to use Vector3. (#4403) 2019-09-29 14:59:24 +02:00
Mattes D
180a43d097 Fixed MSVC warnings (#4400) 2019-09-27 16:51:44 +01:00
Mattes D
66e73a2d68 NBTChunkSerializer: Cleaned up interface.
Removed dependency on cChunkDataCallback.
Moved all the serializing code into a worker class.
Changed the serialization into a single-call action.
2019-09-24 17:38:59 +02:00
Mattes D
878393a03d Moved the generator defaults to ComposableGenerator. 2019-09-06 16:12:33 +02: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
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
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
changyong guo
01e72ddb65 Rewrite explosion knock back (#4251)
1. Base knockback on an entity's bounding box intersection with the explosion 
2. Armor blast protection reduces knockback
3. Don't apply knockback to players flying in creative mode

Fixes #4139
2018-07-23 10:24:00 +01:00
Bond-009
98d807187b Removed duplicate code (#4198)
Should also fix dogs not despawning
2018-04-11 12:17:30 +01: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
d11335e4f6 Add world name in logs from cWorld (#4148) 2018-01-16 22:04:39 +00:00
Alexander Harkness
6309c6a97f
improve rain simulation (#4017)
* Uses vanilla logic to decide which blocks rain falls through.
 * Rain falls infinitely above the world, and stops at y=0.
 * Entities will now be extinguished if they are under rain-blocking
blocks, and fire will now be extinguished by rain similarly.
 * Create IsWeatherWetAtXYZ to identify wetness at a particular location. 
 * Use new code for enderman rain detection.
 * Fixes issue #916
 * Disable warnings for global constructors in the fire simulator.
2017-12-26 21:25:57 +00:00
peterbell10
c54bf40ef9 cWorld Threads: Seperate initialization and thread start.
Prevents nullptr dereferences before Start has been called.
2017-10-21 19:33:22 +02:00
peterbell10
1537ebed6f cWorld: Move Initialization from Start to the constructor.
Start now does nothing more than launch the world's threads.
2017-10-21 19:33:22 +02: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
e225b7f826 Replace ItemCallbacks with lambdas (#3993) 2017-09-11 23:20:49 +02:00
Lane Kolbly
b12f4ef7d5 Made world data paths adjustable, and added API to temporarily disable saving chunks to disk. (#3912) 2017-09-07 13:41:16 +01:00
Bond-009
104f9e127b Changed some int parameters to vector parameters (#3937) 2017-09-07 10:25:34 +02:00
peterbell10
ef1f371dab Add cWorld::RemoveEntity and use in cEntity (#4003)
* Add cWorld::RemoveEntity and use in cEntity

* cEntity: Remove uneeded asserts from Destroy and DoMoveToWorld
2017-09-05 15:11:35 +01: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
1779db1201 cWorld: Add entities without holding of m_CSEntitiesToAdd
* Fixes deadlock when cWorld::AddEntity is called while holding chunk map CS.
2017-08-29 15:46:36 +02:00
peterbell10
f4f2fc7c3d Add cUUID class (#3871) 2017-08-25 13:43:18 +01:00
Pablo Beltrán
b18f6637b6 Fully implemented leashes (#3798) 2017-08-21 10:46:41 +02: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
Lane Kolbly
7bdbfad1bb Changed int parameters to vector parameters in cCuboid and simulators (#3874) 2017-08-17 15:48:38 +02:00
Tiger Wang
4ef47aed62 Changed entity ownership model to use smart pointers 2017-08-07 19:24:16 +01:00
peterbell10
759618b035 Remove double includes part 2 (#3890) 2017-08-03 15:34:19 +02:00
Lukas Pioch
4691bc5a29 Removed double includes (#3885) 2017-08-02 19:57:20 +01:00
peterbell10
8eb5672920 cWorld::SendBlockTo take player by ref 2017-08-01 08:21:20 +02:00
peterbell10
a56cfd1f42 Remove smart pointer macros 2017-07-21 14:41:51 +01:00
Mattes D
167c4bf2e6 Simulators: Added area-based wakeup. 2017-07-16 10:01:19 +02:00
Lane Kolbly
793acd267f Changing pickup lifetime and combining semantics, making these adjustable in the lua api. (#3843) 2017-07-12 12:13:27 +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
3d56ad01aa Let water vaporise in the Nether by default 2017-06-20 09:28:00 +02:00
peterbell10
f4de38af80 Remove sign conversion 2017-06-16 07:07:02 +02:00
peterbell10
360d8eade0 FastRandom rewrite (#3754) 2017-06-13 21:35:30 +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
Pablo Beltrán
2359611c57 Don't destroy monster when last target type is a player (#3721)
In current Cuberite version if you are pursued by monsters you just have to disconnect and connect again to get rid of them. If no other player is in your chunk monsters will get destroyed.
2017-05-21 10:29:06 +02:00
Mattes D
2c3c1f1527 Tracer replacement (#3704)
* Replaced cTracer usage with cLineBlockTracer.

* Exported new cLineBlockTracer utility functions to Lua API.
2017-05-11 13:34:36 +01:00
Lukas Pioch
5580d558a5 Added missing checks for Initialize function and updated APIDoc 2017-05-08 06:31:45 +02:00
Bond-009
ca3aa4ca06 Changed world_end to world_the_end #3531 (#3538) 2017-02-24 10:02:16 +01:00
mathiascode
dae2adde65 Updated sounds and effect IDs (#3422) 2017-02-15 06:05:24 +01:00