1
0
Fork 0
Commit Graph

1040 Commits

Author SHA1 Message Date
Kiryu144 36a97d441b
Added y bounds checking for cPlayer::PlaceBlock (#5194) 2021-07-23 10:14:01 +01:00
KingCol13 1d1fa91401
Chorus fruit teleport (#5259)
* Outline function for teleporting.

* Created new handler for chorus fruit.

* Fixed AttemptTeleport failing.

* Better names, working sound effect.

* Corrected naming.

* Remove stray LOGD.

* Offset teleport to middle of block.

* Style Fixes

Co-authored-by: x12xx12x <44411062+12xx12@users.noreply.github.com>

* Style Fixes 2

Co-authored-by: x12xx12x <44411062+12xx12@users.noreply.github.com>

* Move FindTeleportDestination to static cPawn method.

* cBoundingBox interface.

* Cleanup includes.

* Maybe exported to API?

* Change a_World to reference, add to APIDesc.

Co-authored-by: x12xx12x <44411062+12xx12@users.noreply.github.com>
2021-07-10 20:05:00 +00:00
KingCol13 68776c4d59
Item frame maps (#5258)
+ Send map data when item frame spawns.
+ Add some casts to placate compiler warnings.

* size_t for array access.
* Mark chunk dirty when rotation or item in item frame is changed.
2021-07-09 18:45:53 +01:00
Tiger Wang 06a2b1211b Invalidate m_LastStreamedChunk when player position doesn't match
So teleporting to and back doesn't cause chunk sending to stop.

* Fixes #4531
2021-07-06 21:33:03 +01:00
Tiger Wang 3252b3d4dc Remove spammy LOGD output 2021-06-28 21:54:21 +01:00
Tiger Wang 93611b8437 SetBedPos: make World parameter non-null
* Fixes #5190
2021-06-28 21:54:21 +01:00
TheHyper45 3b35a00397
Death messages for tamed pets and ocelots are now tamable. (#5243)
* 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-06-19 21:25:24 +00:00
Tiger Wang a62b2b1be2
Move item placement into item handlers (#5184)
* Move item placement into item handlers

+ Add appropriate CanBeAt checks in cPlayer::PlaceBlocks, into which all placement handlers call.
* Partly addresses #5157
* Fixes #4878
* Fixes #2919
* Fixes #4629
* Fixes #4239
* Fixes #4849

Co-authored-by: changyong guo <guo1487@163.com>
Co-authored-by: Xotheus <shady3300@outlook.com>
Co-authored-by: Krist Pregracke <krist@tiger-scm.com>

* Review fixes

* Update APIDesc.lua

* Rename

Co-authored-by: changyong guo <guo1487@163.com>
Co-authored-by: Xotheus <shady3300@outlook.com>
Co-authored-by: Krist Pregracke <krist@tiger-scm.com>
2021-05-05 13:25:10 +00:00
Tiger Wang 34bf5c0d9d Rename files to match code 2021-05-04 16:11:56 +01:00
nshah25 8be1dd54bb
Add player statistics to API (#5193)
* Fixed issue #5166

Co-authored-by: 12xx12 <44411062+12xx12@users.noreply.github.com>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2021-05-03 21:07:09 +01:00
jclever77 cbfc740ad0
Added functionality: mobs now enter boats and minecarts (#5214)
* Added functionality: mobs now enter boats and minecarts when coming into collision with them.

* Fixed basic style errors, nothing else

* Added self to contributors and reverted .gitignore to original state.
2021-04-30 11:39:10 +00:00
12xx12 37213eb76c
Resets ticks alive on death (#5197)
* resets ticks alive on death
* updated the comment in the .h file
2021-04-21 12:07:50 +01:00
Tiger Wang 3001e23e8c Thrown potions/enderpearls: cleanup 2021-04-12 22:35:07 +01:00
Tiger Wang 951e6c76a7 cPlayer: move some constants out of header 2021-04-12 22:35:07 +01:00
Tiger Wang a999c5d845 More cProtocol cleanup
* Alpha sort functions
* Simplify hand handling
* Fix left handed mode client-side display
2021-04-12 22:35:07 +01:00
Tiger Wang 63ded9f6b4 Add animations for shield/item block & break 2021-04-12 22:35:07 +01:00
Tiger Wang 99bd05dff5 Add magical critical effect 2021-04-12 22:35:07 +01:00
Tiger Wang 17c091a97f Fix thrown snowball/egg hit animations
+ Snowballs destroy ender crystals
2021-04-12 22:35:07 +01:00
Tiger Wang 2fc86476ae Improve bed handling robustness
+ Boot the player out if the bed was destroyed
2021-04-12 22:35:07 +01:00
Tiger Wang 66c211c33a Unify multiprotocol entity animations 2021-04-12 22:35:07 +01:00
Tiger Wang 6e80f7544d Update entity sizes 2021-04-12 22:35:07 +01:00
Tiger Wang 1394fc8eb5 Streamline player abilities handling
* Update player list gamemode on world change
* Fix invisibility for spectators, use entity metadata
* Populate m_World for cPlayers on load
- Remove SendPlayerMaxSpeed, a duplicate of SendEntityProperties
2021-04-12 22:35:07 +01:00
Tiger Wang d6b264bc21 Fall particles: check for valid Y 2021-04-12 22:35:07 +01:00
Tiger Wang 4cd49d7eca Fix sending incorrect date values on world change
Yak shave: make more things use cTickTime. Fix a couple of incorrect modulo-on-millisecond-value by making them use WorldTickAge.
2021-04-12 22:35:07 +01:00
Nate b2eddbed84
Teleport off of mount when throwing enderpearl (#5179)
* Teleport off of mount when throwing enderpearl

* Simplify returning boolean

* Oops forgot a semicolon

* Fix code conventions in Player.h
2021-04-08 12:17:24 +02:00
Nate 8efe55c62c
Change to Cuboid calculation for splash distance (#5176)
* Change to Cuboid calculation for splash distance

* Use ForEachEntityInBox when splash entities

* Remove TODO comment, calculation verified

* Added self to contributors
2021-04-06 16:16:31 +00:00
Damián Imrich 071b7be3d4
Basic elytra flight (#5124)
* Basic elytra flight

Co-authored-by: 12xx12 <44411062+12xx12@users.noreply.github.com>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2021-04-03 18:45:20 +01:00
Tiger Wang 8a30a4a7b8 Player data loading cleanup
* Kick player if data were corrupt to avoid making it worse
2021-03-29 23:36:15 +01:00
Tiger Wang abcc14076c Call ProcessProtocolOut at opportune times 2021-03-28 21:20:13 +01:00
Tiger Wang 90369deb5a
Change TimeOfDay to WorldDate (#5160)
* Change TimeOfDay to WorldDate

* Do not wrap at 20 minutes, continue incrementing
* Fixes #4737
* Fixes #5159
2021-03-20 20:58:19 +00:00
Tiger Wang 55ba39ca0e Don't send ping updates one packet at a time
* Use the batch update feature of the packet.
* Lengthen interval between time and ping update packets (ref. http://github.com/cuberite/cuberite/issues/4082#issuecomment-348675321).
2021-03-19 11:23:30 +00:00
Tiger Wang 45591cbe7b
Properly deprecate more XYZ parameter'd functions (#5147)
* Fixes #5144
2021-03-15 02:28:18 +00:00
NiLSPACE c729d7abde
Fixed some death messages showing up even when they are disabled. (#5153) 2021-03-11 21:26:35 +00:00
12xx12 3daf253b7f
Some emplace_back replacements (#5149)
* replace push_back with emplace_back when a new object was created in the function call
2021-03-07 16:31:43 +00:00
Tiger Wang be2bf999c2 Fix #5118 2021-02-07 22:36:15 +00:00
Simerson b1b7424c43
Creative mode hits immediately disappear boats (#5117)
Instant destroy boat in creative mode

+ boat one-shot in creative mode
+ Add boat instant destroy in creative
+ Instant break boat in creative
2021-01-28 22:39:40 +00:00
Damián Imrich 4f3b699b27
End crystal placement (#5112)
* End crystal placement

* End crystal placement - fixed error and added some comments

* Removed unused includes

* Update src/Items/ItemEndCrystal.h

Co-authored-by: Alexander Harkness <me@bearbin.net>

* End Crystal placement, early-return pattern enforcement

* End crystal Item finish?

* Small changes

Fixed a crashbug in ender crystal destruction.
According to vanilla 1.16 testing, end crystals don't place if any entity intersects the box, not just other end crystals.
Check return value of SpawnEnderCrystal.
Add header in SeeMake.
Cafe Stile Redux.

* The stylechecker relies on CMakeLists

* There is another

Co-authored-by: Alexander Harkness <me@bearbin.net>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2021-01-22 17:06:26 +00:00
Damián Imrich 59e906ec6c
Implementation of totem of undying behaviour (#5111)
* 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-22 09:05:18 +00:00
Tiger Wang 813176fbd1
cChunk: don't inherit from cChunkDef (#5106) 2021-01-18 16:09:10 +00:00
Tiger Wang 054a89dd9e Clarify cClientHandle, cPlayer ownership semantics
+ 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-12 12:34:34 +00:00
Tiger Wang 9328afe65c Convert most calls to blocking GetHeight/GetBiomeAt to direct chunk accesses
* Hopefully fixes #5094
2021-01-11 16:39:56 +00:00
Tiger Wang 16aeb84cd3
Fix potential destruction crashes (#5095)
* 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
2021-01-02 13:50:34 +00:00
Aiden Neill 3d044d2dde
Added magma block contact damage (#5055)
* 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-11-25 17:56:55 +00:00
12xx12 36a67df105
Ender Crytal Fix and report proper cmake file for luabindingscheck fail (#5017)
* fixed network
fixed explosion
fixed ticking

added network broadcast to Setter method

added nullptr protection

using macros in 1.10 Protocol_1_10.cpp

revealed functions to LUA API

small fixups, typos, less functions used

fixed more doc

readded info that saving is done only if the beam is displayed

made the constructor transfer all needed members

fixed wrong commit

removed default parameters on SpawnEnderCrystal

fixed wrong metadata

moved call to destroy in the right place

fixed some typos

Fixed Ender Crystal

* fixed documentation

* fixed doc and added proper error message

* Parameters, arrows

* Parameters

Co-authored-by: 12xx12 <12xx12100@gmail.com>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-11-06 15:00:59 +00:00
Tiger Wang 645fea4237
Players are no longer kicked when clicking on bedrock (#5023)
* Players are no longer kicked when clicking on bedrock
* Fixes #5022
2020-11-06 14:58:47 +00:00
12xx12 961d5eb420
Add beam target, configurable base visibility to Ender Crystals (#5010)
* Fixes #4990

Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-10-29 20:47:20 +00:00
12xx12 c07ea7b9ab
added const correctness on some functions in cPlayer (#4999)
Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-10-15 20:18:32 +02:00
peterbell10 a9031b6bae
Fix cmake not adding Werror on clang, and _lots_ of warnings (#4963)
* 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-10-05 10:27:14 +00:00
KingCol13 cd1b507745
Fix instant mining of blocks not being recognised, tweak anti-cheat (#4938)
* Tried to fix a small issue...

Ended up rewriting a bunch of god awful, opaque code with no source
and no sense. Who names a function GetPlayerRelativeBlockHardness???
It's gone now. We're safe again.

* Testing anti-cheat.

* Tidy up debug logging.

* Remove empty member declaration.

* Rewrite GetDigSpeed slightly for better readability.

* GetMiningProgressPerTick now returns 1 when instantly mined. Fixed hasily written typo.

* Comment style and typo fixes.
2020-10-02 20:57:17 +00:00
KingCol13 8947147c25
Enchanting table shows detail on hover. Enchanting is deterministic. (#4937)
* Use lapis for enchanting, subtract correct number of levels, ClientHandle now selects from pregenerated list.

Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-10-01 22:33:32 +01:00