mirror of
https://github.com/hyperdefined/ToolStats.git
synced 2025-12-06 06:41:44 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
72e869d5e2 | ||
|
|
300fe56c5a | ||
|
|
fe5e55d746 | ||
|
|
0574fb61a6 | ||
|
|
433ab547cb |
2
pom.xml
2
pom.xml
@@ -23,7 +23,7 @@
|
||||
|
||||
<groupId>lol.hyper</groupId>
|
||||
<artifactId>toolstats</artifactId>
|
||||
<version>1.6.1</version>
|
||||
<version>1.6.3</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>ToolStats</name>
|
||||
|
||||
@@ -56,7 +56,7 @@ public class ChunkPopulate implements Listener {
|
||||
for (Entity entity : chunk.getEntities()) {
|
||||
// if there is a new item frame
|
||||
if (!(entity instanceof ItemFrame)) {
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
ItemFrame itemFrame = (ItemFrame) entity;
|
||||
// if the item frame has an elytra
|
||||
@@ -64,7 +64,7 @@ public class ChunkPopulate implements Listener {
|
||||
ItemStack elytraCopy = itemFrame.getItem();
|
||||
ItemMeta meta = elytraCopy.getItemMeta();
|
||||
if (meta == null) {
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
// add the new tag so we know it's new
|
||||
PersistentDataContainer container = meta.getPersistentDataContainer();
|
||||
|
||||
@@ -66,20 +66,21 @@ public class VillagerTrade implements Listener {
|
||||
if (event.getSlotType() == InventoryType.SlotType.RESULT) {
|
||||
ItemStack item = event.getCurrentItem();
|
||||
// only check items we want
|
||||
if (ItemChecker.isValidItem(item.getType())) {
|
||||
// if the player shift clicks, show the warning
|
||||
if (event.isShiftClick()) {
|
||||
String configMessage = toolStats.config.getString("messages.shift-click-warning.trading");
|
||||
if (configMessage != null) {
|
||||
event.getWhoClicked().sendMessage(ChatColor.translateAlternateColorCodes('&', configMessage));
|
||||
}
|
||||
}
|
||||
ItemStack newItem = addLore(item, player);
|
||||
if (newItem != null) {
|
||||
// this gets delayed since villager inventories suck for no reason
|
||||
Bukkit.getScheduler().runTaskLater(toolStats, () -> event.setCurrentItem(newItem), 5);
|
||||
if (!ItemChecker.isValidItem(item.getType())) {
|
||||
return;
|
||||
}
|
||||
// if the player shift clicks, show the warning
|
||||
if (event.isShiftClick()) {
|
||||
String configMessage = toolStats.config.getString("messages.shift-click-warning.trading");
|
||||
if (configMessage != null) {
|
||||
player.sendMessage(ChatColor.translateAlternateColorCodes('&', configMessage));
|
||||
}
|
||||
}
|
||||
ItemStack newItem = addLore(item, player);
|
||||
if (newItem != null) {
|
||||
// set the new item
|
||||
inventory.setItem(event.getSlot(), newItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user