mirror of
https://github.com/CodeMC/WorldGuardWrapper.git
synced 2024-11-10 13:15:19 +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
|
@Override
|
||||||
public <T> Optional<T> queryFlag(Player player, Location location, IWrappedFlag<T> flag) {
|
public <T> Optional<T> queryFlag(Player player, Location location, IWrappedFlag<T> flag) {
|
||||||
AbstractWrappedFlag<T> wrappedFlag = (AbstractWrappedFlag<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
|
@Override
|
||||||
|
|
|
@ -103,7 +103,7 @@ public class WorldGuardImplementation implements IWorldGuardImplementation {
|
||||||
@Override
|
@Override
|
||||||
public <T> Optional<T> queryFlag(Player player, Location location, IWrappedFlag<T> flag) {
|
public <T> Optional<T> queryFlag(Player player, Location location, IWrappedFlag<T> flag) {
|
||||||
AbstractWrappedFlag<T> wrappedFlag = (AbstractWrappedFlag<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")
|
@SuppressWarnings("unchecked")
|
||||||
|
|
|
@ -107,7 +107,7 @@ public class WorldGuardImplementation implements IWorldGuardImplementation {
|
||||||
@Override
|
@Override
|
||||||
public <T> Optional<T> queryFlag(Player player, Location location, IWrappedFlag<T> flag) {
|
public <T> Optional<T> queryFlag(Player player, Location location, IWrappedFlag<T> flag) {
|
||||||
AbstractWrappedFlag<T> wrappedFlag = (AbstractWrappedFlag<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")
|
@SuppressWarnings("unchecked")
|
||||||
|
|
|
@ -112,7 +112,7 @@ public class WorldGuardImplementation implements IWorldGuardImplementation {
|
||||||
@Override
|
@Override
|
||||||
public <T> Optional<T> queryFlag(Player player, Location location, IWrappedFlag<T> flag) {
|
public <T> Optional<T> queryFlag(Player player, Location location, IWrappedFlag<T> flag) {
|
||||||
AbstractWrappedFlag<T> wrappedFlag = (AbstractWrappedFlag<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")
|
@SuppressWarnings("unchecked")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user