Skip to content

Commit

Permalink
Add override for copy back metadata function
Browse files Browse the repository at this point in the history
  • Loading branch information
virustotalop committed Aug 29, 2024
1 parent ad9303f commit f4ec493
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public CopyBackMetadataFunction() {
@Override
public boolean function(PlayerWrapper<?> playerWrapper) {
Gui gui = null;
String data = this.getData();
FunctionOwner owner = this.getOwner();
if (owner instanceof Slot) {
Slot slot = (Slot) owner;
Expand All @@ -41,10 +42,13 @@ public boolean function(PlayerWrapper<?> playerWrapper) {
gui = (Gui) owner;
}

boolean override = Boolean.parseBoolean(data);

Gui back = gui.getBack();
if (back == null) {
return false;
return override;
}

gui.getMetadata().putAll(back.getMetadata());
return true;
}
Expand Down

0 comments on commit f4ec493

Please sign in to comment.