mirror of
https://github.com/plexusorg/Module-TFMExtras.git
synced 2026-06-03 23:26:55 +00:00
Update dependencies and Gradle, along with small cleanup
This commit is contained in:
+6
-6
@@ -21,18 +21,18 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly("org.projectlombok:lombok:1.18.38")
|
compileOnly("org.projectlombok:lombok:1.18.42")
|
||||||
annotationProcessor("org.projectlombok:lombok:1.18.38")
|
annotationProcessor("org.projectlombok:lombok:1.18.42")
|
||||||
compileOnly("io.papermc.paper:paper-api:1.21.7-R0.1-SNAPSHOT")
|
compileOnly("io.papermc.paper:paper-api:1.21.10-R0.1-SNAPSHOT")
|
||||||
implementation("org.apache.commons:commons-lang3:3.17.0")
|
implementation("org.apache.commons:commons-lang3:3.19.0")
|
||||||
compileOnly("dev.plex:server:1.5")
|
compileOnly("dev.plex:server:1.6")
|
||||||
compileOnly("com.infernalsuite.aswm:api:1.20.6-R0.1-SNAPSHOT") {
|
compileOnly("com.infernalsuite.aswm:api:1.20.6-R0.1-SNAPSHOT") {
|
||||||
exclude(group = "com.flowpowered")
|
exclude(group = "com.flowpowered")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "dev.plex"
|
group = "dev.plex"
|
||||||
version = "1.5"
|
version = "1.6"
|
||||||
description = "Module-TFMExtras"
|
description = "Module-TFMExtras"
|
||||||
|
|
||||||
java {
|
java {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ public class TFMExtras extends PlexModule
|
|||||||
|
|
||||||
private Set<Class<?>> getClassesFrom(String packageName)
|
private Set<Class<?>> getClassesFrom(String packageName)
|
||||||
{
|
{
|
||||||
Set<Class<?>> classes = new HashSet();
|
Set<Class<?>> classes = new HashSet<>();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -70,12 +70,9 @@ public class CartSitCommand extends PlexCommand
|
|||||||
{
|
{
|
||||||
return CompletableFuture.supplyAsync(() ->
|
return CompletableFuture.supplyAsync(() ->
|
||||||
{
|
{
|
||||||
Entity nearest = entities.get(0);
|
Entity nearest = entities.getFirst();
|
||||||
for (int i = 0; i < entities.size(); i++)
|
for (Entity e : entities) {
|
||||||
{
|
if (player.getLocation().distance(e.getLocation()) < player.getLocation().distance(nearest.getLocation())) {
|
||||||
Entity e = entities.get(i);
|
|
||||||
if (player.getLocation().distance(e.getLocation()) < player.getLocation().distance(nearest.getLocation()))
|
|
||||||
{
|
|
||||||
nearest = e;
|
nearest = e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import dev.plex.command.annotation.CommandParameters;
|
|||||||
import dev.plex.command.annotation.CommandPermissions;
|
import dev.plex.command.annotation.CommandPermissions;
|
||||||
import dev.plex.command.source.RequiredCommandSource;
|
import dev.plex.command.source.RequiredCommandSource;
|
||||||
|
|
||||||
|
import io.papermc.paper.registry.RegistryAccess;
|
||||||
|
import io.papermc.paper.registry.RegistryKey;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -79,7 +81,7 @@ public class EnchantCommand extends PlexCommand
|
|||||||
return messageComponent("enchantSpecify");
|
return messageComponent("enchantSpecify");
|
||||||
}
|
}
|
||||||
|
|
||||||
Enchantment enchantmentToRemove = Registry.ENCHANTMENT.get(NamespacedKey.minecraft(args[1].toLowerCase()));
|
Enchantment enchantmentToRemove = RegistryAccess.registryAccess().getRegistry(RegistryKey.ENCHANTMENT).get(NamespacedKey.minecraft(args[1].toLowerCase()));
|
||||||
if (enchantmentToRemove == null || !item.containsEnchantment(enchantmentToRemove))
|
if (enchantmentToRemove == null || !item.containsEnchantment(enchantmentToRemove))
|
||||||
{
|
{
|
||||||
return messageComponent("enchantInvalid");
|
return messageComponent("enchantInvalid");
|
||||||
@@ -108,7 +110,7 @@ public class EnchantCommand extends PlexCommand
|
|||||||
private List<Enchantment> getEnchantments(ItemStack item)
|
private List<Enchantment> getEnchantments(ItemStack item)
|
||||||
{
|
{
|
||||||
List<Enchantment> enchants = Lists.newArrayList();
|
List<Enchantment> enchants = Lists.newArrayList();
|
||||||
Arrays.stream(Enchantment.values()).filter(enchantment -> enchantment.canEnchantItem(item)).forEach(enchants::add);
|
RegistryAccess.registryAccess().getRegistry(RegistryKey.ENCHANTMENT).stream().filter(enchantment -> enchantment.canEnchantItem(item)).forEach(enchants::add);
|
||||||
return enchants;
|
return enchants;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package dev.plex.extras.listener;
|
|||||||
|
|
||||||
import dev.plex.extras.TFMExtras;
|
import dev.plex.extras.TFMExtras;
|
||||||
import dev.plex.listener.PlexListener;
|
import dev.plex.listener.PlexListener;
|
||||||
|
import io.papermc.paper.registry.RegistryAccess;
|
||||||
|
import io.papermc.paper.registry.RegistryKey;
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
|
|
||||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||||
@@ -74,7 +76,7 @@ public class ClownfishListener extends PlexListener
|
|||||||
{
|
{
|
||||||
target.setFlying(false);
|
target.setFlying(false);
|
||||||
|
|
||||||
for (Sound sound : Sound.values())
|
for (Sound sound : RegistryAccess.registryAccess().getRegistry(RegistryKey.SOUND_EVENT))
|
||||||
{
|
{
|
||||||
if (sound.toString().contains("HIT"))
|
if (sound.toString().contains("HIT"))
|
||||||
{
|
{
|
||||||
@@ -91,7 +93,7 @@ public class ClownfishListener extends PlexListener
|
|||||||
|
|
||||||
if (!pushedPlayers.isEmpty())
|
if (!pushedPlayers.isEmpty())
|
||||||
{
|
{
|
||||||
for (Sound sound : Sound.values())
|
for (Sound sound : RegistryAccess.registryAccess().getRegistry(RegistryKey.SOUND_EVENT))
|
||||||
{
|
{
|
||||||
if (sound.toString().contains("HIT"))
|
if (sound.toString().contains("HIT"))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import dev.plex.extras.island.info.IslandPermissions;
|
|||||||
import dev.plex.listener.PlexListener;
|
import dev.plex.listener.PlexListener;
|
||||||
import dev.plex.util.PlexUtils;
|
import dev.plex.util.PlexUtils;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
|
||||||
import org.bukkit.event.block.BlockBreakEvent;
|
import org.bukkit.event.block.BlockBreakEvent;
|
||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import org.bukkit.event.player.PlayerChangedWorldEvent;
|
import org.bukkit.event.player.PlayerChangedWorldEvent;
|
||||||
@@ -103,7 +102,6 @@ public class WorldListener extends PlexListener
|
|||||||
{
|
{
|
||||||
event.getPlayer().sendMessage(PlexUtils.messageComponent("cantVisitIsland"));
|
event.getPlayer().sendMessage(PlexUtils.messageComponent("cantVisitIsland"));
|
||||||
event.getPlayer().teleportAsync(event.getFrom().getSpawnLocation());
|
event.getPlayer().teleportAsync(event.getFrom().getSpawnLocation());
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
name: Module-TFMExtras
|
name: Module-TFMExtras
|
||||||
main: dev.plex.extras.TFMExtras
|
main: dev.plex.extras.TFMExtras
|
||||||
description: TFM extras for Plex
|
description: TFM extras for Plex
|
||||||
version: 1.5
|
version: 1.6
|
||||||
Reference in New Issue
Block a user