Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add custom_item_support config file to optionally disable repair/salv…
…age on items with custom models
- Loading branch information
Showing
8 changed files
with
80 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/com/gmail/nossr50/config/CustomItemSupportConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.gmail.nossr50.config; | ||
|
||
import java.io.File; | ||
|
||
public class CustomItemSupportConfig extends BukkitConfig { | ||
public CustomItemSupportConfig(File dataFolder) { | ||
super("custom_item_support.yml", dataFolder); | ||
validate(); | ||
} | ||
|
||
@Override | ||
protected void loadKeys() { | ||
|
||
} | ||
|
||
public boolean isCustomRepairAllowed() { | ||
return config.getBoolean("Custom_Item_Support.Repair.Allow_Repair_On_Items_With_Custom_Model_Data", true); | ||
} | ||
|
||
public boolean isCustomSalvageAllowed() { | ||
return config.getBoolean("Custom_Item_Support.Salvage.Allow_Salvage_On_Items_With_Custom_Model_Data", true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# This is meant to be a general config for allowing mcMMO to allow interaction with custom items. | ||
# In the future, I would like to add configs to be specific about certain custom items. | ||
# For now, support is generalized to whether the custom item has a custom model. | ||
# This is an easy solution to implement for now, but not the most ideal. | ||
Custom_Item_Support: | ||
Repair: | ||
# Turn this off to disable repair on any items with custom model data | ||
Allow_Repair_On_Items_With_Custom_Model_Data: true | ||
Salvage: | ||
# Turn this off to disable salvage on any items with custom model data | ||
Allow_Salvage_On_Items_With_Custom_Model_Data: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters