Skip to content

Commit 5dcad79

Browse files
- version change
- added authors - changed gradle version - changed folia lib repo
1 parent 598d138 commit 5dcad79

File tree

7 files changed

+41
-27
lines changed

7 files changed

+41
-27
lines changed

build.gradle

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
plugins {
2-
id 'java'
3-
id 'xyz.jpenilla.run-paper' version '2.3.1'
2+
id 'java-library'
43
id 'io.github.goooler.shadow' version '8.1.8'
4+
id 'xyz.jpenilla.run-paper' version '3.0.1'
55
}
66

77
group = 'lol.hub'
8-
version = '4.0.4'
8+
version = pluginVersion
99
description = 'Minecraft self-service teleport requests'
1010

11+
ext {
12+
minecraftVersion = project.findProperty('minecraftVersion') ?: '1.20.4'
13+
javaVersion = JavaVersion.toVersion(project.findProperty('javaVersion') ?: '21')
14+
pluginVersion = project.findProperty('pluginVersion') ?: '1.0.0'
15+
}
16+
1117
repositories {
1218
mavenCentral()
1319
maven {
@@ -22,7 +28,7 @@ repositories {
2228
}
2329
maven {
2430
// FoliaLib
25-
url = 'https://nexuslite.gcnt.net/repos/other/'
31+
url = 'https://repo.tcoded.com/releases/'
2632
content {
2733
includeGroup 'com.tcoded'
2834
}
@@ -32,26 +38,27 @@ repositories {
3238
dependencies {
3339
// paper api
3440
// https://jd.papermc.io/paper/1.20/
35-
compileOnly group: 'io.papermc.paper', name: 'paper-api', version: "${project.minecraft_version}-R0.1-SNAPSHOT"
41+
compileOnly group: 'io.papermc.paper', name: 'paper-api', version: "${minecraftVersion}-R0.1-SNAPSHOT"
3642

3743
// folia api
3844
// https://jd.papermc.io/folia/1.20/
39-
//compileOnly group: 'dev.folia', name: 'folia-api', version: "${project.minecraft_version}-R0.1-SNAPSHOT"
45+
//compileOnly group: 'dev.folia', name: 'folia-api', version: "${minecraftVersion}-R0.1-SNAPSHOT"
4046

4147
// https://github.com/TechnicallyCoded/FoliaLib
42-
shadow group: 'com.tcoded', name: 'FoliaLib', version: "0.4.2"
48+
shadow group: 'com.tcoded', name: 'FoliaLib', version: "0.5.1"
4349

4450
// Other dependencies
4551
shadow 'org.bstats:bstats-bukkit:3.1.0'
4652
}
4753

4854
java {
49-
toolchain.languageVersion = JavaLanguageVersion.of(21)
55+
sourceCompatibility = javaVersion
56+
targetCompatibility = javaVersion
5057
}
58+
5159
tasks.withType(JavaCompile).configureEach {
52-
it.sourceCompatibility = it.targetCompatibility = JavaVersion.toVersion(21)
53-
it.options.release = 21
54-
it.options.encoding = 'UTF-8'
60+
options.encoding = 'UTF-8'
61+
options.release = sourceCompatibility.toInteger()
5562
}
5663

5764
processResources {
@@ -65,29 +72,30 @@ processResources {
6572
// https://imperceptiblethoughts.com/shadow/
6673
shadowJar {
6774
configurations = [project.configurations.shadow]
68-
archiveFileName = "${project.name}-${project.version}+${project.minecraft_version}.jar"
75+
archiveFileName = "${project.name}-${project.version}+${minecraftVersion}.jar"
6976
destinationDirectory = layout.buildDirectory.dir('dist')
7077

71-
relocate 'org.bstats', 'com.krazzzzymonkey.cloudanarchycore.bstats'
72-
relocate 'com.tcoded', 'com.krazzzzymonkey.cloudanarchycore.tcoded'
78+
relocate 'org.bstats', 'lol.hub.bstats'
79+
relocate 'com.tcoded', 'lol.hub.tcoded'
7380

7481
// delete unshaded jar
7582
doLast {
7683
file(jar.archiveFile).delete()
7784
}
7885
}
79-
build.finalizedBy(shadowJar)
86+
tasks.named('build') { finalizedBy(shadowJar) }
8087

8188
tasks {
8289
runServer {
83-
runDirectory = layout.projectDirectory.dir('run')
84-
minecraftVersion(project.minecraft_version)
90+
runDirectory = project.layout.projectDirectory.dir('run')
91+
minecraftVersion(minecraftVersion)
8592
dependsOn('build')
8693
systemProperty('com.mojang.eula.agree', 'true')
8794
downloadPlugins {
88-
url("https://github.com/ViaVersion/ViaBackwards/releases/download/5.3.2/ViaBackwards-5.3.2.jar")
89-
url("https://github.com/ViaVersion/ViaVersion/releases/download/5.3.2/ViaVersion-5.3.2.jar")
90-
url("https://github.com/dmulloy2/ProtocolLib/releases/download/5.3.0/ProtocolLib.jar")
95+
url("https://github.com/ViaVersion/ViaBackwards/releases/download/5.5.0/ViaBackwards-5.5.0.jar")
96+
url("https://github.com/ViaVersion/ViaVersion/releases/download/5.5.0/ViaVersion-5.5.0.jar")
97+
url("https://github.com/dmulloy2/ProtocolLib/releases/download/5.4.0/ProtocolLib.jar")
98+
url("https://ci.codemc.io/job/Updated-NoCheatPlus/job/Updated-NoCheatPlus/198/artifact/target/NoCheatPlus.jar")
9199
}
92100
}
93101
}

gradle.properties

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
minecraft_version=1.20.4
1+
# Plugin version
2+
pluginVersion=4.0.5
3+
4+
# Java version
5+
javaVersion=21
6+
7+
# Minecraft version
8+
minecraftVersion=1.20.4

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

src/main/java/lol/hub/hubtp/Plugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ private void registerTpCommand(String label, PluginCommand pCmd, Function<Plugin
151151
*/
152152
@Override
153153
public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command,
154-
@NotNull String commandLabel, String[] args) {
154+
@NotNull String commandLabel, String @NotNull [] args) {
155155
// Stop console access
156156
if (!(commandSender instanceof Player sender)) {
157157
Log.warn("Ignoring command executed by non-player sender: " + commandSender.getName());

src/main/java/lol/hub/hubtp/RequestManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private static List<Request> cancelRequestsByRequesterInternal(Player requester,
9595
List<Request> toCancel = pendingRequests.keySet().stream()
9696
.filter(request -> request.requester().uuid().equals(requester.getUniqueId()))
9797
.filter(request -> targetName == null || request.target().name().equalsIgnoreCase(targetName))
98-
.collect(Collectors.toList());
98+
.toList();
9999

100100
if (toCancel.isEmpty()) {
101101
return List.of();

src/main/java/lol/hub/hubtp/commands/CancelCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public void run(Player commandSender, String targetName) {
4444
return;
4545
}
4646

47-
String resolvedTargetName = cancelled.get(0).target().name();
47+
String resolvedTargetName = cancelled.getFirst().target().name();
4848
commandSender.sendMessage(
4949
Component.text("Cancelled teleport request to ", NamedTextColor.GOLD)
5050
.append(Component.text(resolvedTargetName, NamedTextColor.GOLD))

src/main/resources/plugin.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ name: HubTP
22
version: @VERSION@
33
description: @DESCRIPTION@
44
website: "https://github.com/zeroBzeroT/HubTP/"
5-
author: 'nothub'
6-
authors: [ 'AlexProgrammerDE', 'MaybeEther', 'SooStrator', 'bierdosenhalter' ]
5+
authors: [ 'nothub', 'AlexProgrammerDE', 'MaybeEther', 'SooStrator', 'bierdosenhalter', 'v0ee' ]
76
main: 'lol.hub.hubtp.Plugin'
87
api-version: '1.20'
98

0 commit comments

Comments
 (0)