mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 22:17:17 +00:00
Version 3.0 setup
This commit is contained in:
1 parent
e122816613
commit
58ffaa0641
23 files changed
+874
-2
No files matched your search
@@ -0,0 +1,30 @@
|
||||
package net.william278.huskhomes.position;
|
||||
|
||||
import net.william278.huskhomes.player.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Represents a home set by a {@link Player}
|
||||
*/
|
||||
public class Home extends SavedPosition {
|
||||
|
||||
/**
|
||||
* The {@link Player} who owns this home
|
||||
*/
|
||||
@NotNull
|
||||
public final Player owner;
|
||||
|
||||
/**
|
||||
* {@code true} if this home is public
|
||||
*/
|
||||
public boolean isPublic;
|
||||
|
||||
public Home(double x, double y, double z, float yaw, float pitch,
|
||||
@NotNull World world, @NotNull Server server,
|
||||
@NotNull PositionMeta positionMeta,
|
||||
@NotNull Player owner, boolean isPublic) {
|
||||
super(x, y, z, yaw, pitch, world, server, positionMeta);
|
||||
this.owner = owner;
|
||||
this.isPublic = isPublic;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package net.william278.huskhomes.position;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Represents a position somewhere on the proxy network or server
|
||||
*/
|
||||
public class Position {
|
||||
|
||||
/**
|
||||
* The double-precision defined x coordinate of the position
|
||||
*/
|
||||
public double x;
|
||||
|
||||
/**
|
||||
* The double-precision defined y coordinate of the position
|
||||
*/
|
||||
public double y;
|
||||
|
||||
/**
|
||||
* The double-precision defined z coordinate of the position
|
||||
*/
|
||||
public double z;
|
||||
|
||||
/**
|
||||
* The float-precision defined yaw facing of the position
|
||||
*/
|
||||
public float yaw;
|
||||
|
||||
/**
|
||||
* The float-precision defined pitch facing of the position
|
||||
*/
|
||||
public float pitch;
|
||||
|
||||
/**
|
||||
* The {@link World} the position is within
|
||||
*/
|
||||
@NotNull
|
||||
public World world;
|
||||
|
||||
/**
|
||||
* The {@link Server} the position is on
|
||||
*/
|
||||
@NotNull
|
||||
public Server server;
|
||||
|
||||
public Position(double x, double y, double z, float yaw, float pitch, @NotNull World world, @NotNull Server server) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.yaw = yaw;
|
||||
this.pitch = pitch;
|
||||
this.world = world;
|
||||
this.server = server;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package net.william278.huskhomes.position;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Represents metadata about a {@link Position}, used in {@link SavedPosition} implementations
|
||||
*/
|
||||
public class PositionMeta {
|
||||
|
||||
/**
|
||||
* The name of this position
|
||||
*/
|
||||
@NotNull
|
||||
public String name;
|
||||
|
||||
/**
|
||||
* A description of this position
|
||||
*/
|
||||
@NotNull
|
||||
public String description;
|
||||
|
||||
public PositionMeta(@NotNull String name, @NotNull String description) {
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package net.william278.huskhomes.position;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class SavedPosition extends Position {
|
||||
@NotNull
|
||||
public final PositionMeta positionMeta;
|
||||
|
||||
public SavedPosition(double x, double y, double z, float yaw, float pitch,
|
||||
@NotNull World world, @NotNull Server server,
|
||||
@NotNull PositionMeta positionMeta) {
|
||||
super(x, y, z, yaw, pitch, world, server);
|
||||
this.positionMeta = positionMeta;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package net.william278.huskhomes.position;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Represents a server on a proxied network
|
||||
*/
|
||||
public class Server {
|
||||
|
||||
/**
|
||||
* Proxy-defined identifier of this server
|
||||
*/
|
||||
public String id;
|
||||
|
||||
/**
|
||||
* Plugin-assigned identifier of this server
|
||||
*/
|
||||
public UUID uuid;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package net.william278.huskhomes.position;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Represents a server warp
|
||||
*/
|
||||
public class Warp extends SavedPosition {
|
||||
|
||||
public Warp(double x, double y, double z, float yaw, float pitch,
|
||||
@NotNull World world, @NotNull Server server,
|
||||
@NotNull PositionMeta positionMeta) {
|
||||
super(x, y, z, yaw, pitch, world, server, positionMeta);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package net.william278.huskhomes.position;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Represents a world on a server
|
||||
*/
|
||||
public class World {
|
||||
|
||||
/**
|
||||
* The name of this world, as defined by the world directory name
|
||||
*/
|
||||
public String name;
|
||||
|
||||
/**
|
||||
* UUID of this world, as defined by the {@code uid.dat} file in the world directory
|
||||
*/
|
||||
public UUID uuid;
|
||||
|
||||
public World(String name, UUID uuid) {
|
||||
this.name = name;
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user