1
0
Fork 0
Commit Graph

26 Commits

Author SHA1 Message Date
Rorkh 4c5d9d38f4 Only nether-native mobs can see through lava 2021-10-02 21:18:18 +01:00
Tiger Wang 028a5735c5
Spectation: add dedicated pathway for spectator mode (#5303)
* Spectation: add dedicated pathway for spectator mode

+ Sync player rotation with spectated entity.
+ Add dedicated infrastructure to cPlayer for handling spectation, instead of misusing entity riding.
* Avoid infinite recursion when exiting spectation, fixes #5296

* AttachTo: Change parameter to reference
2021-09-29 22:17:03 +00:00
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 6e80f7544d Update entity sizes 2021-04-12 22:35:07 +01:00
12xx12 d78bcac150
Obsidian pillars, end fountain, not Ender dragon spawning (#4993)
* added generator for obsidian pillars and central fountain which then is used for the exit portal

* checkstyle

* checkstyle the second

* fixed clang
removed magic number
added Clamp

* make the pillars configurable

* fixed clang
added warning if there was a unknown value if the tower should have a cage or not

* forgot to cancel on unkwon value

* fixed clang this time maybe

* added new generator to generator test

* fixed test

* added prefab generation for end fountain

* fixed checkstyle and updated the prefab

* added ender dragon spawning
made the fountain positioning dynamic
removed fountain placement functions

* added enderdragon stuff to testing

* pls compile

* added changes suggested by @peterbell10

* fixed clang

* added debug for further research on the ARM build

* ok - it wasn't my tower placement

* checking in setup

* readded the fountain schematic

* removed finisher

* readded generator

* removed generator trigger - kept ini file access

* using cChunkDef function to calculate abs pos of endercrystal

* yes, I know it's unused...

* commented everything in the ComposableGenerator.cpp
 - so only the new class in compiled in but not called at all

* don't compile in the new generator at all
(removed from CMakeLists.txt)

* readded the new generator

* readded the new generator

* removed debug output

* made the towers generate acrocc chunk borders

* fixed bad merge

* fixed clang

* fixed clang

* generate the dragon 20 blocks above terrain

* trying to fixed weird undefined reference

* maybe this fixes the weird behaviour

* takes chunk width as parameter now

* added new comments with info to generated structures
removed ender dragon spawning
removed chunkwidth from parameter

* fixed linker

* maybe fixed linking. tried with gc and clang

* fixed ender crystal

* fixed test

* updated output strings

* fixed build

* fixed up test

* fixed test compile

* fixed test - cant get the tests to show up

* removed the semicolon

* maybe this is the fix?

* at this point i have no idea - in MVSC it works

* removed the ender dragon

Co-authored-by: 12xx12 <12xx12100@gmail.com>
2021-04-08 12:18:18 +02:00
Tiger Wang 125df19477
Do not fake a tool when converting to pickups (#5170)
* When the cause of destruction was world-induced (CanBeAt check failed) there is no tool. Pass the nullptr directly to ConvertToPickups and let it handle it.
* Fixes #4795
- Remove unused a_Digger parameter to ConvertToPickups.
2021-03-28 14:41:34 +01:00
Tiger Wang de76503d5c Remove DoesDropOnUnsuitable
This is only overridden false in Vines and Snow. It is called when a CanBeAt check fails, to determine whether DropBlockAsPickups is called. However, Vines and Snow already drop nothing without the right tool, so this function is superfluous.
2021-03-15 02:44:39 +00:00
Tiger Wang c53a0ba5f6 Unify block entity pickup conversion
- Removed normal BlockHandler knowledge of block entities during conversion
+ Added cBlockEntity::ConvertToPickups that handles it
2020-09-25 09:07:01 +00:00
Tiger Wang 68cced73af
BlockHandler initialisation is a constant expression (#4891)
* BlockHandler initialisation is a constant expression

If we can't make it all namespaces, this is the next best I guess.

+ Tag handlers constexpr, const as needed
+ Inherit constructors
* Privatise handler functions

* More constexpr

Co-authored-by: Alexander Harkness <me@bearbin.net>
2020-09-20 13:50:52 +00:00
Tiger Wang c3d2956ba5
BlockHandler: no dynamic allocation (#4862)
* BlockHandler: no dynamic allocation
2020-09-17 14:51:42 +01:00
Tiger Wang 501702065b Fixup test block handler stubs 2020-08-04 18:39:47 +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
peterbell10 aac592f985
Manage block entity lifetime with unique_ptr (#4080) 2020-04-03 23:23:38 +02:00
Mattes D 01b8ed5295
Pulled the BlockID and BlockInfo headers from Globals.h. (#4591)
The BlockID.h file was removed from Globals.h and renamed to BlockType.h (main change)
The BlockInfo.h file was removed from Globals.h (main change)
The ENUM_BLOCK_ID and ENUM_ITEM_ID enum names were replaced with ENUM_BLOCK_TYPE and ENUM_ITEM_TYPE (cosmetics)
The various enums, such as eDimension, eDamageType and eExplosionSource were moved from BlockType.h to Defines.h, together with the helper functions for converting between them and strings (StringToDimension et al.) (minor)
Many inline functions were moved from headers to their respective cpp files, so that BlockType.h could be included only into the cpp file, rather than the header.
That broke our tests a bit, since they pick bits and pieces out of the main code and provide stubs for the rest; they had to be re-stubbed and re-verified.
eMonsterType values are no longer tied to E_ITEM_SPAWN_EGG_META_* values
2020-04-03 08:57:01 +02: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 d8d1e6e1d2 Added a BasicGeneratorTest. 2019-09-06 16:12:33 +02:00
Bond-009 5badb9bcca cChunkInterface GetBlock, GetBlockMeta, GetBlockTypeMeta use vectors (#4050) 2017-11-20 11:13:11 +00:00
peterbell10 f4f2fc7c3d Add cUUID class (#3871) 2017-08-25 13:43:18 +01:00
peterbell10 0d0323608d cBlockHandler: take player by ref 2017-08-01 08:21:20 +02:00
Lane Kolbly 5402b214b3 Check for intersection between placed blocks and entities. (#3850)
* Check for intersection between placed blocks and entities.

+ Implemented GetPlacementCollisionBox, to permit custom placement collision boxes for blocks.

* Factored block-entity placement checking into another function in cPlayer.

- Removed vector min/max functions

* Use GetWorld to get the world in DoesPlacingBlocksIntersectEntity.

+ Added block height checks, allow different cEntity subclasses to decide whether they will prevent block placement.
2017-07-28 17:59:21 +01:00
peterbell10 bbf5bec817 BigFlower fixes (#3826)
* BigFlowers fixes

* Correct upper part meta
* Documented parameters to DoesIgnoreBuildCollision
2017-07-07 16:37:53 +02:00
peterbell10 d838ef7ba4 cBlockInfo static initialisation (#3832) 2017-07-03 18:34:27 +02:00
Mattes D fe42538349 cBlockArea supports block entities. (#3795) 2017-06-24 11:58:06 +02:00
Mattes D 96fdd72d45 Gen: Moved tests to a separate folder, unified shared sources. 2017-05-04 09:49:30 +02:00