Wiki

Clone wiki

SkyChanger / Home

# Header

##Contents## * Feature List * Commands * Packet Number Key * Permissions * Permission Tree * Configuration File * Language Support * Developer API * Screenshots


SkyChanger is a light-weight plugin built using the Spigot API. The main function of this plugin is to change the color of the sky for yourself, a specific player, a specific world, or everyone. This plugin functions by sending a packet with a specified ID to the target player(s). Every packet number that is not 0 will cause rain to appear, and higher magnitude packer numbers increase the intensity of the rain. For an optimal experience it is recommended to use this plugin with Optifine and to turn rain and rain particles off. If this is not possible or inconvenient, rain is automatically turned off in Desert and Mesa biomes. You may want to use this plugin exclusively there.

If you have optifine installed, you should turn off Rain Splash, which can be found under Options > Video Settings > Animations > Rain Splash. You could also turn off regular rainfall, however this does not cause any lag. If you want to do this aswell, you can find it under Options > Video Settings > Details > Rain & Snow.


#Feature List

  • Allow players to change the color of their personal sky.
  • Change the sky color for specific players.
  • Change the sky color for a specific world.
  • Change the sky color for everyone online.
  • Freeze/Unfreeze yourself, others, a world, or everyone online.
  • Configurable limits to the range of packets that can be sent.
  • Usage messages tailored to specific users based on permission level.
  • Multilanguage support.
  • Metrics tracking by bStats.

#Commands

Command Description Required Permission
/SkyChanger <#> Change the color of your personal sky using a packet number. skychanger.changesky.self
/SkyChanger <#> [player] Change the sky color for a specific player. The player argument may either be a name or UUID. skychanger.changesky.others
/SkyChanger <#> [-a] Change the sky color for everyone online. skychanger.changesky.all
/SkyChanger <#> [-w [world]] Change the sky color for everyone in [world]. If the world paramter is left blank, your current world will be the target. skychanger.changesky.world.[* OR world]
/SkyChanger freeze/unfreeze Freeze/unfreeze yourself. skychanger.freeze.self
/SkyChanger freeze/unfreeze [player] Freeze/unfreeze a specific player. skychanger.freeze.others
/SkyChanger freeze/unfreeze [-a] Freeze/unfreeze everyone online. skychanger.freeze.all
/SkyChanger freeze/unfreeze [-w [world]] Freeze/unfreeze everyone in [world]. If the world paramter is left blank, your current world will be the target. skychanger.freeze.world.[* OR world]
/SkyChanger reload Reload the configuration file. skychanger.reload
/SkyChanger version Display plugin version information. -

The freeze command only freezes the player's client and it stays frozen until there is a packet update that will effectively unfreeze them. This means that they will not be protected or immune on the server and will still be subject to damage. A freeze is not harmful, as the only observable affect is unloading chunks on a client and rendering them unable to move. The unfreeze command will unfreeze the player, however sometimes the chunks may not reload. In order to force reload them you may use the keybind F3 + A. A player will also be automatically unfrozen if they teleport somewhere (for example to spawn or their home). As always the best way for a player to be fully unfrozen is to relog. Freezing only appears to work in the Overworld.

Command usage messages are tailored to the permission level of each user. For example, if a user only had the permission skychanger.changesky.self, the usage message they would see is /SkyChanger <#>. If a user had the permission skychanger.changesky.*, the usage message would be /SkyChanger <#> [player | -​a]. Further, if a user only had the permission skychanger.changesky.others, the usage message would be displayed as /SkyChanger <#> [player]

Also, if a player does not have permission for a command altogether they will not see it on the help page brought up by typing either /SkyChanger or /SkyChanger help.

####Packet Number Key

The packet numbers will be bound to the range you specify in the config.yml, however anyone with the permission skychanger.bypasslimit will be able to specify any number for the packet. The packet numbers are floating points (decimals, ex 1.2) and are subject to the maximum and minimum values of floating point numbers. The max and min values are |3.4028235E38| and |1.4E-45|, respectively. Any magnitude smaller than the min will be truncated, while any magnitude higher than the maximum will produce complete darkness and no rain. See the table below for details.

