7034 Commits

Author SHA1 Message Date
Dylan K. Taylor
66562f24fb Made Leaves drops more generic, fix dark oak leaves not dropping apples 1.7dev-501 api/3.0.0-ALPHA10 2017-12-13 12:57:58 +00:00
Dylan K. Taylor
56f1a6ba37 Block: Migrated all trivial drops code to getDropsForCompatibleTool()
getDrops() should now be overridden only for special cases. There are some non-trivial overrides left that are going to need some extra work to clean up.
2017-12-13 12:49:58 +00:00
Dylan K. Taylor
8c47a338df Block: Remove unused imports 2017-12-13 12:44:21 +00:00
Dylan K. Taylor
7c6535283e SnowLayer: Fixed tool requirement 2017-12-13 12:39:29 +00:00
Dylan K. Taylor
c669819bbb Fixed stained/hardened clay being harvestable without a pickaxe, close #1803 2017-12-13 12:01:46 +00:00
Dylan K. Taylor
50f3231629 Fixed being able to mine double stone slabs without a pickaxe 2017-12-13 11:34:41 +00:00
Dylan K. Taylor
015cde2169 Merge branch 'master' into tools-refactor 2017-12-13 11:26:24 +00:00
Dylan K. Taylor
dc064dfa2e Level: Fixed some unnecessary double uses of Level::blockHash() 2017-12-13 11:25:36 +00:00
Dylan K. Taylor
131a6a4d19 Cache fix related to #1813: Don't cache blocks for chunks that don't exist 2017-12-13 10:47:12 +00:00
Dylan K. Taylor
67a576722c Fixed item frames placed on invalid blocks, close #1804 2017-12-13 09:46:18 +00:00
Dylan K. Taylor
b9b50dd5dc Added Block->getDropsForCompatibleTool(), removed lots of boilerplate code from subclasses
The function name is a little long-winded, but that can always be refactored later if needed. This provides a way for blocks requiring specific tools to override drops with non-standard stuff without needing to worry about what tool type was used.

