Fixed Rotation in SchematicLoader
Fixed reference to CommandRegenPocket - should be CommandResetDungeons. Autofixed indentation in SchematicLoader. I wanted to commit that change before doing any more code changes but I forgot. Then I fixed the code that calculates the coordinate offsets so our dungeons rotate right. It was pretty simple - all I had to do was move the xCooe and zCooe calculations into the loops so they're recalculated to account for rotation. I rearranged the loops for optimal performance.
This commit is contained in:
@@ -907,41 +907,37 @@ public class SchematicLoader
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//determines necessary rotation, reflection, and translation to build the .schematic by finding the difference between the
|
//Compute the Y-axis translation that places our structure correctly
|
||||||
//.schematic incomingLink location which is relative to the .schematic only, and comparing it with the world incoming link coordinates
|
yCooe = incY - incomingLink.getY();
|
||||||
//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;
|
|
||||||
|
|
||||||
}
|
//Loop to actually place the blocks
|
||||||
if(orientation==1)//TODO currently broken, only orientation 3 works atm
|
for ( x = 0; x < width; x++)
|
||||||
{
|
{
|
||||||
xCooe=-incomingLink.getX()+incX;
|
for ( z = 0; z < length; z++)
|
||||||
yCooe=-incomingLink.getY()+incY;
|
|
||||||
zCooe=-incomingLink.getZ()+incZ;
|
|
||||||
}
|
|
||||||
if(orientation==2)//TODO currently broken, only orientation 3 works atm
|
|
||||||
{
|
{
|
||||||
xCooe=-incomingLink.getX()+incX;
|
//Compute the X-axis and Z-axis translations that will shift
|
||||||
yCooe=-incomingLink.getY()+incY;
|
//and rotate our structure properly.
|
||||||
zCooe=-incomingLink.getZ()+incZ;
|
switch (orientation)
|
||||||
}
|
|
||||||
if(orientation==3)//TODO this only works because it is the default orientation of the pocket dim
|
|
||||||
{
|
{
|
||||||
|
case 0:
|
||||||
xCooe = -incomingLink.getX() + incX;
|
xCooe = -incomingLink.getX() + incX;
|
||||||
yCooe=-incomingLink.getY()+incY;
|
|
||||||
zCooe = -incomingLink.getZ() + incZ;
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
//loop to actually place the blocks
|
for ( y = 0; y < height; y++)
|
||||||
for ( x = 0; x < width; ++x)
|
|
||||||
{
|
|
||||||
for ( y = 0; y < height; ++y)
|
|
||||||
{
|
|
||||||
for ( z = 0; z < length; ++z)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
int index = y * width * length + z * width + x;
|
int index = y * width * length + z * width + x;
|
||||||
|
|||||||
@@ -391,7 +391,7 @@ public class mod_pocketDim
|
|||||||
@ServerStarting
|
@ServerStarting
|
||||||
public void serverStarting(FMLServerStartingEvent event)
|
public void serverStarting(FMLServerStartingEvent event)
|
||||||
{
|
{
|
||||||
CommandRegenPocket.instance().register(event);
|
CommandResetDungeons.instance().register(event);
|
||||||
CommandCreateDungeonRift.instance().register(event);
|
CommandCreateDungeonRift.instance().register(event);
|
||||||
CommandDeleteAllLinks.instance().register(event);
|
CommandDeleteAllLinks.instance().register(event);
|
||||||
CommandDeleteDimensionData.instance().register(event);
|
CommandDeleteDimensionData.instance().register(event);
|
||||||
|
|||||||
Reference in New Issue
Block a user