Advertisement
Guest User

Untitled

a guest
Aug 18th, 2013
477
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.67 KB | None | 0 0
  1. import net.minecraft.client.Minecraft;
  2. import net.minecraft.entity.Entity;
  3. import net.minecraft.entity.player.EntityPlayerMP;
  4. import net.minecraft.world.World;
  5. import net.minecraft.world.WorldServer;
  6. import net.minecraftforge.common.DimensionManager;
  7. import micdoodle8.mods.galacticraft.api.vector.Vector.Vector3;
  8. import micdoodle8.mods.galacticraft.api.world.ITeleportType;
  9. import micdoodle8.mods.galacticraft.core.GCCoreConfigManager;
  10. import micdoodle8.mods.galacticraft.core.entities.GCCorePlayerMP;
  11.  
  12. public class SpaceElevatorTeleportType implements ITeleportType {
  13.  
  14.     @Override
  15.     public boolean useParachute() {
  16.         return true;//whether to use a parachute on spawn. Sets to false on moon and spacestation, and true on the overworld.
  17.     }
  18.  
  19.     @Override
  20.     public Vector3 getPlayerSpawnLocation(WorldServer world, EntityPlayerMP player) {
  21.         GCCorePlayerMP p = null;
  22.         if(player instanceof GCCorePlayerMP){
  23.             p = (GCCorePlayerMP) player;
  24.         }
  25.         if(p == null){
  26.             return getEntitySpawnLocation(world, player);
  27.         }
  28.         else{
  29.             return new Vector3(p.getCoordsTeleportedFromX(), 250, p.getCoordsTeleportedFromZ());//This is where the player spawns, same place he tp'd from.
  30.         }
  31.     }
  32.  
  33.     @Override
  34.     public Vector3 getEntitySpawnLocation(WorldServer world, Entity entity) {
  35.         return new Vector3(entity.posX, 250, entity.posZ);
  36.     }
  37.  
  38.     @Override
  39.     public Vector3 getParaChestSpawnLocation(WorldServer world, EntityPlayerMP player, Random rand) {
  40.         return new Vector3(player.posX, 250, player.posZ);//this determines the chest spawn location
  41.     }
  42.  
  43.     @Override
  44.     public void onSpaceDimensionChanged(World newWorld, EntityPlayerMP player) {}//I honestly dont know what this method does.
  45.  
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement