Fixed some weather shit; Added yml for new texturepack

This commit is contained in:
Janik Heß
2025-03-08 01:18:13 +01:00
parent 6a8aa6283f
commit f76d3c3b01
3 changed files with 26 additions and 3 deletions

View File

@@ -10,6 +10,8 @@ import net.kyori.adventure.text.Component;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.NamespacedKey;
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.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
@@ -22,6 +24,9 @@ import org.bukkit.inventory.RecipeChoice.MaterialChoice;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.components.CustomModelDataComponent;
import org.bukkit.persistence.PersistentDataType;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -52,10 +57,23 @@ public class App extends JavaPlugin {
public static boolean coordinateRunner = false;
public PluginManager pM = Bukkit.getPluginManager();
public HashMap<Player, Boolean> hmActionbar = new HashMap<Player, Boolean>();
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");
tpConfig.addDefault("sha1", "a7f7bde9e54279b502d65435877d251aa522cabc");
// Copy defaults and save if the file doesn't have these values
tpConfig.options().copyDefaults(true);
try {
tpConfig.save(tpYml);
} catch (IOException e) {
e.printStackTrace();
}
getServer().recipeIterator().forEachRemaining(recipe -> {
if (recipe instanceof ShapelessRecipe) {
ShapelessRecipe shapelessRecipe = (ShapelessRecipe) recipe;

View File

@@ -20,6 +20,8 @@ import net.kyori.adventure.text.Component;
public class CustomItems implements Listener {
public static ItemStack flintBlock = new ItemStack(Material.DIRT);
public de.hessj.helper.Helper helper= new de.hessj.helper.Helper();
@@ -30,8 +32,8 @@ public class CustomItems implements Listener {
}
}
private String url = "https://mc.hessj.de/texturepack/CUSTOM.zip";
private String sha1 = "a7f7bde9e54279b502d65435877d251aa522cabc";
private String url = App.main.tpConfig.getString("url");
private String sha1 = App.main.tpConfig.getString("sha1");
@EventHandler
public void onPlayerJoin(PlayerJoinEvent e) {

View File

@@ -164,6 +164,9 @@ public class EnvironmentExListeners implements Listener {
}
}
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 if (voteForNo >= voteForYes) {