Skip to content

Commit 60f0c8d

Browse files
Merge pull request #43 from variananora/rc-27-update
Update to RC-27
2 parents 2d44303 + 24024f5 commit 60f0c8d

16 files changed

Lines changed: 64 additions & 64 deletions

.gitignore

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

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@
105105
<dependency>
106106
<groupId>com.github.TheBusyBiscuit</groupId>
107107
<artifactId>Slimefun4</artifactId>
108-
<version>RC-21</version>
108+
<version>RC-27</version>
109109
<scope>provided</scope>
110110
<exclusions>
111111
<exclusion>
112-
<groupId>io.github.thebusybiscuit</groupId>
113-
<artifactId>cscorelib2</artifactId>
112+
<groupId>io.github.baked-libs</groupId>
113+
<artifactId>dough-api</artifactId>
114114
</exclusion>
115115
</exclusions>
116116
</dependency>

src/main/java/io/github/thebusybiscuit/slimefunluckyblocks/LuckyBlock.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@
1414
import org.bukkit.event.block.BlockBreakEvent;
1515
import org.bukkit.inventory.ItemStack;
1616

17+
import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
18+
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
19+
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
20+
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
1721
import io.github.thebusybiscuit.slimefun4.core.handlers.BlockBreakHandler;
1822
import io.github.thebusybiscuit.slimefunluckyblocks.surprises.Surprise;
19-
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
20-
import me.mrCookieSlime.Slimefun.Objects.Category;
21-
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
22-
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
2323

