summaryrefslogtreecommitdiffstats
path: root/src/World.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-12-29Improved farmer AI & Fixed entity loading functions (#5351)Persson-dev1-1/+1
* 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>
2021-10-03World: change spawnpoint type to int (#5313)Tiger Wang1-8/+8
* World: change spawnpoint type to int As Vanilla does.
2021-06-28Don't flush ClientHandle data multiple timesTiger Wang1-4/+2
* Change cWorld::m_Players to a vector
2021-05-05Move item placement into item handlers (#5184)Tiger Wang1-6/+6
* 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-04-12Unify multiprotocol entity animationsTiger Wang1-3/+1
2021-04-12Remove unused GetClassStatic in cWorldTiger Wang1-9/+0
2021-04-12Streamline player abilities handlingTiger Wang1-0/+1
* Update player list gamemode on world change * Fix invisibility for spectators, use entity metadata * Populate m_World for cPlayers on load - Remove SendPlayerMaxSpeed, a duplicate of SendEntityProperties
2021-04-12Fix sending incorrect date values on world changeTiger Wang1-10/+12
Yak shave: make more things use cTickTime. Fix a couple of incorrect modulo-on-millisecond-value by making them use WorldTickAge.
2021-04-03Basic elytra flight (#5124)Damián Imrich1-9/+0
* Basic elytra flight Co-authored-by: 12xx12 <44411062+12xx12@users.noreply.github.com> Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2021-03-28Unify DoWithBlockEntity (#5168)Tiger Wang1-59/+2
+ 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-20Change TimeOfDay to WorldDate (#5160)Tiger Wang1-19/+9
* Change TimeOfDay to WorldDate * Do not wrap at 20 minutes, continue incrementing * Fixes #4737 * Fixes #5159
2021-03-19Don't send ping updates one packet at a timeTiger Wang1-4/+16
* Use the batch update feature of the packet. * Lengthen interval between time and ping update packets (ref. http://github.com/cuberite/cuberite/issues/4082#issuecomment-348675321).
2021-03-15Properly deprecate more XYZ parameter'd functions (#5147)Tiger Wang1-90/+0
* Fixes #5144
2021-03-05Adding Boss bar (#5025)12xx121-1/+2
+ Add boss bar Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2021-03-05Prepare ChunkData for BlockState storage (#5105)Tiger Wang1-14/+8
* 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-02-06Adds playerlist header and footer broadcasting (1.8-1.13)dImrich1-0/+1
2021-01-12Clarify cClientHandle, cPlayer ownership semanticsTiger Wang1-48/+8
+ A cPlayer, once created, has a strong pointer to the cClientHandle. The player ticks the clienthandle. If he finds the handle destroyed, he destroys himself in turn. Nothing else can kill the player. * The client handle has a pointer to the player. Once a player is created, the client handle never outlasts the player, nor does it manage the player's lifetime. The pointer is always safe to use after FinishAuthenticate, which is also the point where cProtocol is put into the Game state that allows player manipulation. + Entities are once again never lost by constructing a chunk when they try to move into one that doesn't exist. * Fixed a forgotten Super invocation in cPlayer::OnRemoveFromWorld. * Fix SaveToDisk usage in destructor by only saving things cPlayer owns, instead of accessing cWorld.
2021-01-11Convert most calls to blocking GetHeight/GetBiomeAt to direct chunk accessesTiger Wang1-10/+3
* Hopefully fixes #5094
2020-12-26ViewDistance: unsigned -> signedTiger Wang1-3/+3
2020-12-22unique_ptr<cChunkMap> to plain memberTiger Wang1-16/+12
2020-12-18Warnings improvementsTiger Wang1-3/+3
* Turn off global-constructors warning. These are needed to implement cRoot signal handler functionality * Add Clang flags based on version lookup instead of a compile test. The CMake config process is single threaded and slow enough already * Reduced GetStackValue verbosity + Clarify EnchantmentLevel, StayCount, AlwaysTicked, ViewDistance signedness + Give SettingsRepositoryInterface a move constructor to simplify main.cpp code - Remove do {} while (false) construction in redstone handler
2020-11-13Some const and inheritance correctness (#5014)12xx121-7/+4
* Some const and inheritance correctness * Devirtualise SendBlockTo(Vector3i) Co-authored-by: 12xx12 <12xx12100@gmail.com> Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-11-06Add correct implementation of crops (#4802)0ddlyoko1-10/+2
* [FIX] Add correct implementation of seed drops. > Official percentage of drops has been implemented * Fix C++ conventions * Change "Vals" variable to "m_Vals" * [FIX] Add correct implementation of Carrots, Potatoes, Wheat & Beetroots seed * Add Fortune support with crops Add fortune support with Wheat, Carrots, Potatoes & Beetroots seeds * [FIX] Right-clicking on a grown Beetroot in survival consume 2 bone meals Fix #4805 * Add documentation for "cWorld::IsFullGrownPlantAt" method * Fix dispenser that full grown a plant > Change methods cItemDyeHandler::FertilizePlant & cItemDyeHandler::growPlantsAround to static * Display particle even if tree doesn't grow * When right-clicking on a full grown melon / pumpkin seed, no longer produce a melon / pumpkin Before this commit, when you right-click on a melon or a pumpkin seed, a melon / pumpkin block spawned. With this commit, it no longer spawns * [FIX] Do not create melon / pumpkin block when right-clicking with a bone meal This fix will prevent the creation of a melon / pumpkin block when you right-click with a bone meal on a melon / pumpkin plant - It just detect if the plant is full grown. if yes, the method "Grow" is not called - Remove IsFullGrownPlant Co-authored-by: 12xx12 <12xx12100@gmail.com> Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-11-06Ender Crytal Fix and report proper cmake file for luabindingscheck fail (#5017)12xx121-1/+1
* 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>
2020-10-29Add beam target, configurable base visibility to Ender Crystals (#5010)12xx121-0/+4
* Fixes #4990 Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-10-09Add default value nullptr for parameter a_Digger and added digger toLukas Pioch1-2/+2
cWorld:DigBlock in lua api
2020-10-08Merged OnBreak with OnPlayerBreak (#4967)12xx121-3/+3
Co-authored-by: 12xx12 <12xx12100@gmail.com> Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-09-12Reverse order of ChunkSender priorities (#4858)Tiger Wang1-2/+2
* Reduces confusion when using overloaded operator< and priority_queue Co-authored-by: peterbell10 <peterbell10@live.co.uk>
2020-08-28Clean up GenerateChunk/TouchChunkTiger Wang1-5/+2
- Remove TouchChunk - Remove unused bool return value in GenerateChunk - Remove ShouldGenerateIfLoadFailed
2020-08-28Remove unneeded MarkDirty, SendToClients parameters of SetMetaTiger Wang1-7/+3
Partially reverts #3129, whose addition of these parameters was superseded by #3149 that fixed generated leaves' metas. References: https://github.com/cuberite/cuberite/pull/4417#discussion_r334950513 e0bcd754009f16480437b2c1fa5e7fbedab31496
2020-08-27Removed constMattes D1-2/+2
2020-08-27Changed tree-growing functions in cWorld to use Vector3i coords.Mattes D1-20/+15
2020-08-04OnBroken/OnPlaced are for entity actionsTiger Wang1-9/+5
* Call OnPlaced/OnBroken in PlaceBlock/DigBlock - Remove unused Placing/Breaking handlers * Have the blockhandler's Check handle neighbour updating, instead of QueueTickBlockNeighbors
2020-07-14cWorld * -> cWorld (#4771)Tiger Wang1-16/+13
* cWorld * -> cWorld
2020-05-04Improve entity position updates (#4701)Tiger Wang1-4/+2
* Make puking pickups fly nicer * Improve entity position updates * Move determination of whether a delta is too big for a packet into the protocol handlers + Less jittery movement + Generalise CollectEntity to take any entity
2020-04-21Vector3 in Handlers (#4680)Mattes D1-0/+7
Refactored all cBlockHandler and cItemHandler descendants to use Vector3.
2020-04-17More Vector3 in cBlockHandler (#4644)Mattes D1-7/+6
* cBlockHandler.OnUpdate uses Vector3 params. Also slightly changed how block ticking works.
2020-04-16Using Super.Mattes D1-4/+14
2020-04-13Acquire chunk map CS when accessing player entitiesPeter Bell1-1/+1
2020-04-09Falling blocks can now be spawned at any position. (#4620)Mattes D1-3/+11
* Falling blocks can now be spawned at any position. * Added a /cake command to Debuggers that throws a cake in a nice slow arc. * Fixed regular falling blocks.
2020-04-03Pulled the BlockID and BlockInfo headers from Globals.h. (#4591)Mattes D1-1/+1
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-03-27 Lock hopper when powered by redstone (#4347)Bond-0091-0/+4
* Lock hopper when powered by redstone * Add to manual bindings * Add hopper API documentation Co-authored-by: Mat <mail@mathias.is>
2020-03-26Disable bonemealable settings for now (#4551)Mat1-0/+2
2020-03-22TNT position fixes (#4519)Mat1-3/+3
* TNT position fixes * Don't add offset to explosion spawn coords * Don't make other entities push TNT * Correct initial TNT speed * Fix typo * Improvements * Revert unwanted change * Style fixes * Update format
2020-03-05Stabilise MoveToWorld (#4004)Mat1-2/+1
* Stabilise MoveToWorld * Fix comments and deprecate ScheduleMoveToWorld * Enhanced thread safety for m_WorldChangeInfo * Return unique_ptr from cAtomicUniquePtr::exchange * cWorld now calls entity cEntity::OnAddToWorld and cEntity::OnRemoveFromWorld. Allows broadcasting entities added to the world from the world's tick thread. This also factors out some common code from cEntity::DoMoveToWorld and cEntity::Initialize. As a consequence, cEntity::Destroy(false) (i.e. Destroying the entity without broadcasting) is impossible. This isn't used anywhere in Cuberite so it's now deprecated. * Update entity position after removing it from the world. Fixes broadcasts being sent to the wrong chunk. * Fix style * cEntity: Update LastSentPosition when sending spawn packet * Add Wno-deprecated-declarations to the lua bindings * Kill uses of ScheduleMoveToWorld
2019-10-28Moved growing from cWorld / cChunk to cBlockHandler descendants.Mattes D1-35/+146
2019-10-16Refactored block-to-pickup conversion. (#4417)Mattes D1-13/+62
2019-09-29Refactored more of Entities and BlockEntities to use Vector3. (#4403)Mattes D1-7/+65
2019-09-24NBTChunkSerializer: Cleaned up interface.Mattes D1-1/+3
Removed dependency on cChunkDataCallback. Moved all the serializing code into a worker class. Changed the serialization into a single-call action.
2019-09-06Moved the generator defaults to ComposableGenerator.Mattes D1-4/+1
2019-09-06Separated chunk generator from world / plugin interfaces.Mattes D1-9/+13
The generator now only takes care of servicing synchronous "GetChunk(X, Y)" and "GetBiomes(X, Y)" requests.
2018-08-26Store and pass entity effect duration as an int not a short. (#4293)Alexander Harkness1-1/+1
Fixes #4292.
2018-08-02Experience orb (#4259)changyong guo1-2/+10
* 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-07-27cWorld: Manually bind deprecated broadcast functions (#4265)peterbell101-26/+5
Ref: https://github.com/cuberite/cuberite/pull/4264#discussion_r204769193
2018-07-24Broadcast refactor (#4264)peterbell101-52/+71
* Move Broadcast functions from cChunkMap to cBroadcaster - Remove cBroadcastInterface in favour of cBroadcaster. - cChunk: Remove broadcast functions. * resurect broadcast interface * Absorb cBroadcaster into cWorld. Removes the need for forwarding the function calls. * Improve const-correctness * Use Int8 instead of char + Comment `ForClients` functions * Improve comments * Broadcaster: Rename ForClients functions
2018-07-23Keep players in gmNotSet (#4248)changyong guo1-0/+1
This allows players game mode to update to the default after portal to another world. Fixes #4207
2017-12-26improve rain simulation (#4017)Alexander Harkness1-10/+14
* 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-10-21cWorld Threads: Seperate initialization and thread start.peterbell101-1/+1
Prevents nullptr dereferences before Start has been called.
2017-10-21cWorld: Move Initialization from Start to the constructor.peterbell101-5/+11
Start now does nothing more than launch the world's threads.
2017-09-25BroadcastBlockBreakAnimation and BroadcastBlockEntity use vectors (#4038)Bond-0091-2/+2
2017-09-19Changed BroadcastSoundEffect, SendSoundEffect, and CastThunderbolt parameters to vectors (#3959)Lane Kolbly1-3/+6
* Made BroadcastSoundEffect take vector parameters. * Added docs for new vectored methods * Removed old code * Fixed lua warnings * Made old BroadcastSoundEffect not an override. * m_Block to m_BlockPos, used Vector3d constructor where prettier. * a_Block to a_BlockPos * Changed thunderbolt a_Block to a_BlockPos
2017-09-11Replace ItemCallbacks with lambdas (#3993)peterbell101-50/+33
2017-09-07Made world data paths adjustable, and added API to temporarily disable saving chunks to disk. (#3912)Lane Kolbly1-1/+17
2017-09-07Changed some int parameters to vector parameters (#3937)Bond-0091-2/+16
2017-09-05Add cWorld::RemoveEntity and use in cEntity (#4003)peterbell101-0/+4
* Add cWorld::RemoveEntity and use in cEntity * cEntity: Remove uneeded asserts from Destroy and DoMoveToWorld
2017-09-02Revert "Replace ItemCallbacks with lambdas (#3948)"LogicParrot1-34/+51
This reverts commit 496c337cdfa593654018c171f6a74c28272265b5.
2017-09-01Replace ItemCallbacks with lambdas (#3948)peterbell101-51/+34
2017-08-25Add cUUID class (#3871)peterbell101-2/+3
2017-08-25Bed piston fix (#3956)Lane Kolbly1-1/+1
* 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-21Fully implemented leashes (#3798)Pablo Beltrán1-1/+3
2017-08-17Changed int parameters to vector parameters in cCuboid and simulators (#3874)Lane Kolbly1-8/+18
2017-08-07Changed entity ownership model to use smart pointersTiger Wang1-6/+13
2017-08-03Remove double includes part 2 (#3890)peterbell101-7/+0
2017-08-03Removed unused forward declarations (#3888)Lukas Pioch1-2/+0
2017-08-01cWorld::SendBlockTo take player by refpeterbell101-1/+1
2017-07-21Remove smart pointer macrospeterbell101-3/+3
2017-07-16Simulators: Added area-based wakeup.Mattes D1-1/+1
2017-07-12Changing pickup lifetime and combining semantics, making these adjustable in the lua api. (#3843)Lane Kolbly1-0/+3
2017-07-07Added bed entity (#3823)Lukas Pioch1-0/+3
* 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-06-29Update tolua and export EffectIDpeterbell101-1/+1
2017-06-13FastRandom rewrite (#3754)peterbell101-6/+2
2017-05-24Exported boatLukas Pioch1-1/+2
- 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-21Clang 5.0 fixesLukas Pioch1-1/+1
- Added override keyword - Removed inherited member variables
2017-02-14Added some blocks and items (#3503)mathiascode1-0/+1
2017-01-19World: Remember the age persistently. (#3556)Mattes D1-2/+5
2017-01-18DeadlockDetect now lists some tracked CS's stats.Mattes D1-5/+7
2016-12-16Initial support for the 1.11 protocol.Mattes D1-1/+1
2016-11-18Removed ClientHandle.h dependencies from common headers.Mattes D1-6/+3
2016-10-12Spectators added (#2852)bibo381-0/+4
2016-09-12APIDump: Reformatted the docs to include type information.Mattes D1-1/+2
Also fixed a bit of documentation in the CPP source.
2016-09-03Configurable dirty unused chunk cap to avoid RAM overuse (#3359)LogicParrot1-2/+10
Configurable dirty unused chunk cap to avoid RAM overuse
2016-08-22Delay EntityChangedWorld players' callback until Entity fully linked to world (#3330)ElNounch1-3/+5
Otherwise, some API calls just don't seem to happen .gitignore tweak for test executables
2016-08-15Added cWorld:SetSpawn() API and Lua binding (#3316)ElNounch1-0/+3
2016-07-18Updated API documentation.Mattes D1-1/+1
2016-07-07removed cast from BlockTrapdoor.h (#3256)gaurav sehgal1-1/+1
2016-06-03Makes tall grass and large flowers bonemealableQUSpilPrgm1-0/+2
Adds the bonemeal particle effect to some more places
2016-06-03Update Dispensers and let them act more like in VanillaQUSpilPrgm1-6/+10
- Added code to make bonemeal, potions, minecarts, XP bottles and boats work inside dispensers - Dispensers are now able to place TNT if the block is transparent but not air - Added return value that indicates the success of pumpkin, melon, sugarcane and cactus growing functions - Changed return value of "GrowRipePlant" so that it actually indicates if the block was able to grow - Fixed "GrowSugarcane" and "GrowCactus" in "GrowRipePlant" so that it only grows them a single block
2016-05-141.9 / 1.9.2 / 1.9.3 / 1.9.4 protocol support (#3135)Pokechu221-1/+2
* Semistable update to 15w31a I'm going through snapshots in a sequential order since it should make things easier, and since protocol version history is written. * Update to 15w34b protocol Also, fix an issue with the Entity Equipment packet from the past version. Clients are able to connect and do stuff! * Partially update to 15w35e Chunk data doesn't work, but the client joins. I'm waiting to do chunk data because chunk data has an incomplete format until 15w36d. * Add '/blk' debug command This command lets one see what block they are looking at, and makes figuring out what's supposed to be where in a highly broken chunk possible. * Fix CRLF normalization in CheckBasicStyle.lua Normally, this doesn't cause an issue, but when running from cygwin, it detects the CR as whitespace and creates thousands of violations for every single line. Lua, when run on windows, will normalize automatically, but when run via cygwin, it won't. The bug was simply that gsub was returning a replaced version, but not changing the parameter, so the replaced version was ignored. * Update to 15w40b This includes chunk serialization. Fully functional chunk serialization for 1.9. I'm not completely happy with the chunk serialization as-is (correct use of palettes would be great), but cuberite also doesn't skip sending empty chunks so this performance optimization should probably come later. The creation of a full buffer is suboptimal, but it's the easiest way to implement this code. * Write long-by-long rather than creating a buffer This is a bit faster and should be equivalent. However, the code still doesn't look too good. * Update to 15w41a protocol This includes the new set passengers packet, which works off of the ridden entity, not the rider. That means, among other things, that information about the previously ridden vehicle is needed when detaching. So a new method with that info was added. * Update to 15w45a * 15w51b protocol * Update to 1.9.0 protocol Closes #3067. There are still a few things that need to be worked out (picking up items, effects, particles, and most importantly inventory), but in general this should work. I'll make a few more changes tomorrow to get the rest of the protocol set up, along with 1.9.1/1.9.2 (which did make a few changes). Chunks, however, _are_ working, along with most other parts of the game (placing/breaking blocks). * Fix item pickup packet not working That was a silly mistake, but at least it was an easy one. * 1.9.2 protocol support * Fix version info found in server list ping Thus, the client reports that it can connect rather than saying that the server is out of date. This required creating separate classes for 1.9.1 and 1.9.2, unfortunately. * Fix build errors generated by clang These didn't happen in MSVC. * Add protocol19x.cpp and protocol19x.h to CMakeLists * Ignore warnings in protocol19x that are ignored in protocol18x * Document BLOCK_FACE and DIG_STATUS constants * Fix BLOCK_FACE links and add separate section for DIG_STATUS * Fix bat animation and object spawning The causes of both of these are explained in #3135, but the gist is that both were typos. * Implement Use Item packet This means that buckets, bows, fishing rods, and several other similar items now work when not looking at a block. * Handle DIG_STATUS_SWAP_ITEM_IN_HAND * Add support for spawn eggs and potions The items are transformed from the 1.9 version to the 1.8 version when reading and transformed back when sending. * Remove spammy potion debug logging * Fix wolf collar color metadata The wrong type was being used, causing several clientside issues (including the screen going black). * Fix 1.9 chunk sending in the nether The nether and the end don't send skylight. * Fix clang build errors * Fix water bottles becoming mundane potions This happened because the can become splash potion bit got set incorrectly. Water bottles and mundane potions are only differentiated by the fact that water bottles have a metadata of 0, so setting that bit made it a mundane potion. Also add missing break statements to the read item NBT switch, which would otherwise break items with custom names and also cause incorrect "Unimplemented NBT data when parsing!" logging. * Copy Protocol18x as Protocol19x Aditionally, method and class names have been swapped to clean up other diffs. This commit is only added to make the following diffs more readable; it doesn't make any other changes (beyond class names). * Make thrown potions use the correct appearence This was caused by potions now using metadata. * Add missing api doc for cSplashPotionEntity::GetItem * Fix compile error in SplashPotionEntity.cpp * Fix fix of cSplashPotionEntity API doc * Temporarilly disable fall damage particles These were causing issues in 1.9 due to the changed effect ID. * Properly send a kick packet when connecting with an invalid version This means that the client no longer waits on the server screen with no indication whatsoever. However, right now the server list ping isn't implemented for unknown versions, so it'll only load "Old" on the ping. I also added a GetVarIntSize method to cByteBuffer. This helps clean up part of the code here (and I think it could clean up other parts), but it may make sense for it to be moved elsewhere (or declared in a different way). * Handle server list pings from unrecognized versions This isn't the cleanest way of writing it (it feels odd to use ProtocolRecognizer to send packets, and the addition of m_InPingForUnrecognizedVersion feels like the wrong technique), but it works and I can't think of a better way (apart from creating a full separate protocol class to handle only the ping... which would be worse). * Use cPacketizer for the disconnect packet This also should fix clang build errors. * Add 1.9.3 / 1.9.4 support * Fix incorrect indentation in APIDesc
2016-04-22Reduced unnecessary block updatesLogicParrot1-2/+1
2016-04-16Updated cChunk::SetMeta, fixed grass growth, reduced markDirty/setMeta usageLogicParrot1-1/+2
2016-02-19Proper entity destruction in non-ticking chunksLogicParrot1-1/+0
2016-02-05Bulk clearing of whitespaceLogicParrot1-127/+127
2016-01-12Exported GetSeed to lua and added file extension opendb to .gitignore.Lukas Pioch1-0/+3
2015-12-18Reorganised the redstone simulatorTiger Wang1-8/+0
-> Many thanks to @worktycho for the idea, and @Haxi52 for the implementation plan! * Uses classes and inheritance now * Speed should be improved
2015-12-18Revised the explosion-related Lua API and docs.Mattes D1-14/+5
Fixes #2746.
2015-11-24Add enum for Sound and Particle EffectsDave Tucker1-1/+2
Fixes #2603 Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2015-11-13Improved spawn location calculations.samoatesgames1-1/+5
- Supports Overworld and Nether spawns. - Supports spawning under objects, but still above ground (e.g. under the leaves of a tree). - Protects against spawning in oceans. - Protects against spawning in water. - Uses a radial search about the origin, rather than a linear. - Correctly calculates Nether spawn on spawn world generation (fixes: cuberite#2548) - Fixes a bug in CheckPlayerSpawnPoint() where the X offset was used in both the X and Z coords (BLOCKTYPE BlockType = GetBlock(a_PosX + Coords[i].x, a_PosY, a_PosZ + Coords[i].x);)
2015-11-03Implemented brewingLukas Pioch1-0/+8
2015-09-28Added weather intervals to world.ini settings.Mattes D1-0/+3
2015-09-25Prepared ScheduleTask for threading refactorTiger Wang1-103/+4
* Llama-ified and condensed Schedule/QueueTask - Removed hackery done with piston animations
2015-09-24Add new "ForEach" function: ForEachLoadedChunk.tycho1-1/+4
2015-07-31Unified the doxy-comment format.Mattes D1-7/+8
2015-07-16Spawn baby mobshallucino1-1/+1
2015-07-16Improved spider AIscribblemaniac1-0/+1
Fixes #2335
2015-06-28Added a size check for portals.STRWarrior1-0/+18
Made the portal size configurable Alpha-sorted SetXYZNetherPortalXYZ functions
2015-06-24Buttons no longer click on when already on. Buttons now play sound when clicking off.Hax521-0/+22
2015-06-10Reinstate "Chunk queue collapsing"Tiger Wang1-1/+1
This reinstates commit f36acb683594daff5af3971dcbe3c3a171628b78 and reverts commit adfbc42c021e1bcfcb355933c0fd784306ce0e18.
2015-06-07Revert "Chunk queue collapsing"worktycho1-1/+1
2015-06-05Moved Chunk Broadcasts over to the regular queuetycho1-1/+1
2015-05-30Made cLightingThread own its callbackstycho1-2/+2
2015-05-24Made -Weverything an error.tycho1-1/+1
2015-05-23Fixed missing overrides and added a ignore flag for reserved macro for clang version 3.6 and higher.Lukas Pioch1-4/+4
2015-05-19Fixed a lot of warningstycho1-1/+1
2015-05-09More style checking.Mattes D1-3/+3
Spaces around some operators are checked.
2015-05-07Added support for additional data in the ParticleEffect Packettycho1-1/+6
Also started refactoring how broadcasts are handled
2015-03-21Changed linked world name variables and setters / getters.Mattes D1-15/+16
Ref.: #1792 Ref.: https://github.com/mc-server/MCServer/pull/1792#discussion_r25946707
2015-03-21Changed cEntity::m_UniqueID to UInt32.Mattes D1-20/+28
2015-03-20Added cPluginLua::cResettable interface, used for scheduled tasks.Mattes D1-12/+8
This allows plugins to register objects that can "survive" the plugin unloading - they will simply bail out if the plugin is already unloaded, instead of referencing bad plugin data. Fixes #1556.
2015-03-13Monsters will now attack. Additional checks have been added when generating spawn.tumultenrx1-0/+3
Monsters will now attack. Additional checks have been added when generating spawn.
2015-03-05Reverted non-functional changesTiger Wang1-17/+1
2015-02-08Handle client 'leave bed' requestTiger Wang1-1/+17
* Fixes #1728
2015-01-27Converted cServer to use the cNetwork API.Mattes D1-3/+6
2015-01-18cWorld: Fixed a type warning.Mattes D1-1/+1
2015-01-11Fix trailing whitespaceTycho1-1/+1
2015-01-11Initial convertion of a_Dt to std::chronoTycho1-15/+13
also refactored cWorld::m_WorldAge and cWorld::m_TimeOfDay
2014-12-24Refactored all player block placing to go through hooks.Mattes D1-0/+5
Fixes #1618.
2014-12-10Added a cWorld:PrepareChunk function.Mattes D1-0/+6
It prepares the chunk - loads or generates it and lights it. The spawn prepare process uses this function.
2014-11-30Improved comments for cWorld::DoWithPlayer().Mattes D1-1/+2
2014-11-30removed GetUsernames() from WorldVincent1-3/+0
2014-11-29fixed naming of strings and changed from i to IVincent1-1/+2
2014-11-29issue 1253 - prevent multiple logins with same usernameVincent1-0/+2
2014-11-26Merge remote-tracking branch 'origin-master' into c++11Tiger Wang1-0/+2
2014-11-22cWorld: Rewritten spawn preparation.Mattes D1-0/+2
It now supports pregeneration distance of any size and runs in two threads in parallel (generator / lighting). Fixes #1597.
2014-11-15Fixed a security problem with signs.Howaner1-4/+1
2014-11-12Fixed trailing whitespace.Mattes D1-1/+1
2014-11-05renamed FindAndDoWithUUID to DoWithPlayerByUUID, fixed style and comments, added description to APIDumpLukas Pioch1-2/+2
2014-11-02Added FindAndDoWithUUIDLukas Pioch1-0/+3
2014-10-30... in this worldHowaner1-1/+1
2014-10-30Added a MaxViewDistance option.Howaner1-0/+10
2014-10-25Cleaned up simulatorsTiger Wang1-4/+3
2014-10-23En masse NULL -> nullptr replaceTiger Wang1-185/+189
2014-10-20En masse NULL -> nullptr replaceTiger Wang1-45/+45
2014-10-19Migrated random generators to std::randomTiger Wang1-1/+1
2014-10-15Functions in cPluginManager get references instead of pointers.Mattes D1-1/+1
2014-10-13Fixed style.Mattes D1-1/+2
2014-10-12Aligned simulatorsworktycho1-5/+5
2014-10-12convert old style casts to fix warningsSteven Riehl1-144/+140
2014-10-10Moved a few objects to unique_ptrtycho1-9/+9
2014-10-06Stream 4 chunks per tick. Added priority.Howaner1-2/+2
2014-09-26Fixed players custom name in 1.8Howaner1-1/+1
2014-09-18Exported player list states to extra functions.Howaner1-27/+31
2014-09-17Added first test to show the object can be createdTycho1-2/+2
2014-09-17Update World.hnesco1-1/+1
2014-09-16Preparing 1.8 update nesco1-0/+3
Added Spectator gamemode
2014-09-12Spawn exp if you break a mob spawner.Howaner1-1/+1
2014-09-11Possibly decoupled IncrementalRedstoneSimulator from the rest of the serverTycho1-3/+4
THis wil hopefully allow for unit testing
2014-09-111.8: Added ParticleEffect packet.Howaner1-1/+1
2014-09-09Added the player list to the 1.8 protocol.Howaner1-1/+1
2014-09-08TimeOfDay does not need to be an Int64Tycho1-3/+3
2014-09-05Rewritten chunk status to specify whether the chunk is in queue.Mattes D1-7/+7
This fixes #1370.
2014-09-03Added cWorld::ForEachEntityInBox()madmaxoft1-0/+5
2014-09-02Added SetCustomName() to players.Howaner1-1/+1
2014-08-29fix chunk regeneratingLO1ZB1-1/+1
2014-08-28remove y-coord from chunksLO1ZB1-3/+3
2014-08-14CheckBasicStyle checks the src folder as well.madmaxoft1-1/+1
2014-08-10Renamed functions.Howaner1-4/+4
2014-08-08Renamed m_DoDaylightCycle to m_CycleDaylight.Howaner1-4/+4
2014-08-07Added SetDoDaylightCycle() and IsDaylightCycleEnabled() to cWorld.Howaner1-1/+13
I need this for a GameRule plugin.
2014-07-30Exported the beacon.Howaner1-0/+5
2014-07-29Slight cleanup after portalsTiger Wang1-2/+3
2014-07-27Add "Broadcasting" settings to world.iniHowaner1-1/+7
2014-07-24Removed redundant semicolons and re-added warningarchshift1-6/+6
2014-07-24Added a queue for setting chunk data.madmaxoft1-18/+18
Fixes #1196.
2014-07-22Export BroadcastEntityAnimation with ToLuaarchshift1-1/+1
Fixes #752
2014-07-22Speed improvements, crash fixes, & self-suggestionsTiger Wang1-1/+1
2014-07-21SuggestionsTiger Wang1-0/+7
2014-07-21Style: Normalized to no spaces before closing parenthesis.madmaxoft1-4/+4
2014-07-20Bug and crash fixesTiger Wang1-1/+1
* Fixes end portals' solidity * Fixed crashes to do with multithreading and removing an entity from the wrong world * Fixed crashes due to bad merge * Fixed crashes due to an object being deleted twice * Simplified cWorld::Start() and added comments to configuration files
2014-07-19Fixed style: spaces after commas.madmaxoft1-1/+1
2014-07-18Fix failed merge and other issuesTiger Wang1-12/+0
2014-07-17Normalized comments.madmaxoft1-1/+1
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.
2014-07-17Fixed spaces around single-line comments.madmaxoft1-4/+4
There should be at least two spaces in front and one space after //-style comments.
2014-07-17Fixed basic whitespace problems.madmaxoft1-7/+7
Indenting by spaces and alignment by spaces, as well as trailing whitespace on non-empty lines.
2014-07-13Made CreateProjectile a pointerworktycho1-1/+1
2014-07-13Changed BroadcastSoundEffect function to take floating pos.Howaner1-1/+1
2014-07-10Implemented support for forced chunk ticking.madmaxoft1-0/+7
Fixes #1160.
2014-07-09Fixed arrow collection animationTiger Wang1-1/+0
* Fixed piston extension non-solidness
2014-07-07Implemented trapped chests & othersTiger Wang1-13/+2
+ Added trapped chests * Fixed a bunch of bugs in the redstone simulator concerning wires and repeaters * Other potential bugfixes
2014-07-02Redstone simulator is alerted to lever unpoweringTiger Wang1-1/+1
* Fixed the "fix" that broke the fix for #535, thereby fixing said issue * Fixed #535
2014-06-27Added generic entity-collecting.Mattes D1-0/+1
Now any cEntity can be collected, not only cPickups. This should help PR #1098.
2014-06-21Fixed invalid iteratorsTiger Wang1-3/+0
2014-06-19Nullify deleted pointers.archshift1-0/+1
2014-06-17Add DoWithBlockEntityAt() to WorldInterface.hHowaner1-1/+1
2014-06-14Cauldrons check the heightmapTiger Wang1-3/+3
2014-06-13Removed an unused fwd declaration.madmaxoft1-1/+0
2014-06-11Fixed constnessworktycho1-5/+5
2014-06-11Compile fixTiger Wang1-1/+1
2014-06-11Reduced code duplicationTiger Wang1-4/+4
call @maxmaxoft! calling... call connected (0:20) call ended
2014-06-11IsWeatherSunnyAt does something useful :DTiger Wang1-9/+5
2014-06-11SMICOLOSLAlexander Harkness1-4/+4
Meant to be semicolons up there.
2014-06-11Updated unnecessary function :/Tiger Wang1-1/+5
2014-06-11Add DoxyComments to he weather things. Alexander Harkness1-7/+24
Also changed the function names.
2014-06-11Add new IsWeatherWet hook for cauldrons.Alexander Harkness1-1/+12
@madmaxoft can you comment?
2014-06-10Portal improvements and suggestionsTiger Wang1-2/+11
2014-06-08Fixed deadlock when moving players to other worlds.Mattes D1-2/+19
Fixes #1039, fixes #851
2014-06-08Added queue for adding entities to cWorld.Mattes D1-1/+8
This alone doesn't work properly yet, further changes to cPlayer are needed.
2014-06-05SuggestionsTiger Wang1-1/+3
2014-06-04Configurable portalsTiger Wang1-0/+24
2014-05-29Cauldrons fillTiger Wang1-2/+2
2014-05-29Changed block send queue to use vectorsTiger Wang1-4/+2
As suggested by @worktycho.
2014-05-25Hopefully fixed piston duplication issuesTiger Wang1-1/+17
* Fixes #879 * Fixes #714
2014-04-27Redstone simulator now directly accesses cChunkTiger Wang1-1/+1
* Redstone simulator performance improvements * Added return values to some functions * Minor fixes
2014-04-26Moved the weather picker out of TickWeather(), squashing a warning and improving readability.archshift1-1/+4
2014-04-23Small changesTiger Wang1-1/+3
2014-04-18Did some static analysis, fixed some bugs and optimized a lot of codejfhumann1-1/+1
2014-03-30Fixed a few clang warnings.madmaxoft1-3/+3
2014-03-25Minor fixesandrew1-10/+10
2014-03-24Wither invulnerabilityandrew1-1/+1
2014-03-22Added override specifier to functions declared in cWorldTycho1-8/+8
2014-03-20ENUMified shrapnel levelTiger Wang1-6/+4
2014-03-18Added levels of shrapnelTiger Wang1-4/+8
2014-03-16Added override specifier where appropriate in cWorld.madmaxoft1-37/+38
2014-03-11Unified Vector classesandrew1-2/+1
2014-03-10Shrapnel now configurableTiger Wang1-0/+6
2014-03-09Beds now work properly fixes #707Tiger Wang1-4/+4
Also fixes FS392 Conflicts: src/Blocks/WorldInterface.h src/ClientHandle.cpp
2014-03-08Change TNT Fuse to ticksHowaner1-1/+1
2014-03-07Add Lua Bindings for FlowerPotEntity.h and add documentation.Howaner1-2/+2
2014-03-07Add Flower PotsHowaner1-2/+7
2014-03-05Add SendBlockTo to cWorldInterfaceHowaner1-1/+1
2014-03-03Fixed previous weather changes.madmaxoft1-1/+2
cWorld::GetDefaultWeatherInterval() returns -1 for unknown weather.
2014-03-02Add cancelling to WeatherChanging event.Howaner1-0/+3
2014-03-02More documentation (thanks to madmaxoft) and use GetBlockTypeMetaHowaner1-2/+2
2014-03-02Add Trapdoor Functions to cWorld and fix Trapdoor Redstone BugsHowaner1-0/+6
2014-02-27Implemented ballistic missiles (fireworks)Tiger Wang1-1/+1
+ Added fireworks
2014-02-23Rename SkullEntity to MobHeadEntityHowaner1-4/+4
2014-02-23Add Heads completelyHowaner1-0/+5
2014-02-23Maps: Improvementsandrew1-3/+6
2014-02-20Thread safe cMap managerandrew1-2/+3
2014-02-19Rename SkullEntity to MobHeadEntityHowaner1-4/+4
2014-02-18Add Heads completelyHowaner1-0/+5
2014-02-18The cuboid for cWorld::SetAreaBiome() doesn't need sorting.madmaxoft1-1/+2
2014-02-18Added cWorld:SetAreaBiome() API function.madmaxoft1-1/+19
Fixes #675.
2014-02-18Added a bit more documentation to cForEachChunkProvider.madmaxoft1-4/+7
2014-02-15Removed the unnecessary LoopPlayersAndBroadcastChat() functions.madmaxoft1-9/+7
2014-02-15Implemented cCompositeChat.madmaxoft1-1/+3
This allows plugins to send composite chat messages, containing URLs, commands to run and cmdline suggestions. Fixes #678.
2014-02-15Exported cWorld::BroadcastParticleEffect.STRWarrior1-1/+1
2014-02-14Send map when selectedandrew1-0/+6
2014-02-13IDCount Serializationandrew1-0/+11
2014-02-11Fixed formatting. Moved UnloadUnusedChunks from public to private.narroo1-4/+3
2014-02-11Fixed formatting of previous commit.narroo1-2/+2
2014-02-11More gcc warnings fixed.madmaxoft1-1/+2
2014-02-11Fixed bug #385. UnloadUnusedChunks now has the same interface asnarroo1-1/+15
SaveAllChunks. Meaning, QueueUnloadUnusedChunks and the supporting cTaskUnloadUnusedChunks has been added. Use QueueUnloadUnusedChunks from now on to prevent deadlocking.
2014-02-08Initial ChunkStay code.madmaxoft1-3/+0
2014-02-07Renamed cRedstoneManager to cRedstoneSimulator and renamed cRedstoneSimulator to cIncrementalRedstoneSimulator (Might change later).STRWarrior1-4/+4
2014-02-07Implemented an easy way of adding new redstone simulators.STRWarrior1-3/+6
Also added a "noop" redstone simulator that does the same as the fluid version.
2014-02-07Improved chat messaging functionsTiger Wang1-10/+17
* Moved string manipulation into cClientHandle and therefore... + Added configuration option for prefixes. * Cleaned up code. * Updated documentation for API.
2014-02-06Added more chat functionsTiger Wang1-1/+11
2014-02-03Increased Type safety of BiomesTycho1-1/+1
Changed a number of funcictions from using integers to store biomes to using EMCSBiome Note that switching from an int to an Enum is a non-breaking chang to the lua bindings
2014-02-03Not exporting FindClosestPlayertonibm191-1/+1
2014-02-03Exporded World:FindClosestPlayer, Item:IsEnchantable and Monster:MoveToPosition to Lua APItonibm191-1/+1
2014-02-01Changed pointers to referencesTycho1-2/+2
2014-02-01Changed signitures of Several BLockHandler MethodsTycho1-1/+1
Changed the signitures of the following to use interfaces: GetPlacementBlockTypeMeta OnPlaced OnPlacedByPlayer OnDestroyed OnNeighbourChanged NeighbourChanged OnUse CanBeAt Check
2014-01-27The world can now be configured wether farmers should be able to harvest crops.STRWarrior1-0/+3
2014-01-26Refactored cBlockHandler::OnUse and dependentsTycho1-28/+28
2014-01-25First attempt at Implementing InterfacesTycho1-4/+5
2014-01-25Mob bugfixesTiger Wang1-1/+1
* Mobs no longer require constant line-of-sight to a player to remain aggravated * Fixed an ASSERT * Fixed mobs jumping * Fixed Idle state not properly using AI + Added FILE_IO_PREFIX to favicon loading + Implemented #563
2014-01-23Command block fixes 2andrew1-0/+9
2014-01-21Scoreboard protocol supportandrew1-1/+4
2014-01-20Actually implemented interfacesTycho1-0/+1
2014-01-20Seperated BlockArea From WorldTycho1-3/+3
If anyone can come up with a better name for the interface I'll change it, It contians to methods which do compleatly unrelated things
2014-01-19Changed the cWorld::ScheduleTask() signature.madmaxoft1-130/+146
Now it takes the delay in ticks as an argument, and a cTask descendant as the task to run. Lua API has been updated similarly.
2014-01-19Basic scoreboard implementationandrew1-0/+6
2014-01-18Command blocks: Execute()andrew1-1/+1
2014-01-18switched to using m_WorldAge rather than m_TickIDTycho1-3/+0
2014-01-18Basic command block implementationandrew1-6/+10
2014-01-17Added user setting compression factorTycho1-0/+2
2014-01-17Increased tick count to longTycho1-1/+1
2014-01-17Implemented xsofts suggestion for a saturating counter in the schedulerTycho1-0/+3
2014-01-14added cWorld::ScheduleTask FunctionTycho1-0/+24
ScheduleTask schedules a SceduledTask object to be run x ticks in the future. In is exported to lua, fixes #150
2014-01-12Renamed cEmptyMinecart to cRideableMinecartSTRWarrior1-1/+1
2014-01-12EmptyMinecarts should be able to get a block inside of them.STRWarrior1-1/+1
2014-01-12Added cWorld::SpawnMinecart.STRWarrior1-0/+3
2014-01-10Decoupled cChunkGenerator from cWorld and cRoot.madmaxoft1-0/+24
Now the chunk generator can be used by other projects without depending on the two hugest structures in MCS.
2014-01-06Exported cWorld::BroadcastBlockAction().madmaxoft1-1/+1
As requested in #508; no guarantees about it.
2013-12-31fixed warnings in World.cppTycho Bickerstaff1-0/+1
2013-12-23Replaced esCreeper with esMonster.madmaxoft1-1/+1
Any monster will be able to explode, and also this fixes #425.
2013-12-22Implented BroadcastParticleEffectSTRWarrior1-0/+1
2013-12-20Fixed the rest of constructor reorders.madmaxoft1-1/+1
2013-12-16Removed some old cRedstone remnantsTiger Wang1-5/+0
2013-12-15This adds the cWorld::BroadcastEntityEffect and cWorld::BroadcastRemoveEntityEffect functions.STRWarrior1-0/+2
2013-12-14Implemented note block playing and fixed wireTiger Wang1-0/+5
Game of Thrones music in Minecraft, here I come!
2013-12-13Redstone data is now loaded on chunk loadTiger Wang1-0/+1
2013-12-07Added a SpawnFallingBlock function so plugins can make other blocks fall.STRWarrior1-0/+3
2013-12-07Renamed animation functionTiger Wang1-1/+1
Renamed BroadcastPlayerAnimation to BroadcastEntityAnimation. Not just players can have animations, you know.
2013-12-06Fixed duplication glitch with QueueSetBlockTiger Wang1-1/+1
If a coordinate was queued, and then the block there was broken, it would reappear: double items! Also now just sets meta if previous and current blocktypes matched.
2013-12-04Lava can spawn fire.madmaxoft1-0/+3
Settable in world.ini, lava can spawn fire to fuel blocks near it. Fix #65.
2013-11-30Added the real tick duration to the OnWorldTick hook.madmaxoft1-1/+1
2013-11-24Moved source to srcAlexander Harkness1-0/+0
2013-11-20Added cWorld:ForEachBlockEntityInChunk() and cWorld:DoWithBlockEntityAt() functions.madmaxoft1-2/+8
Also exported them to the Lua API.
2013-11-13Player XpDaniel O'Brien1-744/+744
2013-10-29Changes based on madmaxoft's nitpicker notes.Samuel Barney1-2/+2
2013-10-29Update to allow the light map to remain the same, but allow alteration of sky light values based on time.Samuel Barney1-0/+7
2013-10-24Pickups now have collection delay when vomitedTiger Wang1-2/+2
Implements FS#394.
2013-10-12Fixed and exported cWorld:QueueTask().madmaxoft1-2/+2
This implements #220.
2013-10-04Added cWorld::IsWeatherXXX() functionsmadmaxoft1-1/+9
2013-09-16Removed cWorld:SaveAllChunks() from the API.madmaxoft1-1/+1
Use cWorld:QueueSaveAllChunks() instead, the old function was prone to deadlocks.
2013-09-16cWorld:QueueTickBlock takes the delay in ticks.madmaxoft1-4/+6
2013-09-15Fixed doxycomments of cWorld plant-growing codemadmaxoft1-5/+10
2013-09-15Removed cWorld deprecated API: SetWorldTime()madmaxoft1-6/+0
2013-09-15Removed obsoleted cWorld functions from the API:madmaxoft1-10/+3
GetClassStatic() (is used only internally by ManualBindings) GetTime() (is replaced with GetWorldAge() and GetTimeOfDay()
2013-09-15Fixed API bindings of cWorld:GetSignLines(), exported cWorld:UseBlockEntity().madmaxoft1-2/+2
2013-09-15Fixed cWorld bindings for GetBlockInfo() and GetBlockTypeMeta().madmaxoft1-2/+7
They no longer require the superficial arguments.
2013-09-08Adding glue to call everything done in last commits - now the mobs are spawningmgueydan1-2/+3
2013-09-08Disabeling current mob spawning and tickmgueydan1-2/+2
2013-09-07Adding mob census (sorry this is a big commit as work was done before git integration i couldn't split it more)mgueydan1-0/+1
2013-09-07Renamed cWorld::DoExplosiontAt() to cWorld::DoExplosionAt()madmaxoft1-2/+2
2013-09-01Exported BroadcastSoundEffect and BroadcastSoundParticleEffect to the Lua APISTRWarrior1-728/+728
2013-08-22Added skeleton code for projectile spawning.madmaxoft1-0/+4
2013-08-21Added cWorld:GetIniFileName() to the Lua API.madmaxoft1-6/+14
2013-08-18Implemented cWorld:QueueSetBlock(), as requested for delayed blocksetting.madmaxoft1-2/+17
Untested yet, so might not work.
2013-08-18Removed SetServerBlock griefing.madmaxoft1-1/+0
2013-08-18Properly fixed piston non-animationTiger Wang1-0/+1
Fixes #57
2013-08-16Replaced E_ENTITY_TYPE_XXX with cMonster::mtXXX.madmaxoft1-2/+3
Also slightly improved the spawning algorithm.
2013-08-15Exported cWorld:DoExplosionAt() to Lua API.madmaxoft1-1/+1
2013-08-14Fixed crashes in world's clientlist manipulatorsmadmaxoft1-0/+6
2013-08-13Exported cWorld:BroadcastChat() to the Lua API; used in the Core.madmaxoft1-2/+2
2013-08-13Clients are now ticked in cServer first, then in cWorld once they get assigned a world.madmaxoft1-2/+14
2013-08-11Added cWorld:QueueSaveAllChunks() function for saving chunks asynchronously.madmaxoft1-2/+36
The cWorld:SaveAllChunks() is therefore deprecated in the API and will be removed soon, use QueueSaveAllChunks() instead.
2013-08-11Each world now ticks in a separate thread.madmaxoft1-1/+8
2013-08-11Moved MaxPlayers and Description from cWorld to cServer.madmaxoft1-16/+22
Also started creating a new cWorld::cTickThread class, but not used yet.
2013-08-09Added OnExploding() and OnExploded() hooks.madmaxoft1-3/+15
As requested in FS 413, with extra parameters: World, BlockX, BlockY, BlockZ, Size, CanCauseFire, Source, SourceData OnExploding() can return 3 values: StopHook, CanCauseFire, ExplosionSize
2013-08-05Exported the cWorld:TryGetHeight() functionmadmaxoft1-4/+4
2013-08-05Exported cWorld:DoWithEntityByID() to Lua APImadmaxoft1-1/+1
2013-08-03Added cWorld::DoWithChunk() function.madmaxoft1-0/+3
This will be used by the blocktracers to gain direct access to chunk data.
2013-07-30Tab completion packet is handled and sent.madmaxoft1-0/+3
This only handles the network comm and the overall design logic, the actual completion is not yet implemented, only dummy values are returned for now.
2013-07-28Added cPlayer::IsGameModeXXX() and cWorld::IsGameModeXXX() functions.madmaxoft1-0/+11
These are the preferred way of determining the gamemode, you should use those instead of doing manual comparisons to the gamemode value.
2013-07-07World: More unused variables removed.madmaxoft@gmail.com1-3/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1667 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-07-07World: Removed an unused variablemadmaxoft@gmail.com1-1/+0
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1666 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-07-07Improved function names for protocol packet sending; alpha-sorted the function listsmadmaxoft@gmail.com1-20/+20
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1659 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-07-01Rewritten entity-on-fire management ("forever on fire" bugs)madmaxoft@gmail.com1-1/+1
Fixes FS #297 and part of FS #403. Added sizes to all entities. Moved all damage-related functions from cPawn to cEntity API change: renamed cPawn:TeleportTo() to cEntity:TeleportToCoords() git-svn-id: http://mc-server.googlecode.com/svn/trunk@1635 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-22Added the End height and composition generators.madmaxoft@gmail.com1-7/+0
Also made the dimension in world.ini specifiable by a string. Exported StringToDimension() and StringToBiome() to Lua API. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1621 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-21Dispensers dispense primed TNTmadmaxoft@gmail.com1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1617 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-21Simulators are woken up after an explosion.madmaxoft@gmail.com1-3/+7
Fixes FS #391 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1615 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-18More TNT fixes.madmaxoft@gmail.com1-0/+3
Chain-reaction TNTs are spawned in proper coordinates (FS #390) Centralized Primed TNT entity spawning and made available to the plugins. Internal changes for better TNT performance. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1604 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-15First attempt at fixing the inter-threading deadlocks between the tick thread and the socket threadmadmaxoft@gmail.com1-0/+13
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1591 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-12Added cWorld::SetSignLines(), re-exported to Lua manually to avoid ghost return valuesmadmaxoft@gmail.com1-2/+5
FS #364 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1582 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-09Fixed previous commit.nielsbreu@gmail.com1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1573 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-09Added SetTicksUntilWeatherChange/GetTicksUntilWeatherChange. to set/get the amount of ticks before the weather changes. Added SendBlockChange to Lua to create "fake" blocksnielsbreu@gmail.com1-2/+8
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1572 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-26Implemented droppersmadmaxoft@gmail.com1-1/+13
Added a common ancestor class "DropSpenser" that has the common code for dropper and dispenser and is Lua-accessible, too. The Debuggers plugin now triggers both droppers and dispensers when rclking them with a redstone torch. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1514 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-25Fixed the cWorld:DoWithChestAt(), DoWithDispenserAt() and DoWithFurnaceAt() callbacks binding.madmaxoft@gmail.com1-2/+2
They are now doing what the comment said they are doing. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1506 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-09Tiny formatting fix of rev 1463madmaxoft@gmail.com1-5/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1467 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-09function SpawnItemPickups is now exported to Lua. Lua is able to create a Items object.nielsbreu@gmail.com1-1/+7
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1463 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-04-18Initial implementation of explosions and TNT blockkeyboard.osh@gmail.com1-0/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1392 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-04-13Proper entity removal functionsmadmaxoft@gmail.com1-4/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1386 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-04-13Rewritten entities so that they are owned by individual chunks and ticked within their chunk's Tick()madmaxoft@gmail.com1-22/+22
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1385 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-04-05Added carrots and potatoes handling, bonemealing and proper lighting.madmaxoft@gmail.com1-2/+4
FS #166 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1359 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-03-18Added support for the packet #28 (0x1C): ENTITY_VELOCITYkeyboard.osh@gmail.com1-0/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1283 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-03-11Initial nether composition generatormadmaxoft@gmail.com1-5/+15
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1266 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-03-03Player can sit in minecarts (but not move them yet)madmaxoft@gmail.com1-0/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1249 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-03-02Rewritten SandSimulator to use direct chunk access; and sand falling on torches now creates a pickup.madmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1240 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-03-01New fire simulator, fully rewritten to the new scheme of things, directly accessing chunk data.madmaxoft@gmail.com1-0/+3
http://forum.mc-server.org/showthread.php?tid=617&pid=6626#pid6626 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1233 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-28Simulators now have direct access to the cChunk object in the WakeUp() callmadmaxoft@gmail.com1-0/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1227 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-13Added HOOK_WEATHER_CHANGING.madmaxoft@gmail.com1-4/+13
http://www.mc-server.org/support/index.php?do=details&task_id=299 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1210 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-03Added a GetClassStatic function to all entities, as well as cFurnaceEntity, cChestEntity and cWorldfaketruth1-0/+5
Using templates to generate ForEach* functions instead of MACROS Better error reporting in ForEach* functions git-svn-id: http://mc-server.googlecode.com/svn/trunk@1191 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-01Simplified cWorld::FindAndDoWithPlayer()madmaxoft@gmail.com1-1/+1
It should still work the same - call the callback for the player with the most similar name. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1184 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-01-12Merged branch "branches/hooks" into "trunk".madmaxoft@gmail.com1-23/+16
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1139 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-27Fixed slab usage in creative modeluksor111@gmail.com1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1112 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-26Dispensers can dispense items and liquids nowluksor111@gmail.com1-0/+6
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1105 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-21Replaced "const double &" with plain "double" for simplicitymadmaxoft@gmail.com1-5/+7
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1085 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-19Added dispensers (they can't dispense items yet)luksor111@gmail.com1-4/+6
Fixed crash when digging snow Moved BlockPlace hook check, so Core plugin will no longer block item usage Player chat messages are now visible in the console git-svn-id: http://mc-server.googlecode.com/svn/trunk@1081 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-11-11Removed an unused obsolete function chain - cWorld::GetChunkBlockData()madmaxoft@gmail.com1-3/+0
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1036 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-11-01Refactored the world time.madmaxoft@gmail.com1-18/+43
Now it is stored in two values - WorldAge (only incremented, plugins cannot change) and TimeOfDay (plugins can change). Since sub-tick precision is needed in Tick(), we store it both as number of seconds (double) and number of ticks (Int64) is calculated off of that. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1022 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-28Added cWorld:SpawnMob(PosX, PosY, PosZ, EntityType) to Lua APImadmaxoft@gmail.com1-0/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1014 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-26Fixed a valgrind warning in BlockDirt.madmaxoft@gmail.com1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1011 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-21Top blocks are now snowed over, either normally, or in deep snow (patch contributed by funmaker, Luksor and Sebi)madmaxoft@gmail.com1-0/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1000 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-21Added jukeboxes (patch contributed by Luksor)madmaxoft@gmail.com1-22/+23
git-svn-id: http://mc-server.googlecode.com/svn/trunk@994 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-20Made cWorld's block query functions more orthogonal, added GetBlockInfo() returning all info on a block.madmaxoft@gmail.com1-12/+18
git-svn-id: http://mc-server.googlecode.com/svn/trunk@986 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-13Preparation for multiple fluid simulators.madmaxoft@gmail.com1-8/+11
Moved all simulators into a subfolder. Replaced cWaterSimulator and cLavaSimulator with a generic cFluidSimulator. Moved original fluid simulation into cClassicFluidSimulator. Fluid simulator parameters (MaxHeight, Falloff) are read from the world.ini file (can have nether-like lava with lower falloff) git-svn-id: http://mc-server.googlecode.com/svn/trunk@956 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-13Added delayed ticking to Lua APImadmaxoft@gmail.com1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@953 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-10Added an option to disable/enable PVP on a per world basisfaketruth1-0/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@944 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-06BlockArea writing support (BlockTypes with BlockMeta only)madmaxoft@gmail.com1-0/+7
git-svn-id: http://mc-server.googlecode.com/svn/trunk@933 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-03Moved blockticking into blockhandler classes.madmaxoft@gmail.com1-1/+7
Also slightly refactored the variable / argument names (BlockID is deprecated, use BlockType instead) git-svn-id: http://mc-server.googlecode.com/svn/trunk@921 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-29Beds can be slept in now (it doesn't change the time though)faketruth1-0/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@911 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-29Made beds placeablefaketruth1-1/+2
Android: Updated some stuff and set default view distance lower git-svn-id: http://mc-server.googlecode.com/svn/trunk@900 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-25Added the block dig animation packet (patch contributed by l0udPL)madmaxoft@gmail.com1-1/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@892 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-24Source files cleanup: The rest of the files renamed.madmaxoft@gmail.com1-3/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@887 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-23Source files cleanup: WorldStorage-related files in a separate subfoldermadmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@882 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-23Source files cleanup: Generating-related files in a separate subfoldermadmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@881 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-11Merged in a patch for sounds by l0udPLmadmaxoft@gmail.com1-0/+1
http://forum.mc-server.org/showthread.php?tid=434&pid=4564#pid4564 git-svn-id: http://mc-server.googlecode.com/svn/trunk@858 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-02Next iteration on the 1.3.2 protocol. Still no good, but sometimes it just gets through. For your testing pleasures ;)madmaxoft@gmail.com1-3/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@819 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-01Added a Player parameter to OnUpdatedSign and OnUpdatingSign Lua callbacks and to the cWorld:UpdateSign method (http://forum.mc-server.org/showthread.php?tid=464&pid=4393#pid4393)madmaxoft@gmail.com1-1/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@814 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-31Progress on the 1.3.2 protocol.madmaxoft@gmail.com1-1/+1
Sometimes the client lets the player through, but most of the times the connection breaks for no apparent reason. git-svn-id: http://mc-server.googlecode.com/svn/trunk@812 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-29Gotten completely rid of all cPackets. The cProtocol125 class now does all the parsing and writing by itself.madmaxoft@gmail.com1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@802 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-27Cut out all packet handling to a separate cProtocol descendantmadmaxoft@gmail.com1-9/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@796 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-26git-svn-id: http://mc-server.googlecode.com/svn/trunk@795 0a769ca7-a7f5-676a-18bf-c427514a06d6madmaxoft@gmail.com1-0/+1
2012-08-25cWorld doesn't use cPackets.madmaxoft@gmail.com1-2/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@789 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-24cPickup doesn't use cPackets.madmaxoft@gmail.com1-0/+1
Also, Lua API change, OnCollectItem -> OnCollectPickup; first param is cPlayer to match other callbacks. git-svn-id: http://mc-server.googlecode.com/svn/trunk@786 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-24Monster classes don't use cPackets. Chat messages are sent / broadcast without cPackets. BlockEntities don't use cPackets.madmaxoft@gmail.com1-0/+7
git-svn-id: http://mc-server.googlecode.com/svn/trunk@783 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-23Added a RateCompareString function to StringUtilsfaketruth1-0/+3
Created a preprocessor template (define) for DoWith* functions Exported cWorld::FindAndDoWithPlayer(), cRoot::FindAndDoWithPlayer() and cRoot::ForEachPlayer() to Lua Added a function FindAndDoWithPlayer to cRoot and cWorld. It takes a part of a player name and finds a single player based on that. Fixed Core's MOTD to contain the correct URL to the MCServer site Fixed Core /kick command Fixed Core's WebAdmin kick git-svn-id: http://mc-server.googlecode.com/svn/trunk@779 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-19Window, Chest, Furnace and Pawn are not using cPackets at allmadmaxoft@gmail.com1-0/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@762 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-19Almost all packets' handling is now rewritten not to use cPacket descendants elsewhere than in cClientHandle.madmaxoft@gmail.com1-0/+7
git-svn-id: http://mc-server.googlecode.com/svn/trunk@761 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-19Another handful of packets rewritten.madmaxoft@gmail.com1-0/+2
Also changed cItem::m_ItemID into m_ItemType of type short. Easier handling. m_ItemID kept for compatibility reasons (Lua-interface etc.) git-svn-id: http://mc-server.googlecode.com/svn/trunk@756 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-18Chat packet handled in the new way; fixed missing packet sending for inventory slot.madmaxoft@gmail.com1-1/+3
Again, API change! cPlugin:OnChat() has had its parameters swapped, to match all the other callbacks - Player first, Message second git-svn-id: http://mc-server.googlecode.com/svn/trunk@751 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-06A bit of cleanup and documentation around the UI window handlingmadmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@716 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-03Fixed a few gcc pedantic warnings; made BLOCKTYPE an unsigned char type.madmaxoft@gmail.com1-11/+11
git-svn-id: http://mc-server.googlecode.com/svn/trunk@711 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-07-15A new Block handling system :olapayo94@gmail.com1-3/+18
It was really a lot of work :D Took me the complete weekend :D Would really like to here your opinion on this =) The aim of this is to put all the actions for one block in one place so it is not spread around the source. (ToPickup, Action in cWorld, Action in cChunk, Action here, action there :D) git-svn-id: http://mc-server.googlecode.com/svn/trunk@671 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-07-15World threads are stopped before the plugin mgr for clean exit (FS #228)madmaxoft@gmail.com1-1/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@669 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-07-02cBlockArea object added (with only minimal testing so far)madmaxoft@gmail.com1-0/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@641 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-07-02Added the cWorld::DoWithPlayer() function and exported it in the Lua API. Removed the obsolete cWorld::GetPlayer() function.madmaxoft@gmail.com1-3/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@639 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-17Removed the deprecated GetBlockEntity(), added several enumerators to replace it.madmaxoft@gmail.com1-5/+23
git-svn-id: http://mc-server.googlecode.com/svn/trunk@629 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-16Exported cWorld::ForEachEntity and cWorld::ForEachEntityInChunk; no idea if they actually workmadmaxoft@gmail.com1-3/+10
git-svn-id: http://mc-server.googlecode.com/svn/trunk@620 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-14Attempt to bring sanity to newlines across systems.cedeel@gmail.com1-408/+408
git-svn-id: http://mc-server.googlecode.com/svn/trunk@606 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-13Revamped the weather system.cedeel@gmail.com1-0/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@599 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-09Sugarcane and cactus max height can be set in world.ini.madmaxoft@gmail.com1-0/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@585 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-09Plants growable by bonemeal are settable in the world.ini. Default matches vanilla MC.madmaxoft@gmail.com1-2/+14
git-svn-id: http://mc-server.googlecode.com/svn/trunk@584 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-09Bonemeal is consumed in survival mode when used on growable blocksmadmaxoft@gmail.com1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@582 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-07Bonemeal works on crops, melons, pumpkins, saplings and grass. Plant growing has been refactored into separate functions callable from Lua, too.madmaxoft@gmail.com1-0/+6
git-svn-id: http://mc-server.googlecode.com/svn/trunk@573 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-07Repeaters' delays can be set by rclkmadmaxoft@gmail.com1-0/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@570 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-06Item-dropping code rewritten and centralized - now there's only one place to modify if we want to split or merge same-item drops: cWorld:SpawnItemPickups(). Also, mined blocks can now drop more items, and they recognize if they're being mined by the correct tool.madmaxoft@gmail.com1-2/+9
git-svn-id: http://mc-server.googlecode.com/svn/trunk@561 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-02Added Lua function cRoot:ForEachWorld(), removed the obsolete cRoot:GetWorld() method (both C++ and Lua)madmaxoft@gmail.com1-3/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@534 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-31cWorld::UnloadUnusedChunks() exported to Luamadmaxoft@gmail.com1-1/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@531 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-30Added support for SetNextBlockTick() function callable from Luamadmaxoft@gmail.com1-0/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@527 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-30Lua plugins can now query the world for various queue sizes ( http://forum.mc-server.org/showthread.php?tid=432 )madmaxoft@gmail.com1-0/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@524 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-29Added code for the chunks to manipulate their neighbors while ticking. Also added some basic farming support - melon and pumpkin growing code. Untested and untestable so far, will test and fix later.madmaxoft@gmail.com1-6/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@518 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-25Merged the composable_generator branch into the trunkmadmaxoft@gmail.com1-23/+52
git-svn-id: http://mc-server.googlecode.com/svn/trunk@504 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-04-11Moved the commands /coords /viewdistance and /regeneratechunks from cServer.cpp to the Core pluginfaketruth1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@457 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-04-10Added the "/regeneratechunk" command that regenerates either current chunk or a chunk specified with x, z parameters. TODO: permissions - we don't want guests erasing our chunks!madmaxoft@gmail.com1-1/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@454 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-24Reverted the previous commit - it is useless, since entities still depend heavily on cWorldmadmaxoft@gmail.com1-22/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@428 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-23Encapsulated cWorld functions needed in cWorldStorage into an interface, so that cWorldStorage can actually be used outside of MC-Server (such as storage conversion tools and chunk analyzers)madmaxoft@gmail.com1-1/+22
git-svn-id: http://mc-server.googlecode.com/svn/trunk@427 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-22Fixed a deadlock by removing clients from all chunks upon their exit, not using the clients chunklists.madmaxoft@gmail.com1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@426 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-16Exposed a function to Lua to get a block's sky light valuefaketruth1-1/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@416 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-14Split chunk data into separate arrays; decoupled most sources from cChunk.h dependencymadmaxoft@gmail.com1-19/+41
git-svn-id: http://mc-server.googlecode.com/svn/trunk@411 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-12Added a flat terrain generator with settable terrain heightmadmaxoft@gmail.com1-0/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@404 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-10Fixed a few obsoleted functionsmadmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@397 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-09cClientHandles have a unique ID now to distinguish themfaketruth1-1/+1
cAuthenticator uses unique client ID for authentication Changed the kick function used by cAuthenticator to take a client ID instead of name, so the correct user is kicked Using callback reference instead of pointer in GetChunkData and affiliates GetChunkData returns false when failed, and true when succeeded Renamed entity type enums to something prettier Exposed some functions to Lua git-svn-id: http://mc-server.googlecode.com/svn/trunk@388 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-07Fixed bug where cPlayer's cClientHandle was used after cPlayer was destroyed http://forum.mc-server.org/showthread.php?tid=380faketruth1-27/+28
Also removed the SetClientHandle() function from cPlayer Added a Destroyed() function to cEntity that is called ONLY ONCE after an entity has been 'destroyed' Cleaned up some code, using enums for GameMode and Weather and replaced some 'const char *' with 'const AString &' Exposed some more functions to Lua git-svn-id: http://mc-server.googlecode.com/svn/trunk@382 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-06Fixed rev368's ChunkSender, now sends properly even chunks that are loaded. Fixed a deadlock in cClientHandle vs TickThread over cClientHandle::m_CSChunkListsmadmaxoft@gmail.com1-0/+6
git-svn-id: http://mc-server.googlecode.com/svn/trunk@371 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-05ChunkSender: Chunks are now compressed and sent to clients from a separate threads, proper passive waiting between threads. Not much tested, just appears to work :)madmaxoft@gmail.com1-3/+9
git-svn-id: http://mc-server.googlecode.com/svn/trunk@365 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-03Got rid of some hardcoded numbers, now using hardcoded variables! woofaketruth1-12/+15
git-svn-id: http://mc-server.googlecode.com/svn/trunk@355 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-01New redstone simulator. Should work without crashes!faketruth1-5/+11
git-svn-id: http://mc-server.googlecode.com/svn/trunk@345 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-28Chunk now has an indicator of load failure; Chunk generator uses cChunkStaymadmaxoft@gmail.com1-0/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@337 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-28Implemented synchronous chunk loading; optimized cChunkStay interface for speed (though still unused ;)madmaxoft@gmail.com1-2/+8
git-svn-id: http://mc-server.googlecode.com/svn/trunk@336 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-28Const-correctness for packet broadcasting (fixes GCC compilation)madmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@333 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-26New cChunkStay class for temporarily keeping chunks loaded even when then have no clients. For now unused, will be used by generator and lighting in the future.madmaxoft@gmail.com1-0/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@330 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-23Made the viewdistance settable by users and default in settings.ini. The default is 9.madmaxoft@gmail.com1-6/+0
git-svn-id: http://mc-server.googlecode.com/svn/trunk@326 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-21Removed cChunkPtrs from everywhere but internal cChunkMap usage. Now we should finally be threadsafe :)madmaxoft@gmail.com1-4/+10
Also fixed a threading issue when a player connecting might have gotten stuck in "Downloading world" forever git-svn-id: http://mc-server.googlecode.com/svn/trunk@304 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-21Fixed heightmap optimization from rev 302; removed a few more cChunkPtrsmadmaxoft@gmail.com1-0/+9
git-svn-id: http://mc-server.googlecode.com/svn/trunk@303 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-20Removed some more cChunkPtr usagemadmaxoft@gmail.com1-1/+15
git-svn-id: http://mc-server.googlecode.com/svn/trunk@298 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-18Substantial cWorld::FastSetBlock() speed up by queueing all such calls and processing them later chunk-wise (makes growing trees in the generator fast again)madmaxoft@gmail.com1-16/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@295 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-18Re-implemented tree-growing. May produce artefacts on old-world / new-world boundaries.madmaxoft@gmail.com1-0/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@293 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-18Thread-safe chunk generation, storage and generator are queried for progress while initializing servermadmaxoft@gmail.com1-5/+7
Note that this commit breaks foliage generation - there are no trees in the chunks generated! git-svn-id: http://mc-server.googlecode.com/svn/trunk@292 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-16git-svn-id: http://mc-server.googlecode.com/svn/trunk@281 0a769ca7-a7f5-676a-18bf-c427514a06d6faketruth1-1/+1
2012-02-16New server command "unload" to manually unload unused chunksmadmaxoft@gmail.com1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@280 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-16cWorldGenerator speedup - doesn't call GetChunk() anymore, not queueing the chunk it's generating to be loaded recursively.madmaxoft@gmail.com1-7/+8
cChunk fix - setting a block to the same value doesn't mark chunk dirty (resulted in un-unloadable chunks) git-svn-id: http://mc-server.googlecode.com/svn/trunk@279 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-16Got rid of dangerous GetEntity(), not using DoWithEntity()faketruth1-5/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@278 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-16Chunk is now marked as dirty; saving only dirty chunks; rewritten load / save not to use cChunkPtr; set VC2008 project to level4 warnings; block entities are now loaded and saved properlymadmaxoft@gmail.com1-3/+11
git-svn-id: http://mc-server.googlecode.com/svn/trunk@273 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-15Restored chest and furnace functionality as it was (it's basically working but joined chests show single-chest window)madmaxoft@gmail.com1-0/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@263 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-14Slight cleanup - removed old code, some additional comments on dangerous functionsmadmaxoft@gmail.com1-1/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@261 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-14Got rid of cWorld::GetAllPlayers() and implemented ForEachPlayer() more or less in Luafaketruth1-6/+3
Core now uses ForEachPlayer() to interact with connected players git-svn-id: http://mc-server.googlecode.com/svn/trunk@260 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-13Rewritten most of the code for multithreading; still not 100%, but getting there. If this commit proves to be too problematic, we can always undo it.madmaxoft@gmail.com1-62/+99
git-svn-id: http://mc-server.googlecode.com/svn/trunk@251 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-08MTRand class is not created in each tick, therefore much improving tick-thread time (now uses ~5 % CPU instead of one full core)madmaxoft@gmail.com1-5/+19
git-svn-id: http://mc-server.googlecode.com/svn/trunk@245 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-29VC2008 / VC2010: Enabled precompiled header through Globals.h; the header included in every module in the project. Compilation optimization.madmaxoft@gmail.com1-4/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@188 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-19Terrain generation is synchronous again, async generation has bugs.faketruth1-6/+7
Made some funky smart pointer things for chunks. Fixed a bug where the client would override the player position on the server and back again, resulting in sending too many chunks to the client which it doesn't even need. Fixed some compiler warnings in cPickup.cpp git-svn-id: http://mc-server.googlecode.com/svn/trunk@164 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-01Fixed the numchunks console command.faketruth1-1/+2
Added some form of reference counting to cChunk to make sure it's not referenced when deleting it. Right now it's only needed due to the generation of chunks in a separate thread and adding it to the spread light list in cWorld git-svn-id: http://mc-server.googlecode.com/svn/trunk@161 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-28- implemented the fire simulation in native c++ (cFireSimulator)lapayo94@gmail.com1-0/+2
- Changed the Durationsystem for Items. cPlayer::UseEquippedItem calls cItem::DamageItem this function damages the item if it has a duration. (needed the duration also in another place so this saves code ;)) - added some other burning blocks - the mobtypes for the settings.ini which i must have forgotten in the last commit git-svn-id: http://mc-server.googlecode.com/svn/trunk@150 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-27Some kind of 'template' world generator that right now just generates an all dirt world. You can use this to test new algorithmsfaketruth1-2/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@127 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-26- improved Simulator system lapayo94@gmail.com1-2/+11
-> Manager handles all ticks -> advantage: Much easier to add new simulators, because you only have to register them in the manager - moved sand and gravel simulation to a Simulator-class (cSandSimulator) - Made Squid a little bit more funny and realistic, because it dies now when it´s not in water -Escaping mobs run now faster than normal (They just walked away before :D) git-svn-id: http://mc-server.googlecode.com/svn/trunk@125 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-26 - Linux compatible fixes including updated makefilemtilden@gmail.com1-0/+1
- Mersenne Twister still says uint32 but it's now signed for compatibility with random uses needing negative values - Server seed is sent to clients, but needs to be able to be signed long long later on for authentic reasons - Protocol Version is required to match to ensure client compatibility, this should probably have a settings.ini check as well as store the value there git-svn-id: http://mc-server.googlecode.com/svn/trunk@121 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-25Chunks are generated in a separate thread allowing players to keep on playing and chatting while chunks are generated. This means, however, that cWorld::GetChunk() does not always return a chunk and is something you need to be aware of. I am not entirely sure if all this is completely stable, but I think so :Ofaketruth1-0/+1
Chunks are now generated before the player is able to see them. This is done because after a chunks is done generating, some blocks might still need to be set (parts of trees from neighboring chunk), causing more bandwidth to be used (each changed block needs to be sent to clients again) and (fps) lagging the clients when changing a lot of blocks. Calculating ahead fixes these issues. Separated the placing of foliage (trees and stuff) when generated chunks into a new function GenerateFoliage() Cleaned up the VS2010 project, now using some VS2010 specific functions like dependencies on projects (no need for setting library dependencies manually). VS2010 project now compiles way faster in Release by using multi threading. git-svn-id: http://mc-server.googlecode.com/svn/trunk@103 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-24Max. players and MOTD are now changeable in the settings.inilapayo94@gmail.com1-4/+12
Thanks to mtilden ( http://forum.mc-server.org/showthread.php?tid=183&pid=1381#pid1381 ) git-svn-id: http://mc-server.googlecode.com/svn/trunk@101 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-22Digging leaves with shears now drops leaveslapayo94@gmail.com1-0/+4
Falling Sand now notifies water around Implemented Function to get the relative chunk position in the total position (cChunk::PositionToWorldPosition) Pistons don´t drop water and lava items anymore when stopping water/lava implemented Getter for lava and water simulator IsBlockWater and IsBlockLava function in Defines.h git-svn-id: http://mc-server.googlecode.com/svn/trunk@97 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-10Added random weather that persists per world. Also added SetWeather, GetWeather, and CastThunderbolt to lua bindings.admin@omencraft.com1-1/+6
git-svn-id: http://mc-server.googlecode.com/svn/trunk@83 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-09Redstone clocks now work. even one clocks. torches don't update themselves when placed yet, but redstone wire updates the torch. Fixed a bug with piston animations.admin@omencraft.com1-0/+6
git-svn-id: http://mc-server.googlecode.com/svn/trunk@80 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-08Fixed world timefaketruth1-0/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@78 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-06Patch with diff file created by Sebi (implemented some stuff like lava physics, drops are deleted when in lava, water is now slower, lava gives actual damage etc.). Pistons now work mostly as they should. They do not yet show the motion animation and do not emit sound. They do extend, push, and retract as they should though. Right now the only way to activate a piston is to light redstone wire adjacent to it with a redstone torch.admin@omencraft.com1-0/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@67 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-02Fixed some "Entity was not found in any chunk!" warningsfaketruth1-1/+1
Player's current world is saved in the player file. When a player joins the server, the player joins the last world he was in. It seems MCServer can finally run multiple worlds! It just needs functionality to switch between them git-svn-id: http://mc-server.googlecode.com/svn/trunk@46 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-01You can now run multiple worlds by defining them in settings.ini . However there's no way to change worlds on the fly yetfaketruth1-5/+6
Players are now stored in separate folder /players instead of in the world folder (!so move the folder!) Fixed a memory leak/error in cPickup.cpp Multiple worlds are stored in cRoot cClientHandle lists are taken out of cWorld and now stored in cServer Worlds now have names to distinguish them by Some functions in the Core plugin now distinguish between worlds git-svn-id: http://mc-server.googlecode.com/svn/trunk@40 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-10-26Made several recomended changes. Gamemode is now world based. Need to add it to player.admin@omencraft.com1-0/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@18 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-10-03MCServer c++ source filesfaketruth1-0/+158
git-svn-id: http://mc-server.googlecode.com/svn/trunk@3 0a769ca7-a7f5-676a-18bf-c427514a06d6