This commit is contained in:
Adrian 2015-08-09 13:14:45 +02:00
parent 0d9946a4ce
commit 1d7ea6e729
11 changed files with 39 additions and 44 deletions

View file

@ -1,5 +1,6 @@
Improvements:
* [#2345] Finish adding command localization (asie, warlordjones)
* Flood Gates now have configurable sides. No idea when I fixed that, but it works now. (asie)
* Lists
* Lists now accept empty Lists for sorting (asie)

View file

@ -286,7 +286,8 @@ public class BuildCraftEnergy extends BuildCraftMod {
BuildcraftFuelRegistry.fuel.addFuel(fluidFuel, fuelFuelEnergyOutput, (int) (25000 * fuelFuelMultiplier));
BuildcraftFuelRegistry.coolant.addCoolant(FluidRegistry.WATER, 0.0023f);
BuildcraftFuelRegistry.coolant.addSolidCoolant(StackKey.stack(Blocks.ice), StackKey.fluid(FluidRegistry.WATER), 2f);
BuildcraftFuelRegistry.coolant.addSolidCoolant(StackKey.stack(Blocks.ice), StackKey.fluid(FluidRegistry.WATER), 1.5f);
BuildcraftFuelRegistry.coolant.addSolidCoolant(StackKey.stack(Blocks.packed_ice), StackKey.fluid(FluidRegistry.WATER), 2.0f);
BuildCraftCore.engineBlock.registerTile(TileEngineStone.class, "tile.engineStone");
BuildCraftCore.engineBlock.registerTile(TileEngineIron.class, "tile.engineIron");

View file

@ -24,7 +24,7 @@ import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.MathHelper;
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraftforge.common.ForgeChunkManager;
@ -541,11 +541,9 @@ public class TileQuarry extends TileAbstractBuilder implements IHasWork, ISidedI
if (chunkTicket != null) {
if (xSize < 3 || zSize < 3 || ((xSize * zSize) >> 8) >= chunkTicket.getMaxChunkListDepth()) {
if (placedBy != null) {
placedBy.addChatMessage(new ChatComponentText(
String.format(
"Quarry size is outside of chunkloading bounds or too small %d %d (%d)",
placedBy.addChatMessage(new ChatComponentTranslation("chat.buildcraft.quarry.tooSmall",
xSize, zSize,
chunkTicket.getMaxChunkListDepth())));
chunkTicket.getMaxChunkListDepth()));
}
a = new DefaultAreaProvider(xCoord, yCoord, zCoord, xCoord + 10, yCoord + 4, zCoord + 10);
@ -622,7 +620,7 @@ public class TileQuarry extends TileAbstractBuilder implements IHasWork, ISidedI
stream.writeDouble(headPosY);
stream.writeDouble(headPosZ);
stream.writeFloat((float) speed);
stream.writeFloat((float) headTrajectory);
stream.writeFloat(headTrajectory);
int flags = stage.ordinal();
flags |= movingHorizontally ? 0x10 : 0;
flags |= movingVertically ? 0x20 : 0;
@ -842,10 +840,9 @@ public class TileQuarry extends TileAbstractBuilder implements IHasWork, ISidedI
}
if (placedBy != null && !(placedBy instanceof FakePlayer)) {
placedBy.addChatMessage(new ChatComponentText(
String.format(
"[BUILDCRAFT] The quarry at %d %d %d will keep %d chunks loaded",
xCoord, yCoord, zCoord, chunks.size())));
placedBy.addChatMessage(new ChatComponentTranslation(
"chat.buildcraft.quarry.chunkloadInfo",
xCoord, yCoord, zCoord, chunks.size()));
}
}

View file

@ -14,9 +14,6 @@ import buildcraft.api.tiles.IDebuggable;
import buildcraft.core.lib.items.ItemBuildCraft;
import buildcraft.core.lib.utils.StringUtils;
/**
* Created by asie on 3/7/15.
*/
public class ItemDebugger extends ItemBuildCraft {
public ItemDebugger() {
super();

View file

@ -17,8 +17,9 @@ import java.util.ArrayList;
import net.minecraft.command.ICommandSender;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.event.FMLInterModComms;
import net.minecraftforge.common.config.Property;
@ -247,16 +248,16 @@ 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())));
sender.addChatMessage(new ChatComponentTranslation("command.buildcraft.changelog_header", getRecommendedVersion())
.setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GRAY).setBold(true)));
for (String updateLine : Version.getChangelog()) {
String colour = "\u00A79";
EnumChatFormatting format = EnumChatFormatting.BLUE;
if (updateLine.startsWith("*")) {
colour = "\u00A7f";
format = EnumChatFormatting.WHITE;
} else if (updateLine.trim().endsWith(":")) {
colour = "\u00A76";
format = EnumChatFormatting.GOLD;
}
sender.addChatMessage(new ChatComponentText(colour + updateLine));
sender.addChatMessage(new ChatComponentText(updateLine).setChatStyle(new ChatStyle().setColor(format)));
}
}

