Skip to content

Commit

Permalink
1.9 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
eyesniper2 committed Jan 16, 2025
1 parent 2079518 commit 63bc8c7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 19 deletions.
19 changes: 14 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.apache.tools.ant.filters.ReplaceTokens

buildscript {
ext.kotlin_version = '1.6.10'

Expand All @@ -19,12 +21,19 @@ buildscript {
}

group 'net.skripthub'
version '1.7'
version '1.9'

apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'java'
apply plugin: 'kotlin'

processResources {
from("src/main/resources") {
duplicatesStrategy = 'include'
filter ReplaceTokens, tokens: ["version": project.version]
}
}

repositories {
mavenCentral()
maven {
Expand All @@ -37,17 +46,17 @@ repositories {
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url = 'https://oss.sonatype.org/content/repositories/central' }
maven { url 'https://repo.destroystokyo.com/repository/maven-public/' }
maven { url 'https://papermc.io/repo/repository/maven-public/' }
maven { url 'https://repo.papermc.io/repository/maven-public/' }
maven { url 'https://repo.skriptlang.org/releases' }
maven { url 'https://jitpack.io' }
}

dependencies {
implementation 'com.github.SkriptLang:Skript:2.8.0'
implementation 'com.github.SkriptLang:Skript:2.10.0'

implementation group: 'org.spigotmc', name: 'spigot-api', version:'1.17-R0.1-SNAPSHOT'
implementation group: 'org.spigotmc', name: 'spigot-api', version:'1.19.4-R0.1-SNAPSHOT'

testImplementation group: 'junit', name: 'junit', version: '4.12'
testImplementation group: 'junit', name: 'junit', version: '4.13.1'
}

shadowJar {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import org.bukkit.command.CommandSender
import org.bukkit.event.Cancellable
import org.skriptlang.skript.lang.entry.EntryValidator
import org.skriptlang.skript.lang.entry.SectionEntryData
import org.skriptlang.skript.lang.entry.util.TriggerEntryData
import org.skriptlang.skript.lang.structure.StructureInfo
import java.lang.reflect.Field

Expand All @@ -35,7 +36,7 @@ class GenerateSyntax {
data.description = cleanDescription(info.description as? Array<String>)
data.examples = cleanExamples(info.examples as Array<String>?)
data.patterns = cleanupSyntaxPattern(info.patterns)
if (data.patterns != null && data.name != null && data.name!!.startsWith("On ")) {
if (data.name != null && data.name!!.startsWith("On ")) {
for (x in 0 until data.patterns!!.size)
data.patterns!![x] = "[on] " + data.patterns!![x]
}
Expand Down Expand Up @@ -94,10 +95,7 @@ class GenerateSyntax {
data.examples = cleanExamples(syntaxInfoClass.getAnnotation(Examples::class.java).value)
data.patterns = cleanupSyntaxPattern(info.patterns)
if (syntaxInfoClass.isAnnotationPresent(Since::class.java)) {
val sinceString = removeHTML(syntaxInfoClass.getAnnotation(Since::class.java).value)
if (sinceString != null) {
data.since = arrayOf(sinceString)
}
data.since = removeHTML(syntaxInfoClass.getAnnotation(Since::class.java).value)
}
if (syntaxInfoClass.isAnnotationPresent(RequiredPlugins::class.java))
data.requiredPlugins = syntaxInfoClass.getAnnotation(RequiredPlugins::class.java).value
Expand Down Expand Up @@ -126,10 +124,7 @@ class GenerateSyntax {
data.examples = cleanExamples(syntaxInfoClass.getAnnotation(Examples::class.java).value)
data.patterns = cleanupSyntaxPattern(info.patterns)
if (syntaxInfoClass.isAnnotationPresent(Since::class.java)) {
val sinceString = removeHTML(syntaxInfoClass.getAnnotation(Since::class.java).value)
if (sinceString != null) {
data.since = arrayOf(sinceString)
}
data.since = removeHTML(syntaxInfoClass.getAnnotation(Since::class.java).value)
}
if (syntaxInfoClass.isAnnotationPresent(RequiredPlugins::class.java))
data.requiredPlugins = syntaxInfoClass.getAnnotation(RequiredPlugins::class.java).value
Expand Down Expand Up @@ -171,12 +166,13 @@ class GenerateSyntax {
data.name = info.codeName
}
data.id = info.c.simpleName
if (data.id.equals("Type")) {
data.id += data.name?.replace(" ", "")
}
if (info.documentationID != null) {
data.id = info.documentationID;
}
if (data.id.equals("Type")) {
data.id = data.id + data.name?.replace(" ", "")
}

data.description = cleanDescription(info.description as? Array<String>)
data.examples = cleanExamples(info.examples as? Array<String>)
data.usage = cleanUsages(info.usage as? Array<String>)
Expand Down Expand Up @@ -286,7 +282,7 @@ class GenerateSyntax {
entriesArray.add(DocumentationEntryNode(
entry.key,
!entry.isOptional,
entry is SectionEntryData,
entry is SectionEntryData || entry is TriggerEntryData,
entry.defaultValue.toString()))
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ author: eyesniper2
website: https://skripthub.net/
depend: [Skript]
prefix: Skript Hub Docs Tool
version: 1.7
version: @version@
api-version: '1.17'

permissions:
docstool.command.gendocs:
Expand Down

0 comments on commit 63bc8c7

Please sign in to comment.