Skip to content

Commit

Permalink
Merge pull request #198 from mind04/tnt-prime-event
Browse files Browse the repository at this point in the history
fix TNTPrimeEvent deprecation warning
  • Loading branch information
FrankHeijden authored Dec 11, 2023
2 parents 9b6cf75 + 780444b commit e0dfe0d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package dev.frankheijden.insights.listeners;

import com.destroystokyo.paper.event.block.TNTPrimeEvent;
import dev.frankheijden.insights.api.InsightsPlugin;
import dev.frankheijden.insights.api.objects.wrappers.ScanObject;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.TNTPrimeEvent;

public class PaperEntityListener extends EntityListener {

Expand All @@ -26,11 +26,11 @@ public void onEntityRemove(com.destroystokyo.paper.event.entity.EntityRemoveFrom
*/
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onTNTPrime(TNTPrimeEvent event) {
var primerEntity = event.getPrimerEntity();
var primingEntity = event.getPrimingEntity();
var block = event.getBlock();

if (primerEntity instanceof Player) {
var player = (Player) primerEntity;
if (primingEntity instanceof Player) {
var player = (Player) primingEntity;

handleRemoval(player, block.getLocation(), ScanObject.of(block.getType()), 1, false);
} else {
Expand Down

0 comments on commit e0dfe0d

Please sign in to comment.