Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Wug's usePortal ==
- public void usePortal(int i)
- {
- int j = thePlayer.dimension;
- thePlayer.dimension = i;
- theWorld.setEntityDead(thePlayer);
- thePlayer.isDead = false;
- WorldProvider newWorldProvider = WugApi.getProviderForDimension(thePlayer.dimension);
- WorldProvider oldWorldProvider = WugApi.getProviderForDimension(j);
- Position oldpos = new Position(thePlayer);
- Position newpos = newWorldProvider.getEntryPoint(oldWorldProvider.getExitPoint(oldpos));
- if (!newWorldProvider.canRespawnHere() || thePlayer.isEntityAlive())
- thePlayer.setLocationAndAngles(newpos.x, newpos.y, newpos.z, thePlayer.rotationYaw, thePlayer.rotationPitch);
- if (thePlayer.isEntityAlive())
- theWorld.updateEntityWithOptionalForce(thePlayer, false);
- changeWorld(new World(theWorld, newWorldProvider), newWorldProvider.travelMsg(j), thePlayer);
- thePlayer.worldObj = theWorld;
- System.out.println((new StringBuilder()).append("Teleported to ").append(theWorld.worldProvider.worldType).toString());
- newWorldProvider.relocate(theWorld, thePlayer, oldWorldProvider);
- }
- // Notch's usePortal ==
- public void usePortal(int i)
- {
- int j = thePlayer.dimension;
- thePlayer.dimension = i;
- theWorld.setEntityDead(thePlayer);
- thePlayer.isDead = false;
- double d = thePlayer.posX;
- double d1 = thePlayer.posZ;
- double d2 = 1.0D;
- if(j > -1 && thePlayer.dimension == -1)
- {
- d2 = 0.125D;
- } else
- if(j == -1 && thePlayer.dimension > -1)
- {
- d2 = 8D;
- }
- d *= d2;
- d1 *= d2;
- if(thePlayer.dimension == -1)
- {
- thePlayer.setLocationAndAngles(d, thePlayer.posY, d1, thePlayer.rotationYaw, thePlayer.rotationPitch);
- if(thePlayer.isEntityAlive())
- {
- theWorld.updateEntityWithOptionalForce(thePlayer, false);
- }
- World world = null;
- world = new World(theWorld, WorldProvider.getProviderForDimension(thePlayer.dimension));
- changeWorld(world, "Entering the Nether", thePlayer);
- } else
- if(thePlayer.dimension == 0)
- {
- if(thePlayer.isEntityAlive())
- {
- thePlayer.setLocationAndAngles(d, thePlayer.posY, d1, thePlayer.rotationYaw, thePlayer.rotationPitch);
- theWorld.updateEntityWithOptionalForce(thePlayer, false);
- }
- World world1 = null;
- world1 = new World(theWorld, WorldProvider.getProviderForDimension(thePlayer.dimension));
- if(j == -1)
- {
- changeWorld(world1, "Leaving the Nether", thePlayer);
- } else
- {
- changeWorld(world1, "Leaving the End", thePlayer);
- }
- } else
- {
- World world2 = null;
- world2 = new World(theWorld, WorldProvider.getProviderForDimension(thePlayer.dimension));
- ChunkCoordinates chunkcoordinates = world2.func_40472_j();
- d = chunkcoordinates.posX;
- thePlayer.posY = chunkcoordinates.posY;
- d1 = chunkcoordinates.posZ;
- thePlayer.setLocationAndAngles(d, thePlayer.posY, d1, 90F, 0.0F);
- if(thePlayer.isEntityAlive())
- {
- world2.updateEntityWithOptionalForce(thePlayer, false);
- }
- changeWorld(world2, "Entering the End", thePlayer);
- }
- thePlayer.worldObj = theWorld;
- System.out.println((new StringBuilder()).append("Teleported to ").append(theWorld.worldProvider.worldType).toString());
- if(thePlayer.isEntityAlive() && j < 1)
- {
- thePlayer.setLocationAndAngles(d, thePlayer.posY, d1, thePlayer.rotationYaw, thePlayer.rotationPitch);
- theWorld.updateEntityWithOptionalForce(thePlayer, false);
- (new Teleporter()).placeInPortal(theWorld, thePlayer);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement