Skip to content

Commit

Permalink
move updatechecker to hangar and some other changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ArikSquad committed May 6, 2023
1 parent 224dfc9 commit 8d5b004
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 89 deletions.
58 changes: 0 additions & 58 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,61 +34,3 @@ jobs:
with:
name: "AnimVanish"
path: target/*.jar

upload:
if: "github.ref == 'refs/heads/main' && startsWith(github.event.head_commit.message, '[release] ')"

runs-on: ubuntu-latest
needs: plugin

steps:
- name: Git Checkout
uses: actions/checkout@v3

- name: Download Artifacts
uses: actions/download-artifact@v2

- name: Extract Maven project version
run: echo "name=version::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
id: project

- name: Create a Release
uses: marvinpinto/action-automatic-releases@latest
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: ${{ steps.project.outputs.version }}
prerelease: false
title: ${{ steps.project.outputs.version }}
files: |
target/*.jar
preupload:
if: "github.ref == 'refs/heads/main' && startsWith(github.event.head_commit.message, '[prerelease] ')"

runs-on: ubuntu-latest
needs: plugin

steps:
- name: Git Checkout
uses: actions/checkout@v3

- name: Download Artifacts
uses: actions/download-artifact@v2

- name: Extract Maven project version
run: echo "name=version::$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)" >> $GITHUB_OUTPUT
id: project

- name: Create a Release
uses: marvinpinto/action-automatic-releases@latest
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: ${{ steps.project.outputs.version }}
prerelease: false
title: ${{ steps.project.outputs.version }}
files: |
target/*.jar
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<modelVersion>4.0.0</modelVersion>

<groupId>eu.mikart</groupId>
<artifactId>animvanish</artifactId>
<version>1.0.8</version>
<artifactId>AnimVanish</artifactId>
<version>1.0.8-BETA</version>
<packaging>jar</packaging>

<name>AnimVanish</name>
Expand Down
47 changes: 28 additions & 19 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
<div style="text-align: center;">
<img src="docs/animvanish-transparent.png" style="width: 25%" alt="AnimVanish Logo">
<div align="center">

<img src="https://raw.githubusercontent.com/ArikSquad/AnimVanish/master/docs/animvanish-transparent.png" style="width: 25%" alt="AnimVanish Logo">

## AnimVanish
Plugin that provides large library of pre-made effects to your vanish with support for SuperVanish and PremiumVanish

Plugin that provides large library of pre-made effects for vanishing

<a href="https://papermc.io/">
<img src="https://img.shields.io/badge/paper-mc-blue.svg?style=for-the-badge&logo=" alt="paper-mc">
</a>
<a href="https://github.com/ArikSquad/AnimVanish/blob/master/LICENSE">
<img src="https://img.shields.io/github/license/ArikSquad/AnimVanish?style=for-the-badge" alt="license">
</a>
<a href="https://www.patreon.com/ariksquad">
<img src="https://img.shields.io/badge/Support-AnimVanish-red.svg?style=for-the-badge&logo=reddit" alt="Support AnimVanish on Patreon!">
</a>
</a>

<a href="https://github.com/ArikSquad/AnimVanish/blob/master/LICENSE">
<img src="https://img.shields.io/github/license/ArikSquad/AnimVanish?style=for-the-badge" alt="license">
</a>

<a href="https://www.patreon.com/ariksquad">
<img src="https://img.shields.io/badge/Support-AnimVanish-red.svg?style=for-the-badge&logo=reddit" alt="Support AnimVanish on Patreon!">
</a>

</div>

Remember to go check SuperVanish and PremiumVanish!
Our plugin makes your vanishing look great with a large library of pre-made effects on your vanish.
## Overview
Animvanish makes your vanishing look great with a large library of pre-made effects for vanishing.
You can use AnimVanish to vanish in front of your server community and make it look fantastic.

### Current library of effects:

- Lightning effect (Lightning strike and optional night)
- Particle effect
- TNT effect
Expand All @@ -29,12 +36,17 @@ Our plugin makes your vanishing look great with a large library of pre-made effe
- Turn effect
- Firework effect
- Blood effect
- Launch effect

## Configuration

You can find all about the configuration in the [wiki](https://github.com/ArikSquad/AnimVanish/wiki/Configuration)

## Permissions
For more in-depth information about permissions, please visit the [wiki](https://github.com/ArikSquad/AnimVanish/wiki/Permissions)

For more in-depth information about permissions, please visit
the [wiki](https://github.com/ArikSquad/AnimVanish/wiki/Permissions)

```yml
animvanish.* - All permissions in one
animvanish.invis - This permission allows vanishing with effects
Expand All @@ -45,11 +57,8 @@ animvanish.reload - This permission can reload the plugin
animvanish.help - This permissions can see help for the plugin
```

### Dependencies
AnimVanish depends on [SuperVanish](https://www.spigotmc.org/resources/supervanish-be-invisible.1331/) or [PremiumVanish](https://www.spigotmc.org/resources/premiumvanish-stay-hidden-bungee-support.14404/)!
Additionally, you need to get [Citizens](https://www.spigotmc.org/resources/citizens.13811/) for the NPC effect.

Planned Features
-------
| Feature name | Status |
|-----------------|--------|
| Mod Integration | |
| Built-in Vanish | |

6 changes: 3 additions & 3 deletions src/main/java/eu/mikart/animvanish/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ private void setupConfig() {
localeConfig.reloadConfig();
}
private void updateCheck() {
new UpdateChecker(this, Settings.PLUGIN_ID).getVersion(version -> {
Version currentVersion = new Version(getDescription().getVersion());
Version latestVersion = new Version(version);
new UpdateChecker(this).getVersion(version -> {
Version currentVersion = new Version(getDescription().getVersion().replace("-BETA", ""));
Version latestVersion = new Version(version.replace("-BETA", ""));
if (currentVersion.compareTo(latestVersion) < 0) {
getLogger().info("An update is available " + latestVersion + "! Download it here: " + Settings.PLUGIN_URL);
} else {
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/eu/mikart/animvanish/util/Settings.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package eu.mikart.animvanish.util;

import eu.mikart.animvanish.Main;
import org.jetbrains.annotations.NotNull;

public class Settings {
public static final String PLUGIN_URL = "https://www.spigotmc.org/resources/animvanish-1-19-animated-vanishing.102183/";
public static final int PLUGIN_ID = 102183;
public static final String PLUGIN_URL = "https://hangar.papermc.io/ArikSquad/AnimVanish";
public static final int bStats = 14993;
public static final boolean DEBUG = Main.getInstance().getConfig().getBoolean("debug");
}
6 changes: 2 additions & 4 deletions src/main/java/eu/mikart/animvanish/util/UpdateChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,14 @@

public class UpdateChecker {
private final JavaPlugin plugin;
private final int resourceId;

public UpdateChecker(JavaPlugin plugin, int resourceId) {
public UpdateChecker(JavaPlugin plugin) {
this.plugin = plugin;
this.resourceId = resourceId;
}

public void getVersion(final Consumer<String> consumer) {
Bukkit.getScheduler().runTaskAsynchronously(this.plugin, () -> {
try (InputStream inputStream = new URL("https://api.spigotmc.org/legacy/update.php?resource=" + this.resourceId).openStream(); Scanner scanner = new Scanner(inputStream)) {
try (InputStream inputStream = new URL("https://hangar.papermc.io/api/v1/projects/ArikSquad/AnimVanish/latestrelease").openStream(); Scanner scanner = new Scanner(inputStream)) {
if (scanner.hasNext()) {
consumer.accept(scanner.next());
}
Expand Down

0 comments on commit 8d5b004

Please sign in to comment.