1212import org .bukkit .inventory .ItemStack ;
1313import 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 ;
1519import io .github .thebusybiscuit .slimefun4 .api .SlimefunAddon ;
16- import io .github .thebusybiscuit .slimefun4 .implementation .SlimefunItems ;
1720import io .github .thebusybiscuit .slimefun4 .implementation .items .blocks .BrokenSpawner ;
1821import 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 ;
1926import 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
2928public 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