Skip to content

Commit

Permalink
Added WildStacker support on pickup
Browse files Browse the repository at this point in the history
Reworked protection/supported plugins
General tidy up
Beginning work on 1.3.0 features!
  • Loading branch information
BuildTools committed May 29, 2021
1 parent fee0ae8 commit 0ff9367
Show file tree
Hide file tree
Showing 20 changed files with 303 additions and 197 deletions.
11 changes: 10 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.github.sefiraat</groupId>
<artifactId>DankTech</artifactId>
<version>1.2.6-SNAPSHOT</version>
<version>1.2.6</version>

<build>
<plugins>
Expand Down Expand Up @@ -133,6 +133,10 @@
<id>FactionsUUID-repo</id>
<url>https://ci.ender.zone/plugin/repository/everything/</url>
</repository>
<repository>
<id>bg-repo</id>
<url>https://repo.bg-software.com/repository/api/</url>
</repository>
</repositories>

<dependencies>
Expand Down Expand Up @@ -244,6 +248,11 @@
<version>1.6.9.5-U0.5.20</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.bgsoftware</groupId>
<artifactId>WildStackerAPI</artifactId>
<version>latest</version>
</dependency>
</dependencies>

</project>
21 changes: 7 additions & 14 deletions src/main/java/io/github/sefiraat/danktech/DankTech.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import io.github.sefiraat.danktech.listeners.UnloadingListener;
import io.github.sefiraat.danktech.misc.Protection;
import io.github.sefiraat.danktech.misc.SlimefunDankAddon;
import io.github.sefiraat.danktech.misc.SupportedPlugins;
import io.github.sefiraat.danktech.timers.TimerSave;
import org.bstats.bukkit.Metrics;
import org.bukkit.configuration.InvalidConfigurationException;
Expand All @@ -34,13 +35,11 @@ public class DankTech extends JavaPlugin {
private final Timer repeater = new Timer();
private Protection protection;
private Config configClass;
private SupportedPlugins supportedPlugins;
private SlimefunDankAddon slimefunAddon;

private boolean isUnitTest = false;

private boolean mcMMO = false;
private boolean slimefun = false;
private SlimefunDankAddon slimefunAddon;

public File getItemBlacklistConfigFile() {
return itemBlacklistConfigFile;
}
Expand All @@ -65,12 +64,8 @@ public Protection getProtection() {
public Config getConfigClass() {
return configClass;
}

public boolean isMcMMO() {
return mcMMO;
}
public boolean isSlimefun() {
return slimefun;
public SupportedPlugins getSupportedPlugins() {
return supportedPlugins;
}
public SlimefunDankAddon getSlimefunAddon() {
return slimefunAddon;
Expand Down Expand Up @@ -102,6 +97,7 @@ public void onEnable() {
sortConfigs();
registerCommands();

supportedPlugins = new SupportedPlugins(this);
protection = new Protection(this);
configClass = new Config(this);

Expand All @@ -112,10 +108,7 @@ public void onEnable() {

addRecipes();

mcMMO = getServer().getPluginManager().isPluginEnabled("mcMMO");
slimefun = getServer().getPluginManager().isPluginEnabled("Slimefun");

if (isSlimefun()) {
if (supportedPlugins.isSlimefun()) {
slimefunAddon = new SlimefunDankAddon(this.getInstance());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,10 @@ public ConfigStrings(DankTech parent) {

FileConfiguration c = parent.getConfig();

guiFiller = c.getString("TEXTS.GUI.PANE_FILLER");
guiInfoName = c.getString("TEXTS.GUI.PANE_INFO_NAME");
guiInfoLoreId = c.getString("TEXTS.GUI.PANE_INFO_LORE_ID");
guiInfoLoreLevel = c.getString("TEXTS.GUI.PANE_INFO_LORE_LEVEL");
guiFiller = c.getString("TEXTS.GUI.FILLER");
guiInfoName = c.getString("TEXTS.GUI.INFO_NAME");
guiInfoLoreId = c.getString("TEXTS.GUI.INFO_LORE_ID");
guiInfoLoreLevel = c.getString("TEXTS.GUI.INFO_LORE_LEVEL");
guiLockedSlot = c.getString("TEXTS.GUI.LOCKED_SLOT");
guiUnassignedSlot = c.getString("TEXTS.GUI.UNASSIGNED_SLOT");
guiUnassignedSlotLore = c.getStringList("TEXTS.GUI.UNASSIGNED_SLOT_LORE");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,24 @@ private static ChatColor getRarity(int level) {
}
}

private static String getNameDank(DankTech plugin, int level) {
if (level == 9) {
private static String getNameDank(DankTech plugin, Integer level) {
if (level.equals(9)) {
return getRarity(level) + plugin.getConfigClass().getStrings().getItemDankPack() + " [★]";
} else {
return getRarity(level) + plugin.getConfigClass().getStrings().getItemDankPack() + " [T" + level + "]";
}
}

private static String getNameTrash(DankTech plugin, int level) {
if (level == 9) {
private static String getNameTrash(DankTech plugin, Integer level) {
if (level.equals(9)) {
return getRarity(level) + plugin.getConfigClass().getStrings().getItemTrashPack() + " [★]";
} else {
return getRarity(level) + plugin.getConfigClass().getStrings().getItemTrashPack() + " [T" + level + "]";
}
}

private static String getNameCell(DankTech plugin, int level) {
if (level == 9) {
private static String getNameCell(DankTech plugin, Integer level) {
if (level.equals(9)) {
return getRarity(level) + plugin.getConfigClass().getStrings().getItemStorageCell() + " [★]";
} else {
return getRarity(level) + plugin.getConfigClass().getStrings().getItemStorageCell() + " [T" + level + "]";
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/io/github/sefiraat/danktech/finals/ItemStacks.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ public static ItemStack getCell(int level, DankTech plugin) {
return cell;
}

public static ItemStack getRangeUpgrade(int level, DankTech plugin) {
ItemStack cell = SkullCreator.itemFromBase64(UPGRADE_RANGE_TEXTURE);
ItemMeta m = cell.getItemMeta();
m.setDisplayName(getDankCellName(plugin, level));
PersistentDataContainer c = m.getPersistentDataContainer();
NamespacedKey keyDank = new NamespacedKey(plugin,"dank-upgrade");
c.set(keyDank, PersistentDataType.INTEGER, 1);
cell.setItemMeta(m);
return cell;
}

public static ItemStack getShallowDank(int level, DankTech plugin) {
ItemStack dank = createSkull(getDankTexture(level));
makeDank(dank, plugin);
Expand Down
Loading

0 comments on commit 0ff9367

Please sign in to comment.