Skip to content

Commit b8358a1

Browse files
Merge pull request #28 from variananora/rc-27-update
Update to RC-27
2 parents 8b3c58b + 882211f commit b8358a1

File tree

5 files changed

+36
-39
lines changed

5 files changed

+36
-39
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
.classpath
22
.project
3+
.iml
34
/.settings/
45
/bin/
5-
/target/
6+
/target/
7+
/.idea/
8+
dependency-reduced-pom.xml

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@
104104
<dependency>
105105
<groupId>com.github.TheBusyBiscuit</groupId>
106106
<artifactId>Slimefun4</artifactId>
107-
<version>RC-20</version>
107+
<version>RC-27</version>
108108
<scope>provided</scope>
109109
<exclusions>
110110
<exclusion>
111-
<groupId>io.github.thebusybiscuit</groupId>
112-
<artifactId>cscorelib2</artifactId>
111+
<groupId>io.github.baked-libs</groupId>
112+
<artifactId>dough-api</artifactId>
113113
</exclusion>
114114
</exclusions>
115115
</dependency>

src/main/java/io/github/thebusybiscuit/souljars/FilledJar.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
import org.bukkit.inventory.ItemStack;
44

5+
import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
6+
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
7+
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
58
import io.github.thebusybiscuit.slimefun4.implementation.items.blocks.UnplaceableBlock;
6-
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
7-
import me.mrCookieSlime.Slimefun.Objects.Category;
8-
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
99

