THE UPDATE

Merging months of dev work into master. The update is playable, but
untested.
This commit is contained in:
StevenRS11
2013-11-05 18:15:23 -05:00
parent be89913263
commit a04a266c17
154 changed files with 8826 additions and 8272 deletions

View File

@@ -4,10 +4,10 @@ import java.util.ArrayList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import StevenDimDoors.mod_pocketDim.DimData;
import StevenDimDoors.mod_pocketDim.LinkData;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
import StevenDimDoors.mod_pocketDim.core.DimLink;
import StevenDimDoors.mod_pocketDim.core.NewDimData;
import StevenDimDoors.mod_pocketDim.core.PocketManager;
public class CommandDeleteRifts extends DDCommandBase
{
@@ -33,56 +33,36 @@ public class CommandDeleteRifts extends DDCommandBase
int targetDim;
boolean shouldGo= true;
if(command.length==0)
{
targetDim= sender.worldObj.provider.dimensionId;
}
else if(command.length==1)
if(command.length==1)
{
targetDim = parseInt(sender, command[0]);
if(!dimHelper.dimList.containsKey(targetDim))
{
sender.sendChatToPlayer("Error- dim "+targetDim+" not registered");
shouldGo=false;
}
}
else
{
targetDim=0;
shouldGo=false;
sender.sendChatToPlayer("Error-Invalid argument, delete_links <targetDimID> or blank for current dim");
sender.sendChatToPlayer("Error-Invalid argument, delete_all_links <targetDimID>");
}
if(shouldGo)
{
if(dimHelper.dimList.containsKey(targetDim))
{
DimData dim = dimHelper.instance.getDimData(targetDim);
ArrayList<LinkData> linksInDim = dim.getLinksInDim();
NewDimData dim = PocketManager.getDimensionData(targetDim);
ArrayList<DimLink> linksInDim = dim.getAllLinks();
for(LinkData link : linksInDim)
for (DimLink link : linksInDim)
{
World targetWorld = dimHelper.getWorld(targetDim);
if(targetWorld==null)
World targetWorld = PocketManager.loadDimension(targetDim);
if(sender.worldObj.getBlockId(link.source().getX(), link.source().getY(), link.source().getZ())==mod_pocketDim.blockRift.blockID)
{
dimHelper.initDimension(targetDim);
}
else if(targetWorld.provider==null)
{
dimHelper.initDimension(targetDim);
}
targetWorld = dimHelper.getWorld(targetDim);
if (targetWorld.getBlockId(link.locXCoord, link.locYCoord, link.locZCoord) == mod_pocketDim.blockRift.blockID)
{
dim.removeLinkAtCoords(link);
targetWorld.setBlock(link.locXCoord, link.locYCoord, link.locZCoord, 0);
targetWorld.setBlock(link.source().getX(), link.source().getY(), link.source().getZ(), 0);
linksRemoved++;
dim.deleteLink(link);
}
}
sender.sendChatToPlayer("Removed "+linksRemoved+" rifts.");
}
sender.sendChatToPlayer("Removed " + linksRemoved + " rifts.");
}
return DDCommandResult.SUCCESS; //TEMPORARY HACK
}