added another command- delete_all_links
Signed-off-by: StevenRS11 <steven.r.stafford.ii.14@dartmouth.edu>
This commit is contained in:
@@ -7,6 +7,7 @@ import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import StevenDimDoors.mod_pocketDim.DimData;
|
||||
import StevenDimDoors.mod_pocketDim.LinkData;
|
||||
import StevenDimDoors.mod_pocketDim.dimHelper;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.world.World;
|
||||
@@ -65,8 +66,8 @@ public class CommandDeleteRifts extends CommandBase
|
||||
|
||||
for(LinkData link : linksInDim)
|
||||
{
|
||||
dimHelper.instance.linksForRendering.remove(link);
|
||||
World targetWorld = dimHelper.getWorld(targetDim);
|
||||
|
||||
if(targetWorld==null)
|
||||
{
|
||||
dimHelper.initDimension(targetDim);
|
||||
@@ -74,16 +75,26 @@ public class CommandDeleteRifts extends CommandBase
|
||||
else if(targetWorld.provider==null)
|
||||
{
|
||||
dimHelper.initDimension(targetDim);
|
||||
|
||||
}
|
||||
targetWorld = dimHelper.getWorld(targetDim);
|
||||
|
||||
targetWorld.setBlockWithNotify(link.locXCoord, link.locYCoord, link.locZCoord, 0);
|
||||
if(targetWorld.getBlockId(link.locXCoord, link.locYCoord, link.locZCoord)==mod_pocketDim.blockRiftID)
|
||||
{
|
||||
dimHelper.instance.linksForRendering.remove(link);
|
||||
dim.removeLinkAtCoords(link);
|
||||
|
||||
|
||||
linksRemoved++;
|
||||
|
||||
targetWorld.setBlockWithNotify(link.locXCoord, link.locYCoord, link.locZCoord, 0);
|
||||
|
||||
|
||||
linksRemoved++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dim.linksInThisDim.clear();
|
||||
//dim.linksInThisDim.clear();
|
||||
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Removed "+linksRemoved+" rifts.");
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user