mirror of
https://github.com/CodeMC/WorldGuardWrapper.git
synced 2025-01-18 04:02:38 +01:00
Fix wrapping of flag values
This commit is contained in:
parent
bae55e04b8
commit
f3cbae7039
|
@ -106,7 +106,7 @@ public class WorldGuardImplementation implements IWorldGuardImplementation {
|
|||
@Override
|
||||
public <T> Optional<T> queryFlag(Player player, Location location, IWrappedFlag<T> flag) {
|
||||
AbstractWrappedFlag<T> wrappedFlag = (AbstractWrappedFlag<T>) flag;
|
||||
return wrappedFlag.fromWGValue(queryValue(player, location, wrappedFlag.getHandle()));
|
||||
return queryValue(player, location, wrappedFlag.getHandle()).flatMap(value -> wrappedFlag.fromWGValue(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -103,7 +103,7 @@ public class WorldGuardImplementation implements IWorldGuardImplementation {
|
|||
@Override
|
||||
public <T> Optional<T> queryFlag(Player player, Location location, IWrappedFlag<T> flag) {
|
||||
AbstractWrappedFlag<T> wrappedFlag = (AbstractWrappedFlag<T>) flag;
|
||||
return wrappedFlag.fromWGValue(queryValue(player, location, wrappedFlag.getHandle()));
|
||||
return queryValue(player, location, wrappedFlag.getHandle()).flatMap(value -> wrappedFlag.fromWGValue(value));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
|
|
@ -107,7 +107,7 @@ public class WorldGuardImplementation implements IWorldGuardImplementation {
|
|||
@Override
|
||||
public <T> Optional<T> queryFlag(Player player, Location location, IWrappedFlag<T> flag) {
|
||||
AbstractWrappedFlag<T> wrappedFlag = (AbstractWrappedFlag<T>) flag;
|
||||
return wrappedFlag.fromWGValue(queryValue(player, location, wrappedFlag.getHandle()));
|
||||
return queryValue(player, location, wrappedFlag.getHandle()).flatMap(value -> wrappedFlag.fromWGValue(value));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
|
|
@ -112,7 +112,7 @@ public class WorldGuardImplementation implements IWorldGuardImplementation {
|
|||
@Override
|
||||
public <T> Optional<T> queryFlag(Player player, Location location, IWrappedFlag<T> flag) {
|
||||
AbstractWrappedFlag<T> wrappedFlag = (AbstractWrappedFlag<T>) flag;
|
||||
return wrappedFlag.fromWGValue(queryValue(player, location, wrappedFlag.getHandle()));
|
||||
return queryValue(player, location, wrappedFlag.getHandle()).flatMap(value -> wrappedFlag.fromWGValue(value));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
|
Loading…
Reference in New Issue
Block a user