Skip to content

Commit

Permalink
Merge pull request #19 from Crazy-Crew/dev
Browse files Browse the repository at this point in the history
A few plugin enhancements here & there.
  • Loading branch information
ryderbelserion committed Mar 21, 2023
2 parents ac2dd02 + eae6ec0 commit 94331da
Show file tree
Hide file tree
Showing 51 changed files with 1,594 additions and 267 deletions.
88 changes: 88 additions & 0 deletions .github/ISSUE_TEMPLATE/bugs.yml
@@ -0,0 +1,88 @@
name: "Bug Report"
description: "Create a report to help us improve the plugin."
title: "[Bug Report]: "
labels: ["bug"]

assignees:
- ryderbelserion

body:
- type: markdown
attributes:
value: |
Note: Search to see if an issue already exists for the bug you are reporting.
What plugin version are you on? Type /version `plugin-name`
Add any gif / imgur links if need be. Markdown is supported!
If you have any large stack traces / errors, Please use https://mclo.gs/
Spark Profiler > https://spark.lucko.me/download
- type: input
attributes:
label: Spark link
description: We ask that Spark profilings are shared through a link, not a screenshot. Screenshots inhibit our ability to figure out the real cause of the issue.
placeholder: Output of /spark profiler --timeout 300
validations:
required: false
- type: dropdown
id: version
attributes:
label: Server Version
description: What server version are you on?
options:
- 1.8.8
- 1.12.2
- 1.16.5
- 1.19.3
validations:
required: true
- type: dropdown
id: platform
attributes:
label: Server Platform
description: What server platform are you using?
options:
- Spigot
- Paper
- Purpur
validations:
required: true
- type: textarea
id: bug
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
id: steps
attributes:
label: Steps to reproduce
description: Steps to reproduce the behavior.
placeholder: |
1. Go to '...'
2. Change value in placeholder.yml '...'
3. Run command '...'
4. See error
validations:
required: true
- type: textarea
id: context
attributes:
label: Additional context
description: Add any other context about the problem here.
validations:
required: false
- type: checkboxes
attributes:
label: Agreements
description: Please agree to the following.
options:
- label: I have searched for and ensured there isn't already an open issue regarding this.
required: true
- label: I ticked all the boxes without actually reading them
required: false
- label: My version of Minecraft is supported by CrazyCrew.
required: true
8 changes: 7 additions & 1 deletion .github/workflows/build_release.yml
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- main
#- dev
workflow_dispatch:
inputs:
logLevel:
Expand Down Expand Up @@ -41,4 +42,9 @@ jobs:
run: ./gradlew publish --stacktrace
env:
REPOSITORY_USERNAME: ${{ secrets.CRAZYCREW_USERNAME }}
REPOSITORY_PASSWORD: ${{ secrets.CRAZYCREW_PASSWORD }}
REPOSITORY_PASSWORD: ${{ secrets.CRAZYCREW_PASSWORD }}
- name: Update Notification
run: |
./gradlew webhook --stacktrace
env:
DISCORD_WEBHOOK: ${{ secrets.CRAZYCREW_WEBHOOK }}
16 changes: 13 additions & 3 deletions .gitignore
@@ -1,6 +1,16 @@
.gradle
.idea
build

server
builds
buildSrc/.gradle
buildSrc/build

