From 07699fa651f9c80e34fcce7c2e7a376d9121e85c Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sat, 3 Mar 2012 12:43:50 -0800 Subject: [PATCH] Excavation ? WIP --- .../java/com/gmail/nossr50/commands/party/PtpCommand.java | 2 +- .../gmail/nossr50/commands/skills/ExcavationCommand.java | 1 - .../com/gmail/nossr50/commands/skills/MiningCommand.java | 5 ++++- src/main/java/com/gmail/nossr50/util/Page.java | 8 ++++---- src/main/resources/locale/locale_en_us.properties | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java b/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java index 6eaafa1bc..bb8e50692 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java @@ -54,4 +54,4 @@ public class PtpCommand implements CommandExecutor { return true; } -} +} \ No newline at end of file diff --git a/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java index 86e44a299..dc990ef1f 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java @@ -30,7 +30,6 @@ public class ExcavationCommand implements CommandExecutor { ticks++; } - player.sendMessage(""); player.sendMessage(mcLocale.getString("m.SkillHeader", new Object[] { mcLocale.getString("m.SkillExcavation") })); player.sendMessage(mcLocale.getString("m.XPGain", new Object[] { mcLocale.getString("m.XPGainExcavation") })); diff --git a/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java index e431666b1..441fea609 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java @@ -10,6 +10,7 @@ import com.gmail.nossr50.mcPermissions; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.locale.mcLocale; +import com.gmail.nossr50.util.Page; public class MiningCommand implements CommandExecutor { @Override @@ -123,7 +124,9 @@ public class MiningCommand implements CommandExecutor { player.sendMessage(mcLocale.getString("m.AbilityLockTemplate", new Object[] { mcLocale.getString("m.AbilLockMining3") })); else player.sendMessage(mcLocale.getString("m.MiningDemolitionsExpertDamageDecrease", new Object[] { damage })); - + + Page.grabGuidePageForSkill(SkillType.MINING, player, args); + return true; } } diff --git a/src/main/java/com/gmail/nossr50/util/Page.java b/src/main/java/com/gmail/nossr50/util/Page.java index 1bcfa2fb5..eab289c81 100644 --- a/src/main/java/com/gmail/nossr50/util/Page.java +++ b/src/main/java/com/gmail/nossr50/util/Page.java @@ -14,7 +14,7 @@ public class Page { public static int getTotalPageNumber(String address) { String[] addressSplit = mcLocale.getString(address).split("\n"); - if(addressSplit.length < 8) + if(addressSplit.length <= 8) return 1; else return (addressSplit.length/8)+1; @@ -31,7 +31,7 @@ public class Page { } ArrayList allStrings = new ArrayList(); - String[] addressSplit = mcLocale.getString(address).split("\n"); + String split[] = mcLocale.getString(address).split("\n"); allStrings.add(ChatColor.GOLD+"-="+ChatColor.GREEN+header+ChatColor.GOLD+"=-"); //So stylish @@ -39,10 +39,10 @@ public class Page { while(allStrings.size() < 9) { - if(pageIndexStart+allStrings.size() > addressSplit.length) + if(pageIndexStart+allStrings.size() > split.length) allStrings.add(""); else - allStrings.add(addressSplit[pageIndexStart+allStrings.size()-1]); + allStrings.add(split[pageIndexStart+allStrings.size()-1]); } allStrings.add("Page "+pagenum+" of "+getTotalPageNumber(address)); diff --git a/src/main/resources/locale/locale_en_us.properties b/src/main/resources/locale/locale_en_us.properties index 8c0dcac2c..ca36cc7a1 100644 --- a/src/main/resources/locale/locale_en_us.properties +++ b/src/main/resources/locale/locale_en_us.properties @@ -414,4 +414,4 @@ Skills.SerratedStrikesPlayerOff=[[RED]]Serrated Strikes[[GREEN]] has worn off fo Skills.BlastMiningPlayer=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Blast Mining! Skills.YourBlastMining=[[GREEN]]Your [[YELLOW]]Blast Mining [[GREEN]]ability is refreshed! TreeFeller.AxeSplinters=[[RED]]YOUR AXE SPLINTERS INTO DOZENS OF PIECES -Guides.Excavation=XP GAIN:\n\nGain XP from soft materials with your shovel.\nMaterials include Grass, Dirt, Sand,\nGravel, Mycelium, and Clay\nTHIS IS PROOF\nOF CONCEPT\nTHIS IS PROOF\nOF CONCEPT\nTHIS IS PROOF\nOF CONCEPT\nTHIS IS PROOF\nOF CONCEPT\nTHIS IS PROOF\nOF CONCEPT\nTHIS IS PROOF\nOF CONCEPT\nTHIS IS PROOF\nOF CONCEPT\nTHIS IS PROOF\nOF CONCEPT\nTHIS IS PROOF\nOF CONCEPT\nTHIS IS PROOF\nOF CONCEPT\nTHIS IS PROOF\nOF CONCEPT\nTHIS IS PROOF\nOF CONCEPT\nTHIS IS PROOF\nOF CONCEPT\nTHIS IS PROOF\nOF CONCEPT\nTHIS IS PROOF\nOF CONCEPT\nTHIS IS PROOF\nOF CONCEPT\nTHIS IS PROOF\nOF CONCEPT\nTHIS IS PROOF\nOF CONCEPT\nTHIS IS PROOF\nOF CONCEPT\nTHIS IS PROOF\nOF CONCEPT\nTHIS IS PROOF\nOF CONCEPT\nTHIS IS PROOF\nOF CONCEPT\nTHE END \ No newline at end of file +Guides.Excavation=[[DARK_AQUA]]About Excavation:\n[[YELLOW]]Excavation is the act of digging up dirt to find treasures.\n[[YELLOW]]In the process of excavating the land you will find treasures\n[[YELLOW]]The more you do this the better treasures you will find.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill you must dig with a shovel in hand\n[[YELLOW]]only certain materials can be dug up for treasures and XP.\n[[DARK_AQUA]]Compatible Materials:\n[[YELLOW]]Grass, Dirt, Sand, Clay, Gravel, Mycelium, Soul Sand\n\n[[DARK_AQUA]]How to use Giga Drill Breaker:\n[[YELLOW]]With a shovel in hand right click to ready your tool.\n[[YELLOW]]Once in this state you have about 4 seconds to make\n[[YELLOW]]contact with Excavation compatible materials this will\n[[YELLOW]]activate Giga Drill Breaker.\n[[DARK_AQUA]]What is Giga Drill Breaker?\n[[YELLOW]]Giga Drill Breaker is an ability with a cooldown\n[[YELLOW]]tied to Excavation skill. It triples your chance\n[[YELLOW]]of finding treasures and enables instant break\n[[YELLOW]] on Excavation materials.\n\n[[DARK_AQUA]]How does Treasure Hunter work?\n[[YELLOW]]Every possible treasure for Excavation has its own\n[[YELLOW]]skill level requirement for it to drop, as a result\n[[YELLOW]]it's hard to say how much it is helping you.\n[[YELLOW]]Just keep in mind that the higher your\n[[YELLOW]]Excavation skill is, the more treasures can be found.\n[[YELLOW]]And also keep in mind that each type of\n[[YELLOW]]Excavation compatible material has its own[[YELLOW]]unique list of treasures.\n[[YELLOW]]In other words you will find different treasures in Dirt\n[[YELLOW]]than in Gravel. \ No newline at end of file