Skip to content

static class Sky


This class represents data packet that gets send over the network.
Original: Sky

int weather

Represents the sky weather. For more information see Weather Constants

bool raining

Represents the raining/snowing state.

bool renderLightning

Represents the lightning feature during raining state.
Lightning will only be rendered during raining and when weatherWeight is larger than 0.5

float windScale

Represents the sky wind scale used during raining/snowing.

bool dontRain

Represents the sky dontRain feature.
When it's enabled, the rain/snow won't fall.

Source code in src/pyg2o/classes/sky.py
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
class Sky:
    """
    This class represents data packet that gets send over the network.
    Original: [Sky](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-classes/game/Sky/)

    ## `int` weather
    Represents the sky weather. For more information see [Weather Constants](../../constants/weather.md)

    ## `bool` raining
    Represents the raining/snowing state.

    ## `bool` renderLightning
    Represents the lightning feature during raining state.
    Lightning will only be rendered during raining and when weatherWeight is larger than 0.5

    ## `float` windScale
    Represents the sky wind scale used during raining/snowing.

    ## `bool` dontRain
    Represents the sky dontRain feature.
    When it's enabled, the rain/snow won't fall.
    """

    @staticmethod
    async def get_weather():
        data = 'return Sky.weather'

        server = await PythonWebsocketServer.get_server()
        result = await server.make_request(data)
        return result

    @staticmethod
    async def set_weather(value):
        data = 'return Sky.weather = value'

        server = await PythonWebsocketServer.get_server()
        result = await server.make_request(data)
        return result

    @staticmethod
    async def get_raining():
        data = 'return Sky.raining'

        server = await PythonWebsocketServer.get_server()
        result = await server.make_request(data)
        return result

    @staticmethod
    async def set_raining(value):
        data = 'return Sky.raining = value'

        server = await PythonWebsocketServer.get_server()
        result = await server.make_request(data)
        return result

    @staticmethod
    async def get_renderLightning():
        data = 'return Sky.renderLightning'

        server = await PythonWebsocketServer.get_server()
        result = await server.make_request(data)
        return result

    @staticmethod
    async def set_renderLightning(value):
        data = 'return Sky.renderLightning = value'

        server = await PythonWebsocketServer.get_server()
        result = await server.make_request(data)
        return result

    @staticmethod
    async def get_windScale():
        data = 'return Sky.windScale'

        server = await PythonWebsocketServer.get_server()
        result = await server.make_request(data)
        return result

    @staticmethod
    async def set_windScale(value):
        data = 'return Sky.windScale = value'

        server = await PythonWebsocketServer.get_server()
        result = await server.make_request(data)
        return result

    @staticmethod
    async def get_dontRain():
        data = 'return Sky.dontRain'

        server = await PythonWebsocketServer.get_server()
        result = await server.make_request(data)
        return result

    @staticmethod
    async def set_dontRain(value):
        data = 'return Sky.dontRain = value'

        server = await PythonWebsocketServer.get_server()
        result = await server.make_request(data)
        return result

    @staticmethod
    async def setRainStartTime(hour : int, minute : int):
        """
        This method will set the sky weather time when it starts raining/snowing.
        **Parameters:**
        * `int` **hour**: the sky weather raining start hour.
        * `int` **minute**: the sky weather raining start min.
        """
        data = f'return Sky.setRainStartTime({hour}, {minute})'

        server = await PythonWebsocketServer.get_server()
        result = await server.make_request(data)
        return result

    @staticmethod
    async def setRainStopTime(hour : int, minute : int):
        """
        This method will set the sky weather time when it stops raining/snowing.
        **Parameters:**
        * `int` **hour**: the sky weather raining stop hour.
        * `int` **minute**: the sky weather raining stop min.
        """
        data = f'return Sky.setRainStopTime({hour}, {minute})'

        server = await PythonWebsocketServer.get_server()
        result = await server.make_request(data)
        return result

    @staticmethod
    async def getRainStartTime() -> dict:
        """
        This method will get the sky weather time when it starts raining/snowing.
        **Returns `dict`:**
        * `int` **hour**: the sky weather raining start hour.
        * `int` **minute**: the sky weather raining start min.
        """
        data = 'return Sky.getRainStartTime()'

        server = await PythonWebsocketServer.get_server()
        result = await server.make_request(data)
        return result

    @staticmethod
    async def getRainStopTime() -> dict:
        """
        This method will get the sky weather time when it stops raining/snowing.
        **Returns `dict`:**
        * `int` **hour**: the sky weather raining stop hour.
        * `int` **minute**: the sky weather raining stop min.
        """
        data = 'return Sky.getRainStopTime()'

        server = await PythonWebsocketServer.get_server()
        result = await server.make_request(data)
        return result

getRainStartTime() async staticmethod

This method will get the sky weather time when it starts raining/snowing.
Returns dict:
* int hour: the sky weather raining start hour.
* int minute: the sky weather raining start min.

Source code in src/pyg2o/classes/sky.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
async def getRainStartTime() -> dict:
    """
    This method will get the sky weather time when it starts raining/snowing.
    **Returns `dict`:**
    * `int` **hour**: the sky weather raining start hour.
    * `int` **minute**: the sky weather raining start min.
    """
    data = 'return Sky.getRainStartTime()'

    server = await PythonWebsocketServer.get_server()
    result = await server.make_request(data)
    return result

getRainStopTime() async staticmethod

This method will get the sky weather time when it stops raining/snowing.
Returns dict:
* int hour: the sky weather raining stop hour.
* int minute: the sky weather raining stop min.

Source code in src/pyg2o/classes/sky.py
148
149
150
151
152
153
154
155
156
157
158
159
160
@staticmethod
async def getRainStopTime() -> dict:
    """
    This method will get the sky weather time when it stops raining/snowing.
    **Returns `dict`:**
    * `int` **hour**: the sky weather raining stop hour.
    * `int` **minute**: the sky weather raining stop min.
    """
    data = 'return Sky.getRainStopTime()'

    server = await PythonWebsocketServer.get_server()
    result = await server.make_request(data)
    return result

setRainStartTime(hour, minute) async staticmethod

This method will set the sky weather time when it starts raining/snowing.
Parameters:
* int hour: the sky weather raining start hour.
* int minute: the sky weather raining start min.

Source code in src/pyg2o/classes/sky.py
106
107
108
109
110
111
112
113
114
115
116
117
118
@staticmethod
async def setRainStartTime(hour : int, minute : int):
    """
    This method will set the sky weather time when it starts raining/snowing.
    **Parameters:**
    * `int` **hour**: the sky weather raining start hour.
    * `int` **minute**: the sky weather raining start min.
    """
    data = f'return Sky.setRainStartTime({hour}, {minute})'

    server = await PythonWebsocketServer.get_server()
    result = await server.make_request(data)
    return result

setRainStopTime(hour, minute) async staticmethod

This method will set the sky weather time when it stops raining/snowing.
Parameters:
* int hour: the sky weather raining stop hour.
* int minute: the sky weather raining stop min.

Source code in src/pyg2o/classes/sky.py
120
121
122
123
124
125
126
127
128
129
130
131
132
@staticmethod
async def setRainStopTime(hour : int, minute : int):
    """
    This method will set the sky weather time when it stops raining/snowing.
    **Parameters:**
    * `int` **hour**: the sky weather raining stop hour.
    * `int` **minute**: the sky weather raining stop min.
    """
    data = f'return Sky.setRainStopTime({hour}, {minute})'

    server = await PythonWebsocketServer.get_server()
    result = await server.make_request(data)
    return result