platforms/paper/build
platforms/paper/run/*

!platforms/paper/run/eula.txt
!platforms/paper/run/bukkit.yml
!platforms/paper/run/spigot.yml
!platforms/paper/run/server.properties
!platforms/paper/run/config

build
18 changes: 8 additions & 10 deletions README.md
@@ -1,6 +1,6 @@
<br />

[![CrazyVouchers](https://raw.githubusercontent.com/RyderBelserion/Assets/main/crazycrew/new/vouchers/Banner.png)](https://modrinth.com/plugin/crazyvouchers)
[![CrazyVouchers](https://git.crazycrew.us/ryderbelserion/Assets/raw/branch/main/crazycrew/webp/CrazyVouchersBanner.webp)](https://modrinth.com/plugin/crazyvouchers)

<div align="center">

Expand All @@ -12,7 +12,6 @@
[![Contact][discord-shield]][discord-url]
![CodeFactor][codefactor-shield]

![Spigot](https://cdn.jsdelivr.net/gh/intergrav/devins-badges/assets/compact/unsupported/spigot_vector.svg)
![Paper](https://cdn.jsdelivr.net/gh/intergrav/devins-badges/assets/compact/supported/paper_vector.svg)
![Purpur](https://cdn.jsdelivr.net/gh/intergrav/devins-badges/assets/compact/supported/purpur_vector.svg)

Expand Down Expand Up @@ -48,13 +47,12 @@
</ol>
</details>

## Downloads
> https://modrinth.com/plugin/crazyvouchers
## Resource Page

## Beta Builds
### Get the latest changes before marked as release.
All beta builds will be on Modrinth.<br>
> https://modrinth.com/plugin/crazyvouchers/versions
### Beta Builds
All beta builds will be on Modrinth marked as beta.<br>

<a href="https://modrinth.com/plugin/crazyvouchers">![Modrinth](https://raw.githubusercontent.com/intergrav/devins-badges/v3/assets/cozy/available/modrinth_64h.png)</a>

## Getting Started

Expand Down Expand Up @@ -89,7 +87,7 @@ Check our public [trello board](https://trello.com/b/gWiGLBWI) for our current p
2. Create your Feature Branch (`git checkout -b feature/yourfeature`)
3. Commit your Changes (`git commit -m 'your amazing feature.'`)
4. Push to the Branch (`git push`)
5. Open a Pull Request to add your feature/fix.
5. Open a Pull Request to the dev branch to add your feature/fix.

## License

Expand All @@ -109,4 +107,4 @@ Distributed under the MIT License. See [`LICENSE`](/LICENSE) for more informatio
[license-shield]: https://img.shields.io/github/license/Crazy-Crew/CrazyVouchers.svg?style=flat&logo=appveyor
[license-url]: https://github.com/Crazy-Crew/CrazyVouchers/blob/master/LICENSE

[codefactor-shield]: https://img.shields.io/codefactor/grade/github/Crazy-Crew/CrazyVouchers/main?style=flat&logo=appveyor
[codefactor-shield]: https://img.shields.io/codefactor/grade/github/Crazy-Crew/CrazyVouchers/main?style=flat&logo=appveyor
151 changes: 31 additions & 120 deletions build.gradle.kts
@@ -1,136 +1,47 @@
plugins {
`java-library`

`maven-publish`

id("com.modrinth.minotaur") version "2.6.0"

id("com.github.johnrengelman.shadow") version "7.1.2"
}

repositories {
/**
* Placeholders
*/
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")

/**
* NBT API
*/
maven("https://repo.codemc.org/repository/maven-public/")

/**
* Paper Team
*/
maven("https://repo.papermc.io/repository/maven-public/")

/**
* Everything else we need.
*/
mavenCentral()
}

dependencies {
implementation("de.tr7zw", "nbt-data-api", "2.11.0")

implementation("org.bstats", "bstats-bukkit", "3.0.0")

compileOnly("io.papermc.paper", "paper-api", "${project.extra["minecraft_version"]}-R0.1-SNAPSHOT")

compileOnly("me.clip", "placeholderapi", "2.11.2") {
exclude(group = "org.spigotmc")
exclude(group = "org.bukkit")
}
}

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(project.extra["java_version"].toString()))
}

val isBeta: Boolean = extra["isBeta"].toString().toBoolean()
import task.WebhookExtension
import java.awt.Color

fun getPluginVersion(): String {
return if (isBeta) "${project.version}-BETA" else project.version.toString()
}

