diff --git a/pom.xml b/pom.xml
index a790621..9c5b598 100644
--- a/pom.xml
+++ b/pom.xml
@@ -15,7 +15,7 @@
io.papermc.paper
paper-api
- 1.18.2-R0.1-SNAPSHOT
+ 1.20.1-R0.1-SNAPSHOT
provided
@@ -33,7 +33,7 @@
org.apache.maven.plugins
maven-checkstyle-plugin
- 3.1.2
+ 3.3.0
checkstyle
diff --git a/src/main/java/pw/kaboom/weapons/modules/weapons/WeaponBlobinator.java b/src/main/java/pw/kaboom/weapons/modules/weapons/WeaponBlobinator.java
index 1616349..3f38778 100644
--- a/src/main/java/pw/kaboom/weapons/modules/weapons/WeaponBlobinator.java
+++ b/src/main/java/pw/kaboom/weapons/modules/weapons/WeaponBlobinator.java
@@ -18,8 +18,6 @@ import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.util.Vector;
-import com.destroystokyo.paper.event.entity.ProjectileCollideEvent;
-
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.TextDecoration;
@@ -72,37 +70,28 @@ public final class WeaponBlobinator implements Listener {
}
}
- @EventHandler
- private void onProjectileCollide(final ProjectileCollideEvent event) {
- if (event.getEntityType() == EntityType.SNOWBALL) {
- final Projectile projectile = event.getEntity();
-
- if (Component.text("WeaponBlobinatorBall").equals(projectile.customName())) {
- event.setCancelled(true);
- }
- }
- }
-
@EventHandler
private void onProjectileHit(final ProjectileHitEvent event) {
if (event.getEntityType() == EntityType.SNOWBALL) {
final Block hitBlock = event.getHitBlock();
final Projectile projectile = event.getEntity();
- if (hitBlock != null
- && Component.text("WeaponBlobinatorBall").equals(projectile.customName())) {
- final int radius = 4;
- final World world = projectile.getWorld();
- final Material color = Main.getColors().get(
- ThreadLocalRandom.current().nextInt(Main.getColors().size()));
+ if (Component.text("WeaponBlobinatorBall").equals(projectile.customName())) {
+ if (hitBlock != null) {
+ final int radius = 4;
+ final World world = projectile.getWorld();
+ final Material color = Main.getColors().get(
+ ThreadLocalRandom.current().nextInt(Main.getColors().size()));
- for (int x = -radius; x < radius; x++) {
- for (int y = -radius; y < radius; y++) {
- for (int z = -radius; z < radius; z++) {
- createBlobSplash(world, x, y, z, radius, hitBlock, color);
+ for (int x = -radius; x < radius; x++) {
+ for (int y = -radius; y < radius; y++) {
+ for (int z = -radius; z < radius; z++) {
+ createBlobSplash(world, x, y, z, radius, hitBlock, color);
+ }
}
}
}
+ event.setCancelled(true);
}
}
}
diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml
index 711118a..60abbf3 100644
--- a/src/main/resources/plugin.yml
+++ b/src/main/resources/plugin.yml
@@ -1,12 +1,12 @@
name: Weapons
main: pw.kaboom.weapons.Main
description: Plugin that implements various kinds of weapons.
-api-version: 1.13
+api-version: '1.20'
version: master
folia-supported: true
commands:
weapons:
- aliases: weapon
+ aliases: [ weapon ]
description: Gives you a weapon
permission: weapons.command