Skip to content

Commit

Permalink
feat(VoteReward): Change package.
Browse files Browse the repository at this point in the history
New package for VoteRewardExtension, VoteRewardPlugin and VoteRewardImpl
  • Loading branch information
GeorgeV220 committed Nov 28, 2022
1 parent fa2a725 commit 320e266
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 21 deletions.
3 changes: 2 additions & 1 deletion src/main/java/com/georgev22/voterewards/VoteReward.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import com.georgev22.voterewards.utilities.interfaces.IDatabaseType;
import com.georgev22.voterewards.utilities.player.UserVoteData;
import com.georgev22.voterewards.utilities.player.VoteUtils;
import com.georgev22.voterewards.votereward.VoteRewardImpl;
import com.google.common.collect.Lists;
import com.mongodb.client.MongoClient;
import lombok.Getter;
Expand Down Expand Up @@ -128,7 +129,7 @@ public static VoteReward getInstance() {
return instance;
}

protected VoteReward(@NotNull VoteRewardImpl voteReward) {
public VoteReward(@NotNull VoteRewardImpl voteReward) {
this.voteReward = voteReward;
this.dataFolder = voteReward.getDataFolder();
this.logger = voteReward.getLogger();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.georgev22.voterewards.utilities.inventories;

import com.georgev22.voterewards.VoteRewardPlugin;
import com.georgev22.voterewards.votereward.VoteRewardPlugin;
import org.bukkit.entity.Player;

public class AdminInventory {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.georgev22.voterewards;
package com.georgev22.voterewards.votereward;

import com.georgev22.library.extensions.Extensions;
import com.georgev22.library.extensions.java.JavaExtension;
import com.georgev22.api.libraryloader.exceptions.InvalidDependencyException;
import com.georgev22.api.libraryloader.exceptions.UnknownDependencyException;
import lombok.Getter;
import com.georgev22.voterewards.VoteReward;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package com.georgev22.voterewards;
package com.georgev22.voterewards.votereward;

import com.georgev22.library.extensions.Extension;
import com.georgev22.library.extensions.ExtensionDescriptionFile;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull;

import java.io.File;
Expand All @@ -30,11 +28,11 @@ final class Description {

private ExtensionDescriptionFile extensionDescriptionFile;

protected Description(PluginDescriptionFile pluginDescriptionFile) {
Description(PluginDescriptionFile pluginDescriptionFile) {
this.pluginDescriptionFile = pluginDescriptionFile;
}

protected Description(ExtensionDescriptionFile extensionDescriptionFile) {
Description(ExtensionDescriptionFile extensionDescriptionFile) {
this.extensionDescriptionFile = extensionDescriptionFile;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.georgev22.voterewards;
package com.georgev22.voterewards.votereward;

import com.georgev22.api.libraryloader.LibraryLoader;
import com.georgev22.api.libraryloader.annotations.MavenLibrary;
import com.georgev22.api.libraryloader.exceptions.InvalidDependencyException;
import com.georgev22.api.libraryloader.exceptions.UnknownDependencyException;
import com.georgev22.voterewards.VoteReward;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.PluginDescriptionFile;
Expand All @@ -23,10 +24,6 @@ public class VoteRewardPlugin extends JavaPlugin implements VoteRewardImpl {

private Description description;

public static VoteReward getVoteReward() {
return voteRewardInstance;
}

public VoteRewardPlugin() {
super();
}
Expand All @@ -38,11 +35,11 @@ protected VoteRewardPlugin(JavaPluginLoader loader, PluginDescriptionFile descri
@Override
public void onLoad() {
instance = this;
description = new Description(getDescription());
voteRewardInstance = new VoteReward(this);
try {
new LibraryLoader(this.getClass(), this.getDataFolder()).loadAll();
getVoteReward().onLoad();
description = new Description(getDescription());
voteRewardInstance = new VoteReward(this);
voteRewardInstance.onLoad();
} catch (UnknownDependencyException | InvalidDependencyException e) {
getLogger().log(Level.SEVERE, "Error: ", e);
}
Expand All @@ -51,16 +48,16 @@ public void onLoad() {
@Override
public void onEnable() {
try {
getVoteReward().setPlugin(this);
getVoteReward().onEnable();
voteRewardInstance.setPlugin(this);
voteRewardInstance.onEnable();
} catch (Exception e) {
getLogger().log(Level.SEVERE, "Error: ", e);
}
}

@Override
public void onDisable() {
getVoteReward().onDisable();
voteRewardInstance.onDisable();
Bukkit.getScheduler().cancelTasks(this);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/extension.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: VoteRewards
version: ${version}
main: com.georgev22.voterewards.VoteRewardExtension
main: com.georgev22.voterewards.votereward.VoteRewardExtension
package: com.georgev22.voterewards
api-version: 1.19
authors: [ GeorgeV22 ]
Expand Down

0 comments on commit 320e266

Please sign in to comment.