Files
src
build.gradle
settings.gradle
Code
7 277
src/main/java/com/example/ak47/Ak47Plugin.java
package com.example.ak47;
import org.bukkit.NamespacedKey;
import org.bukkit.plugin.java.JavaPlugin;
public final class Ak47Plugin extends JavaPlugin {
private NamespacedKey itemKey;
private NamespacedKey ammoKey;
@Override
public void onEnable() {
this.itemKey = new NamespacedKey(this, "item_type");
this.ammoKey = new NamespacedKey(this, "ammo");
Ak47Items items = new Ak47Items(itemKey, ammoKey);
getCommand("ak47").setExecutor(new Ak47Command(items));
getServer().getPluginManager().registerEvents(new Ak47Listener(items), this);
getLogger().info("AK-47 and ammunition enabled.");
}
}