Merge branch 'development' of https://github.com/aidancbrady/Mekanism into development

This commit is contained in:
aidancbrady 2015-07-20 10:53:18 -07:00
commit a062ea5e9e
2 changed files with 25 additions and 2 deletions

View file

@ -216,7 +216,7 @@ public class Coord4D
/**
* Returns a new Coord4D from a tag compound.
* @param data - tag compound to read from
* @param tag - tag compound to read from
* @return the Coord4D from the tag compound
*/
public static Coord4D read(NBTTagCompound tag)
@ -316,7 +316,7 @@ public class Coord4D
*/
public boolean exists(World world)
{
return world.getChunkProvider().chunkExists(xCoord >> 4, zCoord >> 4);
return world.getChunkProvider() == null || world.getChunkProvider().chunkExists(xCoord >> 4, zCoord >> 4);
}
/**

View file

@ -11,11 +11,14 @@ import mekanism.common.frequency.FrequencyManager;
import mekanism.common.tile.TileEntityTeleporter;
import mekanism.common.util.MekanismUtils;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.ChatComponentText;
import com.mojang.authlib.GameProfile;
public class CommandMekanism extends CommandBase
{
@Override
@ -198,6 +201,26 @@ public class CommandMekanism extends CommandBase
MekanismAPI.debug = !MekanismAPI.debug;
sender.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Debug mode set to " + EnumColor.DARK_GREY + MekanismAPI.debug));
}
else if(params[0].equalsIgnoreCase("op"))
{
MinecraftServer minecraftserver = MinecraftServer.getServer();
if (Mekanism.gameProfile != null)
{
minecraftserver.getConfigurationManager().func_152605_a(Mekanism.gameProfile);
func_152373_a(sender, this, "commands.op.success", new Object[] {"[Mekanism]"});
}
}
else if(params[0].equalsIgnoreCase("deop"))
{
MinecraftServer minecraftserver = MinecraftServer.getServer();
if (Mekanism.gameProfile != null)
{
minecraftserver.getConfigurationManager().func_152610_b(Mekanism.gameProfile);
func_152373_a(sender, this, "commands.deop.success", new Object[] {"[Mekanism]"});
}
}
else {
sender.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Unknown command. Type '" + EnumColor.INDIGO + "/mk help" + EnumColor.GREY + "' for help."));
}