mirror of
https://github.com/plexusorg/Module-TFMExtras.git
synced 2026-06-05 15:56:54 +00:00
Update dependencies and Gradle, along with small cleanup
This commit is contained in:
@@ -70,12 +70,9 @@ public class CartSitCommand extends PlexCommand
|
||||
{
|
||||
return CompletableFuture.supplyAsync(() ->
|
||||
{
|
||||
Entity nearest = entities.get(0);
|
||||
for (int i = 0; i < entities.size(); i++)
|
||||
{
|
||||
Entity e = entities.get(i);
|
||||
if (player.getLocation().distance(e.getLocation()) < player.getLocation().distance(nearest.getLocation()))
|
||||
{
|
||||
Entity nearest = entities.getFirst();
|
||||
for (Entity e : entities) {
|
||||
if (player.getLocation().distance(e.getLocation()) < player.getLocation().distance(nearest.getLocation())) {
|
||||
nearest = e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
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.Collections;
|
||||
import java.util.List;
|
||||
@@ -79,7 +81,7 @@ public class EnchantCommand extends PlexCommand
|
||||
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))
|
||||
{
|
||||
return messageComponent("enchantInvalid");
|
||||
@@ -108,7 +110,7 @@ public class EnchantCommand extends PlexCommand
|
||||
private List<Enchantment> getEnchantments(ItemStack item)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user