Skip to content
This repository was archived by the owner on Aug 21, 2022. It is now read-only.
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
128 changes: 128 additions & 0 deletions CreatePlugin.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

111 changes: 111 additions & 0 deletions CreatePlugin.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Minecraft_Server_GUI
{
public partial class CreatePlugin : Form
{
public string pluginName;
public string pluginAuthor;
public string pluginPath;
public CreatePlugin()
{
InitializeComponent();
}

private void label1_Click(object sender, EventArgs e)
{

}

private void textBox1_TextChanged(object sender, EventArgs e)
{

}

private void button1_Click(object sender, EventArgs e)
{
pluginName = textBox1.Text;
pluginAuthor = textBox2.Text;
pluginPath = textBox3.Text;
//Make All Plugin Files + Folders
try
{
System.IO.Directory.CreateDirectory(pluginPath + pluginName);
System.IO.Directory.CreateDirectory(pluginPath + "Dependencies");
FileStream fileStream = System.IO.File.Create(pluginPath + @"Dependencies\spigot-api-1.18.1.jar");
fileStream.Close();
string[] content = new string[]
{
Properties.Resources.spigot_api_1_18_1
};
System.IO.File.WriteAllLines(pluginPath + @"Dependencies\spigot-api-1.18.1.jar", content);
fileStream = System.IO.File.Create(pluginPath + pluginName + @"\" + pluginName + ".iml");
fileStream.Close();
content = new string[]
{
Properties.Resources.PluginName
};
System.IO.File.WriteAllLines(pluginPath + pluginName + @"\" + pluginName + ".iml", content);
System.IO.Directory.CreateDirectory(pluginPath + pluginName + @"\src");
fileStream = System.IO.File.Create(pluginPath + pluginName + @"\src\plugin.yml");
fileStream.Close();
content = new string[]
{
"name: " + pluginName,
"version: 1.0.0",
"author: " + pluginAuthor,
"main: com." + pluginAuthor + "." + pluginName + "." + pluginName,
"api-version: 1.18",
"commands:"
};
System.IO.File.WriteAllLines(pluginPath + pluginName + @"\src\plugin.yml", content);
System.IO.Directory.CreateDirectory(pluginPath + pluginName + @"\src\com\" + pluginAuthor + @"\" + pluginName);
fileStream = System.IO.File.Create(pluginPath + pluginName + @"\src\com\" + pluginAuthor + @"\" + pluginName + @"\" + pluginName + ".java");
fileStream.Close();
content = new string[]
{
"package com." + pluginAuthor + "." + pluginName + ";",
"",
"import org.bukkit.plugin.java.JavaPlugin;",
"import org.bukkit.ChatColor;",
"",
"public class " + pluginName + " extends JavaPlugin {",
"",
"\t@Override",
"\tpublic void onEnable() {",
"\t\tgetServer().getConsoleSender().sendMessage(ChatColor.GREEN + '[" + pluginName + "]: Plugin Loaded');",
"\t}",
"}"
};
System.IO.File.WriteAllLines(pluginPath + pluginName + @"\src\com\" + pluginAuthor + @"\" + pluginName + @"\" + pluginName + ".java", content);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
Debug.WriteLine(ex.StackTrace);
}
this.Close();
}

private void button2_Click(object sender, EventArgs e)
{
//set plugin path
DialogResult dialogResult = folderBrowserDialog1.ShowDialog();
if (dialogResult == DialogResult.OK)
{
pluginPath = folderBrowserDialog1.SelectedPath + @"\";
}

textBox3.Text = pluginPath;
}
}
}
63 changes: 63 additions & 0 deletions CreatePlugin.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="folderBrowserDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
Loading