This commit is contained in:
TheCrunchy committed 2023-07-30 14:56:18 +01:00
1 parent 72d3cdad85
commit 94b0296a29
6 files changed
+20 -10

No files matched your search

Binary file not shown.
Binary file not shown.
Binary file not shown.
+13 -6
View File
@@ -28,24 +28,26 @@ public class EntityProjectile implements CrunchProjectile{
public Sound SoundType = Sound.ENTITY_GENERIC_EXPLODE;
@Override
public void Shoot(Player player, Entity entity, Location FireLocation, Float velocity) {
PlaySound = true;
int baseDelay = 0;
for (int i = 0; i < EntityCount; i++) {
if (DelayedFire) {
baseDelay += DelayTime;
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(CrunchSiegeCore.plugin, () -> {
CreateEntity(entity, FireLocation, velocity);
CreateEntity(entity, FireLocation, velocity, player);
}, (long) baseDelay);
}
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();
LivingEntity living = (LivingEntity) entity;
@@ -62,11 +64,16 @@ public class EntityProjectile implements CrunchProjectile{
if (arrow instanceof Arrow) {
Arrow arr = (Arrow) arrow;
arr.setDamage(8);
arr.setShooter(player);
}
// MiscDisguise miscDisguise = new MiscDisguise(DisguiseType.DROPPED_ITEM, Material.IRON_NUGGET);
// DisguiseAPI.disguiseEntity(arrow, miscDisguise);
world.playSound(loc, this.SoundType, 20, 2);
world.spawnParticle(this.ParticleType, loc.getX(), loc.getY(), loc.getZ(), 0);
if (PlaySound) {
world.playSound(loc, this.SoundType, 20, 2);
world.spawnParticle(this.ParticleType, loc.getX(), loc.getY(), loc.getZ(), 0);
PlaySound = false;
}
}
private Vector Randomise() {
@@ -63,6 +63,7 @@ public class ExplosiveProjectile implements CrunchProjectile {
tnt.setVelocity(loc.getDirection().multiply(velocity));
}
// MiscDisguise miscDisguise = new MiscDisguise(DisguiseType.ARROW);
// miscDisguise.setEntity(tnt);
// miscDisguise.startDisguise();
+6 -4
View File
@@ -86,10 +86,12 @@ public class ClickHandler implements Listener {
}
}
}
List<Block> Blocks = sphere(loc, proj.ExplodePower);
for (int i = 0; i < proj.BlocksToPlaceAmount; i++) {
Block replace = getRandomElement(Blocks);
replace.setType(Material.COBWEB);
if (event.getHitBlock() != null) {
List<Block> Blocks = sphere(event.getHitBlock().getLocation(), proj.ExplodePower);
for (int i = 0; i < proj.BlocksToPlaceAmount; i++) {
Block replace = getRandomElement(Blocks);
replace.setType(Material.COBWEB);
}
}
}
}