mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-25 18:09:27 +00:00
添加方法
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user