Fixed Rotation in Schematic Loader and Partially Overhauled Commands #32
@@ -814,7 +814,7 @@ public class SchematicLoader
|
||||
|
||||
entities = nbtdata.getTagList("Entities");
|
||||
tileentities = nbtdata.getTagList("TileEntities");
|
||||
**/
|
||||
**/
|
||||
input.close();
|
||||
|
||||
//combine the split block IDs into a single short[]
|
||||
@@ -907,41 +907,37 @@ public class SchematicLoader
|
||||
}
|
||||
}
|
||||
|
||||
//determines necessary rotation, reflection, and translation to build the .schematic by finding the difference between the
|
||||
//.schematic incomingLink location which is relative to the .schematic only, and comparing it with the world incoming link coordinates
|
||||
//must also factor in the orientation of the incoming door.
|
||||
if(orientation==0) //TODO currently broken, only orientation 3 works atm
|
||||
{
|
||||
xCooe=-incomingLink.getX()+incX;
|
||||
yCooe=-incomingLink.getY()+incY;
|
||||
zCooe=-incomingLink.getZ()+incZ;
|
||||
//Compute the Y-axis translation that places our structure correctly
|
||||
yCooe = incY - incomingLink.getY();
|
||||
|
||||
}
|
||||
if(orientation==1)//TODO currently broken, only orientation 3 works atm
|
||||
//Loop to actually place the blocks
|
||||
for ( x = 0; x < width; x++)
|
||||
{
|
||||
xCooe=-incomingLink.getX()+incX;
|
||||
yCooe=-incomingLink.getY()+incY;
|
||||
zCooe=-incomingLink.getZ()+incZ;
|
||||
}
|
||||
if(orientation==2)//TODO currently broken, only orientation 3 works atm
|
||||
{
|
||||
xCooe=-incomingLink.getX()+incX;
|
||||
yCooe=-incomingLink.getY()+incY;
|
||||
zCooe=-incomingLink.getZ()+incZ;
|
||||
}
|
||||
if(orientation==3)//TODO this only works because it is the default orientation of the pocket dim
|
||||
{
|
||||
xCooe=-incomingLink.getX()+incX;
|
||||
yCooe=-incomingLink.getY()+incY;
|
||||
zCooe=-incomingLink.getZ()+incZ;
|
||||
}
|
||||
|
||||
//loop to actually place the blocks
|
||||
for ( x = 0; x < width; ++x)
|
||||
{
|
||||
for ( y = 0; y < height; ++y)
|
||||
for ( z = 0; z < length; z++)
|
||||
{
|
||||
for ( z = 0; z < length; ++z)
|
||||
//Compute the X-axis and Z-axis translations that will shift
|
||||
//and rotate our structure properly.
|
||||
switch (orientation)
|
||||
{
|
||||
case 0:
|
||||
xCooe = -incomingLink.getX() + incX;
|
||||
zCooe = -incomingLink.getZ() + incZ;
|
||||
break;
|
||||
case 1:
|
||||
xCooe = -incomingLink.getX() + incX;
|
||||
zCooe = -incomingLink.getZ() + incZ;
|
||||
break;
|
||||
case 2:
|
||||
xCooe = -incomingLink.getX() + incX;
|
||||
zCooe = -incomingLink.getZ() + incZ;
|
||||
break;
|
||||
case 3:
|
||||
xCooe = -incomingLink.getX() + incX;
|
||||
zCooe = -incomingLink.getZ() + incZ;
|
||||
break;
|
||||
}
|
||||
|
||||
for ( y = 0; y < height; y++)
|
||||
{
|
||||
|
||||
int index = y * width * length + z * width + x;
|
||||
@@ -990,23 +986,23 @@ public class SchematicLoader
|
||||
{
|
||||
tile.readFromNBT(tag);
|
||||
}
|
||||
**/
|
||||
**/
|
||||
|
||||
//fill chests
|
||||
if(world.getBlockTileEntity(x+xCooe, y+yCooe, z+zCooe) instanceof TileEntityChest)
|
||||
{
|
||||
TileEntityChest chest = (TileEntityChest) world.getBlockTileEntity(x+xCooe, y+yCooe, z+zCooe);
|
||||
ChestGenHooks info = DDLoot.DungeonChestInfo;
|
||||
WeightedRandomChestContent.generateChestContents(rand, info.getItems(rand), (TileEntityChest)world.getBlockTileEntity(x+xCooe, y+yCooe, z+zCooe), info.getCount(rand));
|
||||
}
|
||||
if(world.getBlockTileEntity(x+xCooe, y+yCooe, z+zCooe) instanceof TileEntityChest)
|
||||
{
|
||||
TileEntityChest chest = (TileEntityChest) world.getBlockTileEntity(x+xCooe, y+yCooe, z+zCooe);
|
||||
ChestGenHooks info = DDLoot.DungeonChestInfo;
|
||||
WeightedRandomChestContent.generateChestContents(rand, info.getItems(rand), (TileEntityChest)world.getBlockTileEntity(x+xCooe, y+yCooe, z+zCooe), info.getCount(rand));
|
||||
}
|
||||
|
||||
//fill dispensers
|
||||
if(world.getBlockTileEntity(x+xCooe, y+yCooe, z+zCooe) instanceof TileEntityDispenser)
|
||||
{
|
||||
TileEntityDispenser dispenser = (TileEntityDispenser) world.getBlockTileEntity(x+xCooe, y+yCooe, z+zCooe);
|
||||
dispenser.addItem(new ItemStack(Item.arrow, 64));
|
||||
//fill dispensers
|
||||
if(world.getBlockTileEntity(x+xCooe, y+yCooe, z+zCooe) instanceof TileEntityDispenser)
|
||||
{
|
||||
TileEntityDispenser dispenser = (TileEntityDispenser) world.getBlockTileEntity(x+xCooe, y+yCooe, z+zCooe);
|
||||
dispenser.addItem(new ItemStack(Item.arrow, 64));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1018,35 +1014,35 @@ public class SchematicLoader
|
||||
{
|
||||
|
||||
|
||||
int depth = dimHelper.instance.getDimDepth(originDimID);
|
||||
int xNoise = 0;
|
||||
int zNoise =0;
|
||||
switch(world.getBlockMetadata(point.getX()+xCooe, point.getY()+yCooe-1, point.getZ()+zCooe))
|
||||
{
|
||||
case 0:
|
||||
xNoise = (int)rand.nextInt(depth+1*200)+depth*50;
|
||||
zNoise = (int)rand.nextInt(depth+1*20)-(10)*depth;
|
||||
int depth = dimHelper.instance.getDimDepth(originDimID);
|
||||
int xNoise = 0;
|
||||
int zNoise =0;
|
||||
switch(world.getBlockMetadata(point.getX()+xCooe, point.getY()+yCooe-1, point.getZ()+zCooe))
|
||||
{
|
||||
case 0:
|
||||
xNoise = (int)rand.nextInt(depth+1*200)+depth*50;
|
||||
zNoise = (int)rand.nextInt(depth+1*20)-(10)*depth;
|
||||
|
||||
break;
|
||||
case 1:
|
||||
xNoise = (int)rand.nextInt(depth+1*20)-(10)*depth;
|
||||
zNoise = (int) rand.nextInt(depth+1*200)+depth*50;
|
||||
break;
|
||||
case 1:
|
||||
xNoise = (int)rand.nextInt(depth+1*20)-(10)*depth;
|
||||
zNoise = (int) rand.nextInt(depth+1*200)+depth*50;
|
||||
|
||||
break;
|
||||
case 2:
|
||||
xNoise = - (rand.nextInt(depth+1*200)+depth*50);
|
||||
zNoise = (int)rand.nextInt(depth+1*20)-(10)*depth;
|
||||
break;
|
||||
case 2:
|
||||
xNoise = - (rand.nextInt(depth+1*200)+depth*50);
|
||||
zNoise = (int)rand.nextInt(depth+1*20)-(10)*depth;
|
||||
|
||||
break;
|
||||
case 3:
|
||||
xNoise = (int)rand.nextInt(depth+1*20)-(10)*depth;
|
||||
zNoise = -(rand.nextInt(depth+1*200)+depth*50);
|
||||
break;
|
||||
case 3:
|
||||
xNoise = (int)rand.nextInt(depth+1*20)-(10)*depth;
|
||||
zNoise = -(rand.nextInt(depth+1*200)+depth*50);
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
LinkData sideLink = new LinkData(destDimID,0,point.getX()+xCooe, point.getY()+yCooe, point.getZ()+zCooe,xNoise+point.getX()+xCooe, point.getY()+yCooe+1, zNoise+point.getZ()+zCooe,true,world.getBlockMetadata(point.getX()+xCooe, point.getY()+yCooe-1, point.getZ()+zCooe));
|
||||
dimHelper.instance.createPocket(sideLink, true, true);
|
||||
LinkData sideLink = new LinkData(destDimID,0,point.getX()+xCooe, point.getY()+yCooe, point.getZ()+zCooe,xNoise+point.getX()+xCooe, point.getY()+yCooe+1, zNoise+point.getZ()+zCooe,true,world.getBlockMetadata(point.getX()+xCooe, point.getY()+yCooe-1, point.getZ()+zCooe));
|
||||
dimHelper.instance.createPocket(sideLink, true, true);
|
||||
}
|
||||
|
||||
//generate linkData for wooden dim doors leading to the overworld
|
||||
@@ -1064,7 +1060,7 @@ public class SchematicLoader
|
||||
else if((rand.nextBoolean()&&randomLink!=null))
|
||||
{
|
||||
sideLink.destDimID=randomLink.locDimID;
|
||||
// System.out.println("randomLink");
|
||||
// System.out.println("randomLink");
|
||||
}
|
||||
|
||||
sideLink.destYCoord=yCoordHelper.getFirstUncovered(sideLink.destDimID, point.getX()+xCooe,10,point.getZ()+zCooe);
|
||||
@@ -1131,8 +1127,8 @@ public class SchematicLoader
|
||||
|
||||
Chunk chunk;
|
||||
cX = x >> 4;
|
||||
cZ = z >> 4;
|
||||
cY=y >>4;
|
||||
cZ = z >> 4;
|
||||
cY=y >>4;
|
||||
|
||||
int chunkX=(x % 16)< 0 ? ((x) % 16)+16 : ((x) % 16);
|
||||
int chunkZ=((z) % 16)< 0 ? ((z) % 16)+16 : ((z) % 16);
|
||||
|
||||
@@ -391,7 +391,7 @@ public class mod_pocketDim
|
||||
@ServerStarting
|
||||
public void serverStarting(FMLServerStartingEvent event)
|
||||
{
|
||||
CommandRegenPocket.instance().register(event);
|
||||
CommandResetDungeons.instance().register(event);
|
||||
CommandCreateDungeonRift.instance().register(event);
|
||||
CommandDeleteAllLinks.instance().register(event);
|
||||
CommandDeleteDimensionData.instance().register(event);
|
||||
|
||||
Reference in New Issue
Block a user