Initial commit
This commit is contained in:
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# Auto detect text files and perform LF normalization
|
||||||
|
* text=auto
|
||||||
118
.gitignore
vendored
Normal file
118
.gitignore
vendored
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
# User-specific stuff
|
||||||
|
.idea/
|
||||||
|
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
*.iws
|
||||||
|
|
||||||
|
# IntelliJ
|
||||||
|
out/
|
||||||
|
# mpeltonen/sbt-idea plugin
|
||||||
|
.idea_modules/
|
||||||
|
|
||||||
|
# JIRA plugin
|
||||||
|
atlassian-ide-plugin.xml
|
||||||
|
|
||||||
|
# Compiled class file
|
||||||
|
*.class
|
||||||
|
|
||||||
|
# Log file
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# BlueJ files
|
||||||
|
*.ctxt
|
||||||
|
|
||||||
|
# Package Files #
|
||||||
|
*.jar
|
||||||
|
*.war
|
||||||
|
*.nar
|
||||||
|
*.ear
|
||||||
|
*.zip
|
||||||
|
*.tar.gz
|
||||||
|
*.rar
|
||||||
|
|
||||||
|
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||||
|
hs_err_pid*
|
||||||
|
|
||||||
|
*~
|
||||||
|
|
||||||
|
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||||
|
.fuse_hidden*
|
||||||
|
|
||||||
|
# KDE directory preferences
|
||||||
|
.directory
|
||||||
|
|
||||||
|
# Linux trash folder which might appear on any partition or disk
|
||||||
|
.Trash-*
|
||||||
|
|
||||||
|
# .nfs files are created when an open file is removed but is still being accessed
|
||||||
|
.nfs*
|
||||||
|
|
||||||
|
# General
|
||||||
|
.DS_Store
|
||||||
|
.AppleDouble
|
||||||
|
.LSOverride
|
||||||
|
|
||||||
|
# Icon must end with two \r
|
||||||
|
Icon
|
||||||
|
|
||||||
|
# Thumbnails
|
||||||
|
._*
|
||||||
|
|
||||||
|
# Files that might appear in the root of a volume
|
||||||
|
.DocumentRevisions-V100
|
||||||
|
.fseventsd
|
||||||
|
.Spotlight-V100
|
||||||
|
.TemporaryItems
|
||||||
|
.Trashes
|
||||||
|
.VolumeIcon.icns
|
||||||
|
.com.apple.timemachine.donotpresent
|
||||||
|
|
||||||
|
# Directories potentially created on remote AFP share
|
||||||
|
.AppleDB
|
||||||
|
.AppleDesktop
|
||||||
|
Network Trash Folder
|
||||||
|
Temporary Items
|
||||||
|
.apdisk
|
||||||
|
|
||||||
|
# Windows thumbnail cache files
|
||||||
|
Thumbs.db
|
||||||
|
Thumbs.db:encryptable
|
||||||
|
ehthumbs.db
|
||||||
|
ehthumbs_vista.db
|
||||||
|
|
||||||
|
# Dump file
|
||||||
|
*.stackdump
|
||||||
|
|
||||||
|
# Folder config file
|
||||||
|
[Dd]esktop.ini
|
||||||
|
|
||||||
|
# Recycle Bin used on file shares
|
||||||
|
$RECYCLE.BIN/
|
||||||
|
|
||||||
|
# Windows Installer files
|
||||||
|
*.cab
|
||||||
|
*.msi
|
||||||
|
*.msix
|
||||||
|
*.msm
|
||||||
|
*.msp
|
||||||
|
|
||||||
|
# Windows shortcuts
|
||||||
|
*.lnk
|
||||||
|
|
||||||
|
.gradle
|
||||||
|
build/
|
||||||
|
|
||||||
|
# Ignore Gradle GUI config
|
||||||
|
gradle-app.setting
|
||||||
|
|
||||||
|
# Cache of project
|
||||||
|
.gradletasknamecache
|
||||||
|
|
||||||
|
**/build/
|
||||||
|
|
||||||
|
# Common working directory
|
||||||
|
run/
|
||||||
|
|
||||||
|
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
|
||||||
|
!gradle-wrapper.jar
|
||||||
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2024 Lncvrt
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
118
pom.xml
Normal file
118
pom.xml
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>io.github.lncvrt</groupId>
|
||||||
|
<artifactId>LncvrtBox</artifactId>
|
||||||
|
<name>LncvrtBox</name>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<build>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.8.1</version>
|
||||||
|
<configuration>
|
||||||
|
<source>${java.version}</source>
|
||||||
|
<target>${java.version}</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
|
<version>3.2.4</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>shade</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<source>16</source>
|
||||||
|
<target>16</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>papermc-repo</id>
|
||||||
|
<url>https://repo.papermc.io/repository/maven-public/</url>
|
||||||
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>sonatype</id>
|
||||||
|
<url>https://oss.sonatype.org/content/groups/public/</url>
|
||||||
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>placeholderapi-repo</id>
|
||||||
|
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
|
||||||
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>enginehub-repo</id>
|
||||||
|
<url>https://maven.enginehub.org/repo/</url>
|
||||||
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>jitpack.io</id>
|
||||||
|
<url>https://jitpack.io</url>
|
||||||
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>essentials-releases</id>
|
||||||
|
<url>https://repo.essentialsx.net/releases/</url>
|
||||||
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>bstats-repo</id>
|
||||||
|
<url>https://repo.codemc.io/repository/maven-public/</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.papermc.paper</groupId>
|
||||||
|
<artifactId>paper-api</artifactId>
|
||||||
|
<version>1.20.6-R0.1-SNAPSHOT</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.essentialsx</groupId>
|
||||||
|
<artifactId>EssentialsX</artifactId>
|
||||||
|
<version>2.20.1</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.luckperms</groupId>
|
||||||
|
<artifactId>api</artifactId>
|
||||||
|
<version>5.4</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>me.clip</groupId>
|
||||||
|
<artifactId>placeholderapi</artifactId>
|
||||||
|
<version>2.11.6</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.sk89q.worldedit</groupId>
|
||||||
|
<artifactId>worldedit-core</artifactId>
|
||||||
|
<version>7.3.1</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.sk89q.worldguard</groupId>
|
||||||
|
<artifactId>worldguard-bukkit</artifactId>
|
||||||
|
<version>7.0.4</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<properties>
|
||||||
|
<java.version>1.8</java.version>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
</project>
|
||||||
356
src/main/java/io/github/lncvrt/lncvrtbox/LncvrtBox.java
Normal file
356
src/main/java/io/github/lncvrt/lncvrtbox/LncvrtBox.java
Normal file
@@ -0,0 +1,356 @@
|
|||||||
|
package io.github.lncvrt.lncvrtbox;
|
||||||
|
|
||||||
|
import com.earth2me.essentials.Essentials;
|
||||||
|
import io.github.lncvrt.lncvrtbox.events.*;
|
||||||
|
import net.luckperms.api.LuckPerms;
|
||||||
|
import net.luckperms.api.LuckPermsProvider;
|
||||||
|
import net.luckperms.api.model.user.User;
|
||||||
|
import net.luckperms.api.node.Node;
|
||||||
|
import net.luckperms.api.node.NodeType;
|
||||||
|
import net.luckperms.api.node.types.SuffixNode;
|
||||||
|
import org.bukkit.*;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.command.TabExecutor;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.inventory.Inventory;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.json.simple.JSONObject;
|
||||||
|
import org.json.simple.parser.JSONParser;
|
||||||
|
import org.json.simple.parser.ParseException;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
import static org.bukkit.ChatColor.*;
|
||||||
|
import static org.bukkit.ChatColor.translateAlternateColorCodes;
|
||||||
|
|
||||||
|
public final class LncvrtBox extends JavaPlugin implements Listener, TabExecutor {
|
||||||
|
|
||||||
|
private LuckPerms luckPerms;
|
||||||
|
public final Map<UUID, Boolean> autoCompressStatus = new HashMap<>();
|
||||||
|
private String serverRules;
|
||||||
|
public boolean chatLocked = false;
|
||||||
|
private Essentials essentials;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEnable() {
|
||||||
|
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") == null) {
|
||||||
|
getLogger().warning("PlaceholderAPI not found. Disabling plugin.");
|
||||||
|
getServer().getPluginManager().disablePlugin(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (Bukkit.getPluginManager().getPlugin("LuckPerms") != null) {
|
||||||
|
luckPerms = LuckPermsProvider.get();
|
||||||
|
getLogger().info("LuckPerms detected and hooked.");
|
||||||
|
} else {
|
||||||
|
getLogger().warning("LuckPerms not found. Disabling plugin.");
|
||||||
|
getServer().getPluginManager().disablePlugin(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") == null) {
|
||||||
|
getLogger().warning("PlaceholderAPI not found. Disabling plugin.");
|
||||||
|
getServer().getPluginManager().disablePlugin(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (Bukkit.getPluginManager().getPlugin("Essentials") == null) {
|
||||||
|
getLogger().warning("Essentials not found. Disabling plugin.");
|
||||||
|
getServer().getPluginManager().disablePlugin(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Plugin essentialsPlugin = Bukkit.getServer().getPluginManager().getPlugin("Essentials");
|
||||||
|
if (essentialsPlugin == null) {
|
||||||
|
getLogger().warning("Essentials not found. Disabling plugin.");
|
||||||
|
getServer().getPluginManager().disablePlugin(this);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
getLogger().info("Essentials detected. Attempting to hook...");
|
||||||
|
if (essentialsPlugin instanceof Essentials) {
|
||||||
|
essentials = (Essentials) essentialsPlugin;
|
||||||
|
getLogger().info("Essentials hooked successfully.");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
getLogger().info("Essentials failed to hook.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (new PlaceholderAPIExpansion().register()) {
|
||||||
|
getLogger().info("Successfully registered PlaceholderAPIExpansion!");
|
||||||
|
} else {
|
||||||
|
getLogger().warning("Failed to register PlaceholderAPIExpansion. Disabling plugin.");
|
||||||
|
getServer().getPluginManager().disablePlugin(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
getServer().getPluginManager().registerEvents(new BlockPlaceListener(), this);
|
||||||
|
getServer().getPluginManager().registerEvents(new BlockBreakListener(this), this);
|
||||||
|
getServer().getPluginManager().registerEvents(new CraftItemListener(), this);
|
||||||
|
getServer().getPluginManager().registerEvents(new EntityDamageListener(this), this);
|
||||||
|
getServer().getPluginManager().registerEvents(new EntityPickupItemListener(this), this);
|
||||||
|
getServer().getPluginManager().registerEvents(new EntityResurrectListener(this), this);
|
||||||
|
getServer().getPluginManager().registerEvents(new FurnaceBurnListener(this), this);
|
||||||
|
getServer().getPluginManager().registerEvents(new FurnaceSmeltListener(this), this);
|
||||||
|
getServer().getPluginManager().registerEvents(new PlayerChatListener(this), this);
|
||||||
|
getServer().getPluginManager().registerEvents(new PlayerDeathListener(), this);
|
||||||
|
getServer().getPluginManager().registerEvents(new PlayerDropItemListener(this), this);
|
||||||
|
getServer().getPluginManager().registerEvents(new PlayerElytraBoostListener(), this);
|
||||||
|
getServer().getPluginManager().registerEvents(new PlayerJoinListener(this), this);
|
||||||
|
getServer().getPluginManager().registerEvents(new PlayerMoveListener(), this);
|
||||||
|
getServer().getPluginManager().registerEvents(new PortalCreateListener(), this);
|
||||||
|
getServer().getPluginManager().registerEvents(new PrepareAnvilListener(), this);
|
||||||
|
getServer().getPluginManager().registerEvents(new PrepareItemEnchantListener(), this);
|
||||||
|
getServer().getPluginManager().registerEvents(new ProjectileHitListener(), this);
|
||||||
|
getServer().getPluginManager().registerEvents(new SignChangeListener(this), this);
|
||||||
|
|
||||||
|
getServer().getPluginManager().registerEvents(this, this);
|
||||||
|
|
||||||
|
loadAutoCompressStatus();
|
||||||
|
loadServerRules();
|
||||||
|
Objects.requireNonNull(getCommand("autocompress")).setExecutor(this);
|
||||||
|
Objects.requireNonNull(getCommand("sky")).setExecutor(this);
|
||||||
|
Objects.requireNonNull(getCommand("rules")).setExecutor(this);
|
||||||
|
Objects.requireNonNull(getCommand("link")).setExecutor(this);
|
||||||
|
Objects.requireNonNull(getCommand("unlink")).setExecutor(this);
|
||||||
|
Objects.requireNonNull(getCommand("clearchat")).setExecutor(this);
|
||||||
|
Objects.requireNonNull(getCommand("settag")).setExecutor(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDisable() {
|
||||||
|
saveAutoCompressStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isRestrictedMaterial(Material material) {
|
||||||
|
return material == Material.IRON_ORE || material == Material.RAW_IRON || material == Material.GOLD_ORE || material == Material.RAW_GOLD || material == Material.ANCIENT_DEBRIS || material == Material.SAND;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void convertInventoryItemsPrep(Player player, UUID playerId) {
|
||||||
|
if (autoCompressStatus.getOrDefault(playerId, false)) {
|
||||||
|
convertInventoryItems(player, Material.DIAMOND, Material.DIAMOND_BLOCK, 9, 1);
|
||||||
|
convertInventoryItems(player, Material.LAPIS_LAZULI, Material.LAPIS_BLOCK, 9, 1);
|
||||||
|
convertInventoryItems(player, Material.REDSTONE, Material.REDSTONE_BLOCK, 9, 1);
|
||||||
|
convertInventoryItems(player, Material.EMERALD, Material.EMERALD_BLOCK, 9, 1);
|
||||||
|
convertInventoryItems(player, Material.RAW_GOLD, Material.RAW_GOLD_BLOCK, 9, 1);
|
||||||
|
convertInventoryItems(player, Material.GOLD_INGOT, Material.GOLD_BLOCK, 9, 1);
|
||||||
|
convertInventoryItems(player, Material.GOLD_NUGGET, Material.GOLD_INGOT, 9, 1);
|
||||||
|
convertInventoryItems(player, Material.IRON_ORE, Material.IRON_BLOCK, 9, 1);
|
||||||
|
convertInventoryItems(player, Material.RAW_IRON, Material.RAW_IRON_BLOCK, 9, 1);
|
||||||
|
convertInventoryItems(player, Material.COAL, Material.COAL_BLOCK, 9, 1);
|
||||||
|
convertInventoryItems(player, Material.RAW_COPPER, Material.COPPER_BLOCK, 9, 1);
|
||||||
|
convertInventoryItems(player, Material.COPPER_INGOT, Material.COPPER_BLOCK, 9, 1);
|
||||||
|
convertInventoryItems(player, Material.QUARTZ, Material.QUARTZ_BLOCK, 4, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void convertInventoryItems(Player player, Material fromMaterial, Material toMaterial, int fromCount, int toCount) {
|
||||||
|
ItemStack[] inventoryContents = player.getInventory().getContents();
|
||||||
|
|
||||||
|
Bukkit.getScheduler().runTask(this, () -> {
|
||||||
|
for (int i = 0; i < inventoryContents.length; i++) {
|
||||||
|
ItemStack item = inventoryContents[i];
|
||||||
|
|
||||||
|
if (item != null && item.getType() == fromMaterial && item.getAmount() >= fromCount) {
|
||||||
|
int stacksToConvert = item.getAmount() / fromCount;
|
||||||
|
int remainingItems = item.getAmount() % fromCount;
|
||||||
|
|
||||||
|
if (stacksToConvert > 0) {
|
||||||
|
item.setAmount(remainingItems);
|
||||||
|
player.getInventory().setItem(i, item);
|
||||||
|
|
||||||
|
ItemStack toMaterialStack = new ItemStack(toMaterial, stacksToConvert * toCount);
|
||||||
|
HashMap<Integer, ItemStack> remaining = player.getInventory().addItem(toMaterialStack);
|
||||||
|
|
||||||
|
if (!remaining.isEmpty()) {
|
||||||
|
for (ItemStack remainingItem : remaining.values()) {
|
||||||
|
player.getWorld().dropItem(player.getLocation(), remainingItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mergeInventoryStacks(player.getInventory(), fromMaterial);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void mergeInventoryStacks(Inventory inventory, Material material) {
|
||||||
|
int totalAmount = 0;
|
||||||
|
|
||||||
|
for (ItemStack item : inventory.getContents()) {
|
||||||
|
if (item != null && item.getType() == material) {
|
||||||
|
totalAmount += item.getAmount();
|
||||||
|
item.setAmount(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int fullStacks = totalAmount / material.getMaxStackSize();
|
||||||
|
int remainingItems = totalAmount % material.getMaxStackSize();
|
||||||
|
|
||||||
|
for (int i = 0; i < fullStacks; i++) {
|
||||||
|
inventory.addItem(new ItemStack(material, material.getMaxStackSize()));
|
||||||
|
}
|
||||||
|
if (remainingItems > 0) {
|
||||||
|
inventory.addItem(new ItemStack(material, remainingItems));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void loadServerRules() {
|
||||||
|
File rulesFile = new File(getDataFolder(), "rules.txt");
|
||||||
|
|
||||||
|
if (!rulesFile.exists()) {
|
||||||
|
getLogger().log(Level.WARNING, "rules.txt file not found in plugin folder.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuilder rulesContent = new StringBuilder();
|
||||||
|
try (BufferedReader reader = new BufferedReader(new FileReader(rulesFile))) {
|
||||||
|
String line;
|
||||||
|
while ((line = reader.readLine()) != null) {
|
||||||
|
rulesContent.append(line).append("\n");
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
getLogger().log(Level.SEVERE, "Error reading rules.txt file.", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
serverRules = rulesContent.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
private void saveAutoCompressStatus() {
|
||||||
|
File file = new File(getDataFolder(), "autocompress.json");
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
|
||||||
|
for (Map.Entry<UUID, Boolean> entry : autoCompressStatus.entrySet()) {
|
||||||
|
jsonObject.put(entry.getKey().toString(), entry.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
try (FileWriter writer = new FileWriter(file)) {
|
||||||
|
writer.write(jsonObject.toJSONString());
|
||||||
|
} catch (IOException e) {
|
||||||
|
getLogger().log(Level.SEVERE, "Error saving statuses to autocompress.json", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadAutoCompressStatus() {
|
||||||
|
File file = new File(getDataFolder(), "autocompress.json");
|
||||||
|
if (!file.exists()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try (FileReader reader = new FileReader(file)) {
|
||||||
|
JSONParser parser = new JSONParser();
|
||||||
|
JSONObject jsonObject = (JSONObject) parser.parse(reader);
|
||||||
|
|
||||||
|
for (Object key : jsonObject.keySet()) {
|
||||||
|
UUID playerId = UUID.fromString((String) key);
|
||||||
|
Boolean status = (Boolean) jsonObject.get(key);
|
||||||
|
autoCompressStatus.put(playerId, status);
|
||||||
|
}
|
||||||
|
} catch (IOException | ParseException e) {
|
||||||
|
getLogger().log(Level.SEVERE, "Error loading statuses from autocompress.json", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, String label, String[] args) {
|
||||||
|
if (label.equalsIgnoreCase("autocompress")) {
|
||||||
|
if (!(sender instanceof Player player)) {
|
||||||
|
sender.sendMessage(RED + "This command can only be executed by a player.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
UUID playerId = player.getUniqueId();
|
||||||
|
|
||||||
|
boolean currentStatus = autoCompressStatus.getOrDefault(playerId, false);
|
||||||
|
autoCompressStatus.put(playerId, !currentStatus);
|
||||||
|
|
||||||
|
if (!currentStatus) {
|
||||||
|
player.sendMessage(GREEN + "Auto-compress enabled.");
|
||||||
|
} else {
|
||||||
|
player.sendMessage(RED + "Auto-compress disabled.");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} else if (label.equalsIgnoreCase("sky")) {
|
||||||
|
if (sender instanceof Player player) {
|
||||||
|
player.performCommand("warp sky");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} else if (label.equalsIgnoreCase("rules")) {
|
||||||
|
if (serverRules != null && !serverRules.isEmpty()) {
|
||||||
|
sender.sendMessage(translateAlternateColorCodes('&', serverRules));
|
||||||
|
} else {
|
||||||
|
sender.sendMessage("%sServer rules are currently unavailable.".formatted(RED));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} else if (label.equalsIgnoreCase("link")) {
|
||||||
|
if (sender instanceof Player player) {
|
||||||
|
player.performCommand("discord link");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} else if (label.equalsIgnoreCase("unlink")) {
|
||||||
|
if (sender instanceof Player player) {
|
||||||
|
player.performCommand("discord unlink");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} else if (label.equalsIgnoreCase("clearchat")) {
|
||||||
|
if (sender instanceof Player player) {
|
||||||
|
if (!player.hasPermission("lncvrtbox.clearchat")) {
|
||||||
|
player.sendMessage("%sYou do not have permission to use this command.".formatted(RED));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < 1000; i++) {
|
||||||
|
Bukkit.broadcastMessage("");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} else if (label.equalsIgnoreCase("settag")) {
|
||||||
|
sender.sendMessage(RED + "Setting tags has been removed. Sorry!");
|
||||||
|
return true;
|
||||||
|
} else if (label.equalsIgnoreCase("lockchat")) {
|
||||||
|
if (sender.hasPermission("chatlock.lock")) {
|
||||||
|
chatLocked = !chatLocked;
|
||||||
|
sender.sendMessage("Chat " + (chatLocked ? "locked." : "unlocked."));
|
||||||
|
} else {
|
||||||
|
sender.sendMessage("You do not have permission to use this command.");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isAfk(Player player) {
|
||||||
|
com.earth2me.essentials.User user = essentials.getUser(player);
|
||||||
|
return user.isAfk();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isMuted(Player player) {
|
||||||
|
com.earth2me.essentials.User user = essentials.getUser(player);
|
||||||
|
return user.isMuted();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setSuffix(Player player, String suffix) {
|
||||||
|
User user = luckPerms.getUserManager().getUser(player.getUniqueId());
|
||||||
|
if (user != null) {
|
||||||
|
Node suffixNode = SuffixNode.builder(" " + suffix, 1).build();
|
||||||
|
user.data().clear(NodeType.SUFFIX::matches);
|
||||||
|
user.data().add(suffixNode);
|
||||||
|
luckPerms.getUserManager().saveUser(user);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void removeSuffix(Player player) {
|
||||||
|
User user = luckPerms.getUserManager().getUser(player.getUniqueId());
|
||||||
|
if (user != null) {
|
||||||
|
user.data().clear(NodeType.SUFFIX::matches);
|
||||||
|
luckPerms.getUserManager().saveUser(user);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,179 @@
|
|||||||
|
package io.github.lncvrt.lncvrtbox;
|
||||||
|
|
||||||
|
import com.earth2me.essentials.Essentials;
|
||||||
|
import com.earth2me.essentials.User;
|
||||||
|
import me.clip.placeholderapi.PlaceholderAPI;
|
||||||
|
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
import java.text.NumberFormat;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import static org.bukkit.ChatColor.*;
|
||||||
|
|
||||||
|
public final class PlaceholderAPIExpansion extends PlaceholderExpansion {
|
||||||
|
|
||||||
|
private Essentials essentials;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @NotNull String getIdentifier() {
|
||||||
|
return "lncvrtbox";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @NotNull String getAuthor() {
|
||||||
|
return "Lncvrt";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @NotNull String getVersion() {
|
||||||
|
return "1.0.0";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean persist() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canRegister() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean register() {
|
||||||
|
Plugin essentialsPlugin = Bukkit.getServer().getPluginManager().getPlugin("Essentials");
|
||||||
|
if (essentialsPlugin instanceof Essentials) {
|
||||||
|
this.essentials = (Essentials) essentialsPlugin;
|
||||||
|
return super.register();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @Nullable String onPlaceholderRequest(Player player, @NotNull String identifier) {
|
||||||
|
if (essentials == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
int decimalPlaces = 1;
|
||||||
|
if (identifier.matches("(health|hearts)_\\d+")) {
|
||||||
|
try {
|
||||||
|
decimalPlaces = Integer.parseInt(identifier.split("_")[1]);
|
||||||
|
} catch (NumberFormatException | ArrayIndexOutOfBoundsException ignored) {
|
||||||
|
}
|
||||||
|
identifier = identifier.split("_")[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (identifier) {
|
||||||
|
case "afk" -> {
|
||||||
|
int afkCount = 0;
|
||||||
|
for (Player p : Bukkit.getServer().getOnlinePlayers()) {
|
||||||
|
User user = essentials.getUser(p);
|
||||||
|
if (user != null && user.isAfk()) {
|
||||||
|
afkCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return String.valueOf(afkCount);
|
||||||
|
}
|
||||||
|
case "afk_staff" -> {
|
||||||
|
int staffAfkCount = 0;
|
||||||
|
for (Player p : Bukkit.getServer().getOnlinePlayers()) {
|
||||||
|
if (p.hasPermission("lncvrtutils.staff") && isAfk(p)) {
|
||||||
|
staffAfkCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return String.valueOf(staffAfkCount);
|
||||||
|
}
|
||||||
|
case "team" -> {
|
||||||
|
String team = PlaceholderAPI.setPlaceholders(player, "%betterteams_displayname%");
|
||||||
|
if (team.isEmpty()) {
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
return "%s[%s%s%s%s]%s ".formatted(GRAY, RESET, team, RESET, GRAY, RESET);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case "health" -> {
|
||||||
|
double health = player.getHealth();
|
||||||
|
String format = decimalPlaces > 0 ? "#." + repeat("0", decimalPlaces) : "#";
|
||||||
|
return new DecimalFormat(format).format(health);
|
||||||
|
}
|
||||||
|
case "hearts" -> {
|
||||||
|
double hearts = player.getHealth() / 2.0;
|
||||||
|
String format = decimalPlaces > 0 ? "#." + repeat("0", decimalPlaces) : "#";
|
||||||
|
return new DecimalFormat(format).format(hearts);
|
||||||
|
}
|
||||||
|
case "total_joins" -> {
|
||||||
|
NumberFormat numberFormat = NumberFormat.getNumberInstance(Locale.US);
|
||||||
|
return numberFormat.format(Bukkit.getOfflinePlayers().length);
|
||||||
|
}
|
||||||
|
case "total_joins_formatted" -> {
|
||||||
|
return formatCompact(Bukkit.getOfflinePlayers().length);
|
||||||
|
}
|
||||||
|
case "seasontwocountdown" -> {
|
||||||
|
long targetTime = 1719804600L;
|
||||||
|
long currentTime = System.currentTimeMillis() / 1000;
|
||||||
|
|
||||||
|
if (currentTime >= targetTime) {
|
||||||
|
return "Starting Soon!";
|
||||||
|
} else {
|
||||||
|
long remainingSeconds = targetTime - currentTime;
|
||||||
|
return formatTime(remainingSeconds);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case "kdr" -> {
|
||||||
|
int kills = Integer.parseInt(PlaceholderAPI.setPlaceholders(player, "%statistic_player_kills%"));
|
||||||
|
int deaths = Integer.parseInt(PlaceholderAPI.setPlaceholders(player, "%statistic_deaths%"));
|
||||||
|
double kdr = (deaths == 0) ? kills : (double) kills / deaths;
|
||||||
|
String format = decimalPlaces > 0 ? "0." + repeat("0", decimalPlaces) : "0";
|
||||||
|
return new DecimalFormat(format).format(kdr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String repeat(String str, int count) {
|
||||||
|
return String.valueOf(str).repeat(Math.max(0, count));
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isAfk(Player player) {
|
||||||
|
User user = essentials.getUser(player);
|
||||||
|
return user != null && user.isAfk();
|
||||||
|
}
|
||||||
|
|
||||||
|
private String formatCompact(int number) {
|
||||||
|
DecimalFormat decimalFormat = new DecimalFormat("#.#");
|
||||||
|
if (number >= 1_000_000) {
|
||||||
|
return decimalFormat.format(number / 1_000_000.0) + "M";
|
||||||
|
} else if (number >= 1_000) {
|
||||||
|
return decimalFormat.format(number / 1_000.0) + "k";
|
||||||
|
} else {
|
||||||
|
return String.valueOf(number);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String formatTime(long seconds) {
|
||||||
|
if (seconds <= 0) return "Starting Soon!";
|
||||||
|
|
||||||
|
long days = seconds / 86400;
|
||||||
|
seconds %= 86400;
|
||||||
|
long hours = seconds / 3600;
|
||||||
|
seconds %= 3600;
|
||||||
|
long minutes = seconds / 60;
|
||||||
|
seconds %= 60;
|
||||||
|
|
||||||
|
StringBuilder formattedTime = new StringBuilder();
|
||||||
|
if (days > 0) formattedTime.append(days).append("d ");
|
||||||
|
if (hours > 0 || days > 0) formattedTime.append(hours).append("h ");
|
||||||
|
if (minutes > 0 || hours > 0 || days > 0) formattedTime.append(minutes).append("m ");
|
||||||
|
if (seconds > 0 || minutes > 0 || hours > 0 || days > 0) formattedTime.append(seconds).append("s");
|
||||||
|
|
||||||
|
return formattedTime.toString().trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package io.github.lncvrt.lncvrtbox.events;
|
||||||
|
|
||||||
|
import io.github.lncvrt.lncvrtbox.LncvrtBox;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.block.BlockBreakEvent;
|
||||||
|
|
||||||
|
public class BlockBreakListener implements Listener {
|
||||||
|
private final LncvrtBox plugin;
|
||||||
|
|
||||||
|
public BlockBreakListener(LncvrtBox plugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
|
public void onBlockBreak(BlockBreakEvent event) {
|
||||||
|
plugin.convertInventoryItemsPrep(event.getPlayer(), event.getPlayer().getUniqueId());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package io.github.lncvrt.lncvrtbox.events;
|
||||||
|
|
||||||
|
import net.md_5.bungee.api.chat.ClickEvent;
|
||||||
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
|
|
||||||
|
import static org.bukkit.ChatColor.*;
|
||||||
|
|
||||||
|
public class BlockPlaceListener implements Listener {
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onBlockPlace(BlockPlaceEvent event) {
|
||||||
|
if (event.getBlockPlaced().getType() == Material.POLISHED_BLACKSTONE_BUTTON) {
|
||||||
|
if (event.getItemInHand().hasItemMeta() && event.getItemInHand().getItemMeta().hasDisplayName()) {
|
||||||
|
String displayName = ChatColor.stripColor(event.getItemInHand().getItemMeta().getDisplayName());
|
||||||
|
if (displayName.equalsIgnoreCase("Coal Fragment")) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
return; // Exit early if placing a Coal Fragment button
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (event.getBlockPlaced().getType() == Material.FURNACE ||
|
||||||
|
event.getBlockPlaced().getType() == Material.FURNACE_MINECART ||
|
||||||
|
event.getBlockPlaced().getType() == Material.BLAST_FURNACE) {
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
String message = String.format("%s%s[TIP]%s%s If you are trying to smelt iron, gold, etc you can use the Smelter Shop. Click %s[HERE]%s to teleport to the smelter shop! (if you are on bedrock, instead of clicking there run %s/warp smelter%s.", GREEN, BOLD, RESET, GREEN, UNDERLINE, GREEN, UNDERLINE, GREEN);
|
||||||
|
|
||||||
|
// Create the entire message as a TextComponent
|
||||||
|
TextComponent fullMessage = new TextComponent(TextComponent.fromLegacyText(message));
|
||||||
|
|
||||||
|
// Find the starting index of [HERE] in the message
|
||||||
|
int hereIndex = message.indexOf("[HERE]");
|
||||||
|
|
||||||
|
// Create a TextComponent just for the [HERE] part
|
||||||
|
TextComponent clickableHere = new TextComponent("[HERE]");
|
||||||
|
clickableHere.setColor(net.md_5.bungee.api.ChatColor.GREEN);
|
||||||
|
clickableHere.setUnderlined(true);
|
||||||
|
clickableHere.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/warp smelter"));
|
||||||
|
|
||||||
|
// Replace [HERE] in the full message with the clickable TextComponent
|
||||||
|
TextComponent[] components = new TextComponent[] {
|
||||||
|
new TextComponent(message.substring(0, hereIndex)),
|
||||||
|
clickableHere,
|
||||||
|
new TextComponent(message.substring(hereIndex + "[HERE]".length()))
|
||||||
|
};
|
||||||
|
fullMessage = new TextComponent(components);
|
||||||
|
|
||||||
|
// Send the modified message to the player
|
||||||
|
player.spigot().sendMessage(fullMessage);
|
||||||
|
} else if (event.getBlockPlaced().getType() == Material.WITHER_SKELETON_SKULL) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
event.getPlayer().getInventory().remove(Material.WITHER_SKELETON_SKULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package io.github.lncvrt.lncvrtbox.events;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.inventory.CraftItemEvent;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
|
||||||
|
public class CraftItemListener implements Listener {
|
||||||
|
@EventHandler
|
||||||
|
public void onCraftItem(CraftItemEvent event) {
|
||||||
|
if (event.getCurrentItem() != null && event.getCurrentItem().getType() == Material.DIAMOND_PICKAXE) {
|
||||||
|
ItemStack pickaxe = event.getCurrentItem();
|
||||||
|
ItemMeta meta = pickaxe.getItemMeta();
|
||||||
|
|
||||||
|
if (meta != null) {
|
||||||
|
meta.setUnbreakable(true);
|
||||||
|
pickaxe.setItemMeta(meta);
|
||||||
|
event.setCurrentItem(pickaxe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package io.github.lncvrt.lncvrtbox.events;
|
||||||
|
|
||||||
|
import io.github.lncvrt.lncvrtbox.LncvrtBox;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
|
|
||||||
|
public class EntityDamageListener implements Listener {
|
||||||
|
private final LncvrtBox plugin;
|
||||||
|
|
||||||
|
public EntityDamageListener(LncvrtBox plugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
private void onPlayerDamage(EntityDamageEvent event) {
|
||||||
|
if (event.getEntity() instanceof Player player) {
|
||||||
|
if (plugin.isAfk(player)) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package io.github.lncvrt.lncvrtbox.events;
|
||||||
|
|
||||||
|
import io.github.lncvrt.lncvrtbox.LncvrtBox;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.entity.EntityPickupItemEvent;
|
||||||
|
|
||||||
|
public class EntityPickupItemListener implements Listener {
|
||||||
|
private final LncvrtBox plugin;
|
||||||
|
|
||||||
|
public EntityPickupItemListener(LncvrtBox plugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
|
public void onItemPickup(EntityPickupItemEvent event) {
|
||||||
|
if (event.getEntity() instanceof Player player) {
|
||||||
|
plugin.convertInventoryItemsPrep(player, player.getUniqueId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package io.github.lncvrt.lncvrtbox.events;
|
||||||
|
|
||||||
|
import io.github.lncvrt.lncvrtbox.LncvrtBox;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.entity.EntityResurrectEvent;
|
||||||
|
|
||||||
|
import static org.bukkit.ChatColor.*;
|
||||||
|
|
||||||
|
public class EntityResurrectListener implements Listener {
|
||||||
|
private final LncvrtBox plugin;
|
||||||
|
|
||||||
|
public EntityResurrectListener(LncvrtBox plugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onEntityResurrect(EntityResurrectEvent event) {
|
||||||
|
if (event.getEntity() instanceof Player player && !event.isCancelled()) {
|
||||||
|
if (player.getInventory().getItemInMainHand().getType() == Material.TOTEM_OF_UNDYING || player.getInventory().getItemInOffHand().getType() == Material.TOTEM_OF_UNDYING) {
|
||||||
|
plugin.getServer().broadcastMessage("%s%sLncvrtBoxFFA %s%s» %s%s has popped their totem".formatted(GOLD, BOLD, GRAY, BOLD, RESET, player.getName()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package io.github.lncvrt.lncvrtbox.events;
|
||||||
|
|
||||||
|
import io.github.lncvrt.lncvrtbox.LncvrtBox;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.block.Furnace;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.inventory.FurnaceBurnEvent;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
public class FurnaceBurnListener implements Listener {
|
||||||
|
private final LncvrtBox plugin;
|
||||||
|
|
||||||
|
public FurnaceBurnListener(LncvrtBox plugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onFurnaceBurn(FurnaceBurnEvent event) {
|
||||||
|
Furnace furnace = (Furnace) event.getBlock().getState();
|
||||||
|
Material smelting = Objects.requireNonNull(furnace.getInventory().getSmelting()).getType();
|
||||||
|
|
||||||
|
if (plugin.isRestrictedMaterial(smelting)) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package io.github.lncvrt.lncvrtbox.events;
|
||||||
|
|
||||||
|
import io.github.lncvrt.lncvrtbox.LncvrtBox;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.inventory.FurnaceSmeltEvent;
|
||||||
|
|
||||||
|
public class FurnaceSmeltListener implements Listener {
|
||||||
|
private final LncvrtBox plugin;
|
||||||
|
|
||||||
|
public FurnaceSmeltListener(LncvrtBox plugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onFurnaceSmelt(FurnaceSmeltEvent event) {
|
||||||
|
Material smelted = event.getSource().getType();
|
||||||
|
|
||||||
|
if (plugin.isRestrictedMaterial(smelted)) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package io.github.lncvrt.lncvrtbox.events;
|
||||||
|
|
||||||
|
import io.github.lncvrt.lncvrtbox.LncvrtBox;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||||
|
import org.bukkit.event.player.PlayerChatEvent;
|
||||||
|
|
||||||
|
import java.util.Base64;
|
||||||
|
|
||||||
|
import static org.bukkit.ChatColor.*;
|
||||||
|
|
||||||
|
public class PlayerChatListener implements Listener {
|
||||||
|
private final LncvrtBox plugin;
|
||||||
|
|
||||||
|
public PlayerChatListener(LncvrtBox plugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerChat(AsyncPlayerChatEvent event) {
|
||||||
|
event.setMessage(event.getMessage().replace("wlc", "welcome").replace("linqverted", "Lncvrt").replace("linqvert", "Lncvrt"));
|
||||||
|
|
||||||
|
if (plugin.chatLocked && !event.getPlayer().hasPermission("chatlock.bypass")) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
event.getPlayer().sendMessage("Chat is currently locked. Admins can still view your message.");
|
||||||
|
for (Player admin : Bukkit.getServer().getOnlinePlayers()) {
|
||||||
|
if (admin.hasPermission("chatlock.admin")) {
|
||||||
|
admin.sendMessage("%s%s%s tried to say: %s".formatted(GRAY, ITALIC, event.getPlayer().getName(), event.getMessage()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerChat(PlayerChatEvent event) {
|
||||||
|
String message = event.getMessage().toLowerCase();
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
|
String[] slurs = {"bmlnZ2Vy", "bmlnZ2E="};
|
||||||
|
|
||||||
|
for (String slur : slurs) {
|
||||||
|
if (message.contains(new String(Base64.getDecoder().decode(slur)))) {
|
||||||
|
player.chat("Oops! I'm now banned because I said a slur.");
|
||||||
|
|
||||||
|
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "tempbanip %s 1w Slurs".formatted(player.getName()));
|
||||||
|
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "tempban %s 1w Slurs".formatted(player.getName()));
|
||||||
|
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "mute %s 1mo Slurs".formatted(player.getName()));
|
||||||
|
|
||||||
|
event.setCancelled(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (message.contains("chillindabox") || (message.contains("minehut.gg") && !(message.contains("lncvrtboxffa.minehut.gg") || message.contains("lncvrtboxes.minehut.gg")))) {
|
||||||
|
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "tempbanip %s 1m Advertising".formatted(player.getName()));
|
||||||
|
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "tempban %s 1m Advertising".formatted(player.getName()));
|
||||||
|
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "mute %s 3m Advertising".formatted(player.getName()));
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package io.github.lncvrt.lncvrtbox.events;
|
||||||
|
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||||
|
|
||||||
|
import static org.bukkit.ChatColor.*;
|
||||||
|
import static org.bukkit.ChatColor.RESET;
|
||||||
|
|
||||||
|
public class PlayerDeathListener implements Listener {
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerDeath(PlayerDeathEvent event) {
|
||||||
|
String suicideMsg = "";
|
||||||
|
if (event.getEntity() == event.getEntity().getKiller()) suicideMsg = RESET + " (suicide)";
|
||||||
|
|
||||||
|
event.setDeathMessage("%s%sLncvrtBoxFFA %s%s» %s%s%s".formatted(GOLD, BOLD, GRAY, BOLD, RESET, event.getDeathMessage(), suicideMsg));
|
||||||
|
//Bukkit.getServer().broadcastMessage(event.getEntity().getKiller().getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package io.github.lncvrt.lncvrtbox.events;
|
||||||
|
|
||||||
|
import io.github.lncvrt.lncvrtbox.LncvrtBox;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerDropItemEvent;
|
||||||
|
|
||||||
|
public class PlayerDropItemListener implements Listener {
|
||||||
|
private final LncvrtBox plugin;
|
||||||
|
|
||||||
|
public PlayerDropItemListener(LncvrtBox plugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
|
public void onItemDrop(PlayerDropItemEvent event) {
|
||||||
|
plugin.convertInventoryItemsPrep(event.getPlayer(), event.getPlayer().getUniqueId());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package io.github.lncvrt.lncvrtbox.events;
|
||||||
|
|
||||||
|
import com.destroystokyo.paper.event.player.PlayerElytraBoostEvent;
|
||||||
|
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||||
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
|
import com.sk89q.worldguard.WorldGuard;
|
||||||
|
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||||
|
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||||
|
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
|
||||||
|
import static org.bukkit.ChatColor.RED;
|
||||||
|
|
||||||
|
public class PlayerElytraBoostListener implements Listener {
|
||||||
|
@EventHandler
|
||||||
|
public void onElytraRocketBoost(PlayerElytraBoostEvent event) {
|
||||||
|
RegionManager regionManager = WorldGuard.getInstance().getPlatform().getRegionContainer().get(BukkitAdapter.adapt(event.getPlayer().getWorld()));
|
||||||
|
if (regionManager != null) {
|
||||||
|
BlockVector3 location = BlockVector3.at(event.getPlayer().getLocation().getX(), event.getPlayer().getLocation().getY(), event.getPlayer().getLocation().getZ());
|
||||||
|
ApplicableRegionSet applicableRegions = regionManager.getApplicableRegions(location);
|
||||||
|
for (ProtectedRegion region : applicableRegions) {
|
||||||
|
if (region.getId().equalsIgnoreCase("event")) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
event.getPlayer().setGliding(false);
|
||||||
|
event.getPlayer().sendMessage(RED + "Elytras are disabled in events.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package io.github.lncvrt.lncvrtbox.events;
|
||||||
|
|
||||||
|
import io.github.lncvrt.lncvrtbox.LncvrtBox;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import static org.bukkit.ChatColor.*;
|
||||||
|
|
||||||
|
public class PlayerJoinListener implements Listener {
|
||||||
|
private final LncvrtBox plugin;
|
||||||
|
|
||||||
|
public PlayerJoinListener(LncvrtBox plugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
UUID playerId = player.getUniqueId();
|
||||||
|
|
||||||
|
if (!plugin.autoCompressStatus.containsKey(playerId)) {
|
||||||
|
plugin.autoCompressStatus.put(playerId, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
player.getInventory().remove(Material.WITHER_SKELETON_SKULL);
|
||||||
|
|
||||||
|
player.sendMessage("%s%sWe added %s%s%s/autocompress%s%s%s! Use that to compress diamonds into diamond blocks and more!".formatted(AQUA, BOLD, RESET, AQUA, UNDERLINE, RESET, AQUA, BOLD));
|
||||||
|
player.sendMessage("%s%sYou can also do %s%s%s/settag%s%s%s to customize your suffix/tag (issues related to that have been fixed)".formatted(GREEN, BOLD, RESET, GREEN, UNDERLINE, RESET, GREEN, BOLD));
|
||||||
|
player.sendMessage("%s%sAlso make sure to join the Discord by doing %s%s%s/discord%s%s%s!".formatted(BLUE, BOLD, RESET, BLUE, UNDERLINE, RESET, BLUE, BOLD));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package io.github.lncvrt.lncvrtbox.events;
|
||||||
|
|
||||||
|
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||||
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
|
import com.sk89q.worldguard.WorldGuard;
|
||||||
|
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||||
|
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||||
|
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
|
|
||||||
|
import static org.bukkit.ChatColor.RED;
|
||||||
|
|
||||||
|
public class PlayerMoveListener implements Listener {
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerMove(PlayerMoveEvent event) {
|
||||||
|
if (event.getPlayer().isGliding()) {
|
||||||
|
RegionManager regionManager = WorldGuard.getInstance().getPlatform().getRegionContainer().get(BukkitAdapter.adapt(event.getPlayer().getWorld()));
|
||||||
|
if (regionManager != null) {
|
||||||
|
BlockVector3 location = BlockVector3.at(event.getPlayer().getLocation().getX(), event.getPlayer().getLocation().getY(), event.getPlayer().getLocation().getZ());
|
||||||
|
ApplicableRegionSet applicableRegions = regionManager.getApplicableRegions(location);
|
||||||
|
for (ProtectedRegion region : applicableRegions) {
|
||||||
|
if (region.getId().equalsIgnoreCase("event")) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
event.getPlayer().setGliding(false);
|
||||||
|
event.getPlayer().sendMessage(RED + "Elytras are disabled in events.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package io.github.lncvrt.lncvrtbox.events;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.world.PortalCreateEvent;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
public class PortalCreateListener implements Listener {
|
||||||
|
@EventHandler
|
||||||
|
public void onPortalCreate(PortalCreateEvent event) {
|
||||||
|
World.Environment env = event.getWorld().getEnvironment();
|
||||||
|
if (env == World.Environment.NORMAL && event.getReason() != PortalCreateEvent.CreateReason.FIRE) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
|
||||||
|
for (Player player : Bukkit.getServer().getOnlinePlayers()) {
|
||||||
|
if (Objects.equals(event.getEntity(), player)) {
|
||||||
|
Location spawnLocation = Objects.requireNonNull(Bukkit.getServer().getWorld("world")).getSpawnLocation();
|
||||||
|
player.teleport(spawnLocation);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package io.github.lncvrt.lncvrtbox.events;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.inventory.PrepareAnvilEvent;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class PrepareAnvilListener implements Listener {
|
||||||
|
@EventHandler
|
||||||
|
public void onPrepareAnvil(PrepareAnvilEvent event) {
|
||||||
|
ItemStack left = event.getInventory().getItem(0);
|
||||||
|
ItemStack right = event.getInventory().getItem(1);
|
||||||
|
|
||||||
|
if (left != null && (left.getType() == Material.DIAMOND_PICKAXE || left.getType() == Material.NETHERITE_PICKAXE)) {
|
||||||
|
event.setResult(null);
|
||||||
|
}
|
||||||
|
if (right != null && (right.getType() == Material.DIAMOND_PICKAXE || right.getType() == Material.NETHERITE_PICKAXE)) {
|
||||||
|
event.setResult(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package io.github.lncvrt.lncvrtbox.events;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.enchantment.PrepareItemEnchantEvent;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class PrepareItemEnchantListener implements Listener {
|
||||||
|
@EventHandler
|
||||||
|
public void onPrepareItemEnchant(PrepareItemEnchantEvent event) {
|
||||||
|
ItemStack item = event.getItem();
|
||||||
|
if (item.getType() == Material.DIAMOND_PICKAXE || item.getType() == Material.NETHERITE_PICKAXE) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package io.github.lncvrt.lncvrtbox.events;
|
||||||
|
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.Projectile;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||||
|
import org.bukkit.projectiles.ProjectileSource;
|
||||||
|
|
||||||
|
public class ProjectileHitListener implements Listener {
|
||||||
|
@EventHandler
|
||||||
|
public void onProjectileHit(ProjectileHitEvent event) {
|
||||||
|
Projectile projectile = event.getEntity();
|
||||||
|
if (projectile.getType() == EntityType.WITHER_SKULL) {
|
||||||
|
ProjectileSource shooter = projectile.getShooter();
|
||||||
|
if (shooter instanceof org.bukkit.entity.Wither) {
|
||||||
|
event.getEntity().remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package io.github.lncvrt.lncvrtbox.events;
|
||||||
|
|
||||||
|
import io.github.lncvrt.lncvrtbox.LncvrtBox;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.block.SignChangeEvent;
|
||||||
|
|
||||||
|
public class SignChangeListener implements Listener {
|
||||||
|
private final LncvrtBox plugin;
|
||||||
|
|
||||||
|
public SignChangeListener(LncvrtBox plugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
private void onSignPlace(SignChangeEvent event) {
|
||||||
|
if (plugin.isMuted(event.getPlayer())) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
36
src/main/resources/plugin.yml
Normal file
36
src/main/resources/plugin.yml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
name: LncvrtBox
|
||||||
|
version: '${version}'
|
||||||
|
main: io.github.lncvrt.lncvrtbox.LncvrtBox
|
||||||
|
api-version: '1.20'
|
||||||
|
depend:
|
||||||
|
- PlaceholderAPI
|
||||||
|
- LuckPerms
|
||||||
|
- Essentials
|
||||||
|
commands:
|
||||||
|
settag:
|
||||||
|
description: Command has been removed
|
||||||
|
usage: /settag
|
||||||
|
sky:
|
||||||
|
description: Teleports you to sky world
|
||||||
|
usage: /sky
|
||||||
|
clearchat:
|
||||||
|
description: Clears chat
|
||||||
|
usage: /clearchat
|
||||||
|
aliases:
|
||||||
|
- cc
|
||||||
|
permission: lncvrtbox.clearchat
|
||||||
|
link:
|
||||||
|
description: Links your discord
|
||||||
|
usage: /link
|
||||||
|
unlink:
|
||||||
|
description: Unlinks your discord
|
||||||
|
usage: /unlink
|
||||||
|
autocompress:
|
||||||
|
description: Auto compressor
|
||||||
|
usage: /autocompress
|
||||||
|
rules:
|
||||||
|
description: Rules
|
||||||
|
usage: /rules
|
||||||
|
lockchat:
|
||||||
|
description: Lockchat
|
||||||
|
usage: /lockchat
|
||||||
36
target/classes/plugin.yml
Normal file
36
target/classes/plugin.yml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
name: LncvrtBox
|
||||||
|
version: '1.0.0'
|
||||||
|
main: io.github.lncvrt.lncvrtbox.LncvrtBox
|
||||||
|
api-version: '1.20'
|
||||||
|
depend:
|
||||||
|
- PlaceholderAPI
|
||||||
|
- LuckPerms
|
||||||
|
- Essentials
|
||||||
|
commands:
|
||||||
|
settag:
|
||||||
|
description: Command has been removed
|
||||||
|
usage: /settag
|
||||||
|
sky:
|
||||||
|
description: Teleports you to sky world
|
||||||
|
usage: /sky
|
||||||
|
clearchat:
|
||||||
|
description: Clears chat
|
||||||
|
usage: /clearchat
|
||||||
|
aliases:
|
||||||
|
- cc
|
||||||
|
permission: lncvrtbox.clearchat
|
||||||
|
link:
|
||||||
|
description: Links your discord
|
||||||
|
usage: /link
|
||||||
|
unlink:
|
||||||
|
description: Unlinks your discord
|
||||||
|
usage: /unlink
|
||||||
|
autocompress:
|
||||||
|
description: Auto compressor
|
||||||
|
usage: /autocompress
|
||||||
|
rules:
|
||||||
|
description: Rules
|
||||||
|
usage: /rules
|
||||||
|
lockchat:
|
||||||
|
description: Lockchat
|
||||||
|
usage: /lockchat
|
||||||
3
target/maven-archiver/pom.properties
Normal file
3
target/maven-archiver/pom.properties
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
artifactId=LncvrtBox
|
||||||
|
groupId=io.github.lncvrt
|
||||||
|
version=1.0.0
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
io\github\lncvrt\lncvrtbox\events\PrepareAnvilListener.class
|
||||||
|
io\github\lncvrt\lncvrtbox\events\EntityResurrectListener.class
|
||||||
|
io\github\lncvrt\lncvrtbox\events\PlayerDropItemListener.class
|
||||||
|
io\github\lncvrt\lncvrtbox\events\PlayerMoveListener.class
|
||||||
|
io\github\lncvrt\lncvrtbox\events\PlayerDeathListener.class
|
||||||
|
io\github\lncvrt\lncvrtbox\events\PrepareItemEnchantListener.class
|
||||||
|
io\github\lncvrt\lncvrtbox\events\EntityDamageListener.class
|
||||||
|
io\github\lncvrt\lncvrtbox\events\FurnaceSmeltListener.class
|
||||||
|
io\github\lncvrt\lncvrtbox\events\PlayerElytraBoostListener.class
|
||||||
|
io\github\lncvrt\lncvrtbox\events\SignChangeListener.class
|
||||||
|
io\github\lncvrt\lncvrtbox\events\CraftItemListener.class
|
||||||
|
io\github\lncvrt\lncvrtbox\events\EntityPickupItemListener.class
|
||||||
|
io\github\lncvrt\lncvrtbox\events\BlockBreakListener.class
|
||||||
|
io\github\lncvrt\lncvrtbox\events\PlayerJoinListener.class
|
||||||
|
io\github\lncvrt\lncvrtbox\events\FurnaceBurnListener.class
|
||||||
|
io\github\lncvrt\lncvrtbox\events\ProjectileHitListener.class
|
||||||
|
io\github\lncvrt\lncvrtbox\events\PortalCreateListener.class
|
||||||
|
io\github\lncvrt\lncvrtbox\LncvrtBox.class
|
||||||
|
io\github\lncvrt\lncvrtbox\PlaceholderAPIExpansion.class
|
||||||
|
io\github\lncvrt\lncvrtbox\events\PlayerChatListener.class
|
||||||
|
io\github\lncvrt\lncvrtbox\events\BlockPlaceListener.class
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
C:\Users\lncvr\IdeaProjects\LncvrtBox\src\main\java\io\github\lncvrt\lncvrtbox\events\PlayerJoinListener.java
|
||||||
|
C:\Users\lncvr\IdeaProjects\LncvrtBox\src\main\java\io\github\lncvrt\lncvrtbox\events\PlayerChatListener.java
|
||||||
|
C:\Users\lncvr\IdeaProjects\LncvrtBox\src\main\java\io\github\lncvrt\lncvrtbox\events\ProjectileHitListener.java
|
||||||
|
C:\Users\lncvr\IdeaProjects\LncvrtBox\src\main\java\io\github\lncvrt\lncvrtbox\events\EntityResurrectListener.java
|
||||||
|
C:\Users\lncvr\IdeaProjects\LncvrtBox\src\main\java\io\github\lncvrt\lncvrtbox\events\EntityPickupItemListener.java
|
||||||
|
C:\Users\lncvr\IdeaProjects\LncvrtBox\src\main\java\io\github\lncvrt\lncvrtbox\events\PlayerMoveListener.java
|
||||||
|
C:\Users\lncvr\IdeaProjects\LncvrtBox\src\main\java\io\github\lncvrt\lncvrtbox\events\FurnaceBurnListener.java
|
||||||
|
C:\Users\lncvr\IdeaProjects\LncvrtBox\src\main\java\io\github\lncvrt\lncvrtbox\PlaceholderAPIExpansion.java
|
||||||
|
C:\Users\lncvr\IdeaProjects\LncvrtBox\src\main\java\io\github\lncvrt\lncvrtbox\events\PlayerDropItemListener.java
|
||||||
|
C:\Users\lncvr\IdeaProjects\LncvrtBox\src\main\java\io\github\lncvrt\lncvrtbox\events\PlayerDeathListener.java
|
||||||
|
C:\Users\lncvr\IdeaProjects\LncvrtBox\src\main\java\io\github\lncvrt\lncvrtbox\events\PrepareAnvilListener.java
|
||||||
|
C:\Users\lncvr\IdeaProjects\LncvrtBox\src\main\java\io\github\lncvrt\lncvrtbox\events\CraftItemListener.java
|
||||||
|
C:\Users\lncvr\IdeaProjects\LncvrtBox\src\main\java\io\github\lncvrt\lncvrtbox\events\PrepareItemEnchantListener.java
|
||||||
|
C:\Users\lncvr\IdeaProjects\LncvrtBox\src\main\java\io\github\lncvrt\lncvrtbox\events\EntityExplodeListener.java
|
||||||
|
C:\Users\lncvr\IdeaProjects\LncvrtBox\src\main\java\io\github\lncvrt\lncvrtbox\events\SignChangeListener.java
|
||||||
|
C:\Users\lncvr\IdeaProjects\LncvrtBox\src\main\java\io\github\lncvrt\lncvrtbox\events\BlockPlaceListener.java
|
||||||
|
C:\Users\lncvr\IdeaProjects\LncvrtBox\src\main\java\io\github\lncvrt\lncvrtbox\events\BlockBreakListener.java
|
||||||
|
C:\Users\lncvr\IdeaProjects\LncvrtBox\src\main\java\io\github\lncvrt\lncvrtbox\events\EntityDamageListener.java
|
||||||
|
C:\Users\lncvr\IdeaProjects\LncvrtBox\src\main\java\io\github\lncvrt\lncvrtbox\events\FurnaceSmeltListener.java
|
||||||
|
C:\Users\lncvr\IdeaProjects\LncvrtBox\src\main\java\io\github\lncvrt\lncvrtbox\LncvrtBox.java
|
||||||
|
C:\Users\lncvr\IdeaProjects\LncvrtBox\src\main\java\io\github\lncvrt\lncvrtbox\events\PlayerElytraBoostListener.java
|
||||||
|
C:\Users\lncvr\IdeaProjects\LncvrtBox\src\main\java\io\github\lncvrt\lncvrtbox\events\PortalCreateListener.java
|
||||||
Reference in New Issue
Block a user