1
0
Commit Graph

413 Commits

Author SHA1 Message Date
Mat
7d4934534e
Stabilise MoveToWorld (#4004)
* 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
2020-03-05 12:52:34 +02:00
Mat
dca896dfcc Boats can be spawned on land 2020-03-01 13:27:19 +00:00
Mat
5074527d2c
Disable block placement in adventure mode (#4424) 2019-12-30 01:54:37 +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
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
Zach DeCook
b9e7505d7f Buckets: Be able to place fluids through other fluids. (#4331) 2019-05-07 20:15:58 +01:00
peterbell10
4727ed2084 Add a formatting function for Vector3 (#4282)
* Vector3: Add custom fmt compatible formatter.

* cLuaState: Add fmt version of ApiParamError

* Use vector formatting in manual bindings

* Always log vectors with FLOG
2018-09-24 21:33:39 +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
peterbell10
950aeffff8
CheckBasicStyle: Check number of empty lines between functions (#4267)
Add check for number of empty lines between functions and fix the corresponding failures
2018-07-26 22:24:36 +01:00
changyong guo
7b0db672d1 Keep players in gmNotSet (#4248)
This allows players game mode to update to the default after portal to another world.
Fixes #4207
2018-07-23 00:35:32 +01:00
Bond-009
7e9695ecb0 Damage fishing rod when catching the hook on a block, then reeling it in (#4151)
Fixes #4132
2018-02-11 12:40:16 +00:00
peterbell10
d3c1c626f5
Deal with covered switches consistently (#4161)
* Fixes a number of "<function>: not all control paths return a value" warnings on MSVC.

* Introduces the UNREACHABLE global macro and uses it instead of conditionally compiled switch defaults.

* Move cNBTParseErrorCategory from FastNBT.h into FastNBT.cpp to prevent bad calls to message()
2018-02-04 23:07:12 +00:00
Bond-009
701fee334c Prioritize hinge on the left side (#4153) 2018-01-17 19:15:42 +00:00
Alexander Harkness
2529a89835 Golden Apple Fixes (#4130)
* Do not remove food item until player has been fed
* Golden apples now ignore hunger when eating
* Removed EnchantedGoldenApple recipe, as it was removed in 1.9
    Reference: https://minecraft.gamepedia.com/1.9#Items_2
* Adjust golden apple effects, as they were changed in 1.9
    Reference: https://minecraft.gamepedia.com/1.9#Items_2
2018-01-06 00:39:23 +00:00
Bond-009
d7de2dccf0 Improved fishing rewards (#4120)
* Damage fishing rod after use
* Give xp to the player for catching something
* Fixed junk drops
* Implement Luck of the Sea
2018-01-05 14:32:30 +00:00
Alexander Harkness
b4aa19f329
Item durability loss now depends on the item used. (#4123)
Armour durability also no longer changes when it
is used to break blocks or attack mobs.

Fixes #4119
2018-01-05 11:28:06 +00:00
peterbell10
757231cc6e
Add the fmt library (#4065)
* Replaces AppendVPrintf with fmt::sprintf
* fmt::ArgList now used as a type safe alternative to varargs.
* Removed SIZE_T_FMT compatibility macros. fmt::sprintf is fully portable and supports %zu.
* Adds FLOG functions to log with fmt's native formatting style.
2018-01-03 17:41:16 +00:00
peterbell10
bf5e6874fe cItemHandler: Update max stack size of old doors. (#4072) 2017-11-20 11:04:17 +00:00
Bond-009
10c5c1227e BroadcastBlockBreakAnimation and BroadcastBlockEntity use vectors (#4038) 2017-09-25 18:17:45 +02:00
Lane Kolbly
30c8470a52 Changed BroadcastSoundEffect, SendSoundEffect, and CastThunderbolt parameters to vectors (#3959)
* 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-19 15:12:54 +01:00
Lukas Pioch
c5f590d460 Removed UTF-8 BOM (#4033) 2017-09-19 10:34:08 +02:00
peterbell10
307e7aaff5 Fix switch warnings (#4013)
* Fix switch warnings
  * Fix a variety of -Wswitch and -Wswitch-enum warnings
  * Remove unneeded -Wno-error flags

* Reorganise some eMonsterType switches
  * Alpha sort eMonsterType cases in WriteMobMetadata
    and in cNBTChunkSerializer::AddMonsterEntity
  * List all mob types in protocol 1.12 and NBTChunkSerializer

* cStructGenTrees::GetNumTrees: remove switch default

* cWSSAnvil::LoadOldMinecartFromNBT: Log unhandled minecart type
2017-09-14 09:48:57 +01:00
peterbell10
e225b7f826 Replace ItemCallbacks with lambdas (#3993) 2017-09-11 23:20:49 +02:00
Bond-009
104f9e127b Changed some int parameters to vector parameters (#3937) 2017-09-07 10:25:34 +02:00
LogicParrot
49c443896d Revert "Replace ItemCallbacks with lambdas (#3948)"
This reverts commit 496c337cdf.
2017-09-02 08:50:23 +01:00
peterbell10
496c337cdf Replace ItemCallbacks with lambdas (#3948) 2017-09-01 13:04:50 +02:00
mathiascode
02775e52c4 Minor changes (#3909) 2017-08-24 11:19:40 +02:00
peterbell10
0854ed01a4 Fix use after move in cItemBowHandler::OnItemShoot 2017-08-24 11:17:51 +02:00
Pablo Beltrán
b18f6637b6 Fully implemented leashes (#3798) 2017-08-21 10:46:41 +02:00
Tiger Wang
72d7027861 Merge pull request #3489 from cuberite/EntityOwnership
* Changed entity ownership model to use smart pointers
2017-08-18 11:17:56 +01:00
Lukas Pioch
743a50014a Replaced includes with forward declarations 2017-08-13 12:31:10 +01:00
Tiger Wang
4ef47aed62 Changed entity ownership model to use smart pointers 2017-08-07 19:24:16 +01:00
Lukas Pioch
07f25253a2 Removed unneeded includes (#3902) 2017-08-06 20:57:44 +01:00
peterbell10
759618b035 Remove double includes part 2 (#3890) 2017-08-03 15:34:19 +02:00
Lukas Pioch
4691bc5a29 Removed double includes (#3885) 2017-08-02 19:57:20 +01:00
peterbell10
0d0323608d cBlockHandler: take player by ref 2017-08-01 08:21:20 +02:00
peterbell10
8eb5672920 cWorld::SendBlockTo take player by ref 2017-08-01 08:21:20 +02:00
Lane Kolbly
10d42a2452 Consolidated food effects into EatItem, added all fish type FoodInfos. (#3875)
* Consolidated food effects into EatItem, added all fish types.

* Changed type of NumFishInfos to satisfy clang.

* Removed unused call for a_Item in EatItem
2017-07-30 18:53:21 +01:00
peterbell10
bbf5bec817 BigFlower fixes (#3826)
* BigFlowers fixes

* Correct upper part meta
* Documented parameters to DoesIgnoreBuildCollision
2017-07-07 16:37:53 +02:00
Bond-009
7fd3899796 Added 1.12 blocks (#3760) 2017-06-30 10:46:58 +02:00
Bond-009
0e1649a0f1 Fix shears (and vines)
* Shears now lose durability when breaking any block
* Leaves don't drop 2 leaves anymore when broken by shears
* Removed the chance to drop saplings or apples when leaves are broken by shears
* Vines can't be attached to ender chests, pistons and redstone repeaters
2017-06-21 08:09:03 +02:00
peterbell10
360d8eade0 FastRandom rewrite (#3754) 2017-06-13 21:35:30 +02:00
peterbell10
36be4a89f8 Fixed double chests (#3741)
Normal and trapped chests next to each other don't open a double chest window.
Slot changes in the secondary chest are broadcast.
Placing a chest in +x of another updates the original chest's metadata.
2017-06-03 21:17:53 +02:00
Lukas Pioch
73a3c4e3be Exported boat
- NBT: Added saving / loading of material
- Added the material in the item handler of the boat
- Drop the correct boat if destroyed
- APIDoc: Added desc and functions
2017-05-24 19:02:18 +02:00
Mattes D
2c3c1f1527 Tracer replacement (#3704)
* Replaced cTracer usage with cLineBlockTracer.

* Exported new cLineBlockTracer utility functions to Lua API.
2017-05-11 13:34:36 +01:00
Lukas Pioch
5580d558a5 Added missing checks for Initialize function and updated APIDoc 2017-05-08 06:31:45 +02:00
Bond-009
e8de42fcbb Return bowl when eating beetroot soup 2017-03-20 21:21:02 +01:00
Bond-009
ef85c2e686 Deadbushes drop sticks 2017-03-19 21:57:41 +01:00
Lukas Pioch
043a82344f Boat spawned, remove it from player's hand 2017-03-17 19:33:18 +01:00
Bond-009
2a630e8421 Fixed which blocks can be harvested with what type of pickaxe (#3586) 2017-02-26 12:13:53 +01:00
Alex
9cb1ad546f Changed fish launching mechanism (#3520)
Fish and other fishing loot now correctly fly towards played when reeled in.
2017-02-20 10:03:19 +01:00
mathiascode
dae2adde65 Updated sounds and effect IDs (#3422) 2017-02-15 06:05:24 +01:00
mathiascode
4311f4a658 Added some blocks and items (#3503) 2017-02-14 11:13:55 +01:00
Jacob
0f687c7182 Fixed placing of double tall flowers and an inconsistency with vanilla (#3541) 2017-01-19 17:21:05 +01:00
QuImUfu
fb2eaaa847 Added code to handle signs replacing blocks 2016-12-01 15:20:03 +01:00
Mattes D
0bffa29358 Removed ClientHandle.h dependencies from common headers. 2016-11-18 20:00:04 +01:00
Mattes D
da2ea3c2ff Added missing "override" specifier. 2016-11-13 16:22:03 +01:00
mohe2015
32b38fb264 Anticheat fastbreak (#3411)
Added block hardness checks when breaking blocks.
2016-11-06 19:30:19 +01:00
Mattes D
d2e8643607 Fixed type-casting-related warnings. 2016-08-24 22:26:53 +02:00
Mattes D
7549f468b3 Fixed implicit rounding warnings. 2016-08-19 14:09:10 +02:00
Alexander Harkness
baefed8061 Fix issue #3312
Nether brick fences now drop their item.
2016-08-12 13:55:41 +01:00
Mattes D
8eaa8613da CMake: Remove needless minimum version specifications. 2016-07-18 22:11:42 +02:00
beeduck
db65e11d57 Fixes for boat entities (#3265)
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-07-18 22:10:00 +02:00
LogicParrot
ca6ef58b1e Bulk clearing of whitespace 2016-02-05 23:50:18 +02:00
Mathias
89f3dec7ac Updated old forum links 2016-01-31 02:25:03 +02:00
Mattes D
80e1eb37dd Renamed leftover strings to Cuberite / Server, as needed.
Also upgraded the user setting file for MSVC to 2013.
2016-01-01 21:05:09 +01:00
Gargaj
8968a7174e add handling of water bottle 2015-12-22 20:25:59 +01:00
Gargaj
41761624c2 Tilling dirt should send block update
There are BUD switches that are built on this (https://www.youtube.com/watch?v=Bk_ChvmtCNY) but more prominently, torches placed on dirt blocks should pop off when the dirt block is tilled.
2015-12-06 12:59:38 +01:00
Gargaj
72b2ab6406 Merge mushroom soup into generic food handler
...and fix eating the bowl when eating rabbit stew
2015-12-03 14:55:32 +01:00
Gargaj
b5de4a9a6f remove slab from inventory when using it on another slab (fixes #2610) 2015-11-09 21:12:32 +01:00
Mattes D
9871c0b073 Added CircleCI for stylechecking.
This will allow us to remove the stylecheck from Travis builds, making them a bit faster, and having fast style checks
2015-09-17 11:20:10 +02:00
Samuel Barney
804805d35a Silenced and fixed many warning messages across multiple files. 2015-07-29 09:49:30 -06:00
hallucino
9c85ed5864 Spawn baby mobs 2015-07-16 22:49:55 +02:00
Tiger Wang
8656e149c8 Improved maps 2015-07-14 21:46:30 +01:00
bibo38
31466fda5f Doors now get placed on the server-side.
The Y-Value is already the lower door block(From ItemHandler.cpp:346).
Increasing it once again, places the door into the air, which is blocked by Cuberite.
Bugfix #2279
2015-06-25 16:17:03 +02:00
Mattes D
55a5f11b1b Fixed right-click with bonemeal.
The client would send invalid right-click events with Y set to 0x7ff, which would crash the server. Only process bonemeal for valid clicks (valid blockface).
2015-06-23 15:23:11 +02:00
Mattes D
3889b2cac2 Refactored block placement workflow.
Multi-blocks can now use the default OnPlayerPlaced() callback in cItemHandler.
2015-06-21 19:49:22 +02:00
tycho
e19693e529 Merge branch 'master' into PreventNewWarnings
Conflicts:
	src/Inventory.cpp
2015-05-28 11:05:41 +01:00
Alexander Harkness
da4a76bb50 Merge pull request #2061 from mc-server/fixes
Fixes
2015-05-27 12:21:17 +01:00
tycho
a6ccee5948 Merge branch 'master' into PreventNewWarnings 2015-05-24 17:27:05 +01:00
worktycho
bd95d7bf7b Merge pull request #2091 from Rakete1111/master
Placing buckets up to 25 blocks away #2059
2015-05-24 13:44:34 +01:00
tycho
dae9e5792a Made -Weverything an error. 2015-05-24 12:56:56 +01:00
tycho
81c0116cf1 Merge branch 'master' into PreventNewWarnings 2015-05-23 07:33:52 -07:00
Lukas Pioch
e30b2ed487 Fixed missing overrides and added a ignore flag for reserved macro for clang version 3.6 and higher. 2015-05-23 16:28:37 +02:00
Blitz Rakete
e512b7bf8e Fixes #2059 2015-05-21 19:03:51 +02:00
tycho
77f1f58c0a Make -Werror disabling file only
Ad fix a load of warnings
2015-05-19 19:32:10 +01:00
Tiger Wang
0dbba305b6 Fixes #2052 2015-05-18 14:30:16 +01:00
Mattes D
846d16315a CheckBasicStyle: checks spaces around * and &. 2015-05-09 12:58:55 +02:00
Mattes D
c13b1931ff More style checking.
Spaces around some operators are checked.
2015-05-09 12:58:54 +02:00
jammet
61300ab9ef Rabbit and cooked rabbit now stackable
And corrected the alphabetical ordering.
2015-05-09 12:56:23 +02:00
Tri125
429e545167 Fixed #1893
Quartz ore now stack properly
2015-05-07 11:49:11 -04:00
Mattes D
e51bd6bcd8 Merge pull request #1851 from wraith11/DoorFix
Fix door placing in connection with slabs
2015-04-23 00:55:51 +02:00
Mattes D
5f0a78200b Merge pull request #1852 from wraith11/SlabPlacing
Fix slab placing
2015-04-23 00:54:59 +02:00
wraith11
85c37dd3a0 Fix slab placing 2015-04-22 23:01:21 +02:00
wraith11
794013315b Fix door placing in connection with slabs
Except top-half slabs as transparent blocks for doors.
2015-04-21 20:47:02 +02:00
Mattes D
b97f41b8c6 ItemHandler type fixes. 2015-04-20 09:17:26 +02:00
Mattes D
c9fbcea66d ItemHandler: Using automatic array bounds. 2015-04-20 08:34:44 +02:00
Mattes D
ffe7dae4fc Fixed PolishedGranite et al crafting recipes.
Fixes #1774. Ref.: #1859
2015-04-16 20:59:57 +02:00