Skip to content

Commit

Permalink
Remove debug console logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofpu committed Apr 17, 2024
1 parent c471660 commit 1e562fd
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,6 @@ 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();
if (!canBeNull) {
System.out.println("list of annotations: " + Arrays.toString(javaParameter.getAnnotations()));
System.out.println("list of annotations types: " + javaParameter.getAnnotatedType());
System.out.println("list of declared annotations: " + Arrays.toString(javaParameter.getDeclaredAnnotations()));
System.out.println("alternative: " + context.command().hasAnnotation(Nullable.class));
System.out.println("alternative: " + context.command().getParameters().stream().anyMatch(commandParameter -> {
boolean result = commandParameter.hasAnnotation(Nullable.class);
if (result) {
System.out.println(commandParameter + " has nullable annotation");
}
return result;
}));
}
// context.parameter().getJavaParameter().
System.out.println(String.format("GameIslandContext: %s can be null? %s", context.actor().getName(), canBeNull));

if (player == null && canBeNull) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public MaterialParser(LampParseRegistry registry) {

@Override
Material parse(ValueResolver.ValueResolverContext context) {
System.out.println("MaterialParser#parse called");
String materialName = context.pop();
try {
return MultiMaterial.getOrThrow(materialName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,49 +54,4 @@ public static Collection<String> materials(MaterialCategory category) {
throw new RuntimeException(String.format("Unknown material category: %s", category));
}
}

// final static class MaterialResolvers {
// static final MaterialResolver BUKKIT_MATERIAL_RESOLVER = new BukkitMaterialResolver();
// static final MaterialResolver XMATERIAL_MATERIAL_RESOLVER = new XMaterialResolver();
// static final MaterialResolver EMPTY_RESOLVER = new EmptyResolver();
// }
//
// static class XMaterialResolver extends MaterialResolver {
// @Override
// Material resolve(String name) {
// return XMaterial.matchXMaterial(name).orElseThrow(() -> new IllegalArgumentException("Unknown material: %s")).parseMaterial();
// }
// }
//
// static class BukkitMaterialResolver extends MaterialResolver {
// @Override
// Material resolve(String name) {
// Material material = Material.matchMaterial(name);
// if (material == null) {
// throwException(name);
// }
// return material;
// }
// }
//
// static class EmptyResolver extends MaterialResolver {
//
// @Override
// Material resolve(String name) {
// throwException(name);
// return null;
// }
// }
//
// abstract static class MaterialResolver {
// abstract Material resolve(String name);
//
// void throwException(String name) throws RuntimeException {
// throw getException(name);
// }
//
// RuntimeException getException(String name) {
// return new IllegalArgumentException("Unknown material: %s");
// }
// }
}

0 comments on commit 1e562fd

Please sign in to comment.