Skip to content

Commit

Permalink
Merge bukkit utils into main repository (#54)
Browse files Browse the repository at this point in the history
* Initial commit

* Moved to bukkit-utils from rlf/uSkyBlock

* v1.11

* UUIDUtil and more

* CRLF vs LF.... sigh

* LocationUtil

* ItemStackUtil

* fix test data to CRLF

* TimeUtil added

* Fix minor error in PlainTextCommandVisitor

* Added sorting to AbstractTabCompleter and two player completers

* Make EntitySpawner 1.8 compliant and add 1.11 support to Travis

* Add VersionUtil

* Bump version of Vault and Bukkit

* Bump various versions and quick-fix Issues rlf#1059, rlf#1057

* JDK 1.8

* bump version

* what-evs

* expose mocking

* Fix issue rlf#1064 - challenge chests

* Fix issue rlf#1064 - challenge chests

* move to using marktr instead of tr for commands

* Update mockito and add backdoor for plugin-owners

* Also allow permission-override on abstract commands

* add github.global property

* Paginate only commands the player has access to

* block tab-listing when no permissions

* Improve the reading of stringlists to support space separated lists

* Improve createItemStack for 1.13 detection given 1.12 item-names

* Update ReflectionUtil to be used by StructureAPI

* Improve LocationUtil and add LanguageCommand

* Version to 1.24, fix tests on non-Windows/CRLF, auto deploy via Travis

* First 1.14.2 build

* Attempt to fix deployment #1

* Openjdk8, not oraclejdk9

* 1.25-SNAPSHOT, MC1.16.1

* Java 16, Spigot 1.17

* Add apache snapshots plugin repo

* Hard-code MojangsonParser package name

* Remove JSONSimple dependency (#2)

* Remove JSONUtil
* Use Gson for NBTUtil test

* [ci-skip] Remove unused and outdated PermissionUtil

* NBT map field is now called x

* Deploy using GH Actions

* Remove Travis

* Integrate bukkit-util as maven module

* Update custom yaml handler to not duplicate comments

---------

Co-authored-by: Razorax <[email protected]>
Co-authored-by: Muspah <[email protected]>
Co-authored-by: Muspah <[email protected]>
  • Loading branch information
4 people authored Jun 27, 2024
1 parent 518f3fa commit 01c3894
Show file tree
Hide file tree
Showing 65 changed files with 5,315 additions and 30 deletions.
1 change: 0 additions & 1 deletion bukkit-utils
Submodule bukkit-utils deleted from d4017e
23 changes: 23 additions & 0 deletions bukkit-utils/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

[*.java]
end_of_line=lf

[*.json]
indent_size = 2

[*.{yml,yaml}]
indent_size = 2

[*.md]
trim_trailing_whitespace = false

[*.sh]
end_of_line = lf
48 changes: 48 additions & 0 deletions bukkit-utils/.github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Maven build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build_and_test:
if: github.repository_owner == 'uskyblock'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: JDK 16
uses: actions/setup-java@v1
with:
java-version: '16'
distribution: 'adopt'
- name: Cache Maven repository
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: mvn -U clean deploy

# Deploy steps when pushed to master
- name: Install SSH key
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.SSH_KNOWN_HOST }}
- name: Rsync deploy mvn repo
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
run: |
rsync -r --quiet -e "ssh -p 2222 -o StrictHostKeyChecking=no" \
target/mvn-repo/ \
[email protected]:WWW-USB/maven/uskyblock/
- name: Rsync deploy javadocs
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
run: |
rsync -r --quiet -e "ssh -p 2222 -o StrictHostKeyChecking=no" \
target/site/apidocs \
[email protected]:WWW-USB/javadocs/dependencies/bukkit-utils/
4 changes: 4 additions & 0 deletions bukkit-utils/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.idea
**/*.iml
/target
deploy_rsa
48 changes: 48 additions & 0 deletions bukkit-utils/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# bukkit-utils

This module holds general Bukkit Utilities enabling easier Bukkit Plugin creation.

## Utilities

* [FileUtil](src/main/java/dk/lockfuglsang/minecraft/file/README.md) - UTF-8, Locale and merging config files from jar
* [YmlConfiguration](src/main/java/dk/lockfuglsang/minecraft/yml/README.md) - Support for comments in yml-files
* [Commands](src/main/java/dk/lockfuglsang/minecraft/command/README.md) - Framework for easy command-creation

# License

This module is copyrighted by the authors, and licensed for re-use as Apache License 2.0.

# Usage

Put this in your `pom.xml`:

```
<repositories>
<repository>
<id>uSkyBlock-mvn-repo</id>
<url>https://raw.github.com/rlf/mvn-repo/master</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>dk.lockfuglsang.minecraft</groupId>
<artifactId>bukkit-utils</artifactId>
<version>1.22</version>
</dependency>
</dependencies>
```

# Version History

## 1.22 - Bukkit 1.13 compatible

## 1.21 - Bukkit 1.12 compatible

## v1.1

* FileUtil, I18nUtil

## v1.0
Initial release, extracted from the source-code used in uSkyBlock

* YmlConfiguration, Commands
166 changes: 166 additions & 0 deletions bukkit-utils/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>uSkyBlock</artifactId>
<groupId>ovh.uskyblock</groupId>
<version>3.1.0-SNAPSHOT</version>
</parent>
<artifactId>bukkit-utils</artifactId>

<properties>
<vaultapi.version>1.7</vaultapi.version>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<scm>
<connection>scm:git:git://github.com/uskyblock/bukkit-utils.git</connection>
<developerConnection>scm:git:git://github.com/uskyblock/bukkit-utils.git</developerConnection>
<url>https://github.com/uskyblock/bukkit-utils.git</url>
</scm>

<distributionManagement>
<repository>
<id>internal.repo</id>
<name>Temporary Staging Repository</name>
<url>file://${project.build.directory}/mvn-repo</url>
</repository>
</distributionManagement>

<repositories>
<repository>
<id>spigotmc.org</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/public</url>
</repository>
<repository> <!-- uSkyBlock dependencies that don't have a (stable) repository -->
<id>uskyblock-dependencies</id>
<url>https://www.uskyblock.ovh/maven/dependencies/</url>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<id>apache-snapshots</id>
<url>https://repository.apache.org/snapshots/</url>
</pluginRepository>
</pluginRepositories>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<release>16</release>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<show>public</show>
<failOnError>false</failOnError>
<doclint>none</doclint>
</configuration>
<executions>
<execution>
<goals>
<goal>javadoc</goal>
</goals>
<phase>deploy</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>ovh.uskyblock</groupId>
<artifactId>po-utils</artifactId>
<version>3.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>${spigotapi.version}</version>
<optional>true</optional>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>VaultAPI</artifactId>
<version>${vaultapi.version}</version>
<optional>true</optional>
</dependency>
<!-- DEPRECATED -->
<!-- <dependency>-->
<!-- <groupId>com.googlecode.json-simple</groupId>-->
<!-- <artifactId>json-simple</artifactId>-->
<!-- <version>1.1.1</version>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.28.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.7</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package dk.lockfuglsang.minecraft.animation;

import org.bukkit.entity.Player;

/**
* Common interface for animations
*/
public interface Animation {
boolean show();

boolean hide();

Player getPlayer();
}
Loading

0 comments on commit 01c3894

Please sign in to comment.