Possibility to hide warning using suppressMetadataErrors fixes #14

This commit is contained in:
Matsv 2017-07-04 21:12:09 +02:00
parent a5aa9e7281
commit ea2f603cf7
No known key found for this signature in database
GPG Key ID: 97CEC2A2EA31350F

View File

@ -101,7 +101,8 @@ public abstract class EntityRewriter<T extends BackwardsProtocol> extends Rewrit
protected MetaStorage handleMeta(UserConnection user, int entityId, MetaStorage storage) throws Exception {
Optional<EntityTracker.StoredEntity> optEntity = getEntityTracker(user).getEntity(entityId);
if (!optEntity.isPresent()) {
ViaBackwards.getPlatform().getLogger().warning("Metadata for entity id: " + entityId + " not sent because the entity doesn't exist. " + storage);
if (!Via.getConfig().isSuppressMetadataErrors())
ViaBackwards.getPlatform().getLogger().warning("Metadata for entity id: " + entityId + " not sent because the entity doesn't exist. " + storage);
throw new CancelException();
}