49 Commits

Author SHA1 Message Date
Dylan K. Taylor
b480c63060 Fixed ItemFactory::fromString() meta handling bug introduced by 71c3c349766e348bf53a1beeefaf9a897bc0a954 2018-07-17 14:46:08 +01:00
Dylan K. Taylor
71c3c34976 ItemFactory: prepare for handling items with negative IDs 2018-07-16 13:24:12 +01:00
Dylan K. Taylor
509e8c5f6d ItemFactory: register some easy items
these are items that do nothing and/or are only used for crafting. As such they are simple to add.

Others will be added later on, but others require extra work and/or reverse engineering which I don't have time for now.
2018-05-23 19:48:30 +01:00
Dylan K. Taylor
2c1afe5f2c ItemFactory: generate some TODOs 2018-05-23 13:42:19 +01:00
Dylan K. Taylor
8f41384923 Item: remove workaround for anvils
they removed this in the 1.2.13 release. now the metadata matches the block.
2018-05-23 11:43:55 +01:00
Dylan K. Taylor
acf29711c2 Implemented Totems, close #2198
Totem usage can be detected using the MODIFIER_TOTEM constant of EntityDamageEvent.

This does not currently support using the totem in the offhand because offhand is not implemented yet.
2018-05-23 10:06:35 +01:00
Dylan K. Taylor
ac5a91b67e Cleaned up bool comparison mess 2018-03-19 14:10:55 +00:00
Dylan K. Taylor
ad09e8c8d0 Implemented Bottle o' Enchanting 2018-03-10 10:53:03 +00:00
Dylan K. Taylor
9098502199 Item: added some foods, cleaned up Fish abomination
@PEMapModder GET A CLIENT ALREADY
2018-03-09 19:54:42 +00:00
Dylan K. Taylor
31106bc227 ItemFactory: Register Dragon's Breath item
this is only used for brewing, it doesn't need anything special.
2018-03-09 19:13:30 +00:00
Dylan K. Taylor
cc1a3d695f Implemented basic Ender Pearls
this doesn't have full functionality yet (like spawning endermites) because some things aren't implemented yet.
2018-03-09 19:05:14 +00:00
Dylan K. Taylor
2e9bf7e93b Implemented Splash Potions 2018-03-09 12:25:02 +00:00
Dylan K. Taylor
c7f8796136
Implemented Paintings (#2073)
This supports vanilla placement of paintings, with overlap and collision checking.
Paintings are removed when a block is placed inside them or if any of their supporting blocks are removed.

As per vanilla, a random painting is chosen from the largest subset that will fit into the given space.
2018-03-07 09:03:30 +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
2cabdca3f7 ItemFactory: Allow block-items to be overridden
Currently an ItemBlock is created for every Block requested, but this will need to change in the future (for Anvils because they have stupid bitshifts on the meta instead of a nice bitmask). This allows registering items in the ItemFactory with IDs lower than 256 and having them recognized.
2018-02-16 11:03:04 +00:00
Dylan K. Taylor
3b632c2870 ItemFactory::fromString(): throw an exception on failure to parse meta value 2018-02-16 09:45:38 +00:00
Dylan K. Taylor
4c583ec8ab ItemFactory: Throw exception on failure to parse string as an item in fromString()
closes #1487
2018-02-15 17:56:55 +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
456987e212 ItemFactory: Don't initialize creative items in init()
Wanting initialized item factory does not require initializing the creative inventory. This is often useless and unwanted extra baggage (when this is used on threads for example).
2018-02-15 17:09:38 +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
3bbdc5ab5b Implemented chorus fruit 2017-12-23 15:11:48 +00:00
Dylan K. Taylor
4f8e4f0522
Add EOF newlines where missing (bulk) (#1836)
This should solve issues with people making GitHub PRs and having the web editor messing things up. GitHub Web Editor sucks :(
2017-12-20 11:56:36 +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
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
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
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
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
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
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
f5b0cbb337 Generated some TODOs for BlockFactory & ItemFactory 2017-09-26 16:15:35 +01:00
Dylan K. Taylor
6b34c47c96 Merge branch 'master' into mcpe-1.2 2017-09-14 18:16:45 +01:00
Dylan K. Taylor
130a60f2b2 Fixed ItemFactory::isRegistered() returns false for blocks 2017-09-11 18:23:26 +01:00
Dylan K. Taylor
07268e4b37 Added API methods to determine if a block or item is already registered 2017-09-11 16:22:55 +01:00
Dylan K. Taylor
16cb75ef38 Merge branch 'master' into mcpe-1.2 2017-09-09 21:58:30 +01:00
Dylan K. Taylor
78d49f8e66 Merge branch 'php/7.0' into mcpe-1.2 2017-09-03 15:02:41 +01:00
Dylan K. Taylor
de6ebc5791 Merge branch 'php/7.0' 2017-09-03 15:00:29 +01:00
Dylan K. Taylor
90cb3c010f Added some new items (the basic ones) 2017-09-03 14:24:21 +01:00
Dylan K. Taylor
5d75d3d5b6 Merge branch 'php/7.0' into mcpe-1.2 2017-09-01 23:10:58 +01:00
Dylan K. Taylor
00e4fff259 Fixed Item fromString() crash on PHP 7.2 2017-09-01 20:05:04 +01:00
Dylan K. Taylor
6abef6b22d Made block and item factory lists private to stop people doing stupid things with them 2017-08-29 10:53:01 +01:00
Dylan K. Taylor
c7fd3eb725 Merge branch 'master' into mcpe-1.2 2017-08-27 16:09:23 +01:00
Dylan K. Taylor
9e142655ea Removed redundant count parameter from item constructors, added some documentation and tightened safety checks
the count parameter is useless since Item ctor should now only be used for constructing item _types_, not actual items. All item creations for inventories etc, should go through the ItemFactory.
2017-08-25 19:06:23 +01:00
Dylan K. Taylor
4ab286a142 Generated some Item TODOs 2017-08-25 14:35:50 +01:00
Dylan K. Taylor
44dd7c2222 Removed some redundant item classes 2017-08-25 14:07:50 +01:00
Dylan K. Taylor
8a35b9da29 Added some documentation 2017-08-22 10:28:43 +01:00
Dylan K. Taylor
876659cc73 Item factory refactor and added capability to register custom items 2017-08-21 17:49:26 +01:00