Reorganized DimLink Code

Moved the DimLink code out of NewDimData in order to reduce clutter
inside that class and made it a separate class, except for functions
that should only be available for NewDimData. Deleted IDimLink and
changed all references to it to use DimLink instead. DimLink is now an
abstract class, which achieves the same encapsulation and protection we
had before by having DimLink implement IDimLink from within NewDimData.
NewDimData has a new class inside, InnerDimLink, which provides it
access to special functions that would be dangerous to expose. This is
the same mechanism used to protect NewDimData's dangerous functions.
These changes are in preparation for adding more code for packet
handling.
This commit is contained in:
SenseiKiwi
2013-09-02 11:47:12 -04:00
parent 0bd7ef9593
commit 56ecb0cd9e
20 changed files with 206 additions and 192 deletions

View File

@@ -4,7 +4,7 @@ import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager;
import StevenDimDoors.mod_pocketDim.DDProperties;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import StevenDimDoors.mod_pocketDim.core.IDimLink;
import StevenDimDoors.mod_pocketDim.core.DimLink;
import StevenDimDoors.mod_pocketDim.core.NewDimData;
import StevenDimDoors.mod_pocketDim.core.PocketManager;
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityRift;
@@ -46,7 +46,7 @@ public class RiftRegenerator implements IRegularTickReceiver {
{
for (int count = 0; count < RIFTS_REGENERATED_PER_DIMENSION; count++)
{
IDimLink link = dimension.getRandomLink();
DimLink link = dimension.getRandomLink();
Point4D source = link.source();
if (!mod_pocketDim.blockRift.isBlockImmune(world, source.getX(), source.getY(), source.getZ()))
{