From 49c489d9f485f6f0124ba151f7c496bb5711b481 Mon Sep 17 00:00:00 2001 From: "BT (calcastor/mame)" <43831917+calcastor@users.noreply.github.com> Date: Tue, 26 Jul 2022 21:42:46 -0700 Subject: [PATCH] Use getType in trackers rather than SportPaper getMaterial Also suppress deprecation Signed-off-by: BT (calcastor/mame) <43831917+calcastor@users.noreply.github.com> --- .../src/main/java/tc/oc/pgm/tracker/trackers/CactiTracker.java | 3 ++- .../main/java/tc/oc/pgm/tracker/trackers/DispenserTracker.java | 1 + .../java/tc/oc/pgm/tracker/trackers/FallingBlockTracker.java | 3 ++- core/src/main/java/tc/oc/pgm/tracker/trackers/TNTTracker.java | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/tc/oc/pgm/tracker/trackers/CactiTracker.java b/core/src/main/java/tc/oc/pgm/tracker/trackers/CactiTracker.java index a09cc7ccd0..3618903a69 100644 --- a/core/src/main/java/tc/oc/pgm/tracker/trackers/CactiTracker.java +++ b/core/src/main/java/tc/oc/pgm/tracker/trackers/CactiTracker.java @@ -30,9 +30,10 @@ public DamageInfo resolveDamage( return null; } + @SuppressWarnings("deprecation") @EventHandler(priority = EventPriority.MONITOR) public void onPlace(ParticipantBlockTransformEvent event) { - if (event.getNewState().getMaterial() == Material.CACTUS) { + if (event.getNewState().getType() == Material.CACTUS) { blocks() .trackBlockState( event.getNewState(), diff --git a/core/src/main/java/tc/oc/pgm/tracker/trackers/DispenserTracker.java b/core/src/main/java/tc/oc/pgm/tracker/trackers/DispenserTracker.java index acf727b483..de7ee02d24 100644 --- a/core/src/main/java/tc/oc/pgm/tracker/trackers/DispenserTracker.java +++ b/core/src/main/java/tc/oc/pgm/tracker/trackers/DispenserTracker.java @@ -18,6 +18,7 @@ public DispenserTracker(TrackerMatchModule tmm, Match match) { super(DispenserInfo.class, tmm, match); } + @SuppressWarnings("deprecation") @EventHandler(priority = EventPriority.MONITOR) public void onPlace(ParticipantBlockTransformEvent event) { if (event.getNewState().getType() == Material.DISPENSER) { diff --git a/core/src/main/java/tc/oc/pgm/tracker/trackers/FallingBlockTracker.java b/core/src/main/java/tc/oc/pgm/tracker/trackers/FallingBlockTracker.java index 5434ed16a6..c7c5f260d3 100644 --- a/core/src/main/java/tc/oc/pgm/tracker/trackers/FallingBlockTracker.java +++ b/core/src/main/java/tc/oc/pgm/tracker/trackers/FallingBlockTracker.java @@ -39,9 +39,10 @@ public DamageInfo resolveDamage( return null; } + @SuppressWarnings("deprecation") @EventHandler(priority = EventPriority.MONITOR) public void onPlace(ParticipantBlockTransformEvent event) { - if (event.getNewState().getMaterial().hasGravity()) { + if (event.getNewState().getType().hasGravity()) { blocks() .trackBlockState( event.getNewState(), diff --git a/core/src/main/java/tc/oc/pgm/tracker/trackers/TNTTracker.java b/core/src/main/java/tc/oc/pgm/tracker/trackers/TNTTracker.java index e3bf6fd7d3..711eb88ac4 100644 --- a/core/src/main/java/tc/oc/pgm/tracker/trackers/TNTTracker.java +++ b/core/src/main/java/tc/oc/pgm/tracker/trackers/TNTTracker.java @@ -21,6 +21,7 @@ public TNTTracker(TrackerMatchModule tmm, Match match) { super(TNTInfo.class, tmm, match); } + @SuppressWarnings("deprecation") @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onPlace(ParticipantBlockTransformEvent event) { if (event.getNewState().getType() == Material.TNT) {