-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add development server * fix: kotlin not being shaded * fix: x/y bounds & automatically op Automatically grant op/creative on local server
- Loading branch information
1 parent
30ec36d
commit 01deee1
Showing
7 changed files
with
160 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import xyz.jpenilla.runpaper.task.RunServer | ||
|
||
plugins { | ||
kotlin("jvm") version "1.9.20" | ||
id("com.github.johnrengelman.shadow") version "8.1.1" | ||
|
||
id("net.minecrell.plugin-yml.bukkit") version "0.5.3" | ||
id("xyz.jpenilla.run-paper") version "2.1.0" | ||
} | ||
|
||
group = "me.tech" | ||
version = "1.0.0" | ||
|
||
repositories { | ||
mavenCentral() | ||
|
||
maven("https://papermc.io/repo/repository/maven-public/") | ||
} | ||
|
||
dependencies { | ||
compileOnly("io.papermc.paper:paper-api:1.20.2-R0.1-SNAPSHOT") | ||
|
||
// implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.20") | ||
implementation(rootProject) | ||
} | ||
|
||
tasks.withType<RunServer> { | ||
minecraftVersion("1.20.2") | ||
} | ||
|
||
java { | ||
toolchain.languageVersion.set(JavaLanguageVersion.of(17)) | ||
} | ||
|
||
bukkit { | ||
name = "ui-development" | ||
apiVersion = "1.20" | ||
version = "${project.version}" | ||
authors = listOf("Tech") | ||
main = "me.tech.development.DevelopmentPlugin" | ||
|
||
commands { | ||
register("openui") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#By changing the setting below to TRUE you are indicating your agreement to our EULA (https://aka.ms/MinecraftEULA). | ||
#Sat Nov 25 10:08:58 EST 2023 | ||
eula=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#Minecraft server properties | ||
#Sat Nov 25 10:27:18 EST 2023 | ||
enable-jmx-monitoring=false | ||
rcon.port=25575 | ||
level-seed= | ||
gamemode=survival | ||
enable-command-block=false | ||
enable-query=false | ||
generator-settings={} | ||
enforce-secure-profile=true | ||
level-name=world | ||
motd=A Minecraft Server | ||
query.port=25565 | ||
pvp=true | ||
generate-structures=true | ||
max-chained-neighbor-updates=1000000 | ||
difficulty=easy | ||
network-compression-threshold=256 | ||
max-tick-time=60000 | ||
require-resource-pack=false | ||
use-native-transport=true | ||
max-players=20 | ||
online-mode=true | ||
enable-status=true | ||
allow-flight=false | ||
initial-disabled-packs= | ||
broadcast-rcon-to-ops=true | ||
view-distance=2 | ||
server-ip= | ||
resource-pack-prompt= | ||
allow-nether=true | ||
server-port=25565 | ||
enable-rcon=false | ||
sync-chunk-writes=true | ||
op-permission-level=4 | ||
prevent-proxy-connections=false | ||
hide-online-players=false | ||
resource-pack= | ||
entity-broadcast-range-percentage=100 | ||
simulation-distance=10 | ||
rcon.password= | ||
player-idle-timeout=0 | ||
debug=false | ||
force-gamemode=false | ||
rate-limit=0 | ||
hardcore=false | ||
white-list=false | ||
broadcast-console-to-ops=true | ||
spawn-npcs=true | ||
spawn-animals=true | ||
log-ips=true | ||
function-permission-level=2 | ||
initial-enabled-packs=vanilla | ||
level-type=minecraft\:normal | ||
text-filtering-config= | ||
spawn-monsters=true | ||
enforce-whitelist=false | ||
spawn-protection=16 | ||
resource-pack-sha1= | ||
max-world-size=29999984 |
42 changes: 42 additions & 0 deletions
42
development/src/main/kotlin/me/tech/development/DevelopmentPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package me.tech.development | ||
|
||
import me.tech.mcchestui.* | ||
import net.kyori.adventure.text.Component | ||
import org.bukkit.GameMode | ||
import org.bukkit.Material | ||
import org.bukkit.entity.Player | ||
import org.bukkit.event.EventHandler | ||
import org.bukkit.event.Listener | ||
import org.bukkit.event.player.PlayerJoinEvent | ||
import org.bukkit.plugin.java.JavaPlugin | ||
|
||
class DevelopmentPlugin : JavaPlugin(), Listener { | ||
override fun onEnable() { | ||
getCommand("openui")?.setExecutor { sender, _, _, _ -> | ||
(sender as? Player)?.openGUI(open(sender)) | ||
true | ||
} | ||
|
||
// op & set gamemode on local server. | ||
server.pluginManager.registerEvents(object : Listener { | ||
@EventHandler | ||
fun PlayerJoinEvent.on() { | ||
player.gameMode = GameMode.CREATIVE | ||
player.isOp = true | ||
} | ||
}, this) | ||
} | ||
|
||
private fun open(player: Player): GUI { | ||
return gui( | ||
this, | ||
title = Component.text("Test UI"), | ||
type = GUIType.Chest(rows = 3) | ||
) { | ||
slot(1, 1) { | ||
item = item(Material.CAKE) | ||
onClick = { it.sendMessage("You've clicked the cake!") } | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
rootProject.name = "mc-chestui-plus" | ||
rootProject.name = "mc-chestui-plus" | ||
|
||
include("development") |