1
0
mirror of https://github.com/nkomarn/harbor.git synced 2024-12-18 22:37:36 +01:00

💥 Hotfixes!

This commit is contained in:
Mykyta 2019-07-24 02:33:18 -07:00
parent d67b003457
commit bb5b3dc9e3
No known key found for this signature in database
GPG Key ID: C147E30C19EA3570
7 changed files with 56 additions and 8 deletions

View File

@ -1,2 +1,2 @@
mvn package
yes | cp -rf target/*-*.jar ../Spigot/1.13.2/plugins
yes | cp -rf target/*-*-shaded.jar ../Spigot/1.13.2/plugins

41
pom.xml
View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>xyz.nkomarn</groupId>
<artifactId>Harbor</artifactId>
<version>1.5.2</version>
<version>1.5.3</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@ -17,6 +17,11 @@
</repositories>
<dependencies>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>spigotmc.org</groupId>
<artifactId>spigot-1.14.1</artifactId>
@ -109,7 +114,7 @@
<version>1.7.2</version>
</dependency>
</dependencies>
<build>
<directory>target</directory>
<resources>
@ -119,9 +124,41 @@
<includes>
<include>plugin.yml</include>
<include>config.yml</include>
<include>application.properties</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName></shadedClassifierName>
<relocations>
<relocation>
<pattern>org.bstats</pattern>
<shadedPattern>xyz.nkomarn.SeedDonor.SeedDonor</shadedPattern>
</relocation>
</relocations>
<artifactSet>
<excludes>
<exclude>spigotmc.org:*</exclude>
<exclude>net.milkbowl.vault*</exclude>
</excludes>
</artifactSet>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>

View File

@ -21,7 +21,7 @@ import java.util.stream.Stream;
public class Harbor extends JavaPlugin {
public static Harbor instance;
public static String version = "1.5.2";
public static String version = "1.5.3";
public static boolean debug = false;
public static boolean enabled = false;
public static boolean prerelease = false;

View File

@ -25,9 +25,14 @@ public class Timer implements Runnable {
w.getPlayers().forEach(p -> nms.sendActionbar(p, c.getString("messages.actionbar.everyone"), w));
}
// Title for when you are able to sleep
if (w.getTime() >= 12516 && w.getTime() <= 12535 && c.getBoolean("messages.title.title"))
w.getPlayers().forEach(p -> nms.sendTitle(p, c.getString("messages.title.evening.top"), c.getString("messages.title.evening.bottom")));
if (n.getSleeping(w) > 0 && n.getNeeded(w) == 0) n.skip(w);
// Skip night
if (n.getSleeping(w) > 1 && n.getNeeded(w) == 0) {
n.skip(w);
}
if (c.getBoolean("features.afk")) w.getPlayers().forEach(p -> {
if (TimeUnit.MILLISECONDS.toMinutes(System.currentTimeMillis() - Counters.activity.get(p)) >= c.getInteger("values.timeout")) {

View File

@ -22,7 +22,12 @@ public class Counters {
private NMSUtils nms = new NMSUtils();
public void add(World w, Player p) {
ArrayList<Player> a = sleeping.get(w);
ArrayList<Player> a;
try {
a = sleeping.get(w);
} catch (NullPointerException e) {
a = new ArrayList<>();
}
a.add(p);
sleeping.put(w, a);
}
@ -70,7 +75,7 @@ public class Counters {
}
public void skip(World w) {
if (c.getBoolean("features.skip") && Math.max(0, this.getNeeded(w) - this.getExcluded(w).size()) == 0) {
if (c.getBoolean("features.skip") && Math.max(0, this.getNeeded(w)) == 0) {
w.setTime(1000L);
// Synchronously set weather to clear

View File

@ -1,5 +1,6 @@
package xyz.nkomarn.Harbor.util;
import com.mysql.jdbc.StringUtils;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.bukkit.Bukkit;

View File

@ -104,5 +104,5 @@ gui:
sleeping: "Sleeping Players | Page [page]"
# Spooky controls (don't change)
version: 1.5.2
version: 1.5.3
debug: false