Commit Graph

28 Commits

Author SHA1 Message Date
e12e2897bb Enchantment: Add new constants
these aren't registered yet because they aren't implemented.
2018-05-23 12:34:58 +01:00
8239c67b1a Enchantment: split up primary and secondary flags
closes #1911
2018-05-12 11:20:27 +01:00
ffbb44673f Enchantment: fix mistake in Protection translation key 2018-02-07 10:15:31 +00:00
0df2064802 Implement armor damage protection enchantments (#1839) 2018-01-24 10:13:24 +00:00
8d7c65585c Enchantment: Implement Silk Touch (#1912) 2018-01-14 13:37:27 +00:00
94feecd44b Enchantment: Implemented Unbreaking 2018-01-13 19:34:45 +00:00
98b36fd73e Enchantment: Implemented Efficiency
This is only needed server-side for block-break animation times.
2018-01-11 20:13:57 +00:00
07c7048433 Enchantment: Converted item type bitflags to hex 2018-01-11 20:09:42 +00:00
f09cf92197 Enchantment: Updated item type flags 2018-01-11 20:08:50 +00:00
a6c1e02847 Enchantment: Register Respiration enchantment
First working enchantment on master. Hooray for 3 years late.

This works out of the box (the code checking for this enchantment already exists in Human->doAirSupplyTick()).
2018-01-11 18:32:22 +00:00
a842a5319f Enchantment: Create constant name once, and reuse it
this is more readable and more maintainable.
2017-12-21 13:11:31 +00:00
c2b0f6af22 Enchantment: Simplify getEnchantment() with null coalesce
This is made possible by 0e538ee51d.
2017-12-21 13:02:24 +00:00
6490d99ac2 Enchantment: Added a TODO (calculating XP min/max level cost bounds) 2017-12-21 12:55:55 +00:00
e0b063ac85 Enchantment: Added max level property 2017-12-21 12:49:34 +00:00
12ac2f4ac7 Enchantment: Fixed rarity constant values to match vanilla
Rarity is used for "weighting" enchantments on enchantment tables and such. Therefore higher numbers mean the enchantment is more common. This changes the rarity values to match vanilla.
2017-12-21 12:48:35 +00:00
cc1951c7ba Enchantment: Remove activation type stuff
This isn't and won't be used anywhere.
2017-12-21 12:48:14 +00:00
0e538ee51d Enchantment: Split up enchantment type data and enchantment instance data (#1825)
* Enchantment: Split enchantment type data from instance data
This commit splits enchantments into (effectively) enchantment TYPES vs enchantment INSTANCES.

When applying an enchantment to an item, it only needs to know 2 things:
1. the enchantment ID (identifier) which is used to identify the TYPE
2. the enchantment LEVEL which is used to modify the enchantment's power IN THIS INSTANCE.

Therefore, the LEVEL is not an immutable property. However, all other properties of the currently-named "Enchantment" class are immutable type properties.
Currently, when applying an enchantment to an item, a copy of the enchantment object is created from the registry, and returned. This copies all of the properties contained by the type, which is obviously sub optimal.
2017-12-21 12:40:33 +00:00
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
914e4c9a72 Enchantment: Fix formatting issue 2017-12-16 13:04:25 +00:00
24387d1efe Enchantment: Add some PhpDoc for fields 2017-12-16 10:01:42 +00:00
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
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
3b7fc21839 Enchantment API changes, understandable constant names 2017-08-05 21:27:57 +01:00
51b0673b4b Bite the bullet and enable strict types on everything 2017-06-07 12:53:16 +01:00
9004417456 Fixed file headers (#255) 2017-01-13 16:57:05 +00:00
fabb632286 More changes! 2015-08-13 18:02:10 +02:00
f093a6498d Added base enchantment adding utilities, /enchant command 2015-08-08 16:03:04 +02:00
4dd0469792 Base enchantment class 2015-08-08 14:53:03 +02:00