Merge branch 'development' of https://github.com/aidancbrady/Mekanism into development
This commit is contained in:
commit
a062ea5e9e
2 changed files with 25 additions and 2 deletions
|
@ -216,7 +216,7 @@ public class Coord4D
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a new Coord4D from a tag compound.
|
* 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
|
* @return the Coord4D from the tag compound
|
||||||
*/
|
*/
|
||||||
public static Coord4D read(NBTTagCompound tag)
|
public static Coord4D read(NBTTagCompound tag)
|
||||||
|
@ -316,7 +316,7 @@ public class Coord4D
|
||||||
*/
|
*/
|
||||||
public boolean exists(World world)
|
public boolean exists(World world)
|
||||||
{
|
{
|
||||||
return world.getChunkProvider().chunkExists(xCoord >> 4, zCoord >> 4);
|
return world.getChunkProvider() == null || world.getChunkProvider().chunkExists(xCoord >> 4, zCoord >> 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -11,11 +11,14 @@ import mekanism.common.frequency.FrequencyManager;
|
||||||
import mekanism.common.tile.TileEntityTeleporter;
|
import mekanism.common.tile.TileEntityTeleporter;
|
||||||
import mekanism.common.util.MekanismUtils;
|
import mekanism.common.util.MekanismUtils;
|
||||||
import net.minecraft.command.CommandBase;
|
import net.minecraft.command.CommandBase;
|
||||||
|
import net.minecraft.command.CommandException;
|
||||||
import net.minecraft.command.ICommandSender;
|
import net.minecraft.command.ICommandSender;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraft.util.ChatComponentText;
|
import net.minecraft.util.ChatComponentText;
|
||||||
|
|
||||||
|
import com.mojang.authlib.GameProfile;
|
||||||
|
|
||||||
public class CommandMekanism extends CommandBase
|
public class CommandMekanism extends CommandBase
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
|
@ -198,6 +201,26 @@ public class CommandMekanism extends CommandBase
|
||||||
MekanismAPI.debug = !MekanismAPI.debug;
|
MekanismAPI.debug = !MekanismAPI.debug;
|
||||||
sender.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Debug mode set to " + EnumColor.DARK_GREY + 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 {
|
else {
|
||||||
sender.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Unknown command. Type '" + EnumColor.INDIGO + "/mk help" + EnumColor.GREY + "' for help."));
|
sender.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Unknown command. Type '" + EnumColor.INDIGO + "/mk help" + EnumColor.GREY + "' for help."));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue