mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
More cleanup and Refactoring
This commit is contained in:
parent
17cf48a773
commit
2cf5989d7a
@ -1,5 +1,17 @@
|
||||
package io.github.thebusybiscuit.slimefun4.core.attributes;
|
||||
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
|
||||
|
||||
/**
|
||||
* This Interface, when attached to a class that inherits from {@link SlimefunItem}, marks
|
||||
* the Item as radioactive.
|
||||
* Carrying such an item will give the wearer the radiation effect.
|
||||
*
|
||||
* You can specify a level of {@link Radioactivity} for the severity of the effect.
|
||||
*
|
||||
* @author TheBusyBiscuit
|
||||
*
|
||||
*/
|
||||
public interface Radioactive {
|
||||
|
||||
Radioactivity getRadioactivity();
|
||||
|
@ -0,0 +1,15 @@
|
||||
package io.github.thebusybiscuit.slimefun4.core.attributes;
|
||||
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
|
||||
|
||||
/**
|
||||
* This Interface, when attached to a class that inherits from {@link SlimefunItem}, marks
|
||||
* the Item as soulbound.
|
||||
* This Item will then not be dropped upon death.
|
||||
*
|
||||
* @author TheBusyBiscuit
|
||||
*
|
||||
*/
|
||||
public interface Soulbound {
|
||||
|
||||
}
|
@ -6,7 +6,6 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import me.mrCookieSlime.Slimefun.SlimefunPlugin;
|
||||
import me.mrCookieSlime.Slimefun.Lists.SlimefunItems;
|
||||
import me.mrCookieSlime.Slimefun.Objects.Research;
|
||||
import me.mrCookieSlime.Slimefun.api.Slimefun;
|
||||
|
||||
public final class ResearchSetup {
|
||||
@ -100,10 +99,10 @@ public final class ResearchSetup {
|
||||
register("table_saw", 92, "Table Saw", 4, SlimefunItems.TABLE_SAW);
|
||||
register("slime_steel_armor", 93, "Slimy Steel Armor", 27, SlimefunItems.SLIME_HELMET_STEEL, SlimefunItems.SLIME_CHESTPLATE_STEEL, SlimefunItems.SLIME_LEGGINGS_STEEL, SlimefunItems.SLIME_BOOTS_STEEL);
|
||||
register("blade_of_vampires", 94, "Blade of Vampires", 26, SlimefunItems.BLADE_OF_VAMPIRES);
|
||||
Slimefun.registerResearch(new Research(95, "Lazy Mining", 40), SlimefunItems.DIGITAL_MINER);
|
||||
Slimefun.registerResearch(new NamespacedKey(SlimefunPlugin.instance, "digital_miner"), 95, "Lazy Mining", 40, SlimefunItems.DIGITAL_MINER);
|
||||
register("water_staff", 96, "Water Staff", 8, SlimefunItems.STAFF_WATER);
|
||||
register("24k_gold_block", 97, "Golden City", 19, SlimefunItems.GOLD_24K_BLOCK);
|
||||
Slimefun.registerResearch(new Research(98, "Advanced Mining 101", 42), SlimefunItems.ADVANCED_DIGITAL_MINER);
|
||||
Slimefun.registerResearch(new NamespacedKey(SlimefunPlugin.instance, "advanced_digital_miner"), 98, "Advanced Mining 101", 42, SlimefunItems.ADVANCED_DIGITAL_MINER);
|
||||
register("composter", 99, "Composting Dirt", 3, SlimefunItems.COMPOSTER);
|
||||
register("farmer_shoes", 100, "Farmer Shoes", 4, SlimefunItems.FARMER_SHOES);
|
||||
register("explosive_tools", 101, "Explosive Tools", 30, SlimefunItems.EXPLOSIVE_PICKAXE, SlimefunItems.EXPLOSIVE_SHOVEL);
|
||||
|
@ -59,7 +59,6 @@ import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunArmorPiece;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunBackpack;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunMachine;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SoulboundBackpack;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SoulboundItem;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.Talisman;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.VanillaItem;
|
||||
@ -102,6 +101,7 @@ import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.items.Rag;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.items.SeismicAxe;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.items.SmeltersPickaxe;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.items.SolarHelmet;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.items.SoulboundBackpack;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.items.SoulboundRune;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.items.Splint;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.items.StormStaff;
|
||||
@ -1418,7 +1418,7 @@ public final class SlimefunItemSetup {
|
||||
new CustomItem(SlimefunItems.FLASK_OF_KNOWLEDGE, 8))
|
||||
.register(true);
|
||||
|
||||
new HandledBlock(Categories.BIRTHDAY, new CustomItem(new ItemStack(Material.CAKE), "&bBirthday Cake"), "BIRTHDAY_CAKE", RecipeType.ENHANCED_CRAFTING_TABLE,
|
||||
new HandledBlock(Categories.BIRTHDAY, new SlimefunItemStack("BIRTHDAY_CAKE", Material.CAKE, "&bBirthday Cake"), RecipeType.ENHANCED_CRAFTING_TABLE,
|
||||
new ItemStack[] {null, new ItemStack(Material.TORCH), null, new ItemStack(Material.SUGAR), new ItemStack(Material.CAKE), new ItemStack(Material.SUGAR), null, null, null})
|
||||
.register(true);
|
||||
|
||||
|
@ -18,7 +18,6 @@ import me.mrCookieSlime.Slimefun.api.Slimefun;
|
||||
* See {@link Category} for the complete documentation.
|
||||
*
|
||||
* @author TheBusyBiscuit
|
||||
* @since 4.0
|
||||
*
|
||||
* @see Category
|
||||
* @see SeasonalCategory
|
||||
@ -35,17 +34,11 @@ public class LockedCategory extends Category {
|
||||
* <p>
|
||||
* Like {@link Category#Category(ItemStack)}, the tier is automatically set to 3.
|
||||
*
|
||||
* @param item The display item for this category
|
||||
* @param parents The parent categories for this category
|
||||
* @param key A unique identifier for this category
|
||||
* @param item The display item for this category
|
||||
* @param parents The parent categories for this category
|
||||
*
|
||||
* @since 4.0
|
||||
* @see #LockedCategory(ItemStack, int, Category...)
|
||||
*/
|
||||
@Deprecated
|
||||
public LockedCategory(ItemStack item, Category... parents) {
|
||||
this(item, 3, parents);
|
||||
}
|
||||
|
||||
public LockedCategory(NamespacedKey key, ItemStack item, Category... parents) {
|
||||
this(key, item, 3, parents);
|
||||
}
|
||||
@ -56,19 +49,12 @@ public class LockedCategory extends Category {
|
||||
* See {@link Category#Category(ItemStack, int)} for more information about creating
|
||||
* a category.
|
||||
*
|
||||
* @param item The display item for this category
|
||||
* @param tier The tier of this category
|
||||
* @param parents The parent categories for this category
|
||||
* @param key A unique identifier for this category
|
||||
* @param item The display item for this category
|
||||
* @param tier The tier of this category
|
||||
* @param parents The parent categories for this category
|
||||
*
|
||||
* @since 4.0
|
||||
* @see #LockedCategory(ItemStack, Category...)
|
||||
*/
|
||||
@Deprecated
|
||||
public LockedCategory(ItemStack item, int tier, Category... parents) {
|
||||
super(item, tier);
|
||||
this.parents = Arrays.asList(parents);
|
||||
}
|
||||
|
||||
public LockedCategory(NamespacedKey key, ItemStack item, int tier, Category... parents) {
|
||||
super(key, item, tier);
|
||||
this.parents = Arrays.asList(parents);
|
||||
|
@ -18,7 +18,6 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import io.github.thebusybiscuit.cscorelib2.data.PersistentDataAPI;
|
||||
import io.github.thebusybiscuit.slimefun4.api.events.ResearchUnlockEvent;
|
||||
import io.github.thebusybiscuit.slimefun4.core.SlimefunRegistry;
|
||||
import io.github.thebusybiscuit.slimefun4.core.guide.GuideSettings;
|
||||
import io.github.thebusybiscuit.slimefun4.implementation.setup.ResearchSetup;
|
||||
import io.github.thebusybiscuit.slimefun4.utils.FireworkUtils;
|
||||
@ -30,13 +29,10 @@ import me.mrCookieSlime.Slimefun.api.Slimefun;
|
||||
/**
|
||||
* Statically handles researches. Represents a research, which is bound to one
|
||||
* {@link SlimefunItem} or more and require XP levels to unlock this/these item(s).
|
||||
* <p>
|
||||
* See {@link #Research(int, String, int)} to create a research.
|
||||
* <p>
|
||||
*
|
||||
* See {@link ResearchSetup} for the built-in researches.
|
||||
*
|
||||
* @author TheBusyBiscuit
|
||||
* @since 4.0
|
||||
*/
|
||||
public class Research implements Keyed {
|
||||
|
||||
@ -52,33 +48,21 @@ public class Research implements Keyed {
|
||||
|
||||
/**
|
||||
* The constructor for a Research.
|
||||
* <p>
|
||||
*
|
||||
* Create a new research by calling {@link #Research(int, String, int)}, then
|
||||
* bind this research to the Slimefun items you want by calling
|
||||
* {@link #addItems(SlimefunItem...)}. Once you're finished, call {@link #register()}
|
||||
* to register it.
|
||||
* <p>
|
||||
*
|
||||
* To speed up, directly setup the research by calling
|
||||
* {@link Slimefun#registerResearch(Research, org.bukkit.inventory.ItemStack...)}.
|
||||
*
|
||||
* @deprecated Use the constuctor with {@link NamespacedKey} instead
|
||||
*
|
||||
* @param id Unique integer ID for this research, used for {@link #getByID(int)} and to
|
||||
* register it in Researches.yml
|
||||
* @param key A unique identifier for this research
|
||||
* @param id old way of identifying researches
|
||||
* @param name Display name of the research
|
||||
* @param cost Cost in XP levels to unlock the research
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
@Deprecated
|
||||
public Research(int id, String name, int cost) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.cost = cost;
|
||||
|
||||
this.key = new NamespacedKey(SlimefunPlugin.instance, name.replace(' ', '_'));
|
||||
}
|
||||
|
||||
public Research(NamespacedKey key, int id, String name, int defaultCost) {
|
||||
this.key = key;
|
||||
this.id = id;
|
||||
@ -105,20 +89,6 @@ public class Research implements Keyed {
|
||||
public int getID() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the display name of the research.
|
||||
*
|
||||
* @deprecated Use {@link Research#getName(Player)} instead. It is localized.
|
||||
*
|
||||
* @return The display name of the research
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
@Deprecated
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getName(Player p) {
|
||||
String localized = SlimefunPlugin.getLocal().getResearchName(p, key);
|
||||
@ -211,19 +181,6 @@ public class Research implements Keyed {
|
||||
return (p.getGameMode() == GameMode.CREATIVE && SlimefunPlugin.getSettings().researchesFreeInCreative) || p.getLevel() >= this.cost;
|
||||
}
|
||||
|
||||
/**
|
||||
* Locks the research for the specified player.
|
||||
*
|
||||
* @param p Player to lock the research
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
@Deprecated
|
||||
public void lock(Player p) {
|
||||
PlayerProfile.get(p).setResearched(this, false);
|
||||
SlimefunPlugin.getLocal().sendMessage(p, "commands.research.reset-target", true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unlocks the research for the specified player.
|
||||
*
|
||||
@ -314,21 +271,6 @@ public class Research implements Keyed {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list of all registered researches.
|
||||
*
|
||||
* @return The list of registered researches
|
||||
*
|
||||
* @deprecated Use {@link SlimefunRegistry#getResearches()}
|
||||
*
|
||||
* @since 4.0
|
||||
* @see ResearchSetup
|
||||
*/
|
||||
@Deprecated
|
||||
public static List<Research> list() {
|
||||
return SlimefunPlugin.getRegistry().getResearches();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets if the specified player is currently unlocking a research.
|
||||
*
|
||||
@ -341,20 +283,6 @@ public class Research implements Keyed {
|
||||
return SlimefunPlugin.getRegistry().getCurrentlyResearchingPlayers().contains(p.getUniqueId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the research statistics and title of the specified player to the command sender.
|
||||
*
|
||||
* @param sender CommandSender to send the statistics
|
||||
* @param p Player to get the statistics
|
||||
*
|
||||
* @since 4.0
|
||||
* @see #getTitle(Player, List)
|
||||
*/
|
||||
@Deprecated
|
||||
public static void sendStats(CommandSender sender, Player p) {
|
||||
PlayerProfile.get(p).sendStats(sender);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the title of the specified player.
|
||||
*
|
||||
@ -379,7 +307,7 @@ public class Research implements Keyed {
|
||||
* @since 4.0
|
||||
*/
|
||||
public static Research getByID(int id) {
|
||||
for (Research research : list()) {
|
||||
for (Research research : SlimefunPlugin.getRegistry().getResearches()) {
|
||||
if (research.getID() == id) return research;
|
||||
}
|
||||
return null;
|
||||
@ -397,7 +325,7 @@ public class Research implements Keyed {
|
||||
@Deprecated
|
||||
public static List<Research> getResearches(UUID uuid) {
|
||||
List<Research> researched = new ArrayList<>();
|
||||
for (Research research : list()) {
|
||||
for (Research research : SlimefunPlugin.getRegistry().getResearches()) {
|
||||
if (research.hasUnlocked(uuid)) researched.add(research);
|
||||
}
|
||||
return researched;
|
||||
|
@ -1,12 +1,12 @@
|
||||
package me.mrCookieSlime.Slimefun.Objects.SlimefunItem;
|
||||
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import me.mrCookieSlime.Slimefun.Lists.Categories;
|
||||
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
|
||||
import me.mrCookieSlime.Slimefun.Objects.Category;
|
||||
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
|
||||
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
/**
|
||||
* Represents an alloy, a {@link SlimefunItem} obtainable using the {@code SMELTERY}.
|
||||
* <p>
|
||||
@ -17,18 +17,6 @@ import org.bukkit.inventory.ItemStack;
|
||||
*/
|
||||
public class Alloy extends SlimefunItem {
|
||||
|
||||
/**
|
||||
* Constructs an Alloy bound to {@code Categories.RESOURCES}.
|
||||
*
|
||||
* @param item the item corresponding to this Alloy
|
||||
* @param id the id of this Alloy
|
||||
* @param recipe the recipe to obtain this Alloy in the Smeltery
|
||||
*/
|
||||
@Deprecated
|
||||
public Alloy(ItemStack item, String id, ItemStack[] recipe) {
|
||||
super(Categories.RESOURCES, item, id, RecipeType.SMELTERY, recipe);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs an Alloy bound to {@code Categories.RESOURCES}.
|
||||
*
|
||||
@ -50,17 +38,4 @@ public class Alloy extends SlimefunItem {
|
||||
super(category, item, RecipeType.SMELTERY, recipe);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs an Alloy with a definable {@link Category}.
|
||||
*
|
||||
* @param category the category to bind this Alloy to
|
||||
* @param item the item corresponding to this Alloy
|
||||
* @param id the id of this Alloy
|
||||
* @param recipe the recipe to obtain this Alloy in the Smeltery
|
||||
*/
|
||||
@Deprecated
|
||||
public Alloy(Category category, ItemStack item, String id, ItemStack[] recipe) {
|
||||
super(category, item, id, RecipeType.SMELTERY, recipe);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,21 +7,13 @@ import me.mrCookieSlime.Slimefun.Objects.Category;
|
||||
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
|
||||
|
||||
public class ChargableItem extends SlimefunItem {
|
||||
|
||||
private String chargeType;
|
||||
|
||||
public ChargableItem(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, String chargeType) {
|
||||
public ChargableItem(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
|
||||
super(category, item, recipeType, recipe);
|
||||
this.chargeType = chargeType;
|
||||
}
|
||||
|
||||
public ChargableItem(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, String chargeType, String[] keys, Object[] values) {
|
||||
public ChargableItem(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, String[] keys, Object[] values) {
|
||||
super(category, item, recipeType, recipe, keys, values);
|
||||
this.chargeType = chargeType;
|
||||
}
|
||||
|
||||
public String getChargeType() {
|
||||
return chargeType;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,39 +0,0 @@
|
||||
package me.mrCookieSlime.Slimefun.Objects.SlimefunItem;
|
||||
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
|
||||
import me.mrCookieSlime.Slimefun.Objects.Category;
|
||||
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
|
||||
|
||||
public class DamagableChargableItem extends SlimefunItem {
|
||||
|
||||
private final String chargeType;
|
||||
|
||||
@Deprecated
|
||||
public DamagableChargableItem(Category category, ItemStack item, String id, RecipeType recipeType, ItemStack[] recipe, String chargeType) {
|
||||
super(category, item, id, recipeType, recipe);
|
||||
this.chargeType = chargeType;
|
||||
}
|
||||
|
||||
public DamagableChargableItem(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, String chargeType) {
|
||||
super(category, item, recipeType, recipe);
|
||||
this.chargeType = chargeType;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public DamagableChargableItem(Category category, ItemStack item, String id, RecipeType recipeType, ItemStack[] recipe, String chargeType, String[] keys, Object[] values) {
|
||||
super(category, item, id, recipeType, recipe, keys, values);
|
||||
this.chargeType = chargeType;
|
||||
}
|
||||
|
||||
public DamagableChargableItem(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, String chargeType, String[] keys, Object[] values) {
|
||||
super(category, item, recipeType, recipe, keys, values);
|
||||
this.chargeType = chargeType;
|
||||
}
|
||||
|
||||
public String getChargeType() {
|
||||
return this.chargeType;
|
||||
}
|
||||
|
||||
}
|
@ -8,11 +8,6 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
|
||||
|
||||
public class HandledBlock extends SlimefunItem {
|
||||
|
||||
@Deprecated
|
||||
public HandledBlock(Category category, ItemStack item, String id, RecipeType recipeType, ItemStack[] recipe) {
|
||||
super(category, item, id, recipeType, recipe);
|
||||
}
|
||||
|
||||
public HandledBlock(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
|
||||
super(category, item, recipeType, recipe);
|
||||
}
|
||||
|
@ -6,12 +6,12 @@ import me.mrCookieSlime.Slimefun.Lists.Categories;
|
||||
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
|
||||
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
|
||||
|
||||
public class JetBoots extends DamagableChargableItem {
|
||||
public class JetBoots extends ChargableItem {
|
||||
|
||||
private final double speed;
|
||||
|
||||
public JetBoots(SlimefunItemStack item, ItemStack[] recipe, double speed) {
|
||||
super(Categories.TECH, item, RecipeType.ENHANCED_CRAFTING_TABLE, recipe, "Jet Boots");
|
||||
super(Categories.TECH, item, RecipeType.ENHANCED_CRAFTING_TABLE, recipe);
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
|
@ -6,12 +6,12 @@ import me.mrCookieSlime.Slimefun.Lists.Categories;
|
||||
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
|
||||
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
|
||||
|
||||
public class Jetpack extends DamagableChargableItem {
|
||||
public class Jetpack extends ChargableItem {
|
||||
|
||||
private final double thrust;
|
||||
|
||||
public Jetpack(SlimefunItemStack item, ItemStack[] recipe, double thrust) {
|
||||
super(Categories.TECH, item, RecipeType.ENHANCED_CRAFTING_TABLE, recipe, "Jetpack");
|
||||
super(Categories.TECH, item, RecipeType.ENHANCED_CRAFTING_TABLE, recipe);
|
||||
this.thrust = thrust;
|
||||
}
|
||||
|
||||
|
@ -6,13 +6,15 @@ import me.mrCookieSlime.Slimefun.Lists.RecipeType;
|
||||
import me.mrCookieSlime.Slimefun.Objects.Category;
|
||||
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
|
||||
|
||||
/**
|
||||
* This class represents a {@link SlimefunItem} that can be stored inside
|
||||
* of a Cooler.
|
||||
*
|
||||
* @author TheBusyBiscuit
|
||||
*
|
||||
*/
|
||||
public class Juice extends SlimefunItem {
|
||||
|
||||
@Deprecated
|
||||
public Juice(Category category, ItemStack item, String id, RecipeType recipeType, ItemStack[] recipe) {
|
||||
super(category, item, id, recipeType, recipe);
|
||||
}
|
||||
|
||||
public Juice(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
|
||||
super(category, item, recipeType, recipe);
|
||||
}
|
||||
|
@ -8,29 +8,14 @@ import me.mrCookieSlime.Slimefun.Objects.handlers.ItemHandler;
|
||||
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
|
||||
|
||||
public abstract class SimpleSlimefunItem<T extends ItemHandler> extends SlimefunItem {
|
||||
|
||||
@Deprecated
|
||||
public SimpleSlimefunItem(Category category, ItemStack item, String id, RecipeType recipeType, ItemStack[] recipe) {
|
||||
super(category, item, id, recipeType, recipe);
|
||||
}
|
||||
|
||||
public SimpleSlimefunItem(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
|
||||
super(category, item, recipeType, recipe);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public SimpleSlimefunItem(Category category, ItemStack item, String id, RecipeType recipeType, ItemStack[] recipe, ItemStack recipeOutput) {
|
||||
super(category, item, id, recipeType, recipe, recipeOutput);
|
||||
}
|
||||
|
||||
public SimpleSlimefunItem(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, ItemStack recipeOutput) {
|
||||
super(category, item, recipeType, recipe, recipeOutput);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public SimpleSlimefunItem(Category category, ItemStack item, String id, RecipeType recipeType, ItemStack[] recipe, String[] keys, Object[] values) {
|
||||
super(category, item, id, recipeType, recipe, keys, values);
|
||||
}
|
||||
|
||||
public SimpleSlimefunItem(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, String[] keys, Object[] values) {
|
||||
super(category, item, recipeType, recipe, keys, values);
|
||||
|
@ -352,7 +352,6 @@ public class SlimefunItem implements Placeable {
|
||||
}
|
||||
|
||||
if (this instanceof ChargableItem && SlimefunManager.isItemSimilar(item, this.item, false)) return true;
|
||||
else if (this instanceof DamagableChargableItem && SlimefunManager.isItemSimilar(item, this.item, false)) return true;
|
||||
else if (this instanceof SlimefunBackpack && SlimefunManager.isItemSimilar(item, this.item, false)) return true;
|
||||
else return SlimefunManager.isItemSimilar(item, this.item, true);
|
||||
}
|
||||
@ -546,8 +545,11 @@ public class SlimefunItem implements Placeable {
|
||||
* Only use this method if you absolutely know what you are doing and can make sure that the
|
||||
* Item handler is handled somewhere else.
|
||||
*
|
||||
* @deprecated This method was just a temporary way to add backwards compatibility, it will soon not be needed anymore
|
||||
*
|
||||
* @return Whether this Item handler is handled directly by the Item itself
|
||||
*/
|
||||
@Deprecated
|
||||
protected boolean areItemHandlersPrivate() {
|
||||
return false;
|
||||
}
|
||||
|
@ -21,6 +21,14 @@ public class SlimefunMachine extends SlimefunItem implements RecipeDisplayItem {
|
||||
protected final List<ItemStack> shownRecipes;
|
||||
protected final MultiBlock multiblock;
|
||||
|
||||
public SlimefunMachine(Category category, SlimefunItemStack item, ItemStack[] recipe, ItemStack[] machineRecipes, BlockFace trigger) {
|
||||
super(category, item, RecipeType.MULTIBLOCK, recipe);
|
||||
this.recipes = new ArrayList<>();
|
||||
this.shownRecipes = new ArrayList<>();
|
||||
this.shownRecipes.addAll(Arrays.asList(machineRecipes));
|
||||
this.multiblock = new MultiBlock(this, convertItemStacksToMaterial(recipe), trigger);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public SlimefunMachine(Category category, ItemStack item, String id, ItemStack[] recipe, ItemStack[] machineRecipes, BlockFace trigger) {
|
||||
super(category, item, id, RecipeType.MULTIBLOCK, recipe);
|
||||
@ -30,14 +38,6 @@ public class SlimefunMachine extends SlimefunItem implements RecipeDisplayItem {
|
||||
this.multiblock = new MultiBlock(this, convertItemStacksToMaterial(recipe), trigger);
|
||||
}
|
||||
|
||||
public SlimefunMachine(Category category, SlimefunItemStack item, ItemStack[] recipe, ItemStack[] machineRecipes, BlockFace trigger) {
|
||||
super(category, item, RecipeType.MULTIBLOCK, recipe);
|
||||
this.recipes = new ArrayList<>();
|
||||
this.shownRecipes = new ArrayList<>();
|
||||
this.shownRecipes.addAll(Arrays.asList(machineRecipes));
|
||||
this.multiblock = new MultiBlock(this, convertItemStacksToMaterial(recipe), trigger);
|
||||
}
|
||||
|
||||
public SlimefunMachine(Category category, SlimefunItemStack item, ItemStack[] recipe, ItemStack[] machineRecipes, BlockFace trigger, String[] keys, Object[] values) {
|
||||
super(category, item, RecipeType.MULTIBLOCK, recipe, keys, values);
|
||||
this.recipes = new ArrayList<>();
|
||||
@ -46,15 +46,6 @@ public class SlimefunMachine extends SlimefunItem implements RecipeDisplayItem {
|
||||
this.multiblock = new MultiBlock(this, convertItemStacksToMaterial(recipe), trigger);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public SlimefunMachine(Category category, ItemStack item, String id, ItemStack[] recipe, ItemStack[] machineRecipes, BlockFace trigger, String[] keys, Object[] values) {
|
||||
super(category, item, id, RecipeType.MULTIBLOCK, recipe, keys, values);
|
||||
this.recipes = new ArrayList<>();
|
||||
this.shownRecipes = new ArrayList<>();
|
||||
this.shownRecipes.addAll(Arrays.asList(machineRecipes));
|
||||
this.multiblock = new MultiBlock(this, convertItemStacksToMaterial(recipe), trigger);
|
||||
}
|
||||
|
||||
public List<ItemStack[]> getRecipes() {
|
||||
return recipes;
|
||||
}
|
||||
|
@ -2,10 +2,10 @@ package me.mrCookieSlime.Slimefun.Objects.SlimefunItem;
|
||||
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import io.github.thebusybiscuit.slimefun4.core.attributes.Soulbound;
|
||||
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
|
||||
import me.mrCookieSlime.Slimefun.Objects.Category;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.interfaces.NotPlaceable;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.interfaces.Soulbound;
|
||||
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
|
||||
|
||||
/**
|
||||
|
@ -2,6 +2,7 @@ package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.interfaces;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
@FunctionalInterface
|
||||
@ -9,8 +10,12 @@ public interface RecipeDisplayItem {
|
||||
|
||||
List<ItemStack> getDisplayRecipes();
|
||||
|
||||
@Deprecated
|
||||
default String getRecipeSectionLabel() {
|
||||
return "&7\u21E9 Recipes made in this Machine \u21E9";
|
||||
}
|
||||
|
||||
|
||||
default String getRecipeSectionLabel(Player p) {
|
||||
return getRecipeSectionLabel();
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +0,0 @@
|
||||
package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.interfaces;
|
||||
|
||||
public interface Soulbound {
|
||||
|
||||
}
|
@ -30,7 +30,7 @@ public class MultiTool extends ChargableItem {
|
||||
private List<Integer> modes;
|
||||
|
||||
public MultiTool(SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, String... items) {
|
||||
super(Categories.TECH, item, recipeType, recipe, "Multi Tool", getKeys(items), getValues(items));
|
||||
super(Categories.TECH, item, recipeType, recipe, getKeys(items), getValues(items));
|
||||
}
|
||||
|
||||
private static String[] getKeys(String... items) {
|
||||
|
@ -1,10 +1,11 @@
|
||||
package me.mrCookieSlime.Slimefun.Objects.SlimefunItem;
|
||||
package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.items;
|
||||
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import io.github.thebusybiscuit.slimefun4.core.attributes.Soulbound;
|
||||
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
|
||||
import me.mrCookieSlime.Slimefun.Objects.Category;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.interfaces.Soulbound;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunBackpack;
|
||||
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
|
||||
|
||||
public class SoulboundBackpack extends SlimefunBackpack implements Soulbound {
|
@ -28,19 +28,9 @@ public abstract class MultiBlockMachine extends SlimefunMachine {
|
||||
BlockFace.WEST
|
||||
};
|
||||
|
||||
@Deprecated
|
||||
public MultiBlockMachine(Category category, ItemStack item, String id, ItemStack[] recipe, ItemStack[] machineRecipes, BlockFace trigger) {
|
||||
super(category, item, id, recipe, machineRecipes, trigger);
|
||||
}
|
||||
|
||||
public MultiBlockMachine(Category category, SlimefunItemStack item, ItemStack[] recipe, ItemStack[] machineRecipes, BlockFace trigger) {
|
||||
super(category, item, recipe, machineRecipes, trigger);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public MultiBlockMachine(Category category, ItemStack item, String id, ItemStack[] recipe, ItemStack[] machineRecipes, BlockFace trigger, String[] keys, Object[] values) {
|
||||
super(category, item, id, recipe, machineRecipes, trigger, keys, values);
|
||||
}
|
||||
|
||||
public MultiBlockMachine(Category category, SlimefunItemStack item, ItemStack[] recipe, ItemStack[] machineRecipes, BlockFace trigger, String[] keys, Object[] values) {
|
||||
super(category, item, recipe, machineRecipes, trigger, keys, values);
|
||||
|
@ -12,6 +12,7 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
|
||||
import io.github.thebusybiscuit.cscorelib2.item.ImmutableItemMeta;
|
||||
import io.github.thebusybiscuit.slimefun4.core.attributes.Soulbound;
|
||||
import me.mrCookieSlime.EmeraldEnchants.EmeraldEnchants;
|
||||
import me.mrCookieSlime.EmeraldEnchants.ItemEnchantment;
|
||||
import me.mrCookieSlime.Slimefun.SlimefunPlugin;
|
||||
@ -22,7 +23,6 @@ import me.mrCookieSlime.Slimefun.Objects.Category;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunArmorPiece;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.VanillaItem;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.interfaces.Soulbound;
|
||||
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
|
||||
|
||||
public final class SlimefunManager {
|
||||
|
Loading…
Reference in New Issue
Block a user