Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Ore Siphon #34

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 8 additions & 13 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group = "com.iridium"
version = "4.1.5"
version = "4.1.7"
description = "IridiumEnchants"

repositories {
Expand All @@ -19,35 +19,30 @@ repositories {
maven("https://hub.jeff-media.com/nexus/repository/jeff-media-public/")
maven("https://maven.enginehub.org/repo/")
maven("https://repo.codemc.org/repository/maven-public/")
maven("https://repo.bg-software.com/repository/api/")
mavenCentral()
}

dependencies {
// Dependencies that we want to shade in
implementation("org.jetbrains:annotations:23.0.0")
implementation("com.iridium:IridiumCore:1.7.4")
implementation("com.iridium:IridiumCore:1.9.1.jar")
implementation("org.bstats:bstats-bukkit:3.0.0")
implementation("de.jeff_media:SpigotUpdateChecker:1.3.2")

// Other dependencies that are not required or already available at runtime
compileOnly("org.projectlombok:lombok:1.18.22")
compileOnly("org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT")
compileOnly("me.clip:placeholderapi:2.9.2")
compileOnly("be.maximvdw:MVdWPlaceholderAPI:2.1.1") {
exclude("org.spigotmc")
}
compileOnly("com.iridium:IridiumSkyblock:3.2.8")
compileOnly("com.massivecraft.massivesuper:MassiveCore:2.14.0")
compileOnly("com.massivecraft.massivesuper:Factions:2.14.0")
compileOnly("com.massivecraft:Factions:1.6.9.5-U0.6.8") {
exclude("com.darkblade12")
exclude("org.kitteh")
}

compileOnly("com.iridium:IridiumSkyblock:4.0.8")

compileOnly("com.wasteofplastic:askyblock:3.0.9.4")
compileOnly("com.github.TownyAdvanced:Towny:0.96.7.0")
compileOnly("com.sk89q.worldguard:worldguard-bukkit:7.0.5-SNAPSHOT")
compileOnly("com.sk89q.worldedit:worldedit-bukkit:7.2.6-SNAPSHOT")
compileOnly("com.bgsoftware:SuperiorSkyblock:1.10.2")
compileOnly("com.bgsoftware:SuperiorSkyblockAPI:1.10.2")
compileOnly("com.github.angeschossen:LandsAPI:6.44.14")

// Enable lombok annotation processing
annotationProcessor("org.projectlombok:lombok:1.18.22")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.iridium.iridiumenchants;

import org.apache.commons.lang.NotImplementedException;
import com.iridium.iridiumcore.dependencies.commons.lang3.NotImplementedException;

import java.time.Duration;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ public void registerSupport() {
this.buildSupport = new ArrayList<>();
Arrays.asList(
new ASkyblockSupportHolder(),
new FactionsSupportHolder(),
new FactionsUUIDSupportHolder(),
new IridiumSkyblockSupportHolder(),
new LandsSupportHolder(),
new TownySupportHolder(),
Expand Down Expand Up @@ -203,6 +201,7 @@ public void registerEffects() {
effects.put("TELEPATHY", new Telepathy());
effects.put("ADD_EXTRA_HEALTH", new AddExtraHealth());
effects.put("REMOVE_EXTRA_HEALTH", new RemoveExtraHealth());
effects.put("VEINMINE", new VeinMine());
}

public void registerConditions() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,34 @@ public class Configuration {
.put(XMaterial.DEEPSLATE_GOLD_ORE, XMaterial.GOLD_INGOT)
.put(XMaterial.SAND, XMaterial.GLASS)
.build();

public List<XMaterial> veinMiner = Arrays.asList(
XMaterial.COAL_ORE,
XMaterial.DEEPSLATE_COAL_ORE,
XMaterial.COPPER_ORE,
XMaterial.DEEPSLATE_COPPER_ORE,
XMaterial.IRON_ORE,
XMaterial.DEEPSLATE_IRON_ORE,
XMaterial.LAPIS_ORE,
XMaterial.DEEPSLATE_LAPIS_ORE,
XMaterial.REDSTONE_ORE,
XMaterial.DEEPSLATE_REDSTONE_ORE,
XMaterial.GOLD_ORE,
XMaterial.DEEPSLATE_GOLD_ORE,
XMaterial.NETHER_GOLD_ORE,
XMaterial.EMERALD_ORE,
XMaterial.DEEPSLATE_EMERALD_ORE,
XMaterial.DIAMOND_ORE,
XMaterial.DEEPSLATE_DIAMOND_ORE,
XMaterial.NETHER_QUARTZ_ORE,
XMaterial.ANCIENT_DEBRIS
);

public boolean veinMinerDropsAtBreakLocation = true;
public boolean veinMinerBreaksTools = false;
public int veinMinerCap = 25;
public boolean veinMineWithWrongTool = false;

public List<XMaterial> infusionBlacklist = Arrays.asList(XMaterial.BEDROCK, XMaterial.SPAWNER, XMaterial.CHEST, XMaterial.TRAPPED_CHEST, XMaterial.WATER, XMaterial.LAVA);
public Map<String, Tier> tiers = ImmutableMap.<String, Tier>builder()
.put("Common", new Tier(new Item(XMaterial.ENCHANTED_BOOK, 11, 1, "&b&lCOMMON ENCHANTMENT", Arrays.asList("&e&lCOST: &7%cost% levels", "", "&e&l[!] &7Left Click to purchase a random common enchantment", "&e&l[!] &7Right Click to view all common enchantments")), 20, ExperienceType.LEVEL))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,5 +238,10 @@ public class CustomEnchants {
.put("Telepathy", new CustomEnchant("&7Telepathy", "Puts all blocks you break into your inventory", "Tool", "BLOCK_BREAK", ImmutableMap.<Integer, Level>builder()
.put(1, new Level(100, Collections.singletonList("Common"), Collections.singletonList("TELEPATHY"), Collections.emptyList()))
.build(), true, true))
.put("OreSiphon", new CustomEnchant("&7Ore Siphon", "Breaks adjacent ores of the same type", "Tool", "BLOCK_BREAK", ImmutableMap.<Integer, Level>builder()
.put(1, new Level(100, Collections.singletonList("Common"), Collections.singletonList("VEINMINE:15"), Collections.emptyList()))
.put(2, new Level(100, Collections.singletonList("Elite"), Collections.singletonList("VEINMINE:35"), Collections.emptyList()))
.put(3, new Level(100, Collections.singletonList("Legendary"), Collections.singletonList("VEINMINE:65"), Collections.emptyList()))
.build(), true, true))
.build();
}
65 changes: 33 additions & 32 deletions src/main/java/com/iridium/iridiumenchants/configs/GKits.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,109 +4,110 @@
import com.iridium.iridiumcore.Item;
import com.iridium.iridiumcore.dependencies.xseries.XMaterial;
import com.iridium.iridiumenchants.GKit;
import org.bukkit.enchantments.Enchantment;

import java.util.Arrays;
import java.util.Map;

import static com.iridium.iridiumcore.dependencies.xseries.XEnchantment.*;

public class GKits {
public Map<String, GKit> gkits = ImmutableMap.<String, GKit>builder()
.put("Frosty", new GKit(259200, "iridiumenchants.gkits.frosty", new Item(XMaterial.SNOWBALL, 11, 1, "&b&lFrosty Kit", Arrays.asList("&bCooldown: &7%days% Days %hours% Hours %minutes% Minutes and %seconds% Seconds", "", "&b&l[!] &7Left click to redeem this Gkit", "&b&l[!] &7Right click to preview this Gkit")), ImmutableMap.<Integer, GKit.GKitItem>builder()
.put(1, new GKit.GKitItem(XMaterial.DIAMOND_HELMET, 1, "&b&lFrosty Helmet", ImmutableMap.<String, Integer>builder()
.put(Enchantment.PROTECTION_ENVIRONMENTAL.getName(), 4)
.put(Enchantment.DURABILITY.getName(), 3)
.put(PROTECTION_ENVIRONMENTAL.name(), 4)
.put(DURABILITY.name(), 3)
.put("Replenish", 1)
.build()))
.put(2, new GKit.GKitItem(XMaterial.DIAMOND_CHESTPLATE, 1, "&b&lFrosty Chestplate", ImmutableMap.<String, Integer>builder()
.put(Enchantment.PROTECTION_ENVIRONMENTAL.getName(), 4)
.put(Enchantment.DURABILITY.getName(), 3)
.put(PROTECTION_ENVIRONMENTAL.name(), 4)
.put(DURABILITY.name(), 3)
.put("Resistance", 3)
.put("Evade", 3)
.build()))
.put(3, new GKit.GKitItem(XMaterial.DIAMOND_LEGGINGS, 1, "&b&lFrosty Leggings", ImmutableMap.<String, Integer>builder()
.put(Enchantment.PROTECTION_ENVIRONMENTAL.getName(), 4)
.put(Enchantment.DURABILITY.getName(), 3)
.put(PROTECTION_ENVIRONMENTAL.name(), 4)
.put(DURABILITY.name(), 3)
.put("Jacket", 3)
.build()))
.put(4, new GKit.GKitItem(XMaterial.DIAMOND_BOOTS, 1, "&b&lFrosty Boots", ImmutableMap.<String, Integer>builder()
.put(Enchantment.PROTECTION_ENVIRONMENTAL.getName(), 4)
.put(Enchantment.DURABILITY.getName(), 3)
.put(PROTECTION_ENVIRONMENTAL.name(), 4)
.put(DURABILITY.name(), 3)
.put("Frosty", 1)
.put("Speed", 3)
.put("Jump", 3)
.build()))
.put(5, new GKit.GKitItem(XMaterial.DIAMOND_SWORD, 1, "&b&lFrosty Sword", ImmutableMap.<String, Integer>builder()
.put(Enchantment.DAMAGE_ALL.getName(), 5)
.put(Enchantment.DURABILITY.getName(), 3)
.put(DAMAGE_ALL.name(), 5)
.put(DURABILITY.name(), 3)
.put("IceAspect", 3)
.put("Poison", 3)
.put("Renewal", 3)
.build()))
.build()))
.put("Spooky", new GKit(259200, "iridiumenchants.gkits.spooky", new Item(XMaterial.PUMPKIN, 13, 1, "&c&lSpooky Kit", Arrays.asList("&cCooldown: &7%days% Days %hours% Hours %minutes% Minutes and %seconds% Seconds", "", "&c&l[!] &7Left click to redeem this Gkit", "&c&l[!] &7Right click to preview this Gkit")), ImmutableMap.<Integer, GKit.GKitItem>builder()
.put(1, new GKit.GKitItem(XMaterial.DIAMOND_HELMET, 1, "&c&lSpooky Helmet", ImmutableMap.<String, Integer>builder()
.put(Enchantment.PROTECTION_ENVIRONMENTAL.getName(), 4)
.put(Enchantment.DURABILITY.getName(), 3)
.put(PROTECTION_ENVIRONMENTAL.name(), 4)
.put(DURABILITY.name(), 3)
.put("Replenish", 1)
.build()))
.put(2, new GKit.GKitItem(XMaterial.DIAMOND_CHESTPLATE, 1, "&c&lSpooky Chestplate", ImmutableMap.<String, Integer>builder()
.put(Enchantment.PROTECTION_ENVIRONMENTAL.getName(), 4)
.put(Enchantment.DURABILITY.getName(), 3)
.put(PROTECTION_ENVIRONMENTAL.name(), 4)
.put(DURABILITY.name(), 3)
.put("Netherskin", 1)
.put("Ignition", 3)
.put("SelfDestruct", 3)
.build()))
.put(3, new GKit.GKitItem(XMaterial.DIAMOND_LEGGINGS, 1, "&c&lSpooky Leggings", ImmutableMap.<String, Integer>builder()
.put(Enchantment.PROTECTION_ENVIRONMENTAL.getName(), 4)
.put(Enchantment.DURABILITY.getName(), 3)
.put(PROTECTION_ENVIRONMENTAL.name(), 4)
.put(DURABILITY.name(), 3)
.put("Jacket", 3)
.build()))
.put(4, new GKit.GKitItem(XMaterial.DIAMOND_BOOTS, 1, "&c&lSpooky Boots", ImmutableMap.<String, Integer>builder()
.put(Enchantment.PROTECTION_ENVIRONMENTAL.getName(), 4)
.put(Enchantment.DURABILITY.getName(), 3)
.put(PROTECTION_ENVIRONMENTAL.name(), 4)
.put(DURABILITY.name(), 3)
.put("Magma", 1)
.put("Speed", 3)
.put("Jump", 3)
.build()))
.put(5, new GKit.GKitItem(XMaterial.DIAMOND_AXE, 1, "&c&lSpooky Axe", ImmutableMap.<String, Integer>builder()
.put(Enchantment.DAMAGE_ALL.getName(), 5)
.put(Enchantment.DURABILITY.getName(), 3)
.put(DAMAGE_ALL.name(), 5)
.put(DURABILITY.name(), 3)
.put("Decapitate", 3)
.put("Wither", 3)
.put("Thunder", 1)
.build()))
.build()))
.put("Valentines", new GKit(259200, "iridiumenchants.gkits.valentines", new Item(XMaterial.BOW, 15, 1, "&d&lValentine's Kit", Arrays.asList("&dCooldown: &7%days% Days %hours% Hours %minutes% Minutes and %seconds% Seconds", "", "&d&l[!] &7Left click to redeem this Gkit", "&d&l[!] &7Right click to preview this Gkit")), ImmutableMap.<Integer, GKit.GKitItem>builder()
.put(1, new GKit.GKitItem(XMaterial.DIAMOND_HELMET, 1, "&d&lValentine's Helmet", ImmutableMap.<String, Integer>builder()
.put(Enchantment.PROTECTION_ENVIRONMENTAL.getName(), 4)
.put(Enchantment.DURABILITY.getName(), 3)
.put(PROTECTION_ENVIRONMENTAL.name(), 4)
.put(DURABILITY.name(), 3)
.put("Replenish", 1)
.put("Visionary", 1)
.put("Aquatic", 1)
.build()))
.put(2, new GKit.GKitItem(XMaterial.DIAMOND_CHESTPLATE, 1, "&d&lValentine's Chestplate", ImmutableMap.<String, Integer>builder()
.put(Enchantment.PROTECTION_ENVIRONMENTAL.getName(), 4)
.put(Enchantment.DURABILITY.getName(), 3)
.put(PROTECTION_ENVIRONMENTAL.name(), 4)
.put(DURABILITY.name(), 3)
.put("Resistance", 3)
.put("Evade", 3)
.put("Cursed", 3)
.put("Grace", 3)
.build()))
.put(3, new GKit.GKitItem(XMaterial.DIAMOND_LEGGINGS, 1, "&d&lValentine's Leggings", ImmutableMap.<String, Integer>builder()
.put(Enchantment.PROTECTION_ENVIRONMENTAL.getName(), 4)
.put(Enchantment.DURABILITY.getName(), 3)
.put(PROTECTION_ENVIRONMENTAL.name(), 4)
.put(DURABILITY.name(), 3)
.put("Jacket", 3)
.build()))
.put(4, new GKit.GKitItem(XMaterial.DIAMOND_BOOTS, 1, "&d&lValentine's Boots", ImmutableMap.<String, Integer>builder()
.put(Enchantment.PROTECTION_ENVIRONMENTAL.getName(), 4)
.put(Enchantment.DURABILITY.getName(), 3)
.put(PROTECTION_ENVIRONMENTAL.name(), 4)
.put(DURABILITY.name(), 3)
.put("Speed", 3)
.put("Jump", 3)
.build()))
.put(5, new GKit.GKitItem(XMaterial.BOW, 1, "&d&lValentine's Bow", ImmutableMap.<String, Integer>builder()
.put(Enchantment.ARROW_INFINITE.getName(), 5)
.put(Enchantment.DURABILITY.getName(), 3)
.put(Enchantment.ARROW_DAMAGE.getName(), 5)
.put(ARROW_INFINITE.name(), 5)
.put(DURABILITY.name(), 3)
.put(ARROW_DAMAGE.name(), 5)
.put("Multishot", 3)
.put("SoulReaper", 3)
.put("Piercing", 3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ public class Messages {
public String noGkit = "%prefix% &7No GKit by that name exists.";
public String gaveGKit = "%prefix% &7You gave the %name% gkit to %player%.";
public String recievedGKit = "%prefix% &7You received a %name% gkit from %player%.";
public String cannotVeinMine = "%prefix% &7Your &e%tool% &7is low on durability, so you cannot break the block(s).";
public String veinMineWrongTool = "%prefix% &7Your %tool% is not capable of getting drops from this block, so it will not be mined.";
}
11 changes: 5 additions & 6 deletions src/main/java/com/iridium/iridiumenchants/effects/DropHead.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,18 @@
public class DropHead implements Effect {
@Override
public void apply(LivingEntity player, LivingEntity target, String[] args, ItemStack itemStack, Event event) {

ItemStack head = XMaterial.PLAYER_HEAD.parseItem();
if (head == null) return;
SkullMeta meta = (SkullMeta) head.getItemMeta();

if (args.length == 2 && args[1].equalsIgnoreCase("target")) {
if (target == null) return;
ItemStack head = XMaterial.PLAYER_HEAD.parseItem();
if (head == null) return;
SkullMeta meta = (SkullMeta) head.getItemMeta();
meta.setOwner(target.getName());
head.setItemMeta(meta);
target.getLocation().getWorld().dropItem(target.getLocation(), head);
} else {
if (player == null) return;
ItemStack head = XMaterial.PLAYER_HEAD.parseItem();
if (head == null) return;
SkullMeta meta = (SkullMeta) head.getItemMeta();
meta.setOwner(player.getName());
head.setItemMeta(meta);
player.getLocation().getWorld().dropItem(player.getLocation(), head);
Expand Down
Loading