From 3f367c8ce32bbc8e519197a4b08f161854b366a7 Mon Sep 17 00:00:00 2001 From: Mathijs Riezebos Date: Thu, 26 Jan 2017 00:38:44 +0100 Subject: [PATCH] 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. --- .../java/com/zixiken/dimdoors/shared/PocketRegistry.java | 2 +- .../java/com/zixiken/dimdoors/shared/TeleportHelper.java | 6 +++--- .../java/com/zixiken/dimdoors/shared/blocks/BlockRift.java | 4 ++-- .../dimdoors/shared/tileentities/TileEntityDimDoor.java | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/zixiken/dimdoors/shared/PocketRegistry.java b/src/main/java/com/zixiken/dimdoors/shared/PocketRegistry.java index 70d403ea..63ed8c6c 100644 --- a/src/main/java/com/zixiken/dimdoors/shared/PocketRegistry.java +++ b/src/main/java/com/zixiken/dimdoors/shared/PocketRegistry.java @@ -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++) { diff --git a/src/main/java/com/zixiken/dimdoors/shared/TeleportHelper.java b/src/main/java/com/zixiken/dimdoors/shared/TeleportHelper.java index 91a18489..a7c64022 100644 --- a/src/main/java/com/zixiken/dimdoors/shared/TeleportHelper.java +++ b/src/main/java/com/zixiken/dimdoors/shared/TeleportHelper.java @@ -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; diff --git a/src/main/java/com/zixiken/dimdoors/shared/blocks/BlockRift.java b/src/main/java/com/zixiken/dimdoors/shared/blocks/BlockRift.java index 3094ebec..ad2f1b21 100644 --- a/src/main/java/com/zixiken/dimdoors/shared/blocks/BlockRift.java +++ b/src/main/java/com/zixiken/dimdoors/shared/blocks/BlockRift.java @@ -39,7 +39,7 @@ public class BlockRift extends Block implements ITileEntityProvider { private final ArrayList 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 diff --git a/src/main/java/com/zixiken/dimdoors/shared/tileentities/TileEntityDimDoor.java b/src/main/java/com/zixiken/dimdoors/shared/tileentities/TileEntityDimDoor.java index 7cdd7172..efb15c22 100644 --- a/src/main/java/com/zixiken/dimdoors/shared/tileentities/TileEntityDimDoor.java +++ b/src/main/java/com/zixiken/dimdoors/shared/tileentities/TileEntityDimDoor.java @@ -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