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 Island Level Configuration #818

Merged
merged 12 commits into from
Jun 10, 2024
Original file line number Diff line number Diff line change
@@ -54,6 +54,13 @@ public boolean execute(User user, Island island, String[] args, IridiumTeams<Isl

Schematics.SchematicConfig schematicConfig = IridiumSkyblock.getInstance().getSchematics().schematics.get(schematic.get());

if(island.getLevel() < schematicConfig.minLevel) {
player.sendMessage(StringUtils.color(IridiumSkyblock.getInstance().getMessages().notHighEnoughLevel
.replace("%prefix%", IridiumSkyblock.getInstance().getConfiguration().prefix)
.replace("%level%", String.valueOf(schematicConfig.minLevel))));
return false;
}

if (schematicConfig.regenCost.money != 0 || !schematicConfig.regenCost.bankItems.isEmpty()) {
if (!IridiumSkyblock.getInstance().getSchematicManager().buy(player, schematicConfig)) {
return false;
34 changes: 23 additions & 11 deletions src/main/java/com/iridium/iridiumskyblock/configs/Biomes.java
Original file line number Diff line number Diff line change
@@ -26,23 +26,26 @@ public class Biomes {
XBiome.PLAINS,
1,
11,
new Cost(100, new HashMap<>())
new Cost(100, new HashMap<>()),
1
),
new BiomeItem(
"&9&lSnowy Plains",
XMaterial.SNOW_BLOCK,
XBiome.SNOWY_PLAINS,
1,
13,
new Cost(50, new HashMap<>())
new Cost(50, new HashMap<>()),
1
),
new BiomeItem(
"&9&lSavanna",
XMaterial.TALL_GRASS,
XBiome.SAVANNA,
1,
15,
new Cost(100, new HashMap<>())
new Cost(100, new HashMap<>()),
1
)
))
.put("Nether", Arrays.asList(
@@ -52,23 +55,26 @@ public class Biomes {
XBiome.NETHER_WASTES,
1,
11,
new Cost(50, new HashMap<>())
new Cost(50, new HashMap<>()),
1
),
new BiomeItem(
"&9&lCrimson Forest",
XMaterial.CRIMSON_NYLIUM,
XBiome.CRIMSON_FOREST,
1,
13,
new Cost(1000, new HashMap<>())
new Cost(1000, new HashMap<>()),
1
),
new BiomeItem(
"&9&lWarped Forest",
XMaterial.WARPED_NYLIUM,
XBiome.WARPED_FOREST,
1,
15,
new Cost(100, new HashMap<>())
new Cost(100, new HashMap<>()),
1
)
)
)
@@ -79,29 +85,33 @@ public class Biomes {
XBiome.THE_END,
1,
11,
new Cost(100, new HashMap<>())
new Cost(100, new HashMap<>()),
1
),
new BiomeItem(
"&9&lEnd Highlands",
XMaterial.PURPUR_BLOCK,
XBiome.END_HIGHLANDS,
1,
13,
new Cost(150, new HashMap<>())
new Cost(150, new HashMap<>()),
1
),
new BiomeItem(
"&9&lEnd Barrens",
XMaterial.ENDER_EYE,
XBiome.END_BARRENS,
1,
15,
new Cost(150, new HashMap<>())
)
new Cost(150, new HashMap<>()),
1
)
)
)
.build();
public String buyPriceLore = "&aBuy Price: $%vault_cost%";
public String notPurchasableLore = "&cThis item cannot be purchased!";
public String levelRequirementLore = "&9[!] &7Must be level %level% to purchase";
public boolean abbreviatePrices = true;
public XSound failSound = XSound.BLOCK_ANVIL_LAND;
public XSound successSound = XSound.ENTITY_PLAYER_LEVELUP;
@@ -127,8 +137,9 @@ public static class BiomeItem {
public int slot;
public int page;
public Cost buyCost;
public int minLevel;

public BiomeItem(String name, XMaterial type, XBiome biome, int defaultAmount, int slot, Cost buyCost) {
public BiomeItem(String name, XMaterial type, XBiome biome, int defaultAmount, int slot, Cost buyCost, int minLevel) {
this.name = name;
this.type = type;
this.biome = biome;
@@ -137,6 +148,7 @@ public BiomeItem(String name, XMaterial type, XBiome biome, int defaultAmount, i
this.slot = slot;
this.page = 1;
this.buyCost = buyCost;
this.minLevel = minLevel;
}
}

Original file line number Diff line number Diff line change
@@ -56,6 +56,7 @@ public Configuration() {
public boolean clearEnderChestOnRegen = false;
public boolean allowPvPOnIslands = false;
public boolean islandCreateOnJoin = false;
public boolean islandCreationCost = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this is going to confuse things even more. I understand there are alot of people asking this in the Discord, but if we want to remove the creation cost, I feel setting the default cost to 0 for everything is a better aproach

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was more for the fact that we could allow pricing for creation and regen to be different (as in, when you create the island, it doesn't cost anything, but when you regen, it does) - we could change it to be free but honestly i dont care about those people lol

public int distance = 151;
public int netherUnlockLevel = 10;
public int endUnlockLevel = 20;
Original file line number Diff line number Diff line change
@@ -40,14 +40,15 @@ public Enhancements() {
"&9&lInformation:",
"&9&l * &7Current Level: &9%current_level%",
"&9&l * &7Current Size: &9%size%x%size% Blocks",
"&9&l * &7Upgrade Cost: &9%cost%",
"&9&l * &7Upgrade Cost: &9%vault_cost%, %Crystals_cost% Island Crystals",
"&9&lLevels:",
"&9&l * &7Level 1: &950x50 Blocks",
"&9&l * &7Level 2: &975x75 Blocks",
"&9&l * &7Level 3: &9100x100 Blocks",
"&9&l * &7Level 4: &9125x125 Blocks",
"&9&l * &7Level 5: &9150x150 Blocks",
"",
"&9[!] &7Must be level %minLevel% to purchase",
"&9&l[!] " + "&9Left Click to Purchase Level %next_level%."
)), new ImmutableMap.Builder<Integer, SizeEnhancementData>()
.put(0, new SizeEnhancementData(5, 10000, new ImmutableMap.Builder<String, Double>().put("Crystals", 5.00).build(), 50))
@@ -63,7 +64,7 @@ public Enhancements() {
"",
"&9&lInformation:",
"&9&l * &7Current Level: &9%current_level%",
"&9&l * &7Upgrade Cost: &9%cost%",
"&9&l * &7Upgrade Cost: &9%vault_cost%, %Crystals_cost% Island Crystals",
"&9&lLevels:",
"&9&l * &7Level 1: &9No Void Teleport",
"&9&l * &7Level 2: &9100% Item Loss",
@@ -72,6 +73,7 @@ public Enhancements() {
"&9&l * &7Level 5: &925% Item Loss",
"&9&l * &7Level 6: &90% Item Loss",
"",
"&9[!] &7Must be level %minLevel% to purchase",
"&9&l[!] " + "&9Left Click to Purchase Level %next_level%."
)), new ImmutableMap.Builder<Integer, VoidEnhancementData>()
.put(0, new VoidEnhancementData(5, 10000, new ImmutableMap.Builder<String, Double>().put("Crystals", 5.00).build(), true, 0.00))
@@ -83,8 +85,9 @@ public Enhancements() {
"",
"&9&lInformation:",
"&9&l * &7Current Level: &9%current_level%",
"&9&l * &7Upgrade Cost: &9%cost%",
"&9&l * &7Upgrade Cost: &9%vault_cost%, %Crystals_cost% Island Crystals",
"",
"&9[!] &7Must be level %minLevel% to purchase",
"&9&l[!] " + "&9Left Click to Purchase Level %next_level%."
)), new ImmutableMap.Builder<Integer, GeneratorEnhancementData>()
.put(0, new GeneratorEnhancementData(5, 10000, new ImmutableMap.Builder<String, Double>().put("Crystals", 5.00).build(),
20 changes: 10 additions & 10 deletions src/main/java/com/iridium/iridiumskyblock/configs/Missions.java
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ public Missions() {
"",
"&9&l * &7Time Remaining: " + "&9%timeremaining_hours% hours %timeremaining_minutes% minutes and %timeremaining_seconds% seconds"
)
), Arrays.asList("GROW:SUGAR_CANE:10", "GROW:WHEAT:10", "GROW:CARROTS:10"), new Reward(new Item(XMaterial.DIAMOND, 1, "&9&lFarmer Reward",
), Arrays.asList("GROW:SUGAR_CANE:10", "GROW:WHEAT:10", "GROW:CARROTS:10"), 1, new Reward(new Item(XMaterial.DIAMOND, 1, "&9&lFarmer Reward",
Arrays.asList(
"&9&l Rewards",
"&9&l* &75 Island Crystals",
@@ -64,7 +64,7 @@ public Missions() {
"",
"&9&l * &7Time Remaining: " + "&9%timeremaining_hours% hours %timeremaining_minutes% minutes and %timeremaining_seconds% seconds"
)
), Arrays.asList("KILL:ZOMBIE:10", "KILL:SKELETON:10", "KILL:CREEPER:10"), new Reward(new Item(XMaterial.DIAMOND, 1, "&9&lHunter Reward",
), Arrays.asList("KILL:ZOMBIE:10", "KILL:SKELETON:10", "KILL:CREEPER:10"), 1, new Reward(new Item(XMaterial.DIAMOND, 1, "&9&lHunter Reward",
Arrays.asList(
"&9&l Rewards",
"&9&l* &75 Island Crystals",
@@ -92,7 +92,7 @@ public Missions() {
"",
"&9&l * &7Time Remaining: " + "&9%timeremaining_hours% hours %timeremaining_minutes% minutes and %timeremaining_seconds% seconds"
)
), Collections.singletonList("CRAFT:BREAD:64"), new Reward(new Item(XMaterial.DIAMOND, 1, "&9&lBaker Reward",
), Collections.singletonList("CRAFT:BREAD:64"), 1, new Reward(new Item(XMaterial.DIAMOND, 1, "&9&lBaker Reward",
Arrays.asList(
"&9&l Rewards",
"&9&l* &75 Island Crystals",
@@ -122,7 +122,7 @@ public Missions() {
"",
"&9&l * &7Time Remaining: " + "&9%timeremaining_hours% hours %timeremaining_minutes% minutes and %timeremaining_seconds% seconds"
)
), Arrays.asList("MINE:IRON_ORE:15", "MINE:COAL_ORE:30", "MINE:DIAMOND_ORE:1"), new Reward(new Item(XMaterial.DIAMOND, 1, "&9&lMiner Reward",
), Arrays.asList("MINE:IRON_ORE:15", "MINE:COAL_ORE:30", "MINE:DIAMOND_ORE:1"), 1, new Reward(new Item(XMaterial.DIAMOND, 1, "&9&lMiner Reward",
Arrays.asList(
"&9&l Rewards",
"&9&l* &75 Island Crystals",
@@ -150,7 +150,7 @@ public Missions() {
"",
"&9&l * &7Time Remaining: " + "&9%timeremaining_hours% hours %timeremaining_minutes% minutes and %timeremaining_seconds% seconds"
)
), Collections.singletonList("FISH:ANY:10"), new Reward(new Item(XMaterial.DIAMOND, 1, "&9&lFisherman Reward",
), Collections.singletonList("FISH:ANY:10"), 1, new Reward(new Item(XMaterial.DIAMOND, 1, "&9&lFisherman Reward",
Arrays.asList(
"&9&l Rewards",
"&9&l* &75 Island Crystals",
@@ -178,7 +178,7 @@ public Missions() {
"&9&l* &7$1000",
"",
"&9&l * &7Time Remaining: " + "&9%timeremaining_hours% hours %timeremaining_minutes% minutes and %timeremaining_seconds% seconds"
)), Arrays.asList("SMELT:" + (XMaterial.supports(17) ? XMaterial.RAW_IRON.name() : XMaterial.IRON_ORE.name()) + ":30", "SMELT:" + (XMaterial.supports(17) ? XMaterial.RAW_GOLD.name() : XMaterial.GOLD_ORE.name()) + ":15"), new Reward(new Item(XMaterial.DIAMOND, 1, "&9&lBlacksmith Reward",
)), Arrays.asList("SMELT:" + (XMaterial.supports(17) ? XMaterial.RAW_IRON.name() : XMaterial.IRON_ORE.name()) + ":30", "SMELT:" + (XMaterial.supports(17) ? XMaterial.RAW_GOLD.name() : XMaterial.GOLD_ORE.name()) + ":15"), 1, new Reward(new Item(XMaterial.DIAMOND, 1, "&9&lBlacksmith Reward",
Arrays.asList(
"&9&l Rewards",
"&9&l* &75 Island Crystals",
@@ -207,7 +207,7 @@ public Missions() {
"",
"&9&l * &7Time Remaining: " + "&9%timeremaining_hours% hours %timeremaining_minutes% minutes and %timeremaining_seconds% seconds"
)
), Arrays.asList("BREW:SPEED:2:3", "BREW:STRENGTH:2:3"), new Reward(new Item(XMaterial.DIAMOND, 1, "&9&lPotionBrewer Reward",
), Arrays.asList("BREW:SPEED:2:3", "BREW:STRENGTH:2:3"), 1, new Reward(new Item(XMaterial.DIAMOND, 1, "&9&lPotionBrewer Reward",
Arrays.asList(
"&9&l Rewards",
"&9&l* &75 Island Crystals",
@@ -233,7 +233,7 @@ public Missions() {
"&9&l* &75 Island Crystals",
"&9&l* &7$1000"
)
), Collections.singletonList("MINE:LOGS:10"), new Reward(new Item(XMaterial.DIAMOND, 1, "&9&lPotionBrewer Reward",
), Collections.singletonList("MINE:LOGS:10"), 1, new Reward(new Item(XMaterial.DIAMOND, 1, "&9&lPotionBrewer Reward",
Arrays.asList(
"&9&l Rewards",
"&9&l* &75 Island Crystals",
@@ -257,7 +257,7 @@ public Missions() {
"&9&l* &75 Island Crystals",
"&9&l* &7$1000"
)
), Collections.singletonList("MINE:LOGS:100"), new Reward(new Item(XMaterial.DIAMOND, 1, "&9&lPotionBrewer Reward",
), Collections.singletonList("MINE:LOGS:100"), 1, new Reward(new Item(XMaterial.DIAMOND, 1, "&9&lPotionBrewer Reward",
Arrays.asList(
"&9&l Rewards",
"&9&l* &75 Island Crystals",
@@ -281,7 +281,7 @@ public Missions() {
"&9&l* &75 Island Crystals",
"&9&l* &7$1000"
)
), Collections.singletonList("MINE:LOGS:1000"), new Reward(new Item(XMaterial.DIAMOND, 1, "&9&lPotionBrewer Reward",
), Collections.singletonList("MINE:LOGS:1000"), 1, new Reward(new Item(XMaterial.DIAMOND, 1, "&9&lPotionBrewer Reward",
Arrays.asList(
"&9&l Rewards",
"&9&l* &75 Island Crystals",
Original file line number Diff line number Diff line change
@@ -17,23 +17,23 @@ public class Schematics {

public Map<String, SchematicConfig> schematics = ImmutableMap.<String, SchematicConfig>builder()
.put("desert", new SchematicConfig(new Item(XMaterial.PLAYER_HEAD, 11, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNGY0OTNkZDgwNjUzM2Q5ZDIwZTg0OTUzOTU0MzY1ZjRkMzY5NzA5Y2ViYzlkZGVmMDIyZDFmZDQwZDg2YTY4ZiJ9fX0=", 1, "&9&lDesert Island", Arrays.asList("&7A starter desert island.", "", "&9&l[!] &7Costs $1000")),
new Schematics.Cost(1000, new HashMap<>()), -0.5, 89, -0.5, 90, new SchematicWorld(Biome.DESERT,
new Schematics.Cost(0, new HashMap<>()), 1, -0.5, 89, -0.5, 90, new SchematicWorld(Biome.DESERT,
"desert.schem", 90.0, true
), new SchematicWorld(XMaterial.supports(16) ? Biome.NETHER_WASTES : Biome.valueOf("NETHER"),
"desert_nether.schem", 90.0, true
), new SchematicWorld(Biome.THE_END,
"desert_end.schem", 90.0, true
)))
.put("jungle", new SchematicConfig(new Item(XMaterial.PLAYER_HEAD, 13, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNjgzYWRmNDU2MGRlNDc0MTQwNDA5M2FjNjFjMzNmYjU1NmIzZDllZTUxNDBmNjIwMzYyNTg5ZmRkZWRlZmEyZCJ9fX0=", 1, "&9&lJungle Island", Arrays.asList("&7A starter jungle island.", "", "&9&l[!] &7Costs $1000")),
new Schematics.Cost(1000, new HashMap<>()), 1.5, 83, 1.5, 90, new SchematicWorld(Biome.JUNGLE,
new Schematics.Cost(0, new HashMap<>()), 1, 1.5, 83, 1.5, 90, new SchematicWorld(Biome.JUNGLE,
"jungle.schem", 90.0, true
), new SchematicWorld(XMaterial.supports(16) ? Biome.NETHER_WASTES : Biome.valueOf("NETHER"),
"jungle_nether.schem", 90.0, true
), new SchematicWorld(Biome.THE_END,
"jungle_end.schem", 90.0, true
)))
.put("mushroom", new SchematicConfig(new Item(XMaterial.PLAYER_HEAD, 15, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZWE0NWQxYjQxN2NiZGRjMjE3NjdiMDYwNDRlODk5YjI2NmJmNzhhNjZlMjE4NzZiZTNjMDUxNWFiNTVkNzEifX19", 1, "&9&lMushroom Island", Arrays.asList("&7A starter mushroom island.", "", "&9&l[!] &7Costs $1000")),
new Schematics.Cost(1000, new HashMap<>()), 0.5, 89, -0.5, 90, new SchematicWorld(Biome.MUSHROOM_FIELDS,
new Schematics.Cost(0, new HashMap<>()), 1, 0.5, 89, -0.5, 90, new SchematicWorld(Biome.MUSHROOM_FIELDS,
"mushroom.schem", 90.0, true
), new SchematicWorld(XMaterial.supports(16) ? Biome.NETHER_WASTES : Biome.valueOf("NETHER"),
"mushroom_nether.schem", 90.0, true
@@ -42,6 +42,9 @@ public class Schematics {
)))
.build();
public boolean abbreviatePrices = true;
public String buyPriceLore = "&9Buy Price: &7%vault_cost%";
public String levelRequirementLore = "&9[!] &7Must be level %level% to purchase";
public String regenDisclaimer = "&9[!] &7Applies to regeneration only";
public XSound failSound = XSound.BLOCK_ANVIL_LAND;
public XSound successSound = XSound.ENTITY_PLAYER_LEVELUP;

@@ -50,6 +53,7 @@ public class Schematics {
public static class SchematicConfig {
public Item item;
public Cost regenCost;
public int minLevel;
public double xHome;
public double yHome;
public double zHome;
Loading