Skip to content

Commit

Permalink
Fix particle for 1.20.6 and later #36
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Jul 10, 2024
1 parent a7e548c commit 2c77f30
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<java.version>1.8</java.version>
<powermock.version>2.0.4</powermock.version>
<!-- More visible way how to change dependency versions -->
<spigot.version>1.20.4-R0.1-SNAPSHOT</spigot.version>
<spigot.version>1.20.6-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>2.0.0-SNAPSHOT</bentobox.version>
<!-- Revision variable removes warning about dynamic version -->
<revision>${build.version}-SNAPSHOT</revision>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package world.bentobox.twerk.listeners;

import java.util.Arrays;

import java.util.Collections;
import java.util.EnumMap;
import java.util.HashMap;
Expand Down Expand Up @@ -31,7 +30,8 @@
import org.bukkit.event.world.StructureGrowEvent;
import org.eclipse.jdt.annotation.NonNull;

import world.bentobox.bentobox.BentoBox;
import com.google.common.base.Enums;

import world.bentobox.bentobox.database.objects.Island;
import world.bentobox.bentobox.lists.Flags;
import world.bentobox.bentobox.util.Util;
Expand Down Expand Up @@ -271,7 +271,13 @@ private void twerk(Player player) {
if (count >= addon.getSettings().getMinimumTwerks()) {
player.playSound(player.getLocation(), addon.getSettings().getSoundsTwerkSound(),
(float)addon.getSettings().getSoundsTwerkVolume(), (float)addon.getSettings().getSoundsTwerkPitch());
player.spawnParticle(Particle.SPELL, player.getLocation(), 20, 3D, 0D, 3D);
Particle p = Enums.getIfPresent(Particle.class, "SPELL").orNull();
if (p == null) {
p = Enums.getIfPresent(Particle.class, "POOF").orNull();
}
if (p != null) {
player.spawnParticle(p, player.getLocation(), 20, 3D, 0D, 3D);
}
}
});

Expand Down

0 comments on commit 2c77f30

Please sign in to comment.