Skip to content

Commit f0cdf01

Browse files
authored
Deprecate playEffect without replacement (#2830)
1 parent 62a7e6e commit f0cdf01

File tree

8 files changed

+21
-15
lines changed

8 files changed

+21
-15
lines changed

verification/src/changes/accepted-fabric-public-api-changes.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,14 @@
77
"CONSTRUCTOR_REMOVED"
88
]
99
}
10+
],
11+
"Removal of override": [
12+
{
13+
"type": "com.sk89q.worldedit.fabric.FabricWorld",
14+
"member": "Method com.sk89q.worldedit.fabric.FabricWorld.playEffect(com.sk89q.worldedit.math.Vector3,int,int)",
15+
"changes": [
16+
"METHOD_REMOVED"
17+
]
18+
}
1019
]
1120
}

worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ public void sendBiomeUpdates(Iterable<BlockVector2> chunks) {
355355
}
356356
}
357357

358+
@Deprecated
358359
@Override
359360
public boolean playEffect(Vector3 position, int type, int data) {
360361
World world = getWorld();

worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public boolean canUse(Actor player) {
5252
return player.hasPermission("worldedit.superpickaxe.area");
5353
}
5454

55+
@SuppressWarnings("deprecation")
5556
@Override
5657
public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked, @Nullable Direction face) {
5758
World world = BlockTool.requireWorld(clicked);

worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public boolean actPrimary(Platform server, LocalConfiguration config, Player pla
8686
return true;
8787
}
8888

89+
@SuppressWarnings("deprecation")
8990
private static void recurse(Platform server, EditSession editSession, World world, BlockVector3 pos,
9091
BlockVector3 origin, double size, BlockType initialType, Set<BlockVector3> visited) throws MaxChangedBlocksException {
9192

worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
*/
4747
public abstract class AbstractWorld implements World {
4848

49+
@Deprecated
4950
private final PriorityQueue<QueuedEffect> effectQueue = new PriorityQueue<>();
5051
private int taskId = -1;
5152

@@ -102,11 +103,13 @@ public void sendBiomeUpdates(Iterable<BlockVector2> chunks) {
102103
public void fixLighting(Iterable<BlockVector2> chunks) {
103104
}
104105

106+
@Deprecated
105107
@Override
106108
public boolean playEffect(Vector3 position, int type, int data) {
107109
return false;
108110
}
109111

112+
@Deprecated
110113
@Override
111114
public boolean queueBlockBreakEffect(Platform server, BlockVector3 position, BlockType blockType, double priority) {
112115
if (taskId == -1) {
@@ -169,6 +172,7 @@ public boolean isValid() {
169172
return true;
170173
}
171174

175+
@Deprecated
172176
private class QueuedEffect implements Comparable<QueuedEffect> {
173177
private final Vector3 position;
174178
private final BlockType blockType;
@@ -180,7 +184,7 @@ private QueuedEffect(Vector3 position, BlockType blockType, double priority) {
180184
this.priority = priority;
181185
}
182186

183-
@SuppressWarnings("deprecation")
187+
@Deprecated
184188
public void play() {
185189
playEffect(position, 2001, blockType.getLegacyId());
186190
}

worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,9 @@ default boolean generateFeature(ConfiguredFeatureType type, EditSession editSess
336336
* @param type the effect type
337337
* @param data the effect data
338338
* @return true if the effect was played
339+
* @deprecated This is deprecated without replacement.
339340
*/
341+
@Deprecated
340342
boolean playEffect(Vector3 position, int type, int data);
341343

342344
/**
@@ -347,7 +349,9 @@ default boolean generateFeature(ConfiguredFeatureType type, EditSession editSess
347349
* @param blockType the block type
348350
* @param priority the priority
349351
* @return true if the effect was played
352+
* @deprecated This is deprecated without replacement.
350353
*/
354+
@Deprecated
351355
boolean queueBlockBreakEffect(Platform server, BlockVector3 position, BlockType blockType, double priority);
352356

353357
/**

worldedit-fabric/src/main/java/com/sk89q/worldedit/fabric/FabricWorld.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -575,13 +575,6 @@ public void fixLighting(Iterable<BlockVector2> chunks) {
575575
}
576576
}
577577

578-
@Override
579-
public boolean playEffect(Vector3 position, int type, int data) {
580-
// TODO update sound API
581-
// getWorld().playSound(type, FabricAdapter.toBlockPos(position.toBlockPoint()), data);
582-
return true;
583-
}
584-
585578
@Override
586579
public WeatherType getWeather() {
587580
LevelData info = getWorld().getLevelData();

worldedit-neoforge/src/main/java/com/sk89q/worldedit/neoforge/NeoForgeWorld.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -560,13 +560,6 @@ public void fixLighting(Iterable<BlockVector2> chunks) {
560560
}
561561
}
562562

563-
@Override
564-
public boolean playEffect(Vector3 position, int type, int data) {
565-
// TODO update sound API
566-
// getWorld().play(type, NeoForgeAdapter.toBlockPos(position.toBlockPoint()), data);
567-
return true;
568-
}
569-
570563
@Override
571564
public WeatherType getWeather() {
572565
LevelData info = getWorld().getLevelData();

0 commit comments

Comments
 (0)