Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
PBoki committed May 10, 2023
1 parent d502d84 commit 421757e
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 167 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>tsp.headdb</groupId>
<artifactId>HeadDB</artifactId>
<version>5.0.0-rc.4</version>
<version>5.0.0-rc.5</version>
<packaging>jar</packaging>

<name>HeadDB</name>
Expand Down
7 changes: 0 additions & 7 deletions src/main/java/tsp/headdb/HeadDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import tsp.headdb.core.storage.Storage;
import tsp.headdb.core.task.UpdateTask;

import tsp.headdb.core.util.BuildProperties;
import tsp.headdb.core.util.HeadDBLogger;
import tsp.smartplugin.SmartPlugin;
import tsp.smartplugin.inventory.PaneListener;
Expand All @@ -35,7 +34,6 @@ public class HeadDB extends SmartPlugin {

private static HeadDB instance;
private HeadDBLogger logger;
private BuildProperties buildProperties;
private TranslatableLocalization localization;
private Storage storage;
private BasicEconomyProvider economyProvider;
Expand All @@ -47,7 +45,6 @@ public void onStart() {
instance.saveDefaultConfig();
instance.logger = new HeadDBLogger(getConfig().getBoolean("debug"));
instance.logger.info("Loading HeadDB - " + instance.getDescription().getVersion());
instance.buildProperties = new BuildProperties(this);

new UpdateTask(getConfig().getLong("refresh", 86400L)).schedule(this);
instance.logger.info("Loaded " + loadLocalization() + " languages!");
Expand Down Expand Up @@ -177,10 +174,6 @@ public TranslatableLocalization getLocalization() {
return localization;
}

public BuildProperties getBuildProperties() {
return buildProperties;
}

public HeadDBLogger getLog() {
return logger;
}
Expand Down
83 changes: 0 additions & 83 deletions src/main/java/tsp/headdb/core/api/event/HeadPurchaseEvent.java

This file was deleted.

8 changes: 2 additions & 6 deletions src/main/java/tsp/headdb/core/command/CommandInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import org.bukkit.command.CommandSender;
import tsp.headdb.HeadDB;
import tsp.headdb.core.util.BuildProperties;
import tsp.headdb.core.util.Utils;
import tsp.smartplugin.player.PlayerUtils;

public class CommandInfo extends SubCommand {
Expand All @@ -15,10 +13,8 @@ public CommandInfo() {
@Override
public void handle(CommandSender sender, String[] args) {
if (HeadDB.getInstance().getConfig().getBoolean("showAdvancedPluginInfo")) {
BuildProperties build = HeadDB.getInstance().getBuildProperties();
PlayerUtils.sendMessage(sender, "&7Running &6HeadDB - " + build.getVersion());
PlayerUtils.sendMessage(sender, "&7Created by &6" + Utils.toString(HeadDB.getInstance().getDescription().getAuthors()));
PlayerUtils.sendMessage(sender, "&7Compiled on &6" + build.getTimestamp() + " &7by &6" + build.getAuthor());
PlayerUtils.sendMessage(sender, "&7Running &6HeadDB - " + HeadDB.getInstance().getDescription().getVersion());
PlayerUtils.sendMessage(sender, "&7GitHub: &6https://github.com/TheSilentPro/HeadDB");
} else {
PlayerUtils.sendMessage(sender, "&7Running &6HeadDB &7by &6TheSilentPro (Silent)");
PlayerUtils.sendMessage(sender, "&7GitHub: &6https://github.com/TheSilentPro/HeadDB");
Expand Down
34 changes: 18 additions & 16 deletions src/main/java/tsp/headdb/core/command/CommandMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,24 +135,26 @@ public void handle(CommandSender sender, String[] args) {
}));

// local
pane.setButton(getInstance().getConfig().getInt("gui.main.meta.local.slot"), new Button(Utils.getItemFromConfig("gui.main.meta.local.item", Material.COMPASS), e -> {
Set<LocalHead> localHeads = HeadAPI.getLocalHeads();
PagedPane localPane = Utils.createPaged(player, Utils.translateTitle(getLocalization().getMessage(player.getUniqueId(), "menu.main.local.name").orElse("Local Heads"), localHeads.size(), "Local"));
for (LocalHead head : localHeads) {
localPane.addButton(new Button(head.getItem(), le -> {
if (le.isLeftClick()) {
ItemStack localItem = head.getItem();
if (le.isShiftClick()) {
localItem.setAmount(64);
}
if (getInstance().getConfig().getBoolean("localHeads")) {
pane.setButton(getInstance().getConfig().getInt("gui.main.meta.local.slot"), new Button(Utils.getItemFromConfig("gui.main.meta.local.item", Material.COMPASS), e -> {
Set<LocalHead> localHeads = HeadAPI.getLocalHeads();
PagedPane localPane = Utils.createPaged(player, Utils.translateTitle(getLocalization().getMessage(player.getUniqueId(), "menu.main.local.name").orElse("Local Heads"), localHeads.size(), "Local"));
for (LocalHead head : localHeads) {
localPane.addButton(new Button(head.getItem(), le -> {
if (le.isLeftClick()) {
ItemStack localItem = head.getItem();
if (le.isShiftClick()) {
localItem.setAmount(64);
}

player.getInventory().addItem(localItem);
}
}));
}
player.getInventory().addItem(localItem);
}
}));
}

localPane.open(player);
}));
localPane.open(player);
}));
}

// Fill
Utils.fill(pane, Utils.getItemFromConfig("gui.main.fill", Material.BLACK_STAINED_GLASS_PANE));
Expand Down
45 changes: 0 additions & 45 deletions src/main/java/tsp/headdb/core/util/BuildProperties.java

This file was deleted.

22 changes: 13 additions & 9 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#file: noinspection YAMLSchemaValidation
name: ${project.name}
description: ${project.description}

Expand All @@ -9,18 +8,11 @@ api-version: 1.19
author: TheSilentPro (Silent)
spigot-id: 84967

buildTimestamp: ${build.timestamp}
buildAuthor: ${build.author}

# Although not up-to-date, spigot already includes gson. This is here just in case.
#libraries:
# - "com.google.code.gson:gson:2.10"

commands:
headdb:
usage: /headdb help
description: Open the database
aliases: [hdb, headdatabase, headmenu]
aliases: ["hdb", "headdatabase", "headmenu"]

permissions:
headdb.admin:
Expand All @@ -30,6 +22,10 @@ permissions:
headdb.command.search: true
headdb.command.give: true
headdb.command.update: true
headdb.command.reload: true
headdb.command.language: true
headdb.command.settings: true
headdb.command.texture: true
headdb.favorites: true
headdb.local: true
headdb.category.*: true
Expand All @@ -41,6 +37,14 @@ permissions:
default: op
headdb.command.update:
default: op
headdb.command.reload:
default: op
headdb.command.language:
default: op
headdb.command.settings:
default: op
headdb.command.texture:
default: op
headdb.favorites:
default: op
headdb.local:
Expand Down

0 comments on commit 421757e

Please sign in to comment.