1010
public class FilledJar extends UnplaceableBlock {
1111

12-
public FilledJar(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
13-
super(category, item, recipeType, recipe);
12+
public FilledJar(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
13+
super(itemGroup, item, recipeType, recipe);
1414
this.hidden = true;
1515
}
1616

src/main/java/io/github/thebusybiscuit/souljars/JarsListener.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
import org.bukkit.inventory.ItemStack;
1313
import org.bukkit.inventory.meta.ItemMeta;
1414

15-
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
16-
import me.mrCookieSlime.Slimefun.cscorelib2.inventory.ItemUtils;
15+
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
16+
import io.github.thebusybiscuit.slimefun4.libraries.dough.items.ItemUtils;
1717

1818
public class JarsListener implements Listener {
1919

@@ -24,7 +24,7 @@ public JarsListener(SoulJars plugin) {
2424
plugin.getServer().getPluginManager().registerEvents(this, plugin);
2525

2626
this.plugin = plugin;
27-
this.emptyJar = SlimefunItem.getByID("SOUL_JAR");
27+
this.emptyJar = SlimefunItem.getById("SOUL_JAR");
2828
}
2929

3030
@EventHandler
@@ -36,8 +36,8 @@ public void onKill(EntityDeathEvent e) {
3636

3737
Player killer = e.getEntity().getKiller();
3838

39-
SlimefunItem jar = SlimefunItem.getByID(e.getEntityType().name() + "_SOUL_JAR");
40-
SlimefunItem filledJar = SlimefunItem.getByID("FILLED_" + e.getEntityType().name() + "_SOUL_JAR");
39+
SlimefunItem jar = SlimefunItem.getById(e.getEntityType().name() + "_SOUL_JAR");
40+
SlimefunItem filledJar = SlimefunItem.getById("FILLED_" + e.getEntityType().name() + "_SOUL_JAR");
4141

4242
// Filling all existing Jars
4343
for (int slot = 0; slot < killer.getInventory().getSize(); slot++) {

src/main/java/io/github/thebusybiscuit/souljars/SoulJars.java

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,26 @@
1212
import org.bukkit.inventory.ItemStack;
1313
import org.bukkit.plugin.java.JavaPlugin;
1414

15+
import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
16+
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
17+
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
18+
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
1519
import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon;
16-
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems;
1720
import io.github.thebusybiscuit.slimefun4.implementation.items.blocks.BrokenSpawner;
1821
import io.github.thebusybiscuit.slimefun4.implementation.items.blocks.UnplaceableBlock;
22+
import io.github.thebusybiscuit.slimefun4.libraries.dough.config.Config;
23+
import io.github.thebusybiscuit.slimefun4.libraries.dough.items.CustomItemStack;
24+
import io.github.thebusybiscuit.slimefun4.libraries.dough.updater.GitHubBuildsUpdater;
25+
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems;
1926
import io.github.thebusybiscuit.slimefun4.utils.ChatUtils;
20-
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
21-
import me.mrCookieSlime.Slimefun.Objects.Category;
22-
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
23-
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
24-
import me.mrCookieSlime.Slimefun.cscorelib2.config.Config;
25-
import me.mrCookieSlime.Slimefun.cscorelib2.item.CustomItem;
26-
import me.mrCookieSlime.Slimefun.cscorelib2.updater.GitHubBuildsUpdater;
27-
import me.mrCookieSlime.Slimefun.cscorelib2.updater.Updater;
2827

2928
public class SoulJars extends JavaPlugin implements Listener, SlimefunAddon {
3029

3130
private static final String JAR_TEXTURE = "bd1c777ee166c47cae698ae6b769da4e2b67f468855330ad7bddd751c5293f";
3231
private final Map<EntityType, Integer> mobs = new EnumMap<>(EntityType.class);
3332

3433
private Config cfg;
35-
private Category category;
34+
private ItemGroup itemGroup;
3635
private RecipeType recipeType;
3736
private SlimefunItemStack emptyJar;
3837

@@ -43,20 +42,15 @@ public void onEnable() {
4342
// Setting up bStats
4443
new Metrics(this, 5581);
4544

46-
if (getDescription().getVersion().startsWith("DEV - ")) {
47-
Updater updater = new GitHubBuildsUpdater(this, getFile(), "TheBusyBiscuit/SoulJars/master");
48-
49-
// Only run the Updater if it has not been disabled
50-
if (cfg.getBoolean("options.auto-update")) {
51-
updater.start();
52-
}
45+
if (cfg.getBoolean("options.auto-update") && getDescription().getVersion().startsWith("DEV - ")) {
46+
new GitHubBuildsUpdater(this, getFile(), "TheBusyBiscuit/SoulJars/master").start();
5347
}
5448

5549
emptyJar = new SlimefunItemStack("SOUL_JAR", JAR_TEXTURE, "&bSoul Jar &7(Empty)", "", "&rKill a Mob while having this", "&rItem in your Inventory to bind", "&rtheir Soul to this Jar");
56-
category = new Category(new NamespacedKey(this, "soul_jars"), new CustomItem(emptyJar, "&bSoul Jars", "", "&a> Click to open"));
57-
recipeType = new RecipeType(new NamespacedKey(this, "mob_killing"), new CustomItem(Material.DIAMOND_SWORD, "&cKill the specified Mob", "&cwhile having an empty Soul Jar", "&cin your Inventory"));
50+
itemGroup = new ItemGroup(new NamespacedKey(this, "soul_jars"), new CustomItemStack(emptyJar, "&bSoul Jars", "", "&a> Click to open"));
51+
recipeType = new RecipeType(new NamespacedKey(this, "mob_killing"), new CustomItemStack(Material.DIAMOND_SWORD, "&cKill the specified Mob", "&cwhile having an empty Soul Jar", "&cin your Inventory"));
5852

59-
new SlimefunItem(category, emptyJar, RecipeType.ANCIENT_ALTAR, new ItemStack[] { SlimefunItems.EARTH_RUNE, new ItemStack(Material.SOUL_SAND), SlimefunItems.WATER_RUNE, new ItemStack(Material.SOUL_SAND), SlimefunItems.NECROTIC_SKULL, new ItemStack(Material.SOUL_SAND), SlimefunItems.AIR_RUNE, new ItemStack(Material.SOUL_SAND), SlimefunItems.FIRE_RUNE }, new CustomItem(emptyJar, 3)).register(this);
53+
new SlimefunItem(itemGroup, emptyJar, RecipeType.ANCIENT_ALTAR, new ItemStack[] { SlimefunItems.EARTH_RUNE, new ItemStack(Material.SOUL_SAND), SlimefunItems.WATER_RUNE, new ItemStack(Material.SOUL_SAND), SlimefunItems.NECROTIC_SKULL, new ItemStack(Material.SOUL_SAND), SlimefunItems.AIR_RUNE, new ItemStack(Material.SOUL_SAND), SlimefunItems.FIRE_RUNE }, new CustomItemStack(emptyJar, 3)).register(this);
6054
new JarsListener(this);
6155

6256
for (String mob : cfg.getStringList("mobs")) {
@@ -85,19 +79,19 @@ private void registerSoul(EntityType type) {
8579

8680
// @formatter:off
8781
SlimefunItemStack jarItem = new SlimefunItemStack(type.name() + "_SOUL_JAR", JAR_TEXTURE, "&cSoul Jar &7(" + name + ")", "", "&7Infused Souls: &e1");
88-
SlimefunItem jar = new UnplaceableBlock(category, jarItem, recipeType,
89-
new ItemStack[] { null, null, null, emptyJar, null, new CustomItem(mobEgg, "&rKill " + souls + "x " + name), null, null, null });
82+
SlimefunItem jar = new UnplaceableBlock(itemGroup, jarItem, recipeType,
83+
new ItemStack[] { null, null, null, emptyJar, null, new CustomItemStack(mobEgg, "&rKill " + souls + "x " + name), null, null, null });
9084
jar.register(this);
9185

9286
SlimefunItemStack filledJarItem = new SlimefunItemStack("FILLED_" + type.name() + "_SOUL_JAR", JAR_TEXTURE, "&cFilled Soul Jar &7(" + name + ")", "", "&7Infused Souls: &e" + souls);
93-
SlimefunItem filledJar = new FilledJar(category, filledJarItem, recipeType,
94-
new ItemStack[] { null, null, null, emptyJar, null, new CustomItem(mobEgg, "&rKill " + souls + "x " + name), null, null, null });
87+
SlimefunItem filledJar = new FilledJar(itemGroup, filledJarItem, recipeType,
88+
new ItemStack[] { null, null, null, emptyJar, null, new CustomItemStack(mobEgg, "&rKill " + souls + "x " + name), null, null, null });
9589
filledJar.register(this);
9690

9791
BrokenSpawner brokenSpawner = SlimefunItems.BROKEN_SPAWNER.getItem(BrokenSpawner.class);
9892

9993
SlimefunItemStack spawnerItem = new SlimefunItemStack(type.toString() + "_BROKEN_SPAWNER", Material.SPAWNER, "&cBroken Spawner &7(" + name + ")");
100-
new SlimefunItem(category, spawnerItem, RecipeType.ANCIENT_ALTAR,
94+
new SlimefunItem(itemGroup, spawnerItem, RecipeType.ANCIENT_ALTAR,
10195
new ItemStack[] { new ItemStack(Material.IRON_BARS), SlimefunItems.EARTH_RUNE, new ItemStack(Material.IRON_BARS), SlimefunItems.EARTH_RUNE, filledJarItem, SlimefunItems.EARTH_RUNE, new ItemStack(Material.IRON_BARS), SlimefunItems.EARTH_RUNE, new ItemStack(Material.IRON_BARS) },
10296
brokenSpawner.getItemForEntityType(type)).register(this);
10397
// @formatter:on

0 commit comments

Comments
 (0)