1
0
Fork 0
Commit Graph

45 Commits

Author SHA1 Message Date
Tiger Wang a62b2b1be2
Move item placement into item handlers (#5184)
* Move item placement into item handlers

+ Add appropriate CanBeAt checks in cPlayer::PlaceBlocks, into which all placement handlers call.
* Partly addresses #5157
* Fixes #4878
* Fixes #2919
* Fixes #4629
* Fixes #4239
* Fixes #4849

Co-authored-by: changyong guo <guo1487@163.com>
Co-authored-by: Xotheus <shady3300@outlook.com>
Co-authored-by: Krist Pregracke <krist@tiger-scm.com>

* Review fixes

* Update APIDesc.lua

* Rename

Co-authored-by: changyong guo <guo1487@163.com>
Co-authored-by: Xotheus <shady3300@outlook.com>
Co-authored-by: Krist Pregracke <krist@tiger-scm.com>
2021-05-05 13:25:10 +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
Mattes D 487f9a2aa9
Vector3 in Handlers (#4680)
Refactored all cBlockHandler and cItemHandler descendants to use Vector3.
2020-04-21 22:19:22 +02:00
Mattes D 26ac146f41
More Vector3 in cBlockHandler (#4644)
* cBlockHandler.OnUpdate uses Vector3 params.

Also slightly changed how block ticking works.
2020-04-17 10:36:37 +01:00
Mattes D 221cc4ec5c
Refactored block-to-pickup conversion. (#4417) 2019-10-16 10:06:34 +02: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
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
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
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
Lane Kolbly 87c89a1727 Bed piston fix (#3956)
* Threaded world interface into ConvertBlockToPickups

* Changed how cBlockPiston::PushBlocks sets the old block to air, so that the block exists for the DropBlock call.

* Removed unused a_Digger argument.

* Removed incorrect comment

* This time actually removed a_Digger references.
2017-08-25 10:56:01 +01:00
Pablo Beltrán b18f6637b6 Fully implemented leashes (#3798) 2017-08-21 10:46:41 +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 0397535fa7 Removed unused forward declarations (#3888) 2017-08-03 15:10:29 +02:00
peterbell10 8eb5672920 cWorld::SendBlockTo take player by ref 2017-08-01 08:21:20 +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
LogicParrot ca6ef58b1e Bulk clearing of whitespace 2016-02-05 23:50:18 +02:00
hallucino 9c85ed5864 Spawn baby mobs 2015-07-16 22:49:55 +02:00
STRWarrior e5cfe0cd96 Added a size check for portals.
Made the portal size configurable

Alpha-sorted SetXYZNetherPortalXYZ functions
2015-06-28 17:05:44 +02:00
Mattes D cc069ccb2a Changed cEntity::m_UniqueID to UInt32. 2015-03-21 15:18:17 +01:00
Tycho 045d54e0e2 Merge branch 'master' into redstoneTests
Conflicts:
	src/Blocks/ChunkInterface.h
2014-09-17 18:47:33 +01:00
Tycho 6e7c0e33b5 Added first test to show the object can be created 2014-09-17 18:40:10 +01:00
Howaner d07ef85ee3 Spawn exp if you break a mob spawner. 2014-09-12 16:41:23 +02:00
Tycho 2c945c8818 TimeOfDay does not need to be an Int64 2014-09-08 19:07:45 +01:00
Tiger Wang 37140ae578 Merge branch 'master' into portals
Conflicts:
	src/Blocks/WorldInterface.h
	src/ClientHandle.cpp
	src/ClientHandle.h
	src/Entities/Player.cpp
	src/Entities/Player.h
	src/Generating/FinishGen.cpp
	src/Protocol/Protocol.h
	src/Protocol/Protocol125.cpp
	src/Protocol/Protocol125.h
	src/Protocol/Protocol16x.cpp
	src/Protocol/Protocol16x.h
	src/Protocol/Protocol17x.cpp
	src/Protocol/Protocol17x.h
	src/Protocol/ProtocolRecognizer.cpp
	src/Protocol/ProtocolRecognizer.h
	src/Root.h
	src/World.cpp
2014-07-18 20:10:51 +01:00
madmaxoft 5e198c6730 Basic style fixes. 2014-07-17 22:50:58 +02:00
Tiger Wang 19caba5125 Redstone simulator is alerted to lever unpowering
* Fixed the "fix" that broke the fix for #535, thereby fixing said issue
* Fixed #535
2014-07-02 18:46:00 +01:00
Tiger Wang 7615ed90c0 Merge branch 'master' into portals
Conflicts:
	src/Chunk.cpp
	src/Entities/Entity.h
	src/Entities/Player.h
2014-06-21 22:14:23 +01:00
Howaner a89524d533 Add DoWithBlockEntityAt() to WorldInterface.h 2014-06-17 01:15:38 +02:00
Tiger Wang a70b8298b6 Cauldrons check the heightmap 2014-06-14 10:14:04 +01:00
Tiger Wang 156c9851b8 Suggestions 2014-06-05 17:58:29 +01:00
Tiger Wang cea3a8e7e8 Cauldrons fill 2014-05-29 16:58:40 +01:00
madmaxoft 773ce7fde6 Fixed non-virtual destructors warnings. 2014-03-28 21:35:45 +01:00
Tiger Wang b64e9fb7f5 Beds now work properly fixes #707
Also fixes FS392

Conflicts:
	src/Blocks/WorldInterface.h
	src/ClientHandle.cpp
2014-03-09 15:32:34 +00:00
Howaner 1c7a580e52 Fix comment 2014-03-06 13:35:53 +01:00
Howaner 594ddd86a0 Add SendBlockTo to cWorldInterface 2014-03-05 19:33:43 +01:00
Tycho cf3b4ec226 Changed Signiture of OnDestroyedByPlayer 2014-02-01 06:01:13 -08:00
Tycho c6304b2b4f Changed pointers to references 2014-02-01 05:06:32 -08:00
Tycho 25ec7750aa Changed signitures of Several BLockHandler Methods
Changed the signitures of the following to use interfaces:
GetPlacementBlockTypeMeta
OnPlaced
OnPlacedByPlayer
OnDestroyed
OnNeighbourChanged
NeighbourChanged
OnUse
CanBeAt
Check
2014-01-31 15:17:41 -08:00
Tycho 14e48ccb4b Refactored cBlockHandler::OnUse and dependents 2014-01-26 06:20:39 -08:00
Tycho 15b92af166 First attempt at Implementing Interfaces 2014-01-25 11:14:14 -08:00