1
0
Fork 0
Commit Graph

1050 Commits

Author SHA1 Message Date
x12xx12x 3ff57559e3
ItemHandler initialisation is a constant expression (#5344)
* Transition to non-pointer item handler
* That is my destructor - I decide when I leave this world
* I declare your destruction private and you final
2021-12-01 23:31:10 +00:00
Tiger Wang d49ce751ba
Miscellaneous fixes (#5320)
* Protocol: update Abilities flags

+ Add Spectator handling

* BioGen: move <iostream> include

* ClientHandle: rename Respawn packet dimension check flag

* Make it clearer what it's doing.

* ClientHandle: move ProcessProtocolIn calls to World

* Player: remove some redundant initialisation

* Player: UpdateCapabilities enables flight for spectators

* Produce growth: improve comments

* ClientHandle: run unload checks using delta time

* Fix forgotten initialisation of time member
2021-11-11 21:02:29 +00:00
Ethan Jones afe07fe090
Prevent placing of hangables on illegal blocks and break when support block broken (#5301)
+ Prevent placing of hangables on illegal items and break when support block is broken

Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2021-10-03 21:29:45 +01:00
Tiger Wang 1e4850a6c5
World: change spawnpoint type to int (#5313)
* World: change spawnpoint type to int

As Vanilla does.
2021-10-03 17:43:22 +01:00
JK2K be3111d133
Perform bed checks upon respawn (#5300)
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2021-10-02 21:28:24 +01:00
Rorkh 798fdb0709 Snipe skeleton achievment 2021-10-02 21:18:18 +01:00
Tiger Wang 028a5735c5
Spectation: add dedicated pathway for spectator mode (#5303)
* 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-09-29 22:17:03 +00:00
Bart Ribbers a78de88ac3
Fix typo in message send when getting achievements (#5282) 2021-08-21 11:07:16 +01:00
Rorkh 383867b6b0
Haybale damage reduction implementation (#5277)
* Haybale damage reduction impl

* Update Pawn.cpp
2021-08-04 10:58:54 +02:00
Rorkh 4221e08f3a
Paintings: add sound effects, remove critical hitting (#5276) 2021-07-28 21:51:59 +01:00
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