public static Firework getRandomFirework(Location loc) {
FireworkMeta fireworkMeta = (FireworkMeta) (new ItemStack(Material.FIREWORK)).getItemMeta();
Firework firework = (Firework) loc.getWorld().spawnEntity(loc, EntityType.FIREWORK);
fireworkMeta.setPower(GizmoConfig.FIREWORK_POWER);
fireworkMeta.addEffect(FireworkEffect.builder()
.with(RocketUtils.randomFireworkType())
.withColor(RocketUtils.randomColor())
.trail(GizmoConfig.FIREWORK_TRAIL)
.build());
firework.setFireworkMeta(fireworkMeta);
return firework;
}
RocketUtils.java 文件源码
java
阅读 21
收藏 0
点赞 0
评论 0
项目:ProjectAres
作者:
评论列表
文章目录