394 Commits

Author SHA1 Message Date
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
dbc180315e Declare tool harvest level as a property 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
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
79fd9b1c96 added RottenFlesh item 2017-11-24 10:46:55 +00:00
Dylan K. Taylor
74b074753f Bulk addition of constant visibilities
thanks PhpStorm inspections plugin for annoying the shit out of me until
I did this.
2017-11-21 14:44:10 +00:00
Dylan K. Taylor
9da19b5f15 Added API methods for getting & setting armour dye colours 2017-11-21 14:10:33 +00:00
Dylan K. Taylor
eaba105614 Durable: use new CompoundTag API 2017-11-18 11:13:35 +00:00
Dylan K. Taylor
48a7627b96 add constants for NBT tag names in WritableBook 2017-11-17 10:48:48 +00:00
Dylan K. Taylor
235fc4cd2f remove redundant null coalesce 2017-11-17 10:45:14 +00:00
Dylan K. Taylor
e0654b85ba get rid of dynamic field assignments
nearly there now... eventually
2017-11-17 10:43:51 +00:00
Dylan K. Taylor
19315dfd06 Some cleanup on WritableBook code, get rid of some CompoundTag magic 2017-11-17 10:43:51 +00:00
Sandertv
2794df34ab Basic implementation of banners, including API to modify them with ease. (#1331)
Banner crafting is NOT implemented yet.
2017-11-15 11:10:46 +00:00
Dylan K. Taylor
aa399a1109
migrate to new CompoundTag API (#1515) 2017-11-10 15:38:21 +00:00
Dylan K. Taylor
733e61f815 add return typehints for Item fluent methods
to prevent issues like a2d4baf8b98223839918081cd8a5981fd7bff05d happening again >.>
2017-11-07 09:54:08 +00:00
Dylan K. Taylor
a2d4baf8b9 Fixed ItemBlock->setDamage() not returning a value 2017-11-07 09:44:34 +00:00
Dylan K. Taylor
eab7b93483
Fixed misuse of kill() and close() when deleting entities (#1490) 2017-11-04 19:30:48 +00:00
Dylan K. Taylor
e95b1d4b00 look for item IDs in ItemIds instead of Item
Item is likely to be more polluted by other constants which aren't item IDs.
2017-11-03 12:42:51 +00:00
Dylan K. Taylor
8ad02c9a4e Remove redundant condition from ItemFactory
it's unrealistic to have a numeric constant name, so this condition is pointless.
2017-11-03 12:41:24 +00:00
Dylan K. Taylor
d1db27016e s/facePos/clickVector/
clickVector better describes this
2017-10-27 19:05:26 +01:00
Dylan K. Taylor
3765511317 rename WritableBook->swapPage() to swapPages() 2017-10-23 17:55:01 +01:00
Dylan K. Taylor
50be26958a Added a helper function Entity->createBaseNBT() to cut down on boilerplate code 2017-10-19 17:36:51 +01:00
Dylan K. Taylor
5a353012de Clean up some unused imports 2017-10-19 16:39:34 +01:00
Dylan K. Taylor
2db13bd114 added throwable eggs and refactor some projectile logic
close #1473
2017-10-19 14:12:50 +01:00
Dylan K. Taylor
584810780a Moved projectile-related classes to their own namespace 2017-10-19 12:27:44 +01:00
Dylan K. Taylor
43be64baed Register some more items
the item-blocks will allow their blocks to be placed, but they still won't work until the blocks themselves are added.
2017-10-18 19:52:19 +01:00
Dylan K. Taylor
292e462ea0 Remove nullable return types on CompoundTag getters
this doesn't make sense because there are default value parameters for this
2017-10-16 18:22:45 +01:00
Dylan K. Taylor
769a50faa5 Refactor confusing parameter names for Item->onActivate()
next: refactor the function itself
2017-10-16 13:30:36 +01:00
Dylan K. Taylor
1641183674 added some typehints to Item 2017-10-16 10:29:44 +01:00
Dylan K. Taylor
72531209bf Added some constants for frequently-accessed item NBT tags 2017-10-16 10:24:32 +01:00
Dylan K. Taylor
8c6ab3e634 Some cleanup to item NBT handling 2017-10-16 10:15:41 +01:00
Dylan K. Taylor
a547e2cca8 Fixed sub-optimal code in WritableBook 2017-10-15 10:14:02 +01:00
Dylan K. Taylor
97dbf61236 Remove some no-longer-needed item classes 2017-10-09 12:31:57 +01:00
Dylan K. Taylor
2be8b576ef Changed constructor of ItemBlock to allow handling blocks with different item IDs, added more doors 2017-10-09 11:58:58 +01:00
Dylan K. Taylor
6dbdefafdd Add the long-awaited Enchantment::registerEnchantment() API method
api3/blocks users: I am sorry I kept you waiting so long
2017-10-09 11:40:53 +01:00
Dylan K. Taylor
aa91183504 Added Durable class, fixed some tools not breaking correctly, removed some boilerplate code 2017-10-08 15:54:31 +01:00
Dylan K. Taylor
ae5aa31e7b Add Item->setNamedTagEntry() and Item->removeNamedTagEntry() 2017-10-08 15:06:30 +01:00
Dylan K. Taylor
8fafef2f7f Added tagType parameter to ListTag constructor, remove some boilerplate code 2017-10-08 13:28:01 +01:00
Dylan K. Taylor
69e29236aa Remove some redundant code for checking existence of creative items
getCreativeItemIndex() does basically the same thing anyway
2017-10-08 12:50:53 +01:00
Dylan K. Taylor
e8453b7872 Item->getNamedTag() now always returns a CompoundTag object, removed lots of boilerplate code
This change resulted from many complaints and ugly boilerplate code because getNamedTag() is only ever used when you want to read from the tag or modify it. If you have code that depends on this returning null, you should use hasCompoundTag() instead.
2017-10-08 12:41:57 +01:00
Dylan K. Taylor
00bf190e54 Make Item->getNamedTag() a bit less ugly 2017-10-08 12:17:18 +01:00
Sandertv
81dee2f9fc Adding writable and written books. (#1397)
* Adding writable and written books.
* Added a PlayerEditBookEvent.
* Changed BookEditPacket field names.
2017-10-08 11:49:57 +01:00
Dylan K. Taylor
4dfd171af0 Add flint-steel light sound, close #1434 2017-10-03 19:39:01 +01:00
Dylan K. Taylor
7dc5dc3a9f Restrict item meta values to max signed short value, closes #1101 2017-10-03 12:35:08 +01:00
Dylan K. Taylor
f7ee78233b Item IDs should always be unsigned, treat them with appropriate measures (fixes #1376) 2017-10-03 12:28:50 +01:00