Skip to content

Commit 1ff8b18

Browse files
authored
Reduced log level when the method does not exist (MockBukkit#1529)
* Reduced log level when the method does not exist * fixup! Reduced log level when the method does not exist
1 parent b6b88fc commit 1ff8b18

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/main/java/org/mockbukkit/mockbukkit/entity/EntityTypesMock.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,10 +418,13 @@ else if (bukkitClazz == Player.class)
418418
var myConstructor = bukkitClazz.getDeclaredConstructor(ServerMock.class, UUID.class);
419419
return (EntityMock) myConstructor.newInstance(server, entityUUID);
420420
}
421-
catch (NoSuchMethodException | InstantiationException | IllegalAccessException |
422-
InvocationTargetException e)
421+
catch (NoSuchMethodException e)
423422
{
424-
log.warn("Couldn't find: " + e.getMessage() + " for " + bukkitClazz.getName() + ". Falling back to reflection.", e);
423+
log.debug("Method with signature '{}' does not exist in '{}', falling back to reflection.", e.getMessage(), bukkitClazz.getName());
424+
}
425+
catch (InstantiationException | IllegalAccessException | InvocationTargetException e)
426+
{
427+
log.warn("Couldn't find: {} for {}. Falling back to reflection.", e.getMessage(), bukkitClazz.getName(), e);
425428
}
426429

427430
EntityData<? extends Entity, ? extends EntityMock> data = bukkitToMockData.get(bukkitClazz);

0 commit comments

Comments
 (0)