mirror of
https://github.com/Xiao-MoMi/Custom-Fishing.git
synced 2026-01-03 06:12:19 +00:00
checkpoint - 6
This commit is contained in:
@@ -17,9 +17,6 @@
|
||||
|
||||
package net.momirealms.customfishing.common.helper;
|
||||
|
||||
import net.momirealms.customfishing.bukkit.BukkitCustomFishingPluginImpl;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
@@ -67,6 +67,16 @@ public class AbstractItem<R, I> implements Item<I> {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTag(Object... path) {
|
||||
return factory.hasTag(item, path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeTag(Object... path) {
|
||||
return factory.removeTag(item, path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public I getItem() {
|
||||
return factory.getItem(item);
|
||||
|
||||
@@ -23,6 +23,10 @@ public interface Item<I> {
|
||||
|
||||
Item<I> setTag(Object value, Object... path);
|
||||
|
||||
boolean hasTag(Object... path);
|
||||
|
||||
boolean removeTag(Object... path);
|
||||
|
||||
I getItem();
|
||||
|
||||
I load();
|
||||
|
||||
@@ -23,6 +23,10 @@ public abstract class ItemFactory<P extends CustomFishingPlugin, R, I> {
|
||||
|
||||
protected abstract void setTag(R item, Object value, Object... path);
|
||||
|
||||
protected abstract boolean hasTag(R item, Object... path);
|
||||
|
||||
protected abstract boolean removeTag(R item, Object... path);
|
||||
|
||||
protected abstract void update(R item);
|
||||
|
||||
protected abstract I load(R item);
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package net.momirealms.customfishing.common.plugin.feature;
|
||||
|
||||
public interface Reloadable {
|
||||
|
||||
default void reload() {
|
||||
unload();
|
||||
load();
|
||||
}
|
||||
|
||||
default void unload() {
|
||||
}
|
||||
|
||||
default void load() {
|
||||
}
|
||||
|
||||
default void disable() {
|
||||
unload();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user