New rituals

This commit is contained in:
Edith Boles 2021-10-04 10:22:31 -07:00
parent f7bce13511
commit 97433f7c8a
3 changed files with 63 additions and 0 deletions

View File

@ -60,6 +60,8 @@ public class QuidProQuo extends JavaPlugin {
rituals.add(new SummoningRitual()); rituals.add(new SummoningRitual());
rituals.add(new WitherRitual()); rituals.add(new WitherRitual());
rituals.add(new WoolingRitual()); rituals.add(new WoolingRitual());
rituals.add(new RandomItemRitual());
rituals.add(new KickingRitual());
// run ritual setup scripts // run ritual setup scripts
for (Ritual ritual : rituals) { for (Ritual ritual : rituals) {

View File

@ -0,0 +1,27 @@
package top.penowl.quidproquo.rituals;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import top.penowl.quidproquo.Ritual;
public class KickingRitual extends Ritual {
@Override
public void setup() {
addIngredient(Material.WHEAT, 64*2);
addIngredient(Material.FLOWER_POT, 1);
addIngredient(Material.LOG, 1);
addIngredient(Material.IRON_BOOTS, 1);
health = 3;
name = "kicking";
backfire = 0.4;
}
@Override
public void execute(Player caster, Player target, Location location) {
target.kickPlayer("You have been banned by " + caster.getName() + ".");
}
}

View File

@ -0,0 +1,34 @@
package top.penowl.quidproquo.rituals;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import top.penowl.quidproquo.Ritual;
public class RandomItemRitual extends Ritual {
@Override
public void setup() {
addIngredient(Material.DIRT, 6);
addIngredient(Material.STONE, 5);
addIngredient(Material.IRON_INGOT, 4);
addIngredient(Material.GOLD_INGOT, 3;
addIngredient(Material.REDSTONE, 2);
addIngredient(Material.DIAMOND, 1);
addIngredient(Material.WHEAT, 16);
health = 2;
name = "itemization";
}
@Override
public void execute(Player caster, Player target, Location location) {
Random r = new Random();
int i = r.nextInt(440);
while(Material.getValue(i) == null){
i = r.nextInt(440);
}
location.getWorld().dropItemNaturally(location.clone().add(0, 1, 0), ItemStack(Material.getValue(i));
}
}