summaryrefslogtreecommitdiff
path: root/src/main/java/net/uomc/mineshaft/Mineshaft.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/uomc/mineshaft/Mineshaft.java')
-rw-r--r--src/main/java/net/uomc/mineshaft/Mineshaft.java105
1 files changed, 83 insertions, 22 deletions
diff --git a/src/main/java/net/uomc/mineshaft/Mineshaft.java b/src/main/java/net/uomc/mineshaft/Mineshaft.java
index ebdcf21..1584529 100644
--- a/src/main/java/net/uomc/mineshaft/Mineshaft.java
+++ b/src/main/java/net/uomc/mineshaft/Mineshaft.java
@@ -1,6 +1,9 @@
package net.uomc.mineshaft;
import net.uomc.mineshaft.crafting.Crafting;
+import net.uomc.mineshaft.farm.CompostCommand;
+import net.uomc.mineshaft.farm.FarmCommand;
+import net.uomc.mineshaft.farm.TradeCommand;
import net.uomc.mineshaft.resources.Resource;
import java.io.IOException;
import java.util.Arrays;
@@ -29,6 +32,7 @@ import com.mouldycheerio.dbot.util.PeelingUtils;
import net.dv8tion.jda.api.entities.Member;
import net.uomc.mineshaft.resources.ResourceManager;
+import net.uomc.mineshaft.resources.market.MarketCommand;
public class Mineshaft extends CustomBot {
@@ -38,6 +42,7 @@ public class Mineshaft extends CustomBot {
private Pickaxes pickaxes;
private Crafting crafting;
private MineCommand mineCommand;
+ private EnchantCommand enchantCommand;
public Mineshaft(JSONObject config) throws LoginException, JSONException, IOException, InterruptedException {
super(config);
@@ -54,15 +59,21 @@ public class Mineshaft extends CustomBot {
resourceManager = new ResourceManager(this);
+ getCommandController().addCommand(new MarketCommand(resourceManager.getMarketManager()));
getCommandController().addCommand(new DailyCommand(this));
- getCommandController().addCommand(new EnchantCommand(this));
+
+ enchantCommand = new EnchantCommand(this);
+ getCommandController().addCommand(enchantCommand);
getCommandController().addCommand(new FurnaceCommand(this));
getCommandController().addCommand(new PickaxeCommand(this));
+ getCommandController().addCommand(new Portal(this));
+
mineCommand = new MineCommand(this);
getCommandController().addCommand(mineCommand);
getCommandController().addCommand(new FishCommand(this));
getCommandController().addCommand(new RobCommand(this));
+ getCommandController().addCommand(new TradeCommand(this));
getCommandController().removeCommand("help");
@@ -74,7 +85,7 @@ public class Mineshaft extends CustomBot {
notes.append("Upgrade your **pickaxe** and find new ores `m!pickaxe`\n");
notes.append("**Craft** new items `m!craft`\n");
notes.append("Fight other players! `m!pvp`\n");
- notes.append("Share your resources `m!give`\n");
+ notes.append("Trade your resources `m!market` and `m!give`\n");
notes.append("Become the **top** valuable player `m!top`\n");
notes.append("\nGet free **daily** ores with `m!daily`\n");
@@ -85,26 +96,59 @@ public class Mineshaft extends CustomBot {
// TODO update when changes
String title = "Patch Notes";
StringBuilder notes = new StringBuilder();
- notes.append("### v0.3.1\n");
- notes.append("- Added furnace crafting recipe\n");
- notes.append("- Added `m!daily` to get daily commands\n");
- notes.append("- Balanced amount of ores needed to upgrade pickaxe\n");
- notes.append("- Fix obsidian not spawning\n");
- notes.append("- Added `m!cooldowns`\n");
- notes.append("### v0.3\n");
- notes.append("- Added items for all ores `m!inventory`\n");
- notes.append("- Added pickaxe levels `m!pickaxe`\n");
- notes.append(" - Pickaxe can be upgraded, giving access to better ores (`m!pickaxe upgrade`)\n");
- notes.append("- Added enchanting `m!enchant`\n");
- notes.append(" - Your pickaxe can be enchanted by spending lapis and xp\n");
- notes.append(" - Owning bookshelves gives you a discount on the amount of levels it costs to enchant\n");
- notes.append("- Added crafting `m!craft`\n");
- notes.append(" - Enchanting table and books can now be crafted!\n");
- notes.append("- Fishing now drops books\n");
- notes.append("- Rob has been relaced with `m!kill`\n");
- notes.append(" - Killing a player will drop some of their items\n");
- notes.append("- Added obsidian\n");
- notes.append("- Removed `m!flip`, this will be added in a future update (with a new mechanic)\n");
+ notes.append("### v0.5.2\n");
+ notes.append("- Fix trader giving impossible item prices\n");
+ notes.append("- Items can only be given to players who are in the same dimension\n");
+ notes.append("### v0.5.1\n");
+ notes.append("- Kill only works if you are in the same dimension as the other player\n");
+ notes.append("- Farm cannot be accessed from the nether\n");
+ notes.append("- Added `m!top pickaxes`\n");
+ notes.append("### v0.5\n");
+ notes.append("- Added compostor\n");
+ notes.append(" - compost items with `m!compost`\n");
+ notes.append(" - The more compostors you own, the more items you can compost at a time\n");
+ notes.append("- Added farming `m!farm`\n");
+ notes.append(" - Crops can be planted and harvested\n");
+ notes.append(" - Size of farm can be expanded with bone meal\n");
+ notes.append("- Added villager item\n");
+ notes.append(" - Villagers allow you to trade with the wandering trader `m!trade`\n");
+ notes.append("- Added Carrots, Potatos and Sugar cane\n");
+ notes.append("- Added `m!top [item]` to list who has the most of an item\n");
+ notes.append("- Fixed `m!daily`\n");
+ notes.append("- Fixed typos\n");
+ notes.append("### v0.4\n");
+ notes.append("- Added nether\n");
+ notes.append(" - 10 obsidian can now be used to craft a portal\n");
+ notes.append(" - Nether spawns new ores \n");
+ notes.append("- Netherite pickaxe is now achievable\n");
+ notes.append("- Fishing will have a chance to give you string\n");
+ notes.append("- String can be crafted into wool and beds\n");
+ notes.append("- Added Efficiency enchantment\n");
+ notes.append(" - Further increases spawn rates of rarer ores\n");
+ notes.append("- Enchantments are now applied to `m!daily`'s loot\n");
+ notes.append("- Furnace can now be accessed every 30 minutes\n");
+ notes.append("- Added `m!market` for trading items\n");
+ notes.append("- Fix `m!give` to work properly\n");
+ //notes.append("### v0.3.1\n");
+ //notes.append("- Added furnace crafting recipe\n");
+ //notes.append("- Added `m!daily` to get daily commands\n");
+ //notes.append("- Balanced amount of ores needed to upgrade pickaxe\n");
+ //notes.append("- Fix obsidian not spawning\n");
+ //notes.append("- Added `m!cooldowns`\n");
+ //notes.append("### v0.3\n");
+ //notes.append("- Added items for all ores `m!inventory`\n");
+ //notes.append("- Added pickaxe levels `m!pickaxe`\n");
+ //notes.append(" - Pickaxe can be upgraded, giving access to better ores (`m!pickaxe upgrade`)\n");
+ //notes.append("- Added enchanting `m!enchant`\n");
+ //notes.append(" - Your pickaxe can be enchanted by spending lapis and xp\n");
+ //notes.append(" - Owning bookshelves gives you a discount on the amount of levels it costs to enchant\n");
+ //notes.append("- Added crafting `m!craft`\n");
+ //notes.append(" - Enchanting table and books can now be crafted!\n");
+ //notes.append("- Fishing now drops books\n");
+ //notes.append("- Rob has been relaced with `m!kill`\n");
+ //notes.append(" - Killing a player will drop some of their items\n");
+ //notes.append("- Added obsidian\n");
+ //notes.append("- Removed `m!flip`, this will be added in a future update (with a new mechanic)\n");
sendMessage(e, title, notes.toString());
});
@@ -142,6 +186,15 @@ public class Mineshaft extends CustomBot {
b.sendMessage(e, "Active cooldowns", cooldowns.toString());
});
+ getCommandController().removeCommand("top");
+ getCommandController().addCommand(new MineshaftLeaderBoardCommand(this));
+
+ getCommandController().removeCommand("give");
+ getCommandController().addCommand(new MineshaftGiveResourcesCommand(this));
+
+ getCommandController().addCommand(new FarmCommand(this));
+ getCommandController().addCommand(new CompostCommand(this));
+
logger = new FullLogger(this);
}
@@ -269,4 +322,12 @@ public class Mineshaft extends CustomBot {
return Collections.unmodifiableMap(lacking);
}
+
+ public Crafting getCrafting() {
+ return crafting;
+ }
+
+ public EnchantCommand getEnchantCommand() {
+ return enchantCommand;
+ }
}