All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ru.cwcode.commands.paperplatform.argument.location.LocationPart Maven / Gradle / Ivy

The newest version!
package ru.cwcode.commands.paperplatform.argument.location;


import org.bukkit.Location;

import java.util.Collections;
import java.util.List;

public enum LocationPart {
  X {
    @Override
    List getSuggestion(Location loc) {
      return Collections.singletonList(String.valueOf(loc.getX()));
    }
  },
  Y {
    @Override
    List getSuggestion(Location loc) {
      return Collections.singletonList(String.valueOf(loc.getY()));
    }
  },
  Z {
    @Override
    List getSuggestion(Location loc) {
      return Collections.singletonList(String.valueOf(loc.getZ()));
    }
  },
  PITCH {
    @Override
    List getSuggestion(Location loc) {
      return Collections.singletonList(String.valueOf(loc.getPitch()));
    }
  },
  YAW {
    @Override
    List getSuggestion(Location loc) {
      return Collections.singletonList(String.valueOf(loc.getYaw()));
    }
  },
  WORLD {
    @Override
    List getSuggestion(Location loc) {
      return Collections.singletonList(loc.getWorld().getName());
    }
  };
  
  List getSuggestion(Location loc) {
    return Collections.emptyList();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy