Add option to disable netherite chestplate drop
- Added option to toggle whether netherite armored elytras are dropped as chestplates or not.
This commit is contained in:
parent
b49f24dae4
commit
a4347e52e2
@ -107,6 +107,8 @@ public class ArmoredElytra extends JavaPlugin implements Listener
|
|||||||
final Listener creationListener = config.craftingInSmithingTable() ?
|
final Listener creationListener = config.craftingInSmithingTable() ?
|
||||||
new SmithingTableHandler(this) : new AnvilHandler(this);
|
new SmithingTableHandler(this) : new AnvilHandler(this);
|
||||||
Bukkit.getPluginManager().registerEvents(creationListener, this);
|
Bukkit.getPluginManager().registerEvents(creationListener, this);
|
||||||
|
|
||||||
|
if (config.dropNetheriteAsChestplate())
|
||||||
Bukkit.getPluginManager().registerEvents(new ItemDropListener(this), this);
|
Bukkit.getPluginManager().registerEvents(new ItemDropListener(this), this);
|
||||||
|
|
||||||
// Log all allowed enchantments.
|
// Log all allowed enchantments.
|
||||||
|
@ -31,6 +31,7 @@ public class ConfigLoader
|
|||||||
private int DIAMONDS_TO_FULL;
|
private int DIAMONDS_TO_FULL;
|
||||||
private int NETHERITE_TO_FULL;
|
private int NETHERITE_TO_FULL;
|
||||||
private boolean noFlightDurability;
|
private boolean noFlightDurability;
|
||||||
|
private boolean dropNetheriteAsChestplate;
|
||||||
private LinkedHashSet<Enchantment> allowedEnchantments;
|
private LinkedHashSet<Enchantment> allowedEnchantments;
|
||||||
private boolean allowMultipleProtectionEnchantments;
|
private boolean allowMultipleProtectionEnchantments;
|
||||||
private boolean craftingInSmithingTable;
|
private boolean craftingInSmithingTable;
|
||||||
@ -77,6 +78,12 @@ public class ConfigLoader
|
|||||||
"If you install additional enchantment plugins, you can add their enchantments as well.",
|
"If you install additional enchantment plugins, you can add their enchantments as well.",
|
||||||
"Just add their 'NamespacedKey'. Ask the enchantment plugin dev for more info if you need it."
|
"Just add their 'NamespacedKey'. Ask the enchantment plugin dev for more info if you need it."
|
||||||
};
|
};
|
||||||
|
String[] dropNetheriteAsChestplateComment =
|
||||||
|
{
|
||||||
|
"Whether to drop Netherite Armored Elytras as netherite chestplates when they are dropped",
|
||||||
|
"This means that they won't burn in lava etc.",
|
||||||
|
"When you pick them up, they will turn into Netherite Armored Elytras again."
|
||||||
|
};
|
||||||
String[] updateComment =
|
String[] updateComment =
|
||||||
{
|
{
|
||||||
"Allow this plugin to check for updates on startup. It will not download new versions on its own!"
|
"Allow this plugin to check for updates on startup. It will not download new versions on its own!"
|
||||||
@ -178,6 +185,8 @@ public class ConfigLoader
|
|||||||
allowMultipleProtectionEnchantments = addNewConfigOption(config, "allowMultipleProtectionEnchantments", false,
|
allowMultipleProtectionEnchantments = addNewConfigOption(config, "allowMultipleProtectionEnchantments", false,
|
||||||
allowMultipleProtectionEnchantmentsComment);
|
allowMultipleProtectionEnchantmentsComment);
|
||||||
allowRenaming = addNewConfigOption(config, "allowRenaming", true, allowRenamingComment);
|
allowRenaming = addNewConfigOption(config, "allowRenaming", true, allowRenamingComment);
|
||||||
|
dropNetheriteAsChestplate = addNewConfigOption(config, "dropNetheriteAsChestplate", true,
|
||||||
|
dropNetheriteAsChestplateComment);
|
||||||
|
|
||||||
checkForUpdates = addNewConfigOption(config, "checkForUpdates", true, updateComment);
|
checkForUpdates = addNewConfigOption(config, "checkForUpdates", true, updateComment);
|
||||||
allowStats = addNewConfigOption(config, "allowStats", true, bStatsComment);
|
allowStats = addNewConfigOption(config, "allowStats", true, bStatsComment);
|
||||||
@ -314,6 +323,11 @@ public class ConfigLoader
|
|||||||
return noFlightDurability;
|
return noFlightDurability;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean dropNetheriteAsChestplate()
|
||||||
|
{
|
||||||
|
return dropNetheriteAsChestplate;
|
||||||
|
}
|
||||||
|
|
||||||
public LinkedHashSet<Enchantment> allowedEnchantments()
|
public LinkedHashSet<Enchantment> allowedEnchantments()
|
||||||
{
|
{
|
||||||
return allowedEnchantments;
|
return allowedEnchantments;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user