1
0
Commit Graph

6086 Commits

Author SHA1 Message Date
Tiger Wang
93611b8437 SetBedPos: make World parameter non-null
* Fixes #5190
2021-06-28 21:54:21 +01:00
Tiger Wang
2109057119 Windows: do not include sdkddkver before defining WIN32_WINNT
Including that header before defining the macro defaults the SDK to the latest version, not what we want.
2021-06-28 21:54:21 +01:00
Tiger Wang
91c1d1c58a Windows backtrace: fprintf to fputs 2021-06-28 21:54:21 +01:00
Alexander Harkness
17820b94f6 Double slabs are not transparent blocks
Fixes #4630
2021-06-27 17:21:44 +01:00
Tiger Wang
ecc8ffbd80 Compile the entire Lua stack as C++
* Fixes #5216
2021-06-25 10:17:53 +01:00
x12xx12x
5b8b6eeaa8 fixed crash on lua DoExplosion call 2021-06-23 17:13:35 +01:00
x12xx12x
cc9f7c06b3
Add optional prefix parameter to LOG functions (#5229)
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2021-06-22 23:09:06 +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
Alexander Harkness
62e95745ac
Migrate off CircleCI to Jenkins (#5230)
* Add Jenkinsfile

* cd src

* Escape wildcards

* Refactor stages

* Remove CircleCI junk

* Make clang-tidy do something

* updated regex to include only the files in the base src directory

* fixed errors displayed by new clang tidy version

* adjust clang core count to actual count

* Update README with new Jenkins build

Co-authored-by: 12xx12 <44411062+12xx12@users.noreply.github.com>
2021-06-15 09:00:02 +00:00
Mat
5b440c3ca7
Replace invalid references in deprecation messages (#5235) 2021-06-07 07:49:45 +00:00
12xx12
1322b0c4d1
fixed open inventory crash (#5233) 2021-06-06 20:49:18 +00:00
12xx12
e5fc65264b
Added standardised way to Log with plugin name (#5227)
* added logging functions to each plugin

* added documentation

* modified the global LOG macro

* updated the way of string composition

* removed cloumn

* removed capital v
2021-05-29 16:28:57 +00:00
12xx12
c7febf86e9
added check for harvestation in oreblock handler (#5226) 2021-05-26 18:07:50 +02:00
Feyo Korenhof
9ddc3635d6
Implemented cServer::ScheduleTask() and cServer::TickQueuedTasks() (#5224) 2021-05-26 18:07:32 +02:00
Tiger Wang
d92509a6e7
Re-implement up/down placement metadata (#5219)
+ Use player position when placing blocks which can face up or down, seems to better correspond to Vanilla behaviour.
* Fixes #4651
2021-05-14 10:42:08 +01:00
Tiger Wang
ce8d8388d6
Windows: remove extra newlines in backtrace (#5218)
- Remove DLL lines, not generally needed.
2021-05-06 14:25:12 +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
Tiger Wang
9b97d63f8f
Chest, weather, crash, and miscellaneous fixes (#5215)
* Alpha-sort cChestEntity

* Chests: use SendUpdateBlockEntity

* Pathfinder: fix out of range Y

* 1.13: correct weather packet ID

* Chests: fix neighbour scanner

+ Add OnAddToWorld and overload to scan neighbours there, instead of in the constructor/OnUse. This fixes hoppers accessing newly loaded double chests and seeing a null m_Neighbour, thus thinking its a single chest.
* Fix typo in cross coords computation.
* Simplify hopper logic.

* Block entities: ASSERT that type is correct

If you match the block type first before calling DoWithBlockEntity, the corresponding block entity must either be empty or correspond to the block type.

* Chunk: fix some forgotten PendingSendBE cleanup

+ Add cleanup in SetAllData, WriteBlockArea
- Remove RemoveBlockEntity (used once), HasBlockEntity (not used)

* Replace MakeIndex with MakeIndexNoCheck

* Remove extraneous MarkDirty in hopper & chests
2021-04-30 13:23:46 +00:00
Morritz
a4eba7639e
Fix: GetPhysicalRamUsage on FreeBSD (UNIX) - webadmin display (#5213)
* Fix: GetPhysicalRamUsage on FreeBSD (UNIX) - webadmin display

* fixed cast type

* Fix: GetPhysicalRamUsage on FreeBSD - webadmin display / style and failing build fixes

* added myself to contributors

Co-authored-by: 12xx12 <44411062+12xx12@users.noreply.github.com>
2021-04-30 13:23:31 +00: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
903768489d
Fix random_engine seed cast (#5212) 2021-04-27 13:56:12 +01:00
12xx12
cc6b70ee49
fixed typo (#5208) 2021-04-23 21:33:47 +00:00
12xx12
4a2d0ce9d3
Fixing grass not generating below trees (#5199)
* moves the y-Position below the tree on grass generation
2021-04-23 20:00:02 +01:00
npresley0506
d117a6c5db
Repaired Hoppers Treating Chests as two entities (#5202)
* Repaired Hoppers Treating Chests as two entities

* Style changes

* style fixes

* Fixed style issues, also condensed logic in MoveItemsFromChest

* Used m_Neighbour, fixed styling

* GetNeighbour not ReturnNeighbour

Co-authored-by: npresley <npresley@umich.edu>
2021-04-23 12:51:59 +00:00
12xx12
58b0322ca1
keeping the server from crashing (#5203) 2021-04-22 11:31:49 +00:00
Tiger Wang
1100b04b59
Make Windows go brrrr, not tick. tick. tick. (#5201)
* Fixes #5140
2021-04-21 16:07:48 +01: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
12xx12
02571aae50
Disables the weather packet for 1.13 (#5200)
* disables the weather packet

* fixed style and removed extra semicolon
2021-04-20 15:09:20 +00:00
12xx12
efa5310d69
fixes the fallthrough (#5198) 2021-04-20 15:04:31 +00:00
Tiger Wang
5ae924ec74 ForestRocks: use make_unique to construct 2021-04-12 22:56:21 +01:00
Tiger Wang
d06930de75 Implement random ticks more faithfully
+ Make it pick 3 blocks per section, instead of 50 randomly throughout the chunk
2021-04-12 22:35:07 +01:00
Tiger Wang
7080c4d3e2 Hoppers: use 'locked' bit in meta 2021-04-12 22:35:07 +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
956f5bca28 Remove unused GetClassStatic in cWorld 2021-04-12 22:35:07 +01:00
Tiger Wang
9aa85e38a8 Fix incorrect name in deserialiser for zombie pigmen 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
0f9d424427 Fix block break particles 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
12xx12
a2a2226179
Fixed generator for the Mega Taiga biome (#5129)
* Fixed generator for small foliage.
2021-04-12 22:33:14 +01:00
Tiger Wang
64778c6a39 Fix improper destruction of BEs on /regen 2021-04-12 14:09:58 +01:00
Mattes D
0137e71f6b Added override specifiers to overridden functions.
Needed for clang-11 compatibility.
2021-04-12 14:09:52 +01:00
12xx12
8d10f1b26a
fixed build (#5181) 2021-04-08 11:52:43 +00:00
Damián Imrich
befe132861
cPieceModifier interface and cPieceModifierRandomizeBlocks class (#5122) 2021-04-08 12:24:59 +02:00
12xx12
d78bcac150
Obsidian pillars, end fountain, not Ender dragon spawning (#4993)
* added generator for obsidian pillars and central fountain which then is used for the exit portal

* checkstyle

* checkstyle the second

* fixed clang
removed magic number
added Clamp

* make the pillars configurable

* fixed clang
added warning if there was a unknown value if the tower should have a cage or not

* forgot to cancel on unkwon value

* fixed clang this time maybe

* added new generator to generator test

* fixed test

* added prefab generation for end fountain

* fixed checkstyle and updated the prefab

* added ender dragon spawning
made the fountain positioning dynamic
removed fountain placement functions

* added enderdragon stuff to testing

* pls compile

* added changes suggested by @peterbell10

* fixed clang

* added debug for further research on the ARM build

* ok - it wasn't my tower placement

* checking in setup

* readded the fountain schematic

* removed finisher

* readded generator

* removed generator trigger - kept ini file access

* using cChunkDef function to calculate abs pos of endercrystal

* yes, I know it's unused...

* commented everything in the ComposableGenerator.cpp
 - so only the new class in compiled in but not called at all

* don't compile in the new generator at all
(removed from CMakeLists.txt)

* readded the new generator

* readded the new generator

* removed debug output

* made the towers generate acrocc chunk borders

* fixed bad merge

* fixed clang

* fixed clang

* generate the dragon 20 blocks above terrain

* trying to fixed weird undefined reference

* maybe this fixes the weird behaviour

* takes chunk width as parameter now

* added new comments with info to generated structures
removed ender dragon spawning
removed chunkwidth from parameter

* fixed linker

* maybe fixed linking. tried with gc and clang

* fixed ender crystal

* fixed test

* updated output strings

* fixed build

* fixed up test

* fixed test compile

* fixed test - cant get the tests to show up

* removed the semicolon

* maybe this is the fix?

* at this point i have no idea - in MVSC it works

* removed the ender dragon

Co-authored-by: 12xx12 <12xx12100@gmail.com>
2021-04-08 12:18:18 +02: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
ce6f8b3557 Fix finisher generating invalid pumpkin
Result was black spot in the ground because the meta exceeded 3 and the client didn't render anything.

Been here since the beginning? fbabf9ee8c/source/FinishGen.cpp (L159)
2021-04-01 00:02:44 +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
222d9957a1 cIsThread cleanup
+ Semi-gracefully handle unexpected exceptions
* No-one cared about the return values, remove them
2021-03-29 23:36:15 +01:00
Tiger Wang
8ec5552998
Do an early check for empty network buffers (#5172)
Avoid overhead when nothing to do.
2021-03-29 23:36:00 +01:00
Tiger Wang
abcc14076c Call ProcessProtocolOut at opportune times 2021-03-28 21:20:13 +01:00
Tiger Wang
c24e968f2c Send keep alives slightly less frequently
Ref: http://github.com/cuberite/cuberite/issues/4082#issuecomment-348675321
2021-03-28 15:36:10 +01:00
Tiger Wang
5d11816015 Move some redstone implementations into the source file 2021-03-28 15:36:10 +01:00
Tiger Wang
2687f2df30
Fix chunk block changes being sent out of order (#5169)
* Flush out all pending, buffered changes at the end of each tick, after every chunk is ticked. This makes every block update client-side in unison, instead of unlucky ones only being sent 1 tick later.
* Re-add buffer for outgoing network data; IOCP async WSASend has higher overhead than expected... Fixes regression introduced in 054a89dd9
2021-03-28 14:44:20 +01:00
Tiger Wang
125df19477
Do not fake a tool when converting to pickups (#5170)
* When the cause of destruction was world-induced (CanBeAt check failed) there is no tool. Pass the nullptr directly to ConvertToPickups and let it handle it.
* Fixes #4795
- Remove unused a_Digger parameter to ConvertToPickups.
2021-03-28 14:41:34 +01:00
Tiger Wang
748b121703
Unify DoWithBlockEntity (#5168)
+ DoWith calls now broadcast the block entity and mark the chunk dirty
+ Add block entity change queue to synchronise BE updates with block updates
* Fixed a few incorrect assertions about BE type
- Remove manual overloads
2021-03-28 14:40:57 +01:00
Tiger Wang
5123850db0
Fix Windows XP to 7 compatibility (#5167)
* Partially reverts 01a4e696b
* Unify thread names
- Remove use of GetThreadId API
2021-03-28 13:34:57 +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
e3fe9e5e93 Deduplicate WriteBlockEntity 2021-03-17 23:44:59 +00:00
Tiger Wang
edf9e39ed7 Mob heads, banners cannot be used
* Fixed UsedBy returning true, blocking block placement
2021-03-17 23:44:59 +00:00
Tiger Wang
5ca3a7c2e7 shared_ptr -> unique_ptr in generators 2021-03-17 23:44:42 +00:00
12xx12
243083e01a
Adding basic Banner functionality (#4806)
+ Added item and block for banners

Co-authored-by: 12xx12 <12xx12100@gmail.com>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2021-03-15 02:47:55 +00:00
Tiger Wang
ca5608c66c Derive HugeMushroom from the base handler
ConvertToPickups is already overridden.
2021-03-15 02:44:39 +00:00
Tiger Wang
61cc1c0190 Change Cobblestone block handler to default
Cobblestone shouldn't be handled with the Stone handler.
2021-03-15 02:44:39 +00:00
Tiger Wang
de76503d5c Remove DoesDropOnUnsuitable
This is only overridden false in Vines and Snow. It is called when a CanBeAt check fails, to determine whether DropBlockAsPickups is called. However, Vines and Snow already drop nothing without the right tool, so this function is superfluous.
2021-03-15 02:44:39 +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
Tiger Wang
01a4e696b3
Do protocol decryption in-place (with CryptoAPI on Windows) (#5145) 2021-03-08 16:37:36 +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
d9a2b8611c
Mitigate MSVC crash (#5146)
Reference: http://ci.appveyor.com/project/Cuberite/cuberite/builds/38087390/job/p857ibg3x87naw36/messages
2021-03-06 12:59:39 +00:00
Mat
40b6758905
Add block handler for huge mushroom blocks (#5143) 2021-03-05 19:43:40 +01:00
12xx12
8405b8969f
Adding Boss bar (#5025)
+ Add boss bar

Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2021-03-05 15:08:30 +00:00
12xx12
4d6235c807
Add Mushrooms to Generator and fixed up the roofed forest (#5134)
* added generator for mushrooms and aded them to the biomes

* removed unused variable

* added nEwlY uDocUmEnTeD aPi sYmbOls...
2021-03-05 14:04:48 +01:00
Tiger Wang
868cd94ee9
Prepare ChunkData for BlockState storage (#5105)
* Rename ChunkData Creatable test

* Add missing Y-check in RedstoneWireHandler

* Remove ChunkDef.h dependency in Scoreboard

* Prepare ChunkData for BlockState storage

+ Split chunk block, meta, block & sky light storage
+ Load the height map from disk
- Reduce duplicated code in ChunkData
- Remove saving MCSBiomes, there aren't any
- Remove the allocation pool, ref #4315, #3864

* fixed build

* fixed test

* fixed the debug compile

Co-authored-by: 12xx12 <44411062+12xx12@users.noreply.github.com>
2021-03-05 14:03:55 +01:00
12xx12
5fa45182e8
fixed the crash on generating in the SinglePiceStructuresGen (#5136) 2021-03-05 14:28:36 +02:00
Tiger Wang
81e299f00c Mark UNREACHABLE with intrinsics 2021-02-20 17:46:02 +00:00
Tiger Wang
6aa1d13508 Clang 7? 2021-02-11 01:24:50 +00:00
Tiger Wang
2f1359a0f9 Fix march=native not being enabled
* LINUX doesn't exist apparently, use UNIX instead
+ Add some platform-specific logic to determine whether to use mcpu or march
- Remove duplicated compile option comments
+ Add STATUS level to messages
2021-02-11 01:24:50 +00:00
Tiger Wang
86cfb38211 MSVC warnings 2021-02-10 10:30:32 +00:00
12xx12
2481190d9c CompositeChat: use variants 2021-02-08 12:41:30 +00:00
Tiger Wang
7ad054b087 Explodinator performance optimisations
Thanks @lixfel (#4246)
2021-02-07 22:36:15 +00:00
Tiger Wang
5a8e75e6aa Explodinator: fix divide by zero 2021-02-07 22:36:15 +00:00
Tiger Wang
be2bf999c2 Fix #5118 2021-02-07 22:36:15 +00:00
dImrich
925f960ea2 Adds playerlist header and footer broadcasting (1.8-1.13) 2021-02-06 14:14:40 +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
Tiger Wang
50a94f972d
Fix debug macro situation (#5114)
Use the standard NDEBUG.
2021-01-26 09:41:55 +00:00
Tiger Wang
19302eeb87 Redstone: inline -> static 2021-01-22 22:04:47 +00:00