SkyeDarkhawk

PlayerCommands Diff

Jun 15th, 2011
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 8.31 KB | None | 0 0
  1. # This patch file was generated by NetBeans IDE
  2. # It uses platform neutral UTF-8 encoding and \n newlines.
  3. --- C:\Users\Jeremy\Dropbox\CanaryMod\src\PlayerCommands.java
  4. +++ C:\Users\Jeremy\Desktop\MinecraftServer\src\PlayerCommands.java
  5. @@ -244,7 +244,29 @@
  6.                  return;
  7.  
  8.              Player player = etc.getServer().matchPlayer(split[1]);
  9. +            if (player.getWorld().getType() != ((Player) caller).getWorld().getType()){
  10. +                if (((Player) caller).canIgnoreRestrictions()){
  11. +                    if (player != null){
  12. +                        if (caller.getName().equalsIgnoreCase(player.getName())){
  13. +                            caller.notify("You can't do that...");
  14. +                            return;
  15. +                        }
  16. +                        log.info(caller.getName() + " shifted worlds and teleported to " + player.getName());
  17.  
  18. +                        caller.notify("You feel the world shifting...");
  19. +                        ((Player) caller).switchWorlds();
  20. +                        caller.notify("The worlds suddenly snap back.");
  21. +                        if (((Player) caller).getWorld().getType() != player.getWorld().getType()){
  22. +                            caller.notify("The veil between worlds is still too strong.");
  23. +                        return;
  24. +                        }
  25. +                    }
  26. +                } else {
  27. +                
  28. +                caller.notify("That player is in another world.");
  29. +                return;
  30. +            }}
  31. +            
  32.              if (player != null) {
  33.                  if (caller.getName().equalsIgnoreCase(player.getName())) {
  34.                      caller.notify("You're already here!");
  35. @@ -266,7 +288,29 @@
  36.                  return;
  37.  
  38.              Player player = etc.getServer().matchPlayer(split[1]);
  39. +            if (player.getWorld().getType() != ((Player) caller).getWorld().getType()){
  40. +                if (((Player) caller).canIgnoreRestrictions()){
  41. +                    if (player != null){
  42. +                        if (caller.getName().equalsIgnoreCase(player.getName())){
  43. +                            caller.notify("You can't do that...");
  44. +                            return;
  45. +                        }
  46. +                        log.info(caller.getName() + " caused the worlds to shift around " + player.getName());
  47.  
  48. +                        player.sendMessage("§4You feel the world shifting...");
  49. +                        player.switchWorlds();
  50. +                        if (player.getWorld().getType() != ((Player) caller).getWorld().getType()){
  51. +                            player.sendMessage("§4The veil between worlds keeps you in your place.");
  52. +                            return;
  53. +                        }
  54. +                    }
  55. +                } else {
  56. +                
  57. +                caller.notify("That player is in another world.");
  58. +                return;
  59. +            }
  60. +            }
  61. +            
  62.              if (player != null) {
  63.                  if (caller.getName().equalsIgnoreCase(player.getName())) {
  64.                      caller.notify("Wow look at that! You teleported yourself to yourself!");
  65. @@ -634,6 +678,10 @@
  66.                  caller.notify("Could not find player.");
  67.                  return;
  68.              }
  69. +            if ((player.getWorld().getType().getType()) != 0){
  70. +                caller.notify("You cannot set a home in the Nether, mortal.");
  71. +                return;
  72. +            }
  73.  
  74.              Warp home = new Warp();
  75.              home.Location = player.getLocation();
  76. @@ -665,6 +713,21 @@
  77.                  caller.notify("Could not find player.");
  78.                  return;
  79.              }
  80. +            if (toMove.getWorld().getType().getType() != 0){
  81. +                if (toMove.canIgnoreRestrictions()){
  82. +                    toMove.sendMessage("§4You feel the worlds start to shift...");
  83. +                    int derp = toMove.getWorld().getType().getType();
  84. +                    toMove.switchWorlds();
  85. +                    toMove.sendMessage("§4The worlds suddenly snap back into focus.");
  86. +                    if (derp == toMove.getWorld().getType().getType()){
  87. +                            toMove.sendMessage("§4The veil is still too strong.");
  88. +                            return;
  89. +                        }
  90. +                } else {
  91. +                toMove.sendMessage("§4The veil between the worlds keeps you bound to the Nether...");
  92. +                return;
  93. +                }
  94. +            }
  95.  
  96.              toMove.teleportTo(toMove.getWorld().getSpawnLocation());
  97.  
  98. @@ -689,6 +752,11 @@
  99.                  return;
  100.              }
  101.  
  102. +            if ((player.getWorld().getType().getType()) != 0){
  103. +                caller.notify("You cannot set the spawn point in the Nether, mortal.");
  104. +                return;
  105. +            }
  106. +            
  107.              OWorldInfo info = player.getWorld().getWorld().x;
  108.              info.a((int) player.getX(), (int) player.getY(), (int) player.getZ());
  109.  
  110. @@ -714,13 +782,31 @@
  111.              else
  112.                  home = etc.getDataSource().getHome(caller.getName());
  113.  
  114. +            if (player.getWorld().getType().getType() != 0){
  115. +                    if (player.canIgnoreRestrictions()){
  116. +                        player.sendMessage("§4You feel the worlds start to shift...");
  117. +                        int derp = player.getWorld().getType().getType();
  118. +                        player.switchWorlds();
  119. +                        player.sendMessage("§4The worlds suddenly come back into focus.");
  120. +                        if (derp == player.getWorld().getType().getType()){
  121. +                            player.sendMessage("§4The veil is still too strong.");
  122. +                            return;
  123. +                        }
  124. +                    } else {
  125. +                        player.sendMessage("§4The veil between the worlds keeps you in the Nether...");
  126. +                        return;
  127. +                    }
  128. +            }
  129. +            
  130.              if (home != null)
  131.                  player.teleportTo(home.Location);
  132.              else if (split.length > 1 && player.isAdmin())
  133.                  caller.notify("That player home does not exist");
  134.              else
  135.                  player.teleportTo(player.getWorld().getSpawnLocation());
  136. +                
  137.          }
  138. +        
  139.      };
  140.      @Command
  141.      public static final BaseCommand warp = new BaseCommand("[Warp] - Warps to the specified warp.", "Correct usage is: /warp [warpname]", 2, 3) {
  142. @@ -749,6 +835,22 @@
  143.                      if ((caller instanceof Player) && !((Player) caller).isInGroup(warp.Group) && !warp.Group.equals(""))
  144.                          caller.notify("Warp not found.");
  145.                      else {
  146. +                        if (toWarp.getWorld().getType().getType() != 0){
  147. +                            if (toWarp.canIgnoreRestrictions()) {
  148. +                                toWarp.sendMessage("§4You feel the worlds start to shift...");
  149. +                                int derp = toWarp.getWorld().getType().getType();
  150. +                                toWarp.switchWorlds();
  151. +                                toWarp.sendMessage("§4The worlds suddenly snap back into focus...");
  152. +                                if (derp == toWarp.getWorld().getType().getType()){
  153. +                                    toWarp.sendMessage("§4The veil is still too strong.");
  154. +                                    return;
  155. +                                }
  156. +                            } else {
  157. +                                toWarp.sendMessage("§4The veil between the worlds keeps you in the Nether...");
  158. +                                return;
  159. +                            }
  160. +                        }
  161. +                        
  162.                          toWarp.teleportTo(warp.Location);
  163.                          toWarp.sendMessage(Colors.Rose + "Woosh!");
  164.                      }
  165. @@ -787,6 +889,11 @@
  166.              caller.notify("You can't set a warp with \":\" in its name");
  167.              return;
  168.              }*/
  169. +            if (((Player) caller).getWorld().getType().getType() != 0){
  170. +                caller.notify("You cannot set a warp in the Nether, mortal.");
  171. +                return;
  172. +            }
  173. +            
  174.              Warp warp = new Warp();
  175.              warp.Name = split[1];
  176.              warp.Location = ((Player) caller).getLocation();
Advertisement
Add Comment
Please, Sign In to add comment