Skip to content

Commit

Permalink
Fix timeout when producing skull of player in box, Closes #1075
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Dec 18, 2024
1 parent f1cd2e6 commit 6afdbfa
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

/**
* {@link ITickAction} that is able to cook boxes with spirits.
Expand Down Expand Up @@ -150,8 +152,8 @@ protected ItemStack getCookStack(BlockEntitySpiritFurnace tile) {
protected ItemStack getPlayerSkull(String playerName) {
ItemStack itemStack = new ItemStack(Items.PLAYER_HEAD);
try {
itemStack.set(DataComponents.PROFILE, new ResolvableProfile(SkullBlockEntity.fetchGameProfile(playerName).get().get()));
} catch (InterruptedException | ExecutionException | NullPointerException e) {
itemStack.set(DataComponents.PROFILE, new ResolvableProfile(SkullBlockEntity.fetchGameProfile(playerName).get(1, TimeUnit.SECONDS).get()));
} catch (InterruptedException | ExecutionException | NullPointerException | TimeoutException e) {
e.printStackTrace();
}
return itemStack;
Expand Down

0 comments on commit 6afdbfa

Please sign in to comment.