1
0
Commit Graph

11123 Commits

Author SHA1 Message Date
Tiger Wang
47c0b48bfd Monsters: improve targeting
* Replace DoWithNearestPlayer with bounding box search (avoid iterating through all players in world).
* Do line-of-sight checks from eye-to-eye.
+ Added LOS and LOS lost timer to target lost checks, in addition to distance.
2020-12-21 13:52:23 +00:00
Tiger Wang
491238f799 Chunk: use FAST_FLOOR_DIV 2020-12-21 13:52:15 +00:00
Tiger Wang
e7331fe820 Improve Silverfish search
* Start from the inside out, don't always look at the entire search space by bailing out randomly
2020-12-21 13:52:06 +00:00
Tiger Wang
d9cd2f741d Comment and code style fix
+ Add static keyword
- Don't capture everything in lambda
2020-12-21 13:52:06 +00:00
Tiger Wang
742e27ad2f Remove unused Temporary namespace
- Remove unused temporary mapping generation at startup
2020-12-21 00:11:34 +00:00
the1robert
73ae985a4b Enable LOS checks for Hostile Mobs. 2020-12-20 02:00:44 +00:00
KingCol13
616c1dafbf Trace to surface of cube. 2020-12-19 13:28:02 +00:00
Aiden Neill
a7e9f88ff3
New pull request for daylight sensor (#5066)
* Fixes #4918

Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-12-19 01:42:34 +00:00
cflep
7fbe4a0126
Added dimension check to nether portal (#5068)
+ Added dimension check to nether portal
2020-12-18 21:10:14 +00:00
bwats97
28b8febce4
Added the ability for white beds to be dyed (#5077)
+ Added Ability for white beds to be dyed
2020-12-18 21:09:55 +00:00
mathiascode
2103308618 Ignore CanFly flag sent by the client 2020-12-18 21:03:50 +00:00
Tiger Wang
090d8305e4 Warnings improvements
* Turn off global-constructors warning. These are needed to implement cRoot signal handler functionality
* Add Clang flags based on version lookup instead of a compile test. The CMake config process is single threaded and slow enough already
* Reduced GetStackValue verbosity
+ Clarify EnchantmentLevel, StayCount, AlwaysTicked, ViewDistance signedness
+ Give SettingsRepositoryInterface a move constructor to simplify main.cpp code
- Remove do {} while (false) construction in redstone handler
2020-12-18 21:03:40 +00:00
Tiger Wang
83e18f6d31 Horsies: don't always broadcast metadata 2020-12-18 20:44:06 +00:00
Azurethi
1c5af8c00d Fixes incorrect var name in RsaPrivateKey.cpp
Fixed an incorrect variable name in src/mbedTLS++/RsaPrivateKey.cpp : cRsaPrivateKey::Decrypt.
2020-12-05 00:12:48 +00:00
cflep
5aad42a4d0
Light the nether portal when switching dimensions (#5062)
* Fixes #5007
2020-12-01 01:02:19 +00:00
Tiger Wang
98cf4025ce BlockInfo: float-equal for Clang only 2020-11-28 20:49:33 +00:00
Tiger Wang
815f2aed82 Lilypads: add missing boundary check 2020-11-28 20:48:53 +00:00
Derek Qu
7027b2279f
Fix lilypad displacing block above (#5056)
* Fix lilypad displacing block above

Side fixes:
* Fix lilypad displacing half slabs
* Fix lilypad being placed on flowing water and non-water blocks in
general

Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-11-28 01:01:47 +00:00
Derek Qu
280f7a81f4
Note Block Left Click Fix V2 (#5052)
+ Add function to play note block on left click
2020-11-26 00:58:35 +00:00
Aiden Neill
3d044d2dde
Added magma block contact damage (#5055)
* Added magma block contact damage
* Fireproof entities do not take damage from magma
* Fire resistance prevents magma damage
* No magma damage when hovering over magma block
2020-11-25 17:56:55 +00:00
12xx12
e35519ec8a
Adding new monster types to enum and saving/loading for easier future implementation (#4941)
* added new monster types to enum
added string <-> enum conversion in namespace serializer
added loading functions
added to saving

* renamed zombie pigman to zombified piglins in enum

Co-authored-by: 12xx12 <12xx12100@gmail.com>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-11-22 23:41:13 +00:00
Derek Qu
a0afd13233
Add coloured glass pane recipes (#5032)
+ Add coloured glass pane recipes using uncolored glass panes
2020-11-15 16:45:02 +00:00
Tiger Wang
0c69b648ae HTTPServerConnection: more robust error handling
* Fix passing a nullptr to downstream code when the request was malformed
+ Reset the connection on errors
* Fixes #5029
2020-11-14 12:24:42 +00:00
mBornand
58def8f7df
Fix flower and foliage generation (#4723)
* fix flower generation
- remove wrong mushroom and flower generation
+ add "tiny" mushrooms in Mushrooms biomes
+ add "tiny" mushrooms in Mega Taiga and variants
+ add tulip generation for plains biomes
* Turn numbers into constants
- Remove duplication of grass generation
- Remove fern in inappropriate biomes
* added roofed forest flowers to ini file
* fixed crash with biMesaPlateuM
+ Use empty()
+ Emplace directly
+ Avoid a string copy in BiomeName
+ Alias BiomeIndex to avoid multiple casts

Co-authored-by: 12xx12 <12xx12100@gmail.com>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-11-14 12:24:31 +00:00
12xx12
283b9d706c
Some const and inheritance correctness (#5014)
* Some const and inheritance correctness
* Devirtualise SendBlockTo(Vector3i)

Co-authored-by: 12xx12 <12xx12100@gmail.com>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-11-13 21:50:46 +00:00
12xx12
14a00d0051
changing cComposite Chat to newer c++ standart (#5028)
* upgraded to new C++ for loops and fixed errors

* readded delete instruction

* now using unique ptr

* added test for text only (that was causing an error for me)

* using unique ptr constructor

* added move constructor and deleted copy constructor

* fixed deconstuctor
http prefixes are constexpr and std::string_view

* fixed whitespace

Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-11-11 22:38:51 +01:00
0ddlyoko
672bb04570
Add correct implementation of crops (#4802)
* [FIX] Add correct implementation of seed drops.

> Official percentage of drops has been implemented

* Fix C++ conventions

* Change "Vals" variable to "m_Vals"

* [FIX] Add correct implementation of Carrots, Potatoes, Wheat & Beetroots seed

* Add Fortune support with crops

Add fortune support with Wheat, Carrots, Potatoes & Beetroots seeds

* [FIX] Right-clicking on a grown Beetroot in survival consume 2 bone meals

Fix #4805

* Add documentation for "cWorld::IsFullGrownPlantAt" method

* Fix dispenser that full grown a plant

> Change methods cItemDyeHandler::FertilizePlant & cItemDyeHandler::growPlantsAround to static

* Display particle even if tree doesn't grow

* When right-clicking on a full grown melon / pumpkin seed, no longer produce a melon / pumpkin

Before this commit, when you right-click on a melon or a pumpkin seed, a melon / pumpkin block spawned.
With this commit, it no longer spawns

* [FIX] Do not create melon / pumpkin block when right-clicking with a bone meal

This fix will prevent the creation of a melon / pumpkin block when you right-click with a bone meal on a melon / pumpkin plant
- It just detect if the plant is full grown. if yes, the method "Grow" is not called

- Remove IsFullGrownPlant

Co-authored-by: 12xx12 <12xx12100@gmail.com>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-11-06 16:54:01 +00:00
12xx12
36a67df105
Ender Crytal Fix and report proper cmake file for luabindingscheck fail (#5017)
* fixed network
fixed explosion
fixed ticking

added network broadcast to Setter method

added nullptr protection

using macros in 1.10 Protocol_1_10.cpp

revealed functions to LUA API

small fixups, typos, less functions used

fixed more doc

readded info that saving is done only if the beam is displayed

made the constructor transfer all needed members

fixed wrong commit

removed default parameters on SpawnEnderCrystal

fixed wrong metadata

moved call to destroy in the right place

fixed some typos

Fixed Ender Crystal

* fixed documentation

* fixed doc and added proper error message

* Parameters, arrows

* Parameters

Co-authored-by: 12xx12 <12xx12100@gmail.com>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-11-06 15:00:59 +00:00
Tiger Wang
645fea4237
Players are no longer kicked when clicking on bedrock (#5023)
* Players are no longer kicked when clicking on bedrock
* Fixes #5022
2020-11-06 14:58:47 +00:00
Tiger Wang
1ed782787a Rein in light spread by correcting falloff value
* Fixes #5018
2020-11-02 15:44:23 +00:00
12xx12
177cf041db
Added new flowers on bonemeal use (#5011)
+ Added new biome-dependent flower placement
* Update planter algorithm

Co-authored-by: 12xx12 <12xx12100@gmail.com>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-11-02 15:44:02 +00:00
Lukas Pioch
ce1ceba5b3
Corrected type for param Pos on spawn enter crystal (#5012) 2020-10-30 09:38:11 +01:00
12xx12
961d5eb420
Add beam target, configurable base visibility to Ender Crystals (#5010)
* Fixes #4990

Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-10-29 20:47:20 +00:00
Tiger Wang
6d85435f60 Remove BLOCKENTITY_PROTODEF 2020-10-24 18:49:38 +01:00
KingCol13
c11ca96c3d
TNT Changes (#4970)
+ Make TNT drop pickups, change a few comments.
+ Give each ray random intensity, instead of each explosion.
* Use direction instead of destination, rewrite for pairs of edges.
2020-10-24 18:48:48 +01:00
Tiger Wang
64442b05f8
cBlockInfo: further cleanup (#5001)
* cBlockInfo: further cleanup

+ Use switch statements instead of lookup in dynamically initialised arrays
- Remove some deprecated bindings

* Update Stubs removing references to BlockInfoArray
2020-10-18 15:37:07 +00:00
Tiger Wang
f8d72c8fa9
MUSL stack size (#4995) 2020-10-17 11:31:40 +00:00
12xx12
c07ea7b9ab
added const correctness on some functions in cPlayer (#4999)
Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-10-15 20:18:32 +02:00
Tiger Wang
a145980795
Fix Android builds (#4998)
Construct paths relative to the Cuberite sources with PROJECT_SOURCE_DIR, instead of wherever the first CMakeLists.txt file happened to be with CMAKE_SOURCE_DIR.

In Android's case, the latter was in a folder called android/ but that's not the root of the source tree, so any file path built off that root was wrong. This caused file-specific warnings exclusions to fail to apply.
2020-10-15 09:35:44 +00:00
Lukas Pioch
aee4778bf7
Added missing return types and fixed param types (#4996) 2020-10-13 20:59:11 +00:00
12xx12
9419c78609
Remove debug output on PieceStructuresGen.cpp (#4984)
- Remove debug output on PieceStructuresGen.cpp
- Removed Stopwatch import

Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-10-12 13:35:14 +01:00
Alexander Harkness
c8c061edf7
Update comments and code for Load/SaveOneChunk so they match (#4992)
Fixes #4991
2020-10-11 16:14:43 +00:00
NiLSPACE
bca93b17da
Simple end gen (#4973)
* Fixed current end generator

* Implemented new simplified end generation which includes a void between the main island and other islands

* Fixed basic style

* Hopefully fixed clang errors.
2020-10-11 15:44:57 +00:00
12xx12
c080f819d2
Adding Silverfish Spawning Blocks (#4946)
* added breaking, spawning, animation

* checkstyle

* added undocumented API symbols

* added changes suggested by @peterbell10

* added natural ore like generation

* fixed spawning two silverfishes

* fixed clang

* fixed clang try 2

* updated comment
unified offset

* final clang fix

* added spawning for more silverfishes if one was damaged

* fixed spawning on one hit kill

* fixed spawning on one hit kill
fixed spawning by potion damage

* fixed clang

* fixed broken build

* fixed broken build

* I should read the error message properly
fixed build now?

* added small changes suggested by @peterbell10

Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-10-11 15:27:41 +00:00
Lukas Pioch
c8a1cda48c
Corrected invalid syntax for return types in APIDoc (#4989) 2020-10-11 09:44:33 +00:00
12xx12
c0711407e9
Adding more customize options to mob spawners and improving the way to look for surrounding entities (#4955)
* added nearly any customize option

* fixed unnecessary diff
added comments

* removed unnecessary const qualifier

* fixed build

* changed to ForEachEntityInBox

* added docs

* updated lua api description

* checkstyle

* added changes suggested by @peterbell10
And now the player may break the server by setting ridiculous ranges

* updated docs
changed cast to static cast

* fixed clang

* fixed clang on WSSAnvil.cpp

Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-10-10 19:31:44 +00:00
KingCol13
b0b1ccddd1
Anvil fixes (#4976)
* Rewrite to use wiki target/sacrifice terminology.

* Fix negative damages.

* Prevent repairing if output matches target.

* Make target and sacrifice const.

* Pre-PR tidy-up

* Keep m_MaximumCost updated.
2020-10-10 19:23:25 +00:00
12xx12
32ee1708a2
Adding wolf breading and moving breeding functionality to cMonster (#4951)
* added wolf breading

* mpoved breeding to monster

* checkstyle

* fixed my IDE "helping"

* removed magic number
and fixed faster aging

* added flooring to age manipulation

* fixed copiler error

* fixed typo

* moved tps to Defines.h

* removed the TPS constant from the lua API exposure

* added inline constexpr
added explanation

* fixed broken build

* "fixed" build

Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-10-09 20:49:25 +00:00
12xx12
6fd35be67a
added check if the digger is a nullptr (#4981)
Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-10-09 20:12:19 +00:00
12xx12
d3255b3014
Beacon now checks for players in surrounding square (#4972)
* Beacon now check for players in surrounding square not every player

* added proper BoundingBox

Co-authored-by: Alexander Harkness <me@bearbin.net>

* one symbol to change everything
one symbol to break the whole build

Co-authored-by: 12xx12 <12xx12100@gmail.com>
Co-authored-by: Alexander Harkness <me@bearbin.net>
2020-10-09 19:19:22 +00:00