improved sleeping + added ignore sleep vote command
Some checks failed
Gitea Actions Demo / Build-Gradle (push) Failing after 1m38s
Some checks failed
Gitea Actions Demo / Build-Gradle (push) Failing after 1m38s
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
gradle wrapper
|
||||
./gradlew clean build
|
||||
|
||||
Open the Command Palette: Cmd+Shift+P
|
||||
• Developer: reload window
|
||||
|
||||
ALLGEMEIN: recipes die custom items beinhalten werden nicht im crafting angezeigt (allgm. Bukkit problem)
|
||||
INFO: CustomItemIcon count: 22
|
||||
BUG: Autocrafter nicht von seite möglich
|
||||
BUG: Music Disc 13 now unfunctional (vertrtbar)
|
||||
IDEA: schere verschiedene versionen pferde/mule/cats/schafe/Axolotl/tropical etc?
|
||||
|
||||
TO RELEASE: ignorevote command
|
||||
TO RELEASE: waterbottle + sponge = empty bottle -> Warum nochmal?
|
||||
TO RELEASE: Autocrafter
|
||||
TO RELEASE: jukeboxes können mit Redstone gesteuert werden + crafted music
|
||||
Binary file not shown.
Binary file not shown.
BIN
environmentex-1.0-SNAPSHOT.textClipping
Normal file
BIN
environmentex-1.0-SNAPSHOT.textClipping
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +1,2 @@
|
||||
#Mon Mar 10 20:23:21 CET 2025
|
||||
gradle.version=8.13
|
||||
#Sun Jun 29 18:53:26 CEST 2025
|
||||
gradle.version=8.14.2
|
||||
|
||||
Binary file not shown.
@@ -1,2 +1,2 @@
|
||||
Command: /opt/homebrew/Cellar/openjdk/23.0.2/libexec/openjdk.jdk/Contents/Home/bin/java -Xmx1G -classpath /Users/janik/.gradle/caches/modules-2/files-2.1/net.fabricmc/tiny-remapper/0.10.4/d78e8e115ba5ac99421ce2d5e84e88b91a5f08b7/tiny-remapper-0.10.4-fat.jar net.fabricmc.tinyremapper.Main /Users/janik/Desktop/MCPlugins/environmentex-1.0-SNAPSHOT.jar /Users/janik/Desktop/MCPlugins/environmentex/build/libs/environmentex-1.0-SNAPSHOT-reobf.jar /Users/janik/Desktop/MCPlugins/environmentex/.gradle/caches/paperweight/taskCache/reobfMappings.tiny mojang spigot /Users/janik/Desktop/MCPlugins/environmentex/.gradle/caches/paperweight/taskCache/mappedServerJar.jar --threads=1
|
||||
Finished after 827,23 ms.
|
||||
Command: /opt/homebrew/Cellar/openjdk/23.0.2/libexec/openjdk.jdk/Contents/Home/bin/java -Xmx1G -classpath /Users/janik/.gradle/caches/modules-2/files-2.1/net.fabricmc/tiny-remapper/0.11.1/6c1f29838864ba8f495855edfc8ef17706fedb5d/tiny-remapper-0.11.1-fat.jar net.fabricmc.tinyremapper.Main /Users/janik/Desktop/MCPlugins/environmentex-1.0-SNAPSHOT.jar /Users/janik/Desktop/MCPlugins/environmentex/build/libs/environmentex-1.0-SNAPSHOT-reobf.jar /Users/janik/Desktop/MCPlugins/environmentex/.gradle/caches/paperweight/taskCache/reobfMappings.tiny mojang spigot /Users/janik/Desktop/MCPlugins/environmentex/.gradle/caches/paperweight/taskCache/mappedServerJar.jar --threads=1
|
||||
[INFO] Finished after 3356,66 ms.
|
||||
|
||||
Binary file not shown.
3
environmentex/.vscode/settings.json
vendored
3
environmentex/.vscode/settings.json
vendored
@@ -1,4 +1,3 @@
|
||||
{
|
||||
"java.compile.nullAnalysis.mode": "automatic",
|
||||
"java.configuration.updateBuildConfiguration": "interactive"
|
||||
"java.compile.nullAnalysis.mode": "automatic"
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,24 +0,0 @@
|
||||
main: de.hessj.environmentex.App
|
||||
name: EnvironmentExtenderPlugin
|
||||
version: 0.1
|
||||
api-version: 1.19
|
||||
depend: [HelperPlugin]
|
||||
commands:
|
||||
test:
|
||||
description: Vote mit "Ja" für den Nachtskip
|
||||
usage: /<command>
|
||||
y:
|
||||
description: Vote mit "Ja" für den Nachtskip
|
||||
usage: /<command>
|
||||
n:
|
||||
description: Vote mit "Nein" für den Nachtskip
|
||||
usage: /<command>
|
||||
add:
|
||||
description: Setzt den Whiteliststatus auf accepted
|
||||
usage: /<command> <UUID>
|
||||
afk:
|
||||
description: Setzt den AFK Status
|
||||
usage: /<command>
|
||||
pin:
|
||||
description: ----
|
||||
usage: /<command>
|
||||
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
`java-library`
|
||||
id("io.papermc.paperweight.userdev") version "2.0.0-beta.14"
|
||||
id("io.papermc.paperweight.userdev") version "2.0.0-beta.17"
|
||||
id("xyz.jpenilla.run-paper") version "2.3.1" // Adds runServer and runMojangMappedServer tasks for testing
|
||||
}
|
||||
group = "de.hessj.environmentex"
|
||||
@@ -33,6 +33,13 @@ tasks {
|
||||
javadoc {
|
||||
options.encoding = Charsets.UTF_8.name() // We want UTF-8 for everything
|
||||
}
|
||||
java {
|
||||
sourceSets {
|
||||
named("main") {
|
||||
java.srcDir("src/main/java")
|
||||
}
|
||||
}
|
||||
}
|
||||
processResources {
|
||||
filteringCharset = Charsets.UTF_8.name() // We want UTF-8 for everything
|
||||
val props = mapOf(
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
@@ -22,3 +22,6 @@ commands:
|
||||
pin:
|
||||
description: ----
|
||||
usage: /<command>
|
||||
ignorevote:
|
||||
description: Setzt den Ignorevote Status
|
||||
usage: /<command>
|
||||
Binary file not shown.
BIN
environmentex/gradle/wrapper/gradle-wrapper.jar
vendored
BIN
environmentex/gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
4
environmentex/gradlew
vendored
4
environmentex/gradlew
vendored
@@ -114,7 +114,7 @@ case "$( uname )" in #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
CLASSPATH="\\\"\\\""
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
@@ -213,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
|
||||
4
environmentex/gradlew.bat
vendored
4
environmentex/gradlew.bat
vendored
@@ -70,11 +70,11 @@ goto fail
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
set CLASSPATH=
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
|
||||
@@ -6,6 +6,8 @@ import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import org.bukkit.NamespacedKey;
|
||||
@@ -13,7 +15,9 @@ import org.bukkit.World;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.Recipe;
|
||||
@@ -59,6 +63,9 @@ public class App extends JavaPlugin {
|
||||
public File tpYml = new File(this.getDataFolder() + "/texturepack.yml");
|
||||
public FileConfiguration tpConfig = YamlConfiguration.loadConfiguration(tpYml);
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
tpConfig.addDefault("url", "https://mc.hessj.de/texturepack/CUSTOM.zip");
|
||||
@@ -431,7 +438,6 @@ public class App extends JavaPlugin {
|
||||
}
|
||||
|
||||
private void listenerRegistration() {
|
||||
|
||||
pM.registerEvents(new LoginListener(), this);
|
||||
pM.registerEvents(new EnvironmentExListeners(), this);
|
||||
pM.registerEvents(new InvisibleFrame(), this);
|
||||
@@ -453,6 +459,7 @@ public class App extends JavaPlugin {
|
||||
pM.registerEvents(new ShulkerPreview(), this);
|
||||
pM.registerEvents(new BetterTotems(), this);
|
||||
pM.registerEvents(new CustomMusicDiscs(), this);
|
||||
pM.registerEvents(new PinFeature(), this);
|
||||
getCommand("test").setExecutor(new EnvironmentExCommands());
|
||||
getCommand("y").setExecutor(new EnvironmentExCommands());
|
||||
getCommand("n").setExecutor(new EnvironmentExCommands());
|
||||
@@ -460,6 +467,7 @@ public class App extends JavaPlugin {
|
||||
getCommand("afk").setExecutor(new EnvironmentExCommands());
|
||||
getCommand("pin").setExecutor(new EnvironmentExCommands());
|
||||
getCommand("pin").setTabCompleter(new PinFeature());
|
||||
getCommand("ignorevote").setExecutor(new EnvironmentExCommands());
|
||||
}
|
||||
|
||||
public void log(Object msg) {
|
||||
|
||||
@@ -17,6 +17,7 @@ import org.bukkit.inventory.meta.Damageable;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import net.kyori.adventure.text.Component;
|
||||
|
||||
|
||||
public class CustomItems implements Listener {
|
||||
|
||||
public static ItemStack flintBlock = new ItemStack(Material.DIRT);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package de.hessj.environmentex;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
@@ -18,17 +19,22 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import de.hessj.helper.Helper.Type;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
public class EnvironmentExCommands implements CommandExecutor, Listener {
|
||||
public de.hessj.helper.Helper helper = new de.hessj.helper.Helper();
|
||||
private final Map<UUID, Map<String, Location>> playerPins = new HashMap<>();
|
||||
private HashMap<UUID, BossBar> bossBars = new HashMap<>();
|
||||
public static final Map<UUID, BukkitTask> playerTasks = new HashMap<>();
|
||||
public static HashMap<UUID, BossBar> bossBars = new HashMap<>();
|
||||
int taskId;
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
@@ -54,6 +60,33 @@ public class EnvironmentExCommands implements CommandExecutor, Listener {
|
||||
p.playerListName(App.helper.R3SMessage(Type.ERROR, "[AFK] " + p.getName()));
|
||||
}
|
||||
|
||||
if (label.equalsIgnoreCase("ignorevote")) {
|
||||
|
||||
|
||||
|
||||
|
||||
if(args.length != 1){
|
||||
return false;
|
||||
}
|
||||
Player p = (Player) sender;
|
||||
|
||||
|
||||
|
||||
if(!args[0].equalsIgnoreCase("false") && !args[0].equalsIgnoreCase("true")) {
|
||||
p.sendMessage(helper.R3SMessage(Type.ERROR,
|
||||
"Benutzung: /ignorevote <true | false>"));
|
||||
return true;
|
||||
}
|
||||
|
||||
LoginListener.customConfig.set("players." + p.getUniqueId() + ".ignorevote", Boolean.parseBoolean(args[0]));
|
||||
LoginListener.saveCustomYml(LoginListener.customConfig, LoginListener.customYml);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (label.equalsIgnoreCase("pin")) {
|
||||
Player p = (Player) sender;
|
||||
UUID playerId = p.getUniqueId();
|
||||
@@ -61,7 +94,7 @@ public class EnvironmentExCommands implements CommandExecutor, Listener {
|
||||
|
||||
if (args.length < 1) {
|
||||
p.sendMessage(helper.R3SMessage(Type.ERROR,
|
||||
"Benutzung: /pin <set | list | remove | follow | unfollow> [name | id]"));
|
||||
"Benutzung: /pin <set | list | remove | follow | unfollow> [name | id] | send [id | onlineplayer]"));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -69,6 +102,13 @@ public class EnvironmentExCommands implements CommandExecutor, Listener {
|
||||
Map<String, Location> pins = playerPins.get(playerId);
|
||||
|
||||
switch (subCommand) {
|
||||
case "send":
|
||||
if (args.length < 3) {
|
||||
p.sendMessage(helper.R3SMessage(Type.ERROR, "Benutzung: /pin send <id> <onlineplayer>"));
|
||||
return true;
|
||||
}
|
||||
|
||||
break;
|
||||
case "set":
|
||||
if (args.length < 2) {
|
||||
p.sendMessage(helper.R3SMessage(Type.ERROR, "Benutzung: /pin set <name>"));
|
||||
@@ -172,6 +212,13 @@ public class EnvironmentExCommands implements CommandExecutor, Listener {
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int pinId1 = Integer.parseInt(args[1]);
|
||||
String pinName1 = PinFeature.pinConfig.getString(playerId + "." + pinId1 + ".name");
|
||||
String locationString1 = PinFeature.pinConfig.getString(playerId + "." + pinId1 + ".loc");
|
||||
@@ -188,14 +235,28 @@ public class EnvironmentExCommands implements CommandExecutor, Listener {
|
||||
int y = Integer.parseInt(locParts[2]);
|
||||
int z = Integer.parseInt(locParts[3]);
|
||||
|
||||
String worldLabel = "Overworld";
|
||||
if (worldName.endsWith("_nether"))
|
||||
worldLabel = "Nether";
|
||||
if (worldName.endsWith("_end"))
|
||||
worldLabel = "End";
|
||||
if(!p.getLocation().getWorld().getName().toString().equals(worldName.toString())) {
|
||||
p.sendMessage(helper.R3SMessage(Type.ERROR, "Du kannst nur Pins aus deiner aktuellen Welt folgen."));
|
||||
return true;
|
||||
}
|
||||
|
||||
p.sendMessage(helper.R3SMessage(Type.SUCCESS, "Du folgst nun dem Pin '" + pinName1 + "'"));
|
||||
|
||||
UUID uuid = p.getUniqueId();
|
||||
|
||||
if (playerTasks.containsKey(uuid)) {
|
||||
BukkitTask existingTask = playerTasks.remove(uuid); // remove from map
|
||||
existingTask.cancel(); // cancel the repeating task
|
||||
}
|
||||
|
||||
BukkitTask task = Bukkit.getScheduler().runTaskTimer(App.main, () -> {
|
||||
int cur_x = (int) p.getLocation().getBlockX();
|
||||
int cur_y = (int) p.getLocation().getBlockY();
|
||||
int cur_z = (int) p.getLocation().getBlockZ();
|
||||
|
||||
|
||||
// BossBar erstellen/aktualisieren
|
||||
BossBar bossBar = Bukkit.createBossBar(worldLabel + ": " + x + ", " + y + ", " + z,
|
||||
BossBar bossBar = Bukkit.createBossBar("Entfernung: " + (cur_x-x) + ", " + (cur_y-y) + ", " + (cur_z-z),
|
||||
BarColor.WHITE, BarStyle.SOLID);
|
||||
bossBar.setProgress(0.0);
|
||||
|
||||
@@ -206,7 +267,28 @@ public class EnvironmentExCommands implements CommandExecutor, Listener {
|
||||
bossBar.addPlayer(p);
|
||||
bossBars.put(p.getUniqueId(), bossBar);
|
||||
|
||||
p.sendMessage(helper.R3SMessage(Type.SUCCESS, "Du folgst nun dem Pin '" + pinName1 + "'"));
|
||||
|
||||
}, 0L, 5L);
|
||||
|
||||
playerTasks.put(uuid, task);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} catch (NumberFormatException e) {
|
||||
p.sendMessage(helper.R3SMessage(Type.ERROR, "Kein Pin mit dieser ID gefunden."));
|
||||
@@ -217,8 +299,14 @@ public class EnvironmentExCommands implements CommandExecutor, Listener {
|
||||
if (bossBars.containsKey(p.getUniqueId())) {
|
||||
bossBars.get(p.getUniqueId()).removeAll();
|
||||
bossBars.remove(p.getUniqueId());
|
||||
UUID uuid = p.getUniqueId();
|
||||
BukkitTask task = playerTasks.remove(uuid);
|
||||
if (task != null) {
|
||||
task.cancel();
|
||||
p.sendMessage(helper.R3SMessage(Type.ERROR, "Du folgst nun keinem Pin mehr."));
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package de.hessj.environmentex;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -24,6 +25,8 @@ import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.type.Fence;
|
||||
import org.bukkit.block.data.type.Leaves;
|
||||
import org.bukkit.block.data.type.Stairs;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Axolotl;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Fish;
|
||||
@@ -69,10 +72,9 @@ public class EnvironmentExListeners implements Listener {
|
||||
public static boolean voteIsGoing = false;
|
||||
public static int voteForYes;
|
||||
public static int voteForNo;
|
||||
public static int onlinePlayers;
|
||||
public static int voteablePlayers;
|
||||
public static ArrayList<UUID> hasVoted = new ArrayList<UUID>();
|
||||
public static Location lastLoc;
|
||||
|
||||
public de.hessj.helper.Helper helper = new de.hessj.helper.Helper();
|
||||
|
||||
boolean isAlone() {
|
||||
@@ -116,10 +118,28 @@ public class EnvironmentExListeners implements Listener {
|
||||
voteIsGoing = true;
|
||||
voteForYes = 1;
|
||||
voteForNo = 0;
|
||||
onlinePlayers = 0;
|
||||
voteablePlayers = 0;
|
||||
hasVoted.add(e.getPlayer().getUniqueId());
|
||||
for (Player p : App.main.getServer().getOnlinePlayers()) {
|
||||
onlinePlayers++;
|
||||
|
||||
if(p.playerListName().toString().contains("[AFK] ")){
|
||||
//skipping because AFK
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//wenn player AFK auch!
|
||||
if(p.getUniqueId().equals(e.getPlayer().getUniqueId())){
|
||||
//skipping because sleeper
|
||||
continue;
|
||||
}
|
||||
if(LoginListener.customConfig.getBoolean("players." + p.getUniqueId() + ".ignorevote")){
|
||||
//skipping because ignorevote
|
||||
continue;
|
||||
}
|
||||
voteablePlayers++;
|
||||
|
||||
if (e.getBed().getWorld().isThundering()) {
|
||||
|
||||
p.sendMessage(helper.R3SMessage(Type.INFO, e.getPlayer().getName()
|
||||
@@ -134,6 +154,20 @@ public class EnvironmentExListeners implements Listener {
|
||||
p.sendMessage(helper.R3SMessage(Type.INFO, "Du hast ab jetzt 10 Sekunden Zeit."));
|
||||
|
||||
}
|
||||
|
||||
if(voteablePlayers == 0){
|
||||
if (e.getBed().getWorld().isThundering()) {
|
||||
Bukkit.getWorlds().get(0).setTime(24000);
|
||||
Bukkit.getWorlds().get(0).setStorm(false);
|
||||
Bukkit.getWorlds().get(0).setThundering(false);
|
||||
Bukkit.getWorlds().get(0).setWeatherDuration(6000);
|
||||
} else {
|
||||
Bukkit.getWorlds().get(0).setTime(24000);
|
||||
}
|
||||
voteIsGoing = false;
|
||||
return;
|
||||
}
|
||||
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(App.main, new Runnable() {
|
||||
public void run() {
|
||||
voteIsGoing = false;
|
||||
@@ -145,7 +179,7 @@ public class EnvironmentExListeners implements Listener {
|
||||
|
||||
p.sendMessage(helper.R3SMessage(Type.OK, "Das Gewitter wird durchgeschlafen. ("
|
||||
+ voteForYes + "x Ja, " + voteForNo + "x Nein, "
|
||||
+ (onlinePlayers - voteForNo - voteForYes) + "x enthalten)"));
|
||||
+ (voteablePlayers - voteForNo - voteForYes) + "x enthalten)"));
|
||||
|
||||
}
|
||||
|
||||
@@ -153,7 +187,7 @@ public class EnvironmentExListeners implements Listener {
|
||||
|
||||
p.sendMessage(helper.R3SMessage(Type.OK, "Die Nacht wird durchgeschlafen. ("
|
||||
+ voteForYes + "x Ja, " + voteForNo + "x Nein, "
|
||||
+ (onlinePlayers - voteForNo - voteForYes) + "x enthalten)"));
|
||||
+ (voteablePlayers - voteForNo - voteForYes) + "x enthalten)"));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -175,14 +209,14 @@ public class EnvironmentExListeners implements Listener {
|
||||
p.sendMessage(helper.R3SMessage(Type.ERROR,
|
||||
"Das Gewitter wird nicht durchgeschlafen. (" + voteForYes + "x Ja, "
|
||||
+ voteForNo
|
||||
+ "x Nein, " + (onlinePlayers - voteForNo - voteForYes)
|
||||
+ "x Nein, " + (voteablePlayers - voteForNo - voteForYes)
|
||||
+ "x enthalten)"));
|
||||
|
||||
} else {
|
||||
p.sendMessage(helper.R3SMessage(Type.ERROR,
|
||||
"Die Nacht wird nicht durchgeschlafen. (" + voteForYes + "x Ja, "
|
||||
+ voteForNo
|
||||
+ "x Nein, " + (onlinePlayers - voteForNo - voteForYes)
|
||||
+ "x Nein, " + (voteablePlayers - voteForNo - voteForYes)
|
||||
+ "x enthalten)"));
|
||||
}
|
||||
if (p.isSleeping()) {
|
||||
|
||||
@@ -11,7 +11,6 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
|
||||
import de.hessj.helper.Helper.Type;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.title.Title;
|
||||
@@ -36,6 +35,7 @@ public class LoginListener implements Listener {
|
||||
(DateTimeFormatter.ofPattern("dd.MM.YYYY-HH:mm:ss")).format(LocalDateTime.now()));
|
||||
customConfig.set("players." + e.getPlayer().getUniqueId() + ".whitelisted", false);
|
||||
customConfig.set("players." + e.getPlayer().getUniqueId() + ".hasSeenTutorial", false);
|
||||
customConfig.set("players." + e.getPlayer().getUniqueId() + ".ignorevote", false);
|
||||
saveCustomYml(customConfig, customYml);
|
||||
}
|
||||
if (customConfig.getBoolean("players." + e.getPlayer().getUniqueId() + ".whitelisted")) {
|
||||
@@ -60,6 +60,7 @@ public class LoginListener implements Listener {
|
||||
public static void saveCustomYml(FileConfiguration ymlConfig, File ymlFile) {
|
||||
try {
|
||||
ymlConfig.save(ymlFile);
|
||||
YamlConfiguration.loadConfiguration(ymlFile);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user