/[projects]/miscJava/minecraft-plugins/hoeruputils/src/HoerupUtils.java
ViewVC logotype

Diff of /miscJava/minecraft-plugins/hoeruputils/src/HoerupUtils.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1176 by torben, Wed Oct 20 16:53:03 2010 UTC revision 1177 by torben, Fri Oct 22 13:49:02 2010 UTC
# Line 91  public class HoerupUtils extends Plugin Line 91  public class HoerupUtils extends Plugin
91                    
92                  }                  }
93    
94                    int roundPos(double input) {
95                            int result = (int) input;
96                            if (input < 0.0) {
97                                    result--;
98                            }
99    
100                            return result;
101                    }
102    
103                  private void setSurface(Player player, String[] split) {                  private void setSurface(Player player, String[] split) {
104                          int valid_block_array[] = {1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 35, 41, 42, 43, 44, 45, 46, 48, 49, 56, 57, 73, 74, 79, 80, 82} ;                          int valid_block_array[] = {1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 35, 41, 42, 43, 44, 45, 46, 48, 49, 56, 57, 73, 74, 79, 80, 82} ;
105    
# Line 137  public class HoerupUtils extends Plugin Line 146  public class HoerupUtils extends Plugin
146                                  return;                                  return;
147                          }                          }
148    
149                          int playerX = (int) player.getX();                          int playerX = roundPos( player.getX() );
150                          int playerY = (int) player.getY();                          int playerY = (int) player.getY();
151                          int playerZ = (int) player.getZ();                          int playerZ = roundPos( player.getZ() );
152    
153                          if(playerY <= 2 && blockid != 7) {                          if(playerY <= 2 && blockid != 7) {
154                                  player.sendMessage("setsurface: at this level you may only use bedrock(id=7)");                                  player.sendMessage("setsurface: at this level you may only use bedrock(id=7)");
# Line 184  public class HoerupUtils extends Plugin Line 193  public class HoerupUtils extends Plugin
193                          System.out.println("Player " + player.getName() + " used fillarea with radius=" + radius);                          System.out.println("Player " + player.getName() + " used fillarea with radius=" + radius);
194                                                    
195    
196                          int playerX = (int) player.getX();                          int playerX = roundPos( player.getX() );
197                          int playerY = (int) player.getY();                          int playerY = (int) player.getY();
198                          int playerZ = (int) player.getZ();                          int playerZ = roundPos( player.getZ() );
199                                                    
200                          Server srv = etc.getServer();                          Server srv = etc.getServer();
201    
# Line 209  public class HoerupUtils extends Plugin Line 218  public class HoerupUtils extends Plugin
218                          System.out.println("Player " + player.getName() + " used levelarea with radius=" + radius);                          System.out.println("Player " + player.getName() + " used levelarea with radius=" + radius);
219                                                    
220    
221                          int playerX = (int) player.getX();                          int playerX = roundPos( player.getX() );
222                          int playerY = (int) player.getY();                          int playerY = (int) player.getY();
223                          int playerZ = (int) player.getZ();                          int playerZ = roundPos( player.getZ() );
224                                                    
225                          Server srv = etc.getServer();                          Server srv = etc.getServer();
226    

Legend:
Removed from v.1176  
changed lines
  Added in v.1177

  ViewVC Help
Powered by ViewVC 1.1.20