2424
public class LuckyBlock extends SlimefunItem {
2525

2626
private Collection<Surprise> surprises;
2727
private Predicate<Surprise> predicate;
2828

29-
public LuckyBlock(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
30-
super(category, item, recipeType, recipe);
29+
public LuckyBlock(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
30+
super(itemGroup, item, recipeType, recipe);
3131

3232
addItemHandler(onBlockBreak());
3333
}

src/main/java/io/github/thebusybiscuit/slimefunluckyblocks/SlimefunLuckyBlocks.java

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,19 @@
2222
import org.bukkit.plugin.java.JavaPlugin;
2323
import org.bukkit.potion.PotionEffect;
2424

25+
import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
26+
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
27+
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
28+
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
2529
import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon;
30+
import io.github.thebusybiscuit.slimefun4.libraries.dough.common.ChatColors;
31+
import io.github.thebusybiscuit.slimefun4.libraries.dough.common.CommonPatterns;
32+
import io.github.thebusybiscuit.slimefun4.libraries.dough.config.Config;
33+
import io.github.thebusybiscuit.slimefun4.libraries.dough.items.CustomItemStack;
34+
import io.github.thebusybiscuit.slimefun4.libraries.dough.skins.PlayerHead;
35+
import io.github.thebusybiscuit.slimefun4.libraries.dough.skins.PlayerSkin;
36+
import io.github.thebusybiscuit.slimefun4.libraries.dough.updater.GitHubBuildsUpdater;
2637
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems;
27-
import io.github.thebusybiscuit.slimefun4.utils.PatternUtils;
2838
import io.github.thebusybiscuit.slimefunluckyblocks.surprises.CustomItemSurprise;
2939
import io.github.thebusybiscuit.slimefunluckyblocks.surprises.LuckLevel;
3040
import io.github.thebusybiscuit.slimefunluckyblocks.surprises.Surprise;
@@ -79,18 +89,7 @@
7989
import io.github.thebusybiscuit.slimefunluckyblocks.surprises.unlucky.WalshrusSurprise;
8090
import io.github.thebusybiscuit.slimefunluckyblocks.surprises.unlucky.WitchSurprise;
8191
import io.github.thebusybiscuit.slimefunluckyblocks.surprises.unlucky.ZombiePigmenSurprise;
82-
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
83-
import me.mrCookieSlime.Slimefun.Objects.Category;
84-
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
8592
import me.mrCookieSlime.Slimefun.api.BlockStorage;
86-
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
87-
import me.mrCookieSlime.Slimefun.cscorelib2.chat.ChatColors;
88-
import me.mrCookieSlime.Slimefun.cscorelib2.config.Config;
89-
import me.mrCookieSlime.Slimefun.cscorelib2.item.CustomItem;
90-
import me.mrCookieSlime.Slimefun.cscorelib2.skull.SkullBlock;
91-
import me.mrCookieSlime.Slimefun.cscorelib2.skull.SkullItem;
92-
import me.mrCookieSlime.Slimefun.cscorelib2.updater.GitHubBuildsUpdater;
93-
import me.mrCookieSlime.Slimefun.cscorelib2.updater.Updater;
9493

9594
public class SlimefunLuckyBlocks extends JavaPlugin implements SlimefunAddon {
9695

@@ -107,32 +106,28 @@ public void onEnable() {
107106
// Setting up bStats
108107
new Metrics(this, 4858);
109108

110-
if (getDescription().getVersion().startsWith("DEV - ")) {
111-
Updater updater = new GitHubBuildsUpdater(this, getFile(), "TheBusyBiscuit/luckyblocks-sf/master");
112-
113-
if (cfg.getBoolean("options.auto-update")) {
114-
updater.start();
115-
}
109+
if (cfg.getBoolean("options.auto-update") && getDescription().getVersion().startsWith("DEV - ")) {
110+
new GitHubBuildsUpdater(this, getFile(), "TheBusyBiscuit/luckyblocks-sf/master").start();
116111
}
117112

118-
Category category = new Category(new NamespacedKey(this, "lucky_blocks"), new CustomItem(SkullItem.fromHash(TEXTURE), "&rLucky Blocks"));
113+
ItemGroup itemGroup = new ItemGroup(new NamespacedKey(this, "lucky_blocks"), new CustomItemStack(PlayerHead.getItemStack(PlayerSkin.fromHashCode(TEXTURE)), "&rLucky Blocks"));
119114

120115
SlimefunItemStack luckyBlock = new SlimefunItemStack("LUCKY_BLOCK", TEXTURE, "&fLucky Block", "&7Luck: &f0");
121116
SlimefunItemStack veryLuckyBlock = new SlimefunItemStack("LUCKY_BLOCK_LUCKY", TEXTURE, "&fVery lucky Block", "&7Luck: &a+80");
122117
SlimefunItemStack veryUnluckyBlock = new SlimefunItemStack("LUCKY_BLOCK_UNLUCKY", TEXTURE, "&fVery unlucky Block", "&7Luck: &c-80");
123118
SlimefunItemStack pandorasBox = new SlimefunItemStack("PANDORAS_BOX", "86c7dde512871bd607b77e6635ad39f44f2d5b4729e60273f1b14fba9a86a", "&5Pandora\"s Box", "&7Luck: &c&oERROR");
124119

125120
// @formatter:off
126-
new LuckyBlock(category, luckyBlock, RecipeType.ENHANCED_CRAFTING_TABLE,
121+
new LuckyBlock(itemGroup, luckyBlock, RecipeType.ENHANCED_CRAFTING_TABLE,
127122
new ItemStack[] { SlimefunItems.GOLD_12K, SlimefunItems.GOLD_12K, SlimefunItems.GOLD_12K, SlimefunItems.GOLD_12K, new ItemStack(Material.DISPENSER), SlimefunItems.GOLD_12K, SlimefunItems.GOLD_12K, SlimefunItems.GOLD_12K, SlimefunItems.GOLD_12K }).register(this, surprises, s -> s.getLuckLevel() != LuckLevel.PANDORA);
128123

129-
new LuckyBlock(category, veryLuckyBlock, RecipeType.ENHANCED_CRAFTING_TABLE,
124+
new LuckyBlock(itemGroup, veryLuckyBlock, RecipeType.ENHANCED_CRAFTING_TABLE,
130125
new ItemStack[] { null, SlimefunItems.GOLD_12K, null, SlimefunItems.GOLD_12K, luckyBlock, SlimefunItems.GOLD_12K, null, SlimefunItems.GOLD_12K, null }).register(this, surprises, s -> s.getLuckLevel() == LuckLevel.LUCKY);
131126

132-
new LuckyBlock(category, veryUnluckyBlock, RecipeType.ENHANCED_CRAFTING_TABLE,
127+
new LuckyBlock(itemGroup, veryUnluckyBlock, RecipeType.ENHANCED_CRAFTING_TABLE,
133128
new ItemStack[] { null, new ItemStack(Material.SPIDER_EYE), null, new ItemStack(Material.SPIDER_EYE), luckyBlock, new ItemStack(Material.SPIDER_EYE), null, new ItemStack(Material.SPIDER_EYE), null }).register(this, surprises, s -> s.getLuckLevel() == LuckLevel.UNLUCKY);
134129

135-
new LuckyBlock(category, pandorasBox, RecipeType.ENHANCED_CRAFTING_TABLE,
130+
new LuckyBlock(itemGroup, pandorasBox, RecipeType.ENHANCED_CRAFTING_TABLE,
136131
new ItemStack[] { new ItemStack(Material.OAK_PLANKS), new ItemStack(Material.LAPIS_BLOCK), new ItemStack(Material.OAK_PLANKS), new ItemStack(Material.LAPIS_BLOCK), luckyBlock, new ItemStack(Material.LAPIS_BLOCK), new ItemStack(Material.OAK_PLANKS), new ItemStack(Material.LAPIS_BLOCK), new ItemStack(Material.OAK_PLANKS) }).register(this, surprises, s -> s.getLuckLevel() == LuckLevel.PANDORA);
137132
// @formatter:on
138133

@@ -233,7 +228,7 @@ private void registerCustomSurprises() {
233228

234229
if (cfg.getString(itemPath + ".slimefun_item") != null) {
235230
String id = cfg.getString(itemPath + ".slimefun_item").toUpperCase(Locale.ROOT);
236-
SlimefunItem sfItem = SlimefunItem.getByID(id);
231+
SlimefunItem sfItem = SlimefunItem.getById(id);
237232

238233
if (sfItem != null) {
239234
item = sfItem.getItem();
@@ -273,7 +268,7 @@ private void registerCustomSurprises() {
273268

274269
if (enchantment != null) {
275270
if (split.length == 2) {
276-
if (!PatternUtils.NUMERIC.matcher(split[1]).matches()) {
271+
if (!CommonPatterns.NUMERIC.matcher(split[1]).matches()) {
277272
getLogger().log(Level.WARNING, "Could not set \"{0}\" enchant with level \"{1}\" for custom surprise \"{2}\"", new Object[] { enchName, split[1], name });
278273
continue;
279274
}
@@ -344,7 +339,7 @@ public void spawnLuckyBlock(Block b) {
344339
});
345340

346341
b.setBlockData(data);
347-
SkullBlock.setFromHash(b, TEXTURE);
342+
PlayerHead.setSkin(b, PlayerSkin.fromHashCode(TEXTURE), true);
348343
BlockStorage.store(b, "LUCKY_BLOCK");
349344

350345
if (getCfg().getBoolean("debug")) {

src/main/java/io/github/thebusybiscuit/slimefunluckyblocks/surprises/lucky/LuckyAxeSurprise.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010

1111
import io.github.thebusybiscuit.slimefunluckyblocks.surprises.LuckLevel;
1212
import io.github.thebusybiscuit.slimefunluckyblocks.surprises.Surprise;
13-
import me.mrCookieSlime.Slimefun.cscorelib2.item.CustomItem;
13+
import io.github.thebusybiscuit.slimefun4.libraries.dough.items.CustomItemStack;
1414

1515
public final class LuckyAxeSurprise implements Surprise {
1616

1717
private final ItemStack axe;
1818

1919
public LuckyAxeSurprise() {
20-
axe = new CustomItem(Material.GOLDEN_AXE, "&e&lLucky Axe");
20+
axe = new CustomItemStack(Material.GOLDEN_AXE, "&e&lLucky Axe");
2121
axe.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 10);
2222
axe.addUnsafeEnchantment(Enchantment.DIG_SPEED, 10);
2323
axe.addUnsafeEnchantment(Enchantment.LOOT_BONUS_BLOCKS, 10);

src/main/java/io/github/thebusybiscuit/slimefunluckyblocks/surprises/lucky/LuckyBootsSurprise.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010

1111
import io.github.thebusybiscuit.slimefunluckyblocks.surprises.LuckLevel;
1212
import io.github.thebusybiscuit.slimefunluckyblocks.surprises.Surprise;
13-
import me.mrCookieSlime.Slimefun.cscorelib2.item.CustomItem;
13+
import io.github.thebusybiscuit.slimefun4.libraries.dough.items.CustomItemStack;
1414

1515
public final class LuckyBootsSurprise implements Surprise {
1616

1717
private final ItemStack boots;
1818

1919
public LuckyBootsSurprise() {
20-
boots = new CustomItem(Material.DIAMOND_BOOTS, "&e&lLucky Boots");
20+
boots = new CustomItemStack(Material.DIAMOND_BOOTS, "&e&lLucky Boots");
2121
boots.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 10);
2222
boots.addUnsafeEnchantment(Enchantment.PROTECTION_PROJECTILE, 10);
2323
boots.addUnsafeEnchantment(Enchantment.PROTECTION_EXPLOSIONS, 5);

src/main/java/io/github/thebusybiscuit/slimefunluckyblocks/surprises/lucky/LuckyChestplateSurprise.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010

1111
import io.github.thebusybiscuit.slimefunluckyblocks.surprises.LuckLevel;
1212
import io.github.thebusybiscuit.slimefunluckyblocks.surprises.Surprise;
13-
import me.mrCookieSlime.Slimefun.cscorelib2.item.CustomItem;
13+
import io.github.thebusybiscuit.slimefun4.libraries.dough.items.CustomItemStack;
1414

1515
public final class LuckyChestplateSurprise implements Surprise {
1616

1717
private final ItemStack chestplate;
1818

1919
public LuckyChestplateSurprise() {
20-
chestplate = new CustomItem(Material.DIAMOND_CHESTPLATE, "&e&lLucky Chestplate");
20+
chestplate = new CustomItemStack(Material.DIAMOND_CHESTPLATE, "&e&lLucky Chestplate");
2121
chestplate.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 10);
2222
chestplate.addUnsafeEnchantment(Enchantment.PROTECTION_PROJECTILE, 10);
2323
chestplate.addUnsafeEnchantment(Enchantment.PROTECTION_EXPLOSIONS, 5);

src/main/java/io/github/thebusybiscuit/slimefunluckyblocks/surprises/lucky/LuckyHelmetSurprise.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010

1111
import io.github.thebusybiscuit.slimefunluckyblocks.surprises.LuckLevel;
1212
import io.github.thebusybiscuit.slimefunluckyblocks.surprises.Surprise;
13-
import me.mrCookieSlime.Slimefun.cscorelib2.item.CustomItem;
13+
import io.github.thebusybiscuit.slimefun4.libraries.dough.items.CustomItemStack;
1414

1515
public final class LuckyHelmetSurprise implements Surprise {
1616

1717
private final ItemStack helmet;
1818

1919
public LuckyHelmetSurprise() {
20-
helmet = new CustomItem(Material.DIAMOND_HELMET, "&e&lLucky Helmet");
20+
helmet = new CustomItemStack(Material.DIAMOND_HELMET, "&e&lLucky Helmet");
2121
helmet.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 10);
2222
helmet.addUnsafeEnchantment(Enchantment.PROTECTION_PROJECTILE, 10);
2323
helmet.addUnsafeEnchantment(Enchantment.PROTECTION_EXPLOSIONS, 5);

src/main/java/io/github/thebusybiscuit/slimefunluckyblocks/surprises/lucky/LuckyLeggingsSurprise.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010

1111
import io.github.thebusybiscuit.slimefunluckyblocks.surprises.LuckLevel;
1212
import io.github.thebusybiscuit.slimefunluckyblocks.surprises.Surprise;
13-
import me.mrCookieSlime.Slimefun.cscorelib2.item.CustomItem;
13+
import io.github.thebusybiscuit.slimefun4.libraries.dough.items.CustomItemStack;
1414

1515
public final class LuckyLeggingsSurprise implements Surprise {
1616

1717
private final ItemStack leggings;
1818

1919
public LuckyLeggingsSurprise() {
20-
leggings = new CustomItem(Material.DIAMOND_LEGGINGS, "&e&lLucky Leggings");
20+
leggings = new CustomItemStack(Material.DIAMOND_LEGGINGS, "&e&lLucky Leggings");
2121
leggings.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 10);
2222
leggings.addUnsafeEnchantment(Enchantment.PROTECTION_PROJECTILE, 10);
2323
leggings.addUnsafeEnchantment(Enchantment.PROTECTION_EXPLOSIONS, 5);

src/main/java/io/github/thebusybiscuit/slimefunluckyblocks/surprises/lucky/LuckyPickaxeSurprise.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010

1111
import io.github.thebusybiscuit.slimefunluckyblocks.surprises.LuckLevel;
1212
import io.github.thebusybiscuit.slimefunluckyblocks.surprises.Surprise;
13-
import me.mrCookieSlime.Slimefun.cscorelib2.item.CustomItem;
13+
import io.github.thebusybiscuit.slimefun4.libraries.dough.items.CustomItemStack;
1414

1515
public final class LuckyPickaxeSurprise implements Surprise {
1616

1717
private final ItemStack pickaxe;
1818

1919
public LuckyPickaxeSurprise() {
20-
pickaxe = new CustomItem(Material.GOLDEN_PICKAXE, "&e&lLucky Pickaxe");
20+
pickaxe = new CustomItemStack(Material.GOLDEN_PICKAXE, "&e&lLucky Pickaxe");
2121
pickaxe.addUnsafeEnchantment(Enchantment.DIG_SPEED, 10);
2222
pickaxe.addUnsafeEnchantment(Enchantment.LOOT_BONUS_BLOCKS, 10);
2323
pickaxe.addUnsafeEnchantment(Enchantment.DURABILITY, 10);

0 commit comments

Comments
 (0)