Spongeapi: Proper Horse, Mule, Donkey and Llama structure.

Created on 14 Nov 2016  路  6Comments  路  Source: SpongePowered/SpongeAPI

The current Horse api expansion (in the 1.11 branch) is done in a way that allows it to backwards compatible. But with the introduction of the Llama's, I don't really the like the structure that the api ends up with: Llama extends Horse, and this doesn't make a lot of sense in the way that Llama's aren't even a part of the horse family. So I propose the following structure changes:

untitled diagram 1

@gabizou

wontfix

Most helpful comment

Llama's aren't even a part of the horse family

They are in minecraftia.

All 6 comments

Llama's aren't even a part of the horse family

They are in minecraftia.

@Cybermaxke the goal of the API has never been to say what _should be_ versus _what is_. If Minecraft's base engine is dictating that Llamas are extensions of Horses, then so be it. This is what we had to decide on a year and a half ago with regards to our entity hierarchy structures diverging from the vanilla base game. @Zidane and myself spoke about this at length and agreed on the decision that we eventually made then, and this is a decision we make now.

This is amazing.

Can we pin this issue?

It has a flowchart.

I like flowcharts.

@gabizou There can always be an additional interface which represents the Horses, Donkeys, Mules and Llamas. Naming the base class Horse seems like a bad idea and may lead to confusion.

@Cybermaxke This is a design decision that has been made multiple times, and will not be reversed.

If you have a problem with hierarchies, go complain to Mojang.

Naming the base class Horse seems like a bad idea and may lead to confusion.

There's a very good reason to keep it named Horse: Backwards compatibility and exact representation of the underlying structure. As I said before closing the issue, this was a decision made in the past that isn't going to be changed.

Was this page helpful?
0 / 5 - 0 ratings