summaryrefslogtreecommitdiffstats
path: root/src/Entities/Entity.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2023-09-27Update Minecraft Wiki links to new domain (#5532)Spongecade1-1/+1
* Update Minecraft Wiki links to new domain * Added Spongecade to contributors * Sorted Spongecade
2022-02-08Spectation: keep track of spectatorsTiger Wang1-0/+9
+ Keep a list of spectators so that pointer clean-up can happen when the spectated is killed. * Fix invalid game state when riding/spectating and then entering or leaving spectator mode.
2021-10-02Snipe skeleton achievmentRorkh1-2/+2
2021-09-30Spectation: add dedicated pathway for spectator mode (#5303)Tiger Wang1-6/+9
* Spectation: add dedicated pathway for spectator mode + Sync player rotation with spectated entity. + Add dedicated infrastructure to cPlayer for handling spectation, instead of misusing entity riding. * Avoid infinite recursion when exiting spectation, fixes #5296 * AttachTo: Change parameter to reference
2021-06-19Death messages for tamed pets and ocelots are now tamable. (#5243)TheHyper451-0/+2
* Fixing bugs regarding wolfs and ocelots * Death messages appear after killing tamed ocelots and wolfs * Style fix * Added myself to the CONTRIBUTORS file * Removed redundant string initialization * Removed an unsafe cast. * Changed the order of initialization of fields in constuctor of class cOcelot
2021-04-21Resets ticks alive on death (#5197)12xx121-1/+1
* resets ticks alive on death * updated the comment in the .h file
2021-04-12Unify multiprotocol entity animationsTiger Wang1-41/+0
2021-04-12Update entity sizesTiger Wang1-9/+12
2021-04-03Basic elytra flight (#5124)Damián Imrich1-16/+13
* Basic elytra flight Co-authored-by: 12xx12 <44411062+12xx12@users.noreply.github.com> Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2021-02-07Fix #5118Tiger Wang1-11/+0
2021-01-22Implementation of totem of undying behaviour (#5111)Damián Imrich1-0/+2
* notchian totem of undying * ... * .... * Update src/Entities/Pawn.cpp Co-authored-by: Alexander Harkness <me@bearbin.net> * DeductTotem func * fixed build errors * Added myself to CONTRIBUTORS * Small changes Co-authored-by: Peter <peter@cassoviacode.com> Co-authored-by: Alexander Harkness <me@bearbin.net> Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2021-01-12Clarify cClientHandle, cPlayer ownership semanticsTiger Wang1-10/+2
+ 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-02Fix potential destruction crashes (#5095)Tiger Wang1-7/+2
* Fix potential destruction crashes * Fix destructors accessing destroyted objects * Fix cPlayer not destroying windows (Destroyed never called) * Tentatively fixes #4608, fixes #3236, fixes #3262 - Remove cEntity::Destroyed() and replace with cEntity::OnRemoveFromWorld() * Add missing call to OnRemoveFromWorld
2020-11-25Added magma block contact damage (#5055)Aiden Neill1-0/+3
* Added magma block contact damage * Fireproof entities do not take damage from magma * Fire resistance prevents magma damage * No magma damage when hovering over magma block
2020-09-25Do not call into things we don't own in destructorsTiger Wang1-3/+0
- Remove improper accesses in cChunk destructor * Fixes #4894
2020-09-12Use tracing for explosions (#4845)Tiger Wang1-0/+1
* TNT: Implement tracing algorithm + Add intensity tracing * Fix iterating over all players to SendExplosion, even those not in range * Implemented TNT entity interaction * Fixed misaligned destruction tracing * Finalise TNT algorithm - Remove BlockArea and just use chunks Using SetBlock makes it so that we can update everything properly, and does appear to be faster. * BlockInfo learns about explosion attentuation * Rename Explodinator parameters * TNT: pull block destruction into common function Co-authored-by: Alexander Harkness <me@bearbin.net>
2020-05-10Cleanup unneeded globals (#4736)peterbell101-1/+1
2020-05-04Improve entity position updates (#4701)Tiger Wang1-1/+5
* 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-05-03Buttons can now be triggered by arrows. (#4670)DrButcher1-0/+1
* Buttons can now be triggered by arrows.
2020-05-03Add cEntity::GetBoundingBox, and use where appropriate. (#4711)Alexander Harkness1-0/+3
* Add cEntity::GetBoundingBox, and use where appropriate.
2020-04-18MoveToWorld must always be provided a worldTiger Wang1-4/+4
2020-04-18Only store IDs across ticksTiger Wang1-3/+3
2020-04-16Using Super.Mattes D1-2/+2
2020-03-31Prevent player from being destroyed by plugins (#4584)Alexander Harkness1-6/+2
* Prevent player from being destroyed by plugins Add manual binding, bails out with error message if attempted entity to destroy is player. * Improve warnings and documentation, remove automatic binding * Remove old and unnecessary deprecated function
2020-03-24Send respawn packet by default (#4540)Mat1-2/+2
2020-03-22Fix armor protection (#4506)Mat1-2/+2
* Fix armor protection * Check min damage * Check min damage * Commit missing changes * Convert to int * Use float * Float some more
2020-03-07Don't send entity velocity for boats (#4488)Mat1-4/+4
* Don't send entity velocity for boats
2020-03-05Stabilise MoveToWorld (#4004)Mat1-14/+59
* 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-09-29Refactored more of Entities and BlockEntities to use Vector3. (#4403)Mattes D1-1/+5
2019-08-11Fix building with clang 8.0 (#4346)Bond-0091-4/+6
2019-08-08Change TakeDamageInfo::FinalDamage from int to float (#4359)Aplaus2281-2/+2
Closes #4357
2018-07-24Broadcast refactor (#4264)peterbell101-1/+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-23cPawn: Reset last ground height in ResetPosition (#4261)peterbell101-1/+1
Prevents fall damage after teleporting/portaling to a lower height. Fixes #3457
2018-07-23Rewrite explosion knock back (#4251)changyong guo1-1/+10
1. Base knockback on an entity's bounding box intersection with the explosion 2. Armor blast protection reduces knockback 3. Don't apply knockback to players flying in creative mode Fixes #4139
2018-06-24Support swap item between main hand and offhand by press key "F" (#4241)changyong guo1-0/+3
Hi, I found cuberite don't support to press key "F" to swap items on main hand and offhand, so I implemented this feature. Best regards Changyong
2018-04-11Update m_LastSentPosition in TeleportToCoords and DoMoveToWorld. (#4211)peterbell101-0/+4
2018-01-14Rename cEntity swim states (#3996)Alexander Harkness1-11/+23
* Replace cEntity:m_IsSubmerged with m_IsHeadInWater * Replace cEntity:m_IsSwimming with m_IsInWater * Add API documentation for new symbols * Apply SetSwimState to all entities, not just mobs and players * Pickups now use IsOnFire to check if they are on fire before destruction Fixes #3987
2017-11-22Store Health as a float (#4073)Fabian1-6/+6
* Fix #4024 * Fix clang error * Add comment * Fix behaviour * Save Health as float * Changed m_Health to float * Remove redundant static_cast * Fix casts
2017-09-12Adjust lava damage values (#4020)Alexander Harkness1-1/+1
Fixes isue #2925
2017-09-07Updated APIDoc (#3985)Lukas Pioch1-3/+4
2017-09-07Changed some int parameters to vector parameters (#3937)Bond-0091-1/+1
2017-08-30Protocol Spawn Position Should Use LastSentPosition (#3929)Lane Kolbly1-0/+4
+ Added GetLastSentPos * Fixed spawn position bug in 1.8.
2017-08-30Added ShouldSendRespawn parameter to ScheduleMoveToWorld (#3979)Lane Kolbly1-1/+2
2017-08-24Minor changes (#3909)mathiascode1-1/+1
2017-08-21Fully implemented leashes (#3798)Pablo Beltrán1-1/+19
2017-08-07Changed entity ownership model to use smart pointersTiger Wang1-3/+1
2017-08-03Remove double includes part 2 (#3890)peterbell101-1/+0
2017-07-28Check for intersection between placed blocks and entities. (#3850)Lane Kolbly1-0/+3
* Check for intersection between placed blocks and entities. + Implemented GetPlacementCollisionBox, to permit custom placement collision boxes for blocks. * Factored block-entity placement checking into another function in cPlayer. - Removed vector min/max functions * Use GetWorld to get the world in DoesPlacingBlocksIntersectEntity. + Added block height checks, allow different cEntity subclasses to decide whether they will prevent block placement.
2017-07-23Updated armor cover calculation. (#3858)Lane Kolbly1-2/+8
* Updated armor damage calculation. + Added lua docs, added casts from float to int. * Changed verbage in docstring and comment.
2017-06-15Entity: Replaced a mutexed counter with a std::atomic. (#3773)Mattes D1-4/+6
2017-04-01Added a nullptr check to cEntity::IsA (#3659)Marvin Kopf1-1/+1
Fixes #3603
2016-12-10Export GetPosition and GetSpeed from cEntity as a copy instead of a pointer to lua.Lukas Pioch1-2/+6
2016-10-12Spectators added (#2852)bibo381-1/+1
2016-07-18Updated API documentation.Mattes D1-3/+7
2016-07-18Fixes for boat entities (#3265)beeduck1-0/+3
protocol for vehicles now properly handled, protocol for boat paddles now properly handled, boats can no longer spawn underwater, boats now properly float, boat metadata now properly broadcasted.
2016-06-02Fixed fall damageTiger Wang1-1/+1
* Fixes #3216
2016-05-03Fixed death on teleportation or leaving Minecart (#3181)LogicParrot1-1/+1
2016-03-30MoveToWorld defaults to spawnpointLogicParrot1-2/+2
2016-02-19Proper entity destruction in non-ticking chunksLogicParrot1-16/+29
2016-02-02Fix cPawn pushingMarvin Kopf1-0/+3
cPawn instances can no longer push an entity they are attached to. cEntity now has a IsAttachedTo method.
2016-01-22Improved tamed wolf pack cooperation and projectile reactionsLogicParrot1-0/+3
2016-01-21Spiders now friendly at daylight, new cChunk functionsLogicParrot1-1/+0
2015-11-29implement breedingGargaj1-0/+2
2015-11-05Destroy an ender crystal, damage a dragon when hit by an egg.Alexander Harkness1-88/+88
2015-10-31Implemented the FireResistence potion effects.bibo381-1/+1
This not only provides fire resistence, but also prevents blaze fireballs. See #2556
2015-08-20Fixed food drain bugsTiger Wang1-22/+22
2015-07-31Unified the doxy-comment format.Mattes D1-66/+65
2015-06-13Work on NetherPortalScanner. Setup portal scanner to reset PortalCooldown. Changed where player is spawned. Added a_InitSpawn flag to CreateAndInitializeWorld.Lane Kolbly1-11/+12
2015-06-10Implemented nether portal scanning code.Lane Kolbly1-8/+18
2015-05-24Made -Weverything an error.tycho1-2/+2
2015-05-09More style checking.Mattes D1-2/+2
Spaces around some operators are checked.
2015-03-31Changed air drag units to 'interpolated ticks' per secondDevToaster1-2/+4
2015-03-31Modified physics for more vanilla-like behaviorDevToaster1-0/+8
2015-03-21Changed cEntity::m_UniqueID to UInt32.Mattes D1-3/+10
2015-02-07cPlayer should override IsOnGround()Howaner1-2/+2
2015-02-07Added IsOnGround() to cEntityHowaner1-0/+3
2015-01-11Initial convertion of a_Dt to std::chronoTycho1-2/+2
also refactored cWorld::m_WorldAge and cWorld::m_TimeOfDay
2014-10-23En masse NULL -> nullptr replaceTiger Wang1-96/+100
2014-10-20En masse NULL -> nullptr replaceTiger Wang1-7/+7
2014-10-19LuaState: Pushing a cEntity pushes the correct class name.Mattes D1-5/+5
This makes Lua scripts easier, as they don't need to cast values from cEntity to the specific descendant.
2014-10-12convert old style casts to fix warningsSteven Riehl1-94/+90
2014-10-09Float/Ciel: If it's going to use C++11, it might as well take advantage of itarchshift1-3/+3
2014-10-09Use static casts instead of C casts, add floor-cast functionsarchshift1-3/+3
2014-09-13Entities experience water resistanceTiger Wang1-0/+6
2014-09-04Revert "Globals.h: Added Floor and Ciel casting, C++ cast cleanups, etc"archshift1-3/+3
This reverts commit 472efa8174626a00ffdf5b39e1a44ac419cd3698. Apparently we don't support some of these features quite yet (darn you C++98!)
2014-09-04Globals.h: Added Floor and Ciel casting, C++ cast cleanups, etcarchshift1-3/+3
Snow Golems must also be above 64Y to spawn snow (as of 1.8).
2014-09-01Added name tagHowaner1-1/+1
2014-07-30Entity.h: Moved constants out of some unnamed enumarchshift1-14/+14
2014-07-24Removed redundant semicolons and re-added warningarchshift1-1/+1
2014-07-23SuggestionsTiger Wang1-3/+5
2014-07-22Speed improvements, crash fixes, & self-suggestionsTiger Wang1-2/+4
2014-07-21SuggestionsTiger Wang1-9/+21
2014-07-20Bug and crash fixesTiger Wang1-6/+9
* 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-20Added m_TicksAlive to entities, allows projectiles to hit their creatorsarchshift1-0/+6
2014-07-17Fixed tabs used for alignment.madmaxoft1-1/+1
2014-07-17Basic style fixes.madmaxoft1-1/+1
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-04Tailored death messagesTiger Wang1-1/+1
2014-06-22Some Entity.cpp style improvementsTiger Wang1-2/+2
2014-06-21Fixed invalid iteratorsTiger Wang1-1/+9
2014-06-17Cave spider now poisons its victim, added IsPawn function to Entityarchshift1-0/+1
2014-06-17Player: made healing instantaneousarchshift1-1/+1
2014-06-16Merge branch 'master' of github.com:mc-server/MCServerTycho1-10/+25
2014-06-16Implemented PR suggestionsarchshift1-1/+1
Furnace.txt: newline BlockID: removed extraneous dimension mapping cEntity: fixed typo cPlayer: WorldPtr typedef
2014-06-14Removed an unused tolua_end and tolua_begin pair.madmaxoft1-2/+0
2014-06-14Refactored speed-setting to use a common function for all cases.madmaxoft1-16/+23
2014-06-14Reverted portal creation codeTiger Wang1-3/+0
It wasn't really working and needs more development
2014-06-12Portals animate and delay correctlyTiger Wang1-2/+8
2014-06-11Player.h: Moved doxy-comments to Entity.harchshift1-0/+7
Moved doxy-comments to the defining function in Entity.h rather than the overloaded functions in Player.h Comment for each function (instead of assumed encapsulating comments) @deprecated tag for ForceSetSpeed()
2014-06-10Portal improvements and suggestionsTiger Wang1-0/+3
2014-06-08Fixed deadlock when moving players to other worlds.Mattes D1-2/+3
Fixes #1039, fixes #851
2014-06-08Added queue for adding entities to cWorld.Mattes D1-2/+3
This alone doesn't work properly yet, further changes to cPlayer are needed.
2014-05-31Implemented end and nether portalsTiger Wang1-0/+6
2014-05-22cEntity::SetSpeed(a_Vector3d) isn't virtualized anymoreSTRWarrior1-1/+1
2014-05-22cPlayer overrides the SetSpeedXX functionsSTRWarrior1-3/+3
Fixed compile error
2014-05-22Both SetSpeed functions are now overridden by cPlayerSTRWarrior1-5/+8
2014-05-18Implemented cacti damageTiger Wang1-0/+3
+ Implemented cacti damage * Fixed pickup tossing (PR #994 bug)
2014-05-12cEntity::Killed(cEntity *) Handler; Achievement triggers; cPlayer::AwardAchievement()andrew1-0/+3
2014-05-02A bit of reformatting.madmaxoft1-5/+10
2014-04-27More comments!Tiger Wang1-2/+9
* Also fixed a potential issue with position sending - if someone moved slowly enough, their position would never be updated.
2014-04-26Further refactored, Reverted Minecart changearchshift1-1/+1
Other small changes.
2014-04-26FixesHowaner1-10/+13
2014-04-26Moved switch{} out of GetArmorCoverAgainst().archshift1-0/+3
2014-04-26Change m_InvulnerableTicks description again again :DHowaner1-1/+1
2014-04-26Change m_InvulnerableTicks description again.Howaner1-1/+1
2014-04-26Change m_InvulnerableTicks descriptionHowaner1-1/+1
2014-04-26Add entity invulnerableHowaner1-4/+13
2014-04-23Some change to Entity.cppTiger Wang1-7/+4
* Added comments to BroadcastMovementUpdate() and the collision tracer
2014-04-23Renamed getter and setter for IsFireproof.archshift1-2/+2
2014-04-23Fireproof status getter and setter.archshift1-0/+5
2014-04-22Fixed indentation and changed m_Fireproof to m_IsFireproof.archshift1-2/+2
2014-04-22Lay foundation for fireproof entities.archshift1-0/+3
Prevent any entities with the m_Fireproof flag from taking fire or lava damage.
2014-04-17Added new AI rulesTiger Wang1-1/+2
+ Added new AI rules handling cacti and large heights * Fixed cIniFile not recognising comments in cIniFile::ReadFile() * Fixed users.ini not being properly generated * Changed all instances of (int)floor(GetPosXXX()) to POSXXX_TOINT
2014-04-12Entities handle chunks properly againTiger Wang1-15/+36
* Entities properly handle chunks * Changed EntityStatus enums to be less shouty
2014-04-03Documented the units and range for entity rotations.madmaxoft1-7/+7
2014-03-25Ender crystalsandrew1-11/+13
2014-03-11Unified Vector classesandrew1-3/+1
2014-03-05Added extra awesomeness to TNTTiger Wang1-0/+1
+ TNT now has a chance of flinging FallingBlock entities around * Improved TNT damage * Improved TNT spawning visuals * Possible fix for 'SetSwimState failure' messages in debug
2014-02-18Implemented paintings, fixes #689Tiger Wang1-0/+2
+ Implemented paintings
2014-02-18Implemented item frames, a part of #689Tiger Wang1-0/+2
+ Implemented Item Frames * Fixed Pitch and Yaw being wrongly flipped in the protocol (XOFT!)
2014-02-03Fixed compilationtonibm191-1/+0
2014-02-03Exporded World:FindClosestPlayer, Item:IsEnchantable and Monster:MoveToPosition to Lua APItonibm191-0/+1
2014-01-25Implemented fall damage for mobsTiger Wang1-0/+5
+ Implemented mobile fall damage * Formatting fixes + Defined new Position->Integer macros
2014-01-25All mobs now drown (fixes #54)Tiger Wang1-1/+22
* Implemented mob drowning * Iron Golems and squids are excluded
2014-01-24Removed unused ReferenceManagerTiger Wang1-9/+1
2014-01-17Removed internal cEntity::GetRot() usage.madmaxoft1-2/+2
2014-01-16Removed obsoleted functionsTiger Wang1-3/+1
2014-01-15OBSOLETE'd obsolete functionsTiger Wang1-2/+2
2014-01-13Detaching improvementsTiger Wang1-1/+1
* Players now search for an area around themselves to teleport to when detaching from something
2013-12-30Fixed compilation in VC2008.madmaxoft1-2/+4
Also removed an unused inline header file (yuck).
2013-12-22merged in warnings changesTycho Bickerstaff1-4/+10
2013-12-22converted commneted paramater names to the unused macroTycho Bickerstaff1-3/+7
2013-12-21ChunkSender is now warnings cleanTycho Bickerstaff1-4/+4
2013-12-20Sorted a few constructors to remove warnings.madmaxoft1-1/+1
2013-12-19Added cFloater class.STRWarrior1-0/+3
2013-12-16Added HandleSpeedFromAttachee so an entity can override the function.STRWarrior1-0/+1
2013-11-24Moved source to srcAlexander Harkness1-0/+0
2013-11-03Added cEntity:GetYaw() and cEntity:SetYaw().madmaxoft1-2/+4
This is the preferred way to get / set rotation, GetRotation() and SetRotation is obsoleted due to bad name.
2013-10-13Eight round of fixesTiger Wang1-13/+8
* Changed IsA() to *long if statement* - Removed deprecated values in Entity.h - to blazes with the plugins! * Renamed villager type enumerations to be LESS SHOUTY and more vt-y + Use vtMax for World.cpp testificate spawning
2013-10-09Second round of fixesTiger Wang1-66/+1
* Implemented suggestions
2013-10-08Initial round of fixesTiger Wang1-17/+27
* Fixed intentional misspelling of baby! :D * Better chested horse bool name * Fixed some weird continuity issues with my recent changes not being pushed up initially * Fixed derpy hexadecimal values
2013-10-08Initial Metadata Commit [SEE DESC]Tiger Wang1-0/+63
+ Pigs, Minecarts, Sheep, Skeletons, Slimes, Villagers, Wolves, and Horses have metadata + Base code on taming wolves, shearing sheep, and taming horses + Sheep and horses have different colours when spawned
2013-10-08Cleaned up cEntity's enums.madmaxoft1-23/+20
Several were obsoleted and unused, others weren't supposed to be exported to the Lua API.
2013-09-27Fixed a typo in cEntity doxycomments.madmaxoft1-4/+4
2013-09-11Added void damageTiger Wang1-0/+6
2013-09-08Fixed a bunch of stuffTiger Wang1-0/+2
* Fixed compilation * Made it less obvious I COPIED ALL THE CODE from Minecarts * Fixed alignment spaces to make xoft happy
2013-09-07Arrows have proper yaw and pitch when shot, and stop when they hit a block.madmaxoft1-0/+6
2013-09-06Implemented SteerVehicle packet.madmaxoft1-0/+2
2013-09-06Implemented SteerVehicle packet.madmaxoft1-0/+2
2013-09-03Added cEntity's gravity to the Lua API.madmaxoft1-0/+4
2013-08-29Implemented xoft's suggestions [SEE DESC]Tiger Wang1-3/+3
Rail metas are now in BlockID and exported to LUA Minecart now does a SetMass, instead of m_Mass Minecarts use SubType instead of TypeType
2013-08-27Preliminary Minecart physics handling [SEE DESC]Tiger Wang1-3/+3
This commit includes physics handling for the following scenarios: Flat rails in orientations [N, S, W, E] Ascending/descending rails in orientations [N, S, W, E] Powered rails are NOT handled (they don't respond to redstone). Curved rails are NOT handled (I haven't figured out how to do them :P) Please note that I have not tried to emulate vanilla behaviour because of a lack of knowledge on velocity unites/C++. We can say it's a feature or something. :P
2013-08-27Entities fall 3x slower in watermadmaxoft1-1/+1
2013-08-22Added skeleton code for projectile spawning.madmaxoft1-3/+3
2013-08-22Removed unwanted VirtualHooks remnants.madmaxoft1-2/+1
cEntity no longer needs its SpawnOn() default-implemented, it can now be a true pure virtual function.
2013-08-19Moved entities into the Entities subfolder.madmaxoft1-3/+3
2013-08-08Addeed OnSpawningEntity, OnSpawnedEntity, OnSpawningMonster, OnSpawnedMonster hooks.madmaxoft1-1/+2
As requested in FS 418.
2013-07-07Mobs are assigned MaxHealth from monsters.ini; reading monsters.ini doesn't need settings.ini values anymore.madmaxoft@gmail.com1-1/+4
Fixes FS #409. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1662 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-07-01Added DamageType translation to APImadmaxoft@gmail.com1-42/+0
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1639 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-07-01Rewritten entity-on-fire management ("forever on fire" bugs)madmaxoft@gmail.com1-15/+189
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-25Unified the way mobs are spawned (egg vs natural). Fixed deadlocks in mob moving. Fixed mob destroying code.madmaxoft@gmail.com1-1/+2
Should fix FS #400 and partially fix FS #381 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1626 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-15Entity: Added IsTNTnielsbreu@gmail.com1-0/+1
Once again I wasn't paying attention.. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1594 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-04cEntity: fixed doxy commentsmadmaxoft@gmail.com1-4/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1551 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-21Added basic functions for width and height for Entitieskeyboard.osh@gmail.com1-11/+19
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1498 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-19Fixed entity chunking.madmaxoft@gmail.com1-2/+2
Sand simulator was off, sand in negative coords wouldn't fall properly git-svn-id: http://mc-server.googlecode.com/svn/trunk@1489 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-04-28Entity: fixed mass declarationmadmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1432 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-04-28cEntity: Added mass to entities.keyboard.osh@gmail.com1-0/+9
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1430 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-04-22Moved physics to the cEntity class from the derivative classes (cMonster, cPickup). Added physics override to cPlayer to disable physics calculations. Fixed bug with pitch calculations on mobs.keyboard.osh@gmail.com1-1/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1400 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-04-18Initial implementation of explosions and TNT blockkeyboard.osh@gmail.com1-0/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1392 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-21/+15
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1385 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-04-02Added support for head yaw tracking and packet sending and fixed bug in BroadcastMovementUpdatekeyboard.osh@gmail.com1-0/+7
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1350 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-03-23Added helper functions AddSpeed, AddSpeedX, AddSpeedY, AddSpeedZ, AddPosition, AddPosX, AddPosY, AddPosZ. Made sure that all entites use these helper functions.keyboard.osh@gmail.com1-1/+10
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1299 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-03-22Implemented BroadcastMovementUpdate function. Moved m_Pos,m_Rot,m_Speed to private members and made sure that all classes uses the public functions to access these members.keyboard.osh@gmail.com1-7/+25
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1294 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-03-09Pickups are now being saved into Anvil.madmaxoft@gmail.com1-23/+27
Also changed cEntity rotation datatype to double git-svn-id: http://mc-server.googlecode.com/svn/trunk@1262 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-03-03Player can sit in minecarts (but not move them yet)madmaxoft@gmail.com1-2/+20
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1249 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-03-01Previous commit was missing the Entity.h filemadmaxoft@gmail.com1-4/+8
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1232 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-27Minecart entity now supports IsA() self-identificationmadmaxoft@gmail.com1-4/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1225 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-21Moved the Speed member into cEntity class instead of its descendants.madmaxoft@gmail.com1-2/+12
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1222 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-18Minecarts can now be placed.madmaxoft@gmail.com1-0/+1
No interaction, no physics, though. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1219 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-10Removed useless logging from cEntity::GetLookVector()madmaxoft@gmail.com1-9/+9
Requested by STR_Warrior http://forum.mc-server.org/showthread.php?tid=434&pid=6368#pid6368 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1205 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-03Added a GetClassStatic function to all entities, as well as cFurnaceEntity, cChestEntity and cWorldfaketruth1-25/+7
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-01-12Merged branch "branches/hooks" into "trunk".madmaxoft@gmail.com1-4/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1139 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-22MTRand reference is now passed as a Tick() parameter so that it isn't created and destroyed over and over again. All entities will handle physics (empty callback for now)madmaxoft@gmail.com1-1/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1096 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-21Added more constants into eEntityType; made them a compulsory parameter to the constructor, so that all entities have proper type.madmaxoft@gmail.com1-9/+21
Also added a few utility functions to cEntity for distinguishing the types (IsPlayer(), IsPickup() etc.) git-svn-id: http://mc-server.googlecode.com/svn/trunk@1092 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-21Reworked the IsA() / GetClass() framework to actually be useful. Added GetParentClass().madmaxoft@gmail.com1-17/+39
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1090 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-21Replaced "const double &" with plain "double" for simplicitymadmaxoft@gmail.com1-26/+26
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1085 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-24Source files cleanup: The rest of the files renamed.madmaxoft@gmail.com1-0/+0
git-svn-id: http://mc-server.googlecode.com/svn/trunk@887 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-1/+0
git-svn-id: http://mc-server.googlecode.com/svn/trunk@802 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-28Moved all packet-serializing code into cProtocol125; half the packet classes aren't needed anymore.madmaxoft@gmail.com1-0/+10
git-svn-id: http://mc-server.googlecode.com/svn/trunk@800 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-3/+6
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-19/+31
git-svn-id: http://mc-server.googlecode.com/svn/trunk@762 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-14Attempt to bring sanity to newlines across systems.cedeel@gmail.com1-148/+148
git-svn-id: http://mc-server.googlecode.com/svn/trunk@606 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-04-11Moved the commands /coords /viewdistance and /regeneratechunks from cServer.cpp to the Core pluginfaketruth1-3/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@457 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-24Reverted the previous commit - it is useless, since entities still depend heavily on cWorldmadmaxoft@gmail.com1-3/+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/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@427 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-09cClientHandles have a unique ID now to distinguish themfaketruth1-5/+5
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-3/+4
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-02-20Removed some more cChunkPtr usagemadmaxoft@gmail.com1-0/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@298 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-20Using own ASSERT() that logs to filefaketruth1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@297 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-15No longer using pointers for Vector3(f/d/i) in cEntity's and cTracerfaketruth1-12/+12
git-svn-id: http://mc-server.googlecode.com/svn/trunk@268 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-18/+45
git-svn-id: http://mc-server.googlecode.com/svn/trunk@251 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-26Players can switch worlds on the fly with the command /gotoworld [worldName]. This uses the function cPlayer::MoveToWorld()faketruth1-0/+1
Changed isValidItem to IsValidItem in Core.lua git-svn-id: http://mc-server.googlecode.com/svn/trunk@126 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-26Made some functions in cChunk and cNoise inline, this should significantly increase chunk generation speedfaketruth1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@115 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-25- fixed the code from the last commit :)lapayo94@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@111 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-02Fixed some "Entity was not found in any chunk!" warningsfaketruth1-1/+4
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-10-31Prepared some parts of the code for multi world support, I created lots of TODO'sfaketruth1-1/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@29 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-10-03MCServer c++ source filesfaketruth1-0/+108
git-svn-id: http://mc-server.googlecode.com/svn/trunk@3 0a769ca7-a7f5-676a-18bf-c427514a06d6