BlockRift solidity and Teleportation location correction

-Made sure that a BlockRift is not replacable and that you can walk
through them. (It hurts though, but we can say that that's a feature)
-Player now gets teleported on the ground in front of the rift, instead
of 1 block in the air.
This commit is contained in:
Mathijs Riezebos 2017-01-26 00:38:44 +01:00
parent 755dd47fd6
commit 3f367c8ce3
4 changed files with 7 additions and 7 deletions

View file

@ -202,7 +202,7 @@ public class PocketRegistry {
}
}
private int getDiffToPreviousGroup(int ID) {
private static int getDiffToPreviousGroup(int ID) {
int temp = 0;
int group;
for (group = 1; temp <= ID; group++) {

View file

@ -43,10 +43,10 @@ public class TeleportHelper extends Teleporter {
DimDoors.log(TeleportHelper.class, "Teleporting Player within same dimension.");
EntityPlayerMP player = (EntityPlayerMP) entity;
player.setLocationAndAngles(newPos.getX() + 0.5, newPos.getY() + 0.5, newPos.getZ() + 0.5, player.getRotationYawHead(), player.getRotatedYaw(Rotation.CLOCKWISE_180)); //@todo, instead of following line
player.setPositionAndUpdate(newPos.getX() + 0.5, newPos.getY() + 0.5, newPos.getZ() + 0.5);
//player.setLocationAndAngles(newPos.getX() + 0.5, newPos.getY() + 0.05, newPos.getZ() + 0.5, player.getRotationYawHead(), player.getRotatedYaw(Rotation.CLOCKWISE_180)); //@todo, instead of following line
player.setPositionAndUpdate(newPos.getX() + 0.5, newPos.getY() + 0.05, newPos.getZ() + 0.5);
player.world.updateEntityWithOptionalForce(player, false);
player.connection.sendPacket(new SPacketUpdateHealth(player.getHealth(), player.getFoodStats().getFoodLevel(), player.getFoodStats().getSaturationLevel()));
//player.connection.sendPacket(new SPacketUpdateHealth(player.getHealth(), player.getFoodStats().getFoodLevel(), player.getFoodStats().getSaturationLevel()));
} else {
DimDoors.log(TeleportHelper.class, "Teleporting non-Player within same dimension.");
WorldServer world = (WorldServer) entity.world;

View file

@ -39,7 +39,7 @@ public class BlockRift extends Block implements ITileEntityProvider {
private final ArrayList<Block> modBlocksImmuneToRift; // List of DD blocks immune to rifts
public BlockRift() {
super(Material.FIRE);
super(Material.LEAVES); //Fire is replacable. We do not want this block to be replacable. We do want to walf through it though...
setTickRandomly(true);
setHardness(1.0F);
setUnlocalizedName(ID);
@ -102,7 +102,7 @@ public class BlockRift extends Block implements ITileEntityProvider {
*/
@Override
public boolean isBlockSolid(IBlockAccess worldIn, BlockPos pos, EnumFacing side) {
return true;
return false;
}
@Override

View file

@ -57,7 +57,7 @@ public class TileEntityDimDoor extends DDTileEntityBase {
@Override
public Location getTeleportTargetLocation() {
return new Location(this.getWorld().provider.getDimension(), this.getPos().offset(orientation));
return new Location(this.getWorld().provider.getDimension(), this.getPos().offset(orientation).down());
}
@Override