Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
1.0.0 hasty release
Browse files Browse the repository at this point in the history
  • Loading branch information
katorly committed Aug 2, 2024
1 parent f057bc3 commit 757d17c
Show file tree
Hide file tree
Showing 23 changed files with 485 additions and 75 deletions.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/git_toolbox_blame.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions .vscode/extensions.json

This file was deleted.

6 changes: 0 additions & 6 deletions .vscode/settings.json

This file was deleted.

19 changes: 0 additions & 19 deletions .vscode/tasks.json

This file was deleted.

27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
<h1 align="center">ExampleProject</h1>
<h1 align="center">ObfusPlayer</h1>
<p align="center">One sentence to describe your plugin.<br><br>
<a href="https://mozilla.org/MPL/2.0"><img src="https://img.shields.io/badge/license-MPL%202.0-brightgreen?style=flat-square"></a> <a href="https://github.com/katorlys/ExampleProject/releases/latest"><img src="https://img.shields.io/github/v/release/katorlys/ExampleProject?include_prereleases&style=flat-square"></a> <a href="https://github.com/katorlys/ExampleProject/actions/workflows/build.yml"><img src="https://img.shields.io/github/actions/workflow/status/katorlys/ExampleProject/build.yml?style=flat-square"></a> <a href="https://github.com/katorlys/ExampleProject/pulls"><img src="https://img.shields.io/github/issues-pr-closed/katorlys/ExampleProject?style=flat-square"></a> <a href="https://github.com/katorlys/ExampleProject/issues"><img src="https://img.shields.io/github/issues-closed/katorlys/ExampleProject?style=flat-square"></a> <a href="https://github.com/katorlys/ExampleProject"><img src="https://img.shields.io/tokei/lines/github/katorlys/ExampleProject?style=flat-square"></a></p>
<a href="https://mozilla.org/MPL/2.0"><img src="https://img.shields.io/badge/license-MPL%202.0-brightgreen?style=flat-square"></a> <a href="https://github.com/katorlys/ObfusPlayer/releases/latest"><img src="https://img.shields.io/github/v/release/katorlys/ObfusPlayer?include_prereleases&style=flat-square"></a> <a href="https://github.com/katorlys/ObfusPlayer/actions/workflows/build.yml"><img src="https://img.shields.io/github/actions/workflow/status/katorlys/ObfusPlayer/build.yml?style=flat-square"></a> <a href="https://github.com/katorlys/ObfusPlayer/pulls"><img src="https://img.shields.io/github/issues-pr-closed/katorlys/ObfusPlayer?style=flat-square"></a> <a href="https://github.com/katorlys/ObfusPlayer/issues"><img src="https://img.shields.io/github/issues-closed/katorlys/ObfusPlayer?style=flat-square"></a></p>

## Introduction
Describe your plugin clearly.
### Features
- Feature 1
### Dependencies
A simple Spigot 1.20.4 plugin to obfuscate players' name tag on their head and their names from tab list.

![](img/screenshot_1.png)
Will obfuscate player's name tag and their name from tab list.

![](img/screenshot_2.png)
Will not obfuscate player's name in chat.

## Commands
`/command` Command function.
- `/hide [on|off]` Toggle obfuscation for player's name tag and their name from tab list.

## Permissions
`permission.node` Permission description.
- `obfusplayer.use` To use `/hide` command.

