Redstone Lighting Updating

Discussion in 'Plugin Development' started by YogurtSmudge, Mar 19, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    YogurtSmudge

    Hi, So, I have a server that has some players, but the players are building a lot of redstone clocks and such. I was wondering if there's a way to still update the redstone/redstone wire but not the lighting on it. I have noticed it drops my fps when I look at it. Here is an example of what I mean.
    Show Spoiler
    [​IMG]

    Is there a way where possibly I can still update the redstone but not the lighting? Thanks

    ~YogurtSmudge
     
    Last edited by a moderator: Mar 21, 2016
  2. Offline

    teej107

    @YogurtSmudge It'll be really complicated and hard to do. It'll require using NMS, if not, modding the server code itself. You could also see if there is a client mod to help with this but that pretty much it.
     
  3. Offline

    Zombie_Striker

    @YogurtSmudge
    If your problem is simply with FPS, you need to download a mod. If the problem is that the clocks are slowing your server, you will need to develop something to stop, slowdown or break the redstone clocks.
     
  4. Offline

    mcdorli

    Spam torches around everywhere, that nullifies the problem
     
    Zombie_Striker likes this.
  5. Offline

    Ligachamp

    This actually quite a problem for bigger servers... Is there really no other way to disable this on the server, without changing the code?
     
  6. Offline

    mythbusterma

    @Ligachamp

    The lighting updates are done client side. Unless you mean not changing the torch states at all, and rendering the torches useless, that is possible.
     
  7. Offline

    Ligachamp

    Uhm... AFAIR the server does some calculations on the lightning too, or at least saves some lighting informations. But I could be wrong too, so I would be happy if you could tell me what exactly gets handled by the server (except logic calculations)? :)
     
  8. Offline

    WolfMage1

  9. Offline

    mcdorli

    No, it doesn't not only dayLightCalculatot get their ligjtlevel calculated
     
  10. Offline

    Ligachamp

    How do you mean that?
     
  11. Offline

    mcdorli

    @Ligachamp I was in a hurry, I mesnt only daylightSensors get theit light level calculated
     
  12. Offline

    Ligachamp

    @mcdorli thx, now it's clear to me :)

    Maybe it would be possible to create a plugin, which spams areas containing (large) redstone mechanics with torches/glowstone? That would prevent the lightning updates, as you mentioned before. But it would be hard to find an algorithm to cover the whole area, especially on compact circuits. :/
     
  13. Offline

    mcdorli

    Just spam fake lightningsources around
     
  14. Offline

    Ligachamp

    Didn't know that is even possible :confused:

    Can those also be placed on existing blocks (in this case redstone wires/torches)? I mean on the same x/y/z location of an existing block.
     
  15. Offline

    I Al Istannen

    @Ligachamp

    There was a plugin from the Author of ProtocolLib (forgot the name), which would create the same effect as DynamicLightning. Should be totally possible. I think there are some SkyLightSources you can use, too.

    But apart from that, is it really needed, that the user will see the redstone update? If not could just cancel the outgoing block change packets (or is this done client side), and all the redstone contraptions work as usual, just darker/brighter?
     
  16. Offline

    Ligachamp

    This sounds quite intresting... Maybe I'll have a look at it, when I've got some spare time. If that plugin isn't up to date anymore, I could try to create something similar, as I could immagine there are loads of people looking for such a plugin. (including me)

    You're right, it could also be enough to cancel the lightning events, if thats possible tough?
     
  17. Offline

    mcdorli

    Code:
    [SIZE=16px]Chunk chunk = ((CraftChunk)e.getPlayer().getLocation().getChunk()).getHandle();Location loc = e.getPlayer().getLocation();[/SIZE]
    chunk.a(EnumSkyBlock.BLOCK,loc.getBlockX() & 0xF,loc.getBlockY(),loc.getBlockZ() & 0xF,15);
    
    This sets the light intensity on the set block to 15, you need to update the chunk though

    You could set the light around redstone to 0, so it doesn't get lit up
     
  18. Online

    timtower Administrator Administrator Moderator

    @Ligachamp Could also stop the server from sending redstone block updates in some area's.
    Keeps the redstone working server side but the client won't see all the updates.
     
  19. Offline

    Ligachamp

    I think it's easier for me to set lightlevels to 0, since I'm not that experienced and that reduces the server load too (no update packages get even created?).
     
  20. Online

    timtower Administrator Administrator Moderator

    @Ligachamp It is about the block updates though, not the light updates.
     
  21. Offline

    Ligachamp

    I don't get it... where is the method "a" declared? I understand the parameters, but can't find any reference to it.

    Oh, so the light updates are just a part of the block updates?
     
  22. Online

    timtower Administrator Administrator Moderator

    @Ligachamp Light updates are handled client side after a block update.
     
  23. Offline

    Ligachamp

    Block updates this time meant as packets transferred from server to client ;) But ok, I've got it now, thx :)
     
  24. Offline

    Zombie_Striker

    @Ligachamp
    Mark this thread as solved if your problem has been solved.
     
    Last edited: Mar 22, 2016
  25. Offline

    Ligachamp

    Zombie_Striker likes this.
Thread Status:
Not open for further replies.

Share This Page