fun getPluginVersionType(): String {
return if (isBeta) "beta" else "release"
plugins {
id("crazyvouchers.root-plugin")
}

tasks {
shadowJar {
archiveFileName.set("${rootProject.name}-${getPluginVersion()}.jar")

listOf(
"de.tr7zw",
"org.bstats"
).forEach {
relocate(it, "${project.group}.plugin.lib.$it")
}
}

modrinth {
token.set(System.getenv("MODRINTH_TOKEN"))
projectId.set(rootProject.name.toLowerCase())

versionName.set("${rootProject.name} ${getPluginVersion()}")
versionNumber.set(getPluginVersion())

versionType.set(getPluginVersionType())
val releaseUpdate = Color(27, 217, 106)
val betaUpdate = Color(255, 163, 71)

uploadFile.set(shadowJar.get())
val beta = settings.versions.beta.get().toBoolean()
val extension = settings.versions.extension.get()

autoAddDependsOn.set(true)
val color = if (beta) betaUpdate else releaseUpdate
val repo = if (beta) "beta" else "releases"

gameVersions.addAll(listOf("1.18", "1.18.1", "1.18.2", "1.19", "1.19.1", "1.19.2", "1.19.3"))
loaders.addAll(listOf("paper", "purpur"))
webhook {
this.avatar("https://en.gravatar.com/avatar/${WebhookExtension.Gravatar().md5Hex("no-reply@ryderbelserion.com")}.jpeg")

//<h3>The first release for CrazyVouchers on Modrinth! 🎉🎉🎉🎉🎉<h3><br> If we want a header.
changelog.set("""
<h4>Changes:</h4>
<p>Added 1.18.2 support.</p>
<h4>Bug Fixes:</h4>
<p>N/A</p>
""".trimIndent())
}
this.username("Ryder Belserion")

compileJava {
options.release.set(project.extra["java_version"].toString().toInt())
}
this.content("New version of ${rootProject.name} is ready! <@&1029922295210311681>")

processResources {
filesMatching("plugin.yml") {
expand(
"name" to rootProject.name,
"group" to project.group,
"version" to getPluginVersion(),
"description" to project.description,
"website" to "https://modrinth.com/plugin/${rootProject.name.toLowerCase()}"
)
}
}
}
this.embeds {
this.embed {
this.color(color)

publishing {
val mavenExt: String = if (isBeta) "beta" else "releases"
this.fields {
this.field(
"Version ${rootProject.version}",
"Download Link: https://modrinth.com/$extension/${rootProject.name.lowercase()}/version/${rootProject.version}"
)

repositories {
maven("https://repo.crazycrew.us/$mavenExt") {
name = "crazycrew"
//credentials(PasswordCredentials::class)
credentials {
username = System.getenv("REPOSITORY_USERNAME")
password = System.getenv("REPOSITORY_PASSWORD")
this.field(
"API Update",
"Version ${rootProject.version} has been pushed to https://repo.crazycrew.us/#/$repo"
)
}
}
}

publications {
create<MavenPublication>("maven") {
groupId = "${project.group}"
artifactId = rootProject.name.toLowerCase()
version = getPluginVersion()
from(components["java"])
this.author(
rootProject.name,
"https://modrinth.com/$extension/${rootProject.name.lowercase()}/versions",
"https://cdn-raw.modrinth.com/data/EMORKQjj/1cf7fffa9bf92d1bc292983dc320984cc764b51e.png"
)
}
}
}
23 changes: 23 additions & 0 deletions buildSrc/build.gradle.kts
@@ -0,0 +1,23 @@
plugins {
`kotlin-dsl`
}

repositories {
gradlePluginPortal()
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10")
implementation("gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.16.1")
implementation("com.github.johnrengelman:shadow:8.1.0")

// For the webhook tasks, this applies to the buildSrc only
val ktor = "2.2.4"

implementation("io.ktor:ktor-client-core-jvm:$ktor")
implementation("io.ktor:ktor-client-cio-jvm:$ktor")
implementation("io.ktor:ktor-client-content-negotiation:$ktor")
implementation("io.ktor:ktor-serialization-gson:$ktor")

implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
}
3 changes: 3 additions & 0 deletions buildSrc/settings.gradle.kts
@@ -0,0 +1,3 @@
dependencyResolutionManagement {
repositories.gradlePluginPortal()
}
15 changes: 15 additions & 0 deletions buildSrc/src/main/kotlin/crazyvouchers.paper-plugin.gradle.kts
@@ -0,0 +1,15 @@
plugins {
id("crazyvouchers.root-plugin")
}

repositories {
/**
* Paper Team
*/
maven("https://repo.papermc.io/repository/maven-public/")

/**
* NBT API
*/
maven("https://repo.codemc.io/repository/maven-public/")
}

0 comments on commit 94331da

Please sign in to comment.