From b470cf56bb45084fd380b960c1aee6086e954660 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Wed, 1 Dec 2021 18:06:55 +0100 Subject: [PATCH] Add BlockCounter Signed-off-by: yoyosource --- .../features/testblock/blockcounter/BlockCounter.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/testblock/blockcounter/BlockCounter.java b/BauSystem_Main/src/de/steamwar/bausystem/features/testblock/blockcounter/BlockCounter.java index b0a7cb0f..e9464e95 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/testblock/blockcounter/BlockCounter.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/testblock/blockcounter/BlockCounter.java @@ -24,7 +24,6 @@ import de.steamwar.bausystem.configplayer.Config; import de.steamwar.bausystem.region.Region; import lombok.experimental.UtilityClass; import org.bukkit.entity.Player; -import yapion.hierarchy.types.YAPIONValue; import java.util.HashMap; import java.util.Map; @@ -35,7 +34,10 @@ public class BlockCounter { public final Map blockCountMap = new HashMap<>(); public boolean isActive(final Player p) { - return (boolean) Config.getInstance().get(p).getYAPIONValueOrSetDefault("blockCounter", new YAPIONValue<>(false)).get(); + if (!Config.getInstance().get(p).containsKey("blockCounter")) { + return false; + } + return Config.getInstance().get(p).getPlainValue("blockCounter"); } public void enable(final Player p) {