style changes, add /buildcraft changelog, add missing files

This commit is contained in:
Adrian 2015-05-07 19:26:13 +02:00
parent 44c9e6f56b
commit db002ea714
6 changed files with 52 additions and 11 deletions

View file

@ -99,7 +99,7 @@ public class BlockIndex implements Comparable<BlockIndex> {
return b.x == x && b.y == y && b.z == z;
}
return super.equals(obj);
return false;
}
@Override

View file

@ -496,5 +496,21 @@ bc_update.once=This message only displays once
bc_update.again=Type '/buildcraft version' if you want to see it again
command.buildcraft.version=BuildCraft %s for Minecraft %s (Latest: %s).
command.buildcraft.versioninfo=Version information.
command.buildcraft.available=Available Commands:
command.buildcraft.changelog_header=Changelog for BuildCraft %s:
command.buildcraft.aliases=Aliases: %s
command.buildcraft.help=Type '%s' for help.
command.buildcraft.list=Available Commands:
command.buildcraft.permlevel=Permission level: %s
command.buildcraft.noperms=You do not have permission to use this command.
command.buildcraft.buildcraft.help=Various BuildCraft-related commands
command.buildcraft.buildcraft.format=Format: /%s <sub-command>
command.buildcraft.buildcraft.version.desc=- %s : Version Information
command.buildcraft.buildcraft.version.help=Displays the current and latest BC version.
command.buildcraft.buildcraft.version.format=Format: /%s
command.buildcraft.buildcraft.changelog.desc=- %s : Changelog
command.buildcraft.buildcraft.changelog.help=Displays the latest BC chanelog.
command.buildcraft.buildcraft.changelog.format=Format: /%s

View file

@ -14,6 +14,7 @@ import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.util.UUID;
import buildcraft.core.command.SubCommandChangelog;
import buildcraft.core.command.SubCommandVersion;
import buildcraft.core.lib.commands.RootCommand;
import com.mojang.authlib.GameProfile;
@ -243,6 +244,7 @@ public class BuildCraftCore extends BuildCraftMod {
commandBuildcraft.addAlias("bc");
commandBuildcraft.addChildCommand(new SubCommandVersion());
commandBuildcraft.addChildCommand(new SubCommandChangelog());
BuildcraftRecipeRegistry.assemblyTable = AssemblyRecipeManager.INSTANCE;
BuildcraftRecipeRegistry.integrationTable = IntegrationRecipeManager.INSTANCE;

View file

@ -18,6 +18,8 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ChatComponentText;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.event.FMLInterModComms;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.config.Property;
import buildcraft.BuildCraftCore;
import buildcraft.api.core.BCLog;
@ -243,16 +245,17 @@ public class Version implements Runnable {
}
public static void displayChangelog(ICommandSender sender) {
sender.addChatMessage(new ChatComponentText(EnumChatFormatting.GRAY + "" + EnumChatFormatting.BOLD
+ StatCollector.translateToLocalFormatted("command.buildcraft.changelog_header", getRecommendedVersion())));
int nb = 0;
for (String updateLine : Version.getChangelog()) {
sender.addChatMessage(new ChatComponentText("\u00A79" + updateLine));
nb++;
if (nb > 3) {
sender.addChatMessage(new ChatComponentText("\u00A79[...]"));
break;
String colour = "\u00A79";
if (updateLine.startsWith("*")) {
colour = "\u00A7f";
} else if (updateLine.trim().endsWith(":")) {
colour = "\u00A76";
}
sender.addChatMessage(new ChatComponentText(colour + updateLine));
}
}

View file

@ -0,0 +1,19 @@
package buildcraft.core.command;
import buildcraft.core.Version;
import buildcraft.core.lib.commands.SubCommand;
import buildcraft.core.proxy.CoreProxy;
import net.minecraft.command.ICommandSender;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.StatCollector;
public class SubCommandChangelog extends SubCommand {
public SubCommandChangelog() {
super("changelog");
}
@Override
public void processSubCommand(ICommandSender sender, String[] args) {
Version.displayChangelog(sender);
}
}

View file

@ -77,7 +77,8 @@ public class CommandHelpers {
public static void printHelp(ICommandSender sender, IModCommand command) {
ChatStyle header = new ChatStyle();
header.setColor(EnumChatFormatting.BLUE);
header.setColor(EnumChatFormatting.GRAY);
header.setBold(true);
sendLocalizedChatMessage(sender, header, "command.buildcraft." + command.getFullCommandString().replace(" ", ".") + ".format", command.getFullCommandString());
ChatStyle body = new ChatStyle();
body.setColor(EnumChatFormatting.GRAY);