@@ -43,6 +43,7 @@ public interface WorldBorder {
4343 * @param seconds The time in seconds in which the border grows or shrinks from the previous size to that being set.
4444 *
4545 * @throws IllegalArgumentException if newSize is less than 1.0D or greater than {@link #getMaxSize()}
46+ * @see #setSize(double, TimeUnit, long)
4647 */
4748 void setSize (double newSize , long seconds );
4849
@@ -117,15 +118,40 @@ public interface WorldBorder {
117118 * Gets the current border warning time in seconds.
118119 *
119120 * @return The current border warning time in seconds.
121+ * @deprecated Use {@link #getWarningTimeTicks()} instead
120122 */
121- int getWarningTime ();
123+ @ Deprecated (since = "1.21.11" , forRemoval = true )
124+ default int getWarningTime () {
125+ return (int ) Tick .of (this .getWarningTimeTicks ()).toSeconds ();
126+ }
127+
128+ /**
129+ * Gets the current border warning time in ticks.
130+ *
131+ * @return The current border warning time in ticks.
132+ */
133+ long getWarningTimeTicks ();
134+
135+ /**
136+ * Sets the warning time that causes the screen to be tinted red when a contracting border will reach the player within the specified time.
137+ *
138+ * @param seconds The amount of time in seconds.
139+ * @deprecated Use {@link #setWarningTime(TimeUnit, long)} instead
140+ */
141+ @ Deprecated (since = "1.21.11" , forRemoval = true )
142+ default void setWarningTime (int seconds ) {
143+ this .setWarningTime (TimeUnit .SECONDS , seconds );
144+ }
122145
123146 /**
124147 * Sets the warning time that causes the screen to be tinted red when a contracting border will reach the player within the specified time.
125148 *
126- * @param seconds The amount of time in seconds. (The default is 15 seconds.)
149+ * @param unit The time unit.
150+ * @param time The time that causes the screen to be tinted red when a contracting border will reach.
151+ *
152+ * @see Tick
127153 */
128- void setWarningTime (int seconds );
154+ void setWarningTime (@ NotNull TimeUnit unit , long time );
129155
130156 /**
131157 * Gets the current border warning distance.
0 commit comments