Fixed More Bugs

Fixed a similar bug in DDTeleporter and PocketBuilder that caused things
to be oriented wrong. Specifically, teleporting would orient the player
wrong relative to the destination door and pockets would be oriented
wrong relative to their parents. Teleporting works properly now.
This commit is contained in:
SenseiKiwi 2013-09-04 14:29:53 -04:00
parent b3847a62b7
commit 70eb276086
2 changed files with 6 additions and 6 deletions

View file

@ -142,8 +142,8 @@ public class DDTeleporter
throw new IllegalStateException("The destination world should be loaded!");
}
//Check if the block at that point is actually a door
int blockID = world.getBlockId(door.getX(), door.getY(), door.getZ());
//Check if the block below that point is actually a door
int blockID = world.getBlockId(door.getX(), door.getY() - 1, door.getZ());
if (blockID != properties.DimensionalDoorID && blockID != properties.WarpDoorID &&
blockID != properties.TransientDoorID && blockID != properties.UnstableDoorID)
{
@ -152,7 +152,7 @@ public class DDTeleporter
}
//Return the orientation portion of its metadata
return world.getBlockMetadata(door.getX(), door.getY(), door.getZ()) & 3;
return world.getBlockMetadata(door.getX(), door.getY() - 1, door.getZ()) & 3;
}
public static Entity teleportEntity(Entity entity, Point4D destination)

View file

@ -227,8 +227,8 @@ public class PocketBuilder
throw new IllegalStateException("The link's source world should be loaded!");
}
//Check if the block at that point is actually a door
int blockID = world.getBlockId(source.getX(), source.getY(), source.getZ());
//Check if the block below that point is actually a door
int blockID = world.getBlockId(source.getX(), source.getY() - 1, source.getZ());
if (blockID != properties.DimensionalDoorID && blockID != properties.WarpDoorID &&
blockID != properties.TransientDoorID)
{
@ -236,7 +236,7 @@ public class PocketBuilder
}
//Return the orientation portion of its metadata
int orientation = world.getBlockMetadata(source.getX(), source.getY(), source.getZ()) & 3;
int orientation = world.getBlockMetadata(source.getX(), source.getY() - 1, source.getZ()) & 3;
return orientation;
}