forked from Upstream/VillagerTradeLimiter
Version 1.6.3:
* Fixed case sensitivity for disabled items and professions in config * Updated version
This commit is contained in:
parent
b8b14941df
commit
03f8d1b84c
2
pom.xml
2
pom.xml
@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.pretzel.dev</groupId>
|
||||
<artifactId>VillagerTradeLimiter</artifactId>
|
||||
<version>1.6.2</version>
|
||||
<version>1.6.3</version>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
|
@ -4,7 +4,6 @@ import com.pretzel.dev.villagertradelimiter.VillagerTradeLimiter;
|
||||
import com.pretzel.dev.villagertradelimiter.data.Cooldown;
|
||||
import com.pretzel.dev.villagertradelimiter.data.PlayerData;
|
||||
import com.pretzel.dev.villagertradelimiter.settings.Settings;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.Villager;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
@ -45,12 +44,14 @@ public class VillagerListener implements Listener {
|
||||
|
||||
//Checks each item if it should be removed from the trade list
|
||||
for(ItemStack item : items) {
|
||||
if(disabledItems.contains(item.getType().name().toLowerCase())) {
|
||||
for(String disabledItem : disabledItems) {
|
||||
if(disabledItem.equalsIgnoreCase(item.getType().name())) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Handles villager profession change **/
|
||||
@EventHandler
|
||||
@ -62,8 +63,11 @@ public class VillagerListener implements Listener {
|
||||
List<String> disabledProfessions = instance.getCfg().getStringList("DisableProfessions");
|
||||
|
||||
//Changes the new profession to none if disabled in config
|
||||
if(disabledProfessions.contains(profession.name().toLowerCase())) {
|
||||
for(String disabledProfession : disabledProfessions) {
|
||||
if(disabledProfession.equalsIgnoreCase(profession.name())) {
|
||||
event.setProfession(Villager.Profession.NONE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
name: VillagerTradeLimiter
|
||||
author: PretzelJohn
|
||||
main: com.pretzel.dev.villagertradelimiter.VillagerTradeLimiter
|
||||
version: 1.6.2
|
||||
version: 1.6.3
|
||||
api-version: 1.14
|
||||
|
||||
commands:
|
||||
|
Loading…
Reference in New Issue
Block a user