Commit Graph

395 Commits

Author SHA1 Message Date
peterbell10
05c9e06be1
Remove blocking GetHeight (#4689)
* WIP: Remove blocking GetHeight

* Make CheckBasicStyle.lua happy

* Update comment and style

* Update lua bindings and docs

* Rework chunk loading in GenerateRandomSpawn

Explicitly use chunk stays instead of relying on chunks loaded by
`cSpawnPrepare` to not unload.

* Fix variable shadowing

* Update to C++17

* Add note about empty chunks to IsWeatherWetAtXYZ API docs

* Cleanup, fix some of the remaining merge issues.

---------

Co-authored-by: Alexander Harkness <me@bearbin.net>
2024-11-30 11:16:53 +00:00
Angus
5e258c6d95
Move monster speed to monsters.ini (#4500)
* Add walking and running speed to monsters.ini

* Add entry to CONTRIBUTORS

* Add SetRelativeRunSpeed to APIDesc.lua

* Fix typo

* Remove unnecessary cast

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

* Use relative walk speed as a modifier to base walk and run speeds

* Rename Default to Base in Walk/Run Speeds

* Update docs.

---------

Co-authored-by: peterbell10 <peterbell10@live.co.uk>
Co-authored-by: Alexander Harkness <me@bearbin.net>
2024-11-10 11:28:39 +00:00
NiLSPACE
a99c3ec2b8
Added code to export definitions for a lua-language-server (#5475)
* Added code to export definitions for a lua-language-server

* Renamed VSCode -> LLS

* Fixed global variables/functions in APIDump being part of API docs

* Added article explaining how to configure lua-language-server
2024-11-04 22:43:20 +00:00
NiLSPACE
64e97c8d16
Fixed dumpinfo plugin not finding Info.lua file if the plugin folder and name don't match (#5563)
Co-authored-by: Niels <niels.breuker@outlook.com>
2024-05-27 10:42:07 +02:00
NiLSPACE
884e3e97a6
Added extra possible Info.lua parameter that describes the dependencies (#5554) 2024-04-10 19:52:31 +02:00
Mattes D
ed0b090383 Plugin InfoDump: Fall back to gPluginInfo if g_PluginInfo not found. 2024-03-20 12:35:13 +01:00
Mattes D
5fd7cc3646 Plugin InfoReg: Read the info from param 2024-03-17 21:12:43 +01:00
Spongecade
ebeb164d2b
Update Minecraft Wiki links to new domain (#5532)
* Update Minecraft Wiki links to new domain

* Added Spongecade to contributors

* Sorted Spongecade
2023-09-27 20:07:42 +02:00
Debucquoy Anthony tonitch
7db4e20fd7
adding endermite (#5460)
* First Draft of adding endermite

* Update src/Mobs/Endermite.h

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

* Adding Protocols + SpawnEgg

TODO: don't forget to put the endermite in core plugin for the summon
command

* Adding endermite to monster.ini

* Adding 5% change of spawning endermite when throwing enderpearl

* Spawn endermite at last position instead of Hit Position + .cache to .gitignore

* fixup! Spawn endermite at last position instead of Hit Position + .cache to .gitignore

* destroy endermite if 2 min, not if name is set

* Syntax

* Adding Enderman targeting endermite + fixing syntax

* Fixing compile error + return error [but crash on enderman spawn]

* Fix crash but enderman doesn't target

* Enderman targeting endermite finished

* checking style because i'm a noob at git...

* fixup! checking style because i'm a noob at git...

* Added endermite egg meta to docs

* Final touches

Removed unnecesary imports
fixed callback to run only in sight distance and actually check sigtlines

* Fixed error after not pulling branch

---------

Co-authored-by: x12xx12x <44411062+12xx12@users.noreply.github.com>
Co-authored-by: Debucquoy <debucqquoy.anthony@gmail.com>
2023-09-26 21:54:37 +00:00
Mat
a819f37fa1 Update Core 2023-09-26 21:11:04 +03:00
Mattes D
97c49c6f29 cTCPLink and cUrlClient accept list of trusted root CAs for TLS. 2023-05-19 16:25:12 +02:00
Michal Havlíček
669392d44a
Implement slime chunks. (#5484)
* Implement slime chunks.

* add cWorld::IsSlimeChunk

* add documentation for cWorld::IsSlimeChunk
2023-04-08 00:11:10 +02:00
x12xx12x
ceaebd00d8
Small Team Creation Fixes (#5479)
- Add additional explanation for team creation
- error message if team creation fails because team already exists

fixes #5466
2023-03-26 22:25:54 +00:00
Jomar Milan
fddbf65e28
Handle newlines in cIniFile (#5447)
* Handle newlines during read and write in cIniFile

When reading the ini file, replace \n with newline. When writing,
replace the newline with \n.

* Use ReplaceString instead of regex in IniFile

* Update cIniFile description

* Removed duplicate variable

* Revert "Removed duplicate variable"

This reverts commit de11bac047.

* Removed duplicate variable

Now without plugin changes

---------

Co-authored-by: x12xx12x <44411062+12xx12@users.noreply.github.com>
2023-03-22 11:20:59 +01:00
Michal Havlíček
847884b6a8
TNT minecarts exploding when riding over activator rails (#5469)
* TNT Minecarts exploding via activator rails

* Fuse animation

* Add TNT minecart explosion source to APIDesc
2023-01-25 20:50:08 +00:00
x12xx12x
3b2a501524
Update Core Plugin (#5453) 2022-10-28 19:29:52 +03:00
Debucquoy Anthony tonitch
16f3355bbb
rework of the color code with & and standard codes (#5416)
* adding build* to gitignore and tags for ctags

* Notation Changes

* Adding & Parser

* Avoid crash when & as first character

* Looking for @ in the rest of the project

* Formating style

* Modifying test to reflect new behaviours

* Adding a check for the first part

* fixup! Adding & Parser

style changes

* Update APIDesk.lua

* Update src/CompositeChat.cpp

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

* explaination on the antishlash with ampersand

* adding old deprecated formating

* Update src/CompositeChat.cpp

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

* Update src/CompositeChat.cpp

* Update src/CompositeChat.cpp

Co-authored-by: Debucquoy <debucqquoy.anthony@gmail.com>
Co-authored-by: x12xx12x <44411062+12xx12@users.noreply.github.com>
2022-10-25 13:42:04 +02:00
Mat
c61dab94bd Update Core 2022-09-28 22:50:24 +03:00
Mat
b73cd1179f Update Core 2022-08-29 17:44:39 +03:00
Tiger Wang
64a24a4c79
ClientHandle: Fix block interaction regressions (#5431)
* ClientHandle: Fix block interaction regressions

* Fix reach distance being halved.
* Fix fire extinguish not working, fixes #5422.

* AddFaceDirection: deprecate non-vector version
2022-07-16 11:04:14 +00:00
x12xx12x
63b63c5d84
Added check for unexported but documented API (#5418)
Also fixed the errors
2022-05-06 23:26:13 +00:00
DarkoGNU
5d00247cce
Implement ranged attack for snow golems. Fix failed assertion (#5417)
* Implement ranged attack for snow golemas. Fix failed assertion when stopping the server

* Decrease snowball speed

* Adjust accuracy for snow golems

* Use a getter instead of m_World
2022-05-06 23:24:50 +00:00
DarkoGNU
4f554e91ab
Implement farmland trampling (#5401)
* Add DarkoGNU to CONTRIBUTORS

* HandleFarmlandTrampling function & its docs

* Fix decimal separators (, -> .)

* Fix style. Adjust thresholds. Make function non-virtual

* Adjust thresholds again. Prepare for fixing #5402

* Trying to fix falling through farmlands

* Another style fix

* Add FarmlandTramplingEnabled to world.ini

* Docs for IsFarmlandTramplingEnabled

* Style

* Farmland trampling - handling the random chance

* Trampling kinda works, very buggy

* Trying to fix clang-tidy

* Fix trampling

* Trying to fix the 'undocumented API symbol'

* Implement bearbin's suggestions

* Calculate volume properly

* Don't use std::pow for squaring

* Improved comments

* Really, should comments' style be checked?
2022-04-21 18:56:21 +00:00
Simon Pribylski
f4c0429996
Add player permission level (#5358) 2022-01-24 20:24:55 +00:00
Persson-dev
fec64bb91c
Improved farmer AI & Fixed entity loading functions (#5351)
* Allow villagers to pickup items

* Add farmer villager harvesting

* Use of auto keyword

* Using for loop to check adjacent crops

* Show particules when farmer harvest

* Fix area comment

* Move constants to header file

* Removing unnecessary semicolon

* Initialization of CropBlockType variable

* Apply 12xx12 suggestion

* Fixing area constant size

* Refactor bounding box calculation, use vectors.

* Add Api documentation

* Update lua docs

* Rework farmer ai

* Fixing lua docs notes

* Add missing capitalisation

* Add villagers inventory save

* Fixing loading entities from disk inconsistencies

* Add farmer harvest animation

* Fix beetroots grow state

Co-authored-by: Alexander Harkness <me@bearbin.net>
2021-12-29 20:28:41 +01:00
Feyo Korenhof
1be14ebf7f
Added ExperienceAmount variable to HOOK_PLAYER_FISHING and HOOK_PLAYER_FISHED (#5345)
* Implemented cServer::ScheduleTask() and cServer::TickQueuedTasks()

* Fixed formatting and added ScheduleTask to APIDesc

* Added feyokorenhof to contributors

* Added ExperienceAmount variable to all the hook calls.

* Made ExperienceAmount int reference instead of int in HOOK_PLAYER_FISHING. Fixed bug: a_Reward is now a reference

* Add documentation, change ItemFishingRod to pass in experience

Co-authored-by: Alexander Harkness <me@bearbin.net>
2021-11-29 12:53:58 +00:00
AirOne
39392bbeae
Bind more ClientHandle functions to Lua (#5334)
+ Bound the following functions to Lua
  + SendBlockBreakAnim
  + SendCollectEntity
  + SendDestroyEntity
  + SendDetachEntity
  + SendEditSign
  + SendLeashEntity
  + SendThunderbolt
  + SendUnleashEntity

Co-authored-by: BuildTools <unconfigured@null.spigotmc.org>
2021-11-22 00:26:33 +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
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
Alexander Harkness
940e03d0ec
Update Core (#5274) 2021-07-25 19:50:19 +03: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
Tiger Wang
17048fc1e3 Documentation: add statistics descriptions 2021-06-28 21:54:21 +01:00
Tiger Wang
208616041f Documentation: update chat colour link 2021-06-28 21:54:21 +01:00
Tiger Wang
ddf352e1e3 Remove orphaned API symbols
https://github.com/cuberite/cuberite/issues/5195#issue-860458139
2021-06-28 21:54:21 +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
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
Feyo Korenhof
9ddc3635d6
Implemented cServer::ScheduleTask() and cServer::TickQueuedTasks() (#5224) 2021-05-26 18:07:32 +02: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
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
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
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
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
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
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
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
3e3c30496d Add heraldry names to banner pattern API docs 2021-03-15 11:07:54 +00:00
Tiger Wang
45591cbe7b
Properly deprecate more XYZ parameter'd functions (#5147)
* Fixes #5144
2021-03-15 02:28:18 +00:00
Tiger Wang
00e6239b20 Update Core 2021-03-06 01:30:55 +00:00