Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit ec3d514
Merge: 28800ec 898bc8a
Author: Shyanne <randomgirlisweird@gmail.com>
Date:   Sat Mar 16 10:17:24 2024 -0400

    Merge branch 'master' into level-configuration

commit 28800ec
Author: Shyanne <randomgirlisweird@gmail.com>
Date:   Sun Mar 3 13:26:48 2024 -0500

    Fixed bank placeholders and GUIs

commit c6348a5
Author: Shyanne <randomgirlisweird@gmail.com>
Date:   Sun Mar 3 01:46:14 2024 -0500

    small fixes

commit faaf0c9
Author: Shyanne <randomgirlisweird@gmail.com>
Date:   Sun Mar 3 00:55:32 2024 -0500

    Added More Level Features

    - added ``minLevel`` to ``BiomeItem`` and ``SchematicConfig`` classes, and functionality to use them
    - added ``islandCreationCost`` in config to check if we want islands to cost something on creation or just regen
    - updated configs to reflect changes in teams (also updated default regenCost to be 0 because... y'know)
    - removed formulas from ``getLevel()`` because we pull from islandManager instead
    - added ``island_experienceToLevelUp`` and ``island_experienceForNextLevel`` placeholders, which return the amount of experience left needed to level up and the experience needed for the next level respectively

commit 1c3f686
Author: Shyanne <randomgirlisweird@gmail.com>
Date:   Fri Mar 1 13:07:12 2024 -0500

    added leveling toggle

commit ade8705
Author: Shyanne <randomgirlisweird@gmail.com>
Date:   Fri Mar 1 13:02:00 2024 -0500

    no negative values here

commit c3cc083
Author: Shyanne <randomgirlisweird@gmail.com>
Date:   Fri Mar 1 12:56:12 2024 -0500

    Added Island Level Configuration

    - the other side of [IridiumTeams #49](Iridium-Development/IridiumTeams#49)
  • Loading branch information
sh0inx committed Apr 30, 2024
1 parent 9b75714 commit 5d26556
Show file tree
Hide file tree
Showing 13 changed files with 161 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
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
Expand Up @@ -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(
Expand All @@ -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
)
)
)
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public Configuration() {
public boolean allowPvPOnIslands = false;
public boolean islandCreateOnJoin = false;
public boolean spawnOnIsland = false;
public boolean islandCreationCost = false;
public int distance = 151;
public int netherUnlockLevel = 10;
public int endUnlockLevel = 20;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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",
Expand All @@ -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))
Expand All @@ -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(),
Expand Down
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
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;

Expand All @@ -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;
Expand Down
Loading

0 comments on commit 5d26556

Please sign in to comment.