!Removed 1.12 function calls

This commit is contained in:
Indyuce 2020-08-12 15:56:39 +02:00
parent 96af274bfe
commit 12aaf8ca6c
4 changed files with 7 additions and 16 deletions

View File

@ -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;
}

View File

@ -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;

View File

@ -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)

View File

@ -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!