## Config
config.yml:
```yml
# Your config here.
## Compile
```shell
./gradlew shadowJar
```

## Notice
- Test before reviewing. Please don't leave bad reviews if you dislike it.
- If you find a bug, still don't know how to use the plugin, or have new features to suggest, make sure you're using the lastest version of the plugin and then report bugs [on Github](https://github.com/katorlys/ExampleProject/issues). DO NOT use the review section to do these things, or you won't receive any support!
- If you find a bug, still don't know how to use the plugin, or have new features to suggest, make sure you're using the lastest version of the plugin and then report bugs [on Github](https://github.com/katorlys/ObfusPlayer/issues). DO NOT use the review section to do these things, or you won't receive any support!
- Have any other issues or questions? Go to [Discussions](https://github.com/orgs/katorlys/discussions) for further assistance.
13 changes: 8 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
java
kotlin("jvm") version "1.8.0"
id("net.minecrell.plugin-yml.bukkit") version "0.5.3" // Documentation: https://github.com/Minecrell/plugin-yml
id("com.github.johnrengelman.shadow") version "8.1.0" // Documentation: https://github.com/johnrengelman/shadow
id("net.minecrell.plugin-yml.bukkit") version "0.6.0" // Documentation: https://github.com/Minecrell/plugin-yml
id("com.github.johnrengelman.shadow") version "8.1.1" // Documentation: https://github.com/johnrengelman/shadow
}

val spigotVersion : String by project
Expand Down Expand Up @@ -41,9 +41,12 @@ bukkit {
main = pluginMain
author = pluginAuthor
description = pluginDescription
// commands {
// register("examplecommand")
// }
commands {
register("hide")
}
permissions {
register("obfusplayer.hide")
}
}

tasks {
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
kotlin.code.style = official

spigotVersion = 1.19.4-R0.1-SNAPSHOT
spigotVersion = 1.20.4-R0.1-SNAPSHOT

pluginGroup = com.github.katorly
pluginMain = com.github.katorly.exampleproject.ExampleProject
pluginMain = com.github.katorly.obfusplayer.ObfusPlayer

pluginName = ExampleProject
pluginApi = 1.19
pluginName = ObfusPlayer
pluginApi = 1.20
pluginVersion = 1.0.0
pluginAuthor = Katorly
pluginDescription = One sentence to describe your plugin.
pluginDescription = A simple Spigot plugin to obfuscate player's name tag and name from tab list.
Binary file added img/screenshot_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/screenshot_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

31 changes: 31 additions & 0 deletions src/main/kotlin/com/github/katorly/obfusplayer/CommandHandler.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.github.katorly.obfusplayer

import com.github.katorly.obfusplayer.commands.Chide
import org.bukkit.Bukkit
import org.bukkit.command.CommandExecutor
import org.bukkit.command.TabCompleter

class CommandHandler {
companion object {
/**
* Register all the commands of the plugin.
* Please make sure every argument is corresponding.
*
*/
fun registerCommands() {
val commands = arrayOf(
"hide"
)
val excutors = arrayOf<CommandExecutor>(
Chide()
)
val completers = arrayOf<TabCompleter>(
Chide()
)
for (i in commands.indices) {
Bukkit.getPluginCommand(commands[i])!!.setExecutor(excutors[i])
Bukkit.getPluginCommand(commands[i])!!.tabCompleter = completers[i]
}
}
}
}
22 changes: 22 additions & 0 deletions src/main/kotlin/com/github/katorly/obfusplayer/ObfusPlayer.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.github.katorly.obfusplayer

import org.bukkit.plugin.java.JavaPlugin

class ObfusPlayer: JavaPlugin() {
companion object {
lateinit var INSTANCE: ObfusPlayer
private set
}

override fun onEnable() {
INSTANCE = this
CommandHandler.registerCommands()
logger.info("[ObfusPlayer] Repo: https://github.com/katorlys/ObfusPlayer")
logger.info("[ObfusPlayer] Author: Katorly")
logger.info("[ObfusPlayer] ObfusPlayer enabled!")
}

override fun onDisable() {
logger.info("[ObfusPlayer] ObfusPlayer disabled!")
}
}
58 changes: 58 additions & 0 deletions src/main/kotlin/com/github/katorly/obfusplayer/commands/Chide.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package com.github.katorly.obfusplayer.commands

import com.github.katorly.obfusplayer.playername.obfuscatePlayerName
import com.github.katorly.obfusplayer.playername.toggleObfuscation
import com.github.katorly.obfusplayer.playername.unobfuscatePlayerName
import com.github.katorly.obfusplayer.utils.sm
import org.bukkit.command.Command
import org.bukkit.command.CommandSender
import org.bukkit.command.TabExecutor
import org.bukkit.entity.Player

/**
* The /hide command.
*
*/
class Chide : TabExecutor {
override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array<String>): Boolean {
if (command.name.equals("hide", ignoreCase = true)) {
if (sender is Player) {
if (sender.isOp || sender.hasPermission("obfusplayer.hide")) {
if (args.isEmpty()) {
toggleObfuscation(sender)
} else if (args.size == 1) {
if (args[0] == "on") {
obfuscatePlayerName(sender)
} else if (args[0] == "off") {
unobfuscatePlayerName(sender)
}
} else {
sender.sm("&e&lObfusPlayer &r&8>> &7Usage: &f/hide [on|off].")
}
} else {
sender.sm("&e&lObfusPlayer &r&8>> &7Insufficient permission!")
}
} else {
sender.sm("&e&lObfusPlayer &r&8>> &7Only players can use this command!")
}
}
return true
}

override fun onTabComplete(
sender: CommandSender,
command: Command,
label: String,
args: Array<String>
): List<String>? {
if (sender !is Player) {
return null
} else if (sender.isOp || sender.hasPermission("obfusplayer.hide")) {
val sub: MutableList<String> = ArrayList()
sub.add("on")
sub.add("off")
return sub
}
return null
}
}
Loading

0 comments on commit 757d17c

Please sign in to comment.