1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

LogBlock Compatibility

Discussion in 'Addon Suggestions' started by Mr_Simba, Mar 17, 2017.

  1. Mr_Simba

    Mr_Simba King of the Pridelands
    Moderator Supporter

    Joined:
    Dec 9, 2016
    Messages:
    257
    Likes Received:
    55
    Medals:
    In case this seems familiar, yes I suggested this once before, but it was a long time ago and on the old forums so it has been lost. I'm not sure who would be most fitting for this, @Sharpjaws you have CoreProtect and a lot of other plugin compatibilities so it may fit into SharpSK. I'm not picky though about who adds support for it of course, anyone who can get to it would make me super happy!

    The main thing any dev would need for this is LogBlock's consumer. An example of an external plugin logging stuff with LogBlock can be found here. You get LogBlock from the server and call getConsumer on it, then use the consumer to queue block changes. If you don't want to have it as a harder dependency by needing to include its Actor class, you can use the lower down functions which instead accept a string playerName in place of an actor.

    Examples of main potential syntax:

    Code (Skript):
    1. queue logblock block (break|place|replace) from %player% at %location% [with [previous block %itemstack% and new] block %itemstack%][/CODE=SKRIPT]
    2.  
    3. The optional part would be ignored for breaks, but would be used in the "place" and "replace" options. The "previous block %itemstack% and new..." would be used for replaces, since replace takes an old block and new block. So e.g. if we want right clicking on dirt to turn it into a pumpkin and LogBlock to recognize that they did that, we could so:
    4.  
    5. [CODE=SKRIPT]on right click on dirt:
    6.     set clicked block to pumpkin
    7.     queue logbock replace from player at clicked block's location with previous block dirt and new block pumpkin
    Which for example could be running this queueBlockReplace overload behind the scenes:
    Code (Skript):
    1. queueBlockReplace(String playerName, Location loc, int typeBefore, byte dataBefore, int typeAfter, byte dataAfter)
    Hopefully that explains it pretty well. There are even more options in the consumer, but we can already log kills by using 'make damage', so it's mainly just blocks that need support.
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    @Mr_Simba It has been noted. :emoji_grin: I will be looking into it as soon as i can.
    As always all my progress can be followed on my github if you want to see my development on the logblock implementation when I'm on it.
     
    • Winner Winner x 1
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    <3 Cheers! I'll keep an eye on it. Thanks a ton.
     
    • Like Like x 1

Share This Page

Loading...