From 33694db787bc67e8e21ff90dc0136e43b8ca9c18 Mon Sep 17 00:00:00 2001 From: TheCrunchy Date: Sun, 8 May 2022 20:28:25 +0100 Subject: [PATCH] Initial commit --- .classpath | 9 + .gitattributes | 2 + .project | 17 + .settings/org.eclipse.jdt.core.prefs | 11 + .../CrunchSiegeCore$PlayerMoving.class | Bin 0 -> 9928 bytes .../CrunchSiegeCore$SiegeCommand.class | Bin 0 -> 3611 bytes bin/siegeCore/CrunchSiegeCore.class | Bin 0 -> 5085 bytes bin/siegeCore/SiegeEquipment.class | Bin 0 -> 1429 bytes bin/siegeCore/SiegeProjectile.class | Bin 0 -> 529 bytes plugin.yml | 9 + src/siegeCore/CrunchSiegeCore.java | 371 ++++++++++++++++++ src/siegeCore/SiegeEquipment.java | 48 +++ src/siegeCore/SiegeProjectile.java | 13 + 13 files changed, 480 insertions(+) create mode 100644 .classpath create mode 100644 .gitattributes create mode 100644 .project create mode 100644 .settings/org.eclipse.jdt.core.prefs create mode 100644 bin/siegeCore/CrunchSiegeCore$PlayerMoving.class create mode 100644 bin/siegeCore/CrunchSiegeCore$SiegeCommand.class create mode 100644 bin/siegeCore/CrunchSiegeCore.class create mode 100644 bin/siegeCore/SiegeEquipment.class create mode 100644 bin/siegeCore/SiegeProjectile.class create mode 100644 plugin.yml create mode 100644 src/siegeCore/CrunchSiegeCore.java create mode 100644 src/siegeCore/SiegeEquipment.java create mode 100644 src/siegeCore/SiegeProjectile.java diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..2448996 --- /dev/null +++ b/.classpath @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/.project b/.project new file mode 100644 index 0000000..6df3aa3 --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + CrunchSiegeEquipment + + + + + + 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..3a21537 --- /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.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +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.8 diff --git a/bin/siegeCore/CrunchSiegeCore$PlayerMoving.class b/bin/siegeCore/CrunchSiegeCore$PlayerMoving.class new file mode 100644 index 0000000000000000000000000000000000000000..7c4c2915d3249850db7e22711dca5b8c719e7b87 GIT binary patch literal 9928 zcma)C34B!5_5RLel9x=LfGp~;Mg9Ao7lgpzQn2nzUAnnesn)ex+PeK!q~CdOCi5l>1%J-WyZ794&;8DN z&&v~E?Ro&f*W@z;9>K(T$ZE4HqcN+jGS(Fdwl}4p$1e^C)?2aq=-N=E&45=h)rH~-D`Le2d5QK=eEji(QFR0E zQ%@$THwfN`%5? z^8@kr`aoxSAts{Oz;S}3+yc9|G%*P!fjfi<9TqMdEuXYfC7NbpI*lGC_pFVmW}-1JD9#2Z zl%7dp(?iKq&A==JGX>*ary7vn#7US zoet6OW<8W9=He8A!EKt?chWGA%w}F6NLaM{Fm*f+RR$`lG8f16w25le2y&a6YbzHL zMYpY_X>4W8H&KfP^fhkC*wG)_eHCD!PB18=Kvk`(q`|}@EEeRG*|KOXOl*c{i*Jt- z`bIPxXkq|z$!^b?SOWT&8d9|ySjeJLW*d?QBeGbIl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hr`ExnejZeGrMG^-**g_HB*eae)C{NM1lHR5o;=36>f9?=p zn!zy1?T>>kn;4sLnM)XY|2eM5Ub0Qry~HFjaNTir6gTZ(%GccK%6 zQc_B3@df^ZVKP-i4}Wz_*>IU2?3NSx8|N>(S58{7L&|6S{5<=dVKVp3VRA~#tU{X> z>y9jJ(FkVbY?lg#tb*-Q zQngi18zwD>B_){40nR6-O|Vtgl<2OzB+CAW62>% zp71iW$19ATufmVlFqKWxS?n*KioY?Yy@3|Ii4HbFFTq>5lzq*s@GfK7dyIkaGs=Fz zZuN)s=l{^RJ|gwU{QLx8;ZrHZXEKrfq~q{~oPaOctl2Ls*il(2InpX#-rI8}D*5sw zDUch*CwH+$mt>RfH5nwYvm^Jm43&K{Og@w0o;(@hVOz~JLj0cbGSYK`jPlHs(VmlK zjAwz2^>oTO&jnKC`Gp+q>6S*%{rrAdnmmt4zUNsv-Hs#|;V^aRbR^-gE9HER>z=1l zaeX+~ebTc6?49sAMtzCX`0H~_8-9Q)anizz zz0$$~zW&X(b3$guK#(beOMwH_)IbXhklSk^g%P<#F6|ounXGuh;e1JHw_L^uC|B&k zhK(4LRV!#9RPSBJYQYug$1=!5g2J%j3DSmf(#{LanV2M?fadYu?`hu>=#M5K7ITOMBK_fBT{!zTuk$CL65#bcnY zU=omu%_uDO?vy`lm#Z_*TBD_o91EX}Cz=y5Rc7-~LndI3%)wll%YI-5?>m)nr=jIY3hW&F056p~-&dDvOx%nWB&hJV^3#F%7R+@< zZomv3bRJx2e?5)%Xih2G4ot0CFujz4X@>eZBaTms3DYDTDfoS4rfNzshUQ5_yYb hZ_9h~zWwVT@=pe>e{pUoss1e=$tMh|Ld*XY@?S=!3nBmj literal 0 HcmV?d00001 diff --git a/bin/siegeCore/CrunchSiegeCore$SiegeCommand.class b/bin/siegeCore/CrunchSiegeCore$SiegeCommand.class new file mode 100644 index 0000000000000000000000000000000000000000..ecacfd000c958167e9ab4fdf6ab73eab6bcfc57a GIT binary patch literal 3611 zcmaJ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?CIomLDd zetRY(s&%TWTi1b7*KgO=39gGFqM7@C%cfyOwI+opg1Nf9*)ikxS%w>e8ho00J($jC zbaqQEU2afRP(1Ly)sOH9AWU>UAVAF!w)PYPg*D1yhMR-7G|AMY1R+H#6YEw-w&poG zk!)OXtbfH|CJ8HTkua-w_hv#7u!{&*ohCNcH4FS~LS-PlZT6gX_5@2>Mv*VB_u3%yA?x@h~A-T#5|7Q3+fDwIsS(!Pir z88RJ0*hcx*aS1yXk!nLmQl#)A(jokeyT=r15%)4IAe-s@89if{@Vf;Z%tVyV_>=P} zD4hvhm`6$JY@f#vE$*8~Ss`R)ES~rmj*PX%PydAR@>n?jl>2OtKkYs{;%D5a6o1Bj z(m7{cA>NU|IZu)jc-E6>_c>3BByir7q6s|jNwEZ8@Fbb6@uaQRO!5o0&OkA3_*z~(JN>iR-~(#%fyt}Rh-Vqirlt{ zr)f8~h_mFm$Rf^%uaQrBVlDhN1*Z)npc4>*%2SYf zDNKD7!h=ZRA>4_6nuH1{;Sfe>I(ZC5!j`CS4qz68tQ!MtD;{AxFwFL$%rY2dIaF9b zjSNFL!j92|a0=t>B96LbIq#9cCkxR5f5$%rfk=8A?+C(?^e)~byM**UK0p{<>GCh#dfBa3tF5I)BjMBx(a!I$_75wd3rU*j7@$(lp>7T+O8Hs$d> gejvhLqPr6D|3_wp@FTs1a2fOT6x?T2N3VeW0wN~$4FCWD literal 0 HcmV?d00001 diff --git a/bin/siegeCore/CrunchSiegeCore.class b/bin/siegeCore/CrunchSiegeCore.class new file mode 100644 index 0000000000000000000000000000000000000000..17b63ea9257b3d3cee3812aaf304ec998bf79bd9 GIT binary patch literal 5085 zcmbVP33yc175;B#GH)h%AY>y0NP-|u0&%KVF${%B5@c`!lq780eCQDXuM%e|s1OKe41HMdGA%vQWo6Tek-oyW0>8j~(;AL!&yJ27c4RD> z9X8UD9oo1SS<62goNs}EyC5(-K2_QkiV95Yx3t8lKGA{RZZQKFM+D0<6M$3%! zYGafN^%=uy&CXi7zy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oHWJ-n!PdUZdek~6buv`Dv>Sc4^vT+!@%{T z79~rWQ^eeox*(H`4~ITh)P%m8uPdhXDbJ8|WEe5CVrgC^yOLTaBMXn}y}|O+`!2wI z-okynF!>RZPZo~IG=lsa;_PHHdK=x+gBDY!!75PLECR@GqVKdtDA2a@f=n@O)j~5o`=hzx@E} z8iVp@T4Nwqhu61^cKF@-xt!m-5A}_~I%uQr8U+&0Iu|C_1K#z-Y89Q+czxLye4mT^DAUT-lhD;z!N#2rqOSzJ=72M@6%I_powYUjaaTMT=yQ#mE zfpayjX@LJEHx4Ke3NH2WAJEjafGBU`(Yt~4JaJUYnuoEwDTlYMYC4ST=jU*v-s#TV zytI;2w=`6G=5AZ6aBgpd;+eZ^Y3LXZY^^zX1Rs$>602!r9u3H(41Vj=J65!}Y~xg9I87jfLdm*Jh*!sAb1AH!=u!{AmvD(-eT+DJC&%Opp8#B^~6 zJ>{I3A!gE7IjSKGK4K4uT2aRkTEQoOy=Y(v#nCQiiAM6a1@lE%%+3eXY*d^?qZ>?O l4g)Gjk*9zYtVI<!Cz|+M!#!5A12%KlHvY2qy#&l+Vr&2a literal 0 HcmV?d00001 diff --git a/bin/siegeCore/SiegeEquipment.class b/bin/siegeCore/SiegeEquipment.class new file mode 100644 index 0000000000000000000000000000000000000000..4c4b575720da47a50fd39cc04d329ab8bde4c9e5 GIT binary patch literal 1429 zcmZ`(>sA|87~LnK1k$O{M3CMrR?#r6M0@d4C@r_xV7N#EuJ+%M9Me;VnRez3nrHDT z{EGyS~?z z0<*0!>emmGqa&s3DmY=;FdEcNPFs83BR;s8KG=_CBaF7fp7aGOX~)LF)+!1XQV`zn^*FzCgrQvWJt z&`_o_=jh8=;KqMs?6IuZ%OzFvNu998D7&+_r&SmTOy&1&Wp2)1wTo>h$A>cNglsHV z43dw%*yyZL&279IhQ9Oy111yF8B9*OKR$#)cea2HsSIqgiX#Qv| z6>9@+TlE7^ClT?S%iYw3mvWOe15JiRi_3gdei4O+5X$GHE3NlfwEH&5)X^msD80-r zYq{c^}Vr~9l90E5Te1M5EzC^u*g)?Mq4`Oo2!B_a26zV2X zL~5CHrw6h%HcgE?4kmH2jC=UDgm0Mpj?fv-4!*`v+&(a#i5e);|Ly#15& zIt698)ee)WD;xHj)w3Uh1+x`CVfP}x8&yhsiSQSXs&Z z)l7bv$tg_R_(z#djIB+Ct-O-?uV#{XTR-vS6tmO|c0Ph+{el3_G4eUB-#Kl8a?L%( z7w*ImuKNnNhPdq(U*YZ$_cOWV7Kd1NU*pk}Q>+e|{~8-lMvJHTVTeul<`AtvY@==d zx^~f97{L_AIs7CCnc*O_Y&nM-Y3bqtdAo`Q>@a^i9Ra)ei57>!9wFq{3T;{ibp8Q1 CSy0pf literal 0 HcmV?d00001 diff --git a/bin/siegeCore/SiegeProjectile.class b/bin/siegeCore/SiegeProjectile.class new file mode 100644 index 0000000000000000000000000000000000000000..15720699191416b11a9ab1b4ce9bae9f1fcc532f GIT binary patch literal 529 zcmZ`#%TB^j5IsYImRdy~qC7-!1uSIaPUAuh2}vVH3=4J_xZowVjpgxQE{Mj3AK*tB zr^Up?$L7wQJ11x6ocE8{Hvp$N))67(=Sogx%kyQk7j!qiH@X#%ehyP=~>l*H*qHWbAL|rROUa_H~{cjlTMf1g&4NOA2G$5EgZ|RR@o3kQhf24O3 z+>a{XqH)?0u56DxHUJ~6!~vL$w-`M#Bj6o1o?$hNHIfbO1*tXm8^r*WHsFaV5#;$T qgklDwESumy#cz(~$}Csld1WJqB1(){7>CTFuq!hP4yrJUp!x|E18M*O literal 0 HcmV?d00001 diff --git a/plugin.yml b/plugin.yml new file mode 100644 index 0000000..f854645 --- /dev/null +++ b/plugin.yml @@ -0,0 +1,9 @@ +name: CrunchSiegeWeapons +main: siegeCore.CrunchSiegeCore +version: 1.0 +api-version: 1.18 +commands: + siegetest: + description: show event details and progress + default: false + usage: siegetest \ No newline at end of file diff --git a/src/siegeCore/CrunchSiegeCore.java b/src/siegeCore/CrunchSiegeCore.java new file mode 100644 index 0000000..d93aecc --- /dev/null +++ b/src/siegeCore/CrunchSiegeCore.java @@ -0,0 +1,371 @@ +package siegeCore; + +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Random; +import java.util.UUID; +import java.util.concurrent.TimeUnit; +import java.util.logging.Level; + +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.World; +import org.bukkit.attribute.Attribute; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.ArmorStand; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Horse; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Mule; +import org.bukkit.entity.Player; +import org.bukkit.entity.Snowball; +import org.bukkit.entity.TNTPrimed; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.block.Action; +import org.bukkit.event.entity.ProjectileHitEvent; +import org.bukkit.event.player.PlayerInteractEntityEvent; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.event.player.PlayerMoveEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.plugin.Plugin; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.util.Vector; + +import me.libraryaddict.disguise.DisguiseAPI; +import me.libraryaddict.disguise.disguisetypes.Disguise; +import me.libraryaddict.disguise.disguisetypes.DisguiseType; +import me.libraryaddict.disguise.disguisetypes.MiscDisguise; + +public class CrunchSiegeCore extends JavaPlugin { + public static Plugin plugin; + + @SuppressWarnings("deprecation") + @Override + public void onEnable() { + plugin = this; + + this.getCommand("siegetest").setExecutor(new SiegeCommand()); + getServer().getPluginManager().registerEvents(new PlayerMoving(), this); + } + + public class SiegeCommand implements CommandExecutor { + + // This method is called, when somebody uses our command + @Override + @EventHandler + public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { + if (sender instanceof Player) { + Player player = (Player) sender; + Location l = player.getLocation(); + Entity entity2 = player.getWorld().spawnEntity(l, EntityType.ARMOR_STAND); + entity2.setInvulnerable(true); + SiegeEquipment equip = new SiegeEquipment(entity2.getUniqueId()); + ItemStack item = new ItemStack(Material.CARVED_PUMPKIN); + equip.ReadyModelNumber = 122; + equip.ModelNumberToFireAt = 135; + equip.MillisecondsBetweenFiringStages = 2; + equip.MillisecondsBetweenReloadingStages = 50; + equip.FiringModelNumbers = new ArrayList<>(Arrays.asList( + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139 + )); + ItemMeta meta = item.getItemMeta(); + meta.setCustomModelData(equip.ReadyModelNumber); + item.setItemMeta(meta); + + LivingEntity ent = (LivingEntity) entity2; + ArmorStand stand = (ArmorStand) ent; + stand.setVisible(false); + ent.getEquipment().setHelmet(item); + TrackedStands.put(player.getUniqueId(), entity2.getUniqueId()); + equipment.put(entity2.getUniqueId(), equip); + + } + return true; + } + } + + public HashMap TrackedStands = new HashMap(); + + private double getPlayerFacingPI(Player p) { + + double deg = 0; + double fin = 0; + double x = p.getLocation().getDirection().getX(); + double z = p.getLocation().getDirection().getZ(); + + if(x > 0.0 && z >0.0) { + deg = x; + fin = (Math.PI/2)*deg; + } + if(x> 0.0 && z<0.0) { + deg = z*(-1); + fin = ((Math.PI/2)*deg)+(Math.PI/2); + } + if(x<0.0 && z<0.0) { + deg = x*(-1); + fin = (Math.PI/2)*deg+ Math.PI; + } + if(x<0.0 && z>0.0) { + System.out.println("SW"); + deg = z; + fin = (Math.PI/2)*deg+(Math.PI/2 *3); + } + return fin; + } + + public HashMap equipment = new HashMap(); + + public HashMap projectiles = new HashMap(); + public String convertTime(long time){ + + long days = TimeUnit.MILLISECONDS.toDays(time); + time -= TimeUnit.DAYS.toMillis(days); + + long hours = TimeUnit.MILLISECONDS.toHours(time); + time -= TimeUnit.HOURS.toMillis(hours); + + long minutes = TimeUnit.MILLISECONDS.toMinutes(time); + time -= TimeUnit.MINUTES.toMillis(minutes); + + long seconds = TimeUnit.MILLISECONDS.toSeconds(time); + String timeLeftFormatted = String.format("§e" + minutes + " Minutes " +seconds +" Seconds§f"); + + return timeLeftFormatted; + } + + public void UpdateEntityIdModel(UUID entityId, int modelNumber, String WorldName) { + for (Entity ent : Bukkit.getServer().getWorld(WorldName).getEntities()) { + if (ent.getUniqueId() == entityId) { + if (ent instanceof LivingEntity) + { + LivingEntity liv = (LivingEntity) ent; + ItemStack Helmet = liv.getEquipment().getHelmet(); + if (Helmet != null) { + ItemMeta meta = Helmet.getItemMeta(); + meta.setCustomModelData(modelNumber); + Helmet.setItemMeta(meta); + liv.getEquipment().setHelmet(Helmet); + // plugin.getLogger().log(Level.INFO, "Updating stand?"); + } + } + } + } + } + + + public class PlayerMoving implements Listener { + @EventHandler + public void playerMove(PlayerMoveEvent event) { + Player player = event.getPlayer(); + + if (TrackedStands.containsKey(player.getUniqueId())) { + ItemStack itemInHand = player.getInventory().getItemInMainHand(); + if (itemInHand != null) { + if (itemInHand.getType() != Material.STICK) { + // TrackedStands.remove(player.getUniqueId()); + + return; + } + UUID trackedId = TrackedStands.get(player.getUniqueId()); + for (Entity ent : player.getWorld().getEntities()) { + if (ent.getUniqueId() == trackedId) { + // player.sendMessage("got id"); + LivingEntity living = (LivingEntity) ent; + Location loc = ent.getLocation(); + loc.setDirection(player.getLocation().getDirection()); + loc.setYaw(player.getLocation().getYaw()); + loc.setPitch(player.getLocation().getPitch()); + ArmorStand stand = (ArmorStand) living; + + living.teleport(loc); + } + } + } + } + + } + + + @EventHandler + public void onHit(ProjectileHitEvent event) { + if ((event.getEntity() instanceof Snowball) && projectiles.containsKey(event.getEntity().getUniqueId())) { + SiegeProjectile proj = projectiles.get(event.getEntity().getUniqueId()); + Entity snowball = event.getEntity(); + Location loc = snowball.getLocation(); + World world = event.getEntity().getWorld(); + // world.createExplosion(loc, proj.Radius, proj.DoFire); + Entity tnt = event.getEntity().getWorld().spawnEntity(loc, EntityType.PRIMED_TNT); + TNTPrimed tntEnt = (TNTPrimed) tnt; + tntEnt.setFuseTicks(0); + tntEnt.setYield(proj.Radius); + + projectiles.remove(event.getEntity().getUniqueId()); + } + } + @EventHandler + public void rightClick(PlayerInteractEvent event) { + Player player = event.getPlayer(); + + ItemStack ItemInHand = event.getPlayer().getInventory().getItemInMainHand(); + if (ItemInHand == null) { + return; + } + UUID trackedId = TrackedStands.get(player.getUniqueId()); + if (ItemInHand.getType() == Material.CLOCK) { + if (equipment.containsKey(trackedId)) { + SiegeEquipment siege = equipment.get(trackedId); + if (event.getAction() == Action.LEFT_CLICK_AIR) { + siege.FuseTime += 1; + player.sendMessage("§c Fuse Time set to " + siege.FuseTime); + return; + } + if (event.getAction() == Action.RIGHT_CLICK_AIR) { + siege.FuseTime -= 1; + if (siege.FuseTime < 10) { + siege.FuseTime = 10; + } + player.sendMessage("§cFuse Time set to " + siege.FuseTime); + return; + } + } + } + + if (ItemInHand.getType() == Material.BOOK) { + if (equipment.containsKey(trackedId)) { + SiegeEquipment siege = equipment.get(trackedId); + if (event.getAction() == Action.LEFT_CLICK_AIR) { + siege.Velocity += 0.1; + player.sendMessage("§eProjectile Speed set to " + siege.Velocity); + return; + } + if (event.getAction() == Action.RIGHT_CLICK_AIR) { + siege.Velocity -= 0.1; + player.sendMessage("§eProjectile Speed set to " + siege.Velocity); + return; + } + } + } + + if (event.getAction() == Action.LEFT_CLICK_AIR) { + if (ItemInHand.getType() != Material.BLAZE_ROD) { + return; + } + + for (Entity ent : player.getWorld().getEntities()) { + if (ent.getUniqueId() == trackedId) { + SiegeEquipment siege = equipment.get(trackedId); + + if (System.currentTimeMillis() < siege.NextShotTime) { + player.sendMessage("Cannot fire for another " + convertTime(siege.NextShotTime - System.currentTimeMillis())); + return; + } + + LivingEntity living = (LivingEntity) ent; + Location loc = living.getEyeLocation(); + loc.setPitch(-30); + loc.setY(loc.getY() + 2); + loc.getPitch(); + + Random random = new Random(); + + float randomVar = random.nextFloat() * (7 - -7) + -7; + loc.setYaw(loc.getYaw() + randomVar); + siege.NextModelNumber = 0; + siege.location = loc; + siege.NextShotTime = System.currentTimeMillis() + 60000; + player.sendMessage("Cannot fire for another " + convertTime(siege.NextShotTime - System.currentTimeMillis())); + siege.WorldName = ent.getWorld().getName(); + Bukkit.getServer().getWorld(siege.WorldName).playSound(siege.location, Sound.ENTITY_BAT_DEATH, 20, 2); + siege.TaskNumber = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, () -> { + //player.sendMessage("task"); + if (siege.HasFired) { + Bukkit.getServer().getScheduler().cancelTask(siege.TaskNumber); + siege.TaskNumber = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, () -> { + // player.sendMessage("task"); + if (siege.HasReloaded) { + Bukkit.getServer().getScheduler().cancelTask(siege.TaskNumber); + siege.HasReloaded = false; + siege.HasFired = false; + siege.NextModelNumber = 0; + } + else { + //firing stages + if (siege.NextModelNumber - 1 <= siege.FiringModelNumbers.size() && siege.NextModelNumber - 1 >= 0) { + int modelData = siege.FiringModelNumbers.get(siege.NextModelNumber - 1); + // player.sendMessage("" + modelData); + UpdateEntityIdModel(siege.EntityId, modelData, siege.WorldName); + siege.NextModelNumber -= 1; + + }else { + // plugin.getLogger().log(Level.INFO, "its reloaded"); + siege.HasReloaded = true; + } + } + }, 0, siege.MillisecondsBetweenReloadingStages); + + } + else { + //firing stages + if (siege.NextModelNumber < siege.FiringModelNumbers.size()) { + + int modelData = siege.FiringModelNumbers.get(siege.NextModelNumber); + // player.sendMessage("" + modelData); + UpdateEntityIdModel(siege.EntityId, modelData, siege.WorldName); + if (modelData == siege.ModelNumberToFireAt) { + Entity tnt = Bukkit.getServer().getWorld(siege.WorldName).spawnEntity(loc, EntityType.SNOWBALL); + + projectiles.put(tnt.getUniqueId(), siege.projectile); + tnt.setVelocity(loc.getDirection().multiply(siege.Velocity)); + + } + siege.NextModelNumber += 1; + + }else { + siege.HasFired = true; + + } + } + }, 0, siege.MillisecondsBetweenFiringStages); + return; + + } + } + + } + + + + + + } + + @EventHandler + public void onEntityClick(PlayerInteractEntityEvent event) { + + Player player = event.getPlayer(); + if (event.getRightClicked() instanceof ArmorStand) { + ItemStack itemInHand = player.getInventory().getItemInMainHand(); + + if (itemInHand == null) { + return; + } + if (itemInHand.getType() == Material.STICK) { + + + } + + } + } + } + +} diff --git a/src/siegeCore/SiegeEquipment.java b/src/siegeCore/SiegeEquipment.java new file mode 100644 index 0000000..cdf7e7f --- /dev/null +++ b/src/siegeCore/SiegeEquipment.java @@ -0,0 +1,48 @@ +package siegeCore; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +import org.bukkit.Location; +import org.bukkit.inventory.ItemStack; + +public class SiegeEquipment { + + public UUID EntityId; + + public ItemStack ItemToPlace; + + public String ItemToUseForModel; + + public String WorldName; + + public int FuseTime; + public double Velocity = 1; + public long NextShotTime = System.currentTimeMillis(); + + public int MillisecondsBetweenFiringStages; + public int MillisecondsBetweenReloadingStages; + + public int MillisecondsToLoad; + public Location location; + public int ModelNumberToFireAt; + + public Boolean HasFired = false; + public Boolean HasReloaded = false; + + public int TaskNumber; + + public int ReadyModelNumber; + + public int NextModelNumber = 0; + + public List FiringModelNumbers = new ArrayList(); + + public SiegeProjectile projectile = new SiegeProjectile(3, false); + + public SiegeEquipment(UUID id) { + EntityId = id; + } + +} diff --git a/src/siegeCore/SiegeProjectile.java b/src/siegeCore/SiegeProjectile.java new file mode 100644 index 0000000..ae45278 --- /dev/null +++ b/src/siegeCore/SiegeProjectile.java @@ -0,0 +1,13 @@ +package siegeCore; + +public class SiegeProjectile { + + public int Radius = 5; + public Boolean DoFire = false; + + public SiegeProjectile(int rad, boolean fire) { + Radius = rad; + DoFire = fire; + } + +}