mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-22 10:05:12 +01:00
Check for suppress conversion warnings option in ComponentUtil functions
This commit is contained in:
parent
c242456c30
commit
94b26a903c
@ -60,7 +60,9 @@ public final class ComponentUtil {
|
|||||||
final ATextComponent component = SerializerVersion.V1_20_3.toComponent(tag);
|
final ATextComponent component = SerializerVersion.V1_20_3.toComponent(tag);
|
||||||
return component != null ? SerializerVersion.V1_19_4.toJson(component) : null;
|
return component != null ? SerializerVersion.V1_19_4.toJson(component) : null;
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
Via.getPlatform().getLogger().log(Level.SEVERE, "Error converting tag: " + tag, e);
|
if (!Via.getConfig().isSuppressConversionWarnings()) {
|
||||||
|
Via.getPlatform().getLogger().log(Level.SEVERE, "Error converting tag: " + tag, e);
|
||||||
|
}
|
||||||
return plainToJson("<error>");
|
return plainToJson("<error>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -74,7 +76,9 @@ public final class ComponentUtil {
|
|||||||
final ATextComponent component = SerializerVersion.V1_19_4.toComponent(element);
|
final ATextComponent component = SerializerVersion.V1_19_4.toComponent(element);
|
||||||
return trimStrings(SerializerVersion.V1_20_3.toTag(component));
|
return trimStrings(SerializerVersion.V1_20_3.toTag(component));
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
Via.getPlatform().getLogger().log(Level.SEVERE, "Error converting component: " + element, e);
|
if (!Via.getConfig().isSuppressConversionWarnings()) {
|
||||||
|
Via.getPlatform().getLogger().log(Level.SEVERE, "Error converting component: " + element, e);
|
||||||
|
}
|
||||||
return new StringTag("<error>");
|
return new StringTag("<error>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -101,7 +105,9 @@ public final class ComponentUtil {
|
|||||||
final ATextComponent component = SerializerVersion.V1_20_5.toComponent(tag);
|
final ATextComponent component = SerializerVersion.V1_20_5.toComponent(tag);
|
||||||
return component != null ? SerializerVersion.V1_20_3.toString(component) : null;
|
return component != null ? SerializerVersion.V1_20_3.toString(component) : null;
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
Via.getPlatform().getLogger().log(Level.SEVERE, "Error converting tag: " + tag, e);
|
if (!Via.getConfig().isSuppressConversionWarnings()) {
|
||||||
|
Via.getPlatform().getLogger().log(Level.SEVERE, "Error converting tag: " + tag, e);
|
||||||
|
}
|
||||||
return plainToJson("<error>").toString();
|
return plainToJson("<error>").toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ block-disconnect-msg: "You are using an unsupported Minecraft version!"
|
|||||||
# (We don't suggest using reload either, use a plugin manager)
|
# (We don't suggest using reload either, use a plugin manager)
|
||||||
# You can customize the message we kick people with if you use ProtocolLib here.
|
# You can customize the message we kick people with if you use ProtocolLib here.
|
||||||
reload-disconnect-msg: "Server reload, please rejoin!"
|
reload-disconnect-msg: "Server reload, please rejoin!"
|
||||||
# We warn when there's an error converting item and block data over versions, should we suppress these? (Only suggested if spamming)
|
# We warn when there's an error converting item/block or component/nbt data over versions, should we suppress these? (Only suggested if spamming)
|
||||||
suppress-conversion-warnings: false
|
suppress-conversion-warnings: false
|
||||||
#
|
#
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
Loading…
Reference in New Issue
Block a user