721 Commits

Author SHA1 Message Date
Dylan K. Taylor
ec28612a12 BlockFactory: partial revert of 515e4aabc45c057e215e5f695a94a7bd7b0e1094
it's necessary to register these to fill the static property arrays. Someday these won't be necessary I hope...
2018-06-01 17:08:58 +01:00
Dylan K. Taylor
d535fe20a3 BlockFactory: split up static ID mapping registration from other things
this is actually HUGELY WASTEFUL on memory. An average of 3 MB is wasted per AsyncWorker on this.
2018-06-01 10:28:53 +01:00
Dylan K. Taylor
515e4aabc4 BlockFactory: minor reduction in memory usage
removing useless array and don't pre-populate with UnknownBlock objects
2018-06-01 10:15:20 +01:00
Dylan K. Taylor
619390c5b7 Sapling: Account for light level when trying to grow on random ticks 2018-05-11 09:53:03 +01:00
Dylan K. Taylor
b21572774a Tool: cleanup durability handling, closes #379
long overdue... this isn't quite as extensible as the original api3/blocks system was, but this is primarily intended to replace Item->useOn(). If plugins want to use it it can be extended later on.
2018-05-10 19:48:51 +01:00
Muqsit
e7c5d14af3 Fix DoubleSlab name (#2177) 2018-05-09 21:17:35 +01:00
Dylan K. Taylor
532269a484 Implemented block break XP drops 2018-04-15 19:03:18 +01:00
Dylan K. Taylor
46cbcb0c42 Fixed fire with no nearby flammable blocks burning for too long 2018-04-10 10:07:14 +01:00
Dylan K. Taylor
af9b0b019d Added BlockBurnEvent 2018-04-10 10:04:11 +01:00
Dylan K. Taylor
7db8845375 Fire has a 1/3 chance of aging on a random or scheduled tick 2018-04-10 09:59:54 +01:00
Dylan K. Taylor
9a1d3aec6b Flammable blocks adjacent to fire now burn away
There are some strange bugs with blockupdating causing invisible client-side-only fires that need to be investigated.
2018-04-10 09:59:10 +01:00
Dylan K. Taylor
670a53ba3b Fire: fixed logic of extinguishing 2018-04-10 09:58:58 +01:00
Dylan K. Taylor
f22ad14c67 Block: added isFlammable() 2018-04-10 09:58:35 +01:00
Dylan K. Taylor
64540f36be Block: added burnsForever() 2018-04-10 09:58:21 +01:00
Dylan K. Taylor
e66b1953de Block: added flame encouragement and flammability properties 2018-04-10 09:58:08 +01:00
Dylan K. Taylor
aa6666872a BlockFactory: added a hack for weird air blocks with non-zero damage values
I don't know what causes this to occur, but they should never have non-zero damage values, so we discard the metadata.
2018-04-09 16:35:31 +01:00
Dylan K. Taylor
5b7b2dd0e2 Merge changes from ALPHA11 for 1.2.13 2018-04-04 11:31:39 +01:00
Dylan K. Taylor
a1cf5dbd1e fix doc inconsistency 2018-04-04 11:01:14 +01:00
Dylan K. Taylor
c86132028e BlockFactory: add new "dynamic" fake runtime IDs for unknown legacy ID/meta combinations
This is basically how blockstate discovery would actually work in the full-blown system. This maps blocks with unrecognized blockstates to static runtimeIDs not known to the client.

This means that all blocks which don't have corresponding runtimeIDs in the new system will translate to update! blocks instead.

Mojang do this differently: they try to a) match id+meta, if that fails b) match id+0, and if that fails, then replace with update! block runtime ID. I can't do that here because I need to be able to convert both ways. They only need to be able to convert from legacy -> new.
2018-04-04 11:00:58 +01:00
Dylan K. Taylor
5ce55bd3b0 duct tape for block ID remapping 2018-04-04 11:00:39 +01:00
Dylan K. Taylor
1d5978df98 Fixed falling blocks getting moved by currents, closes #2080 2018-03-30 12:20:59 +01:00
Dylan K. Taylor
5d32587cf7 DeadBush: match placement condition with break condition, fixes #2116 2018-03-30 11:54:57 +01:00
Dylan K. Taylor
1f4f8ab3f0 Inventory: Removed BigCraftingGrid, allow arbitrary size parameter
This is more flexible and requires less classes.
2018-03-29 11:24:28 +01:00
Dylan K. Taylor
a4c50d3204 Remove unused imports 2018-03-24 11:59:15 +00:00
Dylan K. Taylor
1648fff916 Replaced Position->getLevel() null checks with isValid() 2018-03-20 11:10:36 +00:00
Dylan K. Taylor
ac5a91b67e Cleaned up bool comparison mess 2018-03-19 14:10:55 +00:00
Dylan K. Taylor
3d89bf5693 Updated PocketMine Math dependency 2018-03-18 18:08:24 +00:00
Dylan K. Taylor
eeeef8df51 Fixed concrete powder not falling 2018-03-16 16:43:47 +00:00
Dylan K. Taylor
bf97eab98f Block: remove redundant local variable from collidesWithBB() 2018-03-15 09:38:14 +00:00
Dylan K. Taylor
a9a55e9558 GlowingRedstoneOre: fixed infinite recursion and crash on block update
closes #2104

