froobynooby / ViewDistanceTweaks

Paper plugin that allows for dynamic simulation and view distances.
https://ci.froobworld.com/job/ViewDistanceTweaks/
MIT License
89 stars 17 forks source link

Doesn't work on Paper 1.16.4 #8

Closed XANT3R closed 3 years ago

XANT3R commented 3 years ago

Plugins not working on Paper 1.16.4 (Paper 288)

My bug:

[01:31:02] [Server thread/INFO]: [ViewDistanceTweaks] Enabling ViewDistanceTweaks v1.3.0
[01:31:02] [Server thread/ERROR]: Error occurred while enabling ViewDistanceTweaks v1.3.0 (Is it up to date?)
java.lang.ExceptionInInitializerError: null
    at com.froobworld.viewdistancetweaks.lib.nabconfiguration.patcher.ConfigPatch.patchFile(ConfigPatch.java:18) ~[?:?]
    at com.froobworld.viewdistancetweaks.lib.nabconfiguration.NabConfiguration.init(NabConfiguration.java:48) ~[?:?]
    at com.froobworld.viewdistancetweaks.lib.nabconfiguration.NabConfiguration.load(NabConfiguration.java:30) ~[?:?]
    at com.froobworld.viewdistancetweaks.ViewDistanceTweaks.onEnable(ViewDistanceTweaks.java:28) ~[?:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.16.4.jar:git-Paper-288]
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:380) ~[patched_1.16.4.jar:git-Paper-288]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:483) ~[patched_1.16.4.jar:git-Paper-288]
    at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:501) ~[patched_1.16.4.jar:git-Paper-288]
    at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:415) ~[patched_1.16.4.jar:git-Paper-288]
    at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:468) ~[patched_1.16.4.jar:git-Paper-288]
    at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:239) ~[patched_1.16.4.jar:git-Paper-288]
    at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:940) ~[patched_1.16.4.jar:git-Paper-288]
    at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.4.jar:git-Paper-288]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_191]
Caused by: java.util.regex.PatternSyntaxException: Look-behind group does not have an obvious maximum length near index 27
(?=(?<!(#[^
|
|
]*(
|
|
)))(#[^
|
|
]*(
|
|
))*((?<=\r\n|\r|\n)[a-zA-Z0-9-_][a-zA-Z0-9-_ ]*:))
                           ^
    at java.util.regex.Pattern.error(Pattern.java:1957) ~[?:1.8.0_191]
    at java.util.regex.Pattern.group0(Pattern.java:2865) ~[?:1.8.0_191]
    at java.util.regex.Pattern.sequence(Pattern.java:2053) ~[?:1.8.0_191]
    at java.util.regex.Pattern.expr(Pattern.java:1998) ~[?:1.8.0_191]
    at java.util.regex.Pattern.group0(Pattern.java:2829) ~[?:1.8.0_191]
    at java.util.regex.Pattern.sequence(Pattern.java:2053) ~[?:1.8.0_191]
    at java.util.regex.Pattern.expr(Pattern.java:1998) ~[?:1.8.0_191]
    at java.util.regex.Pattern.compile(Pattern.java:1698) ~[?:1.8.0_191]
    at java.util.regex.Pattern.<init>(Pattern.java:1351) ~[?:1.8.0_191]
    at java.util.regex.Pattern.compile(Pattern.java:1028) ~[?:1.8.0_191]
    at com.froobworld.viewdistancetweaks.lib.nabconfiguration.patcher.structure.parser.YamlFileParser.<clinit>(YamlFileParser.java:16) ~[?:?]
    ... 14 more
[01:31:02] [Server thread/INFO]: [ViewDistanceTweaks] Disabling ViewDistanceTweaks v1.3.0

Config:

# Configuration for View Distance Tweaks.
# Plugin page: https://www.spigotmc.org/resources/75164/
# Github: https://github.com/froobynooby/ViewDistanceTweaks

# Please don't change this!
version: 2

# Set this to true to enable the plugin. The plugin is initially disabled so that you can make changes to the config
# appropriate to your server.
enabled: true

# How should we determine whether the view distance needs adjusting? Accepts three values:
#  * proactive : Adjust the view distance so that the player-loaded chunk count is always below a set threshold.
#  * reactive  : Adjust the view distance in response to changes in the server's TPS.
#  * mixed     : Be both proactive and reactive; prioritising decreasing the view distance over increasing.
adjustment-mode: mixed

# These settings are for the proactive adjustment mode.
proactive-mode-settings:
  # Set this to the maximum chunk count your server can handle. The view distance of each world will be adjusted such
  # that the total number of player-loaded chunks is sitting as close to this value as possible.
  #  * If you know your server can handle up to p many players with a view distance of d, a reasonable choice is to set
  #    this to (2d + 1)^2 * p.
  #  * As an example, 5780 is the number of player-loaded chunks for 20 players with a view distance of 8.
  global-chunk-count-target: 5780

