org.bukkit.FireworkEffect.Type Java Examples
The following examples show how to use
org.bukkit.FireworkEffect.Type.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FireworkMatchModule.java From PGM with GNU Affero General Public License v3.0 | 6 votes |
public void spawnFireworkDisplay( Location center, Color color, int count, double radius, int power) { FireworkEffect effect = FireworkEffect.builder() .with(Type.BURST) .withFlicker() .withColor(color) .withFade(Color.BLACK) .build(); for (int i = 0; i < count; i++) { double angle = 2 * Math.PI / count * i; double dx = radius * Math.cos(angle); double dz = radius * Math.sin(angle); Location baseLocation = center.clone().add(dx, 0, dz); Block block = baseLocation.getBlock(); if (block == null || !block.getType().isOccluding()) { spawnFirework(getOpenSpaceAbove(baseLocation), effect, power); } } }
Example #2
Source File: CraftMetaFirework.java From Kettle with GNU General Public License v3.0 | 6 votes |
static int getNBT(Type type) { switch (type) { case BALL: return 0; case BALL_LARGE: return 1; case STAR: return 2; case CREEPER: return 3; case BURST: return 4; default: throw new IllegalArgumentException("Unknown effect type " + type); } }
Example #3
Source File: CraftMetaFirework.java From Kettle with GNU General Public License v3.0 | 6 votes |
static Type getEffectType(int nbt) { switch (nbt) { case 0: return Type.BALL; case 1: return Type.BALL_LARGE; case 2: return Type.STAR; case 3: return Type.CREEPER; case 4: return Type.BURST; default: throw new IllegalArgumentException("Unknown effect type " + nbt); } }
Example #4
Source File: ObjectivesFireworkListener.java From ProjectAres with GNU Affero General Public License v3.0 | 6 votes |
public void spawnFireworkDisplay(Location center, Color color, int count, double radius, int power) { FireworkEffect effect = FireworkEffect.builder().with(Type.BURST) .withFlicker() .withColor(color) .withFade(Color.BLACK) .build(); for(int i = 0; i < count; i++) { double angle = 2 * Math.PI / count * i; double dx = radius * Math.cos(angle); double dz = radius * Math.sin(angle); Location baseLocation = center.clone().add(dx, 0, dz); Block block = baseLocation.getBlock(); if(block == null || !block.getType().isOccluding()) { FireworkUtil.spawnFirework(FireworkUtil.getOpenSpaceAbove(baseLocation), effect, power); } } }
Example #5
Source File: PostMatchFireworkListener.java From ProjectAres with GNU Affero General Public License v3.0 | 6 votes |
@Override public void run() { // Build this list fresh every time, because MatchPlayers can unload, but Competitors can't. final List<MatchPlayer> players = winners.stream() .flatMap(c -> c.getPlayers().stream()) .collect(Collectors.toList()); Collections.shuffle(players); for(int i = 0; i < players.size() && i < PostMatch.number(); i++) { MatchPlayer player = players.get(i); Type type = AVAILABLE_TYPES.get(match.getRandom().nextInt(AVAILABLE_TYPES.size())); FireworkEffect effect = FireworkEffect.builder().with(type).withFlicker().withColor(this.colors).withFade(Color.BLACK).build(); FireworkUtil.spawnFirework(player.getBukkit().getLocation(), effect, PostMatch.power()); } this.iterations++; if(this.iterations >= PostMatch.iterations()) { cancelTask(); } }
Example #6
Source File: ArenaControlBlock.java From civcraft with GNU General Public License v2.0 | 6 votes |
public void explode() { World world = Bukkit.getWorld(coord.getWorldname()); ItemManager.setTypeId(coord.getLocation().getBlock(), CivData.AIR); world.playSound(coord.getLocation(), Sound.ANVIL_BREAK, 1.0f, -1.0f); world.playSound(coord.getLocation(), Sound.EXPLODE, 1.0f, 1.0f); FireworkEffect effect = FireworkEffect.builder().with(Type.BURST).withColor(Color.YELLOW).withColor(Color.RED).withTrail().withFlicker().build(); FireworkEffectPlayer fePlayer = new FireworkEffectPlayer(); for (int i = 0; i < 3; i++) { try { fePlayer.playFirework(world, coord.getLocation(), effect); } catch (Exception e) { e.printStackTrace(); } } }
Example #7
Source File: CraftMetaFirework.java From Thermos with GNU General Public License v3.0 | 6 votes |
static int getNBT(Type type) { switch (type) { case BALL: return 0; case BALL_LARGE: return 1; case STAR: return 2; case CREEPER: return 3; case BURST: return 4; default: throw new IllegalStateException(type.toString()); // Spigot } }
Example #8
Source File: CraftMetaFirework.java From Thermos with GNU General Public License v3.0 | 6 votes |
static Type getEffectType(int nbt) { switch (nbt) { case 0: return Type.BALL; case 1: return Type.BALL_LARGE; case 2: return Type.STAR; case 3: return Type.CREEPER; case 4: return Type.BURST; default: throw new IllegalStateException(Integer.toString(nbt)); // Spigot } }
Example #9
Source File: FireworkMatchModule.java From PGM with GNU Affero General Public License v3.0 | 6 votes |
@Override public void run() { if (this.iterations < ITERATION_COUNT) { // Build this list fresh every time, because MatchPlayers can unload, but Competitors can't. final List<MatchPlayer> players = winners.stream().flatMap(c -> c.getPlayers().stream()).collect(Collectors.toList()); Collections.shuffle(players); for (int i = 0; i < players.size() && i < ROCKET_COUNT; i++) { MatchPlayer player = players.get(i); Type type = FIREWORK_TYPES.get(match.getRandom().nextInt(FIREWORK_TYPES.size())); FireworkEffect effect = FireworkEffect.builder() .with(type) .withFlicker() .withColor(this.colors) .withFade(Color.BLACK) .build(); spawnFirework(player.getBukkit().getLocation(), effect, ROCKET_POWER); } } this.iterations++; }
Example #10
Source File: ColoredFireworkStar.java From Slimefun4 with GNU General Public License v3.0 | 6 votes |
public ColoredFireworkStar(Color color, String name, String... lore) { super(Material.FIREWORK_STAR, im -> { if (name != null) { im.setDisplayName(ChatColors.color(name)); } ((FireworkEffectMeta) im).setEffect(FireworkEffect.builder().with(Type.BURST).withColor(color).build()); if (lore.length > 0) { List<String> lines = new ArrayList<>(); for (String line : lore) { lines.add(ChatColors.color(line)); } im.setLore(lines); } }); }
Example #11
Source File: BlockListener.java From civcraft with GNU General Public License v2.0 | 5 votes |
@EventHandler(priority = EventPriority.NORMAL) public void onProjectileHitEvent(ProjectileHitEvent event) { if (event.getEntity() instanceof Arrow) { ArrowFiredCache afc = CivCache.arrowsFired.get(event.getEntity().getUniqueId()); if (afc != null) { afc.setHit(true); } } if (event.getEntity() instanceof Fireball) { CannonFiredCache cfc = CivCache.cannonBallsFired.get(event.getEntity().getUniqueId()); if (cfc != null) { cfc.setHit(true); FireworkEffect fe = FireworkEffect.builder().withColor(Color.RED).withColor(Color.BLACK).flicker(true).with(Type.BURST).build(); Random rand = new Random(); int spread = 30; for (int i = 0; i < 15; i++) { int x = rand.nextInt(spread) - spread/2; int y = rand.nextInt(spread) - spread/2; int z = rand.nextInt(spread) - spread/2; Location loc = event.getEntity().getLocation(); Location location = new Location(loc.getWorld(), loc.getX(),loc.getY(), loc.getZ()); location.add(x, y, z); TaskMaster.syncTask(new FireWorkTask(fe, loc.getWorld(), loc, 5), rand.nextInt(30)); } } } }
Example #12
Source File: BlockListener.java From civcraft with GNU General Public License v2.0 | 5 votes |
private void OnPlayerUseItem(PlayerInteractEvent event) { Location loc = (event.getClickedBlock() == null) ? event.getPlayer().getLocation() : event.getClickedBlock().getLocation(); ItemStack stack = event.getItem(); coord.setFromLocation(event.getPlayer().getLocation()); Camp camp = CivGlobal.getCampFromChunk(coord); if (camp != null) { if (!camp.hasMember(event.getPlayer().getName())) { CivMessage.sendError(event.getPlayer(), "You cannot use "+stack.getType().toString()+" in a camp you do not belong to."); event.setCancelled(true); return; } } TownChunk tc = CivGlobal.getTownChunk(loc); if (tc == null) { return; } Resident resident = CivGlobal.getResident(event.getPlayer().getName()); if (resident == null) { event.setCancelled(true); } if(!tc.perms.hasPermission(PlotPermissions.Type.ITEMUSE, resident)) { event.setCancelled(true); CivMessage.sendErrorNoRepeat(event.getPlayer(), "You do not have permission to use "+stack.getType().toString()+" here."); } return; }
Example #13
Source File: DebugCommand.java From civcraft with GNU General Public License v2.0 | 5 votes |
public void firework_cmd() throws CivException { Player player = getPlayer(); FireworkEffectPlayer fw = new FireworkEffectPlayer(); try { fw.playFirework(player.getWorld(), player.getLocation(), FireworkEffect.builder().withColor(Color.RED).flicker(true).with(Type.BURST).build()); } catch (Exception e) { e.printStackTrace(); } }
Example #14
Source File: FireworkUtils.java From Slimefun4 with GNU General Public License v3.0 | 5 votes |
public static Firework createFirework(Location l, Color color) { Firework fw = (Firework) l.getWorld().spawnEntity(l, EntityType.FIREWORK); FireworkMeta meta = fw.getFireworkMeta(); meta.setDisplayName(ChatColor.GREEN + "Slimefun Research"); FireworkEffect effect = FireworkEffect.builder().flicker(ThreadLocalRandom.current().nextBoolean()).withColor(color).with(ThreadLocalRandom.current().nextInt(3) + 1 == 1 ? Type.BALL : Type.BALL_LARGE).trail(ThreadLocalRandom.current().nextBoolean()).build(); meta.addEffect(effect); meta.setPower(ThreadLocalRandom.current().nextInt(2) + 1); fw.setFireworkMeta(meta); return fw; }
Example #15
Source File: Tools.java From ce with GNU Lesser General Public License v3.0 | 5 votes |
public static Firework shootFirework(Location loc, Random rand) { int type = rand.nextInt(5) + 1; Firework firework = loc.getWorld().spawn(loc, Firework.class); FireworkMeta meta = firework.getFireworkMeta(); Type ft = null; switch (type) { case 1: ft = Type.BALL; break; case 2: ft = Type.BALL_LARGE; break; case 3: ft = Type.BURST; break; case 4: ft = Type.CREEPER; break; case 5: ft = Type.STAR; break; } FireworkEffect effect = FireworkEffect.builder().flicker(rand.nextBoolean()).withColor(fireworkColor(rand.nextInt(16) + 1)).withFade(fireworkColor(rand.nextInt(16) + 1)) .trail(rand.nextBoolean()).with(ft).trail(rand.nextBoolean()).build(); meta.addEffect(effect); firework.setFireworkMeta(meta); return firework; }
Example #16
Source File: FireworkShow.java From CS-CoreLib with GNU General Public License v3.0 | 5 votes |
public static void playEffect(Location l, Color color) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { Firework fw = l.getWorld().spawn(l, Firework.class); Object worldObject = ReflectionUtils.getMethod(l.getWorld().getClass(), "getHandle").invoke(l.getWorld(),(Object[]) null); FireworkMeta meta = fw.getFireworkMeta(); meta.addEffect(FireworkEffect.builder().with(Type.BURST).flicker(false).trail(false).withColor(color).withFade(Color.WHITE).build()); fw.setFireworkMeta(meta); ReflectionUtils.getMethod(worldObject.getClass(), "broadcastEntityEffect").invoke(worldObject, new Object[] {ReflectionUtils.getMethod(fw.getClass(), "getHandle").invoke(fw, (Object[]) null), (byte) 17}); fw.remove(); }
Example #17
Source File: FireworkShow.java From CS-CoreLib with GNU General Public License v3.0 | 5 votes |
public static Firework createFirework(Location l, Color color) { Firework fw = (Firework)l.getWorld().spawnEntity(l, EntityType.FIREWORK); FireworkMeta meta = fw.getFireworkMeta(); FireworkEffect effect = FireworkEffect.builder().flicker(CSCoreLib.randomizer().nextBoolean()).withColor(color).with(CSCoreLib.randomizer().nextInt(3) + 1 == 1 ? Type.BALL: Type.BALL_LARGE).trail(CSCoreLib.randomizer().nextBoolean()).build(); meta.addEffect(effect); meta.setPower(CSCoreLib.randomizer().nextInt(2) + 1); fw.setFireworkMeta(meta); return fw; }
Example #18
Source File: FireworkShow.java From CS-CoreLib with GNU General Public License v3.0 | 5 votes |
public static void launchFirework(Location l, Color color) { Firework fw = (Firework)l.getWorld().spawnEntity(l, EntityType.FIREWORK); FireworkMeta meta = fw.getFireworkMeta(); FireworkEffect effect = FireworkEffect.builder().flicker(CSCoreLib.randomizer().nextBoolean()).withColor(color).with(CSCoreLib.randomizer().nextInt(3) + 1 == 1 ? Type.BALL: Type.BALL_LARGE).trail(CSCoreLib.randomizer().nextBoolean()).build(); meta.addEffect(effect); meta.setPower(CSCoreLib.randomizer().nextInt(2) + 1); fw.setFireworkMeta(meta); }
Example #19
Source File: FireworkUtils.java From Slimefun4 with GNU General Public License v3.0 | 4 votes |
public static FireworkEffect getRandomEffect(Random random, Color color) { return FireworkEffect.builder().flicker(random.nextBoolean()).withColor(color).with(random.nextBoolean() ? Type.BALL : Type.BALL_LARGE).trail(random.nextBoolean()).build(); }
Example #20
Source File: CannonExplosionProjectile.java From civcraft with GNU General Public License v2.0 | 4 votes |
private void launchExplodeFirework(Location loc) { FireworkEffect fe = FireworkEffect.builder().withColor(Color.ORANGE).withColor(Color.YELLOW).flicker(true).with(Type.BURST).build(); TaskMaster.syncTask(new FireWorkTask(fe, loc.getWorld(), loc, 3), 0); }
Example #21
Source File: BlockListener.java From civcraft with GNU General Public License v2.0 | 4 votes |
@EventHandler(priority = EventPriority.NORMAL) public void OnHangingBreakByEntityEvent(HangingBreakByEntityEvent event) { // CivLog.debug("hanging painting break event"); ItemFrameStorage frameStore = CivGlobal.getProtectedItemFrame(event.getEntity().getUniqueId()); if (frameStore != null) { // if (!(event.getRemover() instanceof Player)) { // event.setCancelled(true); // return; // } // // if (frameStore.getTown() != null) { // Resident resident = CivGlobal.getResident((Player)event.getRemover()); // if (resident == null) { // event.setCancelled(true); // return; // } // // if (resident.hasTown() == false || resident.getTown() != frameStore.getTown()) { // event.setCancelled(true); // CivMessage.sendError((Player)event.getRemover(), "Cannot remove item from protected item frame. Belongs to another town."); // return; // } // } // // CivGlobal.checkForEmptyDuplicateFrames(frameStore); // // ItemStack stack = ((ItemFrame)event.getEntity()).getItem(); // if (stack != null && !stack.getType().equals(Material.AIR)) { // BonusGoodie goodie = CivGlobal.getBonusGoodie(stack); // if (goodie != null) { // frameStore.getTown().onGoodieRemoveFromFrame(frameStore, goodie); // } // frameStore.clearItem(); // TaskMaster.syncTask(new DelayItemDrop(stack, event.getEntity().getLocation())); // } if (event.getRemover() instanceof Player) { CivMessage.sendError((Player)event.getRemover(), "Cannot break protected item frames. Right click to interact instead."); } event.setCancelled(true); return; } if (event.getRemover() instanceof Player) { Player player = (Player)event.getRemover(); coord.setFromLocation(player.getLocation()); TownChunk tc = CivGlobal.getTownChunk(coord); if (tc == null) { return; } Resident resident = CivGlobal.getResident(player.getName()); if (resident == null) { event.setCancelled(true); } if (!tc.perms.hasPermission(PlotPermissions.Type.DESTROY, resident)) { event.setCancelled(true); CivMessage.sendErrorNoRepeat(player, "You do not have permission to destroy here."); } } }
Example #22
Source File: BlockListener.java From civcraft with GNU General Public License v2.0 | 4 votes |
@EventHandler(priority = EventPriority.HIGHEST) public void OnPlayerInteractEntityEvent(PlayerInteractEntityEvent event) { if (event.getRightClicked().getType().equals(EntityType.HORSE)) { if (!HorseModifier.isCivCraftHorse((LivingEntity)event.getRightClicked())) { CivMessage.sendError(event.getPlayer(), "Invalid horse! You can only get horses from stable structures."); event.setCancelled(true); event.getRightClicked().remove(); return; } } ItemStack inHand = event.getPlayer().getItemInHand(); if (inHand != null) { boolean denyBreeding = false; switch (event.getRightClicked().getType()) { case COW: case SHEEP: case MUSHROOM_COW: if (inHand.getType().equals(Material.WHEAT)) { denyBreeding = true; } break; case PIG: if (inHand.getType().equals(Material.CARROT_ITEM)) { denyBreeding = true; } break; case HORSE: if (inHand.getType().equals(Material.GOLDEN_APPLE) || inHand.getType().equals(Material.GOLDEN_CARROT)) { CivMessage.sendError(event.getPlayer(), "You cannot breed horses, buy them from the stable."); event.setCancelled(true); return; } break; case CHICKEN: if (inHand.getType().equals(Material.SEEDS) || inHand.getType().equals(Material.MELON_SEEDS) || inHand.getType().equals(Material.PUMPKIN_SEEDS)) { denyBreeding = true; } break; default: break; } if (denyBreeding) { ChunkCoord coord = new ChunkCoord(event.getPlayer().getLocation()); Pasture pasture = Pasture.pastureChunks.get(coord); if (pasture == null) { CivMessage.sendError(event.getPlayer(), "You cannot breed mobs in the wild, take them to a pasture."); event.setCancelled(true); } else { int loveTicks; NBTTagCompound tag = new NBTTagCompound(); ((CraftEntity)event.getRightClicked()).getHandle().c(tag); loveTicks = tag.getInt("InLove"); if (loveTicks == 0) { if(!pasture.processMobBreed(event.getPlayer(), event.getRightClicked().getType())) { event.setCancelled(true); } } else { event.setCancelled(true); } } return; } } if (!(event.getRightClicked() instanceof ItemFrame) && !(event.getRightClicked() instanceof Painting)) { return; } coord.setFromLocation(event.getPlayer().getLocation()); TownChunk tc = CivGlobal.getTownChunk(coord); if (tc == null) { return; } Resident resident = CivGlobal.getResident(event.getPlayer().getName()); if (resident == null) { return; } if(!tc.perms.hasPermission(PlotPermissions.Type.INTERACT, resident)) { event.setCancelled(true); CivMessage.sendErrorNoRepeat(event.getPlayer(), "You do not have permission to interact with this painting/itemframe."); } }
Example #23
Source File: BlockListener.java From civcraft with GNU General Public License v2.0 | 4 votes |
public static void OnPlayerSwitchEvent(PlayerInteractEvent event) { if (event.getClickedBlock() == null) { return; } Resident resident = CivGlobal.getResident(event.getPlayer().getName()); if (resident == null) { event.setCancelled(true); return; } bcoord.setFromLocation(event.getClickedBlock().getLocation()); CampBlock cb = CivGlobal.getCampBlock(bcoord); if (cb != null && !resident.isPermOverride()) { if (!cb.getCamp().hasMember(resident.getName())) { CivMessage.sendError(event.getPlayer(), "You cannot interact with a camp you do not belong to."); event.setCancelled(true); return; } } coord.setFromLocation(event.getClickedBlock().getLocation()); TownChunk tc = CivGlobal.getTownChunk(coord); if (tc == null) { return; } if (resident.hasTown()) { if (War.isWarTime()) { if(tc.getTown().getCiv().getDiplomacyManager().atWarWith(resident.getTown().getCiv())) { switch (event.getClickedBlock().getType()) { case WOODEN_DOOR: case IRON_DOOR: return; default: break; } } } } event.getClickedBlock().getType(); if(!tc.perms.hasPermission(PlotPermissions.Type.INTERACT, resident)) { event.setCancelled(true); if (War.isWarTime() && resident.hasTown() && resident.getTown().getCiv().getDiplomacyManager().atWarWith(tc.getTown().getCiv())) { WarRegen.destroyThisBlock(event.getClickedBlock(), tc.getTown()); } else { CivMessage.sendErrorNoRepeat(event.getPlayer(), "You do not have permission to interact with "+event.getClickedBlock().getType().toString()+" here."); } } return; }
Example #24
Source File: FlagFireworks.java From HeavySpleef with GNU General Public License v3.0 | 4 votes |
@Subscribe public void onPlayerWinGame(PlayerWinGameEvent event) { for (Location location : getValue()) { int amount = random.nextInt(3) + 3; for (int i = 0; i < amount; i++) { Location spawn; int trys = 0; do { int x = random.nextInt(8) - 4; int y = random.nextInt(8) - 4; int z = random.nextInt(8) - 4; spawn = location.clone().add(x, y, z); Block block = spawn.getBlock(); if (!block.isLiquid() && block.getType() != Material.AIR) { //Do another search spawn = null; } } while (spawn == null && ++trys < MAX_TRYS); if (spawn == null) { continue; } Firework firework = (Firework) spawn.getWorld().spawnEntity(spawn, EntityType.FIREWORK); FireworkMeta meta = firework.getFireworkMeta(); Type type = typeValues.get(random.nextInt(typeValues.size())); Color c1 = colorValues.get(random.nextInt(colorValues.size())); Color c2 = colorValues.get(random.nextInt(colorValues.size())); FireworkEffect effect = FireworkEffect.builder() .flicker(random.nextBoolean()) .withColor(c1) .withFade(c2) .with(type) .trail(random.nextBoolean()) .build(); meta.addEffect(effect); int rp = random.nextInt(3); meta.setPower(rp); firework.setFireworkMeta(meta); } } }
Example #25
Source File: CannonProjectile.java From civcraft with GNU General Public License v2.0 | 4 votes |
private void launchExplodeFirework(Location loc) { FireworkEffect fe = FireworkEffect.builder().withColor(Color.ORANGE).withColor(Color.YELLOW).flicker(true).with(Type.BURST).build(); TaskMaster.syncTask(new FireWorkTask(fe, loc.getWorld(), loc, 3), 0); }
Example #26
Source File: TownHall.java From civcraft with GNU General Public License v2.0 | 4 votes |
public void onControlBlockDestroy(ControlPoint cp, World world, Player player, StructureBlock hit) { //Should always have a resident and a town at this point. Resident attacker = CivGlobal.getResident(player); ItemManager.setTypeId(hit.getCoord().getLocation().getBlock(), CivData.AIR); world.playSound(hit.getCoord().getLocation(), Sound.ANVIL_BREAK, 1.0f, -1.0f); world.playSound(hit.getCoord().getLocation(), Sound.EXPLODE, 1.0f, 1.0f); FireworkEffect effect = FireworkEffect.builder().with(Type.BURST).withColor(Color.YELLOW).withColor(Color.RED).withTrail().withFlicker().build(); FireworkEffectPlayer fePlayer = new FireworkEffectPlayer(); for (int i = 0; i < 3; i++) { try { fePlayer.playFirework(world, hit.getCoord().getLocation(), effect); } catch (Exception e) { e.printStackTrace(); } } boolean allDestroyed = true; for (ControlPoint c : this.controlPoints.values()) { if (c.isDestroyed() == false) { allDestroyed = false; break; } } CivMessage.sendTownSound(hit.getTown(), Sound.AMBIENCE_CAVE, 1.0f, 0.5f); if (allDestroyed) { if (this.getTown().getCiv().getCapitolName().equals(this.getTown().getName())) { CivMessage.global(CivColor.LightBlue+ChatColor.BOLD+"The civilization of "+this.getTown().getCiv().getName()+" has been conquered by "+attacker.getCiv().getName()+"!"); for (Town town : this.getTown().getCiv().getTowns()) { town.defeated = true; } War.transferDefeated(this.getTown().getCiv(), attacker.getTown().getCiv()); WarStats.logCapturedCiv(attacker.getTown().getCiv(), this.getTown().getCiv()); War.saveDefeatedCiv(this.getCiv(), attacker.getTown().getCiv()); if (CivGlobal.isCasualMode()) { HashMap<Integer, ItemStack> leftovers = player.getInventory().addItem(this.getCiv().getRandomLeaderSkull("Victory Over "+this.getCiv().getName()+"!")); for (ItemStack stack : leftovers.values()) { player.getWorld().dropItem(player.getLocation(), stack); } } } else { CivMessage.global(CivColor.Yellow+ChatColor.BOLD+"The town of "+getTown().getName()+" in "+this.getCiv().getName()+" has been conquered by "+attacker.getCiv().getName()+"!"); //this.getTown().onDefeat(attacker.getTown().getCiv()); this.getTown().defeated = true; //War.defeatedTowns.put(this.getTown().getName(), attacker.getTown().getCiv()); WarStats.logCapturedTown(attacker.getTown().getCiv(), this.getTown()); War.saveDefeatedTown(this.getTown().getName(), attacker.getTown().getCiv()); } } else { CivMessage.sendTown(hit.getTown(), CivColor.Rose+"One of our Town Hall's Control Points has been destroyed!"); CivMessage.sendCiv(attacker.getTown().getCiv(), CivColor.LightGreen+"We've destroyed a control block in "+hit.getTown().getName()+"!"); CivMessage.sendCiv(hit.getTown().getCiv(), CivColor.Rose+"A control block in "+hit.getTown().getName()+" has been destroyed!"); } }
Example #27
Source File: FireworkEffectHandler.java From BetonQuest with GNU General Public License v3.0 | 4 votes |
public Type getType() { return type; }
Example #28
Source File: NMSHandler.java From SkyWarsReloaded with GNU General Public License v3.0 | 4 votes |
public FireworkEffect getFireworkEffect(Color one, Color two, Color three, Color four, Color five, Type type) { return FireworkEffect.builder().flicker(false).withColor(one, two, three, four).withFade(five).with(type).trail(true).build(); }
Example #29
Source File: NMSHandler.java From SkyWarsReloaded with GNU General Public License v3.0 | 4 votes |
public FireworkEffect getFireworkEffect(Color one, Color two, Color three, Color four, Color five, Type type) { return FireworkEffect.builder().flicker(false).withColor(one, two, three, four).withFade(five).with(type).trail(true).build(); }
Example #30
Source File: NMSHandler.java From SkyWarsReloaded with GNU General Public License v3.0 | 4 votes |
public FireworkEffect getFireworkEffect(Color one, Color two, Color three, Color four, Color five, Type type) { return FireworkEffect.builder().flicker(false).withColor(one, two, three, four).withFade(five).with(type).trail(true).build(); }