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

View File

@@ -32,7 +32,7 @@ public final class ToolStats extends JavaPlugin {
// stores how much damage armor has 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 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;
import lol.hyper.toolstats.ToolStats;
import org.bukkit.ChatColor;
import org.bukkit.NamespacedKey;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@@ -10,7 +26,6 @@ import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataContainer;
import java.util.*;