From a1ad059f27ccef5b31ddf252dcc5b12431de20f4 Mon Sep 17 00:00:00 2001
From: wuming <1686965528@qq.com>
Date: Tue, 22 Aug 2023 17:20:46 +0800
Subject: [PATCH 1/4] 2.7.0
---
pom.xml | 2 +-
.../superiormc/mythictotem/MythicTotem.java | 11 +++
.../mythictotem/api/TotemActivedEvent.java | 47 +++++++++++
.../mythictotem/commands/SubHelp.java | 1 +
.../configs/GeneralSettingConfigs.java | 4 +
.../mythictotem/events/PlayerClickEvent.java | 4 +-
.../events/TotemRedstoneEvent.java | 2 +-
.../libreforge/EffectCastMythicSkill.java | 65 +++++++++++++++
.../libreforge/TriggerTotemActived.java | 83 +++++++++++++++++++
.../mythictotem/managers/ValidManager.java | 6 ++
src/main/resources/config.yml | 1 +
src/main/resources/plugin.yml | 1 +
12 files changed, 222 insertions(+), 5 deletions(-)
create mode 100644 src/main/java/cn/superiormc/mythictotem/api/TotemActivedEvent.java
create mode 100644 src/main/java/cn/superiormc/mythictotem/libreforge/EffectCastMythicSkill.java
create mode 100644 src/main/java/cn/superiormc/mythictotem/libreforge/TriggerTotemActived.java
diff --git a/pom.xml b/pom.xml
index 1d34c89..9176964 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
cn.superiormc
MythicTotem
- 2.6.0
+ 2.7.0
jar
MythicTotem
diff --git a/src/main/java/cn/superiormc/mythictotem/MythicTotem.java b/src/main/java/cn/superiormc/mythictotem/MythicTotem.java
index 8aee10f..f30f2f3 100644
--- a/src/main/java/cn/superiormc/mythictotem/MythicTotem.java
+++ b/src/main/java/cn/superiormc/mythictotem/MythicTotem.java
@@ -7,8 +7,13 @@
import cn.superiormc.mythictotem.events.PlayerClickEvent;
import cn.superiormc.mythictotem.events.PlayerPlaceEvent;
import cn.superiormc.mythictotem.events.TotemRedstoneEvent;
+import cn.superiormc.mythictotem.libreforge.EffectCastMythicSkill;
+import cn.superiormc.mythictotem.libreforge.TriggerTotemActived;
import cn.superiormc.mythictotem.managers.*;
import cn.superiormc.mythictotem.utils.CheckPluginLoad;
+import com.willfp.libreforge.effects.Effects;
+import com.willfp.libreforge.triggers.Triggers;
+import io.lumine.mythic.api.config.ConfigManager;
import io.th0rgal.protectionlib.ProtectionLib;
import org.bukkit.Bukkit;
import org.bukkit.block.Block;
@@ -45,6 +50,12 @@ public void onEnable() {
instance = this;
ProtectionLib.init(this);
this.saveDefaultConfig();
+ if (GeneralSettingConfigs.GetRegisterLibreforge()) {
+ Effects.INSTANCE.register(new EffectCastMythicSkill());
+ Bukkit.getConsoleSender().sendMessage("§x§9§8§F§B§9§8[MythicTotem] §fRegistered cast_mythic_skill effect for libreforge!");
+ Triggers.INSTANCE.register(new TriggerTotemActived());
+ Bukkit.getConsoleSender().sendMessage("§x§9§8§F§B§9§8[MythicTotem] §fRegistered totem_actived trigger for libreforge!");
+ }
TotemConfigs.GetTotemConfigs();
Events();
Commands();
diff --git a/src/main/java/cn/superiormc/mythictotem/api/TotemActivedEvent.java b/src/main/java/cn/superiormc/mythictotem/api/TotemActivedEvent.java
new file mode 100644
index 0000000..6de040c
--- /dev/null
+++ b/src/main/java/cn/superiormc/mythictotem/api/TotemActivedEvent.java
@@ -0,0 +1,47 @@
+package cn.superiormc.mythictotem.api;
+
+import org.bukkit.Bukkit;
+import org.bukkit.Location;
+import org.bukkit.entity.Player;
+import org.bukkit.event.Event;
+import org.bukkit.event.HandlerList;
+import org.jetbrains.annotations.NotNull;
+
+public class TotemActivedEvent extends Event {
+
+ private static final HandlerList handlers = new HandlerList();
+
+ private final Player player;
+
+ private final Location location;
+
+ private final String totemID;
+
+ public TotemActivedEvent(String totemID, Player player, Location location) {
+ this.player = player;
+ this.location = location;
+ this.totemID = totemID;
+ }
+
+ public Player GetPlayer() {
+ return player;
+ }
+
+ public Location GetLocation() {
+ return location;
+ }
+
+ public String GetTotemID() {
+ return totemID;
+ }
+
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}
diff --git a/src/main/java/cn/superiormc/mythictotem/commands/SubHelp.java b/src/main/java/cn/superiormc/mythictotem/commands/SubHelp.java
index 7cec55e..257e425 100644
--- a/src/main/java/cn/superiormc/mythictotem/commands/SubHelp.java
+++ b/src/main/java/cn/superiormc/mythictotem/commands/SubHelp.java
@@ -2,6 +2,7 @@
import cn.superiormc.mythictotem.configs.Messages;
import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Arrow;
import org.bukkit.entity.Player;
public class SubHelp {
diff --git a/src/main/java/cn/superiormc/mythictotem/configs/GeneralSettingConfigs.java b/src/main/java/cn/superiormc/mythictotem/configs/GeneralSettingConfigs.java
index a8b8a14..22c2046 100644
--- a/src/main/java/cn/superiormc/mythictotem/configs/GeneralSettingConfigs.java
+++ b/src/main/java/cn/superiormc/mythictotem/configs/GeneralSettingConfigs.java
@@ -41,4 +41,8 @@ public static boolean GetBlockDamageEventCancel(){
return MythicTotem.instance.getConfig().getBoolean("settings.disappear.BlockDamageEvent.enabled", false);
}
+ public static boolean GetRegisterLibreforge(){
+ return MythicTotem.instance.getConfig().getBoolean("settings.register-libreforge", false);
+ }
+
}
diff --git a/src/main/java/cn/superiormc/mythictotem/events/PlayerClickEvent.java b/src/main/java/cn/superiormc/mythictotem/events/PlayerClickEvent.java
index e25accd..d90fdcd 100644
--- a/src/main/java/cn/superiormc/mythictotem/events/PlayerClickEvent.java
+++ b/src/main/java/cn/superiormc/mythictotem/events/PlayerClickEvent.java
@@ -3,8 +3,6 @@
import cn.superiormc.mythictotem.MythicTotem;
import cn.superiormc.mythictotem.configs.GeneralSettingConfigs;
import cn.superiormc.mythictotem.managers.ValidManager;
-import dev.lone.itemsadder.api.CustomBlock;
-import io.lumine.mythic.core.items.MythicItem;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
@@ -41,7 +39,7 @@ public void InteractEvent(PlayerInteractEvent event) {
}, MythicTotem.instance.getConfig().getLong("settings.cooldown-tick", 5L));
if (MythicTotem.instance.getConfig().getBoolean("settings.debug", false)) {
Bukkit.getConsoleSender().sendMessage("§x§9§8§F§B§9§8[MythicTotem] §eLocation: " + event.getClickedBlock().getLocation());
- Bukkit.getConsoleSender().sendMessage("§x§9§8§F§B§9§8[MythicTotem] §bIA Block: " + CustomBlock.byAlreadyPlaced(event.getClickedBlock()).getNamespacedID());
+ //Bukkit.getConsoleSender().sendMessage("§x§9§8§F§B§9§8[MythicTotem] §bIA Block: " + CustomBlock.byAlreadyPlaced(event.getClickedBlock()).getNamespacedID());
Bukkit.getConsoleSender().sendMessage("§x§9§8§F§B§9§8[MythicTotem] §cBiome: " + event.getClickedBlock().getBiome().name());
}
}
diff --git a/src/main/java/cn/superiormc/mythictotem/events/TotemRedstoneEvent.java b/src/main/java/cn/superiormc/mythictotem/events/TotemRedstoneEvent.java
index 37c5602..e33b7ea 100644
--- a/src/main/java/cn/superiormc/mythictotem/events/TotemRedstoneEvent.java
+++ b/src/main/java/cn/superiormc/mythictotem/events/TotemRedstoneEvent.java
@@ -21,7 +21,7 @@ public void RedstoneEvent(BlockRedstoneEvent event) {
});
if (MythicTotem.instance.getConfig().getBoolean("settings.debug", false)) {
Bukkit.getConsoleSender().sendMessage("§x§9§8§F§B§9§8[MythicTotem] §eLocation: " + event.getBlock().getLocation());
- Bukkit.getConsoleSender().sendMessage("§x§9§8§F§B§9§8[MythicTotem] §bIA Block: " + CustomBlock.byAlreadyPlaced(event.getBlock()).getNamespacedID());
+ //Bukkit.getConsoleSender().sendMessage("§x§9§8§F§B§9§8[MythicTotem] §bIA Block: " + CustomBlock.byAlreadyPlaced(event.getBlock()).getNamespacedID());
}
}
}
diff --git a/src/main/java/cn/superiormc/mythictotem/libreforge/EffectCastMythicSkill.java b/src/main/java/cn/superiormc/mythictotem/libreforge/EffectCastMythicSkill.java
new file mode 100644
index 0000000..6502ed6
--- /dev/null
+++ b/src/main/java/cn/superiormc/mythictotem/libreforge/EffectCastMythicSkill.java
@@ -0,0 +1,65 @@
+package cn.superiormc.mythictotem.libreforge;
+
+import com.willfp.eco.core.config.interfaces.Config;
+import com.willfp.libreforge.ConfigArguments;
+import com.willfp.libreforge.ConfigArgumentsBuilder;
+import com.willfp.libreforge.NoCompileData;
+import com.willfp.libreforge.effects.Effect;
+import com.willfp.libreforge.triggers.TriggerData;
+import com.willfp.libreforge.triggers.TriggerParameter;
+import io.lumine.mythic.bukkit.MythicBukkit;
+import io.lumine.mythic.core.utils.MythicUtil;
+import org.bukkit.entity.Entity;
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.entity.Player;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.*;
+
+public class EffectCastMythicSkill extends Effect {
+
+ public EffectCastMythicSkill() {
+ super("cast_mythic_skill");
+ }
+
+ @Override
+ public boolean isPermanent() {
+ return false;
+ }
+
+ @Override
+ protected boolean onTrigger(@NotNull Config config, @NotNull TriggerData data, NoCompileData compileData) {
+ if (data.getPlayer() == null) {
+ return false;
+ }
+ Player player = data.getPlayer();
+ LivingEntity victim = MythicUtil.getTargetedEntity(player);
+ if (data.getVictim() != null) {
+ victim = data.getVictim();
+ }
+ if (config.getBoolOrNull("victim_to_player") != null && config.getBoolOrNull("victim_to_player")) {
+ victim = player;
+ }
+ String skill = config.getString("skill");
+ List targets = new ArrayList();
+ targets.add(victim);
+ MythicBukkit.inst().getAPIHelper().castSkill(player, skill, player, player.getLocation(), targets, (Collection)null, 1.0F);
+ return true;
+ }
+
+ @NotNull
+ @Override
+ protected Set getParameters() {
+ Set data = new HashSet<>();
+ data.add(TriggerParameter.PLAYER);
+ return data;
+ }
+
+ @NotNull
+ @Override
+ public ConfigArguments getArguments() {
+ ConfigArgumentsBuilder builder = new ConfigArgumentsBuilder();
+ builder.require("skill", "You must specify the skill to cast!");
+ return builder.build$core();
+ }
+}
diff --git a/src/main/java/cn/superiormc/mythictotem/libreforge/TriggerTotemActived.java b/src/main/java/cn/superiormc/mythictotem/libreforge/TriggerTotemActived.java
new file mode 100644
index 0000000..818bf7a
--- /dev/null
+++ b/src/main/java/cn/superiormc/mythictotem/libreforge/TriggerTotemActived.java
@@ -0,0 +1,83 @@
+package cn.superiormc.mythictotem.libreforge;
+
+import cn.superiormc.mythictotem.api.TotemActivedEvent;
+import com.willfp.libreforge.Holder;
+import com.willfp.libreforge.ProvidedHolder;
+import com.willfp.libreforge.SimpleProvidedHolder;
+import com.willfp.libreforge.triggers.Trigger;
+import com.willfp.libreforge.triggers.TriggerData;
+import com.willfp.libreforge.triggers.TriggerParameter;
+import org.bukkit.Location;
+import org.bukkit.block.Block;
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.HashSet;
+import java.util.Set;
+
+public class TriggerTotemActived extends Trigger {
+
+ public TriggerTotemActived() {
+ super("totem_actived");
+ }
+
+
+ @NotNull
+ @Override
+ public Set getParameters() {
+ Set data = new HashSet<>();
+ data.add(TriggerParameter.PLAYER);
+ data.add(TriggerParameter.BLOCK);
+ data.add(TriggerParameter.LOCATION);
+ data.add(TriggerParameter.TEXT);
+ return data;
+ }
+
+ @EventHandler
+ public void handle(TotemActivedEvent event) {
+ Player player = event.GetPlayer();
+ Location location = event.GetLocation();
+ Block block = location.getBlock();
+ String text = event.GetTotemID();
+ ProvidedHolder holder = new ProvidedHolder() {
+ @NotNull
+ @Override
+ public Holder getHolder() {
+ return null;
+ }
+
+ @Nullable
+ @Override
+ public Object getProvider() {
+ return null;
+ }
+
+ @NotNull
+ @Override
+ public Holder component1() {
+ return null;
+ }
+
+ @Nullable
+ @Override
+ public Object component2() {
+ return null;
+ }
+ };
+ TriggerData data = new TriggerData(holder,
+ player,
+ null,
+ block,
+ null,
+ location,
+ null,
+ null,
+ null,
+ text,
+ 1,
+ player);
+ this.dispatch(player, data, null);
+ }
+}
diff --git a/src/main/java/cn/superiormc/mythictotem/managers/ValidManager.java b/src/main/java/cn/superiormc/mythictotem/managers/ValidManager.java
index 2b511ec..9c3556e 100644
--- a/src/main/java/cn/superiormc/mythictotem/managers/ValidManager.java
+++ b/src/main/java/cn/superiormc/mythictotem/managers/ValidManager.java
@@ -1,6 +1,7 @@
package cn.superiormc.mythictotem.managers;
import cn.superiormc.mythictotem.MythicTotem;
+import cn.superiormc.mythictotem.api.TotemActivedEvent;
import cn.superiormc.mythictotem.utils.CheckPluginLoad;
import cn.superiormc.mythictotem.utils.CheckProtection;
import cn.superiormc.mythictotem.utils.RemoveBlock;
@@ -543,6 +544,11 @@ private void AfterCheck(PlacedBlockCheckManager singleTotem,
Bukkit.getScheduler().callSyncMethod(MythicTotem.instance, () -> {
ActionManager actionManager = new ActionManager(startLocation, singleTotem, singleTotem.GetTotemManager().GetTotemAction(), player, block);
actionManager.CheckAction();
+ TotemActivedEvent totemActivedEvent = new TotemActivedEvent(
+ singleTotem.GetTotemManager().GetSection().getName(),
+ this.player,
+ this.block.getLocation());
+ Bukkit.getPluginManager().callEvent(totemActivedEvent);
return null;
});
}
diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml
index 6f825e5..91e3e1b 100644
--- a/src/main/resources/config.yml
+++ b/src/main/resources/config.yml
@@ -71,6 +71,7 @@ settings:
can-break: false
can-interact: false
can-use: false
+ register-libreforge: true
disappear:
BukkitAPI:
# This BukkitAPI option can not be disabled!
diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml
index ec1f3f1..98f4172 100644
--- a/src/main/resources/plugin.yml
+++ b/src/main/resources/plugin.yml
@@ -13,6 +13,7 @@ softdepend:
- Lands
- PlotSquared
- CrashClaim
+ - libreforge
commands:
mythictotem:
From 081f167ffefca06243497de5f57019a49e414c78 Mon Sep 17 00:00:00 2001
From: wuming <1686965528@qq.com>
Date: Fri, 25 Aug 2023 10:18:24 +0800
Subject: [PATCH 2/4] 2.7.1
---
pom.xml | 2 +-
.../superiormc/mythictotem/MythicTotem.java | 10 +--
.../mythictotem/commands/SubHelp.java | 1 -
.../events/TotemRedstoneEvent.java | 3 -
.../libreforge/EffectCastMythicSkill.java | 65 -------------------
.../mythictotem/managers/ValidManager.java | 1 +
6 files changed, 5 insertions(+), 77 deletions(-)
delete mode 100644 src/main/java/cn/superiormc/mythictotem/libreforge/EffectCastMythicSkill.java
diff --git a/pom.xml b/pom.xml
index 9176964..a70a391 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
cn.superiormc
MythicTotem
- 2.7.0
+ 2.7.1
jar
MythicTotem
diff --git a/src/main/java/cn/superiormc/mythictotem/MythicTotem.java b/src/main/java/cn/superiormc/mythictotem/MythicTotem.java
index f30f2f3..6c6abed 100644
--- a/src/main/java/cn/superiormc/mythictotem/MythicTotem.java
+++ b/src/main/java/cn/superiormc/mythictotem/MythicTotem.java
@@ -7,13 +7,11 @@
import cn.superiormc.mythictotem.events.PlayerClickEvent;
import cn.superiormc.mythictotem.events.PlayerPlaceEvent;
import cn.superiormc.mythictotem.events.TotemRedstoneEvent;
-import cn.superiormc.mythictotem.libreforge.EffectCastMythicSkill;
import cn.superiormc.mythictotem.libreforge.TriggerTotemActived;
-import cn.superiormc.mythictotem.managers.*;
+import cn.superiormc.mythictotem.managers.PlacedBlockCheckManager;
+import cn.superiormc.mythictotem.managers.TotemManager;
import cn.superiormc.mythictotem.utils.CheckPluginLoad;
-import com.willfp.libreforge.effects.Effects;
import com.willfp.libreforge.triggers.Triggers;
-import io.lumine.mythic.api.config.ConfigManager;
import io.th0rgal.protectionlib.ProtectionLib;
import org.bukkit.Bukkit;
import org.bukkit.block.Block;
@@ -31,7 +29,7 @@ public final class MythicTotem extends JavaPlugin {
public static String lastErrorMessage = "";
- public static boolean freeVersion = true;
+ public static boolean freeVersion = false;
public static int threeDtotemAmount = 0;
@@ -51,8 +49,6 @@ public void onEnable() {
ProtectionLib.init(this);
this.saveDefaultConfig();
if (GeneralSettingConfigs.GetRegisterLibreforge()) {
- Effects.INSTANCE.register(new EffectCastMythicSkill());
- Bukkit.getConsoleSender().sendMessage("§x§9§8§F§B§9§8[MythicTotem] §fRegistered cast_mythic_skill effect for libreforge!");
Triggers.INSTANCE.register(new TriggerTotemActived());
Bukkit.getConsoleSender().sendMessage("§x§9§8§F§B§9§8[MythicTotem] §fRegistered totem_actived trigger for libreforge!");
}
diff --git a/src/main/java/cn/superiormc/mythictotem/commands/SubHelp.java b/src/main/java/cn/superiormc/mythictotem/commands/SubHelp.java
index 257e425..7cec55e 100644
--- a/src/main/java/cn/superiormc/mythictotem/commands/SubHelp.java
+++ b/src/main/java/cn/superiormc/mythictotem/commands/SubHelp.java
@@ -2,7 +2,6 @@
import cn.superiormc.mythictotem.configs.Messages;
import org.bukkit.command.CommandSender;
-import org.bukkit.entity.Arrow;
import org.bukkit.entity.Player;
public class SubHelp {
diff --git a/src/main/java/cn/superiormc/mythictotem/events/TotemRedstoneEvent.java b/src/main/java/cn/superiormc/mythictotem/events/TotemRedstoneEvent.java
index 1376fb9..e33b7ea 100644
--- a/src/main/java/cn/superiormc/mythictotem/events/TotemRedstoneEvent.java
+++ b/src/main/java/cn/superiormc/mythictotem/events/TotemRedstoneEvent.java
@@ -14,9 +14,6 @@ public class TotemRedstoneEvent implements Listener {
@EventHandler
public void RedstoneEvent(BlockRedstoneEvent event) {
- if (event.isCancelled()) {
- return;
- }
Bukkit.getScheduler().runTaskAsynchronously(MythicTotem.instance, () -> {
synchronized(event) {
new ValidManager(event);
diff --git a/src/main/java/cn/superiormc/mythictotem/libreforge/EffectCastMythicSkill.java b/src/main/java/cn/superiormc/mythictotem/libreforge/EffectCastMythicSkill.java
deleted file mode 100644
index 6502ed6..0000000
--- a/src/main/java/cn/superiormc/mythictotem/libreforge/EffectCastMythicSkill.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package cn.superiormc.mythictotem.libreforge;
-
-import com.willfp.eco.core.config.interfaces.Config;
-import com.willfp.libreforge.ConfigArguments;
-import com.willfp.libreforge.ConfigArgumentsBuilder;
-import com.willfp.libreforge.NoCompileData;
-import com.willfp.libreforge.effects.Effect;
-import com.willfp.libreforge.triggers.TriggerData;
-import com.willfp.libreforge.triggers.TriggerParameter;
-import io.lumine.mythic.bukkit.MythicBukkit;
-import io.lumine.mythic.core.utils.MythicUtil;
-import org.bukkit.entity.Entity;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.entity.Player;
-import org.jetbrains.annotations.NotNull;
-
-import java.util.*;
-
-public class EffectCastMythicSkill extends Effect {
-
- public EffectCastMythicSkill() {
- super("cast_mythic_skill");
- }
-
- @Override
- public boolean isPermanent() {
- return false;
- }
-
- @Override
- protected boolean onTrigger(@NotNull Config config, @NotNull TriggerData data, NoCompileData compileData) {
- if (data.getPlayer() == null) {
- return false;
- }
- Player player = data.getPlayer();
- LivingEntity victim = MythicUtil.getTargetedEntity(player);
- if (data.getVictim() != null) {
- victim = data.getVictim();
- }
- if (config.getBoolOrNull("victim_to_player") != null && config.getBoolOrNull("victim_to_player")) {
- victim = player;
- }
- String skill = config.getString("skill");
- List targets = new ArrayList();
- targets.add(victim);
- MythicBukkit.inst().getAPIHelper().castSkill(player, skill, player, player.getLocation(), targets, (Collection)null, 1.0F);
- return true;
- }
-
- @NotNull
- @Override
- protected Set getParameters() {
- Set data = new HashSet<>();
- data.add(TriggerParameter.PLAYER);
- return data;
- }
-
- @NotNull
- @Override
- public ConfigArguments getArguments() {
- ConfigArgumentsBuilder builder = new ConfigArgumentsBuilder();
- builder.require("skill", "You must specify the skill to cast!");
- return builder.build$core();
- }
-}
diff --git a/src/main/java/cn/superiormc/mythictotem/managers/ValidManager.java b/src/main/java/cn/superiormc/mythictotem/managers/ValidManager.java
index 9c3556e..ad1a15e 100644
--- a/src/main/java/cn/superiormc/mythictotem/managers/ValidManager.java
+++ b/src/main/java/cn/superiormc/mythictotem/managers/ValidManager.java
@@ -9,6 +9,7 @@
import io.th0rgal.oraxen.api.OraxenBlocks;
import org.bukkit.Bukkit;
import org.bukkit.Location;
+import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.block.BlockPlaceEvent;
From 07184fb68d3cbed8e349cbd12d329fec61081d60 Mon Sep 17 00:00:00 2001
From: wuming <1686965528@qq.com>
Date: Fri, 25 Aug 2023 10:23:11 +0800
Subject: [PATCH 3/4] 2.7.1
---
src/main/java/cn/superiormc/mythictotem/MythicTotem.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/cn/superiormc/mythictotem/MythicTotem.java b/src/main/java/cn/superiormc/mythictotem/MythicTotem.java
index 6c6abed..3eab4c6 100644
--- a/src/main/java/cn/superiormc/mythictotem/MythicTotem.java
+++ b/src/main/java/cn/superiormc/mythictotem/MythicTotem.java
@@ -29,7 +29,7 @@ public final class MythicTotem extends JavaPlugin {
public static String lastErrorMessage = "";
- public static boolean freeVersion = false;
+ public static boolean freeVersion = true;
public static int threeDtotemAmount = 0;
From 29bbdcfba888d4eeaac16822c49defaaa71e9055 Mon Sep 17 00:00:00 2001
From: wuming <1686965528@qq.com>
Date: Mon, 28 Aug 2023 02:25:10 +0800
Subject: [PATCH 4/4] 2.7.3
---
pom.xml | 2 +-
src/main/java/cn/superiormc/mythictotem/MythicTotem.java | 6 +++---
.../mythictotem/libreforge/TriggerTotemActived.java | 5 +++++
src/main/resources/config.yml | 2 +-
src/main/resources/plugin.yml | 1 -
5 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/pom.xml b/pom.xml
index a70a391..22d99fe 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
cn.superiormc
MythicTotem
- 2.7.1
+ 2.7.3
jar
MythicTotem
diff --git a/src/main/java/cn/superiormc/mythictotem/MythicTotem.java b/src/main/java/cn/superiormc/mythictotem/MythicTotem.java
index 3eab4c6..057c099 100644
--- a/src/main/java/cn/superiormc/mythictotem/MythicTotem.java
+++ b/src/main/java/cn/superiormc/mythictotem/MythicTotem.java
@@ -11,7 +11,6 @@
import cn.superiormc.mythictotem.managers.PlacedBlockCheckManager;
import cn.superiormc.mythictotem.managers.TotemManager;
import cn.superiormc.mythictotem.utils.CheckPluginLoad;
-import com.willfp.libreforge.triggers.Triggers;
import io.th0rgal.protectionlib.ProtectionLib;
import org.bukkit.Bukkit;
import org.bukkit.block.Block;
@@ -29,7 +28,7 @@ public final class MythicTotem extends JavaPlugin {
public static String lastErrorMessage = "";
- public static boolean freeVersion = true;
+ public static boolean freeVersion = false;
public static int threeDtotemAmount = 0;
@@ -49,7 +48,8 @@ public void onEnable() {
ProtectionLib.init(this);
this.saveDefaultConfig();
if (GeneralSettingConfigs.GetRegisterLibreforge()) {
- Triggers.INSTANCE.register(new TriggerTotemActived());
+ Bukkit.getConsoleSender().sendMessage("§x§9§8§F§B§9§8[MythicTotem] §fHooking into libreforge...");
+ TriggerTotemActived.load();
Bukkit.getConsoleSender().sendMessage("§x§9§8§F§B§9§8[MythicTotem] §fRegistered totem_actived trigger for libreforge!");
}
TotemConfigs.GetTotemConfigs();
diff --git a/src/main/java/cn/superiormc/mythictotem/libreforge/TriggerTotemActived.java b/src/main/java/cn/superiormc/mythictotem/libreforge/TriggerTotemActived.java
index 818bf7a..ab89a66 100644
--- a/src/main/java/cn/superiormc/mythictotem/libreforge/TriggerTotemActived.java
+++ b/src/main/java/cn/superiormc/mythictotem/libreforge/TriggerTotemActived.java
@@ -7,6 +7,7 @@
import com.willfp.libreforge.triggers.Trigger;
import com.willfp.libreforge.triggers.TriggerData;
import com.willfp.libreforge.triggers.TriggerParameter;
+import com.willfp.libreforge.triggers.Triggers;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
@@ -19,6 +20,10 @@
public class TriggerTotemActived extends Trigger {
+ public static void load() {
+ Triggers.INSTANCE.register(new TriggerTotemActived());
+ }
+
public TriggerTotemActived() {
super("totem_actived");
}
diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml
index 91e3e1b..7751ead 100644
--- a/src/main/resources/config.yml
+++ b/src/main/resources/config.yml
@@ -71,7 +71,7 @@ settings:
can-break: false
can-interact: false
can-use: false
- register-libreforge: true
+ register-libreforge: false
disappear:
BukkitAPI:
# This BukkitAPI option can not be disabled!
diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml
index 98f4172..ec1f3f1 100644
--- a/src/main/resources/plugin.yml
+++ b/src/main/resources/plugin.yml
@@ -13,7 +13,6 @@ softdepend:
- Lands
- PlotSquared
- CrashClaim
- - libreforge
commands:
mythictotem: