mirror of
https://github.com/Artillex-Studios/AxTrade.git
synced 2025-01-07 19:17:53 +01:00
1.6.1
This commit is contained in:
parent
46ac53683d
commit
09c771e1c1
11
pom.xml
11
pom.xml
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>com.artillexstudios</groupId>
|
<groupId>com.artillexstudios</groupId>
|
||||||
<artifactId>AxTrade</artifactId>
|
<artifactId>AxTrade</artifactId>
|
||||||
<version>1.6.0</version>
|
<version>1.6.1</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>AxTrade</name>
|
<name>AxTrade</name>
|
||||||
@ -112,7 +112,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.artillexstudios.axapi</groupId>
|
<groupId>com.artillexstudios.axapi</groupId>
|
||||||
<artifactId>axapi</artifactId>
|
<artifactId>axapi</artifactId>
|
||||||
<version>1.4.259</version>
|
<version>1.4.280</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
<classifier>all</classifier>
|
<classifier>all</classifier>
|
||||||
</dependency>
|
</dependency>
|
||||||
@ -255,5 +255,12 @@
|
|||||||
<version>main-3338e61c6c-1</version>
|
<version>main-3338e61c6c-1</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>me.mraxetv.beasttokens.api</groupId>
|
||||||
|
<artifactId>BeastTokens</artifactId>
|
||||||
|
<version>3.13.3</version>
|
||||||
|
<systemPath>${project.basedir}/libs/bt-api-3.13.3.jar</systemPath>
|
||||||
|
<scope>system</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package com.artillexstudios.axtrade.commands;
|
package com.artillexstudios.axtrade.commands;
|
||||||
|
|
||||||
import com.artillexstudios.axapi.nms.NMSHandlers;
|
import com.artillexstudios.axapi.nms.NMSHandlers;
|
||||||
import com.artillexstudios.axapi.reflection.FastFieldAccessor;
|
|
||||||
import com.artillexstudios.axapi.utils.StringUtils;
|
import com.artillexstudios.axapi.utils.StringUtils;
|
||||||
import com.artillexstudios.axtrade.AxTrade;
|
import com.artillexstudios.axtrade.AxTrade;
|
||||||
import com.artillexstudios.axtrade.hooks.HookManager;
|
import com.artillexstudios.axtrade.hooks.HookManager;
|
||||||
@ -13,7 +12,6 @@ import com.artillexstudios.axtrade.utils.NumberUtils;
|
|||||||
import com.artillexstudios.axtrade.utils.SoundUtils;
|
import com.artillexstudios.axtrade.utils.SoundUtils;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.OfflinePlayer;
|
import org.bukkit.OfflinePlayer;
|
||||||
import org.bukkit.Warning;
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.HumanEntity;
|
import org.bukkit.entity.HumanEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -140,11 +138,7 @@ public class Commands implements OrphanCommand {
|
|||||||
private static BukkitCommandHandler handler = null;
|
private static BukkitCommandHandler handler = null;
|
||||||
public static void registerCommand() {
|
public static void registerCommand() {
|
||||||
if (handler == null) {
|
if (handler == null) {
|
||||||
Warning.WarningState prevState = Bukkit.getWarningState();
|
|
||||||
FastFieldAccessor accessor = FastFieldAccessor.forClassField(Bukkit.getServer().getClass().getPackage().getName() + ".CraftServer", "warningState");
|
|
||||||
accessor.set(Bukkit.getServer(), Warning.WarningState.OFF);
|
|
||||||
handler = BukkitCommandHandler.create(AxTrade.getInstance());
|
handler = BukkitCommandHandler.create(AxTrade.getInstance());
|
||||||
accessor.set(Bukkit.getServer(), prevState);
|
|
||||||
|
|
||||||
handler.registerValueResolver(0, OfflinePlayer.class, context -> {
|
handler.registerValueResolver(0, OfflinePlayer.class, context -> {
|
||||||
String value = context.pop();
|
String value = context.pop();
|
||||||
|
@ -2,6 +2,7 @@ package com.artillexstudios.axtrade.hooks;
|
|||||||
|
|
||||||
import com.artillexstudios.axapi.utils.StringUtils;
|
import com.artillexstudios.axapi.utils.StringUtils;
|
||||||
import com.artillexstudios.axtrade.hooks.currency.AxQuestBoardHook;
|
import com.artillexstudios.axtrade.hooks.currency.AxQuestBoardHook;
|
||||||
|
import com.artillexstudios.axtrade.hooks.currency.BeastTokensHook;
|
||||||
import com.artillexstudios.axtrade.hooks.currency.CoinsEngineHook;
|
import com.artillexstudios.axtrade.hooks.currency.CoinsEngineHook;
|
||||||
import com.artillexstudios.axtrade.hooks.currency.CurrencyHook;
|
import com.artillexstudios.axtrade.hooks.currency.CurrencyHook;
|
||||||
import com.artillexstudios.axtrade.hooks.currency.ExperienceHook;
|
import com.artillexstudios.axtrade.hooks.currency.ExperienceHook;
|
||||||
@ -105,6 +106,11 @@ public class HookManager {
|
|||||||
Bukkit.getConsoleSender().sendMessage(StringUtils.formatToString("!FF33[AxTrade] Hooked into RedisEconomy!"));
|
Bukkit.getConsoleSender().sendMessage(StringUtils.formatToString("!FF33[AxTrade] Hooked into RedisEconomy!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (HOOKS.getBoolean("currencies.BeastTokens.register", true) && Bukkit.getPluginManager().getPlugin("BeastTokens") != null) {
|
||||||
|
currency.add(new BeastTokensHook());
|
||||||
|
Bukkit.getConsoleSender().sendMessage(StringUtils.formatToString("!FF33[AxTrade] Hooked into BeastTokens!"));
|
||||||
|
}
|
||||||
|
|
||||||
for (String str : HOOKS.getSection("placeholder-currencies").getRoutesAsStrings(false)) {
|
for (String str : HOOKS.getSection("placeholder-currencies").getRoutesAsStrings(false)) {
|
||||||
if (!HOOKS.getBoolean("placeholder-currencies." + str + ".register", false)) continue;
|
if (!HOOKS.getBoolean("placeholder-currencies." + str + ".register", false)) continue;
|
||||||
currency.add(new PlaceholderCurrencyHook(str, HOOKS.getSection("placeholder-currencies." + str)));
|
currency.add(new PlaceholderCurrencyHook(str, HOOKS.getSection("placeholder-currencies." + str)));
|
||||||
|
@ -0,0 +1,56 @@
|
|||||||
|
package com.artillexstudios.axtrade.hooks.currency;
|
||||||
|
|
||||||
|
import me.mraxetv.beasttokens.api.BeastTokensAPI;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import static com.artillexstudios.axtrade.AxTrade.HOOKS;
|
||||||
|
|
||||||
|
public class BeastTokensHook implements CurrencyHook {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setup() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "BeastTokens";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDisplayName() {
|
||||||
|
return HOOKS.getString("currencies.BeastTokens.name");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean worksOffline() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean usesDouble() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isPersistent() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getBalance(@NotNull UUID player) {
|
||||||
|
return BeastTokensAPI.getTokensManager().getTokens(Bukkit.getOfflinePlayer(player));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void giveBalance(@NotNull UUID player, double amount) {
|
||||||
|
BeastTokensAPI.getTokensManager().addTokens(Bukkit.getOfflinePlayer(player), amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void takeBalance(@NotNull UUID player, double amount) {
|
||||||
|
BeastTokensAPI.getTokensManager().removeTokens(Bukkit.getOfflinePlayer(player), amount);
|
||||||
|
}
|
||||||
|
}
|
@ -41,9 +41,11 @@ public class UpdateNotifier implements Listener {
|
|||||||
this.newest = isLatest(current);
|
this.newest = isLatest(current);
|
||||||
|
|
||||||
if (latest == null || newest) return;
|
if (latest == null || newest) return;
|
||||||
|
Scheduler.get().runLaterAsync(t2 -> {
|
||||||
Bukkit.getConsoleSender().sendMessage(getMessage());
|
Bukkit.getConsoleSender().sendMessage(getMessage());
|
||||||
|
}, 50L);
|
||||||
t.cancel();
|
t.cancel();
|
||||||
}, 50L, time);
|
}, 0, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
@ -70,6 +70,9 @@ currencies:
|
|||||||
enabled:
|
enabled:
|
||||||
- currency-name: "coins"
|
- currency-name: "coins"
|
||||||
name: "coins"
|
name: "coins"
|
||||||
|
BeastTokens:
|
||||||
|
register: true
|
||||||
|
name: "tokens"
|
||||||
|
|
||||||
# do not change this
|
# do not change this
|
||||||
version: 6
|
version: 7
|
@ -23,3 +23,4 @@ softdepend:
|
|||||||
- TokenManager
|
- TokenManager
|
||||||
- UltraEconomy
|
- UltraEconomy
|
||||||
- RedisEconomy
|
- RedisEconomy
|
||||||
|
- BeastTokens
|
Loading…
Reference in New Issue
Block a user