Skip to content

Commit

Permalink
Merge pull request #20 from variananora/rc-27-update
Browse files Browse the repository at this point in the history
Update to RC-27
  • Loading branch information
TheBusyBiscuit authored Sep 5, 2021
2 parents 69930ef + 91c4e13 commit 963f038
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 53 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@
<dependency>
<groupId>com.github.Slimefun</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 @@ -17,21 +17,21 @@
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;

import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
import io.github.thebusybiscuit.slimefun4.core.attributes.NotPlaceable;
import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler;
import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem;
import io.github.thebusybiscuit.slimefun4.libraries.paperlib.PaperLib;
import io.github.thebusybiscuit.slimefun4.utils.ChatUtils;
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
import me.mrCookieSlime.Slimefun.Objects.Category;
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;

public class MagicalMirror extends SimpleSlimefunItem<ItemUseHandler> implements NotPlaceable {

private final NamespacedKey mirrorLocation;

public MagicalMirror(TreeTaps plugin, Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
super(category, item, recipeType, recipe);
public MagicalMirror(TreeTaps plugin, ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
super(itemGroup, item, recipeType, recipe);
mirrorLocation = new NamespacedKey(plugin, "mirror_location");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;

import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
import io.github.thebusybiscuit.slimefun4.core.attributes.RecipeDisplayItem;
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
import me.mrCookieSlime.Slimefun.Objects.Category;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer;
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;

public abstract class ResinExtractor extends AContainer implements RecipeDisplayItem {

public ResinExtractor(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
super(category, item, recipeType, recipe);
public ResinExtractor(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
super(itemGroup, item, recipeType, recipe);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;

import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
import io.github.thebusybiscuit.slimefun4.core.attributes.RecipeDisplayItem;
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
import me.mrCookieSlime.Slimefun.Objects.Category;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer;
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;

public abstract class RubberFactory extends AContainer implements RecipeDisplayItem {

public RubberFactory(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
super(category, item, recipeType, recipe);
public RubberFactory(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
super(itemGroup, item, recipeType, recipe);
}

@Override
Expand Down
54 changes: 27 additions & 27 deletions src/main/java/io/github/thebusybiscuit/slimytreetaps/TreeTaps.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.plugin.java.JavaPlugin;

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.api.researches.Research;
import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion;
import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon;
import io.github.thebusybiscuit.slimefun4.core.attributes.MachineTier;
import io.github.thebusybiscuit.slimefun4.core.attributes.MachineType;
import io.github.thebusybiscuit.slimefun4.core.researching.Research;
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems;
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
import io.github.thebusybiscuit.slimefun4.implementation.items.blocks.UnplaceableBlock;
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
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.updater.GitHubBuildsUpdater;
import io.github.thebusybiscuit.slimefun4.utils.LoreBuilder;
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;
import me.mrCookieSlime.Slimefun.cscorelib2.config.Config;
import me.mrCookieSlime.Slimefun.cscorelib2.item.CustomItem;
import me.mrCookieSlime.Slimefun.cscorelib2.updater.GitHubBuildsUpdater;

public class TreeTaps extends JavaPlugin implements SlimefunAddon {

Expand Down Expand Up @@ -54,50 +54,50 @@ public void onEnable() {
SlimefunItemStack resinExtractor2 = new SlimefunItemStack("RESIN_EXTRACTOR_2", Material.SMITHING_TABLE, "&cResin Extractor &7(&eII&7)", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), "&8\u21E8 &7Speed: 2x", "&8\u21E8 &e\u26A1 &756 J/s");

SlimefunItemStack amber = new SlimefunItemStack("AMBER", "ac7f7b72fc3e733828fcccc0ca8278aca2633aa33a231c93a682d14ac54aa0c4", "&6Amber", "", "&eA hardened gem acquired from Resin");
SlimefunItemStack amberBlock = new SlimefunItemStack("AMBER_BLOCK", SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16) ? Material.SHROOMLIGHT: Material.GLOWSTONE, "&6Block of Amber");
SlimefunItemStack amberBlock = new SlimefunItemStack("AMBER_BLOCK", Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16) ? Material.SHROOMLIGHT: Material.GLOWSTONE, "&6Block of Amber");

SlimefunItemStack blueEnderPearl = new SlimefunItemStack("BLUE_ENDER_PEARL", "38be8abd66d09a58ce12d377544d726d25cad7e979e8c2481866be94d3b32f", "&9Blue Ender Pearl", "", "&7This item can be used to", "&7craft Magical Mirrors");
SlimefunItemStack magicalMirror = new SlimefunItemStack("MAGICAL_MIRROR", Material.BLUE_STAINED_GLASS_PANE, "&9Magical Mirror &7(Unbound)", "", "&eRight Click &7to bind this Mirror", "&7to your current location.", "", "&7Place a bound mirror into an", "&7Item Frame and then click on", "&7that Item Frame to teleport.", "&7Teleports cost &b1 Ender Pearl");

Category category = new Category(new NamespacedKey(this, "tree_taps"), new CustomItem(treeTap, "&6Slimy TreeTaps", "", "&a> Click to open"));
ItemGroup itemGroup = new ItemGroup(new NamespacedKey(this, "tree_taps"), new CustomItemStack(treeTap, "&6Slimy TreeTaps", "", "&a> Click to open"));
RecipeType rubberFactoryType = new RecipeType(new NamespacedKey(this, "rubber_factory"), rubberFactory);

new TreeTool(category, treeTap, cfg.getInt("resin-chance.standard"), stickyResin,
new TreeTool(itemGroup, treeTap, cfg.getInt("resin-chance.standard"), stickyResin,
new ItemStack[] {
null, SlimefunItems.DAMASCUS_STEEL_INGOT, new ItemStack(Material.OAK_LOG),
SlimefunItems.DAMASCUS_STEEL_INGOT, new ItemStack(Material.OAK_LOG), null,
new ItemStack(Material.OAK_LOG), null, new ItemStack(Material.BOWL)
}).register(this);

new TreeTool(category, reinforcedTreeTap, cfg.getInt("resin-chance.reinforced"), stickyResin,
new TreeTool(itemGroup, reinforcedTreeTap, cfg.getInt("resin-chance.reinforced"), stickyResin,
new ItemStack[] {
null, SlimefunItems.HARDENED_METAL_INGOT, new ItemStack(Material.OAK_LOG),
SlimefunItems.HARDENED_METAL_INGOT, treeTap, null,
new ItemStack(Material.OAK_LOG), null, SlimefunItems.COBALT_INGOT
}).register(this);

new TreeTool(category, diamondTreeTap, cfg.getInt("resin-chance.diamond"), stickyResin,
new TreeTool(itemGroup, diamondTreeTap, cfg.getInt("resin-chance.diamond"), stickyResin,
new ItemStack[] {
null, new ItemStack(Material.DIAMOND), new ItemStack(Material.OAK_LOG),
new ItemStack(Material.DIAMOND), reinforcedTreeTap, null,
new ItemStack(Material.OAK_LOG), null, SlimefunItems.CARBONADO
}).register(this);

new TreeTool(category, treeScraper, cfg.getInt("amber-chance"), amber,
new TreeTool(itemGroup, treeScraper, cfg.getInt("amber-chance"), amber,
new ItemStack[] {
null, new ItemStack(Material.GOLD_INGOT), null,
new ItemStack(Material.GOLD_INGOT), treeTap, null,
null, null, SlimefunItems.BRONZE_INGOT
}).register(this);

new SlimefunItem(category, stickyResin, new RecipeType(new NamespacedKey(this, "tree_tap"), treeTap),
new SlimefunItem(itemGroup, stickyResin, new RecipeType(new NamespacedKey(this, "tree_tap"), treeTap),
new ItemStack[] {
null, null, null,
null, new ItemStack(Material.OAK_LOG), null,
null, null, null
}).register(this);

new RubberFactory(category, rubberFactory, RecipeType.ENHANCED_CRAFTING_TABLE,
new RubberFactory(itemGroup, rubberFactory, RecipeType.ENHANCED_CRAFTING_TABLE,
new ItemStack[] {
null, SlimefunItems.HEATING_COIL, null,
SlimefunItems.SOLDER_INGOT, SlimefunItems.ELECTRIC_FURNACE_2, SlimefunItems.SOLDER_INGOT,
Expand All @@ -106,8 +106,8 @@ null, new ItemStack(Material.OAK_LOG), null,

@Override
public void registerDefaultRecipes() {
registerRecipe(4, new ItemStack[] {new CustomItem(stickyResin, 2)}, new ItemStack[] {rubber});
registerRecipe(6, new ItemStack[] {new CustomItem(rubber, 2)}, new ItemStack[] {rawPlastic});
registerRecipe(4, new ItemStack[] {new CustomItemStack(stickyResin, 2)}, new ItemStack[] {rubber});
registerRecipe(6, new ItemStack[] {new CustomItemStack(rubber, 2)}, new ItemStack[] {rawPlastic});
registerRecipe(10, new ItemStack[] {rawPlastic}, new ItemStack[] {SlimefunItems.PLASTIC_SHEET});
}

Expand All @@ -123,7 +123,7 @@ public int getSpeed() {

}.register(this);

new ResinExtractor(category, resinExtractor, RecipeType.ENHANCED_CRAFTING_TABLE,
new ResinExtractor(itemGroup, resinExtractor, RecipeType.ENHANCED_CRAFTING_TABLE,
new ItemStack[] {
null, diamondTreeTap, null,
SlimefunItems.GOLD_24K, SlimefunItems.CARBONADO, SlimefunItems.GOLD_24K,
Expand Down Expand Up @@ -156,7 +156,7 @@ public int getCapacity() {

}.register(this);

new ResinExtractor(category, resinExtractor2, RecipeType.ENHANCED_CRAFTING_TABLE,
new ResinExtractor(itemGroup, resinExtractor2, RecipeType.ENHANCED_CRAFTING_TABLE,
new ItemStack[] {
SlimefunItems.REINFORCED_ALLOY_INGOT, diamondTreeTap, SlimefunItems.REINFORCED_ALLOY_INGOT,
SlimefunItems.GOLD_24K, SlimefunItems.CARBONADO, SlimefunItems.GOLD_24K,
Expand Down Expand Up @@ -189,42 +189,42 @@ public int getCapacity() {

}.register(this);

new SlimefunItem(category, rawPlastic, rubberFactoryType,
new SlimefunItem(itemGroup, rawPlastic, rubberFactoryType,
new ItemStack[] {
null, null, null,
null, new SlimefunItemStack(rubber, 2), null,
null, null, null
}).register(this);

new SlimefunItem(category, rubber, rubberFactoryType,
new SlimefunItem(itemGroup, rubber, rubberFactoryType,
new ItemStack[] {
null, null, null,
null, stickyResin, null,
null, null, null
}).register(this);

new SlimefunItem(category, amber, RecipeType.SMELTERY,
new SlimefunItem(itemGroup, amber, RecipeType.SMELTERY,
new ItemStack[] {
new SlimefunItemStack(stickyResin, 4), null, null,
null, null, null,
null, null, null
}).register(this);

new SlimefunItem(category, amberBlock, RecipeType.ENHANCED_CRAFTING_TABLE,
new SlimefunItem(itemGroup, amberBlock, RecipeType.ENHANCED_CRAFTING_TABLE,
new ItemStack[] {
amber, amber, amber,
amber, amber, amber,
amber, amber, amber
}).register(this);

new UnplaceableBlock(category, blueEnderPearl, RecipeType.ENHANCED_CRAFTING_TABLE,
new UnplaceableBlock(itemGroup, blueEnderPearl, RecipeType.ENHANCED_CRAFTING_TABLE,
new ItemStack[] {
new ItemStack(Material.LAPIS_BLOCK), amberBlock, new ItemStack(Material.LAPIS_BLOCK),
amberBlock, new ItemStack(Material.ENDER_PEARL), amberBlock,
new ItemStack(Material.LAPIS_BLOCK), amberBlock, new ItemStack(Material.LAPIS_BLOCK)
}).register(this);

MagicalMirror mirror = new MagicalMirror(this, category, magicalMirror, RecipeType.ENHANCED_CRAFTING_TABLE,
MagicalMirror mirror = new MagicalMirror(this, itemGroup, magicalMirror, RecipeType.ENHANCED_CRAFTING_TABLE,
new ItemStack[] {
new ItemStack(Material.GLASS), amber, new ItemStack(Material.GLASS),
amber, blueEnderPearl, amber,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;

import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
import io.github.thebusybiscuit.slimefun4.core.attributes.DamageableItem;
import io.github.thebusybiscuit.slimefun4.core.attributes.NotPlaceable;
import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler;
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem;
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
import me.mrCookieSlime.Slimefun.Objects.Category;
import io.github.thebusybiscuit.slimefun4.libraries.dough.protection.Interaction;
import me.mrCookieSlime.Slimefun.api.BlockStorage;
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
import me.mrCookieSlime.Slimefun.cscorelib2.protection.ProtectableAction;

public class TreeTool extends SimpleSlimefunItem<ItemUseHandler> implements NotPlaceable, DamageableItem {

private final int chance;
private final SlimefunItemStack output;

public TreeTool(Category category, SlimefunItemStack item, int chance, SlimefunItemStack output, ItemStack[] recipe) {
super(category, item, RecipeType.ENHANCED_CRAFTING_TABLE, recipe);
public TreeTool(ItemGroup itemGroup, SlimefunItemStack item, int chance, SlimefunItemStack output, ItemStack[] recipe) {
super(itemGroup, item, RecipeType.ENHANCED_CRAFTING_TABLE, recipe);

this.chance = chance;
this.output = output;
Expand All @@ -40,7 +40,7 @@ public ItemUseHandler getItemHandler() {
Player p = e.getPlayer();
Block b = e.getClickedBlock().get();

if (isLog(b) && SlimefunPlugin.getProtectionManager().hasPermission(p, b, ProtectableAction.BREAK_BLOCK)) {
if (isLog(b) && Slimefun.getProtectionManager().hasPermission(p, b, Interaction.BREAK_BLOCK)) {
p.getWorld().playEffect(b.getLocation(), Effect.STEP_SOUND, b.getType());

if (ThreadLocalRandom.current().nextInt(100) < chance) {
Expand Down

0 comments on commit 963f038

Please # to comment.