Packet numbers are accepted in scientific notation as well as standard notation, that is [number]E[power].

Below is a table of useful packet numbers to know

NUMBERS OF HIGH MAGNITUDE WILL INCREASE RAIN AND RAIN PARTICLES, THIS CAN CAUSE YOU TO LAG OUT AT A CERTAIN POINT. TAKE CAUTION WHEN PICKING A PACKET NUMBER!

Number/Range Description
(-infinity, -3.4028236E38] Eternal Darkness, no rain.
(-3.4028235E38, -2] No observable difference from -1, however there will be more rain and particles.
-1 Makes the stars brighter at night.
0 Sunny sky.
1 Rain.
2 Brown colored sky.
[3, 6] Nether sky, larger numbers cause more darkness.
[7, ~15] Black sky with yellow tinted light. Reduced shadows with higher numbers.
[~15, 3.4028235E38) No observable change, however there will be more rain and particles.
[3.4028236E38, infinity) Eternal Darkness, no rain.

These numbers are just the standard effects. The effects will change if you have night vision on, for example. The effects work best in the Overworld and may not produce any changes in the Nether or End.

If you want to reset your sky, your best option is to use a packer number of 0 or reconnect to the server you're on.


#Permissions

Note that the self permissions are automatically granted if a user has access to either the others, all, or world permissions.

Permission Descrption Default
skychanger.* Access to all SkyChanger commands. OP
skychanger.changesky.* Access to every part of the main SkyChanger command. OP
skychanger.changesky.self Access to change your personal sky color. OP
skychanger.changesky.others Access to changing a specific person's sky color. OP
skychanger.changesky.world.* Access to changing a specific world's sky color. OP
skychanger.changesky.world.[world] Access to changing the sky color of ONLY [world]. OP
skychanger.changesky.all Access to changing the sky color of all online players. OP
skychanger.freeze.* Access to every part of the SkyChanger freeze and unfreeze commands. OP
skychanger.freeze.self Access to freeze/unfreeze yourself. OP
skychanger.freeze.others Access to freeze/unfreeze a specific person. OP
skychanger.freeze.world.* Access to freeze/unfreeze a specific world. OP
skychanger.freeze.world.[world] Access to freeze/unfreeze ONLY [world]. OP
skychanger.freeze.all Access to freeze/unfreeze all online players. OP
skychanger.bypasslimit Bypass the packet range limits set in the config.yml. OP
skychanger.reload Access to reload the configuration. OP

If you, for example, want to allow a user to change the sky color of all worlds except one you can add permissions like so:

- -skychanger.changesky.world.heaven
- skychanger.changesky.world.*

This would mean the user has permission to change the sky in all worlds except the world named heaven.

####Permission Tree

skychanger.*

skychanger.changesky.*

skychanger.changesky.self

skychanger.changesky.others

skychanger.changesky.world.*

skychanger.changesky.world.[world]

skychanger.changesky.all

skychanger.freeze.*

skychanger.freeze.self

skychanger.freeze.others

skychanger.freeze.world.*

skychanger.freeze.world.[world]

skychanger.freeze.all

skychanger.bypasslimit

skychanger.reload


#Configuration File

#!YAML

#-----------------------------------------------
#               Sky Changer Config
#-----------------------------------------------

# DO NOT CHANGE THIS VALUE.
# CHANGING IT COULD RESULT IN DATA LOSS.
ConfigVersion: 1.0

