mirror of
https://github.com/Crazy-Crew/CrazyAuctions.git
synced 2025-01-08 19:38:15 +01:00
Push this shit here
This commit is contained in:
parent
fd186f7034
commit
1bfc8490c6
@ -56,14 +56,14 @@ public class CrazyAuctions extends JavaPlugin implements RubyCore {
|
||||
Config.reload(this);
|
||||
Locale.reload(this);
|
||||
|
||||
AuctionData.load(this);
|
||||
AuctionData.load();
|
||||
|
||||
getCommand("ah").setExecutor(new AuctionCommand());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
AuctionData.save(this);
|
||||
AuctionData.save();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -0,0 +1,9 @@
|
||||
package com.badbones69.crazyauctions.api.interfaces;
|
||||
|
||||
import com.badbones69.crazyauctions.CrazyAuctions;
|
||||
|
||||
public interface Universal {
|
||||
|
||||
CrazyAuctions plugin = CrazyAuctions.getPlugin();
|
||||
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
package com.badbones69.crazyauctions.commands;
|
||||
|
||||
import com.badbones69.crazyauctions.CrazyAuctions;
|
||||
import com.badbones69.crazyauctions.configs.data.AuctionData;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
@ -11,8 +10,6 @@ import java.util.UUID;
|
||||
|
||||
public class AuctionCommand implements CommandExecutor {
|
||||
|
||||
private final CrazyAuctions plugin = CrazyAuctions.getPlugin();
|
||||
|
||||
@Override
|
||||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
|
||||
|
||||
@ -20,7 +17,7 @@ public class AuctionCommand implements CommandExecutor {
|
||||
|
||||
AuctionData.auctionData.putIfAbsent(player.getUniqueId(), UUID.randomUUID().toString());
|
||||
|
||||
AuctionData.save(this.plugin);
|
||||
AuctionData.save();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.badbones69.crazyauctions.configs.data;
|
||||
|
||||
import com.badbones69.crazyauctions.CrazyAuctions;
|
||||
import com.badbones69.crazyauctions.api.interfaces.Universal;
|
||||
import com.google.gson.annotations.Expose;
|
||||
import net.dehya.ruby.common.annotations.FileBuilder;
|
||||
import net.dehya.ruby.common.enums.FileType;
|
||||
import net.dehya.ruby.files.FileExtension;
|
||||
@ -8,19 +9,20 @@ import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@FileBuilder(isLogging = true, isAsync = false, isData = false, fileType = FileType.JSON)
|
||||
public class AuctionData extends FileExtension {
|
||||
public class AuctionData extends FileExtension implements Universal {
|
||||
|
||||
@Expose
|
||||
public static ConcurrentHashMap<UUID, String> auctionData = new ConcurrentHashMap<>();
|
||||
|
||||
public AuctionData() {
|
||||
super("auction-data.json");
|
||||
}
|
||||
|
||||
public static void load(CrazyAuctions plugin) {
|
||||
public static void load() {
|
||||
plugin.getSpigotFileManager().addFile(new AuctionData());
|
||||
}
|
||||
|
||||
public static void save(CrazyAuctions plugin) {
|
||||
public static void save() {
|
||||
plugin.getSpigotFileManager().saveFile(new AuctionData());
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user