mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-17 20:11:21 +02:00
Add Essentials extra and KittyCannon as a demo.
This commit is contained in:
21
EssentialsExtra/pom.xml
Normal file
21
EssentialsExtra/pom.xml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>net.essentials3</groupId>
|
||||||
|
<artifactId>BuildAll</artifactId>
|
||||||
|
<version>3.0-SNAPSHOT</version>
|
||||||
|
<relativePath>../pom.xml</relativePath>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>EssentialsExtra</artifactId>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>${project.groupId}</groupId>
|
||||||
|
<artifactId>Essentials</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
@@ -1,8 +1,7 @@
|
|||||||
package net.ess3.commands;
|
|
||||||
|
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import net.ess3.api.IUser;
|
import net.ess3.api.IUser;
|
||||||
|
import net.ess3.commands.EssentialsCommand;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Ocelot;
|
import org.bukkit.entity.Ocelot;
|
56
EssentialsExtra/src/net/ess3/extra/EssentialsExtra.java
Normal file
56
EssentialsExtra/src/net/ess3/extra/EssentialsExtra.java
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
package net.ess3.extra;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.net.URLClassLoader;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import net.ess3.api.ICommandHandler;
|
||||||
|
import net.ess3.api.IEssentials;
|
||||||
|
import net.ess3.bukkit.BukkitPlugin;
|
||||||
|
import net.ess3.commands.EssentialsCommandHandler;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
|
||||||
|
public class EssentialsExtra extends JavaPlugin
|
||||||
|
{
|
||||||
|
private IEssentials ess;
|
||||||
|
private ICommandHandler handler;
|
||||||
|
private ClassLoader loader;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLoad()
|
||||||
|
{
|
||||||
|
ess = ((BukkitPlugin)getServer().getPluginManager().getPlugin("Essentials-3")).getEssentials();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEnable()
|
||||||
|
{
|
||||||
|
handler = new EssentialsCommandHandler(loader, "Command", "essentials.", ess);
|
||||||
|
File commandDir = new File(ess.getPlugin().getDataFolder(), "extras");
|
||||||
|
commandDir.mkdir();
|
||||||
|
URL[] urls = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
urls = new URL[]
|
||||||
|
{
|
||||||
|
commandDir.toURI().toURL()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
catch (MalformedURLException ex)
|
||||||
|
{
|
||||||
|
getLogger().log(Level.SEVERE, "Could not get extra command dir", ex);
|
||||||
|
getServer().getPluginManager().disablePlugin(this);
|
||||||
|
}
|
||||||
|
loader = new URLClassLoader(urls, getClassLoader());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
|
||||||
|
{
|
||||||
|
return handler.handleCommand(sender, command, label, args);
|
||||||
|
}
|
||||||
|
}
|
13
EssentialsExtra/src/plugin.yml
Normal file
13
EssentialsExtra/src/plugin.yml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# This determines the command prefix when there are conflicts (/name:home, /name:help, etc.)
|
||||||
|
name: EssentialsExtra
|
||||||
|
main: net.ess3.extra.EssentialsExtra
|
||||||
|
# Note to developers: This next line cannot change, or the automatic versioning system will break.
|
||||||
|
version: ${build.number}
|
||||||
|
website: http://tiny.cc/EssentialsWiki
|
||||||
|
description: Provides extra commands for Essentials
|
||||||
|
authors: [md_5]
|
||||||
|
depend: [Essentials-3]
|
||||||
|
commands:
|
||||||
|
kittycannon:
|
||||||
|
description: Throw an exploding kitten at your opponent
|
||||||
|
usage: /<command>
|
1
pom.xml
1
pom.xml
@@ -14,6 +14,7 @@
|
|||||||
<module>Essentials</module>
|
<module>Essentials</module>
|
||||||
<module>Essentials2Compat</module>
|
<module>Essentials2Compat</module>
|
||||||
<module>EssentialsChat</module>
|
<module>EssentialsChat</module>
|
||||||
|
<module>EssentialsExtra</module>
|
||||||
<module>EssentialsGeoIP</module>
|
<module>EssentialsGeoIP</module>
|
||||||
<module>EssentialsGroupBridge</module>
|
<module>EssentialsGroupBridge</module>
|
||||||
<module>EssentialsGroupManager</module>
|
<module>EssentialsGroupManager</module>
|
||||||
|
Reference in New Issue
Block a user