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>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
eclipse.preferences.version=1
|
||||
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.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.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=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;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.PluginDescriptionFile;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import buttondevteam.bucket.alisolarflare.aliarrow.AliArrowSubPlugin;
|
||||
import buttondevteam.bucket.core.CoreSubPlugin;
|
||||
|
||||
public class MainPlugin extends JavaPlugin {
|
||||
public static MainPlugin Instance;
|
||||
|
||||
private PluginDescriptionFile pdfFile;
|
||||
private Logger logger;
|
||||
private AliArrowSubPlugin aliArrowSubPlugin;
|
||||
private CoreSubPlugin playerSubPlugin;
|
||||
|
||||
public void onEnable() {
|
||||
// Logs "Plugin Enabled", registers commands
|
||||
Instance = this;
|
||||
pdfFile = getDescription();
|
||||
logger = getLogger();
|
||||
logger.info(pdfFile.getName() + " has been started (V." + pdfFile.getVersion() + ").");
|
||||
|
||||
registerSubPlugins();
|
||||
registerCommands();
|
||||
registerEvents();
|
||||
|
||||
logger.info(pdfFile.getName() + " has been Enabled (V." + pdfFile.getVersion() + ").");
|
||||
}
|
||||
|
||||
private void registerSubPlugins() {
|
||||
aliArrowSubPlugin = new AliArrowSubPlugin(this);
|
||||
aliArrowSubPlugin.register();
|
||||
playerSubPlugin = new CoreSubPlugin(this);
|
||||
playerSubPlugin.register();
|
||||
}
|
||||
|
||||
private void registerCommands() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
private void registerEvents() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
package buttondevteam.bucket;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.PluginDescriptionFile;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import buttondevteam.bucket.alisolarflare.aliarrow.AliArrowSubPlugin;
|
||||
import buttondevteam.bucket.core.CoreSubPlugin;
|
||||
|
||||
public class MainPlugin extends JavaPlugin {
|
||||
public static MainPlugin Instance;
|
||||
|
||||
private PluginDescriptionFile pdfFile;
|
||||
private Logger logger;
|
||||
private AliArrowSubPlugin aliArrowSubPlugin;
|
||||
private CoreSubPlugin playerSubPlugin;
|
||||
|
||||
public void onEnable() {
|
||||
// Logs "Plugin Enabled", registers commands
|
||||
Instance = this;
|
||||
pdfFile = getDescription();
|
||||
logger = getLogger();
|
||||
logger.info(pdfFile.getName() + " has been started (V." + pdfFile.getVersion() + ").");
|
||||
|
||||
registerSubPlugins();
|
||||
registerCommands();
|
||||
registerEvents();
|
||||
|
||||
logger.info(pdfFile.getName() + " has been Enabled (V." + pdfFile.getVersion() + ").");
|
||||
}
|
||||
|
||||
private void registerSubPlugins() {
|
||||
aliArrowSubPlugin = new AliArrowSubPlugin(this);
|
||||
aliArrowSubPlugin.register();
|
||||
playerSubPlugin = new CoreSubPlugin(this);
|
||||
playerSubPlugin.register();
|
||||
}
|
||||
|
||||
private void registerCommands() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
private void registerEvents() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,40 +1,40 @@
|
|||
package buttondevteam.bucket.alisolarflare.aliarrow;
|
||||
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Projectile;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||
|
||||
import buttondevteam.bucket.MainPlugin;
|
||||
|
||||
public class AliArrowListener implements Listener {
|
||||
private final MainPlugin plugin;
|
||||
|
||||
public AliArrowListener(MainPlugin plugin){
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@EventHandler
|
||||
public void onProjectileLaunch(ProjectileLaunchEvent event){
|
||||
try{
|
||||
if(!(event.getEntity().getType() == EntityType.ARROW)){
|
||||
return;
|
||||
}
|
||||
Projectile projectile = event.getEntity();
|
||||
if (!(projectile.getShooter().equals(plugin.getServer().getPlayer("Ali")))){
|
||||
return;
|
||||
}
|
||||
Arrow arrow = (Arrow) projectile;
|
||||
if (!(arrow.isCritical())){
|
||||
return;
|
||||
}
|
||||
AliArrowTask aliArrowTask = new AliArrowTask(plugin,arrow);
|
||||
aliArrowTask.runTaskTimer(plugin, 2, 1);
|
||||
}catch(Exception e){
|
||||
return;
|
||||
}
|
||||
}
|
||||
package buttondevteam.bucket.alisolarflare.aliarrow;
|
||||
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Projectile;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||
|
||||
import buttondevteam.bucket.MainPlugin;
|
||||
|
||||
public class AliArrowListener implements Listener {
|
||||
private final MainPlugin plugin;
|
||||
|
||||
public AliArrowListener(MainPlugin plugin){
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@EventHandler
|
||||
public void onProjectileLaunch(ProjectileLaunchEvent event){
|
||||
try{
|
||||
if(!(event.getEntity().getType() == EntityType.ARROW)){
|
||||
return;
|
||||
}
|
||||
Projectile projectile = event.getEntity();
|
||||
if (!(projectile.getShooter().equals(plugin.getServer().getPlayer("Ali")))){
|
||||
return;
|
||||
}
|
||||
Arrow arrow = (Arrow) projectile;
|
||||
if (!(arrow.isCritical())){
|
||||
return;
|
||||
}
|
||||
AliArrowTask aliArrowTask = new AliArrowTask(plugin,arrow);
|
||||
aliArrowTask.runTaskTimer(plugin, 2, 1);
|
||||
}catch(Exception e){
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,25 +1,25 @@
|
|||
package buttondevteam.bucket.alisolarflare.aliarrow;
|
||||
|
||||
import java.util.logging.Level;
|
||||
|
||||
import buttondevteam.bucket.MainPlugin;
|
||||
|
||||
public class AliArrowSubPlugin {
|
||||
private MainPlugin plugin;
|
||||
|
||||
public AliArrowSubPlugin(MainPlugin plugin){
|
||||
this.plugin = plugin;
|
||||
}
|
||||
public void register(){
|
||||
registerEvents();
|
||||
registerCommands();
|
||||
plugin.getLogger().log(Level.INFO, "Discord Sub Plugin Registered!");
|
||||
}
|
||||
private void registerEvents(){
|
||||
plugin.getServer().getPluginManager().registerEvents(new AliArrowListener(plugin), plugin);
|
||||
|
||||
}
|
||||
private void registerCommands(){
|
||||
|
||||
}
|
||||
}
|
||||
package buttondevteam.bucket.alisolarflare.aliarrow;
|
||||
|
||||
import java.util.logging.Level;
|
||||
|
||||
import buttondevteam.bucket.MainPlugin;
|
||||
|
||||
public class AliArrowSubPlugin {
|
||||
private MainPlugin plugin;
|
||||
|
||||
public AliArrowSubPlugin(MainPlugin plugin){
|
||||
this.plugin = plugin;
|
||||
}
|
||||
public void register(){
|
||||
registerEvents();
|
||||
registerCommands();
|
||||
plugin.getLogger().log(Level.INFO, "Discord Sub Plugin Registered!");
|
||||
}
|
||||
private void registerEvents(){
|
||||
plugin.getServer().getPluginManager().registerEvents(new AliArrowListener(plugin), plugin);
|
||||
|
||||
}
|
||||
private void registerCommands(){
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,30 +1,30 @@
|
|||
package buttondevteam.bucket.alisolarflare.aliarrow;
|
||||
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import buttondevteam.bucket.MainPlugin;
|
||||
|
||||
public class AliArrowTask extends BukkitRunnable{
|
||||
MainPlugin plugin;
|
||||
Arrow arrow;
|
||||
|
||||
|
||||
|
||||
public AliArrowTask(MainPlugin plugin, Arrow arrow){
|
||||
this.plugin = plugin;
|
||||
this.arrow = arrow;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
arrow.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, arrow.getLocation(), 1);
|
||||
if (arrow.isOnGround() || arrow.isDead()){
|
||||
this.cancel();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
package buttondevteam.bucket.alisolarflare.aliarrow;
|
||||
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import buttondevteam.bucket.MainPlugin;
|
||||
|
||||
public class AliArrowTask extends BukkitRunnable{
|
||||
MainPlugin plugin;
|
||||
Arrow arrow;
|
||||
|
||||
|
||||
|
||||
public AliArrowTask(MainPlugin plugin, Arrow arrow){
|
||||
this.plugin = plugin;
|
||||
this.arrow = arrow;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
arrow.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, arrow.getLocation(), 1);
|
||||
if (arrow.isOnGround() || arrow.isDead()){
|
||||
this.cancel();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@ public class TBMCPlayerAddEvent extends Event {
|
|||
private TBMCPlayer player;
|
||||
|
||||
public TBMCPlayerAddEvent(TBMCPlayer player) {
|
||||
// TODO: Convert player configs
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ public class TBMCPlayerLoadEvent extends Event {
|
|||
private TBMCPlayer player;
|
||||
|
||||
public TBMCPlayerLoadEvent(YamlConfiguration yaml, TBMCPlayer player) {
|
||||
//TODO: Convert player configs
|
||||
this.yaml = yaml;
|
||||
this.player = player;
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ public class TBMCPlayerSaveEvent extends Event {
|
|||
private TBMCPlayer player;
|
||||
|
||||
public TBMCPlayerSaveEvent(YamlConfiguration yaml, TBMCPlayer player) {
|
||||
// TODO: Convert player configs
|
||||
this.yaml = yaml;
|
||||
this.player = player;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue