Merge branch 'main' of github.com:PenguinOwl/QuidProQuo

This commit is contained in:
Edith Boles 2021-10-03 16:01:33 -07:00
commit 5f9327cc1f
12 changed files with 157 additions and 29 deletions

View File

@ -31,28 +31,32 @@ public class QuidProQuo extends JavaPlugin {
getServer().getPluginManager().registerEvents(new Events(), this);
// register all rituals
rituals.add(new WoolingRitual());
rituals.add(new FeedingRitual());
rituals.add(new SnowmanRitual());
rituals.add(new GetLuckyRitual());
rituals.add(new AnvilRitual());
rituals.add(new FillerRitual());
rituals.add(new LavaRitual());
rituals.add(new HitRitual());
rituals.add(new HerobrineRitual());
rituals.add(new BatSpewRitual());
rituals.add(new BlockShiftRitual());
rituals.add(new ChickenSpewRitual());
rituals.add(new ChugJugRitual());
rituals.add(new CreeperHissRitual());
rituals.add(new RotateRitual());
rituals.add(new HealRitual());
rituals.add(new HardPenorRitual());
rituals.add(new SoftPenorRitual());
rituals.add(new QuicktimeRitual());
rituals.add(new LightQuicktimeRitual());
rituals.add(new WitherRitual());
rituals.add(new DragonRitual());
rituals.add(new CrystalizationRtiual());
rituals.add(new BatSpewRitual());
rituals.add(new DragonRitual());
rituals.add(new FakePlayerRitual());
rituals.add(new FeedingRitual());
rituals.add(new FillerRitual());
rituals.add(new GetLuckyRitual());
rituals.add(new HardPenorRitual());
rituals.add(new HealRitual());
rituals.add(new HerobrineRitual());
rituals.add(new HitRitual());
rituals.add(new LavaRitual());
rituals.add(new LightningRitual());
rituals.add(new LightQuicktimeRitual());
rituals.add(new QuicktimeRitual());
rituals.add(new RotateRitual());
rituals.add(new SnowmanRitual());
rituals.add(new SoftPenorRitual());
rituals.add(new SoundRitual());
rituals.add(new WitherRitual());
rituals.add(new WoolingRitual());
// run ritual setup scripts
for (Ritual ritual : rituals) {
@ -76,4 +80,4 @@ public class QuidProQuo extends JavaPlugin {
}
}
}

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

@ -0,0 +1,56 @@
package top.penowl.quidproquo.rituals;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import java.util.Random;
import top.penowl.quidproquo.Ritual;
public class BlockShiftRitual extends Ritual {
//possible mats
private static final Material[] pMat = {
Material.STONE, Material.GRASS, Material.DIRT, Material.COBBLESTONE, Material.WOOD,
Material.WATER, Material.LAVA, Material.SAND, Material.GRAVEL, Material.GOLD_ORE,
Material.IRON_ORE, Material.COAL_ORE, Material.LOG, Material.LEAVES, Material.SPONGE,
Material.GLASS, Material.LAPIS_ORE, Material.LAPIS_BLOCK, Material.SANDSTONE,
Material.WEB, Material.WOOL, Material.GOLD_BLOCK, Material.IRON_BLOCK, Material.BRICK,
Material.TNT, Material.BOOKSHELF, Material.MOSSY_COBBLESTONE, Material.OBSIDIAN,
Material.DIAMOND_ORE, Material.DIAMOND_BLOCK, Material.REDSTONE_ORE, Material.ICE,
Material.SNOW_BLOCK, Material.CLAY, Material.PUMPKIN, Material.NETHERRACK,
Material.SOUL_SAND, Material.GLOWSTONE, Material.JACK_O_LANTERN, Material.STAINED_GLASS,
Material.MONSTER_EGG, Material.SMOOTH_BRICK, Material.HUGE_MUSHROOM_1,
Material.HUGE_MUSHROOM_2, Material.MELON_BLOCK, Material.MYCEL, Material.NETHER_BRICK,
Material.ENDER_STONE, Material.EMERALD_ORE, Material.EMERALD_BLOCK, Material.REDSTONE_BLOCK,
Material.QUARTZ_ORE, Material.QUARTZ_BLOCK, Material.STAINED_CLAY, Material.LEAVES,
Material.LOG, Material.SLIME_BLOCK, Material.PRISMARINE, Material.SEA_LANTERN,
Material.HAY_BLOCK, Material.CLAY_BRICK, Material.COAL_BLOCK, Material.PACKED_ICE,
Material.RED_SANDSTONE
};
@Override
public void setup() {
addIngredient(Material.RED_MUSHROOM, 32);
addIngredient(Material.BROWN_MUSHROOM, 32);
addIngredient(Material.WHEAT, 32);
addIngredient(Material.ENDER_PEARL, 4);
name = "block shift";
}
@Override
public void execute(Player caster, Player target, Location location) {
Random random = new Random();
Material fromMat = pMat[random.nextInt(64)];
Material toMat = pMat[random.nextInt(64)];
for(int x = -5; x <= 5; x ++) {
for(int y = -5; y <= 5; y ++) {
for(int z = -5; z <= 5; z ++) {
Block testBlock = target.getLocation().getBlock().getRelative(x, y, z);
if(testBlock.getType() == fromMat)
testBlock.setType(toMat);
}
}
}
}
}

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,10 +2,8 @@ package top.penowl.quidproquo.rituals;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.EnderCrystal;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import top.penowl.quidproquo.Ritual;

View File

@ -1,7 +1,5 @@
package top.penowl.quidproquo.rituals;
import java.util.WeakHashMap;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;

View File

@ -0,0 +1,44 @@
package top.penowl.quidproquo.rituals;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Slime;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import java.util.Random;
import top.penowl.quidproquo.Ritual;
public class FakePlayerRitual extends Ritual {
@Override
public void setup() {
addIngredient(Material.WHEAT, 32);
addIngredient(Material.LEAVES, 32);
name = "player illusion";
}
@Override
public void execute(Player caster, Player target, Location location) {
Location loc = target.getLocation();
Random random = new Random();
int x = random.nextInt(51) - 25;
int y = random.nextInt(51) - 25;
int z = random.nextInt(51) - 25;
Entity fakePlayer = target.getWorld().spawnEntity(loc.clone().add(x, y, z), EntityType.SLIME);
fakePlayer.setCustomName(caster.getName());
LivingEntity fp_livingEntity = (LivingEntity)fakePlayer;
fp_livingEntity.setMaxHealth(100.0);
fp_livingEntity.setHealth(100.0);
fp_livingEntity.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 200, 100));
fp_livingEntity.addPotionEffect(new PotionEffect(PotionEffectType.WITHER, 200, 1));
Slime fpSlime = (Slime)fp_livingEntity;
fpSlime.setSize(1);
}
}

View File

@ -19,7 +19,7 @@ public class HardPenorRitual extends Ritual {
@Override
public void execute(Player caster, Player target, Location location) {
Block shaft = target.getLocation().getBlock();
Block shaft = caster.getLocation().getBlock();
Block ball1 = shaft.getRelative(2, -1, 0);
Block ball2 = shaft.getRelative(-2,-1,0);
//TODO USE ELEGANT MATHEMATICS INSTEAD OF SCUFFED IF STATEMENTS

View File

@ -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 org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;

View File

@ -0,0 +1,31 @@
package top.penowl.quidproquo.rituals;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.entity.Player;
import top.penowl.quidproquo.Ritual;
public class LightningRitual extends Ritual {
@Override
public void setup() {
addIngredient(Material.WHEAT, 64);
addIngredient(Material.GLOWSTONE, 64);
name = "lightning location";
}
@Override
public void execute(Player caster, Player target, Location location) {
// Does this actually get the overworld?
World world = location.getWorld();
List<Player> players = world.getPlayers();
for(Player player : players) {
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));
}
}