Skip to content

Commit

Permalink
0.4.30.23
Browse files Browse the repository at this point in the history
  • Loading branch information
Exortions committed Jul 25, 2021
1 parent c907bea commit 2b86acc
Show file tree
Hide file tree
Showing 265 changed files with 46,115 additions and 63 deletions.
114 changes: 111 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@

<groupId>com.exortions</groupId>
<artifactId>ExosPluginUtils</artifactId>
<version>0.4.27.23</version>
<description>ExosPluginUtils, or PluginUtils for short, is a simple, easy-to-use
<version>0.4.30.23</version>
<packaging>jar</packaging>

<name>PluginUtils</name>
<description>ExosPluginUtils, or PluginUtils for short, is a simple, easy-to-use
library that saves many Minecraft Spigot developers a lot of time when creating
plugins. It allows Spigot developers to create a lot of NMS
(net.minecraft.server) and Spigot things like Tablists, Scoreboards, etc. with
(net.minecraft.server) and Spigot things like Tablists, Scoreboards, etc, as well as MySQL and SQLite support,
a bunch of lines and classes saved, therefore improving the experience while
developing plugins.
</description>
<url>https://www.github.com/Exortions/PluginUtils</url>

<licenses>
<license>
Expand All @@ -28,6 +32,110 @@
<maven.compiler.target>8</maven.compiler.target>
</properties>

<developers>
<developer>
<name>Exortions</name>
<email>exortionsmc@gmail.com</email>
</developer>
</developers>

<scm>
<connection>scm:git:git://github.com/Exortions/PluginUtils.git</connection>
<developerConnection>scm:git:ssh://github.com:Exortions/PluginUtils.git</developerConnection>
<url>https://github.com/Exortions/PluginUtils/tree/master</url>
</scm>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>

<repositories>
<!-- Spigot repo -->
<repository>
Expand Down
24 changes: 23 additions & 1 deletion src/main/java/com/exortions/pluginutils/actionbar/Actionbar.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;

import java.util.List;

/**
* An actionbar utility class.
* @author Exortions
* @since 0.4.24.23
*/
Expand All @@ -18,28 +18,50 @@ public class Actionbar {

private String text;

/**
* Create a new action bar.
* @param text The action bars text.
*/
public Actionbar(String text) {
this.text = text;
}

/**
* Sets the text of the Action bar.
* @param text The text to set.
*/
public void setText(String text) {
this.text = text;
}

/**
* Gets the text of the Action bar.
*/
public String getText() {
return text;
}

/**
* Sends the action bar to a certain player.
* @param player The player.
*/
public void send(Player player) {
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(ChatUtils.colorize(text)));
}

/**
* Sends the action bar to a list of players.
* @param players The players.
*/
public void send(List<Player> players) {
for (Player player : players) {
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(ChatUtils.colorize(text)));
}
}

/**
* Sends the action bar to all online players.
*/
public void sendToAll() {
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
onlinePlayer.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(ChatUtils.colorize(text)));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.exortions.pluginutils.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Annotation to be used
* on a method or class
* to show that it
* supports every version
* of Minecraft.
* Example: @AllMinecraft()
* @author Exortions
* @since 0.4.29.23
*/
@Target(ElementType.TYPE)
@SuppressWarnings("unused")
@Retention(RetentionPolicy.RUNTIME)
public @interface AllMinecraft {
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,19 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Annotation to be used
* on a method or class.
* Example: @LegacyMinecraft(supportedVersions = MinecraftVersion.MINECRAFT_1_16_TO_1_13)
* @author Exortions
* @since 0.4.29.23
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface LegacyMinecraft {

MinecraftVersion[] unsupportedVersions() default MinecraftVersion.MINECRAFT_1_16_TO_1_13;

MinecraftVersion[] supportedVersions() default MinecraftVersion.MINECRAFT_1_12_AND_BELOW;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.exortions.pluginutils.annotation;

import com.exortions.pluginutils.plugin.MinecraftVersion;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Annotation to be used
* on a method or class
* to dictate what minecraft
* versions it supports.
* Example: @NewMinecraft(supportedVersions = MinecraftVersion.MINECRAFT_1_16_TO_1_13)
* @author Exortions
* @since 0.4.29.23
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@SuppressWarnings("unused")
public @interface NewMinecraft {

MinecraftVersion[] supportedVersions();

MinecraftVersion[] unsupportedVersions();

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.List;

/**
* @author MorkaZ
* @since 0.4.24.23
*/
@SuppressWarnings("all")
Expand Down Expand Up @@ -123,11 +124,6 @@ public static String constructQueryRowsRemove(String table, Pair pair, Object li
return query;
}

/**
@param indexColumn - column to "WHERE" query's part
@param indexValue - value to "WHERE" query's part
@param valueColumn - column that will be NULLed in row
*/
public static String constructQueryValueRemove(String table, String indexColumn, Object indexValue, String valueColumn, SQLDatabaseType databaseType){
String query;
if (indexValue instanceof Number){
Expand Down Expand Up @@ -336,10 +332,6 @@ public static List<String> constructQuerySingleValueSubtract(String table, Pair
return queryList;
}


/**
* <p>If databse is not MySQL then REMEMBER to put primary table name on first place</p>
*/
public static List<String> constructQueryMultipleValuesSet(String table, List<Pair<String, Object>> pairs, Boolean hasTableUniqueKey, SQLDatabaseType databaseType){
List<String> queryList = new ArrayList<>();
String flatColumns = "(";
Expand Down
Loading

0 comments on commit 2b86acc

Please sign in to comment.