mirror of
https://github.com/MilkBowl/Vault.git
synced 2024-12-28 03:48:17 +01:00
fixup mChatSuite support for latest build
This commit is contained in:
parent
d5591c148c
commit
5e4afbaa69
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
name: Vault
|
name: Vault
|
||||||
main: net.milkbowl.vault.Vault
|
main: net.milkbowl.vault.Vault
|
||||||
version: 1.2.11-b${BUILD_NUMBER}
|
version: 1.2.12-b${BUILD_NUMBER}
|
||||||
authors: [cereal, Sleaker, mung3r]
|
authors: [cereal, Sleaker, mung3r]
|
||||||
website: http://dev.bukkit.org/server-mods/vault
|
website: http://dev.bukkit.org/server-mods/vault
|
||||||
load: startup
|
load: startup
|
||||||
|
2
pom.xml
2
pom.xml
@ -3,7 +3,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>net.milkbowl.vault</groupId>
|
<groupId>net.milkbowl.vault</groupId>
|
||||||
<artifactId>Vault</artifactId>
|
<artifactId>Vault</artifactId>
|
||||||
<version>1.2.11-SNAPSHOT</version>
|
<version>1.2.12-SNAPSHOT</version>
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
@ -104,7 +104,7 @@ public class Chat_mChatSuite extends Chat {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPlayerPrefix(String world, String player) {
|
public String getPlayerPrefix(String world, String player) {
|
||||||
return mReader.getRawPrefix(player, world);
|
return mReader.getPrefix(player, InfoType.USER, world);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -114,7 +114,7 @@ public class Chat_mChatSuite extends Chat {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPlayerSuffix(String world, String player) {
|
public String getPlayerSuffix(String world, String player) {
|
||||||
return mReader.getRawSuffix(player, world);
|
return mReader.getSuffix(player, InfoType.USER, world);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -124,22 +124,22 @@ public class Chat_mChatSuite extends Chat {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getGroupPrefix(String world, String group) {
|
public String getGroupPrefix(String world, String group) {
|
||||||
throw new UnsupportedOperationException("mChat does not support group info nodes");
|
return mReader.getPrefix(group, InfoType.GROUP, world);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setGroupPrefix(String world, String group, String prefix) {
|
public void setGroupPrefix(String world, String group, String prefix) {
|
||||||
throw new UnsupportedOperationException("mChat does not support group info nodes");
|
setGroupInfoValue(world, group, "prefix", prefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getGroupSuffix(String world, String group) {
|
public String getGroupSuffix(String world, String group) {
|
||||||
throw new UnsupportedOperationException("mChat does not support group info nodes");
|
return mReader.getSuffix(group, InfoType.GROUP, world);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setGroupSuffix(String world, String group, String suffix) {
|
public void setGroupSuffix(String world, String group, String suffix) {
|
||||||
throw new UnsupportedOperationException("mChat does not support group info nodes");
|
setGroupInfoValue(world, group, "suffix", suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -162,12 +162,20 @@ public class Chat_mChatSuite extends Chat {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getGroupInfoInteger(String world, String group, String node, int defaultValue) {
|
public int getGroupInfoInteger(String world, String group, String node, int defaultValue) {
|
||||||
throw new UnsupportedOperationException("mChat does not support group info nodes");
|
String val = getGroupInfoValue(world, group, node);
|
||||||
|
if (val == null || val.equals("")) {
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return Integer.parseInt(val);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setGroupInfoInteger(String world, String group, String node, int value) {
|
public void setGroupInfoInteger(String world, String group, String node, int value) {
|
||||||
throw new UnsupportedOperationException("mChat does not support group info nodes");
|
setGroupInfoValue(world, group, node, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -190,12 +198,20 @@ public class Chat_mChatSuite extends Chat {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double getGroupInfoDouble(String world, String group, String node,double defaultValue) {
|
public double getGroupInfoDouble(String world, String group, String node,double defaultValue) {
|
||||||
throw new UnsupportedOperationException("mChat does not support group info nodes");
|
String val = getGroupInfoValue(world, group, node);
|
||||||
|
if (val == null || val.equals("")) {
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return Double.parseDouble(val);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setGroupInfoDouble(String world, String group, String node, double value) {
|
public void setGroupInfoDouble(String world, String group, String node, double value) {
|
||||||
throw new UnsupportedOperationException("mChat does not support group info nodes");
|
setGroupInfoValue(world, group, node, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -204,11 +220,7 @@ public class Chat_mChatSuite extends Chat {
|
|||||||
if (val == null || val.equals("")) {
|
if (val == null || val.equals("")) {
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
}
|
}
|
||||||
try {
|
return Boolean.parseBoolean(val);
|
||||||
return Boolean.parseBoolean(val);
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
return defaultValue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -218,17 +230,26 @@ public class Chat_mChatSuite extends Chat {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean getGroupInfoBoolean(String world, String group, String node, boolean defaultValue) {
|
public boolean getGroupInfoBoolean(String world, String group, String node, boolean defaultValue) {
|
||||||
throw new UnsupportedOperationException("mChat does not support group info nodes");
|
String val = getGroupInfoValue(world, group, node);
|
||||||
|
if (val == null || val.equals("")) {
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
return Boolean.valueOf(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setGroupInfoBoolean(String world, String group, String node, boolean value) {
|
public void setGroupInfoBoolean(String world, String group, String node, boolean value) {
|
||||||
throw new UnsupportedOperationException("mChat does not support group info nodes");
|
setGroupInfoValue(world, group, node, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPlayerInfoString(String world, String player, String node, String defaultValue) {
|
public String getPlayerInfoString(String world, String player, String node, String defaultValue) {
|
||||||
return getPlayerInfoValue(world, player, node);
|
String val = getPlayerInfoValue(world, player, node);
|
||||||
|
if (val == null) {
|
||||||
|
return defaultValue;
|
||||||
|
} else {
|
||||||
|
return val;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -238,12 +259,17 @@ public class Chat_mChatSuite extends Chat {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getGroupInfoString(String world, String group, String node, String defaultValue) {
|
public String getGroupInfoString(String world, String group, String node, String defaultValue) {
|
||||||
throw new UnsupportedOperationException("mChat does not support group info nodes");
|
String val = getGroupInfoValue(world, group, node);
|
||||||
|
if (val == null) {
|
||||||
|
return defaultValue;
|
||||||
|
} else {
|
||||||
|
return val;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setGroupInfoString(String world, String group, String node, String value) {
|
public void setGroupInfoString(String world, String group, String node, String value) {
|
||||||
throw new UnsupportedOperationException("mChat does not support group info nodes");
|
setGroupInfoValue(world, group, node, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setPlayerInfoValue(String world, String player, String node, Object value) {
|
private void setPlayerInfoValue(String world, String player, String node, Object value) {
|
||||||
@ -254,7 +280,18 @@ public class Chat_mChatSuite extends Chat {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setGroupInfoValue(String world, String group, String node, Object value) {
|
||||||
|
if (world != null) {
|
||||||
|
mWriter.setWorldVar(group, InfoType.GROUP, world, node, value);
|
||||||
|
} else {
|
||||||
|
mWriter.setInfoVar(group, InfoType.GROUP, node, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
private String getPlayerInfoValue(String world, String player, String node) {
|
private String getPlayerInfoValue(String world, String player, String node) {
|
||||||
return mReader.getRawInfo(player, world, node);
|
return mReader.getInfo(player, InfoType.USER, world, node);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getGroupInfoValue(String world, String group, String node) {
|
||||||
|
return mReader.getInfo(group, InfoType.GROUP, world, node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user