Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
26d1f27f79 | |||
4e0195f7ab | |||
9856ad0e54 | |||
de4f24c368 |
253
pom.xml
253
pom.xml
@@ -1,121 +1,132 @@
|
||||
<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>
|
||||
|
||||
<groupId>dev.viper</groupId>
|
||||
<artifactId>RealTimeWeather</artifactId>
|
||||
<version>1.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>RealTimeWeather</name>
|
||||
<description>MC Plugin: Echtzeit & Wetter synchronisieren</description>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spigot-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>sonatype</id>
|
||||
<url>https://oss.sonatype.org/content/groups/public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<!-- Spigot API -->
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.21.1-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- JSON library -->
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>20231013</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Adventure API -->
|
||||
<dependency>
|
||||
<groupId>net.kyori</groupId>
|
||||
<artifactId>adventure-api</artifactId>
|
||||
<version>4.17.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Adventure Platform Bukkit -->
|
||||
<dependency>
|
||||
<groupId>net.kyori</groupId>
|
||||
<artifactId>adventure-platform-bukkit</artifactId>
|
||||
<version>4.3.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.10.1</version>
|
||||
<configuration>
|
||||
<source>${maven.compiler.source}</source>
|
||||
<target>${maven.compiler.target}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.4.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals><goal>shade</goal></goals>
|
||||
<configuration>
|
||||
<relocations>
|
||||
<!-- Shade org.json -->
|
||||
<relocation>
|
||||
<pattern>org.json</pattern>
|
||||
<shadedPattern>dev.viper.shaded.org.json</shadedPattern>
|
||||
</relocation>
|
||||
<!-- Shade Adventure API -->
|
||||
<relocation>
|
||||
<pattern>net.kyori.adventure</pattern>
|
||||
<shadedPattern>dev.viper.shaded.net.kyori.adventure</shadedPattern>
|
||||
</relocation>
|
||||
<!-- Shade Adventure Platform Bukkit -->
|
||||
<relocation>
|
||||
<pattern>net.kyori.platform.bukkit</pattern>
|
||||
<shadedPattern>dev.viper.shaded.net.kyori.platform.bukkit</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
<!-- Minimieren, um die JAR-Größe zu reduzieren (optional) -->
|
||||
<minimizeJar>true</minimizeJar>
|
||||
<!-- Filter, um unnötige Klassen auszuschließen -->
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>*:*</artifact>
|
||||
<excludes>
|
||||
<exclude>META-INF/*.SF</exclude>
|
||||
<exclude>META-INF/*.DSA</exclude>
|
||||
<exclude>META-INF/*.RSA</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
<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>
|
||||
|
||||
<groupId>dev.viper</groupId>
|
||||
<artifactId>RealTimeWeather</artifactId>
|
||||
<version>1.2</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>RealTimeWeather</name>
|
||||
<description>MC Plugin: Echtzeit & Wetter synchronisieren</description>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spigot-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>sonatype</id>
|
||||
<url>https://oss.sonatype.org/content/groups/public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<!-- Spigot API -->
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.21.1-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- JSON library -->
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>20231013</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Adventure API -->
|
||||
<dependency>
|
||||
<groupId>net.kyori</groupId>
|
||||
<artifactId>adventure-api</artifactId>
|
||||
<version>4.17.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Adventure Platform Bukkit -->
|
||||
<dependency>
|
||||
<groupId>net.kyori</groupId>
|
||||
<artifactId>adventure-platform-bukkit</artifactId>
|
||||
<version>4.3.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- bStats Bukkit Library -->
|
||||
<dependency>
|
||||
<groupId>org.bstats</groupId>
|
||||
<artifactId>bstats-bukkit</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.10.1</version>
|
||||
<configuration>
|
||||
<source>${maven.compiler.source}</source>
|
||||
<target>${maven.compiler.target}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.4.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals><goal>shade</goal></goals>
|
||||
<configuration>
|
||||
<relocations>
|
||||
<!-- Shade org.json -->
|
||||
<relocation>
|
||||
<pattern>org.json</pattern>
|
||||
<shadedPattern>dev.viper.shaded.org.json</shadedPattern>
|
||||
</relocation>
|
||||
<!-- Shade Adventure API -->
|
||||
<relocation>
|
||||
<pattern>net.kyori.adventure</pattern>
|
||||
<shadedPattern>dev.viper.shaded.net.kyori.adventure</shadedPattern>
|
||||
</relocation>
|
||||
<!-- Shade Adventure Platform Bukkit -->
|
||||
<relocation>
|
||||
<pattern>net.kyori.platform.bukkit</pattern>
|
||||
<shadedPattern>dev.viper.shaded.net.kyori.platform.bukkit</shadedPattern>
|
||||
</relocation>
|
||||
<!-- Shade bStats -->
|
||||
<relocation>
|
||||
<pattern>org.bstats</pattern>
|
||||
<shadedPattern>dev.viper.shaded.org.bstats</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
<minimizeJar>true</minimizeJar>
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>*:*</artifact>
|
||||
<excludes>
|
||||
<exclude>META-INF/*.SF</exclude>
|
||||
<exclude>META-INF/*.DSA</exclude>
|
||||
<exclude>META-INF/*.RSA</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
21
src/main/java/dev/viper/weathertime/MetricsManager.java
Normal file
21
src/main/java/dev/viper/weathertime/MetricsManager.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package dev.viper.weathertime;
|
||||
|
||||
import org.bstats.bukkit.Metrics;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class MetricsManager {
|
||||
|
||||
private final Metrics metrics;
|
||||
|
||||
public MetricsManager(JavaPlugin plugin) {
|
||||
int pluginId = 26865; // Deine Plugin-ID von bStats eintragen
|
||||
this.metrics = new Metrics(plugin, pluginId);
|
||||
|
||||
// Optional: Eigene Charts hinzufügen
|
||||
// metrics.addCustomChart(new Metrics.SingleLineChart("custom_chart", () -> 1));
|
||||
}
|
||||
|
||||
public Metrics getMetrics() {
|
||||
return metrics;
|
||||
}
|
||||
}
|
50
src/main/java/dev/viper/weathertime/UpdateChecker.java
Normal file
50
src/main/java/dev/viper/weathertime/UpdateChecker.java
Normal file
@@ -0,0 +1,50 @@
|
||||
package dev.viper.weathertime;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.Scanner;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class UpdateChecker {
|
||||
private final JavaPlugin plugin;
|
||||
private final int resourceId;
|
||||
|
||||
public UpdateChecker(JavaPlugin plugin, int resourceId) {
|
||||
this.plugin = plugin;
|
||||
this.resourceId = resourceId;
|
||||
}
|
||||
|
||||
public void getLatestVersion(Consumer<String> consumer) {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
try {
|
||||
HttpURLConnection connection = (HttpURLConnection)
|
||||
new URL("https://api.spiget.org/v2/resources/" + resourceId + "/versions/latest").openConnection();
|
||||
|
||||
connection.setRequestMethod("GET");
|
||||
connection.addRequestProperty("User-Agent", "Mozilla/5.0");
|
||||
|
||||
try (InputStream inputStream = connection.getInputStream();
|
||||
Scanner scanner = new Scanner(inputStream)) {
|
||||
String response = scanner.useDelimiter("\\A").next();
|
||||
|
||||
JSONObject json = new JSONObject(response);
|
||||
String versionName = json.optString("name");
|
||||
|
||||
// Nur Zahlen + Punkte behalten (z.B. "version 1.1" -> "1.1")
|
||||
String cleanVersion = versionName.replaceAll("[^0-9.]", "").trim();
|
||||
|
||||
consumer.accept(cleanVersion.isEmpty() ? versionName : cleanVersion);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
plugin.getLogger().warning("Konnte keine Update-Info abrufen: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@@ -23,6 +23,12 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.block.Block;
|
||||
|
||||
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -32,6 +38,10 @@ import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
|
||||
// <--- NEU: Einbinden der Hilfsklassen (keine Änderung am bestehenden Code)
|
||||
import dev.viper.weathertime.MetricsManager;
|
||||
import dev.viper.weathertime.UpdateChecker;
|
||||
|
||||
public class WeatherTimeSyncPlugin extends JavaPlugin implements Listener {
|
||||
|
||||
private String apiKey;
|
||||
@@ -47,6 +57,13 @@ public class WeatherTimeSyncPlugin extends JavaPlugin implements Listener {
|
||||
private final Set<String> processedLocations = new HashSet<>();
|
||||
private FileConfiguration langConfig;
|
||||
|
||||
// NEU: bStats & Updater-Felder
|
||||
private MetricsManager metricsManager;
|
||||
private UpdateChecker updateChecker;
|
||||
|
||||
// Variable, um die aktuell bekannte neue Version zu speichern
|
||||
private String latestVersion = null;
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
saveDefaultConfig();
|
||||
@@ -54,11 +71,41 @@ public class WeatherTimeSyncPlugin extends JavaPlugin implements Listener {
|
||||
loadConfig();
|
||||
audiences = BukkitAudiences.create(this);
|
||||
|
||||
// bStats initialisieren
|
||||
metricsManager = new MetricsManager(this);
|
||||
|
||||
// Spigot UpdateChecker initialisieren (Resource-ID)
|
||||
updateChecker = new UpdateChecker(this, 127846);
|
||||
updateChecker.getLatestVersion(version -> {
|
||||
// Version bereinigen: nur Zahlen und Punkte
|
||||
String cleanVersion = version.replaceAll("[^0-9.]", "").trim();
|
||||
String currentVersion = getDescription().getVersion();
|
||||
|
||||
// Nur dann melden, wenn cleanVersion wirklich neuer ist
|
||||
if (isVersionNewer(currentVersion, cleanVersion)) {
|
||||
latestVersion = cleanVersion; // Neue Version merken
|
||||
|
||||
// Konsolen-Info
|
||||
getLogger().info("Neue Version verfügbar: " + cleanVersion + " (aktuell: " + currentVersion + ")");
|
||||
getLogger().info("Download: https://www.spigotmc.org/resources/127846/");
|
||||
|
||||
// Ingame-Info an alle aktuell online Operatoren
|
||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||
if (player.isOp()) {
|
||||
player.sendMessage("§aEine neue Version von §eRealTimeWeather §aist verfügbar: §e"
|
||||
+ cleanVersion + " §7(aktuell: " + currentVersion + ")");
|
||||
player.sendMessage("§eDownload: §bhttps://www.spigotmc.org/resources/127846/");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Objects.requireNonNull(getCommand("wetter")).setExecutor(new WetterCommand());
|
||||
Objects.requireNonNull(getCommand("weatherforecast")).setExecutor(new WeatherForecastCommand());
|
||||
Objects.requireNonNull(getCommand("toggleweather")).setExecutor(new ToggleWeatherCommand());
|
||||
|
||||
getServer().getPluginManager().registerEvents(this, this);
|
||||
getServer().getPluginManager().registerEvents(new UpdateNotifyListener(), this);
|
||||
|
||||
setDoDaylightCycleForWorlds();
|
||||
startWeatherUpdateTask();
|
||||
@@ -66,6 +113,41 @@ public class WeatherTimeSyncPlugin extends JavaPlugin implements Listener {
|
||||
initializePlayerDisplays();
|
||||
}
|
||||
|
||||
// Methode zum Versionsvergleich, damit nur wirklich neuere Versionen gemeldet werden
|
||||
private boolean isVersionNewer(String current, String latest) {
|
||||
String[] curParts = current.split("\\.");
|
||||
String[] latParts = latest.split("\\.");
|
||||
int length = Math.max(curParts.length, latParts.length);
|
||||
|
||||
for (int i = 0; i < length; i++) {
|
||||
int curNum = i < curParts.length ? Integer.parseInt(curParts[i]) : 0;
|
||||
int latNum = i < latParts.length ? Integer.parseInt(latParts[i]) : 0;
|
||||
|
||||
if (latNum > curNum) {
|
||||
return true; // neuere Version gefunden
|
||||
}
|
||||
if (latNum < curNum) {
|
||||
return false; // keine neuere Version
|
||||
}
|
||||
}
|
||||
return false; // Versionen sind gleich
|
||||
}
|
||||
|
||||
// Event Listener für Join-Nachricht
|
||||
public class UpdateNotifyListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
if (player.isOp() && latestVersion != null) {
|
||||
String currentVersion = getDescription().getVersion();
|
||||
player.sendMessage("§aEine neue Version von §eRealTimeWeather §aist verfügbar: §e"
|
||||
+ latestVersion + " §7(aktuell: " + currentVersion + ")");
|
||||
player.sendMessage("§eDownload: §bhttps://www.spigotmc.org/resources/127846/");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
if (weatherUpdateTask != null) weatherUpdateTask.cancel();
|
||||
@@ -226,6 +308,13 @@ public class WeatherTimeSyncPlugin extends JavaPlugin implements Listener {
|
||||
case "snow":
|
||||
world.setStorm(true);
|
||||
world.setThundering(false);
|
||||
|
||||
// ---- FAKE-SCHNEE ----
|
||||
spawnTemporarySnowInWorld(world, WeatherTimeSyncPlugin.this);
|
||||
|
||||
// ---- Schneemänner, temporär spawnen (z.B. 25 Stück) ----
|
||||
spawnTemporarySnowmen(world, 25, WeatherTimeSyncPlugin.this);
|
||||
|
||||
break;
|
||||
default:
|
||||
world.setStorm(false);
|
||||
@@ -234,12 +323,93 @@ public class WeatherTimeSyncPlugin extends JavaPlugin implements Listener {
|
||||
}
|
||||
}
|
||||
}.runTask(this);
|
||||
|
||||
} catch (Exception e) {
|
||||
getLogger().warning("Fehler beim Abrufen von Wetter/Zeit für Welt " + world.getName() + ": " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fake-Schnee auf allen aktuell geladenen Chunks platzieren
|
||||
*/
|
||||
private void spawnTemporarySnowInWorld(World world, JavaPlugin plugin) {
|
||||
List<Block> snowBlocks = new ArrayList<>();
|
||||
|
||||
for (org.bukkit.Chunk chunk : world.getLoadedChunks()) {
|
||||
int chunkX = chunk.getX() << 4;
|
||||
int chunkZ = chunk.getZ() << 4;
|
||||
|
||||
for (int x = 0; x < 16; x++) {
|
||||
for (int z = 0; z < 16; z++) {
|
||||
if (Math.random() > 0.7) continue;
|
||||
int worldX = chunkX + x;
|
||||
int worldZ = chunkZ + z;
|
||||
int worldY = world.getHighestBlockYAt(worldX, worldZ);
|
||||
|
||||
Block ground = world.getBlockAt(worldX, worldY - 1, worldZ);
|
||||
Block above = world.getBlockAt(worldX, worldY, worldZ);
|
||||
|
||||
if (ground.getType().isSolid() && above.getType() == Material.AIR) {
|
||||
above.setType(Material.SNOW);
|
||||
snowBlocks.add(above);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Schnee entfernen
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (Block b : snowBlocks) {
|
||||
if (b.getType() == Material.SNOW) {
|
||||
b.setType(Material.AIR);
|
||||
}
|
||||
}
|
||||
}
|
||||
}.runTaskLater(plugin, 180 * 20L); // 3 Minuten bleibt der Schnee liegen
|
||||
}
|
||||
|
||||
/**
|
||||
* Spawn temporärer Schneemänner in geladenen Chunks
|
||||
*/
|
||||
private void spawnTemporarySnowmen(World world, int count, JavaPlugin plugin) {
|
||||
List<org.bukkit.entity.Snowman> snowmen = new ArrayList<>();
|
||||
Random random = new Random();
|
||||
|
||||
List<org.bukkit.Chunk> loadedChunks = Arrays.asList(world.getLoadedChunks());
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
if (loadedChunks.isEmpty()) break;
|
||||
org.bukkit.Chunk chunk = loadedChunks.get(random.nextInt(loadedChunks.size()));
|
||||
|
||||
int chunkX = chunk.getX() << 4;
|
||||
int chunkZ = chunk.getZ() << 4;
|
||||
int x = chunkX + random.nextInt(16);
|
||||
int z = chunkZ + random.nextInt(16);
|
||||
int y = world.getHighestBlockYAt(x, z);
|
||||
|
||||
if (world.getBlockAt(x, y - 1, z).getType().isSolid()) {
|
||||
org.bukkit.entity.Snowman snowman = (org.bukkit.entity.Snowman)
|
||||
world.spawnEntity(new org.bukkit.Location(world, x + 0.5, y, z + 0.5),
|
||||
org.bukkit.entity.EntityType.SNOW_GOLEM);
|
||||
snowmen.add(snowman);
|
||||
}
|
||||
}
|
||||
|
||||
// Schneemänner nach 30 Sekunden wieder entfernen
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (org.bukkit.entity.Snowman s : snowmen) {
|
||||
if (!s.isDead()) s.remove();
|
||||
}
|
||||
}
|
||||
}.runTaskLater(plugin, 180 * 20L);
|
||||
}
|
||||
|
||||
|
||||
private void syncMinecraftTime(World world, ZonedDateTime dateTime) {
|
||||
int hour = dateTime.getHour();
|
||||
int minute = dateTime.getMinute();
|
||||
@@ -351,7 +521,7 @@ public class WeatherTimeSyncPlugin extends JavaPlugin implements Listener {
|
||||
new WeatherForecastCommand().onCommand(player, null, "weatherforecast", new String[]{});
|
||||
} else if (clickedItem.getType() == Material.OAK_SIGN) {
|
||||
player.closeInventory();
|
||||
String infoMessage = "RealTimeWeather Plugin\nVersion: 1.0\nAutor: M_Viper\nGetestete Minecraft-Version: 1.21.1 - 1.21.8";
|
||||
String infoMessage = "RealTimeWeather Plugin\nVersion: 1.2\nAutor: M_Viper\nGetestete Minecraft-Version: 1.21.1 - 1.21.8";
|
||||
audiences.player(player).sendMessage(Component.text(infoMessage, NamedTextColor.AQUA));
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
name: RealTimeWeather
|
||||
version: 1.0
|
||||
version: 1.3
|
||||
main: dev.viper.weathertime.WeatherTimeSyncPlugin
|
||||
api-version: 1.21
|
||||
|
||||
|
Reference in New Issue
Block a user