本文整理汇总了Java中org.bukkit.util.Consumer类的典型用法代码示例。如果您正苦于以下问题:Java Consumer类的具体用法?Java Consumer怎么用?Java Consumer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Consumer类属于org.bukkit.util包,在下文中一共展示了Consumer类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: spawnTemporaryPlayer
import org.bukkit.util.Consumer; //导入依赖的package包/类
public static void spawnTemporaryPlayer(Player p, Location loc, UUID skin, String customName, Consumer<FakePlayer> callback) {
GameProfileBuilder.fetch(skin, gameProfile -> {
System.out.println(gameProfile);
callback.accept(spawnTemporaryPlayer(p, loc, gameProfile, customName));
});
}
示例2: spawn
import org.bukkit.util.Consumer; //导入依赖的package包/类
@Override
public <T extends Entity> T spawn(Location location, Class<T> clazz, Consumer<T> function)
throws IllegalArgumentException
{
// TODO Auto-generated method stub
throw new UnimplementedOperationException();
}
示例3: spawn
import org.bukkit.util.Consumer; //导入依赖的package包/类
@Override
public <T extends Entity> T spawn(Location location, Class<T> clazz, Consumer<T> function) throws IllegalArgumentException {
return TaskManager.IMP.sync(new RunnableVal<T>() {
@Override
public void run(T value) {
this.value = parent.spawn(location, clazz, function);
}
});
}
示例4: updateMeta
import org.bukkit.util.Consumer; //导入依赖的package包/类
public static void updateMeta(ItemStack item, Consumer<ItemMeta> mutator) {
final ItemMeta meta = item.getItemMeta();
mutator.accept(meta);
item.setItemMeta(meta);
}
示例5: updateMetaIfPresent
import org.bukkit.util.Consumer; //导入依赖的package包/类
public static void updateMetaIfPresent(@Nullable ItemStack item, Consumer<ItemMeta> mutator) {
if(item != null && item.hasItemMeta()) {
updateMeta(item, mutator);
}
}
示例6: spawnPlayer
import org.bukkit.util.Consumer; //导入依赖的package包/类
public static void spawnPlayer(Player p, Location loc, UUID skin, String name, Consumer<FakePlayer> callback) {
spawnTemporaryPlayer(p, loc, skin, name, entity -> {
FakeRegister.getPlayerLocationsFile().addPlayerToFile(entity);
callback.accept(entity);
});
}
示例7: spawn
import org.bukkit.util.Consumer; //导入依赖的package包/类
@Override
public <T extends Entity> T spawn( Location location, Class<T> aClass, Consumer<T> consumer ) throws IllegalArgumentException {
return null;
}
示例8: spawn
import org.bukkit.util.Consumer; //导入依赖的package包/类
@Override
public <T extends Entity> T spawn(Location location, Class<T> clazz, Consumer<T> consumer) throws IllegalArgumentException {
throw Pokkit.unsupported();
}