| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Overhaul endian handling in ByteBuffer and FastNBT
Rather than juggling "swapped" and "unswapped" versions of integers, different library functions, #defines, etc., simply always read everything byte-by-byte.
This works regardless of host CPU endian, got optimised down to either a normal load or a byteswap on every compiler I tested - only 1 instruction on most CPU architectures.
This commit introduces a "Bytes" array type to keep endian-sensitive data seperate from host data, alongside the needed C++ template machinery for it to work seamlessly. This approach is a little bit safer as well since you get length- and type-checking for most callsites.
* Remove remaining references to old-style endianness conversion, remove functions themselves.
---------
Co-authored-by: Alexander Harkness <me@bearbin.net>
|
|
|
| |
Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Preserve banner names across place and pick up
Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
* Update src/BlockEntities/BannerEntity.h
---------
Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
Co-authored-by: Alexander Harkness <me@bearbin.net>
|
| |
|
| |
|
|
|
|
|
| |
Replaced them with fmt::format calls, including changes to the format strings. Also changed the format strings to use FMT_STRING, so that the format is checked compile-time against the arguments.
Also fixed code-style violations already present in the code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Allow villagers to pickup items
* Add farmer villager harvesting
* Use of auto keyword
* Using for loop to check adjacent crops
* Show particules when farmer harvest
* Fix area comment
* Move constants to header file
* Removing unnecessary semicolon
* Initialization of CropBlockType variable
* Apply 12xx12 suggestion
* Fixing area constant size
* Refactor bounding box calculation, use vectors.
* Add Api documentation
* Update lua docs
* Rework farmer ai
* Fixing lua docs notes
* Add missing capitalisation
* Add villagers inventory save
* Fixing loading entities from disk inconsistencies
* Add farmer harvest animation
* Fix beetroots grow state
Co-authored-by: Alexander Harkness <me@bearbin.net>
|
|
|
|
|
| |
* World: change spawnpoint type to int
As Vanilla does.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Alpha-sort cChestEntity
* Chests: use SendUpdateBlockEntity
* Pathfinder: fix out of range Y
* 1.13: correct weather packet ID
* Chests: fix neighbour scanner
+ Add OnAddToWorld and overload to scan neighbours there, instead of in the constructor/OnUse. This fixes hoppers accessing newly loaded double chests and seeing a null m_Neighbour, thus thinking its a single chest.
* Fix typo in cross coords computation.
* Simplify hopper logic.
* Block entities: ASSERT that type is correct
If you match the block type first before calling DoWithBlockEntity, the corresponding block entity must either be empty or correspond to the block type.
* Chunk: fix some forgotten PendingSendBE cleanup
+ Add cleanup in SetAllData, WriteBlockArea
- Remove RemoveBlockEntity (used once), HasBlockEntity (not used)
* Replace MakeIndex with MakeIndexNoCheck
* Remove extraneous MarkDirty in hopper & chests
|
|
|
|
| |
Yak shave: make more things use cTickTime. Fix a couple of incorrect modulo-on-millisecond-value by making them use WorldTickAge.
|
|
|
|
|
|
| |
+ Added item and block for banners
Co-authored-by: 12xx12 <12xx12100@gmail.com>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
| |
+ Use libdeflate
+ Use std::byte
* Fix passing temporary to string_view
+ Emulate make_unique_for_overwrite
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fix flower generation
- remove wrong mushroom and flower generation
+ add "tiny" mushrooms in Mushrooms biomes
+ add "tiny" mushrooms in Mega Taiga and variants
+ add tulip generation for plains biomes
* Turn numbers into constants
- Remove duplication of grass generation
- Remove fern in inappropriate biomes
* added roofed forest flowers to ini file
* fixed crash with biMesaPlateuM
+ Use empty()
+ Emplace directly
+ Avoid a string copy in BiomeName
+ Alias BiomeIndex to avoid multiple casts
Co-authored-by: 12xx12 <12xx12100@gmail.com>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fixed network
fixed explosion
fixed ticking
added network broadcast to Setter method
added nullptr protection
using macros in 1.10 Protocol_1_10.cpp
revealed functions to LUA API
small fixups, typos, less functions used
fixed more doc
readded info that saving is done only if the beam is displayed
made the constructor transfer all needed members
fixed wrong commit
removed default parameters on SpawnEnderCrystal
fixed wrong metadata
moved call to destroy in the right place
fixed some typos
Fixed Ender Crystal
* fixed documentation
* fixed doc and added proper error message
* Parameters, arrows
* Parameters
Co-authored-by: 12xx12 <12xx12100@gmail.com>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
|
|
|
|
|
| |
* Fixes #4990
Co-authored-by: 12xx12 <12xx12100@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix cmake not adding Werror on clang, and _lots_ of warnings
* WIP: Build fixes
* Cannot make intermediate blockhandler instance
* Tiger's changes
* Fix BitIndex check
* Handle invalid NextState values in cMultiVersionProtocol
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
| |
|
|
|
|
|
|
|
| |
- 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>
|
|
|
|
|
| |
+ Add EnderChest saving, as Vanilla does
- Remove CreateBlockEntities. Storage should save & load everything so looping over chunk data is not needed
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Avoid inefficient AString -> c_str() -> AString round trip
* Avoid redundant string init expressions
* Avoid unnecessary return, continue, etc.
* Add .clang-format to help with clang-tidy fix-its
* Avoid unnecessary passing by value
* Avoid unnecessary local copying
* Avoid copying in range-for loops
* Avoid over-complicated boolean expressions
* Some violations missed by my local clang-tidy
* Allow unnecessary continue statements
* Add brackets
* Another expression missed locally
* Move BindingsProcessor call into clang-tidy.sh and add space
* Fix pushd not found error
* Different grouping of CheckBlockInteractionRate
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Closes #4708
This updates jsoncpp, mbedtls, TCLAP and SQLiteCpp to their latest stable release. A few additional changes were needed:
* jsoncpp deprecated Reader, FastWriter and StyledWriter which I've replaced
with some helper functions in JsonUtils.cpp
* SQLiteCpp changed how it builds with external sqlite libraries, now expecting
them to be installed. The simplest path was to remove sqlite from cuberite's
submodule and just use SQLiteCpp's internal version.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
| |
Removed dependency on cChunkDataCallback.
Moved all the serializing code into a worker class.
Changed the serialization into a single-call action.
|
|
|
|
|
|
|
|
|
|
| |
* Vector3: Add custom fmt compatible formatter.
* cLuaState: Add fmt version of ApiParamError
* Use vector formatting in manual bindings
* Always log vectors with FLOG
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Add check for number of empty lines between functions and fix the corresponding failures
|
|
|
|
|
|
|
| |
* Replaces AppendVPrintf with fmt::sprintf
* fmt::ArgList now used as a type safe alternative to varargs.
* Removed SIZE_T_FMT compatibility macros. fmt::sprintf is fully portable and supports %zu.
* Adds FLOG functions to log with fmt's native formatting style.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix #4024
* Fix clang error
* Add comment
* Fix behaviour
* Save Health as float
* Changed m_Health to float
* Remove redundant static_cast
* Fix casts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
* Replace cItem::m_Lore with AStringVector
* Reword deprecation warning
* Fix lua bindings
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
| |
* WSSAnvil: Load the sign text from JSON, too.
|
| |
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
| |
* Store block entities in a map from block index
* Cleanup ForEachBlockEntity
* Cleanup DoWithBlockEntityAt
|
| |
|
| |
|
|
|
| |
Vanilla uses "Chest" in NBT for trapped chests.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Ref.: #1970
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Added the Rabbit Types and the MoreCarrotTicks value. Types are selected randomly on creation.
Fixes #1867
|
|\
| |
| | |
Support ageable mobs
|
| |
| |
| |
| | |
Move ageable stuff in Monster directly
|
|/ |
|
|
|
|
|
| |
* Replace old c-style casts with c++ casts
* Added `-Wno-error=old-style-cast` to Protocol18x.cpp
|
| |
|
| |
|
|
|
|
| |
Spaces around some operators are checked.
|
|
|
|
| |
unsafely stealing data
|
|
|
|
| |
Additionally, it now inherits from cHangingEntity.
|
| |
|
| |
|
|
|
|
|
| |
When the chunk data fit perfectly into the old space, an extra 4 KiB of padding zeroes were written, overwriting the next chunk.
Fixes #1730.
|
|
|
|
| |
Fixes CID 72854.
|
| |
|
| |
|
|
|
|
| |
Removed trailing whitespace, added cast to remove warning, added file seeking in case of corrupt files.
|
|\ |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|/ |
|
| |
|
| |
|
|\ |
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| |
| | |
Kept the old Int reading for compatibility reasons.
Ref.: #1448
|
|\| |
|
| |
| |
| |
| | |
Reported as #1448.
|
|/ |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/ClientHandle.cpp
src/ClientHandle.h
src/Protocol/Protocol.h
src/Protocol/Protocol125.cpp
src/Protocol/Protocol125.h
src/Protocol/Protocol17x.cpp
src/Protocol/Protocol17x.h
src/Protocol/ProtocolRecognizer.cpp
src/Protocol/ProtocolRecognizer.h
src/World.cpp
src/World.h
|
| |
| |
| |
| | |
This should help detect #1313's second case.
|
| |
| |
| |
| | |
Fixes #1307.
|
| |
| |
| |
| | |
Reported on the Dropper map in #1307.
|
| | |
|
| |
| |
| |
| | |
Each chunk in MCA needs to be less than 1 MiB compressed; chunks that are larger will be refused with a log message.
|
| |
| |
| |
| | |
This removes the fixed-size buffer which could have caused #1307 and #1366.
|
| | |
|
| |
| |
| |
| | |
This should help with #1307.
|
|/ |
|
| |
|
|
|
|
|
|
| |
Block entities are now loaded based on the blocktype at the coords they specify; before loading, their type ("id" NBT tag) is checked.
The chunk now expects that all block entities given to it via cChunk::SetAllData() have their valid blocktype; asserts if they don't.
Fixes #1354.
|
|
|
|
| |
StrToLower() returns a modified copy of the string, InPlaceLowercase() modifies the string in-place.
|
|
|
|
| |
Fixes #1277.
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| | |
Conflicts:
src/World.h
|
| | |
|
| |
| |
| |
| | |
Fixes #1196.
|
|\|
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/Chunk.cpp
src/Entities/Player.cpp
src/Root.cpp
src/World.cpp
|
| | |
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
|
| |
| |
| |
| |
| | |
This was mostly done automatically and then visually inspected for obvious errors.
All //-style comments should have a 2-space separation from the code, and 1 space after the comment sign.
|
| |
| |
| |
| |
| | |
The callback doesn't need declaration in the header.
Renamed PotionName to PotionParticleType.
|
| |\ |
|
| | |\ |
|
| | | |\
| | | | |
| | | | | |
Implemented trapped chests & others
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
+ Added trapped chests
* Fixed a bunch of bugs in the redstone simulator concerning wires and
repeaters
* Other potential bugfixes
|
| | | | | |
|
| | | |/
| | |/| |
|
| | |/
| |/| |
|
| |\ \
| | |/
| |/| |
Fixes to projectiles and the undead
|
| | | |
|
|\| | |
|
| |/ |
|
|\|
| |
| |
| |
| |
| |
| | |
Conflicts:
src/Chunk.cpp
src/Entities/Entity.h
src/Entities/Player.h
|
| |
| |
| |
| | |
Fixes #140.
|
| |
| |
| |
| | |
Also fixed unreliability in Health and LootPickup loading.
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Add repair cost to cItem, add custom name to NBTChunkSerializer and fix ...
|
| | |
|
| | |
|
|/ |
|
|
|
|
| |
Fixes #524.
|
|\
| |
| | |
Add entity invulnerable
|
| |
| |
| | |
This reverts commit d50f8f6f11f69e7e1e56be92fb2d72a5014a3e34.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|/ |
|
| |
|
|\
| |
| | |
Ender crystals
|
| | |
|
|/ |
|
|\
| |
| | |
More entity saving.
|
| | |
|
| | |
|
| |\ |
|
| | | |
|
| | | |
|
| | | |
|
| |/
|/| |
|
| | |
|
|\|
| |
| | |
Add TNT load/save
|
| | |
|
| | |
|
|\|
| |
| |
| |
| | |
Conflicts:
src/ClientHandle.cpp
|
| | |
|
|/
|
|
| |
+ Added fireworks
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This should fix issues reported in:
http://forum.mc-server.org/showthread.php?tid=1328
http://forum.mc-server.org/showthread.php?tid=1308
|
|\ |
|
| |\
| | |
| | | |
Enchantments fix
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Created a new class cEnchantmentSerializer to serilize Enchantments to NBT.
This breaks a dependecy chain between cChunkGenerator and cWorld.
cEnchantmentSerializer is seperate from NBTWriter as it needs to access private members of cEnchantments
so having it seperate reduces the spread of the frein modifier
|
|/ / |
|
| | |
|
|/ |
|
| |
|
|\
| |
| | |
Added cWorld::SpawnMinecart.
|
| | |
|
| | |
|
|/ |
|
|
|
|
|
|
|
| |
* Fixes #252
* Alleviates #380
+ Adds mob saving
* Fixed some debug !ASSERTs
|
| |
|
| |
|
| |
|
| |
|
|
|