Add reload command & remove ebean references

This commit is contained in:
Lennart ten wolde 2017-02-07 22:01:04 +01:00
parent 109cb00b6f
commit 7443277886
7 changed files with 32 additions and 134 deletions

View file

@ -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>

View file

@ -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);
}
}

View file

@ -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"),

View file

@ -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
*/

View file

@ -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;
}
}

View file

@ -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;
}

View file

@ -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;
}