Release 1.0.0 commit

This commit is contained in:
Fangoboyo 2022-06-07 14:20:08 -07:00
parent 521cabe04f
commit 9edc5ccdd6
19 changed files with 0 additions and 285 deletions

8
.idea/.gitignore vendored
View File

@ -1,8 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@ -1,8 +0,0 @@
<component name="ArtifactManager">
<artifact type="jar" name="PluginInstaller:jar">
<output-path>$PROJECT_DIR$/out/artifacts/PluginInstaller_jar</output-path>
<root id="archive" name="PluginInstaller.jar">
<element id="module-output" name="PluginInstaller" />
</root>
</artifact>
</component>

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="PluginInstaller" />
</profile>
</annotationProcessing>
</component>
</project>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DiscordProjectSettings">
<option name="show" value="ASK" />
<option name="description" value="" />
</component>
</project>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
</component>
</project>

View File

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="PrimCoreRepos-repos" />
<option name="name" value="PrimCoreRepos-repos" />
<option name="url" value="https://github.com/darverdevs/EaglerMavenRepo/raw/main" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>

View File

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<list size="1">
<item index="0" class="java.lang.String" itemvalue="org.bukkit.event.EventHandler" />
</list>
</component>
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<component name="FacetManager">
<facet type="minecraft" name="Minecraft">
<configuration>
<autoDetectTypes>
<platformType>BUKKIT</platformType>
</autoDetectTypes>
</configuration>
</facet>
</component>
</module>

39
pom.xml
View File

@ -1,39 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>tech.nully</groupId>
<artifactId>PrimCore</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<name>PrimCore</name>
<description>A custom coded plugin for primcraft written in Kotlin</description>
<url>nully.tech</url>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<repositories>
<repository>
<id>PrimCoreRepos-repos</id>
<url>https://github.com/darverdevs/EaglerMavenRepo/raw/main</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.EaglerMaven</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.5.2-R1.0</version>
</dependency>
</dependencies>
</project>

View File

@ -1,45 +0,0 @@
package tech.nully.PluginInstaller;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.util.Locale;
public class InstallCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender snder, Command cmd, String label, String[] args) {
// Name checker
if (cmd.getName().equalsIgnoreCase("installpl")) {
snder.sendMessage("Check 1 passed");
if (snder.isOp() || snder instanceof ConsoleCommandSender) {
snder.sendMessage("Check 2 passed");
Installer ins = new Installer();
if (args.length != 1) return false;
snder.sendMessage("Check 3 passed");
String Install_Jar = args[0].toLowerCase();
// Checks if the list of plugin links contains what the user wants to install
if (Main.getJavaURLs().containsKey(Install_Jar)) {
snder.sendMessage("Check 4 passed");
// Creates an input stream based on the corresponding URL from the players first argument
try (InputStream in = URI.create(Main.getJavaURLs().get(Install_Jar)).toURL().openStream()) {
snder.sendMessage("Check 5 passed");
// Installs the plugin
ins.InstallPlugin(in, Install_Jar.toLowerCase(), snder);
snder.sendMessage("You have successfully installed the " + ChatColor.GREEN + Install_Jar.toUpperCase() + ChatColor.WHITE + " plugin!");
return true;
} catch (IOException e) {
}
}
}
}
return false;
}
}

View File

@ -1,34 +0,0 @@
package tech.nully.PluginInstaller;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.util.HashMap;
public class Installer {
private HashMap<String, String> JARURLs = new HashMap<>();
public static HashMap<String, String> SetupInstaller() {
Installer ins = new Installer();
ins.JARURLs.put("dynmap", "https://github.com/darverdevs/PluginInstallerRepo/raw/main/dynmap-1.9.1.jar");;
ins.JARURLs.put("factions", "https://github.com/darverdevs/PluginInstallerRepo/raw/main/Factions.jar");
ins.JARURLs.put("permissionsex", "https://github.com/darverdevs/PluginInstallerRepo/raw/main/PermissionSex.jar");
ins.JARURLs.put("protocollib", "https://github.com/darverdevs/PluginInstallerRepo/raw/main/ProtocolLib.jar");
ins.JARURLs.put("vault", "https://github.com/darverdevs/PluginInstallerRepo/raw/main/Vault.jar");
ins.JARURLs.put("mcore", "https://github.com/darverdevs/PluginInstallerRepo/raw/main/mcore.jar");
return ins.JARURLs;
}
public void InstallPlugin(InputStream in, String pluginName, CommandSender s) throws IOException {
File f = new File(Main.getInstance().getDataFolder().getParent() + "/" + pluginName + ".jar");
s.sendMessage("Check 1x passed");
Files.copy(in, f.toPath(), StandardCopyOption.REPLACE_EXISTING);
System.out.println(f.toPath().toString());
s.sendMessage("Check 2x passed");
}
}

View File

@ -1,40 +0,0 @@
package tech.nully.PluginInstaller;
import org.bukkit.ChatColor;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.HashMap;
public class Main extends JavaPlugin {
private static Plugin instance = null;
public static Plugin getInstance() {
return instance;
}
private static HashMap<String, String> javaURLs = null;
public static HashMap<String, String> getJavaURLs() {
return javaURLs;
}
@Override
public void onEnable() {
instance = this;
getCommand("installpl").setExecutor(new InstallCommand());
javaURLs = Installer.SetupInstaller();
getServer().getConsoleSender().sendMessage("--------------------------------------------");
getServer().getConsoleSender().sendMessage("--------------------------------------------");
getServer().getConsoleSender().sendMessage(
ChatColor.GREEN + "[PluginInstaller]" + ChatColor.AQUA + " PluginInstaller V1.0.0 is now Enabled! :D");
getServer().getConsoleSender().sendMessage("--------------------------------------------");
getServer().getConsoleSender().sendMessage("--------------------------------------------");
}
@Override
public void onDisable() {
getServer().getConsoleSender().sendMessage("--------------------------------------------");
getServer().getConsoleSender().sendMessage("--------------------------------------------");
getServer().getConsoleSender().sendMessage(
ChatColor.GREEN + "[PluginInstaller]" + ChatColor.AQUA + " PluginInstaller V1.0.0 is now Disabled! D:");
getServer().getConsoleSender().sendMessage("--------------------------------------------");
getServer().getConsoleSender().sendMessage("--------------------------------------------");
}
}

View File

@ -1,11 +0,0 @@
name: PluginInstaller
version: 1.0.0
main: tech.nully.PluginInstaller.Main
prefix: [PluginInstaller]
authors: [BongoCat]
description: A plugin that is capable of installing the latest compatible version of plugins with eaglercraft
website: nully.tech
commands:
installpl:
usage: /<command> <plugin>
description: Installs the latest compatible version of the requested plugin

View File

@ -1,11 +0,0 @@
name: PluginInstaller
version: 1.0.0
main: tech.nully.PluginInstaller.Main
prefix: [PluginInstaller]
authors: [BongoCat]
description: A plugin that is capable of installing the latest compatible version of plugins with eaglercraft
website: nully.tech
commands:
installpl:
usage: /<command> <plugin>
description: Installs the latest compatible version of the requested plugin