various stuff for release

This commit is contained in:
hyperdefined
2022-01-28 21:18:00 -05:00
parent 357e1281ad
commit 6dbce4fd6a
13 changed files with 82 additions and 42 deletions

8
.deepsource.toml Normal file
View File

@@ -0,0 +1,8 @@
version = 1
[[analyzers]]
name = "java"
enabled = true
[analyzers.meta]
runtime_version = "8"

8
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: maven
directory: "/"
schedule:
interval: daily
time: "11:00"
open-pull-requests-limit: 10

24
.github/workflows/maven.yml vendored Normal file
View File

@@ -0,0 +1,24 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Build with Maven
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Maven
run: mvn -B package --file pom.xml

View File

@@ -1,10 +1,26 @@
# ToolStats <h1 align="center">ToolStats</h1>
A simple plugin to track cool stats for your tools and armor! <p align="center">
<img src="https://img.shields.io/badge/Minecraft-1.11--1.18-orange" alt="Minecraft versions">
<img src="https://img.shields.io/github/v/release/hyperdefined/ToolStats" alt="GitHub release (latest by date)">
<a href="https://github.com/hyperdefined/ToolStats/releases"><img src="https://img.shields.io/github/downloads/hyperdefined/ToolStats/total?logo=github" alt="Downloads"></a>
<a href="https://en.cryptobadges.io/donate/1F29aNKQzci3ga5LDcHHawYzFPXvELTFoL"><img src="https://en.cryptobadges.io/badge/micro/1F29aNKQzci3ga5LDcHHawYzFPXvELTFoL" alt="Donate with Bitcoin"></a>
<a href="https://en.cryptobadges.io/donate/0xF3b4e87E4c11f586949ca8740eD33A1e473F924c"><img src="https://en.cryptobadges.io/badge/micro/0xF3b4e87E4c11f586949ca8740eD33A1e473F924c" alt="Donate with Ethereum"></a>
<a href="https://ko-fi.com/hyperdefined"><img src="https://img.shields.io/badge/Donate-Ko--fi-red" alt="Donate via Ko-fi"></a>
<a href="https://www.gnu.org/licenses/gpl-3.0"><img src="https://img.shields.io/badge/License-GPLv3-blue.svg" alt="License: GPL v3"></a>
</p>
## Todo ToolStats is a small plugin that display various stats about tools.
* ~~Track trident throw kills.~~
* ~~Track armor damage.~~ ![Image](https://raw.githubusercontent.com/hyperdefined/ToolStats/master/images/image.png)
* ~~Track fish caught.~~ ![Image](https://raw.githubusercontent.com/hyperdefined/ToolStats/master/images/image2.png)
* ~~Track sheep sheared.~~ ![Image](https://raw.githubusercontent.com/hyperdefined/ToolStats/master/images/image3.png)
* Properly handle combing of tools. Stats should combine together. ![Image](https://raw.githubusercontent.com/hyperdefined/ToolStats/master/images/image4.png)
![Image](https://raw.githubusercontent.com/hyperdefined/ToolStats/master/images/image5.png)
![Image](https://raw.githubusercontent.com/hyperdefined/ToolStats/master/images/image6.png)
## Documentation
Visit the [wiki](https://docs.hyper.lol/toolstats) for help.
## License
This plugin is released under GNU General Public License v3. See [LICENSE](https://github.com/hyperdefined/ToolStats/blob/master/LICENSE).

BIN
images/image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
images/image2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
images/image3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
images/image4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
images/image5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
images/image6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -32,7 +32,7 @@ public final class ToolStats extends JavaPlugin {
// stores how much damage armor has taken // stores how much damage armor has taken
public final NamespacedKey armorDamage = new NamespacedKey(this, "damage-taken"); public final NamespacedKey armorDamage = new NamespacedKey(this, "damage-taken");
public Set<NamespacedKey> keys = new HashSet<>(); public final Set<NamespacedKey> keys = new HashSet<>();
public BlocksMined blocksMined; public BlocksMined blocksMined;
public CraftItem craftItem; public CraftItem craftItem;

View File

@@ -1,31 +0,0 @@
package lol.hyper.toolstats.events;
import lol.hyper.toolstats.ToolStats;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.PrepareAnvilEvent;
import org.bukkit.inventory.AnvilInventory;
import org.bukkit.inventory.ItemStack;
public class AnvilCombine implements Listener {
private final ToolStats toolStats;
public AnvilCombine(ToolStats toolStats) {
this.toolStats = toolStats;
}
@EventHandler
public void onCombine(PrepareAnvilEvent event) {
AnvilInventory inventory = event.getInventory();
ItemStack firstSlot = inventory.getItem(0);
ItemStack secondSlot = inventory.getItem(1);
if (firstSlot == null || secondSlot == null) {
return;
}
if (firstSlot.getType() == secondSlot.getType()) {
// combine the tool stats
}
}
}

View File

@@ -1,8 +1,24 @@
/*
* This file is part of ToolStats.
*
* ToolStats is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ToolStats is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ToolStats. If not, see <https://www.gnu.org/licenses/>.
*/
package lol.hyper.toolstats.events; package lol.hyper.toolstats.events;
import lol.hyper.toolstats.ToolStats; import lol.hyper.toolstats.ToolStats;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.NamespacedKey;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
@@ -10,7 +26,6 @@ import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataContainer;
import java.util.*; import java.util.*;