mirror of
https://github.com/TotalFreedomMC/TF-Marriage.git
synced 2025-02-05 14:22:45 +00:00
udpate for new utils
This commit is contained in:
parent
5d0c8abcca
commit
4f9f2f2d12
8 changed files with 9 additions and 10 deletions
3
pom.xml
3
pom.xml
|
@ -204,14 +204,13 @@
|
|||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
<artifactSet>
|
||||
<includes>
|
||||
<include>mkremins:fanciful</include>
|
||||
<include>com.lenis0012.bukkit:lenisutils</include>
|
||||
</includes>
|
||||
</artifactSet>
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>com.lenis0012.pluginutils</pattern>
|
||||
<shadedPattern>com.lenis0012.libs.pluginutils</shadedPattern>
|
||||
<shadedPattern>com.lenis0012.bukkit.marriage2.libs.pluginutils</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
|
|
|
@ -19,7 +19,7 @@ public enum Gender {
|
|||
public String getChatPrefix() {
|
||||
switch(this) {
|
||||
default:
|
||||
return MarriagePlugin.getInstance().getBukkitConfig("config.yml").get(toString().toLowerCase(), String.class);
|
||||
return MarriagePlugin.getCore().getBukkitConfig("config.yml").get(toString().toLowerCase(), String.class);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -16,7 +16,7 @@ import com.lenis0012.bukkit.marriage2.Marriage;
|
|||
public class MarriagePlugin extends PluginHolder {
|
||||
private static MarriageCore core;
|
||||
|
||||
public static Marriage getInstance() {
|
||||
public static Marriage getCore() {
|
||||
return core;
|
||||
}
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ public class DataManager {
|
|||
final int days = config.getInt("auto-purge.purge-after-days", 45);
|
||||
final boolean purgeMarried = config.getBoolean("auto-purge.purge-married-players", false);
|
||||
final long daysInMillis = days * 24 * 60 * 60 * 1000L;
|
||||
Bukkit.getScheduler().runTaskTimerAsynchronously(MarriagePlugin.getInstance().getPlugin(), new Runnable() {
|
||||
Bukkit.getScheduler().runTaskTimerAsynchronously(MarriagePlugin.getCore().getPlugin(), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
long startTime = System.currentTimeMillis();
|
||||
|
|
|
@ -113,7 +113,7 @@ public class MarriageData implements MData {
|
|||
}
|
||||
|
||||
public void saveAsync() {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(MarriagePlugin.getInstance().getPlugin(), new Runnable() {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(MarriagePlugin.getCore().getPlugin(), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
dataManager.saveMarriage(MarriageData.this);
|
||||
|
|
|
@ -105,7 +105,7 @@ public class MarriagePlayer implements MPlayer {
|
|||
|
||||
@Override
|
||||
public MPlayer getPartner() {
|
||||
Marriage core = MarriagePlugin.getInstance();
|
||||
Marriage core = MarriagePlugin.getCore();
|
||||
if(marriage != null) {
|
||||
UUID id = uuid.equals(marriage.getPlayer1Id()) ? marriage.getPllayer2Id() : marriage.getPlayer1Id();
|
||||
return core.getMPlayer(id);
|
||||
|
@ -120,7 +120,7 @@ public class MarriagePlayer implements MPlayer {
|
|||
return;
|
||||
}
|
||||
|
||||
((MarriageCore) MarriagePlugin.getInstance()).removeMarriage(marriage);
|
||||
((MarriageCore) MarriagePlugin.getCore()).removeMarriage(marriage);
|
||||
MarriagePlayer partner = (MarriagePlayer) getPartner();
|
||||
partner.marriage = null;
|
||||
this.marriage = null;
|
||||
|
|
|
@ -79,7 +79,7 @@ public class BConfig extends YamlConfiguration {
|
|||
output.write(buffer, 0, length);
|
||||
}
|
||||
} catch(Exception e) {
|
||||
MarriagePlugin.getInstance().getLogger().log(Level.WARNING, "Failed to copy file", e);
|
||||
MarriagePlugin.getCore().getLogger().log(Level.WARNING, "Failed to copy file", e);
|
||||
} finally {
|
||||
if(input != null) {
|
||||
try {
|
||||
|
|
|
@ -51,7 +51,7 @@ public class ListQuery {
|
|||
to.sendMessage(ChatColor.GREEN + names.get(data.getPlayer1Id()) + " + " + names.get(data.getPllayer2Id()));
|
||||
}
|
||||
}
|
||||
}.runTask(MarriagePlugin.getInstance().getPlugin());
|
||||
}.runTask(MarriagePlugin.getCore().getPlugin());
|
||||
}
|
||||
|
||||
public int getPages() {
|
||||
|
|
Loading…
Reference in a new issue