mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 07:06:44 +01:00
Trick the compiler
This commit is contained in:
parent
555860cf83
commit
05ce67fbfe
@ -758,10 +758,11 @@ public abstract class PlotPlayer<P> implements CommandCaller, OfflinePlotPlayer
|
|||||||
|
|
||||||
<T> void setPersistentMeta(@Nonnull final MetaDataKey<T> key,
|
<T> void setPersistentMeta(@Nonnull final MetaDataKey<T> key,
|
||||||
@Nonnull final T value) {
|
@Nonnull final T value) {
|
||||||
|
final Object rawValue = value;
|
||||||
if (key.getType().equals(Integer.class)) {
|
if (key.getType().equals(Integer.class)) {
|
||||||
this.setPersistentMeta(key.toString(), Ints.toByteArray((int) value));
|
this.setPersistentMeta(key.toString(), Ints.toByteArray((int) rawValue));
|
||||||
} else if (key.getType().equals(Boolean.class)) {
|
} else if (key.getType().equals(Boolean.class)) {
|
||||||
this.setPersistentMeta(key.toString(), ByteArrayUtilities.booleanToBytes((boolean) value));
|
this.setPersistentMeta(key.toString(), ByteArrayUtilities.booleanToBytes((boolean) rawValue));
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException(String.format("Unknown meta data type '%s'", key.getType().getSimpleName()));
|
throw new IllegalArgumentException(String.format("Unknown meta data type '%s'", key.getType().getSimpleName()));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user