summaryrefslogtreecommitdiffstats
path: root/src/BlockInfo.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-05-05Move item placement into item handlers (#5184)Tiger Wang1-0/+4
* 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-02-07Explodinator performance optimisationsTiger Wang1-8/+0
Thanks @lixfel (#4246)
2020-10-24TNT Changes (#4970)KingCol131-0/+2
+ Make TNT drop pickups, change a few comments. + Give each ray random intensity, instead of each explosion. * Use direction instead of destination, rewrite for pairs of edges.
2020-10-18cBlockInfo: further cleanup (#5001)Tiger Wang1-82/+29
* cBlockInfo: further cleanup + Use switch statements instead of lookup in dynamically initialised arrays - Remove some deprecated bindings * Update Stubs removing references to BlockInfoArray
2020-10-02Fix instant mining of blocks not being recognised, tweak anti-cheat (#4938)KingCol131-0/+3
* Tried to fix a small issue... Ended up rewriting a bunch of god awful, opaque code with no source and no sense. Who names a function GetPlayerRelativeBlockHardness??? It's gone now. We're safe again. * Testing anti-cheat. * Tidy up debug logging. * Remove empty member declaration. * Rewrite GetDigSpeed slightly for better readability. * GetMiningProgressPerTick now returns 1 when instantly mined. Fixed hasily written typo. * Comment style and typo fixes.
2020-09-25Deleted BiomeDef.h and ChunkDef.h from Globals.h (#4885)KingCol131-0/+1
* Removed BiomeDef.h * Removed ChunkDef.h from Globals.h * Added to CONTRIBUTORS. * Re-added empty last line to Globals.h * Included stddef and StringUtils in BiomeDef.h * Fixed build tools compiling. It compiles, but at what cost? * Added include to src/Generating/Trees.h * Include added in ChunkGeneratorThread.h * Moved rearranged includes in LineBlockTracer.cpp * Re-arrange headers in ChunkInterface.cpp * Included ChunkDef.h in Path.h * Included ChunkDef.h in NBTChunkSerializer.h * Rearranged included and added required includes to headers. * Removed unnecessary included in StringUtils.h.
2020-09-20BlockHandler initialisation is a constant expression (#4891)Tiger Wang1-19/+0
* 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-17BlockHandler: no dynamic allocation (#4862)Tiger Wang1-11/+3
* BlockHandler: no dynamic allocation
2020-09-12Use tracing for explosions (#4845)Tiger Wang1-0/+4
* TNT: Implement tracing algorithm + Add intensity tracing * Fix iterating over all players to SendExplosion, even those not in range * Implemented TNT entity interaction * Fixed misaligned destruction tracing * Finalise TNT algorithm - Remove BlockArea and just use chunks Using SetBlock makes it so that we can update everything properly, and does appear to be faster. * BlockInfo learns about explosion attentuation * Rename Explodinator parameters * TNT: pull block destruction into common function Co-authored-by: Alexander Harkness <me@bearbin.net>
2020-04-03Pulled the BlockID and BlockInfo headers from Globals.h. (#4591)Mattes D1-26/+37
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
2018-02-20cBlockInfo: Deprecate direct access to variables. (#4184)peterbell101-65/+64
2018-01-23Removed cBlockInfo.m_IsSnowable (#4105)Bond-0091-5/+12
* Removed cBlockInfo.m_IsSnowable * Return IsSnowable from deprecated variable binding m_IsSnowable.
2017-12-26improve rain simulation (#4017)Alexander Harkness1-5/+6
* 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-09-07Lighting now generally consistent with vanilla (#3988)Alexander Harkness1-1/+9
* Lighting now generally consistent with vanilla Skylight is now dispersed by some blocks, instead of passing through unimpeded. Some blocks which were not marked as transparent are now marked as such. Water and other such blocks now attenuate light with the correct intensity. Generally changes were based on documentation in the Minecraft Wiki: https://minecraft.gamepedia.com/Opacity#On_block_light , however during play-testing on vanilla lava was found not to attenuate sky or block-light so the attenuation was removed. This fixes #3849 * Add API documentation for IsSkylightDispersant * Rename m_SkylightDispersant to m_IsSkylightDispersant * Update comment for m_Transparent property of Blocks
2017-08-07cBlockInfo: Deprecate place soundpeterbell101-5/+0
2017-07-03cBlockInfo static initialisation (#3832)peterbell101-28/+38
2016-11-06Anticheat fastbreak (#3411)mohe20151-0/+5
Added block hardness checks when breaking blocks.
2016-10-12Spectators added (#2852)bibo381-0/+5
2016-02-05Bulk clearing of whitespaceLogicParrot1-1/+1
2015-12-13blockheight mechanismGargaj1-0/+5
2014-10-23En masse NULL -> nullptr replaceTiger Wang1-1/+1
2014-10-20En masse NULL -> nullptr replaceTiger Wang1-1/+1
2014-09-25Fixed styleTycho1-2/+2
2014-09-17Added first test to show the object can be createdTycho1-3/+28
2014-09-09Moved sound-configs into BlockID.h and fixed/ added loads of soundsMasy981-0/+4
2014-07-29Added cBlockInfo::CanBeTerraformed and made finishers use itSTRWarrior1-0/+4
I might have forgotten some of them though
2014-07-17Fixed issues relating to saplings and leavesTiger Wang1-4/+0
- Removed cBlockInfo::RequiresSpecialTool * Fixes #1195 * Fixes #1201
2014-07-17Fixed spaces around single-line comments.madmaxoft1-1/+1
There should be at least two spaces in front and one space after //-style comments.
2014-06-25BlockInfo is now a proper C++ singleton.madmaxoft1-14/+9
It is properly initialized before it is ever used.
2014-03-02cBlockInfo now manages the respective cBlockHandlerandrew1-0/+27
2014-03-02GetById => Getandrew1-10/+10
2014-03-02Exported cBlockInfoandrew1-3/+8
2014-03-01g_BlockXXX => cBlockInfo::XXXandrew1-5/+22
2014-03-01Refactored global block property arraysandrew1-0/+54