From 4f779eecf6e347c78fc64a6de7782857d7232fb5 Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Wed, 8 Mar 2023 13:30:51 -0600 Subject: [PATCH] Grammar fixes and update dependencies --- CONTRIBUTING.md | 23 ++++++-- README.md | 4 +- build.gradle.kts | 11 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- src/main/java/dev/plex/TFMExtras.java | 56 +++++++++++-------- .../dev/plex/command/AdminInfoCommand.java | 3 +- .../plex/command/AttributeListCommand.java | 3 +- .../dev/plex/command/AutoClearCommand.java | 3 +- .../dev/plex/command/AutoTeleportCommand.java | 3 +- .../java/dev/plex/command/BanListCommand.java | 3 +- .../java/dev/plex/command/CartSitCommand.java | 7 ++- .../dev/plex/command/CloudClearCommand.java | 5 +- .../java/dev/plex/command/EjectCommand.java | 9 ++- .../java/dev/plex/command/EnchantCommand.java | 12 ++-- .../dev/plex/command/JumpPadsCommand.java | 9 +-- .../dev/plex/command/RandomFishCommand.java | 7 ++- src/main/java/dev/plex/jumppads/JumpPads.java | 10 ++-- .../dev/plex/listener/JumpPadsListener.java | 2 + src/main/resources/module.yml | 2 +- src/main/resources/tfmextras/config.yml | 2 +- 20 files changed, 108 insertions(+), 68 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a6199f6..fb967e9 100755 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,24 +1,37 @@ -For those who are wanting to contribute, we fully encourage doing so. There are a few rules we require following when contributing however. +For those who are wanting to contribute, we fully encourage doing so. There are a few rules we require following when +contributing however. ## Steps + 1. Make an issue and get feedback. It's important to know if your idea will be accepted before writing any code. + - If it is a feature request, describe the feature and be extremely specific. - If it is a bug report, ensure you include how to reproduce the bug and the expected outcome - If it is an enhancement, describe your proposed changes. Ensure you are extremely specific. + 2. Fork this project -3. Create a new branch that describes the new feature, enhancement, or bug fix. For example, this is good: `feature/add-xyz`. This is bad: `fix-this-lol`. +3. Create a new branch that describes the new feature, enhancement, or bug fix. For example, this is + good: `feature/add-xyz`. This is bad: `fix-this-lol`. 4. Write the code that addresses your change. -- Keep in mind that it **must** be formatted correctly. If you are using IntelliJ, there is a `codeStyle.xml` file that tells IntelliJ how to format your code. Check this link for information on how to use the file: https://www.jetbrains.com/help/idea/configuring-code-style.html#import-export-schemes -- If you are not using IntelliJ, that is fine. We use the Plexus Code Style (which is almost the same as Allman) so please format your code accordingly. + +- Keep in mind that it **must** be formatted correctly. If you are using IntelliJ, there is a `codeStyle.xml` file that + tells IntelliJ how to format your code. Check this link for information on how to use the + file: https://www.jetbrains.com/help/idea/configuring-code-style.html#import-export-schemes +- If you are not using IntelliJ, that is fine. We use the Plexus Code Style (which is almost the same as Allman) so + please format your code accordingly. + 6. Push your changes to your new branch and make a PR based off of that branch. ## Requirements for a PR + - The issue must be marked as approved - It must only address each specific issue. Don't make one PR for multiple issues. - Your PR must compile and work. If it does not compile or work, your PR will most likely be rejected. ## Code requirements -- Most importantly, your code must be efficient. Your pull request may be rejected if your code is deemed inefficient or sloppy. + +- Most importantly, your code must be efficient. Your pull request may be rejected if your code is deemed inefficient or + sloppy. - Do not repeat yourself. Create functions as needed if you're using large blocks of code over and over again. - Do not use an excessive amount of commits when making your PR. It makes the master branch look messy. - Your code must be consistent with Plex's codebase. If a function already exists, use it. \ No newline at end of file diff --git a/README.md b/README.md index fb7b7fd..4b7cbab 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ # Module-TFMExtras [![Build Status](https://ci.plex.us.org/job/Module-TFMExtras/badge/icon)](https://ci.plex.us.org/job/Module-TFMExtras/) + Adds extra commands to Plex which makes it behave more like TotalFreedomMod. -**Note:** Please do not use any code licensed under the TotalFreedom General License for this project. It is not allowed. +**Note:** Please do not use any code licensed under the TotalFreedom General License for this project. It is not +allowed. diff --git a/build.gradle.kts b/build.gradle.kts index 751f179..6005ac4 100755 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -16,16 +16,15 @@ repositories { } dependencies { - compileOnly("org.projectlombok:lombok:1.18.24") - annotationProcessor("org.projectlombok:lombok:1.18.24") - compileOnly("io.papermc.paper:paper-api:1.19-R0.1-SNAPSHOT") + compileOnly("org.projectlombok:lombok:1.18.26") + annotationProcessor("org.projectlombok:lombok:1.18.26") + compileOnly("io.papermc.paper:paper-api:1.19.3-R0.1-SNAPSHOT") implementation("org.apache.commons:commons-lang3:3.12.0") - compileOnly("dev.plex:server:1.2-SNAPSHOT") - compileOnly("dev.plex:api:1.2-SNAPSHOT") + compileOnly("dev.plex:server:1.3-SNAPSHOT") } group = "dev.plex" -version = "1.2-SNAPSHOT" +version = "1.3-SNAPSHOT" description = "Module-TFMExtras" java { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index aa991fc..e1bef7e 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/dev/plex/TFMExtras.java b/src/main/java/dev/plex/TFMExtras.java index bc68d39..d1c3dc6 100755 --- a/src/main/java/dev/plex/TFMExtras.java +++ b/src/main/java/dev/plex/TFMExtras.java @@ -2,7 +2,7 @@ package dev.plex; import com.google.common.collect.ImmutableSet; import com.google.common.reflect.ClassPath; -import dev.plex.command.*; +import dev.plex.command.PlexCommand; import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; import dev.plex.config.ModuleConfig; @@ -12,20 +12,17 @@ import dev.plex.listener.PlayerListener; import dev.plex.listener.PlexListener; import dev.plex.module.PlexModule; import dev.plex.util.PlexLog; +import lombok.Getter; +import org.bukkit.Location; +import org.bukkit.World; import java.io.IOException; import java.lang.reflect.InvocationTargetException; -import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.Set; import java.util.concurrent.ThreadLocalRandom; -import dev.plex.util.ReflectionsUtil; -import lombok.Getter; -import org.bukkit.Location; -import org.bukkit.World; - public class TFMExtras extends PlexModule { @Getter @@ -49,29 +46,36 @@ public class TFMExtras extends PlexModule @Override public void enable() { - registerListener(new JumpPadsListener()); registerListener(new PlayerListener()); - getClassesFrom("dev.plex.command").forEach(aClass -> { + getClassesFrom("dev.plex.command").forEach(aClass -> + { if (aClass.getSuperclass() == PlexCommand.class && aClass.isAnnotationPresent(CommandParameters.class) && aClass.isAnnotationPresent(CommandPermissions.class)) { - try { + try + { PlexCommand plexCommand = (PlexCommand) aClass.getConstructors()[0].newInstance(); registerCommand(plexCommand); - } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { + } + catch (InstantiationException | IllegalAccessException | InvocationTargetException e) + { throw new RuntimeException(e); } } }); - getClassesFrom("dev.plex.listener").forEach(aClass -> { + getClassesFrom("dev.plex.listener").forEach(aClass -> + { if (aClass.getSuperclass() == PlexListener.class) { - try { + try + { PlexListener plexListener = (PlexListener) aClass.getConstructors()[0].newInstance(); registerListener(plexListener); - } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { + } + catch (InstantiationException | IllegalAccessException | InvocationTargetException e) + { throw new RuntimeException(e); } } @@ -83,7 +87,7 @@ public class TFMExtras extends PlexModule addDefaultMessage("chatCleared", "{0} - Cleared the chat", "0 - The command sender"); addDefaultMessage("attributeList", "All possible attributes: {0}", "0 - The attribute list, each split by a new line"); addDefaultMessage("modifiedAutoClear", "{0} will {1} have their inventory cleared when they join.", "0 - The player who will have their inventory cleared on join", "1 - Whether they had this option toggled (returns: 'no longer', 'now')"); - addDefaultMessage("modifiedAutoTeleport", "{0} will {1} have be teleported automatically when they join.", "0 - The player to be tp'd automatically", "1 - Whether they had this option toggled (returns: 'no longer', 'now')"); + addDefaultMessage("modifiedAutoTeleport", "{0} will {1} be teleported automatically when they join.", "0 - The player to be teleported automatically", "1 - Whether they had this option toggled (returns: 'no longer', 'now')"); } @Override @@ -96,26 +100,34 @@ 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); } - private Set> getClassesFrom(String packageName) { + private Set> getClassesFrom(String packageName) + { Set> classes = new HashSet(); - try { + try + { ClassPath path = ClassPath.from(TFMExtras.class.getClassLoader()); ImmutableSet infoSet = path.getTopLevelClasses(packageName); - infoSet.forEach((info) -> { - try { + infoSet.forEach((info) -> + { + try + { Class clazz = Class.forName(info.getName()); classes.add(clazz); - } catch (ClassNotFoundException var4) { + } + catch (ClassNotFoundException var4) + { PlexLog.error("Unable to find class " + info.getName() + " in " + packageName); } }); - } catch (IOException var4) { + } + catch (IOException var4) + { PlexLog.error("Something went wrong while fetching classes from " + packageName); throw new RuntimeException(var4); } diff --git a/src/main/java/dev/plex/command/AdminInfoCommand.java b/src/main/java/dev/plex/command/AdminInfoCommand.java index e9b5267..f5a5aaa 100755 --- a/src/main/java/dev/plex/command/AdminInfoCommand.java +++ b/src/main/java/dev/plex/command/AdminInfoCommand.java @@ -4,7 +4,6 @@ import dev.plex.TFMExtras; import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; import dev.plex.rank.enums.Rank; -import java.util.List; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.minimessage.MiniMessage; import org.bukkit.command.CommandSender; @@ -12,6 +11,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(level = Rank.OP, permission = "plex.tfmextras.admininfo") public class AdminInfoCommand extends PlexCommand diff --git a/src/main/java/dev/plex/command/AttributeListCommand.java b/src/main/java/dev/plex/command/AttributeListCommand.java index d76a1f4..62816ce 100755 --- a/src/main/java/dev/plex/command/AttributeListCommand.java +++ b/src/main/java/dev/plex/command/AttributeListCommand.java @@ -3,7 +3,6 @@ package dev.plex.command; import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; import dev.plex.rank.enums.Rank; -import java.util.Arrays; import net.kyori.adventure.text.Component; import org.apache.commons.lang3.StringUtils; import org.bukkit.attribute.Attribute; @@ -12,6 +11,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(level = Rank.OP, permission = "plex.tfmextras.attrlist") public class AttributeListCommand extends PlexCommand diff --git a/src/main/java/dev/plex/command/AutoClearCommand.java b/src/main/java/dev/plex/command/AutoClearCommand.java index 0ed805e..33be783 100755 --- a/src/main/java/dev/plex/command/AutoClearCommand.java +++ b/src/main/java/dev/plex/command/AutoClearCommand.java @@ -7,13 +7,14 @@ import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.exception.PlayerNotFoundException; import dev.plex.player.PlexPlayer; import dev.plex.rank.enums.Rank; -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 = "/ ", aliases = "aclear,ac") @CommandPermissions(level = Rank.ADMIN, permission = "plex.tfmextras.autoclear") public class AutoClearCommand extends PlexCommand diff --git a/src/main/java/dev/plex/command/AutoTeleportCommand.java b/src/main/java/dev/plex/command/AutoTeleportCommand.java index bf9d096..a986b59 100755 --- a/src/main/java/dev/plex/command/AutoTeleportCommand.java +++ b/src/main/java/dev/plex/command/AutoTeleportCommand.java @@ -7,7 +7,6 @@ import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.exception.PlayerNotFoundException; import dev.plex.player.PlexPlayer; import dev.plex.rank.enums.Rank; -import java.util.List; import net.kyori.adventure.text.Component; import org.bukkit.command.CommandSender; import org.bukkit.command.ConsoleCommandSender; @@ -15,6 +14,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 = "/ [player]", aliases = "autotp,rtp,randomtp,tpr") @CommandPermissions(level = Rank.OP, permission = "plex.tfmextras.autotp") public class AutoTeleportCommand extends PlexCommand diff --git a/src/main/java/dev/plex/command/BanListCommand.java b/src/main/java/dev/plex/command/BanListCommand.java index afdee16..1fb5237 100755 --- a/src/main/java/dev/plex/command/BanListCommand.java +++ b/src/main/java/dev/plex/command/BanListCommand.java @@ -4,7 +4,6 @@ import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; import dev.plex.punishment.Punishment; import dev.plex.rank.enums.Rank; -import java.util.stream.Collectors; import net.kyori.adventure.text.Component; import org.apache.commons.lang3.StringUtils; import org.bukkit.command.CommandSender; @@ -12,6 +11,8 @@ 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 = "/ [purge]") @CommandPermissions(level = Rank.ADMIN, permission = "plex.tfmextras.banlist") public class BanListCommand extends PlexCommand diff --git a/src/main/java/dev/plex/command/CartSitCommand.java b/src/main/java/dev/plex/command/CartSitCommand.java index d912f59..a1f26a5 100755 --- a/src/main/java/dev/plex/command/CartSitCommand.java +++ b/src/main/java/dev/plex/command/CartSitCommand.java @@ -4,9 +4,6 @@ import dev.plex.Plex; import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; import dev.plex.rank.enums.Rank; -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; @@ -17,6 +14,10 @@ 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(level = Rank.NONOP, permission = "plex.tfmextras.cartsit") public class CartSitCommand extends PlexCommand diff --git a/src/main/java/dev/plex/command/CloudClearCommand.java b/src/main/java/dev/plex/command/CloudClearCommand.java index 9644927..40f4f33 100755 --- a/src/main/java/dev/plex/command/CloudClearCommand.java +++ b/src/main/java/dev/plex/command/CloudClearCommand.java @@ -4,8 +4,6 @@ import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; import dev.plex.rank.enums.Rank; 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; @@ -16,6 +14,9 @@ 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(level = Rank.ADMIN, permission = "plex.tfmextras.cloudclear") public class CloudClearCommand extends PlexCommand diff --git a/src/main/java/dev/plex/command/EjectCommand.java b/src/main/java/dev/plex/command/EjectCommand.java index a86601b..6940441 100755 --- a/src/main/java/dev/plex/command/EjectCommand.java +++ b/src/main/java/dev/plex/command/EjectCommand.java @@ -1,6 +1,5 @@ package dev.plex.command; -import dev.plex.TFMExtras; import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.source.RequiredCommandSource; @@ -12,13 +11,13 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.List; - @CommandParameters(name = "eject", description = "Removes all passengers from a player") @CommandPermissions(level = Rank.OP, permission = "plex.tfmextras.eject", source = RequiredCommandSource.IN_GAME) -public class EjectCommand extends PlexCommand { +public class EjectCommand extends PlexCommand +{ @Override - protected Component execute(@NotNull CommandSender sender, @Nullable Player player, @NotNull String[] args) { + protected Component execute(@NotNull CommandSender sender, @Nullable Player player, @NotNull String[] args) + { final int passengers = player.getPassengers().size(); player.eject(); return MiniMessage.miniMessage().deserialize("Ejected " + passengers + " passengers."); diff --git a/src/main/java/dev/plex/command/EnchantCommand.java b/src/main/java/dev/plex/command/EnchantCommand.java index 9165cd5..ddd6f1e 100755 --- a/src/main/java/dev/plex/command/EnchantCommand.java +++ b/src/main/java/dev/plex/command/EnchantCommand.java @@ -22,9 +22,11 @@ import java.util.List; @CommandParameters(name = "enchant", description = "Enchants an item", usage = "/ ", aliases = "enchantment") @CommandPermissions(level = Rank.OP, permission = "plex.tfmextras.enchant", source = RequiredCommandSource.IN_GAME) -public class EnchantCommand extends PlexCommand { +public class EnchantCommand extends PlexCommand +{ @Override - protected Component execute(@NotNull CommandSender sender, @Nullable Player player, @NotNull String[] args) { + protected Component execute(@NotNull CommandSender sender, @Nullable Player player, @NotNull String[] args) + { if (args.length == 0) { return usage(); @@ -58,13 +60,15 @@ public class EnchantCommand extends PlexCommand { return null; } - private List getEnchantments(ItemStack item) { + private List getEnchantments(ItemStack item) + { List enchants = Lists.newArrayList(); Arrays.stream(Enchantment.values()).filter(enchantment -> enchantment.canEnchantItem(item)).forEach(enchants::add); return enchants; } - private String[] getEnchantmentNames(ItemStack item) { + private String[] getEnchantmentNames(ItemStack item) + { return getEnchantments(item).stream().map(enchantment -> enchantment.key().value()).toArray(String[]::new); } } diff --git a/src/main/java/dev/plex/command/JumpPadsCommand.java b/src/main/java/dev/plex/command/JumpPadsCommand.java index e9e38e3..29a615c 100755 --- a/src/main/java/dev/plex/command/JumpPadsCommand.java +++ b/src/main/java/dev/plex/command/JumpPadsCommand.java @@ -8,9 +8,6 @@ import dev.plex.jumppads.JumpPads; import dev.plex.jumppads.Mode; import dev.plex.rank.enums.Rank; 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; @@ -20,7 +17,11 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -@CommandParameters(name = "jumppads", usage = "/jumppads [player]", description = "Enables jump pads for yourself or another player. Mode types available: none, regular, enhanced, extreme, ultimate", aliases = "jp, pads, launchpads") +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +@CommandParameters(name = "jumppads", usage = "/jumppads [player]", description = "Enables jump pads for yourself or another player. Mode types available: none, regular, enhanced, extreme, ultimate", aliases = "jp,pads,launchpads") @CommandPermissions(level = Rank.OP, permission = "plex.tfmextras.jumppads", source = RequiredCommandSource.ANY) public class JumpPadsCommand extends PlexCommand { diff --git a/src/main/java/dev/plex/command/RandomFishCommand.java b/src/main/java/dev/plex/command/RandomFishCommand.java index bf22e98..8ac9e7f 100755 --- a/src/main/java/dev/plex/command/RandomFishCommand.java +++ b/src/main/java/dev/plex/command/RandomFishCommand.java @@ -4,9 +4,6 @@ import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.source.RequiredCommandSource; import dev.plex.rank.enums.Rank; -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; @@ -16,6 +13,10 @@ 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(level = Rank.OP, permission = "plex.tfmextras.randomfish", source = RequiredCommandSource.IN_GAME) public class RandomFishCommand extends PlexCommand diff --git a/src/main/java/dev/plex/jumppads/JumpPads.java b/src/main/java/dev/plex/jumppads/JumpPads.java index 37d2066..f36012e 100755 --- a/src/main/java/dev/plex/jumppads/JumpPads.java +++ b/src/main/java/dev/plex/jumppads/JumpPads.java @@ -1,11 +1,6 @@ package dev.plex.jumppads; import dev.plex.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; @@ -13,6 +8,11 @@ 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 playerModeMap = new HashMap<>(); diff --git a/src/main/java/dev/plex/listener/JumpPadsListener.java b/src/main/java/dev/plex/listener/JumpPadsListener.java index 9d9d84a..f5c6e2e 100755 --- a/src/main/java/dev/plex/listener/JumpPadsListener.java +++ b/src/main/java/dev/plex/listener/JumpPadsListener.java @@ -59,7 +59,9 @@ 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()))) + { return; + } if (w.y() == -1) { playerVector.add(new Vector(0.0, jumpPads.SCALAR * jumpPads.STRENGTH, 0.0)); diff --git a/src/main/resources/module.yml b/src/main/resources/module.yml index 058d8ca..cb7e2e3 100755 --- a/src/main/resources/module.yml +++ b/src/main/resources/module.yml @@ -1,4 +1,4 @@ name: Module-TFMExtras main: dev.plex.TFMExtras description: TFM extras for Plex -version: 1.2-SNAPSHOT \ No newline at end of file +version: 1.3-SNAPSHOT \ No newline at end of file diff --git a/src/main/resources/tfmextras/config.yml b/src/main/resources/tfmextras/config.yml index aedbb4d..bf4284c 100755 --- a/src/main/resources/tfmextras/config.yml +++ b/src/main/resources/tfmextras/config.yml @@ -1,4 +1,4 @@ - # TFM Extras Configuration File # +# TFM Extras Configuration File # server: # The strength of the Jump Pads. Must be a positive whole number. Not recommended being greater than 10.