mirror of
https://github.com/TotalFreedomMC/TF-Marriage.git
synced 2025-02-10 11:05:44 +00:00
Add reload command & remove ebean references
This commit is contained in:
parent
109cb00b6f
commit
7443277886
7 changed files with 32 additions and 134 deletions
2
pom.xml
2
pom.xml
|
@ -4,7 +4,7 @@
|
|||
|
||||
<groupId>com.lenis0012.bukkit</groupId>
|
||||
<artifactId>marriage2</artifactId>
|
||||
<version>2.0.15</version>
|
||||
<version>2.0.16-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>Marriage</name>
|
||||
<url>http://dev.bukkit.org/server-mods/marriage-reloaded/</url>
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
package com.lenis0012.bukkit.marriage2.commands;
|
||||
|
||||
import com.lenis0012.bukkit.marriage2.Marriage;
|
||||
import com.lenis0012.bukkit.marriage2.config.Message;
|
||||
import com.lenis0012.bukkit.marriage2.config.Permissions;
|
||||
import com.lenis0012.bukkit.marriage2.config.Settings;
|
||||
import com.lenis0012.bukkit.marriage2.internal.MarriagePlugin;
|
||||
import com.lenis0012.pluginutils.modules.configuration.ConfigurationModule;
|
||||
|
||||
public class CommandReload extends Command {
|
||||
|
||||
public CommandReload(Marriage marriage) {
|
||||
super(marriage, "reload");
|
||||
|
||||
// Command options
|
||||
setDescription("Reload configuration settings");
|
||||
setPermission(Permissions.RELOAD);
|
||||
setAllowConsole(true);
|
||||
setHidden(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
MarriagePlugin plugin = (MarriagePlugin) marriage.getPlugin();
|
||||
ConfigurationModule module = plugin.getModule(ConfigurationModule.class);
|
||||
module.reloadSettings(Settings.class, false);
|
||||
reply(Message.CONFIG_RELOAD);
|
||||
}
|
||||
}
|
|
@ -52,6 +52,7 @@ public enum Message {
|
|||
PVP_DISABLED("&aYou have disabled pvp with your partner!"),
|
||||
PARTNER_PVP("&aYour partner has changed pvp rules."),
|
||||
BONUS_EXP("&aYou gained %s extra EXP for leveling with your partner!"),
|
||||
CONFIG_RELOAD("&aConfiguration settings were reloaded, please note that some settings may not apply until reboot."),
|
||||
|
||||
// COMMANDS
|
||||
COMMAND_MARRY("Request a marriage with another player"),
|
||||
|
|
|
@ -21,6 +21,7 @@ public enum Permissions {
|
|||
UPDATE("marry.update", 1),
|
||||
CHAT_SPY("marry.chatspy", 1),
|
||||
MIGRATE("marry.migrate", 1),
|
||||
RELOAD("marry.reload", 1),
|
||||
/**
|
||||
* Player commands
|
||||
*/
|
||||
|
|
|
@ -1,86 +0,0 @@
|
|||
package com.lenis0012.bukkit.marriage2.internal.data.models;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Entity
|
||||
@Table(name = "marriage_players")
|
||||
public class LocationModel {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(unique = true, updatable = false)
|
||||
private int id;
|
||||
|
||||
@Column
|
||||
private String world;
|
||||
|
||||
@Column
|
||||
private double x;
|
||||
|
||||
@Column
|
||||
private double y;
|
||||
|
||||
@Column
|
||||
private double z;
|
||||
|
||||
@Column
|
||||
private float yaw;
|
||||
|
||||
@Column
|
||||
private float pitch;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getWorld() {
|
||||
return world;
|
||||
}
|
||||
|
||||
public void setWorld(String world) {
|
||||
this.world = world;
|
||||
}
|
||||
|
||||
public double getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public void setX(double x) {
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
public double getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public void setY(double y) {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public double getZ() {
|
||||
return z;
|
||||
}
|
||||
|
||||
public void setZ(double z) {
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public float getYaw() {
|
||||
return yaw;
|
||||
}
|
||||
|
||||
public void setYaw(float yaw) {
|
||||
this.yaw = yaw;
|
||||
}
|
||||
|
||||
public float getPitch() {
|
||||
return pitch;
|
||||
}
|
||||
|
||||
public void setPitch(float pitch) {
|
||||
this.pitch = pitch;
|
||||
}
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
package com.lenis0012.bukkit.marriage2.internal.data.models;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Table(name = "marriage_players")
|
||||
public class MarriageModel {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(unique = true, updatable = false)
|
||||
private int id;
|
||||
|
||||
@Column(updatable = false, length = 128)
|
||||
private String player1;
|
||||
|
||||
@Column(updatable = false, length = 128)
|
||||
private String player2;
|
||||
|
||||
@ManyToMany
|
||||
@JoinTable
|
||||
private List<PlayerModel> players;
|
||||
|
||||
@Column
|
||||
private boolean pvpEnabled = true;
|
||||
|
||||
@OneToOne(cascade = CascadeType.ALL)
|
||||
@JoinColumn(name = "home_id")
|
||||
private LocationModel home;
|
||||
|
||||
@Column
|
||||
private Timestamp marriedAt = new Timestamp(System.currentTimeMillis());
|
||||
|
||||
@Version
|
||||
private long version;
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package com.lenis0012.bukkit.marriage2.internal.data.models;
|
||||
|
||||
import javax.persistence.ManyToMany;
|
||||
import java.util.List;
|
||||
|
||||
public class PlayerModel {
|
||||
|
||||
@ManyToMany(mappedBy = "players")
|
||||
private List<MarriageModel> marriages;
|
||||
}
|
Loading…
Reference in a new issue