Dynamic ViewDist

Discussion in 'Archived: Plugin Requests' started by teamcraft, Oct 23, 2013.

  1. Offline

    teamcraft

    Plugin category: Mechanics

    Suggested name: Dynamic ViewDist

    What I want: I've been looking for a plugin that changes dynamically the server max view distance accordingly to the number of players online. Something like the obsolete plugin MaxTPS did (it's not working now but you can find it at: http://dev.bukkit.org/bukkit-plugins/maxtps/).

    This way any server from small to large ones can improve their tickrate by reducing chunkload dynamically depending on the number of players online. The "tiers" of view distance vs players can be configured in a file (ex: config.yml)

    config.yml

    - T1
    - Players: 1-20
    - ViewDistance: 10
    - T2
    - Players: 21-30
    - ViewDistance: 9
    - T3
    - Players: 31-40
    - ViewDistance: 8

    ...infinite tiers can be configured.
    Adding more features like automatic tier jumping based on median tickrate regardless number of online players would be great but at least this basics would give server owners more control and more player capacity.

    Ideas for commands: /vdist show (shows the actual view distance and tier)

    Ideas for permissions: vdist.show - Grants access to /vdist show command.

    When I'd like it by: As soon as possible, of course! :p
     
  2. Offline

    Goblom

    Seems easy enough for anyone who wants to update MaxTPS (at it is open source) source
     
  3. Offline

    timtower Administrator Administrator Moderator

  4. Offline

    teamcraft

    It works OK when server starts-up. Then it starts spamming this error:
    Code:
    [SEVERE] Could not pass event ItemSpawnEvent to MaxTPS v1.2.4
    org.bukkit.event.EventException
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
            at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:36)
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462)
            at org.bukkit.craftbukkit.v1_6_R3.event.CraftEventFactory.callItemSpawnEvent(CraftEventFactory.java:267)
            at net.minecraft.server.v1_6_R3.World.addEntity(World.java:925)
            at net.minecraft.server.v1_6_R3.World.addEntity(World.java:895)
            at net.minecraft.server.v1_6_R3.Entity.a(Entity.java:1274)
            at net.minecraft.server.v1_6_R3.Entity.a(Entity.java:1264)
            at net.minecraft.server.v1_6_R3.Entity.b(Entity.java:1260)
            at net.minecraft.server.v1_6_R3.EntityChicken.c(EntityChicken.java:61)
            at net.minecraft.server.v1_6_R3.EntityLiving.l_(EntityLiving.java:1277)
            at net.minecraft.server.v1_6_R3.EntityInsentient.l_(EntityInsentient.java:150)
            at net.minecraft.server.v1_6_R3.World.entityJoinedWorld(World.java:1354)
            at net.minecraft.server.v1_6_R3.World.playerJoinedWorld(World.java:1335)
            at net.minecraft.server.v1_6_R3.World.tickEntities(World.java:1223)
            at net.minecraft.server.v1_6_R3.WorldServer.tickEntities(WorldServer.java:480)
            at net.minecraft.server.v1_6_R3.MinecraftServer.t(MinecraftServer.java:574)
            at net.minecraft.server.v1_6_R3.DedicatedServer.t(DedicatedServer.java:227)
            at net.minecraft.server.v1_6_R3.MinecraftServer.s(MinecraftServer.java:488)
            at net.minecraft.server.v1_6_R3.MinecraftServer.run(MinecraftServer.java:421)
            at net.minecraft.server.v1_6_R3.ThreadServerApplication.run(SourceFile:583)
    Caused by: java.lang.NoClassDefFoundError: net.minecraft.server.EntityItem
            at cz.majncraft.maxtps.MaxTPSListener.class$(MaxTPS.groovy)
            at cz.majncraft.maxtps.MaxTPSListener.$get$$class$net$minecraft$server$EntityItem(MaxTPS.groovy)
            at cz.majncraft.maxtps.MaxTPSListener.onItemSpawn(MaxTPS.groovy:457)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:601)
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425)
            ... 22 more
    
    PS: Sorry for the late reply...I'm kinda overwhelmed with work this days...
    Thanks in advance for your replies!
     
  5. Offline

    timtower Administrator Administrator Moderator

    Late reply isn't a problem ;)
    And I doubt it that that plugin ever worked, loads of missing things etc
     
  6. Offline

    Shevchik

    This plugin uses NMS, so you should update imports and it should work fine
     
  7. Offline

    timtower Administrator Administrator Moderator

    The github isn't even the right one, and for loads of items there aren't even imports
     
  8. Offline

    Shevchik

    You can use fernflower to decompile lates version of plugin.
     
  9. Offline

    timtower Administrator Administrator Moderator

    jd-gui
    Code: http://pastebin.com/NjXW2fRj
    Have fun fixing, loads of bad things in this thing:
    MaxTPS this;
     
  10. Offline

    BillyGalbreath

    teamcraft and timtower like this.
  11. Offline

    teamcraft

    Oh thanks, I had tested this plugin a few months ago and BKCommonLib had a conflict with ProtocolLib so I had to discard the installation of NoLagg, but it seems they fixed it finally (and a few months ago too...shame on me for not checking) and they work together as a charm now.
    +1 for you, sir.
    Consider this thread ended, thank you all.
     
    Minerman01 likes this.

Share This Page