Update Gradle and Java versions, refactor, and fix enchantments
Upgraded Gradle to v8.5, updated Java language version to 21, and replaced the Shadow plugin. Deprecated `MaterialData` was removed. Fixed enchantment from ARROW_INFINITE to INFINITY in GUI and particle actions.
This commit is contained in:
@@ -1,14 +1,12 @@
|
||||
package com.alttd;
|
||||
|
||||
import com.alttd.commands.CommandManager;
|
||||
import com.alttd.commands.subcommands.CommandReload;
|
||||
import com.alttd.config.Config;
|
||||
import com.alttd.config.DatabaseConfig;
|
||||
import com.alttd.config.ParticleConfig;
|
||||
import com.alttd.database.Database;
|
||||
import com.alttd.listeners.*;
|
||||
import com.alttd.objects.APartType;
|
||||
import com.alttd.particles.InitParticles;
|
||||
import com.alttd.util.Logger;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
@@ -32,7 +30,6 @@ public class AltitudeParticles extends JavaPlugin {
|
||||
Database.getDatabase().init();
|
||||
new CommandManager();
|
||||
registerEvents();
|
||||
InitParticles.init();
|
||||
Logger.info("--------------------------------------------------");
|
||||
Logger.info("Altitude Particles started");
|
||||
Logger.info("--------------------------------------------------");
|
||||
|
||||
@@ -13,7 +13,6 @@ import org.bukkit.Material;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.material.MaterialData;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
@@ -90,9 +89,11 @@ public class ParticleConfig {
|
||||
if (particleType.getDataType().equals(Particle.DustOptions.class)) {
|
||||
int rgb = HexFormat.fromHexDigits((String) pData.get("color"));
|
||||
particleBuilder.data(new Particle.DustOptions(Color.fromRGB(rgb), 1));
|
||||
} else if (particleType.getDataType().equals(MaterialData.class)) {
|
||||
//TODO implement
|
||||
} else if (particleType.getDataType().equals(BlockData.class)) {
|
||||
}
|
||||
// else if (particleType.getDataType().equals(MaterialData.class)) {
|
||||
// //TODO implement
|
||||
// }
|
||||
else if (particleType.getDataType().equals(BlockData.class)) {
|
||||
//TODO implement
|
||||
} else if (particleType.getDataType().equals(Integer.class)) {
|
||||
//TODO implement
|
||||
|
||||
@@ -58,7 +58,7 @@ public class ActivateParticleSet implements GUIAction {
|
||||
meta.getEnchants().forEach((enchantment, integer) -> meta.removeEnchant(enchantment));
|
||||
item.setItemMeta(meta);
|
||||
});
|
||||
itemMeta.addEnchant(Enchantment.ARROW_INFINITE, 1, true);
|
||||
itemMeta.addEnchant(Enchantment.INFINITY, 1, true);
|
||||
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
|
||||
Queries.addParticle(player.getUniqueId(), particleSet.getAPartType(), particleSet.getParticleId());
|
||||
enable = true;
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ChooseParticleGUI extends DefaultGUI {
|
||||
|
||||
if (activeParticleSet != null && playerSettings.getParticles(aPartType).equals(particleSet)) {
|
||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
||||
itemMeta.addEnchant(Enchantment.ARROW_INFINITE, 1, true);
|
||||
itemMeta.addEnchant(Enchantment.INFINITY, 1, true);
|
||||
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
|
||||
itemStack.setItemMeta(itemMeta);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user