Converted to Maven project, tried to push to Maven repo
And there may be a way easier solution...
This commit is contained in:
parent
5cf3ecc008
commit
730fe6c8d2
9 changed files with 155 additions and 151 deletions
6
.project
6
.project
|
@ -10,8 +10,14 @@
|
||||||
<arguments>
|
<arguments>
|
||||||
</arguments>
|
</arguments>
|
||||||
</buildCommand>
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
</buildSpec>
|
</buildSpec>
|
||||||
<natures>
|
<natures>
|
||||||
|
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||||
|
org.eclipse.jdt.core.compiler.source=1.8
|
||||||
|
|
|
@ -1,51 +1,51 @@
|
||||||
package buttondevteam.bucket;
|
package buttondevteam.bucket;
|
||||||
|
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.plugin.PluginDescriptionFile;
|
import org.bukkit.plugin.PluginDescriptionFile;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import buttondevteam.bucket.alisolarflare.aliarrow.AliArrowSubPlugin;
|
import buttondevteam.bucket.alisolarflare.aliarrow.AliArrowSubPlugin;
|
||||||
import buttondevteam.bucket.core.CoreSubPlugin;
|
import buttondevteam.bucket.core.CoreSubPlugin;
|
||||||
|
|
||||||
public class MainPlugin extends JavaPlugin {
|
public class MainPlugin extends JavaPlugin {
|
||||||
public static MainPlugin Instance;
|
public static MainPlugin Instance;
|
||||||
|
|
||||||
private PluginDescriptionFile pdfFile;
|
private PluginDescriptionFile pdfFile;
|
||||||
private Logger logger;
|
private Logger logger;
|
||||||
private AliArrowSubPlugin aliArrowSubPlugin;
|
private AliArrowSubPlugin aliArrowSubPlugin;
|
||||||
private CoreSubPlugin playerSubPlugin;
|
private CoreSubPlugin playerSubPlugin;
|
||||||
|
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
// Logs "Plugin Enabled", registers commands
|
// Logs "Plugin Enabled", registers commands
|
||||||
Instance = this;
|
Instance = this;
|
||||||
pdfFile = getDescription();
|
pdfFile = getDescription();
|
||||||
logger = getLogger();
|
logger = getLogger();
|
||||||
logger.info(pdfFile.getName() + " has been started (V." + pdfFile.getVersion() + ").");
|
logger.info(pdfFile.getName() + " has been started (V." + pdfFile.getVersion() + ").");
|
||||||
|
|
||||||
registerSubPlugins();
|
registerSubPlugins();
|
||||||
registerCommands();
|
registerCommands();
|
||||||
registerEvents();
|
registerEvents();
|
||||||
|
|
||||||
logger.info(pdfFile.getName() + " has been Enabled (V." + pdfFile.getVersion() + ").");
|
logger.info(pdfFile.getName() + " has been Enabled (V." + pdfFile.getVersion() + ").");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerSubPlugins() {
|
private void registerSubPlugins() {
|
||||||
aliArrowSubPlugin = new AliArrowSubPlugin(this);
|
aliArrowSubPlugin = new AliArrowSubPlugin(this);
|
||||||
aliArrowSubPlugin.register();
|
aliArrowSubPlugin.register();
|
||||||
playerSubPlugin = new CoreSubPlugin(this);
|
playerSubPlugin = new CoreSubPlugin(this);
|
||||||
playerSubPlugin.register();
|
playerSubPlugin.register();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerCommands() {
|
private void registerCommands() {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerEvents() {
|
private void registerEvents() {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,40 +1,40 @@
|
||||||
package buttondevteam.bucket.alisolarflare.aliarrow;
|
package buttondevteam.bucket.alisolarflare.aliarrow;
|
||||||
|
|
||||||
import org.bukkit.entity.Arrow;
|
import org.bukkit.entity.Arrow;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Projectile;
|
import org.bukkit.entity.Projectile;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||||
|
|
||||||
import buttondevteam.bucket.MainPlugin;
|
import buttondevteam.bucket.MainPlugin;
|
||||||
|
|
||||||
public class AliArrowListener implements Listener {
|
public class AliArrowListener implements Listener {
|
||||||
private final MainPlugin plugin;
|
private final MainPlugin plugin;
|
||||||
|
|
||||||
public AliArrowListener(MainPlugin plugin){
|
public AliArrowListener(MainPlugin plugin){
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onProjectileLaunch(ProjectileLaunchEvent event){
|
public void onProjectileLaunch(ProjectileLaunchEvent event){
|
||||||
try{
|
try{
|
||||||
if(!(event.getEntity().getType() == EntityType.ARROW)){
|
if(!(event.getEntity().getType() == EntityType.ARROW)){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Projectile projectile = event.getEntity();
|
Projectile projectile = event.getEntity();
|
||||||
if (!(projectile.getShooter().equals(plugin.getServer().getPlayer("Ali")))){
|
if (!(projectile.getShooter().equals(plugin.getServer().getPlayer("Ali")))){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Arrow arrow = (Arrow) projectile;
|
Arrow arrow = (Arrow) projectile;
|
||||||
if (!(arrow.isCritical())){
|
if (!(arrow.isCritical())){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
AliArrowTask aliArrowTask = new AliArrowTask(plugin,arrow);
|
AliArrowTask aliArrowTask = new AliArrowTask(plugin,arrow);
|
||||||
aliArrowTask.runTaskTimer(plugin, 2, 1);
|
aliArrowTask.runTaskTimer(plugin, 2, 1);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,25 +1,25 @@
|
||||||
package buttondevteam.bucket.alisolarflare.aliarrow;
|
package buttondevteam.bucket.alisolarflare.aliarrow;
|
||||||
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import buttondevteam.bucket.MainPlugin;
|
import buttondevteam.bucket.MainPlugin;
|
||||||
|
|
||||||
public class AliArrowSubPlugin {
|
public class AliArrowSubPlugin {
|
||||||
private MainPlugin plugin;
|
private MainPlugin plugin;
|
||||||
|
|
||||||
public AliArrowSubPlugin(MainPlugin plugin){
|
public AliArrowSubPlugin(MainPlugin plugin){
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
public void register(){
|
public void register(){
|
||||||
registerEvents();
|
registerEvents();
|
||||||
registerCommands();
|
registerCommands();
|
||||||
plugin.getLogger().log(Level.INFO, "Discord Sub Plugin Registered!");
|
plugin.getLogger().log(Level.INFO, "Discord Sub Plugin Registered!");
|
||||||
}
|
}
|
||||||
private void registerEvents(){
|
private void registerEvents(){
|
||||||
plugin.getServer().getPluginManager().registerEvents(new AliArrowListener(plugin), plugin);
|
plugin.getServer().getPluginManager().registerEvents(new AliArrowListener(plugin), plugin);
|
||||||
|
|
||||||
}
|
}
|
||||||
private void registerCommands(){
|
private void registerCommands(){
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,30 +1,30 @@
|
||||||
package buttondevteam.bucket.alisolarflare.aliarrow;
|
package buttondevteam.bucket.alisolarflare.aliarrow;
|
||||||
|
|
||||||
import org.bukkit.Particle;
|
import org.bukkit.Particle;
|
||||||
import org.bukkit.entity.Arrow;
|
import org.bukkit.entity.Arrow;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
import buttondevteam.bucket.MainPlugin;
|
import buttondevteam.bucket.MainPlugin;
|
||||||
|
|
||||||
public class AliArrowTask extends BukkitRunnable{
|
public class AliArrowTask extends BukkitRunnable{
|
||||||
MainPlugin plugin;
|
MainPlugin plugin;
|
||||||
Arrow arrow;
|
Arrow arrow;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public AliArrowTask(MainPlugin plugin, Arrow arrow){
|
public AliArrowTask(MainPlugin plugin, Arrow arrow){
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.arrow = arrow;
|
this.arrow = arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
arrow.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, arrow.getLocation(), 1);
|
arrow.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, arrow.getLocation(), 1);
|
||||||
if (arrow.isOnGround() || arrow.isDead()){
|
if (arrow.isOnGround() || arrow.isDead()){
|
||||||
this.cancel();
|
this.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,6 @@ public class TBMCPlayerAddEvent extends Event {
|
||||||
private TBMCPlayer player;
|
private TBMCPlayer player;
|
||||||
|
|
||||||
public TBMCPlayerAddEvent(TBMCPlayer player) {
|
public TBMCPlayerAddEvent(TBMCPlayer player) {
|
||||||
// TODO: Convert player configs
|
|
||||||
this.player = player;
|
this.player = player;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@ public class TBMCPlayerLoadEvent extends Event {
|
||||||
private TBMCPlayer player;
|
private TBMCPlayer player;
|
||||||
|
|
||||||
public TBMCPlayerLoadEvent(YamlConfiguration yaml, TBMCPlayer player) {
|
public TBMCPlayerLoadEvent(YamlConfiguration yaml, TBMCPlayer player) {
|
||||||
//TODO: Convert player configs
|
|
||||||
this.yaml = yaml;
|
this.yaml = yaml;
|
||||||
this.player = player;
|
this.player = player;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,6 @@ public class TBMCPlayerSaveEvent extends Event {
|
||||||
private TBMCPlayer player;
|
private TBMCPlayer player;
|
||||||
|
|
||||||
public TBMCPlayerSaveEvent(YamlConfiguration yaml, TBMCPlayer player) {
|
public TBMCPlayerSaveEvent(YamlConfiguration yaml, TBMCPlayer player) {
|
||||||
// TODO: Convert player configs
|
|
||||||
this.yaml = yaml;
|
this.yaml = yaml;
|
||||||
this.player = player;
|
this.player = player;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue