Merge branch 'main' of github.com:PenguinOwl/QuidProQuo
random merge dunno whats going on
This commit is contained in:
commit
38e091c63d
32
src/main/java/top/penowl/quidproquo/Commands.java
Normal file
32
src/main/java/top/penowl/quidproquo/Commands.java
Normal file
@ -0,0 +1,32 @@
|
||||
package top.penowl.quidproquo;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class Commands implements CommandExecutor {
|
||||
|
||||
HashMap<String, Ritual> recipes = new HashMap<String, Ritual>();
|
||||
|
||||
public Commands(List<Ritual> rituals) {
|
||||
for (Ritual ritual : rituals) {
|
||||
recipes.put(ritual.name.toUpperCase(), ritual);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (args.length < 1) {
|
||||
// display help
|
||||
return true;
|
||||
} else if (recipes.containsKey(args[0].toUpperCase())) {
|
||||
// display recipe info
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
@ -30,6 +30,9 @@ public class QuidProQuo extends JavaPlugin {
|
||||
getLogger().info("Loading rituals...");
|
||||
getServer().getPluginManager().registerEvents(new Events(), this);
|
||||
|
||||
// register command handler
|
||||
getCommand("ritual").setExecutor(new Commands(rituals));
|
||||
|
||||
// register all rituals
|
||||
rituals.add(new HealRitual());
|
||||
rituals.add(new WoolingRitual());
|
||||
@ -39,6 +42,7 @@ public class QuidProQuo extends JavaPlugin {
|
||||
rituals.add(new AnvilRitual());
|
||||
rituals.add(new FillerRitual());
|
||||
rituals.add(new LavaRitual());
|
||||
rituals.add(new HitRitual());
|
||||
|
||||
// run ritual setup scripts
|
||||
for (Ritual ritual : rituals) {
|
||||
|
@ -7,13 +7,15 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import top.penowl.quidproquo.Ritual;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class AnvilRitual extends Ritual {
|
||||
|
||||
@Override
|
||||
public void setup() {
|
||||
addIngredient(Material.ANVIL, 1);
|
||||
addIngredient(Material.ENDER_PEARL, 2);
|
||||
addIngredient(Material.ROTTEN_FLESH, 32);
|
||||
addIngredient(Material.ENDER_PEARL, 1);
|
||||
addIngredient(Material.ROTTEN_FLESH, 1);
|
||||
addIngredient(Material.WHEAT, 32);
|
||||
name = "anviling";
|
||||
health = 5;
|
||||
backfire = 0.5;
|
||||
|
@ -2,7 +2,6 @@ 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;
|
||||
@ -11,8 +10,8 @@ public class FeedingRitual extends Ritual {
|
||||
|
||||
@Override
|
||||
public void setup() {
|
||||
addSacrifice(EntityType.PIG, 1);
|
||||
addIngredient(Material.WOOD_SWORD, 1);
|
||||
addIngredient(Material.WOOD_HOE, 1);
|
||||
addIngredient(Material.WHEAT, 16);
|
||||
health = 1;
|
||||
name = "feeding";
|
||||
}
|
||||
|
@ -15,8 +15,9 @@ public class FillerRitual extends Ritual {
|
||||
|
||||
@Override
|
||||
public void setup() {
|
||||
addIngredient(Material.LOG, 64);
|
||||
addIngredient(Material.LOG, 1);
|
||||
addSacrifice(EntityType.PIG, 1);
|
||||
addIngredient(Material.WHEAT, 128);
|
||||
name = "trolling";
|
||||
health = 2;
|
||||
backfire = 0.2;
|
||||
|
@ -11,8 +11,9 @@ public class GetLuckyRitual extends Ritual {
|
||||
|
||||
@Override
|
||||
public void setup() {
|
||||
addIngredient(Material.GOLD_BLOCK, 3);
|
||||
addIngredient(Material.GOLD_BLOCK, 1);
|
||||
addIngredient(Material.TNT, 1);
|
||||
addIngredient(Material.WHEAT, 256);
|
||||
health = 3;
|
||||
lightning = true;
|
||||
name = "daring";
|
||||
|
@ -10,13 +10,14 @@ public class HealRitual extends Ritual {
|
||||
|
||||
@Override
|
||||
public void setup() {
|
||||
addIngredient(Material.REDSTONE, 9);
|
||||
addIngredient(Material.REDSTONE, 1);
|
||||
addIngredient(Material.WHEAT, 16);
|
||||
name = "healing";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(Player caster, Player target, Location location) {
|
||||
caster.setHealth(Math.min(caster.getMaxHealth(), caster.getHealth()+2.0));
|
||||
caster.setHealth(Math.min(caster.getMaxHealth(), caster.getHealth()+8.0));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -11,16 +11,25 @@ public class HitRitual extends Ritual {
|
||||
@Override
|
||||
public void setup() {
|
||||
addIngredient(Material.IRON_SWORD, 1);
|
||||
<<<<<<< HEAD
|
||||
addIngredient(Material.IRON_INGOT, 1);
|
||||
=======
|
||||
>>>>>>> 7f77c0dac5cb9bbd0ceaf70f710f7fdecac3e9ad
|
||||
addIngredient(Material.WHEAT, 9);
|
||||
name = "shadow hit";
|
||||
health = 2;
|
||||
health = 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(Player caster, Player target, Location location) {
|
||||
<<<<<<< HEAD
|
||||
target.playSound(target.getLocation(), Sound.HURT_FLESH, 1, 1);
|
||||
//target.damage(1.0);
|
||||
=======
|
||||
for(int i = 0; i < 3; i ++) {
|
||||
target.playSound(target.getLocation(), Sound.SUCCESSFUL_HIT, 1, 1);
|
||||
}
|
||||
>>>>>>> 7f77c0dac5cb9bbd0ceaf70f710f7fdecac3e9ad
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -12,13 +12,13 @@ public class LavaRitual extends Ritual {
|
||||
addIngredient(Material.LAVA_BUCKET, 1);
|
||||
addIngredient(Material.DIAMOND, 1);
|
||||
addIngredient(Material.WHEAT, 64);
|
||||
backfire = 0.50;
|
||||
backfire = 0.10;
|
||||
name = "combustion";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(Player caster, Player target, Location location) {
|
||||
target.setFireTicks(60);
|
||||
target.setFireTicks(250);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -12,8 +12,9 @@ public class SnowmanRitual extends Ritual {
|
||||
@Override
|
||||
public void setup() {
|
||||
addIngredient(Material.STICK, 64);
|
||||
addIngredient(Material.DIAMOND, 2);
|
||||
addSacrifice(EntityType.SHEEP, 3);
|
||||
addIngredient(Material.DIAMOND, 1);
|
||||
addSacrifice(EntityType.SHEEP, 1);
|
||||
addIngredient(Material.WHEAT, 32);
|
||||
health = 10;
|
||||
name = "snowing";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user