Filled Clock item Advances Time / Changes Weather

Discussion in 'Plugin Requests' started by krlsmnk, Jul 26, 2018.

?

Should the weather-change option be...

  1. Guaranteed?

    85.7%
  2. Random?

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

    krlsmnk

    Plugin category: Time / Weather

    Minecraft version: 1.13

    Suggested name: MagicClock / WaitClock / StopWatch?

    What I want: A night/day skipping plugin that doesn't rely on /commands. They always feel immersion-breaking and gimmick-y.

    A Clock, when used, will advance time to the next interval (Day, Noon, Night, Midnight).

    Config option to prevent renamed clocks from functioning at all (to prevent conflicts with CreativeGates).

    Optional:

    1: Config option to have the Clock clear the weather.

    2: Config option to have the clock toggle the weather (make it rain if it isn't).

    3: Toggle-able config option to have the clock require and consume a specified item in order to function.

    4: Config option to have the clock, when used, suspend the "doDaylightCycle" gamerule for an amount of time specified in the config. A value of 0 will stop the daylight cycle completely, and activating the clock again should resume the cycle (but not advance time 1 interval).

    5: Play a sound when the time is advanced.

    Ideas for commands: PLEASE NO COMMANDS.

    Ideas for permissions: I don't need them, but you can include some if you want.
     
  2. Offline

    MightyOne

    So you want the default craftable clock, available for everyone, to change the time to the next daytime
    but at the same time increase it by a fixed value
    buuut at the same time toggle the weather?

    How exactly should that all work together?
     
  3. Offline

    krlsmnk

    Not sure what fixed value you're talking about.

    The weather option is optional. If you don't know how to nest if-statements you should likely stick to simpler projects.
     
  4. Offline

    MightyOne

    hey, I didn't want to start a fight here. I jus wanted to express that I cannot imagine these 3 (or 2) things can be combined:
    Your request doesn't state what exactly should happen if both features are selected in the config.
    I also find it a bit daring to question someones coding skills if you don't know anything about that person.
     
    timtower and Zombie_Striker like this.
  5. Offline

    timtower Moderator Moderator

    Cleaned posts.
    Keep it nice.
     
    MightyOne likes this.
  6. Offline

    krlsmnk

    I agree; it's a bit unclear.
    1 and 2 should be mutually exclusive.

    All others should simply be "true" or "false", and when using the clock, all "true" behaviors are executed in sequence.
     
  7. Offline

    Tango_

    Can you explain what you mean by point 3 when you require the clock to consume an item, how does this work? Also when you want a sound to be played, is this just for the player or for everyone online? And lastly, with the suspend time cycle enabled, I am unsure of how to continue the regular time interval change after, can you explain this too. I'm not sure how to differentiate this from the regular clock usage, and how can players obtain the ability to stop time cycle?
    I have some time so I can get this done for you fairly soon.

    EDIT:
    I made a version of this without the cycle suspend feature, I can add this in the future once I learn more about it. I also added the consume feature, or what I believe the consume feature is. Here is the first version, let me know what you want changed: DOWNLOAD
     
    Last edited: Jul 31, 2018
  8. Offline

    krlsmnk

    Awesome! I'll check it out as soon as I get home.

    I'll explain as best I can:

    For point 3, say you have the clock item in hand, when you try to use it, it will search your inventory for the item defined in the config (for example, let's say redstone). If you have redstone in your inventory, it will delete 1 of them and execute the clock function(s). If you do not, it will tell you that "You do not have enough X," and not run the clock functions.

    The sounds should be for the player only.

    For the time suspend, stopping time can be done by executing the "doDaylightCycle = false" command. To enable the normal time flow, that option can be set to true again.

    As for which of the 4 time intervals it sets the cycle to, it should check the in-game time. (/time query daytime) then set the time equal to the next interval (/time set day/noon/night/midnight)
     
  9. Offline

    Tango_

    Ahh ok. I did the consume function slightly differently, I made it so the player is required to click the clock with item X. I understand how to set the gamerule DoDaylightCycle, but do you want me to make it so when you enabled this in the config, and a player clicks the clock, X seconds are paused of the current interval or the next interval? Or have I understood it completely wrong?
     
  10. Offline

    krlsmnk

    Say it's "noon" in game.
    Player uses the clock.
    Plugin checks config file.

    If (clock has been renamed): //skip all checks; do nothing
    If (option 3 == true): check for listed item in inventory; If(exists) //remove 1, then continue; Else () //notify user; skip rest of checks;
    If (option1 == true): //set weather clear
    If (option 2 == true): If(raining) // clear; Else () //make it rain
    If(option4 == true): //set time == next interval;
    If(option4_partB == true): If(time == paused): //resume daylight cycle; Else(): //pause daylight cycle

    So if Option 4 is enabled, it should always advance to the next cycle, then if the sub-Option is true, it will suspend or reinstate the time flow starting at the new interval.

    Edit: Despite my phrasing of calling this a "sub-option" they should likely not be tied to one another, so they can be used independently. ("option4_partB" becomes independent "option5")

    Edit 2: Revising my original concept of options 1 and 2 being mutually exclusive, if executed in this order I think they could be kept separate. This way, if 1 is true and 2 is false: the clock will always clear the weather. If 1 and 2 are both true, the clock will always make it rain. If 1 is false and 2 is true, the clock will always toggle the weather. And if both are false, it won't affect the weather at all.
     
    Last edited: Aug 2, 2018
  11. Offline

    Tango_

    Ok got it. How should time pausing work across players. Does the player that paused the time have to be the same player to unpause, or can anyone unpause? And also if it is paused, and another player used the clock, will this cancel the previous players pause, set the next time interval and then add a new X seconds time pause?

    Lastly, this is the config I have, just to be certain, do the options and descriptions match what you are asking:

    # MagicClocks Config by Tango_

    # Setting this to true will disable the clocks ability once the clock is renamed
    prevent_renamed_clocks: false

    # Setting this to true will both clear weather and set the next time interval.
    allow_clear_weather: false

    # Setting this to true will toggle rain along with other true options and time change.
    toggle_weather_change: false

    # Set if the plugin should pause time after clock use
    allow_time_pause: true
    # Set for how long time cycle should be paused in seconds.
    # Setting this to 0 will pause time completely and requires another clock press to return to normal.

    seconds_paused: 15

    # Set if pausing the time should go to next time interval first
    pause_next_interval: true

    # Set if you require an item to consume to function
    # You can view the full list of materials here:
    https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
    consume_required: false
    consume_item: DIAMOND
    consume_amount: 5

    # Set the sound effect once the clock is used
    # You can view the full list here:
    https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Sound.html
    sound_effect: BLOCK_METAL_PRESSURE_PLATE_CLICK_ON
     
    Last edited: Aug 2, 2018
  12. Offline

    krlsmnk

    I'm not sure what the multiplayer ruling should be. I play on a rather small server exclusively with people I know, and we all usually Discord.

    I don't usually think about permissions / big servers with my requests. It's your application, so I suppose anything's fine.

    Config looks fantastic, my dude! Can't wait to try it out. Thanks again for running with this idea.
     
  13. Offline

    Tango_

    Ok I believe I have finished what you are requesting. unfortunately I don't have lots of time to find bugs. If you do happen to find any, let me know and I will fix them for you. Heres the link: DOWNLOAD
     
    krlsmnk likes this.
  14. Offline

    krlsmnk

    Thanks so much!
    I'm in the middle of moving right now, so it might be a couple days. But I'll definitely let you know how it goes.

    Did some testing.

    Took me a minute to realize I needed to click the "activate" the clock, then click it again to get it to go off, but the enchanted effect and the lore you added helps make it more clear.

    The lack of sound on activation seems strange. Possible to make it play a sound separate from the Use function?

    Only slight thing I've noticed that is a bit funky is this:
    If I activate the clock, THEN rename it, I can still use it to advance the time, and doing so will clear the rename and return it to a normal clock.

    I haven't been able to confuse or break Creative Gates or your plugin by making these mismatch clocks, so I'm not even sure it's an issue worth addressing, but I thought I'd point it out anyway. Seems the activate function checks for rename, but the use function doesn't.

    So in terms of usability / learnability, it could improve a tiny bit. As far as functionality goes, though, it works perfectly! Fantastic resource, my dude.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Aug 4, 2018
  15. Offline

    Tango_

    Thanks for the feedback. It seems I forgot to add a check for the activated clocks. I added the option to play a sound on when items have been taken to activate the clock, you can configure the sound in config. This took me little to no time to fix so here you go.

    DOWNLOAD
    (You may have to generate a new config, not sure)
     
    krlsmnk likes this.
  16. Offline

    krlsmnk

    It works fantastic!
    How do I mark this thread as "filled" or do I need a mod to do that?
     
  17. Offline

    KarimAKL

    @krlsmnk Just above your original post you should see a "Thread Tools" hover or click that and you should see a "Edit Title" option, press that and you should be able to set a title prefix. :)
     
    krlsmnk likes this.
Thread Status:
Not open for further replies.

Share This Page