Skip to content

Commit

Permalink
2.1.0
Browse files Browse the repository at this point in the history
- Updated build.gradle to utilize shadowJar
- Added JetBrains annotations throughout the project
- Added detailed block comments above every method
- Added detailed logging and exception handling instead of printing stack traces
- Minor code improvements and changes
  • Loading branch information
Foulest committed Jan 21, 2024
1 parent 4101238 commit e788bec
Show file tree
Hide file tree
Showing 20 changed files with 1,917 additions and 173 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Source repository: https://github.com/actions/dependency-review-action
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
name: 'Dependency Review'
on: [pull_request]
on: [ pull_request ]

permissions:
contents: read
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ hs_err_pid*
# Java compiled files
*.class
*.ear
*.jar
*.nar
*.war

Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
# Vault

[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![Codacy Security Scan](https://github.com/Foulest/Vault/actions/workflows/codacy.yml/badge.svg)](https://github.com/Foulest/Vault/actions/workflows/codacy.yml)
[![DevSkim Badge](https://github.com/Foulest/Vault/actions/workflows/devskim.yml/badge.svg)](https://github.com/Foulest/Vault/actions/workflows/devskim.yml)
[![JitPack Badge](https://jitpack.io/v/Foulest/Vault.svg)](https://jitpack.io/#Foulest/Vault)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/08549e809046466f94a7f36663125529)](https://app.codacy.com/gh/Foulest/Vault/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)

Vault is a permissions, chat, & economy API to give plugins easy hooks into.

This is, of course, an updated fork of the original **[Vault](https://github.com/milkbowl/Vault)** project. Visit the original
project for more information.
This is, of course, an updated fork of the original **[Vault](https://github.com/milkbowl/Vault)** project. Visit the
original project for more information.

All credit for the original project goes to the **[MilkBowl](https://github.com/MilkBowl)** team.

## Features

- All the features of the original Vault project
- Re-coded the entire project to be more efficient and easier to maintain
- Merged the VaultAPI into the project itself
- Removed Vault's update checker and need for config files
- Updated to natively support newer versions of Minecraft
- Removed all built-in support for old permissions and chat plugins
- Moved existing commands under the `vault` command and revised them
- Lombok has been implemented to reduce boilerplate code
- Merged the VaultAPI into the project itself
- Migrated from using Maven to Gradle

## Getting Help
Expand Down
36 changes: 21 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
plugins {
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'maven-publish'
id 'java'
}

group = 'net.milkbowl'
version = '2.0.0'
version = '2.1.0'
description = 'Vault'
compileJava.options.encoding = 'UTF-8'
java.sourceCompatibility = JavaVersion.VERSION_1_8

repositories {
// Maven central repository
// Maven repositories
mavenCentral()
mavenLocal()

// Local libraries
flatDir {
dirs 'libs'
}

// Needed for Spigot API
maven {
url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots'
name 'Spigot Snapshots'

content {
includeGroup 'org.bukkit'
Expand All @@ -29,36 +32,39 @@ repositories {

maven {
url 'https://oss.sonatype.org/content/repositories/snapshots'
name 'Sonatype Snapshots'
}

maven {
url 'https://oss.sonatype.org/content/repositories/central'
name 'Sonatype Central'
}
}

configurations {
provided // Custom configuration for compile-only dependencies
implementation.extendsFrom(provided)
}

dependencies {
// Spigot API - necessary for project
// https://hub.spigotmc.org/nexus/content/repositories/snapshots
compileOnly group: 'org.spigotmc', name: 'spigot-api', version: '1.20.4-R0.1-SNAPSHOT'

// JetBrains Annotations - for code inspection and documentation
// https://mvnrepository.com/artifact/org.jetbrains/annotations
implementation group: 'org.jetbrains', name: 'annotations', version: '24.1.0'

// Lombok - for reducing boilerplate code
// https://projectlombok.org
implementation group: 'org.projectlombok', name: 'lombok', version: '1.18.30'
annotationProcessor group: 'org.projectlombok', name: 'lombok', version: '1.18.30'
}

jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
compileJava {
dependsOn('clean')
}

// Include compile-only dependencies in the JAR
from {
configurations.provided.collect { file ->
zipTree(file)
}
shadowJar {
dependencies {
exclude(dependency(group: 'org.projectlombok', name: 'lombok'))
}

minimize()
relocate 'org.jetbrains', 'net.milkbowl.vault.shaded.org.jetbrains'
}
11 changes: 9 additions & 2 deletions src/main/java/net/milkbowl/vault/Vault.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package net.milkbowl.vault;

import lombok.Getter;
import lombok.NonNull;
import net.milkbowl.vault.cmds.VaultCmd;
import net.milkbowl.vault.permission.Permission;
import net.milkbowl.vault.permission.SuperPerms;
Expand All @@ -11,10 +10,18 @@
import org.bukkit.plugin.ServicePriority;
import org.bukkit.plugin.ServicesManager;
import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull;

import java.util.logging.Level;

/**
* Main class for Vault.
*
* @author Foulest
* @project Vault
*/
@Getter
@SuppressWarnings("unused")
public class Vault extends JavaPlugin {

public static Vault instance;
Expand Down Expand Up @@ -53,7 +60,7 @@ public void onDisable() {
*
* @param commands Command to load.
*/
private void loadCommands(@NonNull Object... commands) {
private void loadCommands(Object @NotNull ... commands) {
for (Object command : commands) {
framework.registerCommands(command);
}
Expand Down
Loading

0 comments on commit e788bec

Please sign in to comment.