View file

@ -1,8 +1,9 @@
package buildcraft.core.command;
import net.minecraft.command.ICommandSender;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.StatCollector;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.EnumChatFormatting;
import buildcraft.core.Version;
import buildcraft.core.lib.commands.SubCommand;
@ -15,9 +16,8 @@ public class SubCommandVersion extends SubCommand {
@Override
public void processSubCommand(ICommandSender sender, String[] args) {
String colour = Version.isOutdated() ? "\u00A7c" : "\u00A7a";
sender.addChatMessage(new ChatComponentText(String.format(colour + StatCollector.translateToLocal("command.buildcraft.version"), Version.getVersion(),
CoreProxy.proxy.getMinecraftVersion(), Version.getRecommendedVersion())));
sender.addChatMessage(new ChatComponentTranslation("command.buildcraft.version", Version.getVersion(),
CoreProxy.proxy.getMinecraftVersion(), Version.getRecommendedVersion())
.setChatStyle(new ChatStyle().setColor(Version.isOutdated() ? EnumChatFormatting.RED : EnumChatFormatting.GREEN)));
}
}

View file

@ -25,7 +25,6 @@ public abstract class Transactor implements ITransactor {
public abstract int inject(ItemStack stack, ForgeDirection orientation, boolean doAdd);
public static ITransactor getTransactorFor(Object object) {
if (object instanceof ISidedInventory) {
return new TransactorSimple((ISidedInventory) object);
} else if (object instanceof IInventory) {

View file

@ -14,6 +14,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.common.util.ForgeDirection;
@ -47,13 +48,11 @@ public class TileEngineCreative extends TileEngineBase {
if (!(player instanceof FakePlayer)) {
if (BuildCraftCore.hidePowerNumbers) {
player.addChatMessage(new ChatComponentText(String.format(
StringUtils.localize("chat.pipe.power.iron.mode.numberless"),
StringUtils.localize("chat.pipe.power.iron.level." + powerMode.maxPower))));
player.addChatMessage(new ChatComponentTranslation("chat.pipe.power.iron.mode.numberless"
StringUtils.localize("chat.pipe.power.iron.level." + powerMode.maxPower)));
} else {
player.addChatMessage(new ChatComponentText(String.format(
StringUtils.localize("chat.pipe.power.iron.mode"),
powerMode.maxPower)));
player.addChatMessage(new ChatComponentTranslation("chat.pipe.power.iron.mode",
powerMode.maxPower));
}
}

View file

@ -10,7 +10,6 @@ package buildcraft.robotics;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.WeakHashMap;
@ -1343,7 +1342,7 @@ public class EntityRobot extends EntityRobotBase implements
@Override
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
int result = 0;
int result;
if (tank != null && !tank.isFluidEqual(resource)) {
return 0;
@ -1385,7 +1384,7 @@ public class EntityRobot extends EntityRobotBase implements
@Override
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
FluidStack result = null;
FluidStack result;
if (tank == null) {
result = null;

View file

@ -8,6 +8,9 @@
*/
package buildcraft.robotics.ai;
import java.util.HashSet;
import java.util.Set;
import net.minecraft.block.Block;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.item.ItemStack;
@ -23,7 +26,6 @@ import buildcraft.core.lib.utils.BlockUtils;
import buildcraft.core.proxy.CoreProxy;
public class AIRobotBreak extends AIRobot {
private BlockIndex blockToBreak;
private float blockDamage = 0;

View file

@ -14,6 +14,7 @@ import java.util.LinkedList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatComponentTranslation;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraftforge.common.util.FakePlayer;
@ -58,13 +59,11 @@ public class PipePowerIron extends Pipe<PipeTransportPower> {
}
if (getWorld().isRemote && !(player instanceof FakePlayer)) {
if (BuildCraftCore.hidePowerNumbers) {
player.addChatMessage(new ChatComponentText(String.format(
StringUtils.localize("chat.pipe.power.iron.mode.numberless"),
StringUtils.localize("chat.pipe.power.iron.level." + getMode().maxPower))));
player.addChatMessage(new ChatComponentTranslation("chat.pipe.power.iron.mode.numberless"
StringUtils.localize("chat.pipe.power.iron.level." + getMode().maxPower)));
} else {
player.addChatMessage(new ChatComponentText(String.format(
StringUtils.localize("chat.pipe.power.iron.mode"),
getMode().maxPower)));
player.addChatMessage(new ChatComponentTranslation("chat.pipe.power.iron.mode",
getMode().maxPower));
}
}