Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(commandSplit[1].equals("set"))
- {
- p = 1;
- try
- {
- writer = new BufferedWriter(new FileWriter(new File("/SMP-home"+".txt")));
- writer.write("#This are the homes, which were already set. (f.e. 'Feanturi3:x/y/z')");
- }
- catch (IOException f)
- {
- System.out.println(f);
- }
- boolean user = false;
- for(int x = 0; x < arrayHomeTp.size() ; x++)
- {
- MSC_homeTP homeTp = arrayHomeTp.get(x);
- if(homeTp.username.equalsIgnoreCase(username))
- {
- user = true;
- World world = ModLoader.getMinecraftServerInstance().getWorldManager(1).worldProvider.worldObj;
- EntityPlayer entityplayermp = world.getPlayerEntityByName(username);
- arrayHomeTp.remove(x);
- arrayHomeTp.add(new MSC_homeTP(username, (int)entityplayermp.posX, (int)entityplayermp.posY, (int)entityplayermp.posZ));
- icommandlistener.info(username+":"+(int)entityplayermp.posX+"/"+(int)entityplayermp.posY+"/"+(int)entityplayermp.posZ);
- }
- if(!user)
- {
- try
- {
- icommandlistener.info(homeTp.username+":"+homeTp.i+"/"+homeTp.j+"/"+homeTp.k);
- writer.newLine();
- writer.write(homeTp.username+":"+homeTp.i+"/"+homeTp.j+"/"+homeTp.k);
- }
- catch (IOException e)
- {
- System.out.println(e);
- }
- }
- }
- if(!user)
- {
- World world = ModLoader.getMinecraftServerInstance().getWorldManager(1).worldProvider.worldObj;
- EntityPlayer entityplayermp = world.getPlayerEntityByName(username);
- arrayHomeTp.add(new MSC_homeTP(username, (int)entityplayermp.posX, (int)entityplayermp.posY, (int)entityplayermp.posZ));
- try
- {
- icommandlistener.info(username+":"+(int)entityplayermp.posX+"/"+(int)entityplayermp.posY+"/"+(int)entityplayermp.posZ);
- writer.newLine();
- writer.write(username+":"+(int)entityplayermp.posX+"/"+(int)entityplayermp.posY+"/"+(int)entityplayermp.posZ);
- }
- catch (IOException e)
- {
- System.out.println(e);
- }
- }
- try
- {
- writer.flush();
- writer.close();
- }
- catch (IOException e)
- {
- System.out.println(e);
- }
- }
Add Comment
Please, Sign In to add comment