mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 14:24:35 +00:00
Add CraftTweaker infuseType command
This commit is contained in:
3 files changed
+42
-9
No files matched your search
@@ -6,7 +6,8 @@ import crafttweaker.mc1120.commands.CTChatCommand;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.integration.crafttweaker.gas.GasesCommand;
|
||||
import mekanism.common.integration.crafttweaker.commands.GasesCommand;
|
||||
import mekanism.common.integration.crafttweaker.commands.InfuseTypesCommand;
|
||||
|
||||
public class CrafttweakerIntegration {
|
||||
|
||||
@@ -39,5 +40,6 @@ public class CrafttweakerIntegration {
|
||||
|
||||
public static void registerCommands() {
|
||||
CTChatCommand.registerCommand(new GasesCommand());
|
||||
CTChatCommand.registerCommand(new InfuseTypesCommand());
|
||||
}
|
||||
}
|
||||
+6
-8
@@ -1,11 +1,8 @@
|
||||
package mekanism.common.integration.crafttweaker.gas;
|
||||
|
||||
import static crafttweaker.mc1120.commands.SpecialMessagesChat.getClickableCommandText;
|
||||
import static crafttweaker.mc1120.commands.SpecialMessagesChat.getLinkToCraftTweakerLog;
|
||||
import static crafttweaker.mc1120.commands.SpecialMessagesChat.getNormalMessage;
|
||||
package mekanism.common.integration.crafttweaker.commands;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.mc1120.commands.CraftTweakerCommand;
|
||||
import crafttweaker.mc1120.commands.SpecialMessagesChat;
|
||||
import java.util.List;
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasRegistry;
|
||||
@@ -21,8 +18,8 @@ public class GasesCommand extends CraftTweakerCommand {
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
setDescription(getClickableCommandText(TextFormatting.DARK_GREEN + "/ct " + subCommandName,
|
||||
"/ct " + subCommandName, true), getNormalMessage(TextFormatting.DARK_AQUA +
|
||||
setDescription(SpecialMessagesChat.getClickableCommandText(TextFormatting.DARK_GREEN + "/ct " + subCommandName,
|
||||
"/ct " + subCommandName, true), SpecialMessagesChat.getNormalMessage(TextFormatting.DARK_AQUA +
|
||||
"Outputs a list of all registered gases to the crafttweaker.log"));
|
||||
}
|
||||
|
||||
@@ -32,6 +29,7 @@ public class GasesCommand extends CraftTweakerCommand {
|
||||
List<Gas> gases = GasRegistry.getRegisteredGasses();
|
||||
gases.forEach(
|
||||
gas -> CraftTweakerAPI.logCommand(String.format("<gas:%s>, %s", gas.getName(), gas.getLocalizedName())));
|
||||
sender.sendMessage(getLinkToCraftTweakerLog("List of " + gases.size() + " gases generated;", sender));
|
||||
sender.sendMessage(SpecialMessagesChat.getLinkToCraftTweakerLog(
|
||||
"List of " + gases.size() + " gases generated;", sender));
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package mekanism.common.integration.crafttweaker.commands;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.mc1120.commands.CraftTweakerCommand;
|
||||
import crafttweaker.mc1120.commands.SpecialMessagesChat;
|
||||
import java.util.Set;
|
||||
import mekanism.api.infuse.InfuseRegistry;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
public class InfuseTypesCommand extends CraftTweakerCommand {
|
||||
|
||||
public InfuseTypesCommand() {
|
||||
super("infuseTypes");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
setDescription(SpecialMessagesChat.getClickableCommandText(TextFormatting.DARK_GREEN + "/ct " + subCommandName,
|
||||
"/ct " + subCommandName, true), SpecialMessagesChat.getNormalMessage(TextFormatting.DARK_AQUA +
|
||||
"Outputs a list of all registered metallurgic infuser infusion types to the crafttweaker.log"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void executeCommand(MinecraftServer server, ICommandSender sender, String[] args) {
|
||||
CraftTweakerAPI.logCommand("Infuse Types:");
|
||||
Set<String> names = InfuseRegistry.getInfuseMap().keySet();
|
||||
names.forEach(CraftTweakerAPI::logCommand);
|
||||
sender.sendMessage(SpecialMessagesChat.getLinkToCraftTweakerLog("List of " + names.size() +
|
||||
" metallurgic infuser infusion types generated;", sender));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user