Skip to content

Commit

Permalink
BetterReports 2.0.0 (#28)
Browse files Browse the repository at this point in the history
- Rebase (July 2022)
- Bulk of the stuff
- ci: update grgit for old java
- refactor: remove "target" folder
- feat: added bStats metrics
- ci(gradle)!: change from groovy to kotlin
- feat: created a gui helper
-  isn't the best, but it gets the job done.
- feat: new report system and reporting gui
- chore(gradle): change version to 2.0.0-SNAPSHOT
- chore: add comments to ReportCommand.java
- chore!: finalise release
  • Loading branch information
mnewt00 authored Jul 26, 2022
1 parent 5988351 commit 746f5b9
Show file tree
Hide file tree
Showing 81 changed files with 6,717 additions and 1,846 deletions.
23 changes: 13 additions & 10 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
MIT License
## MIT License

Copyright (c) 2020 Timmy109.
Copyright (c) 2020 Contributors.
Copyright (c) 2022 AusTech Development Team

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the
"Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following
conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
36 changes: 11 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,26 @@
# BetterReports

A lightweight plugin for Minecraft that utilizes Discord webhooks for player and bug reports!

# About
BetterReports was coded at first as a small project for a Minecraft server. I then thought

"BetterReports was coded at first as a small project for a Minecraft server. I then thought
that I should submit it as an open source resource on Spigot where we can continue to develop
the plugin.
the plugin." - Timmy109

### Key features

* Lightweight and simple
* Discord webhook
* Works on any version from 1.8 to 1.17.x
* Works on any version from 1.8.x to 1.19.x
* Great for neatly archiving reports in a Discord channel
* Highly customisable messages
* Command cooldown

##### If you feel like you can help improve this plugin, feel free to make a pull request!
##### The current code style should be followed to keep consistency throughout the plugin.
> If you feel like you can help improve this plugin, feel free to make a pull request!\
> The current code style should be followed to keep consistency throughout the plugin.
# License
Copyright (C) 2022 AusTech Development Team
Copyright (c) 2022 Contributors.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

BetterReports is licensed under the MIT license.\
You can find the full license text here: [LICENSE](LICENSE.md)
6 changes: 4 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
## Supported Versions

| Version | Supported |
| ------- | ------------------ |
| 1.0.x | :white_check_mark: |
|---------|--------------------|
| <1.2.0 | :x: |
| 1.2.X | :white_check_mark: |
| 2.0.X | :white_check_mark: |

## Reporting a Vulnerability

Expand Down
143 changes: 0 additions & 143 deletions build.gradle

This file was deleted.

137 changes: 137 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
/*
* BetterReports - build.gradle.kts
*
* Copyright (c) 2022 AusTech Development
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

plugins {
java
id("org.ajoberstar.grgit") version "4.1.1"
id("com.github.johnrengelman.shadow") version "7.0.0"
id("io.freefair.lombok") version "6.0.0-m2"
id("net.kyori.indra") version "2.0.4" apply false
id("net.kyori.indra.git") version "2.0.4"
}

group = "dev.austech"
version = "2.0.0"

repositories {
mavenLocal()
maven {
url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
}

maven {
url = uri("https://oss.sonatype.org/content/groups/public/")
}

maven {
url = uri("https://repo.maven.apache.org/maven2/")
}

maven {
url = uri("https://repo.extendedclip.com/content/repositories/placeholderapi/")
}
}

dependencies {
compileOnly("org.spigotmc:spigot-api:1.12-R0.1-SNAPSHOT")
compileOnly("me.clip:placeholderapi:2.11.2")
compileOnly("org.jetbrains:annotations:23.0.0")
implementation("org.bstats:bstats-bukkit:3.0.0")
}


fun getCommitsSinceLastTag(): Int {
if (indraGit.git() == null || !indraGit.isPresent || indraGit.tags().isEmpty()) {
return -1
}

var tags = indraGit.tags()
var depth = 0
val walk = org.eclipse.jgit.revwalk.RevWalk(indraGit.git()!!.repository)
var commit = walk.parseCommit(indraGit.commit())

while (true) {
for (tag in tags) {
if (walk.parseCommit(tag.getLeaf().getObjectId()) == commit) {
walk.dispose()
return depth
}
}
depth++
commit = walk.parseCommit(commit.getParents()[0])
}
}

ext {
val GIT_COMMIT = if (!indraGit.isPresent()) "unknown" else indraGit.commit()?.abbreviate(7)?.name() ?: "unknown"
val GIT_DEPTH = getCommitsSinceLastTag()

val fullVersion = "$version".replace("-SNAPSHOT", "-dev+${GIT_DEPTH}-${GIT_COMMIT}")

set("fullVersion", fullVersion)
}

tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}

tasks.withType<ProcessResources> {
expand("version" to project.ext["fullVersion"])
outputs.upToDateWhen { false }
}

task<Copy>("copyJars") {
from(tasks.findByPath("shadowJar"))
rename(".*-all.jar", project.name + "-" + project.ext["fullVersion"] + ".jar")
into("jars")
}

tasks.withType<ShadowJar> {
relocate("org.bstats", "dev.austech.betterreports.metrics")
}

fun register(name: String, path: String) {
tasks.register<Copy>(name) {
dependsOn(tasks.named("build"))
from("jars", project.name + "-" + project.ext["fullVersion"] + ".jar")
into(path)
}
}

register("mnewt00", "C:\\Users\\mnewt\\Desktop\\Code\\Server\\1.19\\plugins")

task("cleanJars") {
delete("jars")
}

tasks.named("clean") {
dependsOn("cleanJars")
}

tasks.named("build") {
dependsOn("shadowJar")
dependsOn("copyJars")
}
5 changes: 0 additions & 5 deletions settings.gradle

This file was deleted.

Loading

0 comments on commit 746f5b9

Please sign in to comment.