Skip to content

Commit

Permalink
1.14.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
mfnalex committed Jun 13, 2021
1 parent c7efee6 commit 6608e49
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.14.0
- Added support for many new 1.17 materials. If some are still missing, please let me know on my Discord or in the discussion.
- Updated ChestSortAPI

## 1.13.0
- Updated ChestSortAPI to version 3.0.0. If you have ChestSort installed, you must use at least ChestSort 10.0.0!

Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<name>BestTools</name>
<!--<url>https://www.chestsort.de</url>-->
<description>Automatically switches to the best tools. Most efficient Auto-Tool plugin!</description>
<version>1.13.0</version>
<version>1.14.0</version>
<packaging>jar</packaging>

<properties>
Expand Down Expand Up @@ -108,19 +108,19 @@
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.10.6</version>
<version>2.10.9</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
<version>1.17-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.jeff_media</groupId>
<artifactId>ChestSortAPI</artifactId>
<version>3.0.0</version> <!-- The API version is independent of the ChestSort version -->
<version>4.0.1</version> <!-- The API version is independent of the ChestSort version -->
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.jeff_media.BestTools;

import de.jeff_media.BestTools.tags.v1_17;
import org.bukkit.Material;
import org.bukkit.Tag;
import org.bukkit.enchantments.Enchantment;
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/de/jeff_media/BestTools/BestToolsUtils.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.jeff_media.BestTools;

import de.jeff_media.BestTools.tags.v1_17;
import org.bukkit.Material;
import org.bukkit.Tag;
import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -120,6 +121,15 @@ public BestToolsUtils(@NotNull Main main) {
}
}

// 1.17+
try {
for(Material mat : v1_17.getPickaxeMaterials()) {
addToMap(mat,Tool.PICKAXE);
}
} catch (Throwable t) {
// 1.17+
}

//uToolMap = Map.copyOf(main.toolHandler.toolMap); // Java 10+ only
}

Expand Down
41 changes: 41 additions & 0 deletions src/main/java/de/jeff_media/BestTools/tags/v1_17.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package de.jeff_media.BestTools.tags;

import org.bukkit.Material;
import org.bukkit.Tag;

import java.util.*;

public class v1_17 {

public static Collection<Material> getPickaxeMaterials() {
//org.bukkit.Tag
Tag<Material> [] tags = new Tag[]{
Tag.STONE_BRICKS, Tag.STONE_PRESSURE_PLATES,
Tag.BASE_STONE_NETHER, Tag.BASE_STONE_OVERWORLD,
Tag.REDSTONE_ORES, Tag.COAL_ORES, Tag.COPPER_ORES,
Tag.DIAMOND_ORES, Tag.EMERALD_ORES, Tag.GOLD_ORES,
Tag.IRON_ORES, Tag.LAPIS_ORES
};

Set<Material> list = new HashSet<>();

for(Tag<Material> tag : tags) {
for(Material mat : Material.values()) {
if(tag.isTagged(mat)) {
list.add(mat);
}
}
}

for(Material mat : Material.values()) {
if(mat.name().toLowerCase(Locale.ROOT).contains("cobbled")) {
list.add(mat);
}
}

return list;


}

}
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
main: de.jeff_media.BestTools.Main
name: BestTools
version: 1.13.0
version: 1.14.0
api-version: "1.13"
description: Automatically chooses the best tool when breaking blocks
author: mfnalex
Expand Down

0 comments on commit 6608e49

Please sign in to comment.