It's also possible that passing the Item used here is actually entirely redundant, but again that can be fixed later.
2017-12-12 20:02:50 +00:00
Dylan K. Taylor
da3640357c Rename Block->canBeBrokenWith() to isCompatibleWithTool() and add documentation
This name better describes it. "can be broken with" implies that items which this returns false for cannot destroy the block at all, which is incorrect. What this actually returns is whether the item is the best tool to use to break the block.
2017-12-12 19:51:31 +00:00
Dylan K. Taylor
0004e7429f Added some documentation on harvest level properties 2017-12-12 16:55:00 +00:00
Dylan K. Taylor
e2e6b7516a Removed WoodenTool classes
These were only needed for their fuel properties, which are the same for all tools of the wooden tier anyway.
2017-12-12 13:55:38 +00:00
Dylan K. Taylor
b903161a5d Refactored tool efficiency handling
This fixes lots of bugs with things like wool, cobwebs, swords.
2017-12-12 13:55:36 +00:00
Dylan K. Taylor
99fe63b2a3 Added harvest level properties to applicable blocks
this fixes block-breaking animations with wrong tools, and also finally resolves the long-standing hierarchy problem in Stair.
2017-12-12 13:54:17 +00:00
Dylan K. Taylor
dbc180315e Declare tool harvest level as a property 2017-12-12 13:54:16 +00:00
Dylan K. Taylor
45983acc0d Fixed too-fast break times with wrong tool types 2017-12-12 13:54:16 +00:00
Dylan K. Taylor
a02af1053f Remove redundant overrides from WoodenTools 2017-12-12 13:54:16 +00:00
Dylan K. Taylor
7de88b9040 Tool tier efficiency should still apply if the block can't be harvested
If you use an iron pickaxe on obsidian, it still mines faster because the tool types are compatible, even though the tool is not high enough.
2017-12-12 13:54:06 +00:00
Dylan K. Taylor
58327d0514 Change block tool types to bitflags
This allows specification of multiple tool types for a block, such as cobwebs.
2017-12-12 13:51:33 +00:00
Dylan K. Taylor
db31d13f96 Added Item->getBlockToolType() 2017-12-12 13:45:52 +00:00
Dylan K. Taylor
55d0684565 Move block-breaking tool-type constants to a BlockToolType interface 2017-12-12 13:45:52 +00:00
Dylan K. Taylor
7e3cd24444 Added TieredTool->getTier() 2017-12-12 13:45:51 +00:00
Dylan K. Taylor
2088a43c56 Refactored tool hierarchy 2017-12-12 13:45:51 +00:00
Dylan K. Taylor
3beccc47cd SlotChangeAction: Remove superfluous >= 0 inventorySlot check
This is done by slotExists() anyway.
2017-12-12 10:36:53 +00:00
Dylan K. Taylor
dfc2d1dfe6 Stop hardcoding src/pocketmine/resources everywhere 2017-12-11 19:52:49 +00:00
Dylan K. Taylor
1f1531810d Added \pocketmine\RESOURCE_PATH and Server->getResourcePath() 2017-12-11 19:52:20 +00:00
Dylan K. Taylor
a5fc77749f Added -file (-f) option to start.ps1
This allows specifying a PocketMine-MP PHP file to execute (phar or source) to use to run the server, like start.sh. If not specified, auto-detection is used.
2017-12-11 19:40:02 +00:00
Dylan K. Taylor
98cb7f2e10 Removed redundant filePath from Server constructor
This parameter is hardcoded to \pocketmine\PATH in PocketMine.php. Additionally, it does not make sense for the server source path to not be the server source path. \pocketmine\PATH is accessible from the Server context, therefore it should be used and does not need to be stored.
2017-12-11 19:25:06 +00:00
Dylan K. Taylor
e58db75396 Level: Remove redundant null checks from useBreakOn()
These checks are not needed as of 3eae7a187524233f35deae028b01cf58ccd48157.
2017-12-11 16:31:43 +00:00
Dylan K. Taylor
a94c669730 Fixed sword efficiency on anything that's not cobwebs 2017-12-11 12:57:18 +00:00
Dylan K. Taylor
45ee115b67 Player: Fixed bad effects killing creative players
Players aren't supposed to take magic damage in creative... I don't know who added this, but it's wrong.
2017-12-10 20:50:50 +00:00
Dylan K. Taylor
44e06f6a32 Player: Stop abusing getItemInHand() when we already have it stored 2017-12-10 17:08:56 +00:00
Dylan K. Taylor
2e62c084a4 Oops! composer.lock wasn't up to date 2017-12-10 12:34:01 +00:00
Dylan K. Taylor
a3622dfa9d Updated PocketMine-SPL dependency 2017-12-10 12:26:48 +00:00
Dylan K. Taylor
7c8a29151c MemoryManager: Remove unused field (leftover from 59d9d6a7df92a986ef5896dc0f2afbbe4606114f) 2017-12-10 12:12:43 +00:00
Dylan K. Taylor
8a90d159fe Cleanup unused imports 2017-12-10 12:09:46 +00:00
Dylan K. Taylor
bf4076766e Living: Fixed passing FloatTag to setHealth() when HealF tag is present, close #1784 2017-12-09 20:31:14 +00:00
Dylan K. Taylor
49dbd8b2c8 Living: Remove superfluous fire resistance check from dealFireDamage()
This is already checked in Living->attack(). It's preferable to allow it to be cancelled there since plugins can then un-cancel EntityDamageEvent to bypass the effect.
2017-12-07 17:32:50 +00:00
Dylan K. Taylor
502dd14c67 Entity: Remove excess whitespace in doOnFireTick() 2017-12-07 17:28:37 +00:00
Dylan K. Taylor
74239eec69 Living: Remove nonsensical >0 condition on boolean
Maybe this once returned integers, but it doesn't anymore.
2017-12-07 16:49:16 +00:00
Dylan K. Taylor
3c936e1be8 Entity: removed dead maxFireTicks property 2017-12-07 16:37:32 +00:00
Dylan K. Taylor
16fd37a039 Entity: Add getter & setter for fireTicks 2017-12-07 16:37:01 +00:00
Dylan K. Taylor
1ce961f688 Merge branch 'command-reader-fix' 2017-12-07 13:55:48 +00:00
Dylan K. Taylor
d80f711d18 CommandReader: Removed redundant else branch 2017-12-07 13:50:24 +00:00
Dylan K. Taylor
ebd3d207e4 Fixed server not accepting commands after pressing ctrl+D (non-readline) 2017-12-07 13:42:34 +00:00
Dylan K. Taylor
31f0437c96 fix readline crash when user presses ctrl+D 2017-12-07 13:41:58 +00:00
Dylan K. Taylor
b06ca6eb0b Rename Living->callDeathEvent() to Living->onDeath() 2017-12-07 12:26:49 +00:00
Dylan K. Taylor
67a09a9b16 Bump versions for 1.2.6
No changes. Mojang sucks.
2017-12-06 18:12:45 +00:00