cleanup
This commit is contained in:
@@ -6,6 +6,7 @@ import eu.mhsl.minecraft.pixelpics.render.render.Renderer;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
@@ -13,6 +14,7 @@ import java.io.*;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Objects;
|
||||
import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarFile;
|
||||
|
||||
@@ -20,18 +22,42 @@ public final class Main extends JavaPlugin {
|
||||
private static Main instance;
|
||||
private Renderer screenRenderer;
|
||||
|
||||
public final NamespacedKey pictureIdFlag = Objects.requireNonNull(
|
||||
NamespacedKey.fromString("imageId".toLowerCase(), this),
|
||||
"Failed to create item-Flag Namespace"
|
||||
);
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
instance = this;
|
||||
extractJsonResources();
|
||||
|
||||
Bukkit.getPluginCommand("pixelPic").setExecutor(new PixelPicsCommand());
|
||||
Objects.requireNonNull(Bukkit.getPluginCommand("pixelPic"))
|
||||
.setExecutor(new PixelPicsCommand());
|
||||
|
||||
Bukkit.getPluginCommand("test").setExecutor((sender, command, label, args) -> {
|
||||
// Dialog dialog = Dialog.create(
|
||||
// builder -> builder.empty()
|
||||
// .base(
|
||||
// DialogBase.builder(Component.text("Hello World")).build()
|
||||
// )
|
||||
// .type(DialogType.multiAction(
|
||||
// List.of(
|
||||
// ActionButton.builder(Component.text("Option 1")).action(DialogAction.staticAction(ClickEvent.callback(audience -> System.out.println("HIIIII")))).build(),
|
||||
// ActionButton.builder(Component.text("Option 2")).action(DialogAction.customClick(Key.key("test"), null)).build(),
|
||||
// ActionButton.builder(Component.text("Option 3")).action(DialogAction.commandTemplate("say hi")).build()
|
||||
// ),
|
||||
// ActionButton.builder(Component.text("Beenden")).build(),
|
||||
// 3
|
||||
// ))
|
||||
//
|
||||
// );
|
||||
// sender.showDialog(dialog);
|
||||
|
||||
Material.getMaterial("acacia_button");
|
||||
Bukkit.broadcast(Component.text(Material.STONE.getBlockTranslationKey().replace("block.minecraft.", "")));
|
||||
|
||||
if(!(sender instanceof Player player))
|
||||
if(!(sender instanceof Player))
|
||||
throw new IllegalStateException("Dieser Command kann nur von einem Spieler ausgeführt werden!");
|
||||
|
||||
File blockDir = new File(getDataFolder(), "models/block");
|
||||
@@ -48,12 +74,8 @@ public final class Main extends JavaPlugin {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
}
|
||||
|
||||
public void extractJsonResources() {
|
||||
String resourcePath = "models/block/"; // Pfad im JAR
|
||||
String resourcePath = "models/block/";
|
||||
File outputDir = new File(getDataFolder(), resourcePath);
|
||||
if (outputDir.exists()) return;
|
||||
outputDir.mkdirs();
|
||||
|
||||
Reference in New Issue
Block a user