summaryrefslogtreecommitdiffstats
path: root/src/Chunk.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-07-06Remove some unused typedefsTiger Wang1-2/+0
2021-04-30Chest, weather, crash, and miscellaneous fixes (#5215)Tiger Wang1-6/+3
* Alpha-sort cChestEntity * Chests: use SendUpdateBlockEntity * Pathfinder: fix out of range Y * 1.13: correct weather packet ID * Chests: fix neighbour scanner + Add OnAddToWorld and overload to scan neighbours there, instead of in the constructor/OnUse. This fixes hoppers accessing newly loaded double chests and seeing a null m_Neighbour, thus thinking its a single chest. * Fix typo in cross coords computation. * Simplify hopper logic. * Block entities: ASSERT that type is correct If you match the block type first before calling DoWithBlockEntity, the corresponding block entity must either be empty or correspond to the block type. * Chunk: fix some forgotten PendingSendBE cleanup + Add cleanup in SetAllData, WriteBlockArea - Remove RemoveBlockEntity (used once), HasBlockEntity (not used) * Replace MakeIndex with MakeIndexNoCheck * Remove extraneous MarkDirty in hopper & chests
2021-04-12Implement random ticks more faithfullyTiger Wang1-1/+1
+ Make it pick 3 blocks per section, instead of 50 randomly throughout the chunk
2021-03-28Move some redstone implementations into the source fileTiger Wang1-2/+2
2021-03-28Fix chunk block changes being sent out of order (#5169)Tiger Wang1-3/+3
* Flush out all pending, buffered changes at the end of each tick, after every chunk is ticked. This makes every block update client-side in unison, instead of unlucky ones only being sent 1 tick later. * Re-add buffer for outgoing network data; IOCP async WSASend has higher overhead than expected... Fixes regression introduced in 054a89dd9
2021-03-28Unify DoWithBlockEntity (#5168)Tiger Wang1-92/+16
+ 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-07Some emplace_back replacements (#5149)12xx121-1/+1
* replace push_back with emplace_back when a new object was created in the function call
2021-03-05Prepare ChunkData for BlockState storage (#5105)Tiger Wang1-27/+18
* 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-01-18cChunk: don't inherit from cChunkDef (#5106)Tiger Wang1-6/+1
2021-01-11Convert most calls to blocking GetHeight/GetBiomeAt to direct chunk accessesTiger Wang1-1/+11
* Hopefully fixes #5094
2020-12-22unique_ptr<cChunkMap> to plain memberTiger Wang1-6/+2
2020-12-21Chunk: use FAST_FLOOR_DIVTiger Wang1-1/+0
2020-12-18Warnings improvementsTiger Wang1-2/+2
* 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-10-05Fix cmake not adding Werror on clang, and _lots_ of warnings (#4963)peterbell101-2/+2
* Fix cmake not adding Werror on clang, and _lots_ of warnings * WIP: Build fixes * Cannot make intermediate blockhandler instance * Tiger's changes * Fix BitIndex check * Handle invalid NextState values in cMultiVersionProtocol Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-09-25Do not call into things we don't own in destructorsTiger Wang1-0/+5
- Remove improper accesses in cChunk destructor * Fixes #4894
2020-08-28Save enderchest block entities to storageTiger Wang1-15/+1
+ Add EnderChest saving, as Vanilla does - Remove CreateBlockEntities. Storage should save & load everything so looping over chunk data is not needed
2020-08-28Clean up pickup collection to use ForEachEntityInBoxTiger Wang1-2/+0
2020-08-28Chunk: Make StayCount/AlwaysTicked unsignedTiger Wang1-3/+2
2020-08-28Clean up GenerateChunk/TouchChunkTiger Wang1-7/+1
- Remove TouchChunk - Remove unused bool return value in GenerateChunk - Remove ShouldGenerateIfLoadFailed
2020-08-28Remove unneeded MarkDirty, SendToClients parameters of SetMetaTiger Wang1-14/+8
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-21cChunk's deleted copy constructor needs constTiger Wang1-1/+1
2020-08-21Remove level of indirection in cChunk storageTiger Wang1-4/+3
- No more unique_ptr storage
2020-08-08const-ify some Chunk functionsTiger Wang1-7/+7
2020-08-04OnBroken/OnPlaced are for entity actionsTiger Wang1-4/+0
* Call OnPlaced/OnBroken in PlaceBlock/DigBlock - Remove unused Placing/Breaking handlers * Have the blockhandler's Check handle neighbour updating, instead of QueueTickBlockNeighbors
2020-08-02Use std::queue for the block tick queueTiger Wang1-1/+1
2020-08-02Remove unused block tick related cChunk functionsTiger Wang1-16/+3
2020-07-25Use relative vectors in cChunk::DoWithTiger Wang1-19/+16
2020-04-21Vector3 in Handlers (#4680)Mattes D1-1/+1
Refactored all cBlockHandler and cItemHandler descendants to use Vector3.
2020-04-17More Vector3 in cBlockHandler (#4644)Mattes D1-7/+9
* cBlockHandler.OnUpdate uses Vector3 params. Also slightly changed how block ticking works.
2020-04-05Filter blocks to add to redstone sim's wake queue (#4621)peterbell101-0/+1
2020-04-03Manage block entity lifetime with unique_ptr (#4080)peterbell101-2/+3
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-18Fixed unloading of chunks that contain player entities (#4508)Max Luchterhand1-0/+3
Co-authored-by: peterbell10 <peterbell10@live.co.uk> Co-authored-by: mluchterhand <mluchterhand@max.de>
2019-10-28Moved growing from cWorld / cChunk to cBlockHandler descendants.Mattes D1-45/+106
2019-10-16Refactored block-to-pickup conversion. (#4417)Mattes D1-7/+28
2019-09-29Refactored more of Entities and BlockEntities to use Vector3. (#4403)Mattes D1-0/+8
2019-08-11Fix building with clang 8.0 (#4346)Bond-0091-1/+1
2018-07-24Broadcast refactor (#4264)peterbell101-32/+2
* 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-23Optimise chunk set (#4260)peterbell101-1/+1
Closes #1244 Initially I was just going to add the cChunkData to cSetChunkData but profiling revealed that the copying wasn't even the biggest slowdown. Much more time was being spent in cChunk::CreateBlockEntities and cChunk::WakeUpSimulators than was in memcpy so I've made those significantly faster as well. Optimisations performed: * cSetChunkData now stores blocks in a cChunkData object * cChunkData objects can now perform moves even if they are using different pools * cChunk::CreateBlockEntities now iterates in the correct order and only over present chunk sections * Similarly for cChunk::WakeUpSimulators * cSetChunkData::CalculateHeightMap now shortcuts to the highest present chunk section before checking blocks directly
2018-02-04cChunk and cChunkData: Use vectors for block get and set functions (#4172)peterbell101-20/+45
* cChunkData: Change interface to use Vector3i * cChunk: Add Vector3i overloads for bounded block get and set functions.
2017-09-25BroadcastBlockBreakAnimation and BroadcastBlockEntity use vectors (#4038)Bond-0091-3/+3
2017-09-19Changed BroadcastSoundEffect, SendSoundEffect, and CastThunderbolt parameters to vectors (#3959)Lane Kolbly1-3/+3
* 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-38/+26
2017-09-02Revert "Replace ItemCallbacks with lambdas (#3948)"LogicParrot1-27/+39
This reverts commit 496c337cdfa593654018c171f6a74c28272265b5.
2017-09-01Replace ItemCallbacks with lambdas (#3948)peterbell101-39/+27
2017-08-21Fully implemented leashes (#3798)Pablo Beltrán1-0/+2
2017-08-07Changed entity ownership model to use smart pointersTiger Wang1-5/+10
2017-08-06Removed unneeded includes (#3902)Lukas Pioch1-2/+0
2017-08-03Remove double includes part 2 (#3890)peterbell101-1/+0
2017-08-03Removed unused forward declarations (#3888)Lukas Pioch1-11/+0
2017-07-07Added bed entity (#3823)Lukas Pioch1-0/+5
* 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-13FastRandom rewrite (#3754)peterbell101-2/+1
2017-05-22Store cChunk::m_BlockEntities in a map (#3717)peterbell101-2/+17
* Store block entities in a map from block index * Cleanup ForEachBlockEntity * Cleanup DoWithBlockEntityAt
2016-12-16Initial support for the 1.11 protocol.Mattes D1-1/+1
2016-10-12Spectators added (#2852)bibo381-0/+1
2016-10-09cChunk::SetAlwaysTicked implies cChunk::stay (#3361)LogicParrot1-1/+1
2016-09-03Configurable dirty unused chunk cap to avoid RAM overuse (#3359)LogicParrot1-0/+3
Configurable dirty unused chunk cap to avoid RAM overuse
2016-07-18Updated API documentation.Mattes D1-2/+2
2016-06-03Makes tall grass and large flowers bonemealableQUSpilPrgm1-0/+3
Adds the bonemeal particle effect to some more places
2016-06-03Update Dispensers and let them act more like in VanillaQUSpilPrgm1-6/+6
- 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-7/+0
2016-04-16Updated cChunk::SetMeta, fixed grass growth, reduced markDirty/setMeta usageLogicParrot1-4/+13
2016-04-05Improved player freeze codeLogicParrot1-1/+0
2016-02-19Proper entity destruction in non-ticking chunksLogicParrot1-3/+0
2016-02-02Fixed cChunk::m_Entities corruption upon world travelLogicParrot1-1/+4
2016-01-21Spiders now friendly at daylight, new cChunk functionsLogicParrot1-60/+89
2015-12-18Reorganised the redstone simulatorTiger Wang1-13/+1
-> Many thanks to @worktycho for the idea, and @Haxi52 for the implementation plan! * Uses classes and inheritance now * Speed should be improved
2015-12-13allow use failures to propagate from the entity/block to the playerGargaj1-1/+3
2015-11-24Add enum for Sound and Particle EffectsDave Tucker1-1/+1
Fixes #2603 Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2015-11-03Implemented brewingLukas Pioch1-0/+8
2015-09-19Fixed wrong assumtion regarding RemoveClienttycho1-3/+1
Remove client can be called with a client that is not present in the chunk
2015-09-18Removed a significant performance issue.tycho1-4/+9
Iterating through the list of clients in chunks was taking up a significant amount of time with larger numbers of clients due to processor stalls. Changing the data structure to a vector fixed the issue.
2015-06-10Reinstate "Chunk queue collapsing"Tiger Wang1-1/+0
This reinstates commit f36acb683594daff5af3971dcbe3c3a171628b78 and reverts commit adfbc42c021e1bcfcb355933c0fd784306ce0e18.
2015-06-07Revert "Chunk queue collapsing"worktycho1-0/+1
2015-06-05Moved Chunk Broadcasts over to the regular queuetycho1-1/+0
2015-05-09CheckBasicStyle: checks spaces around * and &.Mattes D1-2/+2
2015-05-07Added support for additional data in the ParticleEffect Packettycho1-3/+3
Also started refactoring how broadcasts are handled
2015-03-21Fixed signedness warnings in Protocol.Mattes D1-1/+1
2015-03-21Changed cEntity::m_UniqueID to UInt32.Mattes D1-2/+2
2015-01-11Initial convertion of a_Dt to std::chronoTycho1-1/+1
also refactored cWorld::m_WorldAge and cWorld::m_TimeOfDay
2014-10-23En masse NULL -> nullptr replaceTiger Wang1-24/+24
2014-10-20En masse NULL -> nullptr replaceTiger Wang1-24/+24
2014-10-19Fixed error with non-const functionJulian Laubstein1-1/+1
2014-10-15Functions in cPluginManager get references instead of pointers.Mattes D1-1/+1
2014-10-03Improved furnacesTiger Wang1-1/+1
* Fixed progress bar on 1.8 * Fixed bugs * Improved code * Fixes #1068 * Fixes #1070
2014-09-27Add data accessor.worktycho1-0/+1
2014-09-26Removed more unessicary includesTycho1-1/+5
2014-09-26Fixed issue with castingtycho1-2/+2
2014-09-16IncrementalRedstoneSimulator now has no dependencies on cChunkTycho1-10/+1
2014-09-11Possibly decoupled IncrementalRedstoneSimulator from the rest of the serverTycho1-8/+10
THis wil hopefully allow for unit testing
2014-09-111.8: Added ParticleEffect packet.Howaner1-1/+1
2014-09-06Removed chunk's unused Y coord.Mattes D1-2/+1
This fixes the second issue of #1313.
2014-09-05Rewritten chunk status to specify whether the chunk is in queue.Mattes D1-7/+37
This fixes #1370.
2014-09-03Added cWorld::ForEachEntityInBox()madmaxoft1-0/+4
2014-08-29cChunk: Fixed the Coords param.Mattes D1-1/+1
2014-08-29Rewritten block entity loading.Mattes D1-1/+1
Block entities are now loaded based on the blocktype at the coords they specify; before loading, their type ("id" NBT tag) is checked. The chunk now expects that all block entities given to it via cChunk::SetAllData() have their valid blocktype; asserts if they don't. Fixes #1354.
2014-08-28remove y-coord from chunksLO1ZB1-1/+1
2014-08-14CheckBasicStyle checks the src folder as well.madmaxoft1-1/+1
2014-08-05Refactored Redstone simulator not to depend on TNTEntity or DropSpenserENtity DirectlyTycho1-1/+5
2014-07-30Exported the beacon.Howaner1-0/+5
2014-07-24Removed redundant semicolons and re-added warningarchshift1-3/+3
2014-07-24Added a queue for setting chunk data.madmaxoft1-10/+4
Fixes #1196.
2014-07-21Style: Normalized to no spaces before closing parenthesis.madmaxoft1-6/+6
2014-07-17Fixed spaces around single-line comments.madmaxoft1-1/+0
There should be at least two spaces in front and one space after //-style comments.
2014-07-17Fixed basic whitespace problems.madmaxoft1-2/+2
Indenting by spaces and alignment by spaces, as well as trailing whitespace on non-empty lines.
2014-07-13Changed BroadcastSoundEffect function to take floating pos.Howaner1-1/+1
2014-07-10Fixed style consistency.madmaxoft1-2/+2
2014-07-10Implemented support for forced chunk ticking.madmaxoft1-4/+26
Fixes #1160.
2014-06-27Added generic entity-collecting.Mattes D1-1/+1
Now any cEntity can be collected, not only cPickups. This should help PR #1098.
2014-06-21Fixed invalid iteratorsTiger Wang1-1/+0
2014-06-16Merge branch 'master' of github.com:mc-server/MCServerTycho1-1/+2
2014-06-14Added generic Allocation Pool InterfaceTycho1-1/+1
2014-06-14fixed spacesTycho1-1/+1
2014-06-12Removed unnessicary indirection from Entity iterator listTycho1-1/+1
2014-06-12Portals animate and delay correctlyTiger Wang1-1/+1
2014-06-05Redstone fixes and improvements [SEE DESC]Tiger Wang1-1/+8
Haha, see desc. * Improved redstone speed through a marking dirty system. Only a select few devices are still continuously simulated * Fixed redstone crashing with recent piston changes
2014-05-31Implemented end and nether portalsTiger Wang1-0/+1
2014-05-25Hopefully fixed piston duplication issuesTiger Wang1-2/+2
* Fixes #879 * Fixes #714
2014-05-24Implemented style changesTycho1-2/+2
2014-05-23Implemented Allocation Pool use by cChunkDataTycho1-1/+2
2014-05-21Changed cChunkData::SetMeta to return a bool indicating whether the value changedTycho1-3/+3
2014-05-21Renamed cChunkBuffer to cChunkDataTycho1-6/+6
2014-05-10Fixed stupid errorTycho1-1/+1
2014-05-10Fixed bug in setting metasTycho1-1/+7
2014-04-27Redstone simulator now directly accesses cChunkTiger Wang1-5/+4
* Redstone simulator performance improvements * Added return values to some functions * Minor fixes
2014-04-26Implemented Chunk Sparsing with segmentsTycho1-16/+16
2014-04-25Implemented commentsTiger Wang1-4/+4
2014-04-18Fixed clang compilation errors. Apparently gcc and MSVC do not care about the order of initializer lists, but clang does.jfhumann1-1/+1
2014-04-18Did some static analysis, fixed some bugs and optimized a lot of codejfhumann1-1/+1
2014-04-07Maybe speed improvements?Tiger Wang1-1/+1
* Use a single index to determine from when to begin copying data * Use heightmap to determine first nonair block
2014-04-07Blocklight and skylight now compressedTiger Wang1-4/+4
2014-04-05Nibbletypes are compressedTiger Wang1-1/+1
+ Added nibble compression * Fixed an off by one
2014-04-04Speed and memory improvementsTiger Wang1-1/+1
* Changed array to be continuous, so no more layer splitting
2014-03-23Sort of implementation of chunk sparsingTiger Wang1-1/+1
Issues: * Chunks are flipped * Slow/inefficient/badly coded * Only blocktypes are 'compressed'
2014-03-07Add Lua Bindings for FlowerPotEntity.h and add documentation.Howaner1-2/+2
2014-03-07Add Flower PotsHowaner1-1/+6
2014-02-24Removed an unused member variable from cChunk.madmaxoft1-1/+0
2014-02-23Rename SkullEntity to MobHeadEntityHowaner1-4/+4
2014-02-23Add Heads completelyHowaner1-1/+6
2014-02-19Rename SkullEntity to MobHeadEntityHowaner1-4/+4
2014-02-18Add Heads completelyHowaner1-1/+6
2014-02-18Added cWorld:SetAreaBiome() API function.madmaxoft1-0/+8
Fixes #675.
2014-02-15Sizeable speed improvements to redstoneTiger Wang1-2/+12
+ Moved all simulator data into individual chunks * Cleaned up parameters for functions and some code * Fixed repeaters powering off faster than they power on The main issue before was that, although the redstone simulator stored blocks to be simulated in individual cChunks, other data, such as powered lists, and etcetera, were global regardless of which chunk was being simulated. Therefore, with worlds with lots of redstone, each tick saw the ticking of chunks, which themselves iterated through the entire dataset needlessly, creating LOTS of lag. Should be better now :)
2014-02-08Initial ChunkStay code.madmaxoft1-54/+56
2014-02-07Renamed cRedstoneManager to cRedstoneSimulator and renamed cRedstoneSimulator to cIncrementalRedstoneSimulator (Might change later).STRWarrior1-1/+1
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-18Basic command block implementationandrew1-6/+10
2013-12-30Fixed compilation in VC2008.madmaxoft1-23/+0
Also removed an unused inline header file (yuck).
2013-12-22merged in warnings changesTycho Bickerstaff1-23/+0
2013-12-22Implented BroadcastParticleEffectSTRWarrior1-0/+1
2013-12-15This adds the cWorld::BroadcastEntityEffect and cWorld::BroadcastRemoveEntityEffect functions.STRWarrior1-0/+2
2013-12-14Implemented note block playing and fixed wireTiger Wang1-1/+5
Game of Thrones music in Minecraft, here I come!
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-3/+4
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-11-30Changed cBlockHandler->OnUpdate() to use cChunk directly.madmaxoft1-3/+3
2013-11-24Moved source to srcAlexander Harkness1-0/+0
2013-11-20Added cWorld:ForEachBlockEntityInChunk() and cWorld:DoWithBlockEntityAt() functions.madmaxoft1-0/+6
Also exported them to the Lua API.
2013-11-18Redstone Megacommit [SEE DESC]Tiger Wang1-0/+3
+ Updated BlockID - look for yourself * Improved button, repeater, lever, and comparator code -> simplification and splitting of some stuff from the redstone simulator file * Fixed buttons not breaking when in an invalid game state * Fixed QueueSetBlock -> improved (AGAIN) piston code + Rewrote redstone simulator Fixes: #57, #58, #205, and part of #131. Fixes FS issues: 281, 116, and 102
2013-10-29Changes based on madmaxoft's nitpicker notes.Samuel Barney1-1/+1
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/+3
2013-10-27Added cChunk::UnboundedRelGetBlockLights().madmaxoft1-0/+5
This queries both BlockLight and SkyLight for the specified block.
2013-10-24Removed my hackish Light functionsSamuel Barney1-2/+0
2013-10-22Implemented UnboundedRel BlockLight and SkyLight.madmaxoft1-8/+15
Also unified the various UnboundedRel operations to use the same underlying structure.
2013-10-21Added two new unbounded del functions to deal with looking up the lighting.Samuel Barney1-0/+3
2013-09-08renaming the cChunk::getRandomBlock method + removing a buggy working logmgueydan1-1/+1
2013-09-08Adding an Empty shell that would launch mob spawner - not called yetmgueydan1-0/+8
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/+4
2013-08-19Added forgotten initialisationTiger Wang1-1/+1
2013-08-19Fixed uninitialised thingummiesTiger Wang1-1/+1
2013-08-19Moved entities into the Entities subfolder.madmaxoft1-1/+1
2013-08-19Removed an unused CriticalSection from cChunk.madmaxoft1-1/+0
Fixes #109
2013-08-18Implemented cWorld:QueueSetBlock(), as requested for delayed blocksetting.madmaxoft1-0/+24
Untested yet, so might not work.
2013-08-18Removed SetServerBlock griefing.madmaxoft1-2/+0
2013-08-18Properly fixed piston non-animationTiger Wang1-0/+2
Fixes #57
2013-07-07Improved function names for protocol packet sending; alpha-sorted the function listsmadmaxoft@gmail.com1-14/+16
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1659 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-13Added hopper entity, it can suck items out of chests, dispensers, droppers and other hopppers above it.madmaxoft@gmail.com1-2/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1587 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-12Added cWorld::SetSignLines(), re-exported to Lua manually to avoid ghost return valuesmadmaxoft@gmail.com1-1/+3
FS #364 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1582 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-04Implemented proper player crouching.madmaxoft@gmail.com1-1/+1
Fixes FS #365 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1553 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-28cChunk: Added the GetRelNeighborChunkAdjustCoords() functionmadmaxoft@gmail.com1-0/+7
Not only does it return the proper neighbor chunk, but also it adjusts the relative coords to be in that returned chunk. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1523 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-28Chunk / ChunkMap: Added support for unbounded querying blocktype-only or blockmeta-onlymadmaxoft@gmail.com1-0/+6
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1522 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-26Implemented droppersmadmaxoft@gmail.com1-0/+12
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-04-13Rewritten entities so that they are owned by individual chunks and ticked within their chunk's Tick()madmaxoft@gmail.com1-5/+12
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1385 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-04-01Proper fix for FS #347. Also unification of ticking block entities.madmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1348 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-03-22Fixed block update queueing and water meta change not propagated to clients.madmaxoft@gmail.com1-0/+3
Fixes FS #333. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1297 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-15Huge performance boost in blockhandlers, they have direct access to chunk data when blockchecking.madmaxoft@gmail.com1-14/+15
Also fixed vines' placement. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1278 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-03-14Small performance improvements in fluid simulator.madmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1276 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-03Simulators are woken up upon chunk loadmadmaxoft@gmail.com1-0/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1248 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-0/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1240 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-03-02Floody fluid simulator has been converted to use direct chunk accessmadmaxoft@gmail.com1-1/+7
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1236 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-15/+24
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-4/+18
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1227 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-01-12Merged branch "branches/hooks" into "trunk".madmaxoft@gmail.com1-2/+0
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-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-12-14cChunk now tracks its neighbors as direct pointers; used in UnboundedRelGetBlock et al.madmaxoft@gmail.com1-4/+13
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1073 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-10-21Top blocks are now snowed over, either normally, or in deep snow (patch contributed by funmaker, Luksor and Sebi)madmaxoft@gmail.com1-2/+3
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-19/+20
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-3/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@986 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-14Floody fluid simulator now dries up correctly, too.madmaxoft@gmail.com1-0/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@964 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-06BlockArea writing support (BlockTypes with BlockMeta only)madmaxoft@gmail.com1-0/+4
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-4/+3
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-25Added the block dig animation packet (patch contributed by l0udPL)madmaxoft@gmail.com1-0/+1
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-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@887 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-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-7/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@802 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/+2
2012-08-25cWorld doesn't use cPackets.madmaxoft@gmail.com1-0/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@789 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-25Removed cPackets from cChunk.madmaxoft@gmail.com1-4/+11
Also decoupled a possible deadlock in player login code. git-svn-id: http://mc-server.googlecode.com/svn/trunk@788 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-24cPickup doesn't use cPackets.madmaxoft@gmail.com1-0/+2
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/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@783 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-19Window, Chest, Furnace and Pawn are not using cPackets at allmadmaxoft@gmail.com1-1/+4
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/+6
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/+3
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-07-15A new Block handling system :olapayo94@gmail.com1-1/+0
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-02Leaves decay properly - if they are not connected to a logmadmaxoft@gmail.com1-1/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@644 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-17Removed the deprecated GetBlockEntity(), added several enumerators to replace it.madmaxoft@gmail.com1-1/+20
git-svn-id: http://mc-server.googlecode.com/svn/trunk@629 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-17Fixed leaves blockticking - must touch neighboring chunks, too, instead of self at wrong places.madmaxoft@gmail.com1-0/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@626 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-16Exported cWorld::ForEachEntity and cWorld::ForEachEntityInChunk; no idea if they actually workmadmaxoft@gmail.com1-1/+4
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-271/+271
git-svn-id: http://mc-server.googlecode.com/svn/trunk@606 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-09Cacti grow by themselves and by bonemealmadmaxoft@gmail.com1-0/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@583 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-08Sugarcane grows and can be grown using bonemeal.madmaxoft@gmail.com1-0/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@578 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/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@573 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-07BlockChecking split into a separate functionmadmaxoft@gmail.com1-1/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@571 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-06Grass spreads to adjacent dirt blocks. Doesn't check dest light yet.madmaxoft@gmail.com1-0/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@563 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-30Added support for SetNextBlockTick() function callable from Luamadmaxoft@gmail.com1-0/+8
git-svn-id: http://mc-server.googlecode.com/svn/trunk@527 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-30Fixed blocktick distributionmadmaxoft@gmail.com1-12/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@525 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-30Farmland gets hydrated and dehydrated. Fixed an off-by-one error in neighbor-chunk manipulation.madmaxoft@gmail.com1-0/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@522 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-8/+14
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-24/+35
git-svn-id: http://mc-server.googlecode.com/svn/trunk@504 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-2/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@454 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-16That didn't work.. I forgot some cChunk functions were changed. Now it should compile againfaketruth1-0/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@417 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-14Unified the chunk data to use the BLOCKDATA datatype.madmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@413 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-14Split chunk data into separate arrays; decoupled most sources from cChunk.h dependencymadmaxoft@gmail.com1-168/+47
git-svn-id: http://mc-server.googlecode.com/svn/trunk@411 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-13Small optimizations in the SetNibble() and GetNibble() functions; removed unused lighting functions from cChunkmadmaxoft@gmail.com1-3/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@408 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-10Completely integrated the new axis ordering. Will update worlds accordinglyfaketruth1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@396 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-10Was using "#else if" which is not valid apparently, now using "#elif"faketruth1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@391 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-10You can change axis ordering by setting AXIS_ORDER to AXIS_ORDER_XZY in cChunk.h !THIS WILL SCREW UP YOUR WORLDS THOUGH!faketruth1-13/+22
Still need to update world storage schemes, converters and such git-svn-id: http://mc-server.googlecode.com/svn/trunk@390 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-10Using more of the index functions in cChunk, so it should be easy enough to flip the axis ordering nowfaketruth1-4/+31
Added some more functions that use Vector3i for block coordinates in cChunk git-svn-id: http://mc-server.googlecode.com/svn/trunk@389 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-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-6/+9
git-svn-id: http://mc-server.googlecode.com/svn/trunk@365 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-04Should have complete support for 256 blocks high worlds. Old save files are converted to new ones at load.faketruth1-1/+1
BACK UP YOUR WORLD! git-svn-id: http://mc-server.googlecode.com/svn/trunk@358 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-04The world can now truly be made higher by incrementing cChunk::c_ChunkHeight to 256. !!HOWEVER THIS WILL DESTROY YOUR SAVED WORLD!!faketruth1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@357 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-04Changed signed char to unsigned char in block packets, so we can receive height up to 255faketruth1-1/+2
Blocks placed above 128 limit don't become obsidian anymore. This was due to the cChunk::MakeIndex() function return 0 when outside of bounds, it now returns an 'error constant' git-svn-id: http://mc-server.googlecode.com/svn/trunk@356 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-03Got rid of some hardcoded numbers, now using hardcoded variables! woofaketruth1-4/+6
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-0/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@345 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-28Server uses ~40% less CPU nowfaketruth1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@339 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-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/+6
git-svn-id: http://mc-server.googlecode.com/svn/trunk@330 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-23Plain pointer cChunkPtr finishing touches; removed cChunk's critical sectionsmadmaxoft@gmail.com1-14/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@325 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-23Made cChunkPtr a plain old pointer again, since it's safe nowmadmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@324 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-23cChunk: removed unused codemadmaxoft@gmail.com1-2/+0
git-svn-id: http://mc-server.googlecode.com/svn/trunk@323 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-21Removed cChunkPtrs from everywhere but internal cChunkMap usage. Now we should finally be threadsafe :)madmaxoft@gmail.com1-2/+8
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-3/+4
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-2/+24
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-1/+16
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-3/+6
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-1/+1
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-17Chunk coords mostly "upgraded" to include the Y coord for future compatibilitymadmaxoft@gmail.com1-2/+12
git-svn-id: http://mc-server.googlecode.com/svn/trunk@285 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-4/+4
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-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/+49
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/+2
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-10/+9
git-svn-id: http://mc-server.googlecode.com/svn/trunk@261 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-36/+93
git-svn-id: http://mc-server.googlecode.com/svn/trunk@251 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-08Removed unused codemadmaxoft@gmail.com1-3/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@249 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-2/+12
git-svn-id: http://mc-server.googlecode.com/svn/trunk@245 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-29Old code begone! ChunkMap cleanupmadmaxoft@gmail.com1-2/+0
git-svn-id: http://mc-server.googlecode.com/svn/trunk@189 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-19Terrain generation is synchronous again, async generation has bugs.faketruth1-2/+2
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-0/+5
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-31Made a couple of functions in cChunk inline, this should speed up several block operations on chunksfaketruth1-1/+14
Players should not spawn in the ground anymore. When an entity was added to cWorld twice (which shouldn't happen actually), the server would crash when the entity is destroyed, this should be fixed now. git-svn-id: http://mc-server.googlecode.com/svn/trunk@158 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-26 - Linux compatible fixes including updated makefilemtilden@gmail.com1-1/+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-26Moved the actual world generation from cChunk.cpp to a more isolated file cWorldGenerator.cppfaketruth1-15/+7
New generators should inherit cWorldGenerator and implement their own generation algorithms git-svn-id: http://mc-server.googlecode.com/svn/trunk@117 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-26Made some functions in cChunk and cNoise inline, this should significantly increase chunk generation speedfaketruth1-1/+6
git-svn-id: http://mc-server.googlecode.com/svn/trunk@115 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-22Digging leaves with shears now drops leaveslapayo94@gmail.com1-0/+2
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-10-31Prepared some parts of the code for multi world support, I created lots of TODO'sfaketruth1-4/+7
git-svn-id: http://mc-server.googlecode.com/svn/trunk@29 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-10-21Compiles for linuxfaketruth1-1/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@6 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-10-03MCServer c++ source filesfaketruth1-0/+127
git-svn-id: http://mc-server.googlecode.com/svn/trunk@3 0a769ca7-a7f5-676a-18bf-c427514a06d6