1
0
Fork 0
Commit Graph

154 Commits

Author SHA1 Message Date
Tiger Wang d9a2b8611c
Mitigate MSVC crash (#5146)
Reference: http://ci.appveyor.com/project/Cuberite/cuberite/builds/38087390/job/p857ibg3x87naw36/messages
2021-03-06 12:59:39 +00:00
Tiger Wang 868cd94ee9
Prepare ChunkData for BlockState storage (#5105)
* Rename ChunkData Creatable test

* Add missing Y-check in RedstoneWireHandler

* Remove ChunkDef.h dependency in Scoreboard

* Prepare ChunkData for BlockState storage

+ Split chunk block, meta, block & sky light storage
+ Load the height map from disk
- Reduce duplicated code in ChunkData
- Remove saving MCSBiomes, there aren't any
- Remove the allocation pool, ref #4315, #3864

* fixed build

* fixed test

* fixed the debug compile

Co-authored-by: 12xx12 <44411062+12xx12@users.noreply.github.com>
2021-03-05 14:03:55 +01:00
Tiger Wang eeb63b8901
zlib -> libdeflate (#5085)
+ Use libdeflate
+ Use std::byte
* Fix passing temporary to string_view
+ Emulate make_unique_for_overwrite
2021-01-11 16:39:43 +00:00
12xx12 e35519ec8a
Adding new monster types to enum and saving/loading for easier future implementation (#4941)
* added new monster types to enum
added string <-> enum conversion in namespace serializer
added loading functions
added to saving

* renamed zombie pigman to zombified piglins in enum

Co-authored-by: 12xx12 <12xx12100@gmail.com>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-11-22 23:41:13 +00:00
12xx12 961d5eb420
Add beam target, configurable base visibility to Ender Crystals (#5010)
* Fixes #4990

Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-10-29 20:47:20 +00:00
12xx12 c0711407e9
Adding more customize options to mob spawners and improving the way to look for surrounding entities (#4955)
* added nearly any customize option

* fixed unnecessary diff
added comments

* removed unnecessary const qualifier

* fixed build

* changed to ForEachEntityInBox

* added docs

* updated lua api description

* checkstyle

* added changes suggested by @peterbell10
And now the player may break the server by setting ridiculous ranges

* updated docs
changed cast to static cast

* fixed clang

* fixed clang on WSSAnvil.cpp

Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-10-10 19:31:44 +00:00
12xx12 410d6c0045
Fixing Mob spawner behaviour (#4930)
* fixed mob spawner failure (whoopsie in the BlockEntity.GetChunkZ())
Style

* fixed spawning behaviour

* fixed saving entity type saving

* checkstyle

* removed debug log

* removed short saving

* Style

Co-authored-by: 12xx12 <12xx12100@gmail.com>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-09-27 20:02:16 +03:00
12xx12 f8de67aace Added end portal and enchanting table block entities 2020-09-20 01:40:20 +01:00
12xx12 2d197e147e
Use pitch lookup in noteblock block entity (#4826)
- Removed the calculation in the noteblock block entity

I did the calculation in python if anyone is interested where the numbers are from

Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-09-05 16:07:01 +01:00
Tiger Wang be121f9e80 Save enderchest block entities to storage
+ Add EnderChest saving, as Vanilla does
- Remove CreateBlockEntities. Storage should save & load everything so looping over chunk data is not needed
2020-08-28 21:40:40 +01:00
Alexander Harkness a780b3a4f5
Oops, remember to save your files! 2020-04-10 00:53:04 +01:00
Bond-009 8438def87e
Add Zombie Villagers 2020-04-10 00:50:45 +01:00
Mat 60bcc06f43
Implement wither skeletons (#4563) 2020-04-04 13:44:17 +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 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
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 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
Fabian 0dd172b80f Store Health as a float (#4073)
* Fix #4024

* Fix clang error

* Add comment

* Fix behaviour

* Save Health as float

* Changed m_Health to float

* Remove redundant static_cast

* Fix casts
2017-11-22 13:47:52 +00:00
peterbell10 307e7aaff5 Fix switch warnings (#4013)
* Fix switch warnings
  * Fix a variety of -Wswitch and -Wswitch-enum warnings
  * Remove unneeded -Wno-error flags

* Reorganise some eMonsterType switches
  * Alpha sort eMonsterType cases in WriteMobMetadata
    and in cNBTChunkSerializer::AddMonsterEntity
  * List all mob types in protocol 1.12 and NBTChunkSerializer

* cStructGenTrees::GetNumTrees: remove switch default

* cWSSAnvil::LoadOldMinecartFromNBT: Log unhandled minecart type
2017-09-14 09:48:57 +01:00
peterbell10 447d929da1 Implement anvil chunk sparsing 2017-08-26 20:56:44 +02:00
peterbell10 f4f2fc7c3d Add cUUID class (#3871) 2017-08-25 13:43:18 +01:00
mathiascode 02775e52c4 Minor changes (#3909) 2017-08-24 11:19:40 +02:00
Pablo Beltrán b18f6637b6 Fully implemented leashes (#3798) 2017-08-21 10:46:41 +02:00
peterbell10 b8dda388e0 Represent cItem::m_Lore as an AStringVector (#3882)
* Replace cItem::m_Lore with AStringVector

* Reword deprecation warning

* Fix lua bindings
2017-08-18 11:29:54 +01:00
peterbell10 759618b035 Remove double includes part 2 (#3890) 2017-08-03 15:34:19 +02:00
Bond-009 6a19841121 Added basic ocelot behavior (#3829) 2017-07-12 12:42:02 +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
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
Lukas Pioch 41bfb22834 Corrected brewingstand and added support for fuel 2017-05-08 06:30:54 +02:00
Mattes D 0870649994 Fixed TrappedChest saving. (#3423)
Vanilla uses "Chest" in NBT for trapped chests.
2016-11-07 21:16:55 +01:00
Mattes D d2e8643607 Fixed type-casting-related warnings. 2016-08-24 22:26:53 +02:00
LogicParrot ca6ef58b1e Bulk clearing of whitespace 2016-02-05 23:50:18 +02:00
bibo38 657b0ed007 Changed the format of the MobHead data to allow MobHeads working on MInecraft 1.8
The NBT format now carries the texture data and transmit it to the client.
See: http://minecraft.gamepedia.com/Head#Block_entity
Related to #2674
2016-01-11 17:55:32 +01:00
Gargaj d05fdbdee9 Test for correct coordinates when fishing
Fun fact: this was able to actually deadlock the server depending on where you were standing :)
2015-12-10 20:54:55 +01:00
Julian Laubstein 48f84cc3e9 changed mob age from char to int 2015-11-16 14:13:44 +01:00
Lukas Pioch 9749c3aac9 Implemented brewing 2015-11-03 18:00:55 +01:00
Mattes D 82d9ac1e1c Namechange to Cuberite 2015-09-25 10:14:17 +02:00
Samuel Barney 804805d35a Silenced and fixed many warning messages across multiple files. 2015-07-29 09:49:30 -06:00
bibo38 6a27ec2ea0 Added Rabbit Metadata values.
Added the Rabbit Types and the MoreCarrotTicks value. Types are selected randomly on creation.
Fixes #1867
2015-07-17 01:09:06 +02:00
Hallucino 53207d3f18 Support ageable mobs
Move ageable stuff in Monster directly
2015-07-14 22:41:31 +02:00
Tiger Wang 3d398baf35 cPainting saving implemented
Additionally, it now inherits from cHangingEntity.
2015-03-13 23:05:06 +00:00
Tiger Wang e15e30a030 Fixed confusion over Item Frame directions 2015-03-13 22:29:27 +00:00
Masy98 6e8e1c6d8d Added Rabbits 2014-12-20 10:31:34 +01:00
Masy98 c836b52dd1 Added Entity Guardian 2014-12-18 19:30:32 +01:00
Howaner 2478e290f9 Many api fixes, add vanilla names to mob type -> string functions and mob spawner fixes. 2014-11-29 15:20:44 +01:00
Howaner 8b028c5c78 Finished mob spawner implementation. 2014-11-18 15:33:41 +01:00
Howaner 42120e2ea5 Merge branch 'master' into MobSpawner
Conflicts:
	MCServer/Plugins/Core
2014-11-18 14:56:32 +01:00
Alexander Harkness 232343065f Fixed compile (typos). 2014-10-27 22:03:11 +00:00
Alexander Harkness b67eb2169e Another one.# 2014-10-27 20:16:51 +00:00
Tiger Wang a26541a7c3 En masse NULL -> nullptr replace 2014-10-22 20:12:49 -07:00