From 12aaf8ca6c1334d25b0c2d728d34150b04091b29 Mon Sep 17 00:00:00 2001 From: Indyuce Date: Wed, 12 Aug 2020 15:56:39 +0200 Subject: [PATCH] !Removed 1.12 function calls --- .../java/net/Indyuce/mmocore/api/block/BlockInfo.java | 4 ---- .../net/Indyuce/mmocore/api/block/SkullBlockType.java | 4 ++-- .../net/Indyuce/mmocore/listener/BlockListener.java | 11 +++-------- .../mmocore/listener/profession/FishingListener.java | 4 ++-- 4 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/main/java/net/Indyuce/mmocore/api/block/BlockInfo.java b/src/main/java/net/Indyuce/mmocore/api/block/BlockInfo.java index 9ecb7969..c450376f 100644 --- a/src/main/java/net/Indyuce/mmocore/api/block/BlockInfo.java +++ b/src/main/java/net/Indyuce/mmocore/api/block/BlockInfo.java @@ -94,10 +94,6 @@ public class BlockInfo { return new RegeneratingBlock(data, loc, this); } - public RegeneratingBlock startRegeneration(Location loc) { - return new RegeneratingBlock(null, loc, this); - } - public boolean hasExperience() { return experience != null; } diff --git a/src/main/java/net/Indyuce/mmocore/api/block/SkullBlockType.java b/src/main/java/net/Indyuce/mmocore/api/block/SkullBlockType.java index 64cc03ba..98917c63 100644 --- a/src/main/java/net/Indyuce/mmocore/api/block/SkullBlockType.java +++ b/src/main/java/net/Indyuce/mmocore/api/block/SkullBlockType.java @@ -31,7 +31,7 @@ public class SkullBlockType implements BlockType { loc.getBlock().setType(VersionMaterial.PLAYER_HEAD.toMaterial()); // save skull orientation if replaced block is a player head - if (MMOCoreUtils.isPlayerHead(block.getBlockData().getMaterial()) && MMOLib.plugin.getVersion().isStrictlyHigher(1, 12)) + if (MMOCoreUtils.isPlayerHead(block.getBlockData().getMaterial())) loc.getBlock().setBlockData(block.getBlockData()); MMOLib.plugin.getVersion().getWrapper().setSkullValue(loc.getBlock(), value); @@ -41,7 +41,7 @@ public class SkullBlockType implements BlockType { public String generateKey() { return "vanilla-skull-" + value; } - + @Override public boolean breakRestrictions(Block block) { return true; diff --git a/src/main/java/net/Indyuce/mmocore/listener/BlockListener.java b/src/main/java/net/Indyuce/mmocore/listener/BlockListener.java index 80878e1f..273388eb 100644 --- a/src/main/java/net/Indyuce/mmocore/listener/BlockListener.java +++ b/src/main/java/net/Indyuce/mmocore/listener/BlockListener.java @@ -24,7 +24,6 @@ import net.Indyuce.mmocore.api.block.VanillaBlockType; import net.Indyuce.mmocore.api.event.CustomBlockMineEvent; import net.Indyuce.mmocore.api.player.PlayerData; import net.Indyuce.mmocore.manager.RestrictionManager.BlockPermissions; -import net.mmogroup.mmolib.MMOLib; public class BlockListener implements Listener { private static final BlockFace[] order = { BlockFace.UP, BlockFace.DOWN, BlockFace.EAST, BlockFace.NORTH, BlockFace.WEST, BlockFace.SOUTH }; @@ -35,7 +34,7 @@ public class BlockListener implements Listener { if (player.getGameMode() == GameMode.CREATIVE) return; - String savedData = MMOLib.plugin.getVersion().isStrictlyHigher(1, 12) ? event.getBlock().getBlockData().getAsString() : ""; + String savedData = event.getBlock().getBlockData().getAsString(); Block block = event.getBlock(); /* @@ -116,12 +115,8 @@ public class BlockListener implements Listener { /* * enable block regen. */ - if (info.hasRegen()) { - if (MMOLib.plugin.getVersion().isStrictlyHigher(1, 12)) - MMOCore.plugin.mineManager.initialize(info.startRegeneration(Bukkit.createBlockData(savedData), block.getLocation())); - else - MMOCore.plugin.mineManager.initialize(info.startRegeneration(block.getLocation())); - } + if (info.hasRegen()) + MMOCore.plugin.mineManager.initialize(info.startRegeneration(Bukkit.createBlockData(savedData), block.getLocation())); } @EventHandler(priority = EventPriority.HIGH) diff --git a/src/main/java/net/Indyuce/mmocore/listener/profession/FishingListener.java b/src/main/java/net/Indyuce/mmocore/listener/profession/FishingListener.java index 19063bfa..9f92cd26 100644 --- a/src/main/java/net/Indyuce/mmocore/listener/profession/FishingListener.java +++ b/src/main/java/net/Indyuce/mmocore/listener/profession/FishingListener.java @@ -28,7 +28,6 @@ import net.Indyuce.mmocore.api.experience.EXPSource; import net.Indyuce.mmocore.api.player.PlayerData; import net.Indyuce.mmocore.api.player.stats.StatType; import net.Indyuce.mmocore.manager.profession.FishingManager.FishingDropTable; -import net.mmogroup.mmolib.MMOLib; import net.mmogroup.mmolib.version.VersionSound; public class FishingListener implements Listener { @@ -119,7 +118,8 @@ public class FishingListener implements Listener { @EventHandler public void a(PlayerFishEvent event) { - if (event.getPlayer().equals(player) && !player.hasMetadata("NPC") && (event.getState() == State.CAUGHT_FISH || event.getState() == State.FAILED_ATTEMPT || (MMOLib.plugin.getVersion().isStrictlyHigher(1, 12) ? event.getState() == State.valueOf("REEL_IN") : false))) { + if (event.getPlayer().equals(player) && !player.hasMetadata("NPC") + && (event.getState() == State.CAUGHT_FISH || event.getState() == State.FAILED_ATTEMPT || event.getState() == State.REEL_IN)) { /* * lose the catch if the current fish is gone!