Skip to content

Commit

Permalink
updating dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanguygab committed Jan 26, 2024
1 parent f59edb3 commit 11f57e6
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 27 deletions.
24 changes: 14 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,32 @@ repositories {
url = 'https://jitpack.io'
}
maven {
name = 'Protocolize-repo'
name = 'Protocolize-repo'
url = 'https://mvn.exceptionflug.de/repository/exceptionflug-public/'
}
maven {
name = "sonatype-oss-snapshots1"
url = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
}
}

dependencies {
compileOnly 'net.md-5:bungeecord-api:1.20-R0.1-SNAPSHOT'
compileOnly 'org.spigotmc:spigot-api:1.20.2-R0.1-SNAPSHOT'
compileOnly files('../../dependencies/TAB-4.0.6.jar')
compileOnly 'org.spigotmc:spigot-api:1.20.4-R0.1-SNAPSHOT'
compileOnly files('../../dependencies/TAB-4.1.3-SNAPSHOT.jar')
compileOnly 'org.projectlombok:lombok:1.18.20'
annotationProcessor 'org.projectlombok:lombok:1.18.20'

compileOnly 'com.discordsrv:discordsrv:1.27.0-SNAPSHOT'
compileOnly 'net.essentialsx:EssentialsXDiscord:2.19.4'
compileOnly 'com.loohp:InteractiveChat:4.2.8.0'
compileOnly 'com.discordsrv:discordsrv:1.27.0'
compileOnly 'net.essentialsx:EssentialsXDiscord:2.20.1'
compileOnly 'com.loohp:InteractiveChat:4.2.9.0'
compileOnly 'com.github.DevLeoko:AdvancedBan:2.3.0'
compileOnly 'dev.simplix:protocolize-api:2.2.6'

implementation "net.kyori:adventure-platform-bukkit:4.3.1"
implementation "net.kyori:adventure-platform-bungeecord:4.3.1"
implementation "net.kyori:adventure-text-minimessage:4.14.0"
implementation("net.kyori:adventure-text-serializer-plain:4.14.0")
implementation "net.kyori:adventure-platform-bukkit:4.3.2"
implementation "net.kyori:adventure-platform-bungeecord:4.3.2"
implementation "net.kyori:adventure-text-minimessage:4.15.0"
implementation("net.kyori:adventure-text-serializer-plain:4.15.0")
}