The inheritance of GlowingRedstoneOre from RedstoneOre maybe should be reconsidered. They only share properties in reality.
2018-03-15 09:24:48 +00:00
Dylan K. Taylor
86eee429bb Block: Split onUpdate() into several functions, removed Level::BLOCK_UPDATE_* constants
This allows the removal of lots of ugly code, and also exposes lots of similarities with how this update type was handled. This can be further improved in the future to more generically handle cases.

I realized in the process of changing this, that it might actually be simpler to treat to treat scheduled updates and neighbour updates as one and the same. They use the same mechanism for being saved on chunks (TileTicks),
and doing that would make updating only require one queue instead of two.

RedstoneOre: use onActivate() to trigger glowing
this is not technically correct behaviour, but this preserves the current behaviour.
2018-03-13 17:29:46 +00:00
Dylan K. Taylor
6a1f8640f6 Cactus: fix bugs in local block updating 2018-03-13 11:40:45 +00:00
Dylan K. Taylor
cd35bd6872 git diff-tree --check $(git hash-object -t tree /dev/null) HEAD 2018-03-11 10:31:25 +00:00
Dylan K. Taylor
73a5788774 Door: remove unused local variable 2018-03-07 18:53:38 +00:00
Dylan K. Taylor
dc3bf8546e Refactored effects handling, split up concerns of effect types and instances
Removed json insanity for effects

Split up effect types and effect instances

Saturation is an instant effect
2018-03-07 12:42:31 +00:00
Dylan K. Taylor
f0535df96d Remove deprecated things 2018-02-27 11:59:16 +00:00
Dylan K. Taylor
ffe89f5e1b fixed Anvils item/block different logic handling, close #1910 2018-02-16 11:07:50 +00:00
Dylan K. Taylor
af2435f199 Removed redundant checks from ItemFactory::init() and BlockFactory::init()
These are never called accidentally, or at least it's highly unlikely to do so. It might be reasonable to throw exceptions for this, but for the meantime they are redundant - extra indentation for no good reason.

This also removes the $force parameter from BlockFactory::init().
2018-02-15 17:42:03 +00:00
Dylan K. Taylor
a84aba5517 Replaced some bad usages of Vector3 get*() with their respective getFloor*() 2018-02-14 18:45:10 +00:00
Dylan K. Taylor
9abfd54cc1 Updated with ListTag changes from PocketMine-NBT 2018-02-13 16:50:49 +00:00
Dylan K. Taylor
906d7eb176 Lang: Move TranslationContainer and TextContainer to \pocketmine\lang namespace
why the hell were they ever put in \pocketmine\event in the first place??

This change was suggested many months ago but I forgot all about it.
2018-02-04 20:03:30 +00:00
Dylan K. Taylor
3842ee15cf Item: Removed now-obsolete Cake class
>> As of 1.2, cake has a max stack size of 64, making this class redundant as its only purpose was to declare a stack size of 1.
2018-01-25 10:09:09 +00:00
Dylan K. Taylor
e36b38939c Lever: fix placement 2018-01-21 17:53:41 +00:00
Dylan K. Taylor
9c65a2b890 Furnace: Fixed lit furnaces dropping the wrong item
closes #1915
2018-01-17 10:24:01 +00:00
DaPorkchop_
e850f34d76 Fix TNT block not setting fuse NBT correctly (#1917) 2018-01-14 18:10:57 +00:00
Dylan K. Taylor
8d7c65585c
Enchantment: Implement Silk Touch (#1912) 2018-01-14 13:37:27 +00:00
Dylan K. Taylor
96f6362117 Fixed glowing redstone ore giving itself when block-picked 2018-01-14 13:35:41 +00:00
Dylan K. Taylor
45b02d92d4 Math: Added RayTraceResult, removed dependence on MovingObjectPosition
MOP doesn't make any sense anyway.

RayTraceResult is a container which represents the point at which a line hits a bounding box. No dependence on blocks or entities is wanted or needed.
MovingObjectPosition has API changes to allow it to wrap RayTraceResult, but nothing uses MOP anymore anyway.

This would allow modularisation of the pocketmine\\math namespace.
2018-01-12 14:28:41 +00:00
Dylan K. Taylor
5f48433c95 Bucket: Added sounds for bucket fill/empty 2018-01-03 14:27:41 +00:00
Dylan K. Taylor
33352638a9 Bucket: Fixed appearing empty when picking up still liquids
Buckets already affected by this bug will still appear empty until used. After that they'll work fine.
2018-01-03 14:22:53 +00:00