Skip to content

Commit

Permalink
Map to new variable
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Dec 7, 2021
1 parent f70cf11 commit 802942d
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,12 @@ public boolean execute(User user, String label, List<String> args) {
}

private void changeBorderTypeTo(User user, String newBorderType) {
BorderType.fromCommandLabel(newBorderType).map(BorderType::getId).ifPresentOrElse(newTypeId -> {
BorderType.fromCommandLabel(newBorderType).map(BorderType::getId).map(MetaDataValue::new)
.ifPresentOrElse(newTypeId -> {
addon.getBorderShower().hideBorder(user);
user.putMetaData(PerPlayerBorderProxy.BORDER_BORDERTYPE_META_DATA, new MetaDataValue(newTypeId));
user.putMetaData(PerPlayerBorderProxy.BORDER_BORDERTYPE_META_DATA, newTypeId);
addon.getBorderShower().showBorder(user.getPlayer(), island);

user.sendMessage("border.set-type.changed",
"[type]", newBorderType);
user.sendMessage("border.set-type.changed", "[type]", newBorderType);
}, () -> addon.logError("Unknown newBorderType " + newBorderType));
}

Expand Down

0 comments on commit 802942d

Please sign in to comment.