Version 1.6.3:

* Fixed case sensitivity for disabled items and professions in config
* Updated version
This commit is contained in:
PretzelJohn 2023-03-20 19:02:43 -04:00
parent b8b14941df
commit 03f8d1b84c
3 changed files with 12 additions and 8 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.pretzel.dev</groupId> <groupId>com.pretzel.dev</groupId>
<artifactId>VillagerTradeLimiter</artifactId> <artifactId>VillagerTradeLimiter</artifactId>
<version>1.6.2</version> <version>1.6.3</version>
<properties> <properties>
<java.version>1.8</java.version> <java.version>1.8</java.version>

View File

@ -4,7 +4,6 @@ import com.pretzel.dev.villagertradelimiter.VillagerTradeLimiter;
import com.pretzel.dev.villagertradelimiter.data.Cooldown; import com.pretzel.dev.villagertradelimiter.data.Cooldown;
import com.pretzel.dev.villagertradelimiter.data.PlayerData; import com.pretzel.dev.villagertradelimiter.data.PlayerData;
import com.pretzel.dev.villagertradelimiter.settings.Settings; import com.pretzel.dev.villagertradelimiter.settings.Settings;
import org.bukkit.entity.Item;
import org.bukkit.entity.Villager; import org.bukkit.entity.Villager;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
@ -45,9 +44,11 @@ public class VillagerListener implements Listener {
//Checks each item if it should be removed from the trade list //Checks each item if it should be removed from the trade list
for(ItemStack item : items) { for(ItemStack item : items) {
if(disabledItems.contains(item.getType().name().toLowerCase())) { for(String disabledItem : disabledItems) {
event.setCancelled(true); if(disabledItem.equalsIgnoreCase(item.getType().name())) {
return; event.setCancelled(true);
return;
}
} }
} }
} }
@ -62,8 +63,11 @@ public class VillagerListener implements Listener {
List<String> disabledProfessions = instance.getCfg().getStringList("DisableProfessions"); List<String> disabledProfessions = instance.getCfg().getStringList("DisableProfessions");
//Changes the new profession to none if disabled in config //Changes the new profession to none if disabled in config
if(disabledProfessions.contains(profession.name().toLowerCase())) { for(String disabledProfession : disabledProfessions) {
event.setProfession(Villager.Profession.NONE); if(disabledProfession.equalsIgnoreCase(profession.name())) {
event.setProfession(Villager.Profession.NONE);
return;
}
} }
} }

View File

@ -1,7 +1,7 @@
name: VillagerTradeLimiter name: VillagerTradeLimiter
author: PretzelJohn author: PretzelJohn
main: com.pretzel.dev.villagertradelimiter.VillagerTradeLimiter main: com.pretzel.dev.villagertradelimiter.VillagerTradeLimiter
version: 1.6.2 version: 1.6.3
api-version: 1.14 api-version: 1.14
commands: commands: