mirror of
https://github.com/kaboomserver/weapons.git
synced 2025-02-05 06:02:57 +00:00
Fix deprecation warning (#11)
* Bump dependencies * Fix deprecation warning * Fix small issue
This commit is contained in:
parent
b665cbd192
commit
8513443147
3 changed files with 16 additions and 27 deletions
4
pom.xml
4
pom.xml
|
@ -15,7 +15,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.papermc.paper</groupId>
|
<groupId>io.papermc.paper</groupId>
|
||||||
<artifactId>paper-api</artifactId>
|
<artifactId>paper-api</artifactId>
|
||||||
<version>1.18.2-R0.1-SNAPSHOT</version>
|
<version>1.20.1-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||||
<version>3.1.2</version>
|
<version>3.3.0</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>checkstyle</id>
|
<id>checkstyle</id>
|
||||||
|
|
|
@ -18,8 +18,6 @@ import org.bukkit.event.entity.ProjectileHitEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import com.destroystokyo.paper.event.entity.ProjectileCollideEvent;
|
|
||||||
|
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
import net.kyori.adventure.text.format.TextDecoration;
|
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
|
@EventHandler
|
||||||
private void onProjectileHit(final ProjectileHitEvent event) {
|
private void onProjectileHit(final ProjectileHitEvent event) {
|
||||||
if (event.getEntityType() == EntityType.SNOWBALL) {
|
if (event.getEntityType() == EntityType.SNOWBALL) {
|
||||||
final Block hitBlock = event.getHitBlock();
|
final Block hitBlock = event.getHitBlock();
|
||||||
final Projectile projectile = event.getEntity();
|
final Projectile projectile = event.getEntity();
|
||||||
|
|
||||||
if (hitBlock != null
|
if (Component.text("WeaponBlobinatorBall").equals(projectile.customName())) {
|
||||||
&& Component.text("WeaponBlobinatorBall").equals(projectile.customName())) {
|
if (hitBlock != null) {
|
||||||
final int radius = 4;
|
final int radius = 4;
|
||||||
final World world = projectile.getWorld();
|
final World world = projectile.getWorld();
|
||||||
final Material color = Main.getColors().get(
|
final Material color = Main.getColors().get(
|
||||||
ThreadLocalRandom.current().nextInt(Main.getColors().size()));
|
ThreadLocalRandom.current().nextInt(Main.getColors().size()));
|
||||||
|
|
||||||
for (int x = -radius; x < radius; x++) {
|
for (int x = -radius; x < radius; x++) {
|
||||||
for (int y = -radius; y < radius; y++) {
|
for (int y = -radius; y < radius; y++) {
|
||||||
for (int z = -radius; z < radius; z++) {
|
for (int z = -radius; z < radius; z++) {
|
||||||
createBlobSplash(world, x, y, z, radius, hitBlock, color);
|
createBlobSplash(world, x, y, z, radius, hitBlock, color);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
name: Weapons
|
name: Weapons
|
||||||
main: pw.kaboom.weapons.Main
|
main: pw.kaboom.weapons.Main
|
||||||
description: Plugin that implements various kinds of weapons.
|
description: Plugin that implements various kinds of weapons.
|
||||||
api-version: 1.13
|
api-version: '1.20'
|
||||||
version: master
|
version: master
|
||||||
folia-supported: true
|
folia-supported: true
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
weapons:
|
weapons:
|
||||||
aliases: weapon
|
aliases: [ weapon ]
|
||||||
description: Gives you a weapon
|
description: Gives you a weapon
|
||||||
permission: weapons.command
|
permission: weapons.command
|
||||||
|
|
Loading…
Reference in a new issue