shadowJar {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
import me.neznamy.tab.shared.features.PlaceholderManagerImpl;
import me.neznamy.tab.shared.features.types.TabFeature;
import me.neznamy.tab.shared.features.types.UnLoadable;
import me.neznamy.tab.shared.placeholders.PlayerPlaceholderImpl;
import me.neznamy.tab.shared.placeholders.RelationalPlaceholderImpl;
import me.neznamy.tab.shared.placeholders.ServerPlaceholderImpl;
import me.neznamy.tab.shared.placeholders.types.PlayerPlaceholderImpl;
import me.neznamy.tab.shared.placeholders.types.RelationalPlaceholderImpl;
import me.neznamy.tab.shared.placeholders.types.ServerPlaceholderImpl;
import me.neznamy.tab.shared.platform.TabPlayer;

import me.neznamy.tab.shared.placeholders.conditions.Condition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import lombok.Getter;
import me.neznamy.tab.shared.TAB;
import me.neznamy.tab.shared.placeholders.TabPlaceholder;
import me.neznamy.tab.shared.placeholders.types.TabPlaceholder;
import me.neznamy.tab.shared.platform.TabPlayer;
import me.neznamy.tab.shared.features.PlaceholderManagerImpl;

Expand Down Expand Up @@ -63,15 +63,13 @@ public class AdvancedConditions {
*/
public AdvancedConditions(String name, Map<String,String> conditions) {
this.name = name;
if (conditions == null) {
TAB.getInstance().getMisconfigurationHelper().conditionHasNoConditions(name);
return;
}
if (conditions == null) return;

PlaceholderManagerImpl pm = TAB.getInstance().getPlaceholderManager();
conditions.forEach((line,text)->{
BiFunction<TabPlayer, TabPlayer, Boolean> condition = compile(line);
if (condition == null && !line.equals("else")) {
TAB.getInstance().getMisconfigurationHelper().invalidConditionPattern("[TAB-Additions]-"+name, line);
TAB.getInstance().getConfigHelper().startup().invalidConditionPattern("[TAB-Additions]-"+name, line);
return;
}
subConditions.put(condition,text);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import me.neznamy.tab.shared.platform.TabPlayer;
import me.neznamy.tab.shared.TAB;
import org.jetbrains.annotations.NotNull;

import java.util.function.BiFunction;

Expand Down Expand Up @@ -54,7 +55,7 @@ public double getLeftSide(TabPlayer viewer, TabPlayer target) {
if (leftSideStatic) return leftSideValue;
String value = parseLeftSide(viewer,target);
if (value.contains(",")) value = value.replace(",", "");
return TAB.getInstance().getErrorManager().parseDouble(value, 0);
return parseDouble(leftSide,value,0,viewer);
}

/**
Expand All @@ -67,11 +68,34 @@ public double getRightSide(TabPlayer viewer, TabPlayer target) {
if (rightSideStatic) return rightSideValue;
String value = parseRightSide(viewer,target);
if (value.contains(",")) value = value.replace(",", "");
return TAB.getInstance().getErrorManager().parseDouble(value, 0);
return parseDouble(rightSide,value,0,viewer);
}

@Override
public boolean isMet(TabPlayer viewer, TabPlayer target) {
return function.apply(getLeftSide(viewer,target), getRightSide(viewer,target));
}

/**
* Parses double in given string and returns it.
* Returns second argument if string is not valid and prints a console warn.
*
* @param placeholder
* Raw placeholder, used in error message
* @param output
* string to parse
* @param defaultValue
* value to return if string is not valid
* @param player
* Player name used in error message
* @return parsed double or {@code defaultValue} if input is invalid
*/
public double parseDouble(@NotNull String placeholder, @NotNull String output, double defaultValue, TabPlayer player) {
try {
return Double.parseDouble(output);
} catch (NumberFormatException e) {
TAB.getInstance().getConfigHelper().runtime().invalidNumberForCondition(placeholder, output, player);
return defaultValue;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import me.neznamy.tab.shared.TAB;
import me.neznamy.tab.shared.config.file.ConfigurationFile;
import me.neznamy.tab.shared.features.types.*;
import me.neznamy.tab.shared.placeholders.PlayerPlaceholderImpl;
import me.neznamy.tab.shared.placeholders.RelationalPlaceholderImpl;
import me.neznamy.tab.shared.placeholders.types.PlayerPlaceholderImpl;
import me.neznamy.tab.shared.placeholders.types.RelationalPlaceholderImpl;
import me.neznamy.tab.shared.platform.TabPlayer;
import net.kyori.adventure.platform.AudienceProvider;
import net.kyori.adventure.text.Component;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import io.github.tanguygab.tabadditions.shared.TABAdditions;
import io.github.tanguygab.tabadditions.shared.TranslationFile;
import me.neznamy.tab.shared.TAB;
import me.neznamy.tab.shared.placeholders.PlayerPlaceholderImpl;
import me.neznamy.tab.shared.placeholders.types.PlayerPlaceholderImpl;
import me.neznamy.tab.shared.platform.TabPlayer;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import me.neznamy.tab.api.placeholder.PlaceholderManager;
import me.neznamy.tab.api.TabAPI;
import me.neznamy.tab.api.TabPlayer;
import me.neznamy.tab.shared.TAB;
import me.neznamy.tab.platforms.bukkit.nms.BukkitReflection;
import net.essentialsx.api.v2.services.discord.DiscordService;
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
import net.md_5.bungee.api.ChatMessageType;
Expand Down Expand Up @@ -40,7 +40,7 @@ public class SpigotPlatform extends Platform {
public SpigotPlatform(TABAdditionsSpigot plugin) {
this.plugin = plugin;
kyori = BukkitAudiences.create(plugin);
chatSuggestions = TAB.getInstance().getServerVersion().getNetworkId() >= 762;
chatSuggestions = BukkitReflection.is1_19_3Plus();
try {
getCommandMap = plugin.getServer().getClass().getMethod("getCommandMap");
} catch (Exception ignored) {}
Expand Down Expand Up @@ -76,7 +76,7 @@ public void registerPlaceholders(PlaceholderManager pm) {
public void registerCommand(String cmd, String... aliases) {
try {
Command command = new BukkitCommand(cmd,"","/"+cmd,List.of(aliases)) {
@Override public boolean execute(@NotNull CommandSender sender, @NotNull String commandLabel, String[] args) {return true;}
@Override public boolean execute(@NotNull CommandSender sender, @NotNull String commandLabel, @NotNull String[] args) {return true;}
};
((SimpleCommandMap)getCommandMap.invoke(plugin.getServer())).register(cmd,"chat",command);
} catch (Exception e) {e.printStackTrace();}
Expand Down

0 comments on commit 11f57e6

Please sign in to comment.