Author SHA1 Message Date
redtea 4877ff0003 Merge branch 'main' of https://github.com/iRedTea/NoDropX 2023-07-25 03:09:19 +03:00
redtea 30726108a4 1.0.1 SNAPSHOT
Update checker
2023-07-25 03:07:21 +03:00
Denis Istratov b09aa71a73 Update README.md 2023-07-25 02:26:47 +03:00
Denis Istratov 82c585350c Update README.md 2023-07-25 02:26:32 +03:00
Denis Istratov 9352296d65 Update README.md 2023-07-25 02:25:27 +03:00
Denis Istratov 674cc3bff7 Update README.md 2023-07-25 02:02:37 +03:00
Denis Istratov e298b20f40 Update README.md 2023-07-25 01:57:55 +03:00
Denis Istratov a21ac871db Update README.md 2023-07-25 01:57:25 +03:00
Denis Istratov 61188df8f7 Update README.md 2023-07-25 01:56:49 +03:00
Denis Istratov 12d150ad13 Update README.md 2023-07-25 01:56:21 +03:00
7 changed files with 62 additions and 20 deletions

No files matched your search

+10 -7
View File
@@ -1,15 +1,18 @@
<img src="https://i.imgur.com/AxYMos8.png)https://i.imgur.com/AxYMos8.png"></img>
# NoDropX # NoDropX
Give no drop items! **Give no drop items!**
The plugin will allow you to create items that will not drop out of your inventory at death! The plugin will allow you to create items that will not drop out of your inventory at death!
Give an no drop item: /nodrop give [player] [item] (count) Give an no drop item: `/nodrop give [player] [item] (count)`
features: **Features:**
- Support HEX Colors (MiniMessages and MD5 ChatColor) - Supports HEX Colors (MiniMessages and MD5 ChatColor)
- Support all versions from 1.12.2 to 1.20.1 - Supports all versions from 1.12.2 to 1.20.1 (Spigot/Paper)
- No drop items storage: /nodrop gui - No drop items storage: `/nodrop gui`
- Fully customization - Fully customization
- Items that protect other slots from death - Items that protect other slots from death
- Developer API
- Mods support (tested on Arclight 1.16.5)
<img src="https://i.imgur.com/s2BwNH5.png"></img> <img src="https://i.imgur.com/vakBZX7.png"></img>
+1 -2
View File
@@ -5,7 +5,7 @@ plugins {
} }
group = 'me.redtea' group = 'me.redtea'
version = '1.0.0-SNAPSHOT' version = '1.0.1-SNAPSHOT'
repositories { repositories {
mavenCentral() mavenCentral()
@@ -37,7 +37,6 @@ dependencies {
implementation "net.kyori:adventure-api:4.14.0" implementation "net.kyori:adventure-api:4.14.0"
implementation "net.kyori:adventure-platform-bukkit:4.3.0" implementation "net.kyori:adventure-platform-bukkit:4.3.0"
implementation files("libs/MiniMessages.jar") implementation files("libs/MiniMessages.jar")
compileOnly files("libs/nodropxforgebridge-1.1.jar")
implementation "dev.triumphteam:triumph-gui:3.1.2" implementation "dev.triumphteam:triumph-gui:3.1.2"
} }
+15 -8
View File
@@ -34,8 +34,7 @@ import me.redtea.nodropx.service.respawn.RespawnService;
import me.redtea.nodropx.service.respawn.impl.RespawnServiceImpl; import me.redtea.nodropx.service.respawn.impl.RespawnServiceImpl;
import me.redtea.nodropx.service.storage.StorageService; import me.redtea.nodropx.service.storage.StorageService;
import me.redtea.nodropx.service.storage.impl.StorageServiceImpl; import me.redtea.nodropx.service.storage.impl.StorageServiceImpl;
import me.redtea.nodropxforgebridge.ApiProvider; import me.redtea.nodropx.util.UpdateChecker;
import me.redtea.nodropxforgebridge.Nodropxforgebridge;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
@@ -46,7 +45,6 @@ import org.bukkit.plugin.java.JavaPlugin;
import java.io.File; import java.io.File;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@@ -132,13 +130,22 @@ public final class NoDropX extends JavaPlugin {
commandManager.register(new NoDropCommand(messages, noDropAPI, guiFacade, this)); commandManager.register(new NoDropCommand(messages, noDropAPI, guiFacade, this));
bStatsInit(); bStatsInit();
printCredits(); printCredits();
checkUpdates();
mod();
} }
//todo remove
private void mod() { private void checkUpdates() {
Nodropxforgebridge.noDropAPI = s -> getAPI().getCapacitySlots(s); if(!(getConfig().contains("checkForUpdates") && getConfig().getBoolean("checkForUpdates"))) {
return;
}
new UpdateChecker(this, 111485).getVersion(version -> {
if (this.getDescription().getVersion().equals(version)) {
getLogger().info("There is not a new update available.");
} else {
getLogger().info("There is a new update available: " + version);
getLogger().info(". Download it from https://www.spigotmc.org/resources/nodropx.111485/");
}
});
} }
@@ -31,7 +31,7 @@ public class NoDropCommand extends CommandBase {
} }
@SubCommand("give") @SubCommand("give")
@Permission("nodropx.give") @Permission("R")
@Completion({"#players", "#materials", "#range:1-64"}) @Completion({"#players", "#materials", "#range:1-64"})
public void onGive(final CommandSender sender, public void onGive(final CommandSender sender,
final Player player, final Player player,
@@ -0,0 +1,32 @@
package me.redtea.nodropx.util;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Scanner;
import java.util.function.Consumer;
public class UpdateChecker {
private final JavaPlugin plugin;
private final int resourceId;
public UpdateChecker(JavaPlugin plugin, int resourceId) {
this.plugin = plugin;
this.resourceId = resourceId;
}
public void getVersion(final Consumer<String> consumer) {
Bukkit.getScheduler().runTaskAsynchronously(this.plugin, () -> {
try (InputStream is = new URL("https://api.spigotmc.org/legacy/update.php?resource=" + this.resourceId).openStream(); Scanner scann = new Scanner(is)) {
if (scann.hasNext()) {
consumer.accept(scann.next());
}
} catch (IOException e) {
plugin.getLogger().info("Unable to check for updates: " + e.getMessage());
}
});
}
}
+2 -1
View File
@@ -1,2 +1,3 @@
forceUseLegacy: false forceUseLegacy: false
forceUseMD5Colors: false forceUseMD5Colors: false
checkForUpdates: true
+1 -1
View File
@@ -14,7 +14,7 @@ noExists: "<dark_red><bold>[!] <red>This player doesnt exists!"
gui: gui:
title: "<bold>Personal storage" title: "<bold>Personal storage"
frame: frame:
name: "&7" name: "<gray>"
material: GLASS_PANE material: GLASS_PANE
prev: prev:
name: "<red>Previous" name: "<red>Previous"