Closed DDoS closed 9 years ago
This seems pretty useful -- probably wouldn't have to increase verbosity much in most places too.
I think the verbosity saved from casts and instanceof
checks would compensate for the slightly longer type name.
Here's what the API looks like with generic locations.
@SpongePowered/developers Yes or no? Should we just replace Extent by World in Location, since that seems to be the most used type by far?
This seems pretty helpful, I think it is worth the verbosity?
yeah, I think generifying Location is probably the best way to go. Would be great for stuff to use Extent wherever possible too, rather than World, so that we can do things like what WE does with treegen on bukkit -- sticking an Extent in between that allows capturing changes occurring.
Well currently Extent is way too big of an interface to actually be useful, but that's another issue.
Closing this, follow in the PR.
Location should have type
Location<T extends Extent>
. This would allowT getExtent()
to return a concrete type, such as World. This would fix the common case of(World) object.getLocation().getExtent()
. Currently it returns Extent which isn't all that useful.