From 419121bc289b05f1769fc24cbf62a7cfa9c6faab Mon Sep 17 00:00:00 2001 From: AliLaptop Date: Sat, 25 Jun 2016 20:50:27 -0400 Subject: [PATCH] Initialized Plugin with AliArrow Subplugin --- .classpath | 8 ++++ .project | 17 ++++++++ .settings/org.eclipse.jdt.core.prefs | 11 +++++ bin/buttondevteam/MainPlugin.class | Bin 0 -> 1731 bytes .../aliarrow/AliArrowListener.class | Bin 0 -> 2091 bytes .../aliarrow/AliArrowSubPlugin.class | Bin 0 -> 1369 bytes .../alisolarflare/aliarrow/AliArrowTask.class | Bin 0 -> 1082 bytes src/buttondevteam/MainPlugin.java | 40 ++++++++++++++++++ .../aliarrow/AliArrowListener.java | 39 +++++++++++++++++ .../aliarrow/AliArrowSubPlugin.java | 25 +++++++++++ .../alisolarflare/aliarrow/AliArrowTask.java | 30 +++++++++++++ 11 files changed, 170 insertions(+) create mode 100644 .classpath create mode 100644 .project create mode 100644 .settings/org.eclipse.jdt.core.prefs create mode 100644 bin/buttondevteam/MainPlugin.class create mode 100644 bin/buttondevteam/alisolarflare/aliarrow/AliArrowListener.class create mode 100644 bin/buttondevteam/alisolarflare/aliarrow/AliArrowSubPlugin.class create mode 100644 bin/buttondevteam/alisolarflare/aliarrow/AliArrowTask.class create mode 100644 src/buttondevteam/MainPlugin.java create mode 100644 src/buttondevteam/alisolarflare/aliarrow/AliArrowListener.java create mode 100644 src/buttondevteam/alisolarflare/aliarrow/AliArrowSubPlugin.java create mode 100644 src/buttondevteam/alisolarflare/aliarrow/AliArrowTask.java diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..f289777 --- /dev/null +++ b/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..e0b5879 --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + ButtonPluginBucket + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..7341ab1 --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,11 @@ +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.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.7 +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 diff --git a/bin/buttondevteam/MainPlugin.class b/bin/buttondevteam/MainPlugin.class new file mode 100644 index 0000000000000000000000000000000000000000..7790b81f7a44539eb454c3d621790eacc72013e0 GIT binary patch literal 1731 zcma)6ZBrXn6n<_<*|1)DiBJlbHqc6wU|F?VtEsJ&g0)QnrH!I~xgnSIwwv9|zTk}g zRnAE2*coU1>W^|fXEz~9g^>??@9sV4IWNzB&i?(+AAbV4fuAg71TNI$DDu6AK8&<# zIggd`cHFpWJPTQYML%dd_4vgL6FKeV*mOf$=nna8v<2rn1yrxr4Y~(eiT(cGg{?EH{y_fG+b+}}534K=u z2lQx%z7zwTwKtKR^tSO#bVp#MSgHwR*ZqdJF@gz+w;%;3s>ah>ajUL_C#udZ<*WX_ za%(Cu{M|jwM$b&hl@Axv=Z;e4d~d^Jj17VF60^7kureIT%0OxsBC+x6#qKdN*) z8xFaM5BTOj6qp%=qzzR{wH$7csqjpNg}T;WA&gWI=|-VgTeY!>Pb6;QQ<8;hx3$+0 zxPDTUfm()`qL!}WGl|c+dz-qi=^!M5=WtsfQ%W-2k+{p|T;!)%8*5m%aE}J>w40K+ z&mCorci{6)Z%TZ{;>-uSX~IYc$FmT!`D=-XY@Y0y*Zo#Yd5y$am3Yj?@t$$xPu@Pi=9_TH@!cKOIN&7kSppmBaZTfO(7kpZNh4Eh#w@F$@ zlS3O*^vcH0Ut@8P_PGwO{EpHqIQfq{ z_&7beMQ`~EEggK(!IzYKgPsTUJUSV=bsDr^@>0^}6s>toQmJ<_gLRxIh0Nj+=I{&V z2ikerZ70JDq9&M&&2Br><=5ERqhh{2!c(f}X$Rl+^Nc6_UL@24Ww|sEbNVjy}=T^azAf)j2tEXn@^E}sAt_<{0d@Z-NaFqP5( literal 0 HcmV?d00001 diff --git a/bin/buttondevteam/alisolarflare/aliarrow/AliArrowListener.class b/bin/buttondevteam/alisolarflare/aliarrow/AliArrowListener.class new file mode 100644 index 0000000000000000000000000000000000000000..628c7181e94af4d36a16d03ac29fe17496edef83 GIT binary patch literal 2091 zcmb7EZC4vb7`+n`wuI%Sw3I^2TU#}}Zd-(EQ^6FW6%#;$V5_zr!U$WIUEFNY{uRG_ z{ESEGLC^8{+27Qo-kDI6&{S>C*_oZ}^Kzd%&wc*<>(}1_Oh8(Q2~2L3qA2h;)qbSp zt|L9S7a8HT~PPR4UH`X%cYBju~mLR_Hzsoa;2C;csFY2&FXL>3wax`S}b z*(mMoxRImwl^;1Todg>9ywaBI3-n}b)8?e>FPm>^THSGdH<}jcO}*Z1XiXqK8*Hj1 z8qi{+39SMRsiCzd5Sa}NX9U`^uCEqLyBjK8l^dQC=*R{I>8;7o)#u|s^p0v1EBKHDSz^#hmFYKwFe-bTv8J9PtB>}(8SSRj#ESy@^a=&OUa zVrJm9BeJ z#-5NHFl}Q7A5vB7o09a{MxE6$%EC<#J+yFFpsNalD&M7%eKRun$i^Jz$)8)C4c*A4 zjEvyud0*g0EhYaUomE-fN#Y(Bv~E8UnEDr?*ST4PiE>GBj_F@a$6B(nj86sZu;lCb zt5gvgo2gM@dHy)Zqh?{DhPz^6TWyx8BHa)hev)v+kvq;%e9rhdX1xv9_@?(Tqs-P9M1DZKNFS6(P_SQ@xMl%E^=plF~O7W z5;<~+?j!UI{DilDK>R?TbE8KX5g7g%ZHI6=CXa9{hC_VtJ-?6sfz0CA5oQJS@i*Li zpzX$<?ZIY+F#;u>BS`a=+jTZ4kCvu^t+13xP~Vjin{!1mcwFB%9mKhXQudhtYMwxOw#gm zJRo&BQumM%;*22hCBEXEeyOstA)(p%o(#FEaKp@qRD(ryBMDQ1Bl2v Ai~s-t literal 0 HcmV?d00001 diff --git a/bin/buttondevteam/alisolarflare/aliarrow/AliArrowSubPlugin.class b/bin/buttondevteam/alisolarflare/aliarrow/AliArrowSubPlugin.class new file mode 100644 index 0000000000000000000000000000000000000000..6df87063ce183b3c26586f9a01627932a4e8c88f GIT binary patch literal 1369 zcma)5Yg5xe6g^uiY18m3@{~s_K3Y)X3q*qtM454>fMcD`_;K5=aUo5dG^xK!M`6$z ze}F&A@orLVD`oV>Jt8RiS;yA>-8$!)JLbPOP4K!d?BP$*W?U>G)V0fP)9CFzR2uu&EM8(wt;L$>7A zxKrW2ROj|(GI%eW3>$y3{cp9Da>^IBYzD&DiG9Mrq{?Ra^zubZxIt5yrVY#})99&b z+iNtqTPNcs%xjnEj`=V;2gcviXB?W#pRucL?+4a-zO zAGRo812=G!hD3QXtQO9tiw%)*%7IT6S;dO#k7?i*ZpR%c3%{j0FhL#geA}#shlesS z<7+EJ0$$T_k74YL(ZD+H(*&rEaTUAVTbv{t@i=o6h17@_ZQ6sc20hI|c-(%oe2 zjWJ~DL~#)+BeZeyh%xslj*)GeFfY=YTK|=g$_fOuoX{|_)>&FMYxJZ zAyIsrC7~W&8+$*>AIQg;t0%a_@Esd()%h3?)$atG1L%{|B6&Z5w=r ZNEI>b1P`_|>10L9i)v@sBG&|-{RV(NN`U|X literal 0 HcmV?d00001 diff --git a/bin/buttondevteam/alisolarflare/aliarrow/AliArrowTask.class b/bin/buttondevteam/alisolarflare/aliarrow/AliArrowTask.class new file mode 100644 index 0000000000000000000000000000000000000000..6c11905464841fb4872ad5a1b8e4b3accbdbe570 GIT binary patch literal 1082 zcma)5=}r?-6#i~oId9WERjz(YMfu z27mYfK9up?Dd=D%@yDE;{rk>6XMX(r_8mYO6$1%|#by`;u4;+>K=56QJJNR@?!Bf@ zXp4KEdtg-^S=GuW_uB?i470AcZ8gJoTLzYI?}%3D2+w*DIo3m^c+(LK={+ahmWpAb zb{b}lOI43z6^5<|gJHZDYbsPAgLhVhN;&C!Qpw;x!&2ewR%g~18w{z3ZcAj5M6Zbq z`WTXhVj}~F0TW$FYb|fWKsQ5wO)Bv$+-(YPvolD(=Gxq8a8GLc*qI7;q|Z?Pi_m{O zAq|xDLe+zDOd6PA7(HWh6H_?H(7i2!7p~{D7={YP_?VHmlEDSc7?@@lj5VrrFOaq) zOkBh)LtkUHR;#W&UVrtpTCZ<0496RtBv&-4%Od6D?(h^5cL!ShwqKG*I zC3?yjdc@4cJgzbH`g{C9oj@=w6#fYvcmD3aT5M=amWk_FWXMYYxmxkuP|;)13Sa7A z*~Cp9OiTZf;H@m}a>>MPz2&scl`S0Nun};(y~g*Bx0l^;L(djZq(0PK{J@1{$P?tSz#2UVrH;%+lN;Df5TOeT)(ZN#>E#VUhz>mO~$T zhR8GBDZ?;E$kG`ahDDkN(lDcx-GO;a^*Xj(`i$HW#uz@~d`G`T$9;rC3LSHS;RBI~ v(rz%khf(^1TbfT2fB1}GlDd~MM$a@A@i9C7kNGT9ehP_llDv0FPvGt^2QC0( literal 0 HcmV?d00001 diff --git a/src/buttondevteam/MainPlugin.java b/src/buttondevteam/MainPlugin.java new file mode 100644 index 0000000..3ff1ca0 --- /dev/null +++ b/src/buttondevteam/MainPlugin.java @@ -0,0 +1,40 @@ +package buttondevteam; + +import java.util.logging.Logger; + +import org.bukkit.plugin.PluginDescriptionFile; +import org.bukkit.plugin.java.JavaPlugin; + +import buttondevteam.alisolarflare.aliarrow.AliArrowSubPlugin; + +public class MainPlugin extends JavaPlugin { + private PluginDescriptionFile pdfFile; + private Logger logger; + private AliArrowSubPlugin aliArrowSubPlugin; + + public void onEnable(){ + //Logs "Plugin Enabled", registers commands + 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(); + } + private void registerCommands() { + // TODO Auto-generated method stub + + } + private void registerEvents() { + // TODO Auto-generated method stub + + } + +} diff --git a/src/buttondevteam/alisolarflare/aliarrow/AliArrowListener.java b/src/buttondevteam/alisolarflare/aliarrow/AliArrowListener.java new file mode 100644 index 0000000..436904c --- /dev/null +++ b/src/buttondevteam/alisolarflare/aliarrow/AliArrowListener.java @@ -0,0 +1,39 @@ +package buttondevteam.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.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; + } + } +} \ No newline at end of file diff --git a/src/buttondevteam/alisolarflare/aliarrow/AliArrowSubPlugin.java b/src/buttondevteam/alisolarflare/aliarrow/AliArrowSubPlugin.java new file mode 100644 index 0000000..8fe0065 --- /dev/null +++ b/src/buttondevteam/alisolarflare/aliarrow/AliArrowSubPlugin.java @@ -0,0 +1,25 @@ +package buttondevteam.alisolarflare.aliarrow; + +import java.util.logging.Level; + +import buttondevteam.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(){ + + } +} diff --git a/src/buttondevteam/alisolarflare/aliarrow/AliArrowTask.java b/src/buttondevteam/alisolarflare/aliarrow/AliArrowTask.java new file mode 100644 index 0000000..013e8fe --- /dev/null +++ b/src/buttondevteam/alisolarflare/aliarrow/AliArrowTask.java @@ -0,0 +1,30 @@ +package buttondevteam.alisolarflare.aliarrow; + +import org.bukkit.Particle; +import org.bukkit.entity.Arrow; +import org.bukkit.scheduler.BukkitRunnable; + +import buttondevteam.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(); + } + + + } + +}