mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-22 17:18:37 +01:00
[trunk] Bukkit-Bug: http://leaky.bukkit.org/issues/668
changed getData().getData() to getDurability() git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1218 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
parent
201ffa4770
commit
4c245dd25b
@ -170,7 +170,8 @@ public class EssentialsConf extends Configuration
|
||||
map.put("type", stack.getType().toString());
|
||||
map.put("amount", stack.getAmount());
|
||||
map.put("damage", stack.getDurability());
|
||||
map.put("data", stack.getData().getData());
|
||||
// getData().getData() is broken
|
||||
map.put("data", stack.getDurability());
|
||||
setProperty(path, map);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,10 @@ public class Worth implements IConf
|
||||
|
||||
public double getPrice(ItemStack itemStack)
|
||||
{
|
||||
double result = config.getDouble("worth."+itemStack.getType().toString().toLowerCase().replace("_", "")+"."+itemStack.getData().getData(), Double.NaN);
|
||||
double result = config.getDouble("worth."+itemStack.getType().toString().toLowerCase().replace("_", "")+"."+itemStack.getDurability(), Double.NaN);
|
||||
if (Double.isNaN(result)) {
|
||||
result = config.getDouble("worth."+itemStack.getType().toString().toLowerCase().replace("_", "")+".0", Double.NaN);
|
||||
}
|
||||
if (Double.isNaN(result)) {
|
||||
result = config.getDouble("worth."+itemStack.getType().toString().toLowerCase().replace("_", ""), Double.NaN);
|
||||
}
|
||||
@ -34,7 +37,9 @@ public class Worth implements IConf
|
||||
if (itemStack.getType().getData() == null) {
|
||||
config.setProperty("worth." + itemStack.getType().toString().toLowerCase().replace("_", ""), price);
|
||||
} else {
|
||||
config.setProperty("worth." + itemStack.getType().toString().toLowerCase().replace("_", "")+"."+itemStack.getData().getData(), price);
|
||||
// Bukkit-bug: getDurability still contains the correct value, while getData().getData() is 0.
|
||||
itemStack.getData();
|
||||
config.setProperty("worth." + itemStack.getType().toString().toLowerCase().replace("_", "")+"."+itemStack.getDurability(), price);
|
||||
}
|
||||
config.removeProperty("worth-"+itemStack.getTypeId());
|
||||
config.save();
|
||||
|
Loading…
Reference in New Issue
Block a user