9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-25 18:09:27 +00:00

添加方法

This commit is contained in:
XiaoMoMi
2025-08-10 15:33:48 +08:00
parent 1aed961edf
commit fc879d6a4c

View File

@@ -56,6 +56,22 @@ public final class CraftEngineBlocks {
return place(location, block, UpdateOption.UPDATE_ALL, playSound);
}
/**
* Place a custom block
*
* @param location location
* @param blockId block owner id
* @param playSound whether to play place sounds
* @return success or not
*/
public static boolean place(@NotNull Location location,
@NotNull Key blockId,
boolean playSound) {
CustomBlock block = byId(blockId);
if (block == null) return false;
return place(location, block.defaultState(), UpdateOption.UPDATE_ALL, playSound);
}
/**
* Place a custom block with given properties
*