1
0
Commit Graph

659 Commits

Author SHA1 Message Date
Mattes D
bdb8830b9c Fixed various MSVC warnings. 2020-05-06 12:53:37 +01:00
Tiger Wang
07ca095740
Improve entity position updates (#4701)
* 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-04 08:10:47 +00:00
DrButcher
258318ab98
Buttons can now be triggered by arrows. (#4670)
* Buttons can now be triggered by arrows.
2020-05-03 21:05:32 +01:00
peterbell10
c0e7708aa7
Fix incorrect relative coords usage in farmland handler (#4690) 2020-04-24 17:29:12 +00:00
mathiascode
e6cc792cef Prevent bookshelf pickup crash
If no tool was involved in the creation of a bookshelf pickup (e.g. explosion), the server would crash due to a missing nullptr check. Removed the IsTool check completely, since we don't use it elsewhere, and vanilla doesn't do such checks either.
2020-04-24 19:39:22 +03:00
Mattes D
487f9a2aa9
Vector3 in Handlers (#4680)
Refactored all cBlockHandler and cItemHandler descendants to use Vector3.
2020-04-21 22:19:22 +02:00
Tiger Wang
c1ea5f982d Re-implement repeater locking 2020-04-18 16:51:29 +01:00
Mattes D
26ac146f41
More Vector3 in cBlockHandler (#4644)
* cBlockHandler.OnUpdate uses Vector3 params.

Also slightly changed how block ticking works.
2020-04-17 10:36:37 +01:00
Peter Bell
96bd4637d7 Implement glowing redstone ore 2020-04-16 23:49:33 +01:00
Tiger Wang
ede56a5750
ಠ_ಠ (#4660)
+ Provisional handling for observers
2020-04-16 22:27:04 +01:00
Mattes D
9ee47e5999 Using Super. 2020-04-16 20:07:48 +00:00
Bond_009
dc4df66548 Trapdoor can be placed anywhere since 1.9 2020-04-15 21:58:27 +00:00
Mattes D
ef2d5027d3
Removed extended ASCII, and added a check against it. (#4642) 2020-04-12 09:24:30 +02:00
Alexander Harkness
8914355895 Fix rotation metas on blocks 2020-04-11 19:00:05 +00:00
GefaketHD
0712fd2d90 fixing rotation - rel. #4625 2020-04-11 19:00:05 +00:00
Alexander Harkness
0d72270186 Replace all single-digit hex constants with two-digit version 2020-04-10 13:07:16 +00:00
Alexander Harkness
db118af6ae Remove silly empty cBlockGlazedTerracotta class 2020-04-10 13:07:16 +00:00
Alexander Harkness
49f301d5a4 Reduce line length on templates 2020-04-10 13:07:16 +00:00
Alexander Harkness
e5cc698ee7 Add additional spacing between template/function definitions 2020-04-10 13:07:16 +00:00
Alexander Harkness
9bb001f17b Add doxy-comments to new functions 2020-04-10 13:07:16 +00:00
Alexander Harkness
2b77b67197 Fix comment text 2020-04-10 13:07:16 +00:00
Alexander Harkness
f40aba941e Add mixins for blocks that rotate based on player yaw at placement
Also add observer block handler.
2020-04-10 13:07:16 +00:00
Alexander Harkness
458d7f95c2 Brewing stands do not have rotation 2020-04-10 13:07:16 +00:00
Alexander Harkness
48ccd93426 Add Terracotta handlers 2020-04-10 13:07:16 +00:00
Alexander Harkness
cb21a4611d Correct Black Glazed Terracotta block handler 2020-04-10 13:07:16 +00:00
Alexander Harkness
ba048e2101
New hotfix to prevent calling OnBroken (#4600)
* Fix stack overflow in breaking ice.

Stupid fix, but it does work and is used in other places too...

* Replace hotfix for pistons with better one

* Fix comments in BlockBed handler
2020-04-03 20:24:49 +00:00
Mattes D
01b8ed5295
Pulled the BlockID and BlockInfo headers from Globals.h. (#4591)
The BlockID.h file was removed from Globals.h and renamed to BlockType.h (main change)
The BlockInfo.h file was removed from Globals.h (main change)
The ENUM_BLOCK_ID and ENUM_ITEM_ID enum names were replaced with ENUM_BLOCK_TYPE and ENUM_ITEM_TYPE (cosmetics)
The various enums, such as eDimension, eDamageType and eExplosionSource were moved from BlockType.h to Defines.h, together with the helper functions for converting between them and strings (StringToDimension et al.) (minor)
Many inline functions were moved from headers to their respective cpp files, so that BlockType.h could be included only into the cpp file, rather than the header.
That broke our tests a bit, since they pick bits and pieces out of the main code and provide stubs for the rest; they had to be re-stubbed and re-verified.
eMonsterType values are no longer tied to E_ITEM_SPAWN_EGG_META_* values
2020-04-03 08:57:01 +02:00
Alexander Harkness
cdc452916e
Replace buckets to the selected hotbar slot, rather than the first available. (#4580)
* Replace buckets to the selected hotbar slot, rather than the first available.

Replicates vanilla behaviour, as well as being more logical.

* Refactor cInventory::AddItem. Behaviour is now documented

* Add new cInventory::ReplaceOneEquippedItem and ::SetEquippedItem methods

* Return empty potion to the same slot after drinking

* Replace buckets correctly in other situations, not simply water and lava

Uses the new ReplaceOneEquippedItem method

* Correct collecting water from source block with bottle

* Add cPlayer::ReplaceOneEquippedItemTossRest method

* Handle stacked filled buckets (in theory)

Use new cPlayer::ReplaceOneEquippedItemTossRest method
2020-04-02 12:42:15 +00:00
Xenoxis
1e1f79b795
Updated Bookshelves drop behaviour (#4567)
* Updated BookShelves Drop Behaviour

As described here : https://minecraft.gamepedia.com/Bookshelf#Loot

* Update src/Blocks/BlockBookShelf.h

* Update CONTRIBUTORS
2020-03-28 12:20:14 +00:00
Xenoxis
ae4d387f1d
Fix Snow Spawn on Cobblestone Slab (#4564) 2020-03-27 23:37:32 +00:00
Mat
fdca7dc7f1
Furnace and brewing stand drops (#4534)
* Furnace drops contents

* Brewing stand drops contents

* Fix lit furnace drop

* Fix brewing stand drop

* Style

* Style
2020-03-24 14:16:09 +02:00
Mat
0d0d019bbe
Fix certain item drops (#4536)
* Fix certain item drops

* Revert unwanted changes

* Revert unwanted changes

* Revert change

* Style fixes
2020-03-23 22:07:08 +02:00
Mat
f5d24746d6
Jukebox improvements (#4537)
* Add jukebox block handler

Co-authored-by: peterbell10 <peterbell10@live.co.uk>
2020-03-23 13:45:09 +00:00
Mat
4b57513dd6
Cocoa pods have three growing stages 2020-03-23 10:19:52 +02:00
Mat
41e09484b7
Don't push blocks outside world height limits (#4516)
* Don't push blocks outside world height limits

* Style fix

* Apply suggestion

Co-Authored-By: peterbell10 <peterbell10@live.co.uk>

* Apply suggestion

Co-Authored-By: peterbell10 <peterbell10@live.co.uk>

* Improvements

* Add block type check back

* Revert line break changes

* Update BlockPiston.cpp

Co-authored-by: peterbell10 <peterbell10@live.co.uk>
2020-03-22 22:51:11 +02:00
Mat
49dd645aa6
Don't remove items twice (#4524)
* Don't remove items twice
2020-03-22 12:17:04 +02:00
Mat
3d5a295423
Ender chest is not affected by piston (#4526) 2020-03-22 00:18:49 +00:00
Mat
0718c44e77
Silk touch pickaxe drops grass block (#4485) 2020-03-17 02:23:50 +02:00
Mattes D
61904af626 Moved growing from cWorld / cChunk to cBlockHandler descendants. 2019-10-28 10:45:43 +01:00
Mattes D
221cc4ec5c
Refactored block-to-pickup conversion. (#4417) 2019-10-16 10:06:34 +02:00
Mattes D
365cbc6e1c
Refactored more of Entities and BlockEntities to use Vector3. (#4403) 2019-09-29 14:59:24 +02:00
Bond-009
e0ca4d8399 Fix building with clang 8.0 (#4346) 2019-08-11 10:39:43 +01:00
Mattes D
8212f163b5 Register vanilla blocks in BlockTypeRegistry. 2019-08-05 21:42:54 +02:00
Zach DeCook
31a8d017d9 * Sponge: Add water absorbtion (#4333)
Closes #1411
2019-06-11 00:28:02 +01:00
Zach DeCook
24a8456f79 Create Ender Portal with Eyes of Ender (#4126)
The algorithm was designed so All portals must be facing the center, no matter which block had the eye inserted in last.

Note: Still need to create a block entity so that portals don't become invisible when you relog.

Addresses part of #3445
Fixes #3695
2019-05-11 20:43:26 +01:00
peterbell10
ee84197014
Force all headers other than "Globals.h" to be included with relative paths (#4269)
Closes #4236

CMake now creates a header file in the build directory under the path "include/Globals.h" which just includes "src/Globals.h" with an absolute path. Then instead of adding "src/" to the include directories, it adds "include/".

#include "Globals.h" still works by including the build generated file and any other src-relative path will not work.
2018-08-29 01:51:25 +01:00
Alexander Harkness
c4f43cd8ec
Store and pass entity effect duration as an int not a short. (#4293)
Fixes #4292.
2018-08-26 15:52:39 +01:00
Rick van Schijndel
a1e52cb6d6 Fixes bed item 26 and 355 being spawned, only 355 spawns now (#4290) 2018-08-23 16:28:41 +01:00
changyong guo
57690b81a2 Experience orb (#4259)
* Replace cWorld::FindClosesPlayer with cWorld::DoWithClosestPlayer
* Implement experience reward splitting into the orb sizes used in vanilla
* Modified speed calculation in cExpOrb::Tick to make the orbs fly towards the player

Fixes #4216
2018-08-02 15:59:10 +01:00
peterbell10
cdd8e42587
cWorld: Manually bind deprecated broadcast functions (#4265)
Ref: https://github.com/cuberite/cuberite/pull/4264#discussion_r204769193
2018-07-27 00:12:41 +01:00