Snowman ritual

This commit is contained in:
Edith Boles 2021-10-01 16:10:10 -07:00
parent 2091effbea
commit 00a850827f
3 changed files with 33 additions and 3 deletions

View File

@ -52,9 +52,9 @@ public final class Events implements Listener {
List<Player> players = new ArrayList<Player>(Bukkit.getOnlinePlayers());
List<UUID> uuids = new ArrayList<UUID>();
for (Player target : players) {
if (target.getUniqueId() != playerUuid) {
//if (target.getUniqueId() != playerUuid) {
uuids.add(target.getUniqueId());
}
//}
}
Collections.sort(uuids);
@ -70,7 +70,7 @@ public final class Events implements Listener {
}
// friendly message
player.sendMessage(ChatColor.YELLOW + "Switched target to " + Bukkit.getPlayer(QuidProQuo.instance.targets.get(playerUuid)));
player.sendMessage(ChatColor.YELLOW + "Switched target to " + Bukkit.getPlayer(QuidProQuo.instance.targets.get(playerUuid)).getName());
} else {

View File

@ -8,6 +8,7 @@ import org.bukkit.plugin.java.JavaPlugin;
import top.penowl.quidproquo.rituals.FeedingRitual;
import top.penowl.quidproquo.rituals.HealRitual;
import top.penowl.quidproquo.rituals.SnowmanRitual;
import top.penowl.quidproquo.rituals.WoolingRitual;
public class QuidProQuo extends JavaPlugin {
@ -36,6 +37,7 @@ public class QuidProQuo extends JavaPlugin {
rituals.add(new HealRitual());
rituals.add(new WoolingRitual());
rituals.add(new FeedingRitual());
rituals.add(new SnowmanRitual());
// run ritual setup scripts
for (Ritual ritual : rituals) {

View File

@ -0,0 +1,28 @@
package top.penowl.quidproquo.rituals;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import top.penowl.quidproquo.Ritual;
public class SnowmanRitual extends Ritual {
@Override
public void setup() {
addIngredient(Material.STICK, 64);
addIngredient(Material.DIAMOND, 2);
addSacrifice(EntityType.SHEEP, 3);
health = 10;
name = "snowing";
}
@Override
public void execute(Player caster, Player target, Location location) {
for (int i = 0; i < 10; i++) {
target.getLocation().getWorld().spawnEntity(target.getLocation(), EntityType.SNOWMAN);
}
}
}