Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
Update StarCosmetics.java
Browse files Browse the repository at this point in the history
  • Loading branch information
gmitch215 committed Dec 23, 2023
1 parent fb85495 commit d4aa6e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -549,12 +549,6 @@ final class CosmeticSelections1_9 implements CosmeticSelections {

loc.getWorld().playSound(loc, Sound.ENTITY_SNOWBALL_THROW, 2F, r.nextFloat(0.3F, 0.6F));
}, fromMined(30, Material.SNOW_BLOCK), COMMON))
.add(new GadgetSelection("egg", Material.EGG, loc -> {
Egg e = cosmetic(loc.getWorld().spawn(loc, Egg.class));
e.setVelocity(loc.getDirection().multiply(1.5));

loc.getWorld().playSound(loc, Sound.ENTITY_EGG_THROW, 2F, r.nextFloat(0.3F, 0.6F));
}, fromKilled(50, EntityType.CHICKEN), COMMON))

.add(new GadgetSelection("tnt_launcher", Material.TNT, loc -> {
TNTPrimed tnt = cosmetic(loc.getWorld().spawn(loc, TNTPrimed.class));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,10 @@ private void postChecks() {

@Override
public void onDisable() {
// Remove Cosmetic Fireworks
// Remove Cosmetic Entities
for (World w : Bukkit.getWorlds())
for (Firework f : w.getEntitiesByClass(Firework.class))
if (f.hasMetadata("cosmetic")) f.remove();
for (Entity en : w.getEntities())
if (en.hasMetadata("cosmetic")) en.remove();

try {
ASYNC_TICK_RUNNABLE.cancel();
Expand Down

0 comments on commit d4aa6e7

Please sign in to comment.