Skip to content

Commit

Permalink
必要なものを設置
Browse files Browse the repository at this point in the history
  • Loading branch information
Ringoame196 committed Dec 30, 2023
1 parent 96e12a1 commit 9407f20
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 13 deletions.
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
# SpigotPluginTemplate

## 使い方

- `Use this template` を押して、GitHub 上にプロジェクトを作成する。
- 作成したプロジェクトをクローンする。
- Gradle の `setup` タスクを実行して、初期化する。
# itemName2

## plugin.yml

Expand All @@ -26,4 +20,3 @@ configure<BukkitPluginDescription> {
### テストサーバーの起動 `buildAndLaunchServer`

`:25565` でテストサーバーを起動します。

31 changes: 27 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ repositories {
mavenCentral()
maven(url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
maven(url = "https://oss.sonatype.org/content/groups/public/")
maven(url = "https://jitpack.io")
maven(url ="https://maven.enginehub.org/repo/")
}

val shadowImplementation: Configuration by configurations.creating
Expand All @@ -30,24 +32,44 @@ configurations["implementation"].extendsFrom(shadowImplementation)
dependencies {
shadowImplementation(kotlin("stdlib"))
compileOnly("org.spigotmc:spigot-api:$pluginVersion-R0.1-SNAPSHOT")
implementation("com.fasterxml.jackson.core:jackson-databind:2.13.0")
compileOnly("com.github.MilkBowl:VaultAPI:1.7")
implementation("com.sk89q.worldguard:worldguard-bukkit:7.0.1")
compileOnly ("com.sk89q.worldguard:worldguard-bukkit:VERSION")
}

configure<BukkitPluginDescription> {
main = "@group@.Main"
main = "com.github.Ringoame196.Main"
version = gitVersion()
apiVersion = "1." + pluginVersion.split(".")[1]
commands {
register("test1111") {
description = "This is a test command!"
aliases = listOf("t")
permission = "testplugin.test"
usage = "Just run the command!"
//。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。 permissionMessage = "You may not test this command!"
}
//。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。 ...
}
}

tasks.withType<ShadowJar> {
configurations = listOf(shadowImplementation)
archiveClassifier.set("")
relocate("kotlin", "@group@.libs.kotlin")
relocate("org.intellij.lang.annotations", "@group@.libs.org.intellij.lang.annotations")
relocate("org.jetbrains.annotations", "@group@.libs.org.jetbrains.annotations")
relocate("kotlin", "com.github.Ringoame196.libs.kotlin")
relocate("org.intellij.lang.annotations", "com.github.Ringoame196.libs.org.intellij.lang.annotations")
relocate("org.jetbrains.annotations", "com.github.Ringoame196.libs.org.jetbrains.annotations")
}

tasks.named("build") {
dependsOn("shadowJar")
doFirst {
copy {
from(buildDir.resolve("libs/${project.name}.jar"))
into("D:/デスクトップ/Twitterサーバー/plugins")
}
}
}

task<LaunchMinecraftServerTask>("buildAndLaunchServer") {
Expand All @@ -66,4 +88,5 @@ task<LaunchMinecraftServerTask>("buildAndLaunchServer") {
agreeEula.set(true)
}


task<SetupTask>("setup")
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Minecraft Version
pluginVersion=1.18.1
pluginVersion=1.19.3
18 changes: 18 additions & 0 deletions push.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@echo off

REM ユーザーにコミットメッセージを入力させる
set /p commit_message="Enter commit message: "

REM git add, commit, push を実行
git add .
git commit -m "%commit_message%"
if errorlevel 1 (
echo Error
) else (
git push
if errorlevel 1 (
echo Error
) else (
echo Success
)
)
18 changes: 18 additions & 0 deletions src/main/kotlin/com/github/Ringoame196/Commands/itemName.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.github.Ringoame196.Commands

import org.bukkit.command.Command
import org.bukkit.command.CommandExecutor
import org.bukkit.command.CommandSender
import org.bukkit.command.TabCompleter

class itemName : CommandExecutor,TabCompleter{
override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array<out String>): Boolean {
return true
}

override fun onTabComplete(sender: CommandSender, command: Command, label: String, args: Array<out String>): MutableList<String>? {
val subCommand = mutableListOf<String>()

return subCommand
}
}
15 changes: 15 additions & 0 deletions src/main/kotlin/com/github/Ringoame196/Main.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.github.Ringoame196

import com.github.Ringoame196.Commands.itemName
import org.bukkit.plugin.java.JavaPlugin

class Main : JavaPlugin() {
override fun onEnable() {
super.onEnable()
getCommand("itemName")!!.setExecutor(itemName())
}

override fun onDisable() {
super.onDisable()
}
}

0 comments on commit 9407f20

Please sign in to comment.