SkyeDarkhawk

Possible fixes

Jun 13th, 2011
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 5.16 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\Location.java
  4. +++ C:\Users\Jeremy\Desktop\MinecraftServer\src\Location.java
  5. @@ -25,6 +25,21 @@
  6.      }
  7.  
  8.      /**
  9. +     * Creates a location with the specified coordinates and dimension
  10. +     *
  11. +     * @param X
  12. +     * @param Y
  13. +     * @param Z
  14. +     * @param enitiyDimension
  15. +     */
  16. +    public Location(double X, double Y, double Z, int entityDimension) {
  17. +        x = X;
  18. +        y = Y;
  19. +        z = Z;
  20. +        dimension = entityDimension;
  21. +    }
  22. +
  23. +    /**
  24.       * Creates a location with the specified coordinates and rotation
  25.       *
  26.       * @param X
  27. @@ -42,6 +57,25 @@
  28.      }
  29.  
  30.      /**
  31. +     * Creates a location with the specified coordinates, rotation, and dimension
  32. +     *
  33. +     * @param X
  34. +     * @param Y
  35. +     * @param Z
  36. +     * @param rotation
  37. +     * @param pitch
  38. +     * @param entityDimension
  39. +     */
  40. +    public Location(double X, double Y, double Z, float rotation, float pitch, int entityDimension) {
  41. +        x = X;
  42. +        y = Y;
  43. +        z = Z;
  44. +        rotX = rotation;
  45. +        rotY = pitch;
  46. +        dimension = entityDimension;
  47. +    }
  48. +    
  49. +    /**
  50.       * X location
  51.       */
  52.      public double x;
  53. @@ -61,4 +95,9 @@
  54.       * Pitch
  55.       */
  56.      public float  rotY;
  57. +    /**
  58. +     * Dimension (Int)
  59. +     */
  60. +    public int dimension;
  61. +    
  62.  }
  63.  
  64. # This patch file was generated by NetBeans IDE
  65. # It uses platform neutral UTF-8 encoding and \n newlines.
  66. --- C:\Users\Jeremy\Dropbox\CanaryMod\src\Player.java
  67. +++ C:\Users\Jeremy\Desktop\MinecraftServer\src\Player.java
  68. @@ -332,9 +332,14 @@
  69.          loc.z = getZ();
  70.          loc.rotX = getRotation();
  71.          loc.rotY = getPitch();
  72. +        loc.dimension = getDimension();
  73.          return loc;
  74.      }
  75.  
  76. +    public int getDimension(){
  77. +        return ((OEntityPlayerMP)entity).s;
  78. +    }
  79. +    
  80.      /**
  81.       * Returns the IP of this player
  82.       *
  83.  
  84. # This patch file was generated by NetBeans IDE
  85. # It uses platform neutral UTF-8 encoding and \n newlines.
  86. --- C:\Users\Jeremy\Dropbox\CanaryMod\src\PlayerCommands.java
  87. +++ C:\Users\Jeremy\Desktop\MinecraftServer\src\PlayerCommands.java
  88. @@ -244,12 +244,18 @@
  89.                  return;
  90.  
  91.              Player player = etc.getServer().matchPlayer(split[1]);
  92. +            OEntityPlayerMP player1 = etc.getMCServer().f.i(caller.getName());
  93. +            OEntityPlayerMP player2 = etc.getMCServer().f.i(split[1]);
  94.  
  95.              if (player != null) {
  96.                  if (caller.getName().equalsIgnoreCase(player.getName())) {
  97.                      caller.notify("You're already here!");
  98.                      return;
  99.                  }
  100. +                if (player1.s != player2.s){
  101. +                    caller.notify("The player you're trying to teleport is in another dimension.");
  102. +                    return;
  103. +                }
  104.  
  105.                  log.info(caller.getName() + " teleported to " + player.getName());
  106.                  ((Player) caller).teleportTo(player);
  107. @@ -665,6 +671,10 @@
  108.                  caller.notify("Could not find player.");
  109.                  return;
  110.              }
  111. +            if (toMove.getDimension() != etc.getServer().getSpawnLocation().dimension){
  112. +                caller.notify("The spawn is in another dimension.");
  113. +                return;
  114. +            }
  115.  
  116.              toMove.teleportTo(etc.getServer().getSpawnLocation());
  117.  
  118. @@ -714,6 +724,11 @@
  119.              else
  120.                  home = etc.getDataSource().getHome(caller.getName());
  121.  
  122. +            if (home.Location.dimension != player.getDimension()){
  123. +                caller.notify("That home is in another dimension.");
  124. +                return;
  125. +            }
  126. +            
  127.              if (home != null)
  128.                  player.teleportTo(home.Location);
  129.              else if (split.length > 1 && player.isAdmin())
  130. @@ -749,6 +764,10 @@
  131.                      if ((caller instanceof Player) && !((Player) caller).isInGroup(warp.Group) && !warp.Group.equals(""))
  132.                          caller.notify("Warp not found.");
  133.                      else {
  134. +                        if (warp.Location.dimension != (toWarp.getDimension())){
  135. +                            caller.notify("That warp is in another dimension.");
  136. +                            return;
  137. +                        }
  138.                          toWarp.teleportTo(warp.Location);
  139.                          toWarp.sendMessage(Colors.Rose + "Woosh!");
  140.                      }
  141.  
  142. # This patch file was generated by NetBeans IDE
  143. # It uses platform neutral UTF-8 encoding and \n newlines.
  144. --- C:\Users\Jeremy\Dropbox\CanaryMod\src\FlatFileSource.java
  145. +++ C:\Users\Jeremy\Desktop\MinecraftServer\src\FlatFileSource.java
  146. @@ -257,7 +257,7 @@
  147.                          String line = scanner.nextLine();
  148.                          if (line.startsWith("#") || line.equals(""))
  149.                              continue;
  150. -                        String[] split = line.split("[^\\\\]:");
  151. +                        String[] split = line.split("\\:");
  152.                          if (split.length < 4)
  153.                              continue;
Advertisement
Add Comment
Please, Sign In to add comment