Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4877ff0003 | ||
|
|
30726108a4 | ||
|
|
b09aa71a73 | ||
|
|
82c585350c | ||
|
|
9352296d65 | ||
|
|
674cc3bff7 | ||
|
|
e298b20f40 | ||
|
|
a21ac871db | ||
|
|
61188df8f7 | ||
|
|
12d150ad13 |
No files matched your search
@@ -1,15 +1,18 @@
|
||||
<img src="https://i.imgur.com/AxYMos8.png)https://i.imgur.com/AxYMos8.png"></img>
|
||||
# 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!
|
||||
|
||||
Give an no drop item: /nodrop give [player] [item] (count)
|
||||
Give an no drop item: `/nodrop give [player] [item] (count)`
|
||||
|
||||
features:
|
||||
- Support HEX Colors (MiniMessages and MD5 ChatColor)
|
||||
- Support all versions from 1.12.2 to 1.20.1
|
||||
- No drop items storage: /nodrop gui
|
||||
**Features:**
|
||||
- Supports HEX Colors (MiniMessages and MD5 ChatColor)
|
||||
- Supports all versions from 1.12.2 to 1.20.1 (Spigot/Paper)
|
||||
- No drop items storage: `/nodrop gui`
|
||||
- Fully customization
|
||||
- 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
@@ -5,7 +5,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = 'me.redtea'
|
||||
version = '1.0.0-SNAPSHOT'
|
||||
version = '1.0.1-SNAPSHOT'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@@ -37,7 +37,6 @@ dependencies {
|
||||
implementation "net.kyori:adventure-api:4.14.0"
|
||||
implementation "net.kyori:adventure-platform-bukkit:4.3.0"
|
||||
implementation files("libs/MiniMessages.jar")
|
||||
compileOnly files("libs/nodropxforgebridge-1.1.jar")
|
||||
implementation "dev.triumphteam:triumph-gui:3.1.2"
|
||||
}
|
||||
|
||||
|
||||
@@ -34,8 +34,7 @@ import me.redtea.nodropx.service.respawn.RespawnService;
|
||||
import me.redtea.nodropx.service.respawn.impl.RespawnServiceImpl;
|
||||
import me.redtea.nodropx.service.storage.StorageService;
|
||||
import me.redtea.nodropx.service.storage.impl.StorageServiceImpl;
|
||||
import me.redtea.nodropxforgebridge.ApiProvider;
|
||||
import me.redtea.nodropxforgebridge.Nodropxforgebridge;
|
||||
import me.redtea.nodropx.util.UpdateChecker;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
@@ -46,7 +45,6 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -132,13 +130,22 @@ public final class NoDropX extends JavaPlugin {
|
||||
commandManager.register(new NoDropCommand(messages, noDropAPI, guiFacade, this));
|
||||
bStatsInit();
|
||||
printCredits();
|
||||
|
||||
mod();
|
||||
checkUpdates();
|
||||
}
|
||||
|
||||
//todo remove
|
||||
private void mod() {
|
||||
Nodropxforgebridge.noDropAPI = s -> getAPI().getCapacitySlots(s);
|
||||
|
||||
private void checkUpdates() {
|
||||
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")
|
||||
@Permission("nodropx.give")
|
||||
@Permission("R")
|
||||
@Completion({"#players", "#materials", "#range:1-64"})
|
||||
public void onGive(final CommandSender sender,
|
||||
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());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,2 +1,3 @@
|
||||
forceUseLegacy: false
|
||||
forceUseMD5Colors: false
|
||||
forceUseMD5Colors: false
|
||||
checkForUpdates: true
|
||||
@@ -14,7 +14,7 @@ noExists: "<dark_red><bold>[!] <red>This player doesnt exists!"
|
||||
gui:
|
||||
title: "<bold>Personal storage"
|
||||
frame:
|
||||
name: "&7"
|
||||
name: "<gray>"
|
||||
material: GLASS_PANE
|
||||
prev:
|
||||
name: "<red>Previous"
|
||||
|
||||
Reference in new issue
Block a user