#--------------[General Settings]---------------
general_settings:

  # Upper packet limit. Scientific notation is accepted.
  # Must be less than 3.4028236E38 or there will be no limit.
  upper_limit: 50.0

  # Lower packet limit. Scientific notation is accepted.
  # Must be greater than -3.4028236E38 or there will be no limit.
  lower_limit: -50.0

  # Choose the language of this plugin. The value must be supported
  # and follow the format "language_COUNTRY". For example en_US.
  # Submit Translations: https://bitbucket.org/AventiumSoftworks/skychanger/issues
  # Supported languages:
  # - en_US (English, United States)
  # - it_IT (Italiano, Italia)
  # - de_DE (Deutsche, Deutschland)
  # - nl_NL (Nederlands, Nederland)
  # - es_EC (Español, Ecuador)
  # - es_AR (Español, Argentina)
  # - no_NO (Norsk, Norge)
  # - iw_IL (ישראל, עברית)
  # - hu_HU (Magyar, Magyarország)
  language: en_US

#Language Support

SkyChanger has built-in multilanguage support. If you wish to change the language of the plugin all you need to do is change the language value in the configuration file. The supported languages will be listed there, however note that the list will not be updated in the config each time you update the plugin. The list is only updated when you regenerate the config file or copy the current one from the wiki section above. Even though the list may not be updated, the languages supported by your version of the plugin will still be accessible.

Currently Supported Languages

  • English, United States (en_US)
  • Italiano, Italia (it_IT)
  • Deutsche, Deutschland (de_DE)
  • Nederlands, Nederland (nl_NL)
  • Español, Ecuador (es_EC)
  • Español, Argentina (es_AR)
  • Norsk, Norge (no_NO)
  • ישראל, עברית (iw_IL)
  • Magyar, Magyarország (hu_HU)

If you would like to contribute your language or correct an incorrect translation, follow this quick guide.

Translation Credits: Daniel Scalzi (English, Italiano), Kenzie667 (Deutsche), Casper (Nederlands), Essi (Español), Ørjan Oliversen (Norsk), Amit (עברית), montlikadani (Magyar)


#Developer API

If you want to hook SkyChanger into your own plugin or simply want to extend functionality, you may use the provided API. If you feel the API is missing anything, or should be changed, please let us know.

Download Latest: bintray

Javadocs are not hosted, however they are provided on the maven repository.

###Maven

<repository>
    <id>jcenter</id>
    <name>jcenter-bintray</name>
    <url>http://jcenter.bintray.com</url>
</repository>

<dependency>
  <groupId>com.dscalzi</groupId>
  <artifactId>SkyChanger</artifactId>
  <version>VERSION</version>
</dependency>

###Gradle

repositories {
    jcenter()
}

dependencies {
    compile 'com.dscalzi:SkyChanger:VERSION'
}

###Example Usage

/**
* Example usage of the API. The following implementation
* would not be practical, it exists only to demonstrate
* the API capabilities.
* 
* @param player The player to experiment on.
*/
public void skychangerTests(Player player) {
    // Get a reference to the API.
    final SkyAPI api = SkyChanger.getAPI();

    // Change the sky and save the result.
    boolean result = api.changeSky(player, 3F);

    if(result) {
        player.sendMessage("Why did the sky turn red?");
    }

    // Freeze the player.
    result = api.freeze(player);

    if(result) {
        player.sendMessage("Where did the land go?");

        // Unfreeze the player.
        result = api.unfreeze(player);

        if(result) {
            player.sendMessage("You've been unfrozen! Press (F3 + A) to reload chunks.");
        }
    }
}

#Screenshots

All screenshots taken with Optifine and with both rain and rain particles off.

Packet 0 at Night Packet 0 at Night

Packet -1 at Night Packet -1 at Night

Packet 0 at Day Packet 0 at Day

Packet 2 at Day Packet 2 at Day

Packet 3 at Day Packet 3 at Day

Packet 4 at Day Packet 4 at Day

Packet 5 at Day Packet 5 at Day

Packet 6 at Day Packet 6 at Day

Packet 7 at Day Packet 7 at Day

Packet 8 at Day Packet 8 at Day

Packet 15 at Day Packet 15 at Day

Packet 7 with NightVision at Day Packet 7 with NightVision at Day

Any magnitude larger than 3.4028236E38 at day Any magnitude larger than 3.4028236E38 at day

Packet -1 at Night while Frozen Packet -1 at Night while Frozen

Updated