|
9 | 9 | import gollorum.signpost.network.messages.ChatMessage; |
10 | 10 | import gollorum.signpost.network.messages.TeleportRequestMessage; |
11 | 11 | import gollorum.signpost.util.*; |
| 12 | +import net.minecraft.entity.Entity; |
12 | 13 | import net.minecraft.entity.player.EntityPlayer; |
13 | 14 | import net.minecraft.entity.player.EntityPlayerMP; |
14 | 15 | import net.minecraft.init.Blocks; |
15 | 16 | import net.minecraft.item.Item; |
16 | 17 | import net.minecraft.item.ItemStack; |
17 | 18 | import net.minecraft.util.math.BlockPos; |
| 19 | +import net.minecraft.world.World; |
18 | 20 | import net.minecraft.world.WorldServer; |
| 21 | +import net.minecraftforge.common.util.ITeleporter; |
19 | 22 | import net.minecraftforge.fml.common.FMLCommonHandler; |
20 | 23 | import net.minecraftforge.fml.relauncher.Side; |
21 | 24 |
|
@@ -251,7 +254,7 @@ public static void confirm(final EntityPlayerMP player){ |
251 | 254 | doPay(player, player.getPosition(), info.destination.teleportPosition.toBlockPos()); |
252 | 255 | SPEventHandler.cancelTask(info.boolRun); |
253 | 256 | if(player.dimension != info.destination.teleportPosition.dim){ |
254 | | - player.changeDimension(info.destination.teleportPosition.dim, null); |
| 257 | + player.changeDimension(info.destination.teleportPosition.dim, new SignTeleporter()); |
255 | 258 | } |
256 | 259 | player.setPositionAndUpdate(info.destination.teleportPosition.x+0.5, info.destination.teleportPosition.y+1, info.destination.teleportPosition.z+0.5); |
257 | 260 | } |
@@ -370,6 +373,12 @@ public static boolean isHandEmpty(EntityPlayer player){ |
370 | 373 | return player.getHeldItemMainhand().getItem().equals(Item.getItemFromBlock(Blocks.AIR)); |
371 | 374 | } |
372 | 375 |
|
| 376 | + private static class SignTeleporter implements ITeleporter { |
| 377 | + |
| 378 | + @Override |
| 379 | + public void placeEntity(World world, Entity entity, float yaw) {} |
| 380 | + } |
| 381 | + |
373 | 382 | public static StonedHashSet getAllWaystones() { |
374 | 383 | StonedHashSet ret = SignpostAdapter.INSTANCE.getExternalBaseInfos(); |
375 | 384 | ret.addAll(allWaystones); |
|
0 commit comments