Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Add event values to events in docs #5690

Closed

Conversation

AyhamAl-Ali
Copy link
Member

@AyhamAl-Ali AyhamAl-Ali commented May 10, 2023

Description

  • Added event values to events in docs
  • Added EventValueInfo#getTime()
  • Added EventValueInfo#isEventExcluded(Class)
  • Overloaded EventValueInfo constructor and deprecated the old one due to time param
  • Added EventValues#getPerEventEventValues() for getting all events values per event -- useful for docs

Preview
image
nvm about the broken if condition, that's from my side


Target Minecraft Versions:
Requirements:
Related Issues:

- Added EventValueInfo#getTime()
- Added EventValueInfo#isEventExcluded(Class)
- Overloaded EventValueInfo instructor and deprecated the old one due to `time` param
- Added EventValues#getPerEventEventValues() for getting all events values per event -- useful for docs
@AyhamAl-Ali AyhamAl-Ali added feature Pull request adding a new feature. documentation Related to Skript's official documentation. labels May 10, 2023
@@ -68,6 +75,7 @@ public class HTMLGenerator {
private final File template;
private final File output;
private final String skeleton;
private Map<Class<? extends Event>, List<EventValues.EventValueInfo<?, ?>>> eventValuesCache = new HashMap<>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could probably use a MultiMap here


/**
* Whether the provided event is one of the excluded events of this {@link EventValueInfo}
* @return Either {@link #TIME_PAST}, {@link #TIME_NOW} or {@link #TIME_FUTURE}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this return javadoc is wrong ;)

prefix = "past ";
else if (eventValueInfo.getTime() == EventValues.TIME_FUTURE)
prefix = "future ";
String className = eventValueInfo.c.getSimpleName().toLowerCase(Locale.ENGLISH);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this use the ClassInfo name instead of replacing?

src/main/java/ch/njol/skript/doc/HTMLGenerator.java Outdated Show resolved Hide resolved
@@ -68,6 +75,7 @@ public class HTMLGenerator {
private final File template;
private final File output;
private final String skeleton;
private Map<Class<? extends Event>, List<EventValues.EventValueInfo<?, ?>>> eventValuesCache = new HashMap<>();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should clear this cache after the templates have been generated, we don't need it sitting in here.

@sovdeeth sovdeeth changed the base branch from master to dev/feature December 30, 2023 07:56
@sovdeeth sovdeeth mentioned this pull request Jan 30, 2024
1 task
@AyhamAl-Ali AyhamAl-Ali marked this pull request as draft April 7, 2024 22:46
@sovdeeth
Copy link
Member

closing due to inactivity

@sovdeeth sovdeeth closed this Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Related to Skript's official documentation. feature Pull request adding a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement | EventValues
4 participants