Skip to content

Commit

Permalink
deprecation refresh_chunk_sections
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jul 21, 2023
1 parent 967819b commit 7cd3463
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
@@ -1,6 +1,7 @@
package com.denizenscript.denizen.objects;

import com.denizenscript.denizen.nms.NMSVersion;
import com.denizenscript.denizen.utilities.BukkitImplDeprecations;
import com.denizenscript.denizencore.utilities.debugging.Debug;
import com.denizenscript.denizen.utilities.flags.DataPersistenceFlagTracker;
import com.denizenscript.denizen.utilities.flags.LocationFlagSearchHelper;
Expand Down Expand Up @@ -889,14 +890,17 @@ public void adjust(Mechanism mechanism) {
// @object ChunkTag
// @name refresh_chunk_sections
// @input None
// @deprecated for MC 1.18+, use 'refresh_chunk'
// @description
// Refreshes all 16x16x16 chunk sections within the chunk.
// For MC 1.18+, prefer <@link mechanism ChunkTag.refresh_chunk>
// @example
// - adjust <player.location.chunk> refresh_chunk_sections
// -->
if (mechanism.matches("refresh_chunk_sections")) {
if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_18)) {
getBukkitWorld().regenerateChunk(chunkX, chunkZ);
BukkitImplDeprecations.chunkRefreshSections.warn(mechanism.context);
getBukkitWorld().refreshChunk(chunkX, chunkZ);
}
else {
NMSHandler.chunkHelper.refreshChunkSections(getChunk());
Expand Down
Expand Up @@ -240,6 +240,9 @@ public class BukkitImplDeprecations {
public static Warning assignmentRemove = new VerySlowWarning("assignmentRemove", "'assignment remove' without a script is deprecated: use 'clear' to clear all scripts, or 'remove' to remove one at a time.");
public static Warning npcScriptSingle = new VerySlowWarning("npcScriptSingle", "'npc.script' is deprecated in favor of 'npc.scripts' (plural).");

// Added 2023/07/21, bump when 1.17 is gone.
public static Warning chunkRefreshSections = new VerySlowWarning("chunkRefreshSections", "ChunkTag.refresh_chunk_sections, as of MC 1.18, is just a replica of ChunkTag.refresh_chunk, and so that mech should be used instead.");

// ==================== FUTURE deprecations ====================

// Added 2021/03/27, deprecate officially by 2024.
Expand Down

0 comments on commit 7cd3463

Please sign in to comment.