Advertisement
Guest User

minecraftforge dimension chaniging from the end

a guest
Feb 27th, 2016
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.50 KB | None | 0 0
  1.     // if changing dimensions
  2.     if (! bedIsInThisDim ) {
  3.       // check if in The End dimension and if the dragon is alive
  4.       boolean dragonIsAlive = false;
  5.       if ( originDim == 1 ) { // if in The End ...
  6.         for ( int k = 0; k < world.loadedEntityList.size(); k++ ) {
  7.           Entity it = (Entity) world.loadedEntityList.get(k);
  8.           if ( it instanceof EntityDragon ) {
  9.             dragonIsAlive = true;
  10.             k = world.loadedEntityList.size();
  11.           }
  12.         }
  13.       } // end dragon check
  14.       // if trying to go out of The End
  15.       SpawnCommands.loadMiscConfig();
  16.       if (( originDim == 1 ) && ( bedDim != 1 ) && ( dragonIsAlive ) && (! Do.getConfigArrayValueBoolean(SpawnCommands.miscConfigArray, "AllowToLeaveTheDragon")) )
  17.       { Do.Say(player,"The mighty dragon is in control of this world. You must defeat the dragon or death is your only escape!"); return; }
  18.       // The following is a hack fix that overcomes a problem when directly leaving the end to any other dimension.
  19.       // The problem: when you leave the end to another dimension the world will NOT load.
  20.       // The solution: when you go to another dimension then go to a third one it WILL load, so we go to another one on the way.
  21.       if ( ( originDim == 1 ) && ( bedDim != 1 ) ) {
  22.         if ( bedDim == 0 ) { player.travelToDimension(-1); } else { player.travelToDimension(0); }
  23.       }
  24.       player.travelToDimension(bedDim); // officially change dimension now
  25.     } // end if changing dimensions
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement