mirror of
https://github.com/darksaid98/SiegeEngines.git
synced 2026-12-03 14:38:53 +00:00
.
This commit is contained in:
1 parent
72d3cdad85
commit
94b0296a29
6 files changed
+19
-9
No files matched your search
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -28,24 +28,26 @@ public class EntityProjectile implements CrunchProjectile{
|
|||||||
public Sound SoundType = Sound.ENTITY_GENERIC_EXPLODE;
|
public Sound SoundType = Sound.ENTITY_GENERIC_EXPLODE;
|
||||||
@Override
|
@Override
|
||||||
public void Shoot(Player player, Entity entity, Location FireLocation, Float velocity) {
|
public void Shoot(Player player, Entity entity, Location FireLocation, Float velocity) {
|
||||||
|
PlaySound = true;
|
||||||
int baseDelay = 0;
|
int baseDelay = 0;
|
||||||
for (int i = 0; i < EntityCount; i++) {
|
for (int i = 0; i < EntityCount; i++) {
|
||||||
if (DelayedFire) {
|
if (DelayedFire) {
|
||||||
baseDelay += DelayTime;
|
baseDelay += DelayTime;
|
||||||
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(CrunchSiegeCore.plugin, () -> {
|
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(CrunchSiegeCore.plugin, () -> {
|
||||||
|
|
||||||
CreateEntity(entity, FireLocation, velocity);
|
CreateEntity(entity, FireLocation, velocity, player);
|
||||||
}, (long) baseDelay);
|
}, (long) baseDelay);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
CreateEntity(entity, FireLocation, velocity);
|
CreateEntity(entity, FireLocation, velocity, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void CreateEntity(Entity entity, Location loc, Float velocity) {
|
private boolean PlaySound = true;
|
||||||
|
private void CreateEntity(Entity entity, Location loc, Float velocity, Player player) {
|
||||||
World world = entity.getLocation().getWorld();
|
World world = entity.getLocation().getWorld();
|
||||||
LivingEntity living = (LivingEntity) entity;
|
LivingEntity living = (LivingEntity) entity;
|
||||||
|
|
||||||
@@ -62,11 +64,16 @@ public class EntityProjectile implements CrunchProjectile{
|
|||||||
if (arrow instanceof Arrow) {
|
if (arrow instanceof Arrow) {
|
||||||
Arrow arr = (Arrow) arrow;
|
Arrow arr = (Arrow) arrow;
|
||||||
arr.setDamage(8);
|
arr.setDamage(8);
|
||||||
|
arr.setShooter(player);
|
||||||
}
|
}
|
||||||
// MiscDisguise miscDisguise = new MiscDisguise(DisguiseType.DROPPED_ITEM, Material.IRON_NUGGET);
|
// MiscDisguise miscDisguise = new MiscDisguise(DisguiseType.DROPPED_ITEM, Material.IRON_NUGGET);
|
||||||
// DisguiseAPI.disguiseEntity(arrow, miscDisguise);
|
// DisguiseAPI.disguiseEntity(arrow, miscDisguise);
|
||||||
world.playSound(loc, this.SoundType, 20, 2);
|
if (PlaySound) {
|
||||||
world.spawnParticle(this.ParticleType, loc.getX(), loc.getY(), loc.getZ(), 0);
|
world.playSound(loc, this.SoundType, 20, 2);
|
||||||
|
world.spawnParticle(this.ParticleType, loc.getX(), loc.getY(), loc.getZ(), 0);
|
||||||
|
PlaySound = false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Vector Randomise() {
|
private Vector Randomise() {
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ public class ExplosiveProjectile implements CrunchProjectile {
|
|||||||
tnt.setVelocity(loc.getDirection().multiply(velocity));
|
tnt.setVelocity(loc.getDirection().multiply(velocity));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// MiscDisguise miscDisguise = new MiscDisguise(DisguiseType.ARROW);
|
// MiscDisguise miscDisguise = new MiscDisguise(DisguiseType.ARROW);
|
||||||
// miscDisguise.setEntity(tnt);
|
// miscDisguise.setEntity(tnt);
|
||||||
// miscDisguise.startDisguise();
|
// miscDisguise.startDisguise();
|
||||||
|
|||||||
@@ -86,10 +86,12 @@ public class ClickHandler implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<Block> Blocks = sphere(loc, proj.ExplodePower);
|
if (event.getHitBlock() != null) {
|
||||||
for (int i = 0; i < proj.BlocksToPlaceAmount; i++) {
|
List<Block> Blocks = sphere(event.getHitBlock().getLocation(), proj.ExplodePower);
|
||||||
Block replace = getRandomElement(Blocks);
|
for (int i = 0; i < proj.BlocksToPlaceAmount; i++) {
|
||||||
replace.setType(Material.COBWEB);
|
Block replace = getRandomElement(Blocks);
|
||||||
|
replace.setType(Material.COBWEB);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user