Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 18 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
plugins {
id 'java-library'
id 'maven-publish'
id("io.papermc.paperweight.userdev") version "1.7.1"
id("xyz.jpenilla.run-paper") version "2.3.0"
id("io.papermc.paperweight.userdev") version "2.0.0-beta.17"
id("xyz.jpenilla.run-paper") version "2.3.1"
}
// Suppiled by Jenkins
ext.majorVersion = 2
ext.minorVersion = 12
ext.minecraftVersion = "1.20.4"
ext.minecraftVersion = "1.21.7"

ext.buildNumber = System.env.BUILD_NUMBER == null ? "dev" : "build" + "$System.env.BUILD_NUMBER"
ext.buildNumber = System.env.BUILD_NUMBER == null ? "dev" : "build" + "$System.env.BUILD_NUMBER"
ext.mavenDirectory = System.env.MAVEN_DIR == null ? "$projectDir/repo" : "$System.env.MAVEN_DIR"
ext.jdDirectory = System.env.JAVADOCS_DIR == null ? null : "$System.env.JAVADOCS_DIR"

// differet version convension from Nyaa plugins
// different version convention than Nyaa plugins
group = "de.greensurvivors"
archivesBaseName = "Padlock"
version = "$majorVersion.$minorVersion.$buildNumber".toString()
Expand All @@ -25,8 +25,8 @@ runServer {
*/

java {
// Configure the java toolchain. This allows gradle to auto-provision JDK 17 on systems that only have JDK 8 installed for example.
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
// Configure the java toolchain. This allows gradle to auto-provision JDK 21 on systems that only have JDK 8 installed for example.
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}

// extra compile warnings
Expand All @@ -36,7 +36,7 @@ compileJava {

// Set the release flag. This configures what version bytecode the compiler will emit, as well as what JDK APIs are usable.
// See https://openjdk.java.net/jeps/247 for more information.
options.release.set(17)
options.release.set(21)
}

repositories {
Expand All @@ -47,16 +47,20 @@ repositories {
}

dependencies {
implementation 'org.apache.commons:commons-collections4:4.4'
implementation 'org.jetbrains:annotations:24.1.0'
implementation("com.github.ben-manes.caffeine:caffeine:3.1.8") // caches
implementation("de.mkammerer:argon2-jvm:2.11") // native password hashing with argon2
implementation 'org.apache.commons:commons-collections4:4.5.0'
implementation 'org.jetbrains:annotations:26.0.2'
implementation("com.github.ben-manes.caffeine:caffeine:3.2.1") // caches
implementation("de.mkammerer:argon2-jvm:2.12") // native password hashing with argon2

paperweight.paperDevBundle("$minecraftVersion-R0.1-SNAPSHOT")
compileOnly ('com.sk89q.worldguard:worldguard-bukkit:7.1.0-SNAPSHOT') { transitive = false }
compileOnly('com.github.MilkBowl:VaultAPI:1.7') { transitive = false }
compileOnly('com.sk89q.worldguard:worldguard-bukkit:7.0.14-SNAPSHOT') { transitive = false }
compileOnly('com.github.MilkBowl:VaultAPI:1.7.1') { transitive = false }
}

// we only work with paper and downstream!
// todo
//paperweight.reobfArtifactConfiguration = ReobfArtifactConfiguration.MOJANG_PRODUCTION

processResources {
expand version: project.version,
mcVersion: "$minecraftVersion"
Expand All @@ -68,13 +72,6 @@ tasks.register('sourcesJar', Jar) {
from sourceSets.main.java.srcDirs
}

tasks {
// Configure reobfJar to run when invoking the build task
assemble {
dependsOn(reobfJar)
}
}

publishing {
publications {
mavenJava(MavenPublication) {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 deletions gradlew

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

22 changes: 12 additions & 10 deletions gradlew.bat

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

21 changes: 6 additions & 15 deletions src/main/java/de/greensurvivors/padlock/Padlock.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package de.greensurvivors.padlock;

import de.greensurvivors.padlock.command.ApplyPassword;
import de.greensurvivors.padlock.command.MainCommand;
import de.greensurvivors.padlock.config.ConfigManager;
import de.greensurvivors.padlock.config.MessageManager;
import de.greensurvivors.padlock.impl.DependencyManager;
import de.greensurvivors.padlock.impl.LockCacheManager;
import de.greensurvivors.padlock.impl.openabledata.OpenableToggleManager;
import de.greensurvivors.padlock.listener.*;
import de.greensurvivors.padlock.listener.BlockDebugListener;
import de.greensurvivors.padlock.listener.BlockEnvironmentListener;
import de.greensurvivors.padlock.listener.BlockInventoryMoveListener;
import de.greensurvivors.padlock.listener.BlockPlayerListener;
import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.Plugin;
Expand Down Expand Up @@ -67,9 +69,9 @@ public void onEnable() {
pluginManager.registerEvents(new BlockPlayerListener(this), this);
pluginManager.registerEvents(new BlockEnvironmentListener(this), this);
pluginManager.registerEvents(new BlockInventoryMoveListener(this), this);
pluginManager.registerEvents(new ChatPlayerListener(this), this);
//setPassword and applyPassword commands are also listener, but they will register themself.

//register commands
//register main command; applyPassword will - again - register itself
MainCommand lockCmd = new MainCommand(this);

PluginCommand mainCommand = getCommand("padlock");
Expand All @@ -81,17 +83,6 @@ public void onEnable() {
getLogger().log(Level.SEVERE, "Couldn't register command 'padlock'!");
}

ApplyPassword pwCmd = new ApplyPassword(plugin);
PluginCommand pwCommand = getCommand("password");
if (pwCommand != null) {

pwCommand.setExecutor(pwCmd);
pwCommand.setTabCompleter(pwCmd);
} else {
getLogger().log(Level.SEVERE, "Couldn't register command 'password'!");
}


// Dependencys
dependencyManager = new DependencyManager(this);
}
Expand Down
Loading