Skip to content

Commit

Permalink
1.20.6
Browse files Browse the repository at this point in the history
  • Loading branch information
fantahund committed May 10, 2024
1 parent c5515dc commit d1a4584
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 29 deletions.
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.20.4-R0.1-SNAPSHOT</version>
<version>1.20.6-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -132,15 +132,15 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<version>3.4.1</version>
<configuration>
<finalName>${project.artifactId}</finalName>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
<version>3.5.3</version>
<executions>
<execution>
<phase>package</phase>
Expand Down Expand Up @@ -194,15 +194,15 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<version>3.4.1</version>
<configuration>
<finalName>${project.artifactId}-shade</finalName>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
<version>3.5.3</version>
<executions>
<execution>
<phase>package</phase>
Expand Down Expand Up @@ -254,9 +254,9 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.13.0</version>
<configuration>
<release>17</release>
<release>21</release>
</configuration>
</plugin>
</plugins>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/fanta/fancyfirework/FireWorkWorks.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void spawnFirework(Player p) {
boolean sky = loc.getBlockY() > toppos.getBlockY();
PlayerInfo playerInfo = AFKListener.playerTimes.get(p);
if (sky && (p.getGameMode() == GameMode.SURVIVAL || p.getGameMode() == GameMode.ADVENTURE) && !FancyFirework.getPlugin().isVanish(p) && !playerInfo.afk) {
Firework firework = (Firework) world.spawnEntity(loc, EntityType.FIREWORK);
Firework firework = (Firework) world.spawnEntity(loc, EntityType.FIREWORK_ROCKET);
firework.setVelocity(new Vector((rand.nextBoolean() ? 1 : -1) * rand.nextDouble(0.01), rand.nextDouble(0.5, 1.5), (rand.nextBoolean() ? 1 : -1) * rand.nextDouble(0.01)));
FireworkMeta fireworkMeta = firework.getFireworkMeta();
FireworkEffect effect = FireworkEffect.builder().with(FireworkEffect.Type.values()[rand.nextInt(FireworkEffect.Type.values().length)]).withColor(randomColor()).withFade(randomColor()).withFlicker().withTrail().build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void onLit(Entity entity, Player player) {
entity.getWorld().playSound(entity.getLocation(), Sound.ENTITY_GHAST_SCREAM, SoundCategory.AMBIENT, 2f, 1.5f);

FountainEffect effect = new FountainEffect(random.nextInt(6, 20), random.nextDouble(0.4, 1), random.nextDouble(359), random.nextDouble(6));
effect.setSpawnParticle(location -> location.getWorld().spawnParticle(Particle.REDSTONE, location, 6, new Particle.DustOptions(randomColor(), 1.5f)));
effect.setSpawnParticle(location -> location.getWorld().spawnParticle(Particle.DUST, location, 6, new Particle.DustOptions(randomColor(), 1.5f)));

return List.of(effect);
});
Expand Down Expand Up @@ -84,7 +84,7 @@ protected Permission createPermission() {

protected void spawnRandomFirework(Location location) {
Random rand = ThreadLocalRandom.current();
Firework firework = (Firework) location.getWorld().spawnEntity(location.add(0, 1.5, 0), EntityType.FIREWORK);
Firework firework = (Firework) location.getWorld().spawnEntity(location.add(0, 1.5, 0), EntityType.FIREWORK_ROCKET);
firework.setVelocity(new Vector((rand.nextBoolean() ? 1 : -1) * rand.nextDouble(0.02), rand.nextDouble(0.5, 1.5), (rand.nextBoolean() ? 1 : -1) * rand.nextDouble(0.02)));
FireworkMeta fireworkMeta = firework.getFireworkMeta();
FireworkEffect effect = FireworkEffect.builder().with(FireworkEffect.Type.values()[rand.nextInt(FireworkEffect.Type.values().length)]).withColor(randomColor()).withFade(randomColor()).withFlicker().withTrail().build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void onExplode(Firework firework) {
@Override
protected void spawnRandomFirework(Location location) {
Random rand = ThreadLocalRandom.current();
Firework firework = (Firework) location.getWorld().spawnEntity(location.add(0, 1.5, 0), EntityType.FIREWORK);
Firework firework = (Firework) location.getWorld().spawnEntity(location.add(0, 1.5, 0), EntityType.FIREWORK_ROCKET);
firework.setVelocity(new Vector((rand.nextBoolean() ? 1 : -1) * rand.nextDouble(0.02), rand.nextDouble(0.5, 1.5), (rand.nextBoolean() ? 1 : -1) * rand.nextDouble(0.02)));
FireworkMeta fireworkMeta = firework.getFireworkMeta();
fireworkMeta.setPower(rand.nextInt(2) + 1);
Expand All @@ -73,8 +73,8 @@ public Color randomColor() {
public void spawn(Location origin) {
Color color = ColorUtils.getColor(plugin.getTime(), 0.2);
Vector rotation = new Vector(0, random.nextDouble(90), 0);
ISpawnParticle spawnParticle = location -> location.getWorld().spawnParticle(Particle.REDSTONE, location, 2, 0.2, 0.2, 0.2, 0, new Particle.DustOptions(color, 2), true);
ISpawnParticle spawnParticleWhite = location -> location.getWorld().spawnParticle(Particle.REDSTONE, location, 2, 0.2, 0.2, 0.2, 0, new Particle.DustOptions(Color.WHITE, 2), true);
ISpawnParticle spawnParticle = location -> location.getWorld().spawnParticle(Particle.DUST, location, 2, 0.2, 0.2, 0.2, 0, new Particle.DustOptions(color, 2), true);
ISpawnParticle spawnParticleWhite = location -> location.getWorld().spawnParticle(Particle.DUST, location, 2, 0.2, 0.2, 0.2, 0, new Particle.DustOptions(Color.WHITE, 2), true);

double maxSize = random.nextDouble(0.15, 0.5);
AtomicDouble size = new AtomicDouble(0.05);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void onExplode(Firework firework) {
@Override
protected void spawnRandomFirework(Location location) {
Random rand = ThreadLocalRandom.current();
Firework firework = (Firework) location.getWorld().spawnEntity(location.add(0, 1.5, 0), EntityType.FIREWORK);
Firework firework = (Firework) location.getWorld().spawnEntity(location.add(0, 1.5, 0), EntityType.FIREWORK_ROCKET);
firework.setVelocity(new Vector((rand.nextBoolean() ? 1 : -1) * rand.nextDouble(0.02), rand.nextDouble(0.5, 1.5), (rand.nextBoolean() ? 1 : -1) * rand.nextDouble(0.02)));
FireworkMeta fireworkMeta = firework.getFireworkMeta();
fireworkMeta.setPower(rand.nextInt(2) + 1);
Expand All @@ -73,9 +73,9 @@ public Color randomColor() {
public void spawn(Location origin) {
Color color = randomColor();
Vector rotation = new Vector(0, random.nextDouble(90), 0);
ISpawnParticle spawnParticle = location -> location.getWorld().spawnParticle(Particle.REDSTONE, location, 2, 0.2, 0.2, 0.2, 0, new Particle.DustOptions(color, 2), true);
ISpawnParticle spawnParticleGreen = location -> location.getWorld().spawnParticle(Particle.REDSTONE, location, 2, 0.2, 0.2, 0.2, 0, new Particle.DustOptions(Color.GREEN, 2), true);
ISpawnParticle spawnParticleWhite = location -> location.getWorld().spawnParticle(Particle.REDSTONE, location, 2, 0.2, 0.2, 0.2, 0, new Particle.DustOptions(Color.WHITE, 2), true);
ISpawnParticle spawnParticle = location -> location.getWorld().spawnParticle(Particle.DUST, location, 2, 0.2, 0.2, 0.2, 0, new Particle.DustOptions(color, 2), true);
ISpawnParticle spawnParticleGreen = location -> location.getWorld().spawnParticle(Particle.DUST, location, 2, 0.2, 0.2, 0.2, 0, new Particle.DustOptions(Color.GREEN, 2), true);
ISpawnParticle spawnParticleWhite = location -> location.getWorld().spawnParticle(Particle.DUST, location, 2, 0.2, 0.2, 0.2, 0, new Particle.DustOptions(Color.WHITE, 2), true);

double maxSize = random.nextDouble(0.15, 0.5);
AtomicDouble size = new AtomicDouble(0.05);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void onExplode(Firework firework) {
@Override
protected void spawnRandomFirework(Location location) {
Random rand = ThreadLocalRandom.current();
Firework firework = (Firework) location.getWorld().spawnEntity(location.add(0, 1.5, 0), EntityType.FIREWORK);
Firework firework = (Firework) location.getWorld().spawnEntity(location.add(0, 1.5, 0), EntityType.FIREWORK_ROCKET);
firework.setVelocity(new Vector((rand.nextBoolean() ? 1 : -1) * rand.nextDouble(0.02), rand.nextDouble(0.5, 1.5), (rand.nextBoolean() ? 1 : -1) * rand.nextDouble(0.02)));
FireworkMeta fireworkMeta = firework.getFireworkMeta();
fireworkMeta.setPower(rand.nextInt(2) + 1);
Expand All @@ -71,7 +71,7 @@ public Color randomColor() {
public void spawn(Location origin) {
Color color = randomColor();
Vector rotation = new Vector(0, random.nextDouble(90), 0);
ISpawnParticle spawnParticle = location -> location.getWorld().spawnParticle(Particle.REDSTONE, location, 2, 0.2, 0.2, 0.2, 0, new Particle.DustOptions(color, 2), true);
ISpawnParticle spawnParticle = location -> location.getWorld().spawnParticle(Particle.DUST, location, 2, 0.2, 0.2, 0.2, 0, new Particle.DustOptions(color, 2), true);

double maxSize = random.nextDouble(0.15, 0.5);
AtomicDouble size = new AtomicDouble(0.05);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void onLit(Entity entity, Player player) {
}

FountainEffect effect = new FountainEffect(random.nextInt(6, 20), random.nextDouble(0.4, 1), random.nextDouble(359), random.nextDouble(6));
effect.setSpawnParticle(location -> location.getWorld().spawnParticle(Particle.REDSTONE, location, 6, new Particle.DustOptions(randomColor(), 1.5f)));
effect.setSpawnParticle(location -> location.getWorld().spawnParticle(Particle.DUST, location, 6, new Particle.DustOptions(randomColor(), 1.5f)));

return List.of(effect);
});
Expand All @@ -69,7 +69,7 @@ public void onTick(Task task, boolean active) {
@Override
protected void spawnRandomFirework(Location location) {
Random rand = ThreadLocalRandom.current();
Firework firework = (Firework) location.getWorld().spawnEntity(location.add(0, 1.5, 0), EntityType.FIREWORK);
Firework firework = (Firework) location.getWorld().spawnEntity(location.add(0, 1.5, 0), EntityType.FIREWORK_ROCKET);
firework.setVelocity(new Vector((rand.nextBoolean() ? 1 : -1) * rand.nextDouble(0.02), rand.nextDouble(0.3, 0.5), (rand.nextBoolean() ? 1 : -1) * rand.nextDouble(0.02)));
FireworkMeta fireworkMeta = firework.getFireworkMeta();
FireworkEffect effect = FireworkEffect.builder().with(FireworkEffect.Type.values()[rand.nextInt(FireworkEffect.Type.values().length)]).withColor(randomColor()).withFade(randomColor()).withFlicker().withTrail().build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void onExplode(Firework firework) {
@Override
protected void spawnRandomFirework(Location location) {
Random rand = ThreadLocalRandom.current();
Firework firework = (Firework) location.getWorld().spawnEntity(location.add(0, 1.5, 0), EntityType.FIREWORK);
Firework firework = (Firework) location.getWorld().spawnEntity(location.add(0, 1.5, 0), EntityType.FIREWORK_ROCKET);
firework.setVelocity(new Vector((rand.nextBoolean() ? 1 : -1) * rand.nextDouble(0.02), rand.nextDouble(0.5, 1.5), (rand.nextBoolean() ? 1 : -1) * rand.nextDouble(0.02)));
FireworkMeta fireworkMeta = firework.getFireworkMeta();
fireworkMeta.setPower(rand.nextInt(2) + 1);
Expand All @@ -101,7 +101,7 @@ public Color randomColor() {
public void spawn(Location origin) {
Color color = randomColor();
Vector rotation = new Vector(0, random.nextDouble(90), 0);
ISpawnParticle spawnParticle = location -> location.getWorld().spawnParticle(Particle.REDSTONE, location, 2, 0.2, 0.2, 0.2, 0, new Particle.DustOptions(color, 2), true);
ISpawnParticle spawnParticle = location -> location.getWorld().spawnParticle(Particle.DUST, location, 2, 0.2, 0.2, 0.2, 0, new Particle.DustOptions(color, 2), true);

double maxSize = random.nextDouble(0.15, 0.5);
AtomicDouble size = new AtomicDouble(0.05);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void onHit(Player player, ProjectileHitEvent event) {
Location loc = event.getEntity().getLocation();
World world = loc.getWorld();
world.playSound(loc, Sound.ENTITY_GENERIC_EXPLODE, SoundCategory.AMBIENT, 2f, 1f);
world.spawnParticle(Particle.SMOKE_LARGE, loc, 250, 2, 2, 2, 0.015, null, true);
world.spawnParticle(Particle.LARGE_SMOKE, loc, 250, 2, 2, 2, 0.015, null, true);
world.spawnParticle(Particle.CAMPFIRE_COSY_SMOKE, loc, 400, 2, 2, 2, 0.015, null, true);
world.spawnParticle(Particle.CAMPFIRE_SIGNAL_SMOKE, loc, 40, 2, 2, 2, 0.015, null, true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void onHit(Player player, ProjectileHitEvent event) {
Location loc = event.getEntity().getLocation();
World world = loc.getWorld();
world.playSound(loc, Sound.ENTITY_GENERIC_EXPLODE, SoundCategory.AMBIENT, 2f, 1f);
world.spawnParticle(Particle.REDSTONE, loc, 150, 1, 1.5, 1, 0.008, new Particle.DustOptions(ColorUtils.getColor(plugin.getTime(), 2), 2.5f), true);
world.spawnParticle(Particle.DUST, loc, 150, 1, 1.5, 1, 0.008, new Particle.DustOptions(ColorUtils.getColor(plugin.getTime(), 2), 2.5f), true);
world.spawnParticle(Particle.CAMPFIRE_COSY_SMOKE, loc, 250, 0.5, 1.5, 0.5, 0.005, null, true);

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public void onHit(Player player, ProjectileHitEvent event) {
World world = loc.getWorld();

world.playSound(loc, Sound.ENTITY_GENERIC_EXPLODE, SoundCategory.AMBIENT, 2f, 1f);
world.spawnParticle(Particle.REDSTONE, loc, 80, 1, 1.5, 1, 0.008, new Particle.DustOptions(Color.fromRGB(22, 112, 90), 2.5f), true);
world.spawnParticle(Particle.REDSTONE, loc, 80, 1, 1.5, 1, 0.008, new Particle.DustOptions(Color.fromRGB(17, 51, 43), 2.5f), true);
world.spawnParticle(Particle.REDSTONE, loc, 80, 1, 1.5, 1, 0.008, new Particle.DustOptions(Color.fromRGB(69, 69, 69), 2.5f), true);
world.spawnParticle(Particle.DUST, loc, 80, 1, 1.5, 1, 0.008, new Particle.DustOptions(Color.fromRGB(22, 112, 90), 2.5f), true);
world.spawnParticle(Particle.DUST, loc, 80, 1, 1.5, 1, 0.008, new Particle.DustOptions(Color.fromRGB(17, 51, 43), 2.5f), true);
world.spawnParticle(Particle.DUST, loc, 80, 1, 1.5, 1, 0.008, new Particle.DustOptions(Color.fromRGB(69, 69, 69), 2.5f), true);
world.spawnParticle(Particle.CAMPFIRE_COSY_SMOKE, loc, 70, 0.5, 1.5, 0.5, 0.005, null, true);

for (Entity entity : world.getNearbyEntities(loc, 3, 3, 3)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ private void damageFNS(Player player, EquipmentSlot slot) {
ItemMeta meta = stack.getItemMeta();
int maxDurability = stack.getType().getMaxDurability();
if (maxDurability > 0) {
int durability = meta.getEnchantLevel(Enchantment.DURABILITY);
int durability = meta.getEnchantLevel(Enchantment.UNBREAKING);
if (durability <= 0 || RandomUtil.SHARED_RANDOM.nextInt(durability + 1) == 0) {
Damageable damageableMeta = (Damageable) meta;
int damageOld = damageableMeta.getDamage();
Expand Down

0 comments on commit d1a4584

Please sign in to comment.