Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.lenic.onix.warps;
- import com.flowpowered.math.vector.Vector3d;
- import de.lenic.onix.Onix;
- import org.spongepowered.api.entity.Entity;
- import org.spongepowered.api.world.Location;
- import org.spongepowered.api.world.extent.Extent;
- import java.util.Optional;
- import java.util.UUID;
- public class WarpPoint {
- private String name;
- private Location loc;
- private Vector3d vector;
- // Constructor
- public WarpPoint(String name, UUID uuid, double block_x, double block_y, double block_z, Vector3d vector){
- this.name = name;
- this.loc = new Location(Onix.game.getServer().getWorld(uuid).get(), block_x, block_y, block_z);
- this.vector = vector;
- }
- // Get | Set name
- public String getName(){
- return this.name;
- }
- public void setName(String name){
- this.name = name;
- }
- // Get | Set world
- public Optional<Extent> getExtent(){
- return Optional.of(this.loc.getExtent());
- }
- public void setExtent(Extent extent){
- this.loc.setExtent(extent);
- }
- // Get | Set location
- public Location getLocation(){
- return this.loc;
- }
- public void setLocation(Location loc){
- this.loc = loc;
- }
- // Warp player to warp point
- public void warpPlayer(Entity entity){
- entity.setLocationAndRotationSafely(this.loc, this.vector);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement