Reformat and update Gradle

This commit is contained in:
Telesphoreo 2023-08-28 19:12:48 -05:00
parent 76b2c609eb
commit 8b4da4308a
No known key found for this signature in database
GPG Key ID: 9D1991811E093C02
28 changed files with 78 additions and 114 deletions

View File

@ -8,9 +8,10 @@ repositories {
url = uri("https://repo.papermc.io/repository/maven-public/")
}
/*maven {
maven {
url = uri("https://nexus.telesphoreo.me/repository/plex/")
}*/
}
maven {
url = uri("https://repo.infernalsuite.com/repository/maven-snapshots/")
}
@ -26,12 +27,12 @@ dependencies {
implementation("org.apache.commons:commons-lang3:3.12.0")
compileOnly("dev.plex:server:1.4-SNAPSHOT")
compileOnly("com.infernalsuite.aswm:api:1.20-R0.1-SNAPSHOT") {
exclude(group="com.flowpowered")
exclude(group = "com.flowpowered")
}
}
group = "dev.plex"
version = "1.3"
version = "1.4-SNAPSHOT"
description = "Module-TFMExtras"
java {

Binary file not shown.

View File

@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

12
gradlew vendored
View File

@ -85,9 +85,6 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@ -133,10 +130,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
@ -197,6 +197,10 @@ if "$cygwin" || "$msys" ; then
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in

View File

@ -1,7 +1,6 @@
package dev.plex.extras;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.common.reflect.ClassPath;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters;
@ -10,28 +9,19 @@ import dev.plex.config.ModuleConfig;
import dev.plex.extras.command.slime.MyWorldCommand;
import dev.plex.extras.command.slime.SlimeManagerCommand;
import dev.plex.extras.hook.SlimeWorldHook;
import dev.plex.extras.hook.slime.PlayerWorld;
import dev.plex.extras.jumppads.JumpPads;
import dev.plex.listener.PlexListener;
import dev.plex.listener.impl.ChatListener;
import dev.plex.module.PlexModule;
import dev.plex.player.PlexPlayer;
import dev.plex.util.PlexLog;
import dev.plex.util.PlexUtils;
import dev.plex.util.minimessage.SafeMiniMessage;
import dev.plex.util.sql.SQLUtil;
import io.papermc.paper.event.player.AsyncChatEvent;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;
import org.bukkit.Location;
import org.bukkit.World;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.ThreadLocalRandom;
import lombok.Getter;
import org.bukkit.Location;
import org.bukkit.World;
public class TFMExtras extends PlexModule
{
@ -68,14 +58,13 @@ public class TFMExtras extends PlexModule
}
getClassesFrom("dev.plex.extras.command").forEach(aClass ->
{
if (PlexCommand.class.isAssignableFrom(aClass) && aClass.isAnnotationPresent(CommandParameters.class) && aClass.isAnnotationPresent(CommandPermissions.class))
{
try
{
PlexCommand plexCommand = (PlexCommand) aClass.getConstructors()[0].newInstance();
PlexCommand plexCommand = (PlexCommand)aClass.getConstructors()[0].newInstance();
registerCommand(plexCommand);
}
catch (InstantiationException | IllegalAccessException | InvocationTargetException e)
@ -91,7 +80,7 @@ public class TFMExtras extends PlexModule
{
try
{
PlexListener plexListener = (PlexListener) aClass.getConstructors()[0].newInstance();
PlexListener plexListener = (PlexListener)aClass.getConstructors()[0].newInstance();
registerListener(plexListener);
}
catch (InstantiationException | IllegalAccessException | InvocationTargetException e)
@ -129,7 +118,7 @@ public class TFMExtras extends PlexModule
{
double x = ThreadLocalRandom.current().nextDouble(-100000, 100000);
double z = ThreadLocalRandom.current().nextDouble(-100000, 100000);
double y = world.getHighestBlockYAt((int) x, (int) z) + 1;
double y = world.getHighestBlockYAt((int)x, (int)z) + 1;
return new Location(world, x, y, z);
}

View File

@ -1,10 +1,10 @@
package dev.plex.extras.command;
import dev.plex.extras.TFMExtras;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.extras.TFMExtras;
import java.util.List;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.minimessage.MiniMessage;
import org.bukkit.command.CommandSender;
@ -12,10 +12,8 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
@CommandParameters(name = "admininfo", description = "Information on how to apply for admin", aliases = "ai,si,staffinfo")
@CommandPermissions( permission = "plex.tfmextras.admininfo")
@CommandPermissions(permission = "plex.tfmextras.admininfo")
public class AdminInfoCommand extends PlexCommand
{
private static final List<Component> ADMIN_INFO = TFMExtras.getModule().getConfig().getStringList("server.admininfo")

View File

@ -3,7 +3,7 @@ package dev.plex.extras.command;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import java.util.Arrays;
import net.kyori.adventure.text.Component;
import org.apache.commons.lang3.StringUtils;
import org.bukkit.attribute.Attribute;
@ -12,10 +12,8 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Arrays;
@CommandParameters(name = "attributes", description = "Lists all possible attributes", aliases = "attributelist,attrlist")
@CommandPermissions( permission = "plex.tfmextras.attrlist")
@CommandPermissions(permission = "plex.tfmextras.attrlist")
public class AttributeListCommand extends PlexCommand
{
@Override

View File

@ -1,21 +1,19 @@
package dev.plex.extras.command;
import dev.plex.extras.TFMExtras;
import dev.plex.cache.DataUtils;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.PlayerNotFoundException;
import dev.plex.extras.TFMExtras;
import dev.plex.player.PlexPlayer;
import java.util.List;
import net.kyori.adventure.text.Component;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
@CommandParameters(name = "autoclear", description = "Toggle whether or not a player has their inventory automatically cleared when they join", usage = "/<command> <player>", aliases = "aclear,ac")
@CommandPermissions(permission = "plex.tfmextras.autoclear")
public class AutoClearCommand extends PlexCommand

View File

@ -1,13 +1,13 @@
package dev.plex.extras.command;
import dev.plex.extras.TFMExtras;
import dev.plex.cache.DataUtils;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.PlayerNotFoundException;
import dev.plex.extras.TFMExtras;
import dev.plex.player.PlexPlayer;
import java.util.List;
import net.kyori.adventure.text.Component;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
@ -15,10 +15,8 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
@CommandParameters(name = "autoteleport", description = "If a player is specified, it will toggle whether or not the player is automatically teleported when they join. If no player is specified, you will be randomly teleported", usage = "/<command> [player]", aliases = "autotp,rtp,randomtp,tpr")
@CommandPermissions( permission = "plex.tfmextras.autotp")
@CommandPermissions(permission = "plex.tfmextras.autotp")
public class AutoTeleportCommand extends PlexCommand
{
@Override

View File

@ -4,6 +4,7 @@ import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.punishment.Punishment;
import java.util.stream.Collectors;
import net.kyori.adventure.text.Component;
import org.apache.commons.lang3.StringUtils;
import org.bukkit.command.CommandSender;
@ -11,8 +12,6 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.stream.Collectors;
@CommandParameters(name = "banlist", description = "Manages the banlist", usage = "/<command> [purge]")
@CommandPermissions(permission = "plex.tfmextras.banlist")
public class BanListCommand extends PlexCommand

View File

@ -3,7 +3,6 @@ package dev.plex.extras.command;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.util.PlexUtils;
import dev.plex.util.item.ItemBuilder;
import net.kyori.adventure.text.Component;

View File

@ -4,7 +4,9 @@ import dev.plex.Plex;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.minimessage.MiniMessage;
import org.bukkit.Bukkit;
@ -15,10 +17,6 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
@CommandParameters(name = "cartsit", description = "Sit in nearest minecart. If target is in a minecart already, they will be ejected", aliases = "minecartsit")
@CommandPermissions(permission = "plex.tfmextras.cartsit")
public class CartSitCommand extends PlexCommand

View File

@ -3,7 +3,6 @@ package dev.plex.extras.command;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.util.PlexUtils;
import net.kyori.adventure.text.Component;
import org.bukkit.Bukkit;

View File

@ -3,8 +3,9 @@ package dev.plex.extras.command;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.util.PlexUtils;
import java.util.Collection;
import java.util.concurrent.atomic.AtomicInteger;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.minimessage.MiniMessage;
import org.bukkit.Bukkit;
@ -15,9 +16,6 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collection;
import java.util.concurrent.atomic.AtomicInteger;
@CommandParameters(name = "cloudclear", description = "Clears lingering potion area effect clouds", aliases = "clearcloud,aeclear")
@CommandPermissions(permission = "plex.tfmextras.cloudclear")
public class CloudClearCommand extends PlexCommand

View File

@ -4,7 +4,6 @@ import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.source.RequiredCommandSource;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.minimessage.MiniMessage;
import org.bukkit.command.CommandSender;
@ -13,7 +12,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@CommandParameters(name = "eject", description = "Removes all passengers from a player")
@CommandPermissions( permission = "plex.tfmextras.eject", source = RequiredCommandSource.IN_GAME)
@CommandPermissions(permission = "plex.tfmextras.eject", source = RequiredCommandSource.IN_GAME)
public class EjectCommand extends PlexCommand
{
@Override

View File

@ -5,7 +5,8 @@ import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.source.RequiredCommandSource;
import java.util.Arrays;
import java.util.List;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.minimessage.MiniMessage;
import org.apache.commons.lang3.StringUtils;
@ -18,11 +19,8 @@ import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Arrays;
import java.util.List;
@CommandParameters(name = "enchant", description = "Enchants an item", usage = "/<command> <add | reset | list | addall | remove>", aliases = "enchantment")
@CommandPermissions( permission = "plex.tfmextras.enchant", source = RequiredCommandSource.IN_GAME)
@CommandPermissions(permission = "plex.tfmextras.enchant", source = RequiredCommandSource.IN_GAME)
public class EnchantCommand extends PlexCommand
{
@Override

View File

@ -3,8 +3,9 @@ package dev.plex.extras.command;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.util.PlexUtils;
import java.util.List;
import java.util.stream.Collectors;
import net.kyori.adventure.text.Component;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
@ -13,9 +14,6 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
import java.util.stream.Collectors;
/**
* Credit to AcidicCyanide <3
* Credit to "TheDeus-Group" for the messages :)

View File

@ -1,14 +1,16 @@
package dev.plex.extras.command;
import dev.plex.extras.TFMExtras;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.extras.TFMExtras;
import dev.plex.extras.jumppads.JumpPads;
import dev.plex.extras.jumppads.Mode;
import dev.plex.util.PlexUtils;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.minimessage.MiniMessage;
import org.bukkit.Bukkit;
@ -18,12 +20,8 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@CommandParameters(name = "jumppads", usage = "/jumppads <mode> [player]", description = "Enables jump pads for yourself or another player. Mode types available: none, regular, enhanced, extreme, ultimate", aliases = "jp,pads,launchpads")
@CommandPermissions( permission = "plex.tfmextras.jumppads", source = RequiredCommandSource.ANY)
@CommandPermissions(permission = "plex.tfmextras.jumppads", source = RequiredCommandSource.ANY)
public class JumpPadsCommand extends PlexCommand
{
JumpPads jumpPads = TFMExtras.getModule().jumpPads;

View File

@ -4,7 +4,9 @@ import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.source.RequiredCommandSource;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.minimessage.MiniMessage;
import org.bukkit.block.Block;
@ -14,12 +16,8 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
@CommandParameters(name = "randomfish", description = "Spawns a random type of fish at your location", aliases = "rfish,bird")
@CommandPermissions( permission = "plex.tfmextras.randomfish", source = RequiredCommandSource.IN_GAME)
@CommandPermissions(permission = "plex.tfmextras.randomfish", source = RequiredCommandSource.IN_GAME)
public class RandomFishCommand extends PlexCommand
{
private static final List<EntityType> FISH_TYPES = Arrays.asList(EntityType.COD, EntityType.SALMON, EntityType.PUFFERFISH, EntityType.TROPICAL_FISH);

View File

@ -6,7 +6,6 @@ import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.PlayerNotFoundException;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.extras.TFMExtras;
import net.kyori.adventure.text.Component;
import org.bukkit.Bukkit;
import org.bukkit.Sound;
@ -22,7 +21,7 @@ import org.jetbrains.annotations.Nullable;
*/
@CommandParameters(name = "myworld", usage = "/<command> <create | goto | manage | members | shared | add | remove | settings> [player]")
@CommandPermissions( permission = "plex.tfmextras.myworld", source = RequiredCommandSource.IN_GAME)
@CommandPermissions(permission = "plex.tfmextras.myworld", source = RequiredCommandSource.IN_GAME)
public class MyWorldCommand extends PlexCommand
{
@Override

View File

@ -5,7 +5,6 @@ import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.extras.TFMExtras;
import dev.plex.util.PlexLog;
import dev.plex.util.PlexUtils;
import io.papermc.paper.threadedregions.scheduler.ScheduledTask;

View File

@ -6,7 +6,8 @@ import dev.plex.extras.TFMExtras;
* @author Taah
* @since 2:16 PM [23-08-2023]
*/
public interface IHook<T> {
public interface IHook<T>
{
void onEnable(TFMExtras module);

View File

@ -2,13 +2,21 @@ package dev.plex.extras.hook;
import com.google.common.collect.Sets;
import com.infernalsuite.aswm.api.SlimePlugin;
import com.infernalsuite.aswm.api.exceptions.*;
import com.infernalsuite.aswm.api.exceptions.CorruptedWorldException;
import com.infernalsuite.aswm.api.exceptions.NewerFormatException;
import com.infernalsuite.aswm.api.exceptions.UnknownWorldException;
import com.infernalsuite.aswm.api.exceptions.WorldAlreadyExistsException;
import com.infernalsuite.aswm.api.exceptions.WorldLockedException;
import com.infernalsuite.aswm.api.loaders.SlimeLoader;
import com.infernalsuite.aswm.api.world.SlimeWorld;
import com.infernalsuite.aswm.api.world.properties.SlimeProperties;
import com.infernalsuite.aswm.api.world.properties.SlimePropertyMap;
import dev.plex.extras.TFMExtras;
import dev.plex.util.PlexLog;
import java.io.IOException;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;
import lombok.Getter;
import org.apache.commons.lang3.tuple.Pair;
import org.bukkit.Bukkit;
@ -17,12 +25,6 @@ import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.event.world.WorldLoadEvent;
import java.io.IOException;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;
/**
* @author Taah
* @since 2:19 PM [23-08-2023]
@ -33,7 +35,7 @@ public class SlimeWorldHook implements IHook<SlimePlugin>
private static final String STORAGE_FAILURE = "<red>This world cannot be stored!";
private final Set<String> loadedWorlds = Sets.newHashSet();
// private final List<>
@Getter
@ -86,7 +88,8 @@ public class SlimeWorldHook implements IHook<SlimePlugin>
this.plugin().loadWorld(world);
this.loader.unlockWorld(s);
}
catch (UnknownWorldException | WorldLockedException | CorruptedWorldException | NewerFormatException | IllegalArgumentException ex)
catch (UnknownWorldException | WorldLockedException | CorruptedWorldException | NewerFormatException |
IllegalArgumentException ex)
{
PlexLog.error(ex.getMessage());
}
@ -221,6 +224,6 @@ public class SlimeWorldHook implements IHook<SlimePlugin>
@Override
public SlimePlugin plugin()
{
return (SlimePlugin) Bukkit.getPluginManager().getPlugin("SlimeWorldManager");
return (SlimePlugin)Bukkit.getPluginManager().getPlugin("SlimeWorldManager");
}
}

View File

@ -1,15 +1,11 @@
package dev.plex.extras.hook.slime;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import dev.plex.storage.annotation.PrimaryKey;
import dev.plex.storage.annotation.SQLTable;
import lombok.Data;
import org.bukkit.GameRule;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import lombok.Data;
/**
* @author Taah

View File

@ -1,6 +1,10 @@
package dev.plex.extras.jumppads;
import dev.plex.extras.TFMExtras;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;
import org.bukkit.Material;
import org.bukkit.Tag;
import org.bukkit.block.Block;
@ -8,11 +12,6 @@ import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;
public class JumpPads
{
public final Map<UUID, Mode> playerModeMap = new HashMap<>();

View File

@ -5,6 +5,7 @@ import dev.plex.extras.jumppads.JumpPads;
import dev.plex.extras.jumppads.Mode;
import dev.plex.listener.PlexListener;
import dev.plex.util.PlexLog;
import java.util.Map;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
@ -14,8 +15,6 @@ import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.util.Vector;
import java.util.Map;
public class JumpPadsListener extends PlexListener
{
JumpPads jumpPads = TFMExtras.getModule().jumpPads;
@ -38,7 +37,7 @@ public class JumpPadsListener extends PlexListener
Block below = block.getRelative(BlockFace.DOWN);
if (jumpPads.wool.getValues().contains(below.getType()))
{
if (event.getFrom().getY() > block.getY() + 0.1 && ((int) event.getTo().getY() == block.getY()))
if (event.getFrom().getY() > block.getY() + 0.1 && ((int)event.getTo().getY() == block.getY()))
{
Vector vector = playerVector.multiply(new Vector(0.0, jumpPads.SCALAR * jumpPads.STRENGTH, 0.0));
if (vector.getY() < 0)
@ -59,7 +58,7 @@ public class JumpPadsListener extends PlexListener
{
if (jumpPads.wool.getValues().contains(b.getType()))
{
if (!(event.getFrom().getY() > block.getY() + 0.1 && ((int) event.getTo().getY() == block.getY())))
if (!(event.getFrom().getY() > block.getY() + 0.1 && ((int)event.getTo().getY() == block.getY())))
{
return;
}
@ -94,7 +93,7 @@ public class JumpPadsListener extends PlexListener
Block below = block.getRelative(BlockFace.DOWN);
if (jumpPads.wool.getValues().contains(below.getType()))
{
if (event.getFrom().getY() > block.getY() + 0.1 && ((int) event.getTo().getY() == block.getY()))
if (event.getFrom().getY() > block.getY() + 0.1 && ((int)event.getTo().getY() == block.getY()))
{
player.setVelocity(jumpPads.extreme(playerVector));
}

View File

@ -4,10 +4,7 @@ import dev.plex.Plex;
import dev.plex.extras.TFMExtras;
import dev.plex.listener.PlexListener;
import dev.plex.util.PlexLog;
import dev.plex.util.PlexUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerJoinEvent;

View File

@ -1,4 +1,4 @@
name: Module-TFMExtras
main: dev.plex.extras.TFMExtras
description: TFM extras for Plex
version: 1.3
version: 1.4-SNAPSHOT