6 Commits

Author SHA1 Message Date
Dylan K. Taylor
c99846e069 Unify Item constructor style
this exposed a few more dead classes.
2019-05-11 18:24:21 +01:00
Dylan K. Taylor
b1cef8509a Revamp Entity construction
This is a similar refactor to the one I recently did for tiles.

- Entity::createEntity() is removed. In its place are Entity::create() (runtime creation, use where you'd use a constructor, accepts a ::class parameter, throws exceptions on unknown entities) and Entity::createFromData() (internal, used to restore entities from chunks, swallows unknown entities and returns null).
- Entity::registerEntity() is renamed to Entity::register().
- Added Entity::override() to allow overriding factory classes without touching save IDs. This allows more cleanly extending & overriding entities. This method only allows overriding registered Entity classes with children of that class, which makes code using the factory much more sane and allows to provide safety guarantees which make the code less nasty.
- Entity::getKnownEntityTypes() is renamed to Entity::getKnownTypes().
- ProjectileItem::getProjectileEntityType() now returns a ::class constant instead of a stringy ID.
- Cleaned up a bunch of nasty code, particularly in Bow.
2019-01-06 23:33:36 +00:00
Dylan K. Taylor
93131b4d92 Rename some meta usages to variant 2018-10-26 18:20:37 +01:00
Dylan K. Taylor
f438736af5 Make some item constructor variant parameters mandatory 2018-10-26 16:51:02 +01:00
Dylan K. Taylor
ba0a256834 SplashPotion: fix max stack size 2018-03-11 13:43:45 +00:00
Dylan K. Taylor
2e9bf7e93b Implemented Splash Potions 2018-03-09 12:25:02 +00:00