mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-07 08:39:17 +00:00
Fix class cast exception when creating int attributes
This commit is contained in:
@@ -113,7 +113,7 @@ public final class AttributeMap {
|
|||||||
private <T> Attribute<?> createAttribute(T value, AttributeType type) {
|
private <T> Attribute<?> createAttribute(T value, AttributeType type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case LONG:
|
case LONG:
|
||||||
return new NumericalAttribute((Long) value);
|
return new NumericalAttribute(((Number) value).longValue());
|
||||||
case DOUBLE:
|
case DOUBLE:
|
||||||
return new NumericalAttribute((Double) value);
|
return new NumericalAttribute((Double) value);
|
||||||
case STRING:
|
case STRING:
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package org.apollo.game.model.entity.attr;
|
package org.apollo.game.model.entity.attr;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user