mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-28 07:36:01 +00:00
Remove teleporter command, deprecated and silly
This commit is contained in:
1 parent
6f2b84e547
commit
8ae57bd9af
3 files changed
-122
No files matched your search
@@ -6,9 +6,6 @@ import java.util.List;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.MekanismAPI;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.frequency.Frequency;
|
||||
import mekanism.common.frequency.FrequencyManager;
|
||||
import mekanism.common.tile.TileEntityTeleporter;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
@@ -104,96 +101,6 @@ public class CommandMekanism extends CommandBase
|
||||
{
|
||||
sender.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " The latest version for this mod is " + EnumColor.DARK_GREY + Mekanism.latestVersionNumber + EnumColor.GREY + "."));
|
||||
}
|
||||
else if(params[0].equalsIgnoreCase("teleporter"))
|
||||
{
|
||||
if(params.length == 2)
|
||||
{
|
||||
sender.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Invalid parameters."));
|
||||
}
|
||||
else if(params[1].equalsIgnoreCase("freq") || params[1].equalsIgnoreCase("frequencies"))
|
||||
{
|
||||
if(params[2].equalsIgnoreCase("list"))
|
||||
{
|
||||
sender.sendMessage(new TextComponentString(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " -------------"));
|
||||
|
||||
if(params.length == 3)
|
||||
{
|
||||
for(Frequency freq : Mekanism.publicTeleporters.getFrequencies())
|
||||
{
|
||||
sender.sendMessage(new TextComponentString(EnumColor.INDIGO + " - " + freq.name + EnumColor.GREY + " (" + freq.ownerUUID + ")"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
FrequencyManager manager = TileEntityTeleporter.loadManager(params[3].trim(), sender.getEntityWorld());
|
||||
|
||||
if(manager != null)
|
||||
{
|
||||
for(Frequency freq : manager.getFrequencies())
|
||||
{
|
||||
sender.sendMessage(new TextComponentString(EnumColor.INDIGO + " - " + freq.name + EnumColor.GREY + " (" + freq.ownerUUID + ")"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
sender.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " User profile doesn't exist."));
|
||||
}
|
||||
}
|
||||
|
||||
sender.sendMessage(new TextComponentString(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------"));
|
||||
}
|
||||
else if(params[2].equalsIgnoreCase("delete"))
|
||||
{
|
||||
if(params.length == 4)
|
||||
{
|
||||
if(Mekanism.publicTeleporters.containsFrequency(params[3].trim()))
|
||||
{
|
||||
Mekanism.publicTeleporters.remove(params[3].trim());
|
||||
sender.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Successfully removed frequency."));
|
||||
}
|
||||
else {
|
||||
sender.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " No such frequency found."));
|
||||
}
|
||||
}
|
||||
else if(params.length == 5)
|
||||
{
|
||||
FrequencyManager manager = TileEntityTeleporter.loadManager(params[3].trim(), sender.getEntityWorld());
|
||||
|
||||
if(manager != null)
|
||||
{
|
||||
if(manager.containsFrequency(params[4].trim()))
|
||||
{
|
||||
manager.remove(params[4].trim());
|
||||
sender.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Successfully removed frequency."));
|
||||
}
|
||||
else {
|
||||
sender.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " No such frequency found."));
|
||||
}
|
||||
}
|
||||
else {
|
||||
sender.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " User profile doesn't exist."));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(params[2].equalsIgnoreCase("deleteAll"))
|
||||
{
|
||||
if(params.length == 4)
|
||||
{
|
||||
String owner = params[3].trim();
|
||||
FrequencyManager manager = TileEntityTeleporter.loadManager(owner, sender.getEntityWorld());
|
||||
|
||||
if(manager != null)
|
||||
{
|
||||
int amount = Mekanism.publicTeleporters.removeAll(owner);
|
||||
amount += manager.removeAll(owner);
|
||||
|
||||
sender.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Successfully removed " + amount + " frequencies."));
|
||||
}
|
||||
else {
|
||||
sender.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " User profile doesn't exist."));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(params[0].equalsIgnoreCase("debug"))
|
||||
{
|
||||
MekanismAPI.debug = !MekanismAPI.debug;
|
||||
|
||||
@@ -185,25 +185,6 @@ public class FrequencyManager
|
||||
}
|
||||
}
|
||||
|
||||
public static FrequencyManager loadOnly(World world, String owner, Class<? extends Frequency> freqClass, String n)
|
||||
{
|
||||
FrequencyManager manager = new FrequencyManager(freqClass, n);
|
||||
String name = manager.getName();
|
||||
|
||||
FrequencyDataHandler handler = (FrequencyDataHandler)world.getPerWorldStorage().getOrLoadData(FrequencyDataHandler.class, name);
|
||||
|
||||
if(handler == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
manager.dataHandler = handler;
|
||||
manager.dataHandler.syncManager();
|
||||
|
||||
return manager;
|
||||
}
|
||||
}
|
||||
|
||||
public Set<Frequency> getFrequencies()
|
||||
{
|
||||
return frequencies;
|
||||
|
||||
@@ -223,16 +223,6 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements ICo
|
||||
}
|
||||
}
|
||||
|
||||
public static FrequencyManager loadManager(String owner, World world)
|
||||
{
|
||||
if(Mekanism.privateTeleporters.containsKey(owner))
|
||||
{
|
||||
return Mekanism.privateTeleporters.get(owner);
|
||||
}
|
||||
|
||||
return FrequencyManager.loadOnly(world, owner, Frequency.class, "Teleporter");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user