Commit Graph
471 Commits
Author SHA1 Message Date
MatandGitHub 195bebb480 Disable bonemealable settings for now (#4551) 2020-03-26 17:06:15 +00:00
MatandGitHub b7e88e2c9f Fix nether mob spawning (#4546)
* Fix nether mob spawning

* Remove zombie from nether mobs
2020-03-25 10:49:36 +00:00
MatandGitHub 7700116330 Pickup spawn improvements (#4525)
Pickups are now thrown around when spawned, like in vanilla. Pickups also bail out of the collision detection checks while being created, to prevent them from blasting too far off in e.g. cobblestone generators.
2020-03-23 00:05:47 +00:00
MatandGitHub c968f1f7da TNT position fixes (#4519)
* TNT position fixes

* Don't add offset to explosion spawn coords

* Don't make other entities push TNT

* Correct initial TNT speed

* Fix typo

* Improvements

* Revert unwanted change

* Style fixes

* Update format
2020-03-22 17:33:36 +02:00
MatandGitHub 61a6a18b79 Improve explosion visuals (#4511) 2020-03-20 23:42:16 +00:00
MatandGitHub 7d4934534e Stabilise MoveToWorld (#4004)
* Stabilise MoveToWorld

* Fix comments and deprecate ScheduleMoveToWorld

* Enhanced thread safety for m_WorldChangeInfo

* Return unique_ptr from cAtomicUniquePtr::exchange

* cWorld now calls entity cEntity::OnAddToWorld and cEntity::OnRemoveFromWorld.

Allows broadcasting entities added to the world from the world's tick thread.
This also factors out some common code from cEntity::DoMoveToWorld and cEntity::Initialize.

As a consequence, cEntity::Destroy(false) (i.e. Destroying the entity without broadcasting) is impossible.
This isn't used anywhere in Cuberite so it's now deprecated.

* Update entity position after removing it from the world.
Fixes broadcasts being sent to the wrong chunk.

* Fix style

* cEntity: Update LastSentPosition when sending spawn packet

* Add Wno-deprecated-declarations to the lua bindings

* Kill uses of ScheduleMoveToWorld
2020-03-05 12:52:34 +02:00
NiLSPACEandMattes D dc787e1d96 Improved large jungle and acacia tree generation (#4413) 2019-12-22 23:38:11 +01:00
Mattes D 61904af626 Moved growing from cWorld / cChunk to cBlockHandler descendants. 2019-10-28 10:45:43 +01:00
Mattes DandGitHub 221cc4ec5c Refactored block-to-pickup conversion. (#4417) 2019-10-16 10:06:34 +02:00
Mattes DandGitHub 365cbc6e1c Refactored more of Entities and BlockEntities to use Vector3. (#4403) 2019-09-29 14:59:24 +02:00
Mattes Dandpeterbell10 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
peterbell10andAlexander Harkness 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 guoandpeterbell10 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
peterbell10andGitHub 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
peterbell10andGitHub 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
peterbell10andTiger Wang 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 guoandpeterbell10 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-009andAlexander Harkness 98d807187b Removed duplicate code (#4198)
Should also fix dogs not despawning
2018-04-11 12:17:30 +01:00
peterbell10andGitHub 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-009andAlexander Harkness d11335e4f6 Add world name in logs from cWorld (#4148) 2018-01-16 22:04:39 +00:00
Alexander HarknessandGitHub 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
peterbell10andMattes D c54bf40ef9 cWorld Threads: Seperate initialization and thread start.
Prevents nullptr dereferences before Start has been called.
2017-10-21 19:33:22 +02:00
peterbell10andMattes D 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-009andMattes D 10c5c1227e BroadcastBlockBreakAnimation and BroadcastBlockEntity use vectors (#4038) 2017-09-25 18:17:45 +02:00
Lane Kolblyandpeterbell10 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 PiochandMattes D c5f590d460 Removed UTF-8 BOM (#4033) 2017-09-19 10:34:08 +02:00
peterbell10andMattes D e225b7f826 Replace ItemCallbacks with lambdas (#3993) 2017-09-11 23:20:49 +02:00
Lane KolblyandAlexander Harkness 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-009andMattes D 104f9e127b Changed some int parameters to vector parameters (#3937) 2017-09-07 10:25:34 +02:00
peterbell10andAlexander Harkness 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
LogicParrotandAlexander Harkness 49c443896d Revert "Replace ItemCallbacks with lambdas (#3948)"
This reverts commit 496c337cdf.
2017-09-02 08:50:23 +01:00
peterbell10andMattes D 496c337cdf Replace ItemCallbacks with lambdas (#3948) 2017-09-01 13:04:50 +02:00
peterbell10andLukas Pioch 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
peterbell10andAlexander Harkness f4f2fc7c3d Add cUUID class (#3871) 2017-08-25 13:43:18 +01:00
Pablo BeltránandMattes D b18f6637b6 Fully implemented leashes (#3798) 2017-08-21 10:46:41 +02:00
Tiger WangandGitHub 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 KolblyandMattes D 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
peterbell10andLukas Pioch 759618b035 Remove double includes part 2 (#3890) 2017-08-03 15:34:19 +02:00
Lukas PiochandTiger Wang 4691bc5a29 Removed double includes (#3885) 2017-08-02 19:57:20 +01:00
peterbell10andLukas Pioch 8eb5672920 cWorld::SendBlockTo take player by ref 2017-08-01 08:21:20 +02:00
peterbell10andTiger Wang a56cfd1f42 Remove smart pointer macros 2017-07-21 14:41:51 +01:00
Mattes DandLukas Pioch 167c4bf2e6 Simulators: Added area-based wakeup. 2017-07-16 10:01:19 +02:00
Lane KolblyandLukas Pioch 793acd267f Changing pickup lifetime and combining semantics, making these adjustable in the lua api. (#3843) 2017-07-12 12:13:27 +02:00
Lukas PiochandGitHub 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-009andLukas Pioch 3d56ad01aa Let water vaporise in the Nether by default 2017-06-20 09:28:00 +02:00
peterbell10andLukas Pioch f4de38af80 Remove sign conversion 2017-06-16 07:07:02 +02:00