Very soon, lurkers and debaters, lovers and haters, there will be the
Sponge Docs Pop Quiz #9
Brought to you by a team of robot monkey-spiders riveted to a barrel.
Here are some of the things they typed as they drifted across the Sponge development wasteland, in pursuit of the cutting edge. Perhaps if you answer them you can enlighten us all
-
Causes. How useful are they going to be for things you want plugins to do?
Notwithstanding that no event happens without a prior event, Sherlock Holmes has been made redundant.
The reasons behind the mysterious events that keep happening to you can now be tracked! Explained! Cancelled!
-
Magnets. How the FLARD do they work?
Minecraft has Gravity but lacks the Electro-Magnetic Force. The closest it has is redstone and the
Extravagantly Modded Forge. What implementations of EMF would you be likely to use on Sponge servers?
-
Would a Search function be useful for Downloads and Changelog?
The changelog and the downloads list are a bit cumbersome to search through. More automation may not be the wisest solution, what solutions are available? Suggestions for improvements here are always encouraged, and offers of assistance greatly appreciated
Once again, thank you for examining these words, numbers and phrases; it is time for this message to evaporate and resonate inside the virtual you. Flashbacks provided for free at the disturbingly code-oriented
Docs Quiz #8. May you always tread the shiny yellow bricks of the Feynman Path. Number 9, Number 9, Number 9, Number 9, Number 9, Number 9, Number 9, Number 9, Number 9, Come In, Your Time Is Up.
1.
Itâs the exact same tradeoff the whole API enforces. Things become less simple (compared to Bukkit, since that is the only other API Iâve ever worked with) but also incredibly powerful. It may prove to be more verbose for simple Tasks, but overall the possibility of tracking each and every cause seems to be worth it. (Disclaimer: I have not used that feature yet)
2.
I do not intend to run a server myself for more than testing, so an EMF (Extravagantly Modded Forge) is of no interest to me.
3.
For now, the current changelog suffices, as it provides an overview on what changed from one dev version to another. The problem is that it is based on commit messages. Commit messages in general are 2% information for everyone, 18% information for developers, 5% expression of mental damage the programmer suffered from his own creation, 50% fixes of screwups from previous commits aptly commented with âoopsâ and, in Sponges case 25% âBump API/SpongeCommon referenceâ.
Those might be fine for devs using dev builds, but they rather confuse than help server owners and average users. So once the project moves to a state where we actually have major and minor releases, we need a second changelog. One written by humans for humans. One with a neat list of bugfixes, a neat list of added Features and maybe a neat list of probable / possible imcompatibilities (Think âEvent names for entity mating events changed in order to not lose PG-13 ratingâ or something).
I also see no benefit in a search function, since in order for it to work, commit messages had to be a lot more standardized.
TL/DR: For Dev builds the current system works, for major / minor builds we need an additional human-readable changelog. A search function would probably work only in the latter.
4 Likes
cause.root()
OR, to get the last Cause, cause.all().get(cause.all().size() -1)
All that typing for a oft-used case, one would expect a cause.last() function for simplicityâŚ
To be fair, I had originally typed cause.last()
because I had expected it to exist, as well.
For now, that will have to do, though.
I took a look at Cause
, and you could just use cause.last(Object.class).get()
for the very last object in the cause. If youâre looking for something more specific, you could use cause.last(TargetClass.class).get()
. In my case, I would use cause.last(Player.class).get()
.
However, this doesnât address getting the base cause when it has extra data included in the Cause
. In an EntityExplodeEvent
caused by a DamageEntityEvent
, the Cause
would be [exploding mob, attacking DamageSource, attacked Entity]
(I would expect; neither one is implemented yet).