Started Rewriting LinkData
Created NewLinkData and replaced references to the original LinkData. Moved it to the mod_pocketDim.core package. Added Point4D, an immutable point type for 3D integer coordinates with an added dimension ID.
This commit is contained in:
@@ -6,7 +6,7 @@ import java.util.Collection;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import StevenDimDoors.mod_pocketDim.DungeonGenerator;
|
||||
import StevenDimDoors.mod_pocketDim.LinkData;
|
||||
import StevenDimDoors.mod_pocketDim.core.NewLinkData;
|
||||
import StevenDimDoors.mod_pocketDim.helpers.DungeonHelper;
|
||||
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
||||
|
||||
@@ -60,7 +60,7 @@ public class CommandCreateDungeonRift extends DDCommandBase
|
||||
int x = MathHelper.floor_double(sender.posX);
|
||||
int y = MathHelper.floor_double(sender.posY);
|
||||
int z = MathHelper.floor_double (sender.posZ);
|
||||
LinkData link = new LinkData(sender.worldObj.provider.dimensionId, 0, x, y + 1, z, x, y + 1, z, true, 3);
|
||||
NewLinkData link = new NewLinkData(sender.worldObj.provider.dimensionId, 0, x, y + 1, z, x, y + 1, z, true, 3);
|
||||
|
||||
if (command[0].equals("random"))
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package StevenDimDoors.mod_pocketDim.commands;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import StevenDimDoors.mod_pocketDim.LinkData;
|
||||
import StevenDimDoors.mod_pocketDim.core.NewLinkData;
|
||||
import StevenDimDoors.mod_pocketDim.helpers.DungeonHelper;
|
||||
|
||||
public class CommandCreatePocket extends DDCommandBase
|
||||
@@ -39,7 +39,7 @@ public class CommandCreatePocket extends DDCommandBase
|
||||
int x = (int) sender.posX;
|
||||
int y = (int) sender.posY;
|
||||
int z = (int) sender.posZ;
|
||||
LinkData link = DungeonHelper.instance().createCustomDungeonDoor(sender.worldObj, x, y, z);
|
||||
NewLinkData link = DungeonHelper.instance().createCustomDungeonDoor(sender.worldObj, x, y, z);
|
||||
|
||||
//Notify the player
|
||||
sender.sendChatToPlayer("Created a door to a pocket dimension (Dimension ID = " + link.destDimID + "). Please build your dungeon there.");
|
||||
|
||||
@@ -5,7 +5,7 @@ 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.core.NewLinkData;
|
||||
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
||||
|
||||
public class CommandDeleteAllLinks extends DDCommandBase
|
||||
@@ -57,9 +57,9 @@ public class CommandDeleteAllLinks extends DDCommandBase
|
||||
if(dimHelper.dimList.containsKey(targetDim))
|
||||
{
|
||||
DimData dim = dimHelper.instance.getDimData(targetDim);
|
||||
ArrayList<LinkData> linksInDim = dim.getLinksInDim();
|
||||
ArrayList<NewLinkData> linksInDim = dim.getLinksInDim();
|
||||
|
||||
for (LinkData link : linksInDim)
|
||||
for (NewLinkData link : linksInDim)
|
||||
{
|
||||
World targetWorld = dimHelper.getWorld(targetDim);
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import java.util.Collection;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import StevenDimDoors.mod_pocketDim.DimData;
|
||||
import StevenDimDoors.mod_pocketDim.LinkData;
|
||||
import StevenDimDoors.mod_pocketDim.core.NewLinkData;
|
||||
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
||||
|
||||
public class CommandDeleteDimensionData extends DDCommandBase
|
||||
@@ -60,10 +60,10 @@ public class CommandDeleteDimensionData extends DDCommandBase
|
||||
{
|
||||
for(DimData dimData :dimHelper.dimList.values())
|
||||
{
|
||||
Collection<LinkData> links= new ArrayList<LinkData>();
|
||||
Collection<NewLinkData> links= new ArrayList<NewLinkData>();
|
||||
links.addAll( dimData.getLinksInDim());
|
||||
|
||||
for(LinkData link : links)
|
||||
for(NewLinkData link : links)
|
||||
{
|
||||
if(link.destDimID==targetDim)
|
||||
{
|
||||
|
||||
@@ -5,8 +5,8 @@ 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.core.NewLinkData;
|
||||
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
||||
|
||||
public class CommandDeleteRifts extends DDCommandBase
|
||||
@@ -58,9 +58,9 @@ public class CommandDeleteRifts extends DDCommandBase
|
||||
if(dimHelper.dimList.containsKey(targetDim))
|
||||
{
|
||||
DimData dim = dimHelper.instance.getDimData(targetDim);
|
||||
ArrayList<LinkData> linksInDim = dim.getLinksInDim();
|
||||
ArrayList<NewLinkData> linksInDim = dim.getLinksInDim();
|
||||
|
||||
for(LinkData link : linksInDim)
|
||||
for(NewLinkData link : linksInDim)
|
||||
{
|
||||
World targetWorld = dimHelper.getWorld(targetDim);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import StevenDimDoors.mod_pocketDim.DimData;
|
||||
import StevenDimDoors.mod_pocketDim.LinkData;
|
||||
import StevenDimDoors.mod_pocketDim.core.NewLinkData;
|
||||
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
||||
|
||||
public class CommandPrintDimensionData extends DDCommandBase
|
||||
@@ -56,11 +56,11 @@ public class CommandPrintDimensionData extends DDCommandBase
|
||||
return DDCommandResult.UNREGISTERED_DIMENSION;
|
||||
}
|
||||
|
||||
ArrayList<LinkData> links = dimData.getLinksInDim();
|
||||
ArrayList<NewLinkData> links = dimData.getLinksInDim();
|
||||
|
||||
sender.sendChatToPlayer("Dimension ID = " + dimData.dimID);
|
||||
sender.sendChatToPlayer("Dimension Depth = " + dimData.depth);
|
||||
for (LinkData link : links)
|
||||
for (NewLinkData link : links)
|
||||
{
|
||||
sender.sendChatToPlayer(link.printLinkData());
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.util.Set;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import StevenDimDoors.mod_pocketDim.DimData;
|
||||
import StevenDimDoors.mod_pocketDim.LinkData;
|
||||
import StevenDimDoors.mod_pocketDim.core.NewLinkData;
|
||||
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
||||
|
||||
public class CommandPruneDimensions extends DDCommandBase
|
||||
@@ -47,12 +47,12 @@ public class CommandPruneDimensions extends DDCommandBase
|
||||
|
||||
for (DimData data : allDims)
|
||||
{
|
||||
for (LinkData link : data.getLinksInDim())
|
||||
for (NewLinkData link : data.getLinksInDim())
|
||||
{
|
||||
linkedDimensions.add(link.destDimID);
|
||||
}
|
||||
}
|
||||
for (LinkData link : dimHelper.instance.interDimLinkList.values())
|
||||
for (NewLinkData link : dimHelper.instance.interDimLinkList.values())
|
||||
{
|
||||
linkedDimensions.add(link.destDimID);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user