Just made gem builder
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package io.github.thetrouper.sssbliss.data;
|
||||
|
||||
import io.github.itzispyder.pdk.utils.SchedulerUtils;
|
||||
import io.github.thetrouper.sssbliss.SSSBliss;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class GemBuilder {
|
||||
|
||||
private ItemStack itemStack;
|
||||
private PotionEffect potionEffect;
|
||||
private Consumer<Player> onRightClick;
|
||||
|
||||
public GemBuilder(ItemStack itemStack) {
|
||||
this.itemStack = itemStack;
|
||||
}
|
||||
|
||||
public GemBuilder effect(PotionEffectType effectType, int amplifier) {
|
||||
this.potionEffect = new PotionEffect(effectType,PotionEffect.INFINITE_DURATION, amplifier, true, true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GemBuilder onRightClick(Consumer<Player> onRightClick) {
|
||||
this.onRightClick = onRightClick;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package io.github.thetrouper.sssbliss.data.gems;
|
||||
|
||||
public class FireGem {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package io.github.thetrouper.sssbliss.events;
|
||||
|
||||
import io.github.itzispyder.pdk.events.CustomListener;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
||||
public class GemUseListener implements CustomListener {
|
||||
@EventHandler
|
||||
public void onGemUse(PlayerInteractEvent e) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package io.github.thetrouper.sssbliss.server.functions;
|
||||
|
||||
import io.github.itzispyder.pdk.Global;
|
||||
import io.github.itzispyder.pdk.plugin.builders.ItemBuilder;
|
||||
import io.github.itzispyder.pdk.utils.ServerUtils;
|
||||
import io.github.thetrouper.sssbliss.data.GemBuilder;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class GemPassiveEffects {
|
||||
|
||||
public static List<GemBuilder> gems = Arrays.asList(
|
||||
new GemBuilder(new ItemBuilder()
|
||||
.material(Material.EMERALD)
|
||||
.name(Global.instance.color("&c&lFire Gem"))
|
||||
.build()
|
||||
)
|
||||
.effect(PotionEffectType.FIRE_RESISTANCE,1)
|
||||
.onRightClick((p) ->{
|
||||
|
||||
}),
|
||||
new GemBuilder(new ItemBuilder()
|
||||
.material(Material.LAPIS_LAZULI)
|
||||
.name(Global.instance.color("&c&lWater Gem"))
|
||||
.build()
|
||||
)
|
||||
.effect(PotionEffectType.FIRE_RESISTANCE,1)
|
||||
.onRightClick((p) ->{
|
||||
|
||||
})
|
||||
);
|
||||
|
||||
public GemBuilder gem = new GemBuilder(new ItemBuilder()
|
||||
.material(Material.EMERALD)
|
||||
.name(Global.instance.color("&c&lFire Gem"))
|
||||
.build()
|
||||
).onRightClick((player)->{
|
||||
player.kick(Component.text("Yipeee!"));
|
||||
}).effect(PotionEffectType.FIRE_RESISTANCE,1);
|
||||
|
||||
public static void applyPassiveEffects() {
|
||||
ServerUtils.forEachPlayer((player)->{
|
||||
|
||||
});
|
||||
}
|
||||
public static void effectPlayer(Player p) {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user