- Use book for message fixes
This commit is contained in:
1 parent
e04f24b412
commit
f6b843615d
5 files changed
+18
-12
No files matched your search
@@ -1,3 +1,3 @@
|
|||||||
artifactId=NeoPerformance-LEGACY
|
artifactId=NeoPerformance-LEGACY
|
||||||
groupId=com.neomechanical
|
groupId=com.neomechanical
|
||||||
version=1.15.4
|
version=1.15.5
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
artifactId=NeoPerformance-NONLEGACY
|
artifactId=NeoPerformance-NONLEGACY
|
||||||
groupId=com.neomechanical
|
groupId=com.neomechanical
|
||||||
version=1.15.4
|
version=1.15.5
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
artifactId=NeoPerformance-abstraction
|
artifactId=NeoPerformance-abstraction
|
||||||
groupId=com.neomechanical
|
groupId=com.neomechanical
|
||||||
version=1.15.4
|
version=1.15.5
|
||||||
+14
-8
@@ -4,6 +4,7 @@ import com.neomechanical.neoconfig.neoutils.commands.Command;
|
|||||||
import com.neomechanical.neoconfig.neoutils.messages.MessageUtil;
|
import com.neomechanical.neoconfig.neoutils.messages.MessageUtil;
|
||||||
import com.neomechanical.neoperformance.NeoPerformance;
|
import com.neomechanical.neoperformance.NeoPerformance;
|
||||||
import com.neomechanical.neoperformance.performance.modules.insight.InsightManager;
|
import com.neomechanical.neoperformance.performance.modules.insight.InsightManager;
|
||||||
|
import com.neomechanical.neoperformance.performance.modules.insight.elements.InsightElement;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@@ -46,17 +47,22 @@ public class InsightsFixCommand extends Command {
|
|||||||
}
|
}
|
||||||
String categoryObtained = strings[2];
|
String categoryObtained = strings[2];
|
||||||
if (categoryObtained.equals("all")) {
|
if (categoryObtained.equals("all")) {
|
||||||
InsightManager insightManager = new InsightManager();
|
HashMap<String, HashMap<String, InsightElement<?>>> insightMap = new InsightManager().getInsightsMap();
|
||||||
if (insightManager.getInsightsMap().isEmpty()) {
|
|
||||||
|
boolean fixedElement = false;
|
||||||
|
insightMap.forEach((category, categoryInsights) ->
|
||||||
|
categoryInsights.entrySet().stream()
|
||||||
|
.filter(entry -> entry.getValue().isAutomatic)
|
||||||
|
.forEach(entry -> {
|
||||||
|
InsightElement<?> insightElement = entry.getValue();
|
||||||
|
insightElement.fix((Player) commandSender);
|
||||||
|
MessageUtil.sendMM(commandSender, NeoPerformance.getLanguageManager().getString("insights.fixed", null) + " " + entry.getKey());
|
||||||
|
})
|
||||||
|
);
|
||||||
|
if (!fixedElement) {
|
||||||
MessageUtil.sendMM(commandSender, NeoPerformance.getLanguageManager().getString("insights.noElements", null));
|
MessageUtil.sendMM(commandSender, NeoPerformance.getLanguageManager().getString("insights.noElements", null));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
insightManager.getInsightsMap().forEach((category, categoryInsights) -> categoryInsights.forEach((insightName, insightElement) -> {
|
|
||||||
if (insightElement.isAutomatic) {
|
|
||||||
insightElement.fix((Player) commandSender);
|
|
||||||
MessageUtil.sendMM(commandSender, NeoPerformance.getLanguageManager().getString("insights.fixed", null) + " " + insightName);
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
MessageUtil.sendMM(commandSender, NeoPerformance.getLanguageManager().getString("insights.fixAutomaticDone", null));
|
MessageUtil.sendMM(commandSender, NeoPerformance.getLanguageManager().getString("insights.fixAutomaticDone", null));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name: NeoPerformance
|
name: NeoPerformance
|
||||||
version: '1.15.4'
|
version: '1.15.5'
|
||||||
main: com.neomechanical.neoperformance.NeoPerformance
|
main: com.neomechanical.neoperformance.NeoPerformance
|
||||||
load: POSTWORLD
|
load: POSTWORLD
|
||||||
authors:
|
authors:
|
||||||
|
|||||||
Reference in new issue
Block a user