Skip to content

Commit

Permalink
Merge pull request Slimefun-Addon-Community#15 from variananora/rc-27…
Browse files Browse the repository at this point in the history
…-update

Update to RC-27
  • Loading branch information
TheBusyBiscuit authored Sep 5, 2021
2 parents 20d28cc + 1ab6aaf commit 8b329e9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 25 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@
<dependency>
<groupId>com.github.TheBusyBiscuit</groupId>
<artifactId>Slimefun4</artifactId>
<version>RC-22</version>
<version>RC-27</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>io.github.thebusybiscuit</groupId>
<artifactId>cscorelib2</artifactId>
<groupId>io.github.baked-libs</groupId>
<artifactId>dough-api</artifactId>
</exclusion>
</exclusions>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;

import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
import io.github.thebusybiscuit.slimefun4.implementation.items.backpacks.SlimefunBackpack;
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
import me.mrCookieSlime.Slimefun.Objects.Category;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;

/**
* This is our {@link SlimefunItem} implementation for the {@link DyedBackpack}.
Expand All @@ -26,8 +26,8 @@ public class DyedBackpack extends SlimefunBackpack {
private final BackpackColor color;

@ParametersAreNonnullByDefault
public DyedBackpack(int size, Category category, SlimefunItemStack item, SlimefunItemStack backpack, BackpackColor color) {
super(size, category, item, RecipeType.ENHANCED_CRAFTING_TABLE, createRecipe(backpack, color));
public DyedBackpack(int size, ItemGroup itemGroup, SlimefunItemStack item, SlimefunItemStack backpack, BackpackColor color) {
super(size, itemGroup, item, RecipeType.ENHANCED_CRAFTING_TABLE, createRecipe(backpack, color));

Validate.notNull(color, "Dyed Backpack colors cannot be null!");
this.color = color;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
import org.bukkit.plugin.java.JavaPlugin;

import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon;
import io.github.thebusybiscuit.slimefun4.core.researching.Research;
import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
import io.github.thebusybiscuit.slimefun4.api.researches.Research;
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems;
import me.mrCookieSlime.Slimefun.Objects.Category;
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
import me.mrCookieSlime.Slimefun.cscorelib2.config.Config;
import me.mrCookieSlime.Slimefun.cscorelib2.item.CustomItem;
import me.mrCookieSlime.Slimefun.cscorelib2.skull.SkullItem;
import me.mrCookieSlime.Slimefun.cscorelib2.updater.GitHubBuildsUpdater;
import io.github.thebusybiscuit.slimefun4.libraries.dough.config.Config;
import io.github.thebusybiscuit.slimefun4.libraries.dough.items.CustomItemStack;
import io.github.thebusybiscuit.slimefun4.libraries.dough.skins.PlayerHead;
import io.github.thebusybiscuit.slimefun4.libraries.dough.skins.PlayerSkin;
import io.github.thebusybiscuit.slimefun4.libraries.dough.updater.GitHubBuildsUpdater;

/**
* This is the main class of the {@link DyedBackpacks} addon.
Expand All @@ -37,35 +38,35 @@ public void onEnable() {
}

Research research = new Research(new NamespacedKey(this, "dyed_backpacks"), 17200, "Dyed Backpacks", 24);
Category category = new Category(new NamespacedKey(this, "dyed_backpacks"), new CustomItem(SkullItem.fromHash(BackpackColor.RED.getTexture()), "&4Dyed Backpacks"), 2);
ItemGroup itemGroup = new ItemGroup(new NamespacedKey(this, "dyed_backpacks"), new CustomItemStack(PlayerHead.getItemStack(PlayerSkin.fromHashCode(BackpackColor.RED.getTexture())), "&4Dyed Backpacks"), 2);

if (cfg.getBoolean("backpacks.small")) {
createBackpacks(category, research, SlimefunItems.BACKPACK_SMALL, 9);
createBackpacks(itemGroup, research, SlimefunItems.BACKPACK_SMALL, 9);
}
if (cfg.getBoolean("backpacks.normal")) {
createBackpacks(category, research, SlimefunItems.BACKPACK_MEDIUM, 18);
createBackpacks(itemGroup, research, SlimefunItems.BACKPACK_MEDIUM, 18);
}
if (cfg.getBoolean("backpacks.large")) {
createBackpacks(category, research, SlimefunItems.BACKPACK_LARGE, 27);
createBackpacks(itemGroup, research, SlimefunItems.BACKPACK_LARGE, 27);
}
if (cfg.getBoolean("backpacks.woven")) {
createBackpacks(category, research, SlimefunItems.WOVEN_BACKPACK, 36);
createBackpacks(itemGroup, research, SlimefunItems.WOVEN_BACKPACK, 36);
}
if (cfg.getBoolean("backpacks.gilded")) {
createBackpacks(category, research, SlimefunItems.GILDED_BACKPACK, 45);
createBackpacks(itemGroup, research, SlimefunItems.GILDED_BACKPACK, 45);
}
if (cfg.getBoolean("backpacks.radiant")) {
createBackpacks(category, research, SlimefunItems.RADIANT_BACKPACK, 54);
createBackpacks(itemGroup, research, SlimefunItems.RADIANT_BACKPACK, 54);
}

research.register();
}

@ParametersAreNonnullByDefault
private void createBackpacks(Category category, Research research, SlimefunItemStack backpack, int size) {
private void createBackpacks(ItemGroup itemGroup, Research research, SlimefunItemStack backpack, int size) {
for (BackpackColor color : BackpackColor.values()) {
SlimefunItemStack item = new SlimefunItemStack("DYED_" + backpack.getItemId() + "_" + color.name(), color.getTexture(), backpack.getItemMeta().getDisplayName() + " &7(" + color.getName() + "&7)", backpack.getItemMeta().getLore().toArray(new String[0]));
DyedBackpack dyed = new DyedBackpack(size, category, item, backpack, color);
DyedBackpack dyed = new DyedBackpack(size, itemGroup, item, backpack, color);
research.addItems(dyed);
dyed.register(this);
}
Expand Down

0 comments on commit 8b329e9

Please sign in to comment.