Skip to content

Commit

Permalink
Merge pull request #19 from r3back/develop
Browse files Browse the repository at this point in the history
Removed Skills File Converter and modified Collections's command permissions
  • Loading branch information
r3back committed Jun 25, 2023
2 parents a0c3c67 + b24ec70 commit 50884eb
Show file tree
Hide file tree
Showing 18 changed files with 124 additions and 726 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
public final class Commands extends OkaeriConfig {
public CommandDetails reloadCommand = new CommandDetails(Collections.singletonList("reload"), "Reload files", "/TheCollections reload", "thecollections.reload", true, Duration.ZERO.getSeconds(), true, "thecollections");
public CommandDetails mainMenuCommand = new CommandDetails(Collections.singletonList("mainmenu"), "Main Menu Command", "/TheCollections mainmenu", "thecollections.mainmenu", true, Duration.ZERO.getSeconds(), true, "thecollections");
public CommandDetails collectionMenuCommand = new CommandDetails(Collections.singletonList("collection"), "Specific Collection Menu Command", "/TheCollections collection <id>", "thecollections.skillmenu", true, Duration.ZERO.getSeconds(), true, "thecollections");
public CommandDetails categoryMenuCommand = new CommandDetails(Collections.singletonList("category"), "Specific Category Menu Command", "/TheCollections category <id>", "thecollections.skillmenu", true, Duration.ZERO.getSeconds(), true, "thecollections");
public CommandDetails collectionMenuCommand = new CommandDetails(Collections.singletonList("collection"), "Specific Collection Menu Command", "/TheCollections collection <id>", "thecollections.collection", true, Duration.ZERO.getSeconds(), true, "thecollections");
public CommandDetails categoryMenuCommand = new CommandDetails(Collections.singletonList("category"), "Specific Category Menu Command", "/TheCollections category <id>", "thecollections.category", true, Duration.ZERO.getSeconds(), true, "thecollections");
public CommandDetails setLevelCommand = new CommandDetails(Collections.singletonList("setlevel"), "Set Collection level", "/TheCollections setlevel <player> <id> <amount>", "thecollections.setlevel", true, Duration.ZERO.getSeconds(), true, "thecollections");
public CommandDetails setXPCommand = new CommandDetails(Collections.singletonList("setxp"), "Set Collection xp", "/TheCollections setxp <player> <id> <amount>", "thecollections.setxp", true, Duration.ZERO.getSeconds(), true, "thecollections");
public CommandDetails helpCommand = new CommandDetails(Collections.singletonList("help"), "Show all commands", "/TheCollections help", "thecollections.help", true, Duration.ZERO.getSeconds(), true, "thecollections");
Expand Down
16 changes: 3 additions & 13 deletions TheSkills/src/main/java/com/qualityplus/skills/TheSkills.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.qualityplus.skills;

import com.qualityplus.assistant.lib.eu.okaeri.injector.annotation.Inject;
import com.qualityplus.assistant.okaeri.OkaeriSilentPlugin;
import com.qualityplus.skills.api.TheSkillsAPI;
import com.qualityplus.skills.api.box.Box;
import com.qualityplus.skills.converter.TheSkillsConverterPlugin;
import com.qualityplus.skills.persistance.data.UserData;

import com.qualityplus.assistant.lib.eu.okaeri.platform.core.annotation.Scan;
Expand All @@ -14,18 +14,8 @@
import org.bukkit.entity.Player;

@Scan(deep = true)
public final class TheSkills extends TheSkillsConverterPlugin {
private static @Inject
@Getter TheSkillsAPI api;

@Override
@Planned(ExecutionPhase.POST_SETUP)
protected void convertSkills(Box box) {
super.convertSkills(box);
super.moveSeaFortuneFile(box);
super.convertStatsAndPerks(box, "stats", "stat");
super.convertStatsAndPerks(box, "perks", "perk");
}
public final class TheSkills extends OkaeriSilentPlugin {
private static @Inject @Getter TheSkillsAPI api;

@Planned(ExecutionPhase.PRE_SHUTDOWN)
private void whenStop(Box box){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,32 @@
@Header(" Alchemy ")
@Header("================================")
@Names(strategy = NameStrategy.HYPHEN_CASE, modifier = NameModifier.TO_LOWER_CASE)
public final class AlchemyConfig extends OkaeriConfig implements SkillFile {
public final class AlchemyConfig extends OkaeriConfig {
public String id = "alchemy";
public boolean enabled = true;
public String displayName = "Alchemy";
public List<String> description = Collections.singletonList("&7Brew Potions to earn alchemy xp!");
public int maxLevel = 50;
private Map<Integer, Double> xpRequirements = getLevelsMap();
private Map<Integer, List<String>> skillInfoInGUI = getInfo();
private Map<Integer, List<StatReward>> statRewards = getRewards();
private Map<Integer, List<StatReward>> statRewards = getInternalRewards();
private Map<Integer, List<String>> skillInfoInMessage = getInfo();
private Map<Integer, List<CommandReward>> commandRewards = new HashMap<>();

private Map<XMaterial, Double> rewards = ImmutableMap.<XMaterial, Double>builder()
.put(XMaterial.GHAST_TEAR, 5D)
.put(XMaterial.GLOWSTONE_DUST, 5D)
.put(XMaterial.FERMENTED_SPIDER_EYE, 5D)
.put(XMaterial.GUNPOWDER, 5D)
.put(XMaterial.REDSTONE, 5D)
.put(XMaterial.NETHER_WART, 5D)
.put(XMaterial.PUFFERFISH, 5D)
.put(XMaterial.DRAGON_BREATH, 5D)
.put(XMaterial.SUGAR, 5D)
.put(XMaterial.RABBIT_FOOT, 5D)
.put(XMaterial.MAGMA_BLOCK, 5D)
.put(XMaterial.SPIDER_EYE, 5D)
.put(XMaterial.PHANTOM_MEMBRANE, 5D)
.build();

public GUIOptions guiOptions = GUIOptions.builder()
.slot(19)
Expand Down Expand Up @@ -68,24 +82,9 @@ public Skill getSkill(){
.skillInfoInMessage(skillInfoInMessage)
.skillInfoInGUI(skillInfoInGUI)
.commandRewards(commandRewards)

.maxLevel(maxLevel)
.skillGUIOptions(guiOptions)
.rewards(ImmutableMap.<XMaterial, Double>builder()
.put(XMaterial.GHAST_TEAR, 5D)
.put(XMaterial.GLOWSTONE_DUST, 5D)
.put(XMaterial.FERMENTED_SPIDER_EYE, 5D)
.put(XMaterial.GUNPOWDER, 5D)
.put(XMaterial.REDSTONE, 5D)
.put(XMaterial.NETHER_WART, 5D)
.put(XMaterial.PUFFERFISH, 5D)
.put(XMaterial.DRAGON_BREATH, 5D)
.put(XMaterial.SUGAR, 5D)
.put(XMaterial.RABBIT_FOOT, 5D)
.put(XMaterial.MAGMA_BLOCK, 5D)
.put(XMaterial.SPIDER_EYE, 5D)
.put(XMaterial.PHANTOM_MEMBRANE, 5D)
.build())
.rewards(rewards)
.build();
}

Expand All @@ -112,7 +111,7 @@ private Map<Integer, List<String>> getInfo(){
.build();
}

private Map<Integer, List<StatReward>> getRewards(){
private Map<Integer, List<StatReward>> getInternalRewards(){
return FastMap.listBuilder(Integer.class, StatReward.class)
.put(1, Arrays.asList(new StatReward("defense", 1), new StatReward("ferocity", 1), new StatReward("brew_chance", 1), new StatReward("potion_master", 1)))
.put(10, Arrays.asList(new StatReward("defense", 2), new StatReward("ferocity", 2), new StatReward("brew_chance", 1), new StatReward("potion_master", 1)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@Header(" Carpentry ")
@Header("================================")
@Names(strategy = NameStrategy.HYPHEN_CASE, modifier = NameModifier.TO_LOWER_CASE)
public final class CarpentryConfig extends OkaeriConfig implements SkillFile {
public final class CarpentryConfig extends OkaeriConfig {

public String id = "carpentry";
public boolean enabled = true;
Expand All @@ -36,10 +36,12 @@ public final class CarpentryConfig extends OkaeriConfig implements SkillFile {
public int maxLevel = 50;
private Map<Integer, Double> xpRequirements = getLevelsMap();
private Map<Integer, List<String>> skillInfoInGUI = getInfo();
private Map<Integer, List<StatReward>> statRewards = getRewards();
private Map<Integer, List<StatReward>> statRewards = getInternalRewards();
private Map<Integer, List<String>> skillInfoInMessage = getInfo();
private Map<Integer, List<CommandReward>> commandRewards = new HashMap<>();

private Map<XMaterial, Double> rewards = ImmutableMap.<XMaterial, Double>builder()
.put(XMaterial.FURNACE, 2D)
.build();
private GUIOptions guiOptions = GUIOptions.builder()
.slot(20)
.item(XMaterial.PLAYER_HEAD)
Expand Down Expand Up @@ -69,9 +71,7 @@ public Skill getSkill(){
.commandRewards(commandRewards)
.maxLevel(maxLevel)
.skillGUIOptions(guiOptions)
.rewards(ImmutableMap.<XMaterial, Double>builder()
.put(XMaterial.FURNACE, 2D)
.build())
.rewards(rewards)
.xpForAllItems(0D)
.build();
}
Expand Down Expand Up @@ -99,7 +99,7 @@ private Map<Integer, List<String>> getInfo(){
.build();
}

private Map<Integer, List<StatReward>> getRewards(){
private Map<Integer, List<StatReward>> getInternalRewards(){
return FastMap.listBuilder(Integer.class, StatReward.class)
.put(1, Arrays.asList(new StatReward("strength", 1), new StatReward("crit_chance", 1), new StatReward("refurbished", 1), new StatReward("medicine_man", 1)))
.put(10, Arrays.asList(new StatReward("strength", 2), new StatReward("crit_chance", 2), new StatReward("refurbished", 1), new StatReward("medicine_man", 1)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,22 @@
@Header(" Combat ")
@Header("================================")
@Names(strategy = NameStrategy.HYPHEN_CASE, modifier = NameModifier.TO_LOWER_CASE)
public final class CombatConfig extends OkaeriConfig implements SkillFile {
public final class CombatConfig extends OkaeriConfig {
public String id = "combat";
public boolean enabled = true;
public String displayName = "Combat";
public List<String> description = Collections.singletonList("&7Earn xp by killing mobs!");
public int maxLevel = 50;

private Map<Integer, Double> xpRequirements = getLevelsMap();
private Map<Integer, List<String>> skillInfoInGUI = getInfo();
private Map<Integer, List<StatReward>> statRewards = getRewards();
private Map<Integer, List<StatReward>> statRewards = getInternalRewards();
private Map<Integer, List<String>> skillInfoInMessage = getInfo();
private Map<Integer, List<CommandReward>> commandRewards = new HashMap<>();

private Map<EntityType, Double> rewards = ImmutableMap.<EntityType, Double>builder()
.put(EntityType.ZOMBIE, 2D)
.put(EntityType.CREEPER, 3D)
.put(EntityType.ENDERMAN, 4D)
.build();
private GUIOptions guiOptions = GUIOptions.builder()
.slot(21)
.item(XMaterial.PLAYER_HEAD)
Expand Down Expand Up @@ -70,11 +73,7 @@ public Skill getSkill(){
.commandRewards(commandRewards)
.maxLevel(maxLevel)
.skillGUIOptions(guiOptions)
.rewards(ImmutableMap.<EntityType, Double>builder()
.put(EntityType.ZOMBIE, 2D)
.put(EntityType.CREEPER, 3D)
.put(EntityType.ENDERMAN, 4D)
.build())
.rewards(rewards)
.build();
}

Expand All @@ -101,7 +100,7 @@ private Map<Integer, List<String>> getInfo(){
.build();
}

private Map<Integer, List<StatReward>> getRewards(){
private Map<Integer, List<StatReward>> getInternalRewards(){
return FastMap.listBuilder(Integer.class, StatReward.class)
.put(1, Arrays.asList(new StatReward("critic_damage", 1), new StatReward("critic_chance", 1), new StatReward("one_punch_man", 1), new StatReward("spiderman", 1)))
.put(10, Arrays.asList(new StatReward("critic_damage", 2), new StatReward("critic_chance", 2), new StatReward("one_punch_man", 1), new StatReward("spiderman", 1)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
@Header(" Discoverer ")
@Header("================================")
@Names(strategy = NameStrategy.HYPHEN_CASE, modifier = NameModifier.TO_LOWER_CASE)
public final class DiscovererConfig extends OkaeriConfig implements SkillFile {
public final class DiscovererConfig extends OkaeriConfig {
public String id = "discoverer";
public boolean enabled = true;
public String displayName = "Discoverer";
public List<String> description = Collections.singletonList("&7Earn xp discovering the world!");
public int maxLevel = 50;
private Map<Integer, Double> xpRequirements = getLevelsMap();
private Map<Integer, List<String>> skillInfoInGUI = getInfo();
private Map<Integer, List<StatReward>> statRewards = getRewards();
private Map<Integer, List<StatReward>> statRewards = getInternalRewards();
private Map<Integer, List<String>> skillInfoInMessage = getInfo();
private Map<Integer, List<CommandReward>> commandRewards = new HashMap<>();
private GUIOptions guiOptions = GUIOptions.builder()
Expand Down Expand Up @@ -97,7 +97,7 @@ private Map<Integer, List<String>> getInfo(){
.build();
}

private Map<Integer, List<StatReward>> getRewards(){
private Map<Integer, List<StatReward>> getInternalRewards(){
return FastMap.listBuilder(Integer.class, StatReward.class)
.put(1, Arrays.asList(new StatReward("speed", 1), new StatReward("ferocity", 1), new StatReward("leaves_master", 1), new StatReward("cactus_skin", 1)))
.put(10, Arrays.asList(new StatReward("speed", 2), new StatReward("ferocity", 2), new StatReward("leaves_master", 1), new StatReward("cactus_skin", 1)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
@Header(" Dungeoneering ")
@Header("================================")
@Names(strategy = NameStrategy.HYPHEN_CASE, modifier = NameModifier.TO_LOWER_CASE)
public final class DungeoneeringConfig extends OkaeriConfig implements SkillFile {
public final class DungeoneeringConfig extends OkaeriConfig {

public String id = "dungeoneering";
public boolean enabled = true;
Expand All @@ -35,7 +35,7 @@ public final class DungeoneeringConfig extends OkaeriConfig implements SkillFile
public int maxLevel = 50;
private Map<Integer, Double> xpRequirements = getLevelsMap();
private Map<Integer, List<String>> skillInfoInGUI = getInfo();
private Map<Integer, List<StatReward>> statRewards = getRewards();
private Map<Integer, List<StatReward>> statRewards = getInternalRewards();
private Map<Integer, List<String>> skillInfoInMessage = getInfo();
private Map<Integer, List<CommandReward>> commandRewards = new HashMap<>();

Expand Down Expand Up @@ -101,7 +101,7 @@ private Map<Integer, List<String>> getInfo(){
.build();
}

private Map<Integer, List<StatReward>> getRewards(){
private Map<Integer, List<StatReward>> getInternalRewards(){
return new HashMap<>();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@Header(" Enchanting ")
@Header("================================")
@Names(strategy = NameStrategy.HYPHEN_CASE, modifier = NameModifier.TO_LOWER_CASE)
public final class EnchantingConfig extends OkaeriConfig implements SkillFile {
public final class EnchantingConfig extends OkaeriConfig {

public String id = "enchanting";
public boolean enabled = true;
Expand All @@ -36,7 +36,7 @@ public final class EnchantingConfig extends OkaeriConfig implements SkillFile {
public int maxLevel = 50;
private Map<Integer, Double> xpRequirements = getLevelsMap();
private Map<Integer, List<String>> skillInfoInGUI = getInfo();
private Map<Integer, List<StatReward>> statRewards = getRewards();
private Map<Integer, List<StatReward>> statRewards = getInternalRewards();
private Map<Integer, List<String>> skillInfoInMessage = getInfo();
private Map<Integer, List<CommandReward>> commandRewards = new HashMap<>();

Expand Down Expand Up @@ -104,7 +104,7 @@ private Map<Integer, List<String>> getInfo(){
.build();
}

private Map<Integer, List<StatReward>> getRewards(){
private Map<Integer, List<StatReward>> getInternalRewards(){
return FastMap.listBuilder(Integer.class, StatReward.class)
.put(1, Arrays.asList(new StatReward("intelligence", 1), new StatReward("defense", 1), new StatReward("enchantment_master", 1), new StatReward("orb_master", 1)))
.put(10, Arrays.asList(new StatReward("intelligence", 2), new StatReward("defense", 2), new StatReward("enchantment_master", 1), new StatReward("orb_master", 1)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,43 @@
import com.qualityplus.assistant.lib.eu.okaeri.configs.annotation.NameStrategy;
import com.qualityplus.assistant.lib.eu.okaeri.configs.annotation.Names;
import com.qualityplus.assistant.lib.eu.okaeri.platform.core.annotation.Configuration;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.*;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Configuration(path = "skills/farming_skill.yml")
@Header("================================")
@Header(" Farming ")
@Header("================================")
@Names(strategy = NameStrategy.HYPHEN_CASE, modifier = NameModifier.TO_LOWER_CASE)
public final class FarmingConfig extends OkaeriConfig implements SkillFile {
public final class FarmingConfig extends OkaeriConfig {
public String id = "farming";
public boolean enabled = true;
public String displayName = "Farming";
public List<String> description = Collections.singletonList("&7Harvest Crops to earn xp!");
public int maxLevel = 50;
private Map<Integer, Double> xpRequirements = getLevelsMap();
private Map<Integer, List<String>> skillInfoInGUI = getInfo();
private Map<Integer, List<StatReward>> statRewards = getRewards();
private Map<Integer, List<StatReward>> statRewards = getInternalRewards();
private Map<Integer, List<String>> skillInfoInMessage = getInfo();
private Map<Integer, List<CommandReward>> commandRewards = new HashMap<>();
private Map<XMaterial, Double> rewards = ImmutableMap.<XMaterial, Double>builder()
.put(XMaterial.WHEAT, 2D)
.put(XMaterial.CARROTS, 4D)
.put(XMaterial.POTATOES, 5D)
.build();
private Map<XMaterial, Double> minionXpRewards = ImmutableMap.<XMaterial, Double>builder()
.put(XMaterial.WHEAT, 2D)
.put(XMaterial.CARROTS, 4D)
.put(XMaterial.POTATOES, 5D)
.build();

private GUIOptions guiOptions = GUIOptions.builder()
.slot(24)
Expand Down Expand Up @@ -69,16 +83,8 @@ public Skill getSkill(){
.commandRewards(commandRewards)
.maxLevel(maxLevel)
.skillGUIOptions(guiOptions)
.rewards(ImmutableMap.<XMaterial, Double>builder()
.put(XMaterial.WHEAT, 2D)
.put(XMaterial.CARROTS, 4D)
.put(XMaterial.POTATOES, 5D)
.build())
.minionXpRewards(ImmutableMap.<XMaterial, Double>builder()
.put(XMaterial.WHEAT, 2D)
.put(XMaterial.CARROTS, 4D)
.put(XMaterial.POTATOES, 5D)
.build())
.rewards(rewards)
.minionXpRewards(minionXpRewards)
.build();
}

Expand All @@ -105,7 +111,7 @@ private Map<Integer, List<String>> getInfo(){
.build();
}

private Map<Integer, List<StatReward>> getRewards(){
private Map<Integer, List<StatReward>> getInternalRewards(){
return FastMap.listBuilder(Integer.class, StatReward.class)
.put(1, Arrays.asList(new StatReward("strength", 1), new StatReward("critic_damage", 1), new StatReward("farming_fortune", 1), new StatReward("eagle_eyes", 1)))
.put(10, Arrays.asList(new StatReward("strength", 2), new StatReward("critic_damage", 2), new StatReward("farming_fortune", 1), new StatReward("eagle_eyes", 1)))
Expand Down

0 comments on commit 50884eb

Please sign in to comment.