forked from Limework/RediSkript
Fix Integer & Update deps
This commit is contained in:
parent
70456455e3
commit
cd039aeeaf
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>RediSkript</artifactId>
|
||||
<groupId>net.limework</groupId>
|
||||
<version>1.3.6-SNAPSHOT</version>
|
||||
<version>1.3.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -179,8 +179,12 @@ public class RedisController extends BinaryJedisPubSub implements Runnable {
|
||||
if (variable == null) {
|
||||
Variables.setVariable(varName, inputValue, null, false);
|
||||
} else if (variable instanceof Long) {
|
||||
if (inputValue instanceof Integer) {
|
||||
inputValue = Long.valueOf((Integer) inputValue);
|
||||
}
|
||||
if (inputValue instanceof Long) {
|
||||
Variables.setVariable(varName, (Long) variable + (Long) inputValue, null, false);
|
||||
|
||||
} else if (inputValue instanceof Double) {
|
||||
|
||||
// convert Long variable to Double
|
||||
@ -192,6 +196,9 @@ public class RedisController extends BinaryJedisPubSub implements Runnable {
|
||||
continue;
|
||||
}
|
||||
} else if (variable instanceof Double) {
|
||||
if (inputValue instanceof Integer) {
|
||||
inputValue = Double.valueOf((Integer) inputValue);
|
||||
}
|
||||
if (inputValue instanceof Double) {
|
||||
Variables.setVariable(varName, (Double) variable + (Double) inputValue, null, false);
|
||||
} else if (inputValue instanceof Long) {
|
||||
@ -201,6 +208,18 @@ public class RedisController extends BinaryJedisPubSub implements Runnable {
|
||||
plugin.getLogger().log(Level.WARNING, "Unsupported add action of data type (" + inputValue.getClass().getName() + ") on variable: " + varName);
|
||||
continue;
|
||||
}
|
||||
} else if (variable instanceof Integer) {
|
||||
if (inputValue instanceof Integer) {
|
||||
Variables.setVariable(varName, (Integer) variable + (Integer) inputValue, null, false);
|
||||
} else if (inputValue instanceof Double) {
|
||||
// convert Integer variable to Double
|
||||
variable = Double.valueOf((Integer) variable);
|
||||
Variables.setVariable(varName, (Double) variable + (Double) inputValue, null, false);
|
||||
} else if (inputValue instanceof Long) {
|
||||
// convert Integer variable to Long
|
||||
variable = Long.valueOf((Integer) variable);
|
||||
Variables.setVariable(varName, (Long) variable + (Long) inputValue, null, false);
|
||||
}
|
||||
} else {
|
||||
// Not supported input type
|
||||
plugin.getLogger().log(Level.WARNING, "Unsupported variable type in add action (" + variable.getClass().getName() + ") on variable: " + varName);
|
||||
@ -218,12 +237,17 @@ public class RedisController extends BinaryJedisPubSub implements Runnable {
|
||||
Variables.setVariable(varName, -(Long) inputValue, null, false);
|
||||
} else if (inputValue instanceof Double) {
|
||||
Variables.setVariable(varName, -(Double) inputValue, null, false);
|
||||
} else if (inputValue instanceof Integer) {
|
||||
Variables.setVariable(varName, -(Integer) inputValue, null, false);
|
||||
} else {
|
||||
// Not supported input type
|
||||
plugin.getLogger().log(Level.WARNING, "Unsupported remove action of data type (" + inputValue.getClass().getName() + ") on variable: " + varName);
|
||||
continue;
|
||||
}
|
||||
} else if (variable instanceof Long) {
|
||||
if (inputValue instanceof Integer) {
|
||||
inputValue = Long.valueOf((Integer) inputValue);
|
||||
}
|
||||
if (inputValue instanceof Long) {
|
||||
Variables.setVariable(varName, (Long) variable - (Long) inputValue, null, false);
|
||||
} else if (inputValue instanceof Double) {
|
||||
@ -237,11 +261,26 @@ public class RedisController extends BinaryJedisPubSub implements Runnable {
|
||||
continue;
|
||||
}
|
||||
} else if (variable instanceof Double) {
|
||||
if (inputValue instanceof Integer) {
|
||||
inputValue = Double.valueOf((Integer) inputValue);
|
||||
}
|
||||
if (inputValue instanceof Double) {
|
||||
Variables.setVariable(varName, (Double) variable - (Double) inputValue, null, false);
|
||||
} else if (inputValue instanceof Long) {
|
||||
Variables.setVariable(varName, (Double) variable - ((Long) inputValue).doubleValue(), null, false);
|
||||
}
|
||||
} else if (variable instanceof Integer) {
|
||||
if (inputValue instanceof Integer) {
|
||||
Variables.setVariable(varName, (Integer) variable - (Integer) inputValue, null, false);
|
||||
} else if (inputValue instanceof Long) {
|
||||
// convert Integer variable to Long
|
||||
variable = Long.valueOf((Integer) variable);
|
||||
Variables.setVariable(varName, (Long) variable - (Long) inputValue, null, false);
|
||||
} else if (inputValue instanceof Double) {
|
||||
// convert Integer variable to Double
|
||||
variable = Double.valueOf((Integer) variable);
|
||||
Variables.setVariable(varName, (Double) variable - (Double) inputValue, null, false);
|
||||
}
|
||||
} else {
|
||||
// Not supported input type
|
||||
plugin.getLogger().log(Level.WARNING, "Unsupported variable type in remove action (" + variable.getClass().getName() + ") on variable: " + varName);
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>RediSkript</artifactId>
|
||||
<groupId>net.limework</groupId>
|
||||
<version>1.3.6-SNAPSHOT</version>
|
||||
<version>1.3.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
6
pom.xml
6
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>net.limework</groupId>
|
||||
<artifactId>RediSkript</artifactId>
|
||||
<version>1.3.6-SNAPSHOT</version>
|
||||
<version>1.3.7-SNAPSHOT</version>
|
||||
<modules>
|
||||
<module>RediSkript-core</module>
|
||||
<module>RediSkript-bukkit</module>
|
||||
@ -48,7 +48,7 @@
|
||||
<dependency>
|
||||
<groupId>org.cryptomator</groupId>
|
||||
<artifactId>siv-mode</artifactId>
|
||||
<version>1.4.4</version>
|
||||
<version>1.5.0</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-pool2 -->
|
||||
<dependency>
|
||||
@ -59,7 +59,7 @@
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
<version>4.2.2</version>
|
||||
<version>4.4.6</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
Loading…
Reference in New Issue
Block a user