diff --git a/buildSrc/src/main/kotlin/CommonJavaConfig.kt b/buildSrc/src/main/kotlin/CommonJavaConfig.kt index 031b1fd9dc..52a56116ac 100644 --- a/buildSrc/src/main/kotlin/CommonJavaConfig.kt +++ b/buildSrc/src/main/kotlin/CommonJavaConfig.kt @@ -32,7 +32,7 @@ fun Project.applyCommonJavaConfiguration(sourcesJar: Boolean, banSlf4j: Boolean configure { configFile = rootProject.file("config/checkstyle/checkstyle.xml") - toolVersion = "8.34" + toolVersion = "9.1" } tasks.withType().configureEach { diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTag.java b/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTag.java index 247d6eaee8..c4241c36a8 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTag.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTag.java @@ -243,8 +243,8 @@ public ListTag getListTag(String key) { * * @param key the key * @param listType the class of the contained type - * @return a list of tags * @param the type of list + * @return a list of tags */ @SuppressWarnings("unchecked") public List getList(String key, Class listType) { diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/ListTag.java b/worldedit-core/src/main/java/com/sk89q/jnbt/ListTag.java index 15bc76afb7..738017674d 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/ListTag.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/ListTag.java @@ -301,8 +301,8 @@ public ListTag getListTag(int index) { * * @param index the index * @param listType the class of the contained type - * @return a list of tags * @param the NBT type + * @return a list of tags */ @SuppressWarnings("unchecked") public List getList(int index, Class listType) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java index d58e2f9a25..2538fb02e7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java @@ -671,13 +671,14 @@ public Tool getTool(ItemType item) { /** * Get the brush tool assigned to the item. If there is no tool assigned - * or the tool is not assigned, the slot will be replaced with the + * or the tool is not a brush tool, the slot will be replaced with the * brush tool. * * @param item the item type * @return the tool, or {@code null} * @throws InvalidToolBindException if the item can't be bound to that item */ + @Deprecated public BrushTool getBrushTool(ItemType item) throws InvalidToolBindException { Tool tool = getTool(item); @@ -689,6 +690,17 @@ public BrushTool getBrushTool(ItemType item) throws InvalidToolBindException { return (BrushTool) tool; } + /** + * Get the brush tool assigned to this item. + * + * @param item the item type + * @return the brush tool assigned to the item type + */ + @Nullable + public BrushTool getBrush(ItemType item) { + return getTool(item) instanceof BrushTool tool ? tool : null; + } + /** * Set the tool. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockTool.java index 1579bb37ec..a1c17c19cf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockTool.java @@ -36,9 +36,8 @@ public interface BlockTool extends Tool { * Perform the primary action of this tool. * * @return true to cancel the original event which triggered this action (if possible) - * @deprecated New subclasses should override - * {@link #actPrimary(Platform, LocalConfiguration, Player, LocalSession, Location, Direction)} - * instead + * @deprecated New subclasses should override {@link #actPrimary(Platform, LocalConfiguration, Player, LocalSession, + * Location, Direction)} instead */ @Deprecated default boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DoubleActionBlockTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DoubleActionBlockTool.java index 7efca8220d..6b5abdf58d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DoubleActionBlockTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DoubleActionBlockTool.java @@ -39,9 +39,8 @@ public interface DoubleActionBlockTool extends BlockTool { * Perform the secondary action of this block tool. * * @return true to cancel the original event which triggered this action (if possible) - * @deprecated New subclasses must override - * {@link #actSecondary(Platform, LocalConfiguration, Player, LocalSession, Location, Direction)} - * instead + * @deprecated New subclasses must override {@link #actSecondary(Platform, LocalConfiguration, Player, LocalSession, + * Location, Direction)} instead */ @Deprecated default boolean actSecondary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java index 2e66eb3a38..da435da12b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java @@ -284,8 +284,7 @@ default Location getBlockIn() { * @param pos where to move them * @param pitch the pitch (up/down) of the player's view in degrees * @param yaw the yaw (left/right) of the player's view in degrees - * @deprecated This method may fail without indication. Use - * {@link #trySetPosition(Vector3, float, float)} instead + * @deprecated This method may fail without indication. Use {@link #trySetPosition(Vector3, float, float)} instead */ @Deprecated default void setPosition(Vector3 pos, float pitch, float yaw) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/asset/AssetLoaders.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/asset/AssetLoaders.java index 3aedd4ed3b..249a443fd0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/asset/AssetLoaders.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/asset/AssetLoaders.java @@ -132,9 +132,8 @@ public Optional> getAssetLoader(Class assetClass, String f * Get the Asset Loaders for the given type. * * @param assetClass The class to get the loaders of - * @return The list of asset loaders - * * @param The asset type + * @return The list of asset loaders */ @SuppressWarnings("unchecked") public List> getAssetLoaders(Class assetClass) {