12823 Commits

Author SHA1 Message Date
Dylan K. Taylor
d4d00a9b80
Living: added calculateFallDamage()
to clean up the way that fall damage is handled for flying players; also, onHitGround() isn't only doing fall damage things these days.
2021-09-05 14:36:58 +01:00
Dylan K. Taylor
6b7e671794
Living: use Vector3->down() instead of subtract(). 2021-09-05 14:12:04 +01:00
Dylan K. Taylor
17dfd2cc52
Living: Trigger fall sounds on the nearest collidable block below
we can't have landed on it unless it actually has a collision box - otherwise, we only landed _in_ it.
This assumes, of course, that no blocks have bounding boxes >= 2 blocks tall, which currently none do.
2021-09-05 14:10:54 +01:00
Dylan K. Taylor
d329bfb25d
Entity: rename movX/movY/movZ to wantedX/wantedY/wantedZ
this makes the code much easier to understand.
2021-09-05 14:06:53 +01:00
Dylan K. Taylor
73cc841d0b
Entity: rename checkBlockCollisions() to checkBlockIntersections() 2021-09-05 14:00:27 +01:00
Dylan K. Taylor
8be1f34736
Entity: Rename fall() to onHitGround(), and make it protected
this had no business being exposed to public API in the first place.
2021-09-05 13:36:40 +01:00
Dylan K. Taylor
6ecad153ea
Entity: remove fallDistance parameter from fall() 2021-09-05 13:34:43 +01:00
Dylan K. Taylor
7e82cafdeb
Entity: remove a bunch of commented code that no one cares about 2021-09-05 13:27:48 +01:00
Dylan K. Taylor
7d5b9295cb
PoisonEffect should accept Translatable|string, like its parent
this doesn't really break anything, but someone will likely whine about consistency if it's not fixed now.
2021-09-03 21:33:55 +01:00
Dylan K. Taylor
0404298c74
Effect: get rid of runtimeIDs 2021-09-03 21:25:06 +01:00
Dylan K. Taylor
c062282954
Drop enchantment runtime IDs 2021-09-03 21:20:43 +01:00
Dylan K. Taylor
ed1e7322dd
be quiet phpstan 2021-09-03 21:16:37 +01:00
Dylan K. Taylor
f95eb6a218
Server is not cloneable 2021-09-03 21:08:29 +01:00
Dylan K. Taylor
62435fe935
Standardize clone denying 2021-09-03 21:07:39 +01:00
Dylan K. Taylor
b026ada489
Standardize serialize denying 2021-09-03 21:07:10 +01:00
Dylan K. Taylor
aa5a9f6d12
Enchantment: use Translatable instead of hardcoded translation keys 2021-09-03 20:52:05 +01:00
Dylan K. Taylor
fbbaef4401
Enchantment: use promoted properties 2021-09-03 20:41:43 +01:00
Dylan K. Taylor
665f2473e1
Effect: stop using hardcoded translation keys for names 2021-09-03 20:39:02 +01:00
Dylan K. Taylor
8e58beef7f
Effect: use promoted properties 2021-09-03 20:32:13 +01:00
Dylan K. Taylor
078347b44a
MemoryManager: fixed a PHPStan error 2021-09-03 20:26:58 +01:00
Dylan K. Taylor
2e153624ad
Anvil: actually add slot constants, this time 2021-09-03 12:44:41 +01:00
Dylan K. Taylor
963f4a9cf3
Added constant slot IDs for Furnace, Enchanting, Anvil and Brewing Stand inventories 2021-09-03 12:16:07 +01:00
Dylan K. Taylor
2fe03757d5
PopulationTask: fixed PHPStan errors 2021-08-30 00:26:54 +01:00
Dylan K. Taylor
e0d6357eb7
OreType: use promoted constructo properties 2021-08-30 00:18:34 +01:00
Dylan K. Taylor
0289b45202
Chunk: Drop dirty flags for tiles and entities
instead, just ungate this and allow the provider to decide what to do.
Any chunk that contains entities or tiles is already always considered dirty, so the only thing the flags are good for is flagging chunks that previously had tiles and/or entities but no longer do.
In those cases, it's just removing keys from LevelDB anyway, so it's already very cheap.
Avoiding these redundant deletions is not worth the extra complexity and fragility of relying on flags to track this stuff.
2021-08-30 00:09:36 +01:00
Dylan K. Taylor
6c85d4d254
CommandReader: fixed CS with php-cs-fixer 3.1.0 2021-08-29 23:35:07 +01:00
Dylan K. Taylor
994a2c9eb9
Clean up entity/tile data loading from world providers 2021-08-29 23:11:18 +01:00
Dylan K. Taylor
b4e23a57d2
CraftingDataCache: Replace hardcoded recipe block names with constants from BedrockProtocol 2021-08-29 16:26:18 +01:00
Dylan K. Taylor
8847aa2d7f
LegacyStringToItemParser: mark as deprecated, and point people towards StringToItemParser, which is much nicer 2021-08-29 16:13:19 +01:00
Dylan K. Taylor
dee2062b1b
CraftingManager: Reduce footprint of recipe keys
this was using json before, which is horribly inefficient.
This saved about 200 KB of memory on initial startup (which isn't much, but for more complex recipes, it might have been significantly worse.
2021-08-29 15:49:18 +01:00
Rush2929
c2558573e2
Fix offhand pickup (#4412) 2021-08-29 12:45:23 +01:00
Colin
2139171a55
added BlockItemPickupEvent class (#4402) 2021-08-29 00:40:09 +01:00
Dylan K. Taylor
938e430b0f
Convert Populator into an interface 2021-08-27 20:41:54 +01:00
Dylan K. Taylor
c7f78bec15
Added missing change to complete beba0ffe1578e0632e98b2c38f3c446f2ee0266c 2021-08-27 20:33:17 +01:00
Dylan K. Taylor
6c1fec8a29
Tree: renamed generateChunkHeight to generateTrunkHeight
I guess it must have been late at night when I originally wrote this code.
2021-08-27 20:32:07 +01:00
Dylan K. Taylor
beba0ffe15
Remove circular dependency between Tree and its children 2021-08-27 20:25:21 +01:00
Dylan K. Taylor
4778c1483a
Tree: fixed formatting error 2021-08-27 20:14:31 +01:00
Colin
8f89c04c51
Refactor Tree classes (#4407) 2021-08-27 20:11:05 +01:00
marshall
ee16a00c57
World: do not attempt placement of itemblock if stack size is zero (#4410)
This doesn't make any sense, and also caused a crash.
2021-08-27 13:14:56 +01:00
Dylan K. Taylor
d9b9aed2cc
Fixed CS 2021-08-26 15:31:28 +01:00
Dylan K. Taylor
7919a1a1c5
Drop support for commands with spaces in the names
the use case for this is basically zero, since the community prefers implementing their own subcommand systems instead (which are much more flexible).
In addition, allowing spaces in command names makes it extra complicated to display helpful information to the user, such as the command that was actually accepted by the command map (which would be useful for identifying accidental invisible characters / control characters when sending commands).
2021-08-26 15:24:35 +01:00
Dylan K. Taylor
e140614a63
Localize /gc 2021-08-26 15:06:43 +01:00
Dylan K. Taylor
47120022c2
Localize messages for /op and /deop 2021-08-26 13:31:19 +01:00
Colin
4189fbdaef
Added StructureGrowEvent (#4354)
This event is currently fired for tree and bamboo growth. Its intended use is for any plant growth that affects multiple blocks at once.

TODO: We could explore using this for cacti and sugarcane?
2021-08-25 14:05:30 +01:00
marshall
6e68e99ec0
Added PlayerEntityInteractEvent (#4374) 2021-08-24 11:56:10 +01:00
Colin
224d71f272
World: renamed getChunks() to getLoadedChunks() (#4393) 2021-08-23 21:23:35 +01:00
Dylan K. Taylor
2d025bf02f
Populate StringToItemParser with some names from VanillaBlocks
this makes just about everything easily accessible via commands.
There are some stuff that shouldn't be here due to not being actual items (e.g. door blocks, bed blocks, wall coral fans) but since there were legacy aliases for all those things already, I figured what the heck - it's more effort to exclude them, so whatever.
2021-08-23 14:49:30 +01:00
Dylan K. Taylor
78b0275a6c
StringToItemParser: added a bunch of nice new aliases
this should especially make potions less cancerous to /give.
2021-08-23 14:25:00 +01:00
SalmonDE
7fd712c1ff
Refactor Block & Tile: getPos() to getPosition() (#4395)
this also changes the name of the class property 'pos' to 'position' as well as Block->getPosOffset() to Block->getPositionOffset()
2021-08-23 14:01:32 +01:00
Dylan K. Taylor
22316976fa
Introduce next-generation StringToItemParser
this isn't specced up with some of the finer features of LegacyStringToItemParser such as metadata parsing, but those are still a work in progress (and probably limited to specific items like durable stuff).
The goal is to unbind these aliases from legacy internal IDs, while also providing a nice flexible way for plugins to add their own items and aliases to the existing system.

This system allows mapping a string to any item at all, irrespective of state, internal IDs, or any of that nonsense. This means it's finally possible to have stuff like lapis_lazuli and bone_meal aliases in commands.
2021-08-23 00:39:20 +01:00