I derped. Oh well. #122
@@ -25,7 +25,6 @@ import StevenDimDoors.mod_pocketDim.tileentities.TileEntityDimDoor;
|
|||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEntityProvider
|
public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEntityProvider
|
||||||
{
|
{
|
||||||
protected final DDProperties properties;
|
protected final DDProperties properties;
|
||||||
@@ -429,4 +428,11 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||||||
int direction = MathHelper.floor_double((entity.rotationYaw + 90) * 4.0F / 360.0F + 0.5D) & 3;
|
int direction = MathHelper.floor_double((entity.rotationYaw + 90) * 4.0F / 360.0F + 0.5D) & 3;
|
||||||
return ((metadata & 3) == direction);
|
return ((metadata & 3) == direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initDoorTE(World world, int x, int y, int z)
|
||||||
|
{
|
||||||
|
TileEntity te = this.createNewTileEntity(world);
|
||||||
|
world.setBlockTileEntity(x, y, z, te);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -10,4 +10,6 @@ public interface IDimDoor
|
|||||||
public void placeLink(World world, int x, int y, int z);
|
public void placeLink(World world, int x, int y, int z);
|
||||||
|
|
||||||
public int getDrops();
|
public int getDrops();
|
||||||
|
|
||||||
|
public void initDoorTE(World world, int x, int y, int z);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,4 +118,11 @@ public class TransTrapdoor extends BlockTrapDoor implements IDimDoor, ITileEntit
|
|||||||
{
|
{
|
||||||
return (metadata & 8) == 0;
|
return (metadata & 8) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initDoorTE(World world, int x, int y, int z)
|
||||||
|
{
|
||||||
|
TileEntity te = this.createNewTileEntity(world);
|
||||||
|
world.setBlockTileEntity(x, y, z, te);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -300,7 +300,6 @@ public class PocketManager
|
|||||||
PocketManager.dimensionData.put(dimData.id, dimData);
|
PocketManager.dimensionData.put(dimData.id, dimData);
|
||||||
dimWatcher.onCreated(new ClientDimData(dimData));
|
dimWatcher.onCreated(new ClientDimData(dimData));
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public static boolean deletePocket(NewDimData target, boolean deleteFolder)
|
public static boolean deletePocket(NewDimData target, boolean deleteFolder)
|
||||||
@@ -403,7 +402,7 @@ public class PocketManager
|
|||||||
*/
|
*/
|
||||||
private static void loadInternal()
|
private static void loadInternal()
|
||||||
{
|
{
|
||||||
System.out.println(!FMLCommonHandler.instance().getSide().isClient());
|
//System.out.println(!FMLCommonHandler.instance().getSide().isClient());
|
||||||
|
|
||||||
File saveDir = DimensionManager.getCurrentSaveRootDirectory();
|
File saveDir = DimensionManager.getCurrentSaveRootDirectory();
|
||||||
if (saveDir != null)
|
if (saveDir != null)
|
||||||
@@ -507,14 +506,24 @@ public class PocketManager
|
|||||||
DimensionManager.registerDimension(dimensionID, properties.PocketProviderID);
|
DimensionManager.registerDimension(dimensionID, properties.PocketProviderID);
|
||||||
return registerDimension(dimensionID, (InnerDimData) parent, true, isDungeon);
|
return registerDimension(dimensionID, (InnerDimData) parent, true, isDungeon);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Registers a dimension with DD but NOT with forge.
|
||||||
|
* @param dimensionID
|
||||||
|
* @param parent
|
||||||
|
* @param isPocket
|
||||||
|
* @param isDungeon
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
private static NewDimData registerDimension(int dimensionID, InnerDimData parent, boolean isPocket, boolean isDungeon)
|
private static NewDimData registerDimension(int dimensionID, InnerDimData parent, boolean isPocket, boolean isDungeon)
|
||||||
{
|
{
|
||||||
if (dimensionData.containsKey(dimensionID))
|
if (dimensionData.containsKey(dimensionID))
|
||||||
{
|
{
|
||||||
|
if(PocketManager.dimensionIDBlackList.contains(dimensionID))
|
||||||
|
{
|
||||||
|
throw new IllegalArgumentException("Cannot register a dimension with ID = " + dimensionID + " because it has been blacklisted.");
|
||||||
|
}
|
||||||
throw new IllegalArgumentException("Cannot register a dimension with ID = " + dimensionID + " because it has already been registered.");
|
throw new IllegalArgumentException("Cannot register a dimension with ID = " + dimensionID + " because it has already been registered.");
|
||||||
}
|
}
|
||||||
//TODO blacklist stuff probably should happen here
|
|
||||||
InnerDimData dimension = new InnerDimData(dimensionID, parent, isPocket, isDungeon, linkWatcher);
|
InnerDimData dimension = new InnerDimData(dimensionID, parent, isPocket, isDungeon, linkWatcher);
|
||||||
dimensionData.put(dimensionID, dimension);
|
dimensionData.put(dimensionID, dimension);
|
||||||
if (!dimension.isPocketDimension())
|
if (!dimension.isPocketDimension())
|
||||||
@@ -529,6 +538,7 @@ public class PocketManager
|
|||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private static NewDimData registerClientDimension(int dimensionID, int rootID)
|
private static NewDimData registerClientDimension(int dimensionID, int rootID)
|
||||||
{
|
{
|
||||||
|
System.out.println("Registered dim "+dimensionID+" on the client.");
|
||||||
// No need to raise events heres since this code should only run on the client side
|
// No need to raise events heres since this code should only run on the client side
|
||||||
// getDimensionData() always handles root dimensions properly, even if the weren't defined before
|
// getDimensionData() always handles root dimensions properly, even if the weren't defined before
|
||||||
|
|
||||||
@@ -579,6 +589,7 @@ public class PocketManager
|
|||||||
if(PocketManager.dimensionData == null)
|
if(PocketManager.dimensionData == null)
|
||||||
{
|
{
|
||||||
System.out.println("Something odd happend during shutdown");
|
System.out.println("Something odd happend during shutdown");
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
NewDimData dimension = PocketManager.dimensionData.get(dimensionID);
|
NewDimData dimension = PocketManager.dimensionData.get(dimensionID);
|
||||||
if (dimension == null)
|
if (dimension == null)
|
||||||
|
|||||||
@@ -17,10 +17,13 @@ import net.minecraft.tileentity.TileEntity;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
import StevenDimDoors.mod_pocketDim.Point3D;
|
import StevenDimDoors.mod_pocketDim.Point3D;
|
||||||
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
|
import StevenDimDoors.mod_pocketDim.blocks.IDimDoor;
|
||||||
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
||||||
import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
||||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||||
|
import StevenDimDoors.mod_pocketDim.items.ItemDimensionalDoor;
|
||||||
import StevenDimDoors.mod_pocketDim.schematic.BlockRotator;
|
import StevenDimDoors.mod_pocketDim.schematic.BlockRotator;
|
||||||
import StevenDimDoors.mod_pocketDim.schematic.CompoundFilter;
|
import StevenDimDoors.mod_pocketDim.schematic.CompoundFilter;
|
||||||
import StevenDimDoors.mod_pocketDim.schematic.InvalidSchematicException;
|
import StevenDimDoors.mod_pocketDim.schematic.InvalidSchematicException;
|
||||||
@@ -293,6 +296,8 @@ public class DungeonSchematic extends Schematic {
|
|||||||
Point4D destination = entryLink.source();
|
Point4D destination = entryLink.source();
|
||||||
NewDimData prevDim = PocketManager.getDimensionData(destination.getDimension());
|
NewDimData prevDim = PocketManager.getDimensionData(destination.getDimension());
|
||||||
prevDim.setDestination(reverseLink, destination.getX(), destination.getY(), destination.getZ());
|
prevDim.setDestination(reverseLink, destination.getX(), destination.getY(), destination.getZ());
|
||||||
|
initDoorTileEntity(world, pocketCenter);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void createExitDoorLink(World world, NewDimData dimension, Point3D point, Point3D entrance, int rotation, Point3D pocketCenter)
|
private static void createExitDoorLink(World world, NewDimData dimension, Point3D point, Point3D entrance, int rotation, Point3D pocketCenter)
|
||||||
@@ -313,6 +318,8 @@ public class DungeonSchematic extends Schematic {
|
|||||||
int metadata = world.getBlockMetadata(x, y, z);
|
int metadata = world.getBlockMetadata(x, y, z);
|
||||||
setBlockDirectly(world, x, y + 1, z, blockID, metadata);
|
setBlockDirectly(world, x, y + 1, z, blockID, metadata);
|
||||||
}
|
}
|
||||||
|
initDoorTileEntity(world, location);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void createDimensionalDoorLink(NewDimData dimension, Point3D point, Point3D entrance, int rotation, Point3D pocketCenter,World world)
|
private static void createDimensionalDoorLink(NewDimData dimension, Point3D point, Point3D entrance, int rotation, Point3D pocketCenter,World world)
|
||||||
@@ -323,6 +330,9 @@ public class DungeonSchematic extends Schematic {
|
|||||||
int orientation = world.getBlockMetadata(location.getX(), location.getY()-1, location.getZ());
|
int orientation = world.getBlockMetadata(location.getX(), location.getY()-1, location.getZ());
|
||||||
|
|
||||||
dimension.createLink(location.getX(), location.getY(), location.getZ(), LinkTypes.DUNGEON, orientation);
|
dimension.createLink(location.getX(), location.getY(), location.getZ(), LinkTypes.DUNGEON, orientation);
|
||||||
|
initDoorTileEntity(world, location);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void spawnMonolith(World world, Point3D point, Point3D entrance, int rotation, Point3D pocketCenter, boolean canSpawn)
|
private static void spawnMonolith(World world, Point3D point, Point3D entrance, int rotation, Point3D pocketCenter, boolean canSpawn)
|
||||||
@@ -340,4 +350,21 @@ public class DungeonSchematic extends Schematic {
|
|||||||
world.spawnEntityInWorld(mob);
|
world.spawnEntityInWorld(mob);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private static void initDoorTileEntity(World world, Point3D point)
|
||||||
|
{
|
||||||
|
Block door = Block.blocksList[world.getBlockId(point.getX(), point.getY(), point.getZ())];
|
||||||
|
Block door2 = Block.blocksList[world.getBlockId(point.getX(), point.getY()-1, point.getZ())];
|
||||||
|
|
||||||
|
if(door instanceof IDimDoor&&door2 instanceof IDimDoor)
|
||||||
|
{
|
||||||
|
((IDimDoor) door).initDoorTE(world, point.getX(), point.getY(), point.getZ());
|
||||||
|
((IDimDoor) door).initDoorTE(world, point.getX(), point.getY()-1, point.getZ());
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new IllegalArgumentException("Tried to init a dim door TE on a block that isnt a Dim Door!!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,15 +19,14 @@ public class TileEntityDimDoor extends TileEntity
|
|||||||
@Override
|
@Override
|
||||||
public boolean canUpdate()
|
public boolean canUpdate()
|
||||||
{
|
{
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateEntity()
|
public void updateEntity()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public Packet getDescriptionPacket()
|
public Packet getDescriptionPacket()
|
||||||
{
|
{
|
||||||
if(PocketManager.getLink(xCoord, yCoord, zCoord, worldObj)!=null)
|
if(PocketManager.getLink(xCoord, yCoord, zCoord, worldObj)!=null)
|
||||||
|
|||||||
@@ -472,7 +472,7 @@ public class PocketBuilder
|
|||||||
Point3D door = new Point3D(x, y, z);
|
Point3D door = new Point3D(x, y, z);
|
||||||
BlockRotator.transformPoint(center, door, orientation - BlockRotator.EAST_DOOR_METADATA, door);
|
BlockRotator.transformPoint(center, door, orientation - BlockRotator.EAST_DOOR_METADATA, door);
|
||||||
|
|
||||||
/*
|
|
||||||
//Build the outer layer of Eternal Fabric
|
//Build the outer layer of Eternal Fabric
|
||||||
buildBox(world, center.getX(), center.getY(), center.getZ(), (size / 2), properties.PermaFabricBlockID, false, 0);
|
buildBox(world, center.getX(), center.getY(), center.getZ(), (size / 2), properties.PermaFabricBlockID, false, 0);
|
||||||
|
|
||||||
@@ -482,9 +482,9 @@ public class PocketBuilder
|
|||||||
buildBox(world, center.getX(), center.getY(), center.getZ(), (size / 2) - layer, properties.FabricBlockID,
|
buildBox(world, center.getX(), center.getY(), center.getZ(), (size / 2) - layer, properties.FabricBlockID,
|
||||||
layer < (wallThickness - 1) && properties.TNFREAKINGT_Enabled, properties.NonTntWeight);
|
layer < (wallThickness - 1) && properties.TNFREAKINGT_Enabled, properties.NonTntWeight);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
MazeBuilder.generate(world, x, y, z, random);
|
|
||||||
|
//MazeBuilder.generate(world, x, y, z, random);
|
||||||
|
|
||||||
//Build the door
|
//Build the door
|
||||||
int doorOrientation = BlockRotator.transformMetadata(BlockRotator.EAST_DOOR_METADATA, orientation - BlockRotator.EAST_DOOR_METADATA + 2, properties.DimensionalDoorID);
|
int doorOrientation = BlockRotator.transformMetadata(BlockRotator.EAST_DOOR_METADATA, orientation - BlockRotator.EAST_DOOR_METADATA + 2, properties.DimensionalDoorID);
|
||||||
|
|||||||
Reference in New Issue
Block a user