接口的使用
org.bukkit.util.Consumer
-
org.bukkit中Consumer的使用
修饰符和类型方法说明World.dropItem
(@NotNull Location location, @NotNull ItemStack item, @Nullable Consumer<Item> function) Drops an item at the specifiedLocation
Note that functions will run before the entity is spawnedWorld.dropItemNaturally
(@NotNull Location location, @NotNull ItemStack item, @Nullable Consumer<Item> function) Drops an item at the specifiedLocation
with a random offset Note that functions will run before the entity is spawnedboolean
RegionAccessor.generateTree
(@NotNull Location location, @NotNull Random random, @NotNull TreeType type, @Nullable Consumer<BlockState> stateConsumer) Creates a tree at the givenLocation
<T extends Entity>
TRegionAccessor.spawn
(@NotNull Location location, @NotNull Class<T> clazz, boolean randomizeData, @Nullable Consumer<T> function) Creates a new entity at the givenLocation
with the supplied function run before the entity is added to the world.<T extends Entity>
TRegionAccessor.spawn
(@NotNull Location location, @NotNull Class<T> clazz, @Nullable Consumer<T> function) Spawn an entity of a specific class at the givenLocation
, with the supplied function run before the entity is added to the world.