Skip to content

Commit

Permalink
Remove check for @nullable annotation on GameIsland parameter
Browse files Browse the repository at this point in the history
Because `org.jetbrains.annotations` dependency may not be available on runtime. And we don't need to check for it anyway, as we have a replacement for it.
  • Loading branch information
Tofpu committed Aug 23, 2024
1 parent f1fbdeb commit 64f0d90
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@
import io.tofpu.speedbridge2.model.island.object.GameIsland;
import io.tofpu.speedbridge2.model.player.PlayerService;
import io.tofpu.speedbridge2.model.player.object.BridgePlayer;
import org.jetbrains.annotations.Nullable;
import revxrsal.commands.exception.CommandErrorException;
import revxrsal.commands.process.ContextResolver;

import java.lang.reflect.Parameter;
import java.util.Arrays;

import static io.tofpu.speedbridge2.model.common.Message.INSTANCE;

Expand All @@ -26,8 +23,7 @@ public GameIslandContext(final LampContextRegistry registry, final PlayerService
@Override
public GameIsland resolve(final ContextResolver.ContextResolverContext context) {
final BridgePlayer player = playerService.getIfPresent(context.actor().getUniqueId());
Parameter javaParameter = context.parameter().getJavaParameter();
boolean canBeNull = javaParameter.isAnnotationPresent(Nullable.class) || context.parameter().isOptional();
boolean canBeNull = context.parameter().isOptional();

if (player == null && canBeNull) {
return null;
Expand Down

0 comments on commit 64f0d90

Please sign in to comment.