Compare commits

...

8 Commits
1.4.1 ... 1.4.3

Author SHA1 Message Date
hyperdefined
59d0295b18 permission stuff 2022-08-15 11:51:23 -04:00
hyperdefined
af908f2eb6 Merge pull request #16 from hyperdefined/dependabot/maven/lol.hyper-github-release-api-1.0.4
Bump github-release-api from 1.0.3 to 1.0.4
2022-08-15 11:45:05 -04:00
dependabot[bot]
c86e96e200 Bump github-release-api from 1.0.3 to 1.0.4
Bumps [github-release-api](https://github.com/hyperdefined/GitHubReleaseAPI) from 1.0.3 to 1.0.4.
- [Release notes](https://github.com/hyperdefined/GitHubReleaseAPI/releases)
- [Commits](https://github.com/hyperdefined/GitHubReleaseAPI/compare/1.0.3...1.0.4)

---
updated-dependencies:
- dependency-name: lol.hyper:github-release-api
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-11 13:32:36 +00:00
hyperdefined
8061293810 Merge pull request #15 from hyperdefined/dependabot/maven/net.kyori-adventure-platform-bukkit-4.1.2
Bump adventure-platform-bukkit from 4.1.1 to 4.1.2
2022-08-04 12:25:29 -04:00
dependabot[bot]
656e265006 Bump adventure-platform-bukkit from 4.1.1 to 4.1.2
Bumps [adventure-platform-bukkit](https://github.com/KyoriPowered/adventure-platform) from 4.1.1 to 4.1.2.
- [Release notes](https://github.com/KyoriPowered/adventure-platform/releases)
- [Commits](https://github.com/KyoriPowered/adventure-platform/compare/v4.1.1...v4.1.2)

---
updated-dependencies:
- dependency-name: net.kyori:adventure-platform-bukkit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-04 11:30:53 +00:00
hyperdefined
507813f106 Update pom.xml 2022-06-27 20:22:13 -04:00
hyperdefined
e3e1c6a690 Update pom.xml 2022-06-18 17:09:25 -04:00
hyperdefined
5eebcb9ff4 make sure chests are in the same world
fixes #14
2022-06-18 17:09:12 -04:00
4 changed files with 28 additions and 19 deletions

12
pom.xml
View File

@@ -23,7 +23,7 @@
<groupId>lol.hyper</groupId>
<artifactId>toolstats</artifactId>
<version>1.4.1</version>
<version>1.4.3</version>
<packaging>jar</packaging>
<name>ToolStats</name>
@@ -121,14 +121,8 @@
<dependency>
<groupId>lol.hyper</groupId>
<artifactId>github-release-api</artifactId>
<version>1.0.2</version>
<version>1.0.4</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
@@ -139,7 +133,7 @@
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-platform-bukkit</artifactId>
<version>4.1.1</version>
<version>4.1.2</version>
<scope>compile</scope>
</dependency>
</dependencies>

View File

@@ -48,7 +48,7 @@ public class CommandToolStats implements TabExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
if (!sender.hasPermission("toolstats.use")) {
if (!sender.hasPermission("toolstats.command")) {
audiences.sender(sender).sendMessage(Component.text("You do not have permission for this command.").color(NamedTextColor.RED));
return true;
}
@@ -67,7 +67,15 @@ public class CommandToolStats implements TabExecutor {
return true;
}
case "reset": {
if (!sender.hasPermission("toolstats.reset")) {
audiences.sender(sender).sendMessage(Component.text("You do not have permission for this command.").color(NamedTextColor.RED));
return true;
}
if (args.length == 2 && args[1].equalsIgnoreCase("confirm")) {
if (!sender.hasPermission("toolstats.reset.confirm")) {
audiences.sender(sender).sendMessage(Component.text("You do not have permission for this command.").color(NamedTextColor.RED));
return true;
}
Player player = (Player) sender;
ItemStack heldItem = player.getInventory().getItemInMainHand();
if (heldItem.getType() == Material.AIR) {

View File

@@ -65,11 +65,13 @@ public class GenerateLoot implements Listener {
// if the distance is less than 1, it's the same chest
for (Block chest : toolStats.playerInteract.openedChests.keySet()) {
Location chestLocation = chest.getLocation();
if (chest.getWorld() == lootLocation.getWorld()) {
double distance = lootLocation.distance(chestLocation);
if (distance <= 1.0) {
openedChest = chest;
}
}
}
// ignore if the chest is not in the same location
if (openedChest == null) {
return;

View File

@@ -7,12 +7,17 @@ description: Track various tool stats!
commands:
toolstats:
usage: /toolstats
description: Main command.
permission: toolstats.main
permission: toolstats.command
permissions:
toolstats.main:
description: Allows the usage of /toolstats
toolstats.command:
description: Allows the usage of /toolstats.
default: true
toolstats.reload:
description: Allows the usage of /toolstats reload
description: Allows the usage of /toolstats reload.
default: op
toolstats.reset:
description: Allows the usage of /toolstats reset.
default: true
toolstats.reset.confirm:
description: Allows the usage of /toolstats reset confirm.
default: true