Remove unused shading, remove rules loading, and temp fix for blackstone buttons / coal fragments
This commit is contained in:
12
pom.xml
12
pom.xml
@@ -21,18 +21,6 @@
|
|||||||
<target>${java.version}</target>
|
<target>${java.version}</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</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>
|
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
<repositories>
|
<repositories>
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.command.TabExecutor;
|
import org.bukkit.command.TabExecutor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.Listener;
|
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
@@ -18,16 +17,18 @@ import xyz.lncvrt.galaxyboxpvp.commands.Autocompress;
|
|||||||
import xyz.lncvrt.galaxyboxpvp.commands.Sky;
|
import xyz.lncvrt.galaxyboxpvp.commands.Sky;
|
||||||
import xyz.lncvrt.galaxyboxpvp.events.*;
|
import xyz.lncvrt.galaxyboxpvp.events.*;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.File;
|
||||||
|
import java.io.FileReader;
|
||||||
|
import java.io.FileWriter;
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
public final class GalaxyBoxPvP extends JavaPlugin implements Listener, TabExecutor {
|
public final class GalaxyBoxPvP extends JavaPlugin implements TabExecutor {
|
||||||
public final Map<UUID, Boolean> autoCompressStatus = new HashMap<>();
|
public final Map<UUID, Boolean> autoCompressStatus = new HashMap<>();
|
||||||
public String serverRules;
|
|
||||||
private Essentials essentials;
|
private Essentials essentials;
|
||||||
private final PlaceholderAPIExpansion placeholderAPIExpansion = new PlaceholderAPIExpansion();
|
private final PlaceholderAPIExpansion placeholderAPIExpansion = new PlaceholderAPIExpansion();
|
||||||
|
|
||||||
@@ -55,7 +56,6 @@ public final class GalaxyBoxPvP extends JavaPlugin implements Listener, TabExecu
|
|||||||
registerCommands();
|
registerCommands();
|
||||||
|
|
||||||
loadAutoCompressStatus();
|
loadAutoCompressStatus();
|
||||||
loadServerRules();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -77,7 +77,6 @@ public final class GalaxyBoxPvP extends JavaPlugin implements Listener, TabExecu
|
|||||||
getServer().getPluginManager().registerEvents(new PrepareItemEnchantListener(), this);
|
getServer().getPluginManager().registerEvents(new PrepareItemEnchantListener(), this);
|
||||||
getServer().getPluginManager().registerEvents(new ProjectileHitListener(), this);
|
getServer().getPluginManager().registerEvents(new ProjectileHitListener(), this);
|
||||||
getServer().getPluginManager().registerEvents(new SignChangeListener(this), this);
|
getServer().getPluginManager().registerEvents(new SignChangeListener(this), this);
|
||||||
getServer().getPluginManager().registerEvents(this, this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerCommands() {
|
private void registerCommands() {
|
||||||
@@ -158,27 +157,6 @@ public final class GalaxyBoxPvP extends JavaPlugin implements Listener, TabExecu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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")
|
@SuppressWarnings("unchecked")
|
||||||
private void saveAutoCompressStatus() {
|
private void saveAutoCompressStatus() {
|
||||||
File file = new File(getDataFolder(), "autocompress.json");
|
File file = new File(getDataFolder(), "autocompress.json");
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import org.bukkit.entity.Player;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public class Sky implements CommandExecutor {
|
public class Sky implements CommandExecutor {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
|
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
|
||||||
if (sender instanceof Player player) {
|
if (sender instanceof Player player) {
|
||||||
|
|||||||
@@ -15,10 +15,7 @@ public class BlockPlaceListener implements Listener {
|
|||||||
public void onBlockPlace(BlockPlaceEvent event) {
|
public void onBlockPlace(BlockPlaceEvent event) {
|
||||||
if (event.getBlockPlaced().getType() == Material.POLISHED_BLACKSTONE_BUTTON) {
|
if (event.getBlockPlaced().getType() == Material.POLISHED_BLACKSTONE_BUTTON) {
|
||||||
if (event.getItemInHand().hasItemMeta() && event.getItemInHand().getItemMeta().hasDisplayName()) {
|
if (event.getItemInHand().hasItemMeta() && event.getItemInHand().getItemMeta().hasDisplayName()) {
|
||||||
String displayName = event.getItemInHand().getItemMeta().getDisplayName();
|
event.setCancelled(true); //temp fix
|
||||||
if (displayName.equalsIgnoreCase("Coal Fragment")) {
|
|
||||||
event.setCancelled(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (event.getBlockPlaced().getType() == Material.FURNACE ||
|
} else if (event.getBlockPlaced().getType() == Material.FURNACE ||
|
||||||
event.getBlockPlaced().getType() == Material.FURNACE_MINECART ||
|
event.getBlockPlaced().getType() == Material.FURNACE_MINECART ||
|
||||||
|
|||||||
Reference in New Issue
Block a user