Removed CommandDeleteAllLinks
I removed CommandDeleteAllLinks because of the significant risk that it would harm a server. It's possible that someone could run this by accident instead of CommandDeleteRifts. It takes the same arguments or even no arguments and it would immediately wipe all links in a dimension. We can restore it later if it's really needed.
This commit is contained in:
parent
d3860119e9
commit
4d53ae5f6a
2 changed files with 0 additions and 67 deletions
|
@ -1,66 +0,0 @@
|
|||
package StevenDimDoors.mod_pocketDim.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
|
||||
public class CommandDeleteAllLinks extends DDCommandBase
|
||||
{
|
||||
private static CommandDeleteAllLinks instance = null;
|
||||
|
||||
private CommandDeleteAllLinks()
|
||||
{
|
||||
super("dd-deletelinks", "???");
|
||||
}
|
||||
|
||||
public static CommandDeleteAllLinks instance()
|
||||
{
|
||||
if (instance == null)
|
||||
instance = new CommandDeleteAllLinks();
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
|
||||
{
|
||||
int linksRemoved=0;
|
||||
int targetDim;
|
||||
boolean shouldGo= true;
|
||||
|
||||
if(command.length==1)
|
||||
{
|
||||
targetDim = parseInt(sender, command[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
targetDim=0;
|
||||
shouldGo=false;
|
||||
sendChat(sender, ("Error-Invalid argument, delete_all_links <targetDimID>"));
|
||||
}
|
||||
|
||||
if(shouldGo)
|
||||
{
|
||||
|
||||
NewDimData dim = PocketManager.getDimensionData(targetDim);
|
||||
ArrayList<DimLink> linksInDim = dim.getAllLinks();
|
||||
|
||||
for (DimLink link : linksInDim)
|
||||
{
|
||||
World targetWorld = PocketManager.loadDimension(targetDim);
|
||||
targetWorld.setBlock(link.source().getX(), link.source().getY(), link.source().getZ(), 0);
|
||||
dim.deleteLink(link);
|
||||
//TODO Probably should check what the block is, but thats annoying so Ill do it later.
|
||||
|
||||
linksRemoved++;
|
||||
}
|
||||
sendChat(sender,("Removed " + linksRemoved + " links."));
|
||||
|
||||
}
|
||||
return DDCommandResult.SUCCESS; //TEMPORARY HACK
|
||||
}
|
||||
}
|
|
@ -350,7 +350,6 @@ public class mod_pocketDim
|
|||
event.registerServerCommand( CommandCreateDungeonRift.instance() );
|
||||
event.registerServerCommand( CommandListDungeons.instance() );
|
||||
event.registerServerCommand( CommandCreateRandomRift.instance() );
|
||||
event.registerServerCommand( CommandDeleteAllLinks.instance() );
|
||||
event.registerServerCommand( CommandDeleteRifts.instance() );
|
||||
event.registerServerCommand( CommandExportDungeon.instance() );
|
||||
event.registerServerCommand( CommandCreatePocket.instance() );
|
||||
|
|
Loading…
Add table
Reference in a new issue