Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 52 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

<groupId>com.magmaguy</groupId>
<artifactId>ResourcePackManager</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.2.1</version>

<properties>
<maven.compiler.source>22</maven.compiler.source>
<maven.compiler.target>22</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand All @@ -22,6 +22,11 @@
<id>central</id>
<url>https://repo1.maven.org/maven2/</url>
</repository>
<repository>
<id>magmaguy-repo-releases</id>
<name>MagmaGuy's Repository</name>
<url>https://repo.magmaguy.com/releases</url>
</repository>
</repositories>

<dependencies>
Expand All @@ -47,10 +52,39 @@
<artifactId>httpclient5</artifactId>
<version>5.3.1</version>
</dependency>
<dependency>
<groupId>com.magmaguy</groupId>
<artifactId>MagmaCore</artifactId>
<version>1.7</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.magmaguy</groupId>
<artifactId>FreeMinecraftModels</artifactId>
<version>1.4.0</version>
<scope>provided</scope>
</dependency>
<!-- Bstats -->
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>3.0.2</version>
<scope>compile</scope>
</dependency>
</dependencies>

<build>
<finalName>ResourcePackManager</finalName>

<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand All @@ -68,11 +102,26 @@
<pattern>org.apache.hc</pattern>
<shadedPattern>com.magmaguy.resourcepackmanager.org.apache.hc</shadedPattern>
</relocation>
<relocation>
<pattern>org.bstats</pattern>
<shadedPattern>com.magmaguy.freeminecraftmodels</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<distributionManagement>
<snapshotRepository>
<id>magmaguy-repo-snapshots</id>
<url>https://magmaguy.com/snapshots</url>
</snapshotRepository>
<repository>
<id>magmaguy-repo-snapshots</id>
<name>MagmaGuy's Repository</name>
<url>https://repo.magmaguy.com/releases</url>
</repository>
</distributionManagement>
</project>
14 changes: 0 additions & 14 deletions src/main/java/com/magmaguy/resourcepackmanager/Logger.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
package com.magmaguy.resourcepackmanager;

import com.magmaguy.freeminecraftmodels.bukkit.Metrics;
import com.magmaguy.magmacore.MagmaCore;
import com.magmaguy.magmacore.command.CommandManager;
import com.magmaguy.magmacore.util.Logger;
import com.magmaguy.resourcepackmanager.autohost.AutoHost;
import com.magmaguy.resourcepackmanager.commands.CommandManager;
import com.magmaguy.resourcepackmanager.commands.DataComplianceRequestCommand;
import com.magmaguy.resourcepackmanager.commands.ReloadCommand;
import com.magmaguy.resourcepackmanager.config.BlueprintFolder;
import com.magmaguy.resourcepackmanager.config.DataConfig;
import com.magmaguy.resourcepackmanager.config.DefaultConfig;
import com.magmaguy.resourcepackmanager.listeners.ResourcePackGeneratedEvent;
import com.magmaguy.resourcepackmanager.mixer.Mix;
import com.magmaguy.resourcepackmanager.playermanager.PlayerManager;
import com.magmaguy.resourcepackmanager.utils.VersionChecker;
import org.bukkit.Bukkit;
import org.bukkit.plugin.Plugin;
import org.bukkit.event.HandlerList;
import org.bukkit.plugin.java.JavaPlugin;

public class ResourcePackManager extends JavaPlugin {

public static Plugin plugin;
public static JavaPlugin plugin;

@Override
public void onEnable() {
Expand All @@ -20,17 +30,36 @@ public void onEnable() {
" | /\\__ \\ _/ |\\/| / _` | ' \\/ _` / _` / -_) '_|\n" +
" |_|_\\|___/_| |_| |_\\__,_|_||_\\__,_\\__, \\___|_| \n" +
" |___/ ");
Logger.info("Enabling ResourcePackManager v." + this.getDescription().getVersion());
Bukkit.getLogger().info("ResourcePackManager v." + this.getDescription().getVersion());

plugin = this;
DefaultConfig.initializeConfig();
new DefaultConfig();
new DataConfig();
BlueprintFolder.initialize();
Mix.initialize();
if (DefaultConfig.isAutoHost())
Bukkit.getPluginManager().registerEvents(new PlayerManager(), this);
CommandManager commandManager = new CommandManager(this, "resourcepackmanager");
commandManager.registerCommand(new ReloadCommand());
commandManager.registerCommand(new DataComplianceRequestCommand());
if (Bukkit.getPluginManager().isPluginEnabled("FreeMinecraftModels"))
Bukkit.getPluginManager().registerEvents(new ResourcePackGeneratedEvent(), this);
Bukkit.getPluginManager().registerEvents(new VersionChecker.VersionCheckerEvents(), this);
AutoHost.initialize();
new CommandManager(this);

Metrics metrics = new Metrics(this, 22867);
VersionChecker.checkPluginVersion();
}

@Override
public void onLoad(){
MagmaCore.createInstance(this);
}

@Override
public void onDisable() {
Logger.info("Disabling ResourcePackManager");
HandlerList.unregisterAll(this);
AutoHost.shutdown();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.magmaguy.resourcepackmanager.api;

import com.magmaguy.magmacore.command.CommandManager;
import com.magmaguy.resourcepackmanager.commands.ReloadCommand;
import com.magmaguy.resourcepackmanager.thirdparty.ThirdPartyResourcePack;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;

import java.util.HashMap;

public class ResourcePackManagerAPI {
public static HashMap<String, ThirdPartyResourcePack> thirdPartyResourcePackHashMap = new HashMap<>();

/**
* Please read and follow the parameters carefully.
* @param pluginName The name of the plugin as it appears in the plugin list. Case-sensitive.
* @param path The absolute path to the resource pack file (zipped or folder), or the URL to the resource pack. Zipped, local resource packs are strongly recommended.
* @param encrypts Whether the pack can be encrypted by the plugin. Currently does nothing.
* @param distributes Whether the plugin can distribute the pack. Currently does nothing.
* @param zips Whether the resource pack linked to is zipped.
* @param local Whether the resource pack is local or not, meaning whether it appears in the directory of the server or is provided as a download link. Local is strongly recommended.
* @param reloadCommand The reload command of the plugin adding a pack. Currently does nothing.
*/
public static void registerResourcePack(String pluginName,
String path,
boolean encrypts,
boolean distributes,
boolean zips,
boolean local,
String reloadCommand) {
thirdPartyResourcePackHashMap.put(pluginName,
new ThirdPartyResourcePack(pluginName, path, encrypts, distributes, zips, local, reloadCommand));
}

/**
* Reloads the plugin, thereby redoing everything necessary to merge and host the resource pack
*/
public static void reloadResourcePack(){
ReloadCommand.reloadPlugin(Bukkit.getConsoleSender());
}
}
Loading