3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-25 18:40:05 +01:00

Use Material rather than legacy int/data when specifying block break effect type (#1829)

Dieser Commit ist enthalten in:
Jordan 2022-06-22 12:50:09 +01:00 committet von GitHub
Ursprung e3f2d5f737
Commit d498996cbd
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
4 geänderte Dateien mit 38 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -50,6 +50,7 @@ import com.sk89q.worldedit.world.RegenOptions;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockType;
import com.sk89q.worldedit.world.weather.WeatherType;
import com.sk89q.worldedit.world.weather.WeatherTypes;
import io.papermc.lib.PaperLib;
@ -415,6 +416,15 @@ public class BukkitWorld extends AbstractWorld {
return true;
}
//FAWE start - allow block break effect of non-legacy blocks
@Override
public boolean playBlockBreakEffect(Vector3 position, BlockType type) {
World world = getWorld();
world.playEffect(BukkitAdapter.adapt(world, position), Effect.STEP_SOUND, BukkitAdapter.adapt(type));
return true;
}
//FAWE end
@Override
public WeatherType getWeather() {
if (getWorld().isThundering()) {

Datei anzeigen

@ -132,6 +132,13 @@ public class WorldWrapper extends AbstractWorld {
return parent.playEffect(position, type, data);
}
//FAWE start - allow block break effect of non-legacy blocks
@Override
public boolean playBlockBreakEffect(Vector3 position, BlockType type) {
return parent.playBlockBreakEffect(position, type);
}
//FAWE end
@Override
public boolean queueBlockBreakEffect(Platform server, BlockVector3 position, BlockType blockType, double priority) {
return parent.queueBlockBreakEffect(server, position, blockType, priority);

Datei anzeigen

@ -107,6 +107,13 @@ public abstract class AbstractWorld implements World {
return false;
}
//FAWE start - allow block break effect of non-legacy blocks
@Override
public boolean playBlockBreakEffect(Vector3 position, BlockType type) {
return false;
}
//FAWE end
@Override
public boolean queueBlockBreakEffect(Platform server, BlockVector3 position, BlockType blockType, double priority) {
if (taskId == -1) {
@ -185,10 +192,11 @@ public abstract class AbstractWorld implements World {
this.priority = priority;
}
@SuppressWarnings("deprecation")
//FAWE start - allow block break effect of non-legacy blocks
public void play() {
playEffect(position, 2001, blockType.getLegacyId());
playBlockBreakEffect(position, blockType);
}
//FAWE end
@Override
public int compareTo(@Nullable QueuedEffect other) {

Datei anzeigen

@ -348,6 +348,17 @@ public interface World extends Extent, Keyed, IChunkCache<IChunkGet> {
*/
boolean playEffect(Vector3 position, int type, int data);
//FAWE start - allow block break effect of non-legacy blocks
/**
* Play a block break effect.
*
* @param position the position
* @param type the effect block type
* @return true if the effect was played
*/
boolean playBlockBreakEffect(Vector3 position, BlockType type);
//FAWE end
/**
* Queue a block break effect.
*