# These settings are for the reactive adjustment mode.
reactive-mode-settings:
  # Above what TPS should we consider increasing the view distance?
  increase-tps-threshold: 19.9

  # Below what TPS should we consider decreasing the view distance?
  decrease-tps-threshold: 18.0

  # These settings concern how we determine the TPS.
  #  * Only touch these settings if you know what you're doing.
  tps-tracker-settings:
    # Over how many ticks should we collect tick durations for calculating the TPS?
    #  * Setting this too high will make the TPS very slow to react to changes.
    #  * Setting this too low will make the TPS volatile.
    collection-period: 1200

    # By how much (in percent) should we allow the tick durations we use to calculate the TPS vary from the average
    # tick duration.
    #  * This is used for smoothing the TPS; making sure it's not heavily affected by sudden large lag spikes, such as
    #    those caused by garbage collections or world-saves.
    #  * Setting this to 0 will mean your TPS will never change - don't do that.
    trim-outliers-to-within: 100.0

  # We keep a history of TPS vs. player-loaded chunk count in order to better predict what the TPS will settle to after
  # increasing the view distance.
  tps-prediction:
    # Should we use TPS prediction when we are considering increasing the view distance?
    #  * For example, we may be at 20 TPS with a view distance of 6, meaning we would consider increasing the view
    #    distance to 7. However, if we saw that 10 minutes ago with a view distance of 7 we had 17 TPS, we would hold
    #    off on increasing.
    #  * Disabling this can lead to a back-and-forth game of increasing and decreasing the view distance every few
    #    minutes - not ideal.
    enabled: true

    # For how long (in minutes) should we keep a TPS / chunk count history?
    history-length: 30

# Every how many ticks should we check whether the view distance needs to be updated?
ticks-per-check: 600

# How many checks in a row that say to increase the view distance should be required before the view distance is
# actually increased?
#  * This is useful as it guards against the following kind of case: A player leaves and the view distance is increased,
#    but the player returns three minutes later and the view distance is lowered to its previous value.
#  * Since increasing the view distance can cause lag-spikes for players with poorer connections, it is recommended to
#    keep this value relatively high.
passed-checks-for-increase: 10

# How many checks in a row that say to decrease the view distance should be required before the view distance is
# actually decreased?
passed-checks-for-decrease: 1

# Should we send a message to the console when we change the view distance?
log-view-distance-changes: true

# These settings can be specified per world. If a world is not specified or if a setting is missing, it will use the
# settings listed under the default section.
world-settings:
  default:
    # What should the absolute minimum view distance be in this world?
    minimum-view-distance: 1

    # What should the absolute maximum view distance be in this world?
    maximum-view-distance: 3

    # Relative to the other worlds, how 'heavy' is a chunk on performance?
    #  * For example: In the End dimension, about half of the chunks you encounter are void and so have very little
    #    impact on performance. For this reason, you may want to set the chunk-weight of the End to 0.5.
    chunk-weight: 1

    # These settings concern how we count the number of chunks in this world.
    chunk-counter-settings:
      # When two players are near each other, their view distances can overlap. Should we not double count the chunks
      # that are overlapping?
      exclude-overlap: true

#  world_the_end:
#    minimum-view-distance: 8
#    maximum-view-distance: 10
#    chunk-weight: 0.5

# These are additional settings that apply if you are using Paper as your server software.
paper-settings:
  # These settings concern the no-tick view distance available in Paper 1.15.2+.
  #  * Note: higher no-tick view distances are less heavy on the server as far as TPS goes. For this reason, there is no
  #    option to adjust no-tick view distance based on TPS.
  no-tick-view-distance:
    # Should we adjust the no-tick view distance?
    enabled: true

    # Set this to the maximum number of chunks you want to be loaded by the no-tick view distance.
    #  * Note: this only counts chunks that are outside of the standard view distance of a player, but within the
    #    no-tick view distance of a player.
    #  * If you know your server can handle up to p many players with a no-tick view distance of n and a standard view
    #    distance of d, a reasonable choice is to set this to ((2n + 1)^2 - (2d + 1)^2) * p.
    #  * As an example, 6720 is the number of chunks loaded by the no-tick view distance for 20 players with a no-tick
    #    view distance of 12, and a standard view distance of 8.
    global-chunk-count-target: 6720

  world-settings:
    default:
      # What should the absolute minimum no-tick view distance be in this world?
      minimum-no-tick-view-distance: 1

      # What should the absolute maximum no-tick view distance be in this world?
      maximum-no-tick-view-distance: 3
froobynooby commented 3 years ago

Thanks for the report. I wasn't getting this error because I'm using Java 11, which it doesn't seem to effect

Should be fixed in version 1.3.1 which I've just uploaded to spigot