Some minor tweaks to the code

Hope I didn't break anything
This commit is contained in:
B1G-FUNGUS 2021-10-03 15:24:20 -07:00
parent e47fb2bc24
commit 339210e887
5 changed files with 6 additions and 9 deletions

View File

@ -23,7 +23,7 @@ public class AnvilRitual extends Ritual {
@Override
public void execute(Player caster, Player target, Location location) {
FallingBlock block = target.getLocation().getWorld().spawnFallingBlock(target.getLocation().clone().add(0, 20, 0), Material.ANVIL, (byte) 0);
FallingBlock block = target.getWorld().spawnFallingBlock(target.getLocation().clone().add(0, 20, 0), Material.ANVIL, (byte) 0);
block.setHurtEntities(true);
}

View File

@ -14,7 +14,6 @@ public class BatSpewRitual extends Ritual {
addIngredient(Material.WHEAT, 64);
addIngredient(Material.IRON_PICKAXE, 1);
addSacrifice(EntityType.CHICKEN, 1);
health = 4;
name = "bat spew";
backfire = 0.1;
}
@ -22,7 +21,7 @@ public class BatSpewRitual extends Ritual {
@Override
public void execute(Player caster, Player target, Location location) {
for (int i = 0; i < 20; i++) {
target.getLocation().getWorld().spawnEntity(target.getLocation(), EntityType.CHICKEN);
target.getWorld().spawnEntity(target.getLocation(), EntityType.CHICKEN);
}
}

View File

@ -21,7 +21,7 @@ public class ChickenSpewRitual extends Ritual {
@Override
public void execute(Player caster, Player target, Location location) {
for (int i = 0; i < 20; i++) {
target.getLocation().getWorld().spawnEntity(target.getLocation(), EntityType.CHICKEN);
target.getWorld().spawnEntity(target.getLocation(), EntityType.CHICKEN);
}
}

View File

@ -2,7 +2,6 @@ package top.penowl.quidproquo.rituals;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
@ -22,10 +21,10 @@ public class LightningRitual extends Ritual {
@Override
public void execute(Player caster, Player target, Location location) {
// Does this actually get the overworld?
World overworld = Bukkit.getWorld("world");
List<Player> players = overworld.getPlayers();
World world = location.getWorld();
List<Player> players = world.getPlayers();
for(Player player : players) {
overworld.strikeLightningEffect(player.getLocation().clone().add(0, 1, 0));
world.strikeLightningEffect(player.getLocation().clone().add(0, 1, 0));
}
}

View File

@ -21,7 +21,6 @@ public class WoolingRitual extends Ritual {
@Override
public void execute(Player caster, Player target, Location location) {
caster.setHealth(Math.min(caster.getMaxHealth(), caster.getHealth()+2.0));
}
}