From 5aecfb7328fd527f40021391ee8d327426941578 Mon Sep 17 00:00:00 2001 From: B1G-FUNGUS Date: Sat, 2 Oct 2021 20:50:04 -0700 Subject: [PATCH 01/12] Organized and added registers I think I did something else but I forgot and too lazy to check diff --- .../top/penowl/quidproquo/QuidProQuo.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main/java/top/penowl/quidproquo/QuidProQuo.java b/src/main/java/top/penowl/quidproquo/QuidProQuo.java index d77bd4f..8bf3f6e 100644 --- a/src/main/java/top/penowl/quidproquo/QuidProQuo.java +++ b/src/main/java/top/penowl/quidproquo/QuidProQuo.java @@ -31,20 +31,22 @@ 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 ChickenSpewRitual()); rituals.add(new ChugJugRitual()); rituals.add(new CreeperHissRitual()); - rituals.add(new RotateRitual()); + 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 RotateRitual()); + rituals.add(new SnowmanRitual()); + rituals.add(new SoftPenorRitual()); + rituals.add(new WoolingRitual()); // run ritual setup scripts for (Ritual ritual : rituals) { @@ -68,4 +70,4 @@ public class QuidProQuo extends JavaPlugin { } -} \ No newline at end of file +} From a8bd059d7d687014bc38c193172ba4dc1d70ea65 Mon Sep 17 00:00:00 2001 From: B1G-FUNGUS Date: Sat, 2 Oct 2021 20:59:23 -0700 Subject: [PATCH 02/12] Fixing registers again forgot to save + surprise push from mr. else-if --- .../java/top/penowl/quidproquo/QuidProQuo.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main/java/top/penowl/quidproquo/QuidProQuo.java b/src/main/java/top/penowl/quidproquo/QuidProQuo.java index a2f93ab..6472394 100644 --- a/src/main/java/top/penowl/quidproquo/QuidProQuo.java +++ b/src/main/java/top/penowl/quidproquo/QuidProQuo.java @@ -32,22 +32,28 @@ public class QuidProQuo extends JavaPlugin { // register all rituals rituals.add(new AnvilRitual()); + rituals.add(new BatSpewRitual()); rituals.add(new ChickenSpewRitual()); rituals.add(new ChugJugRitual()); rituals.add(new CreeperHissRitual()); + rituals.add(new CrystalizationRtiual()); + rituals.add(new DragonRitual()); rituals.add(new FeedingRitual()); rituals.add(new FillerRitual()); rituals.add(new GetLuckyRitual()); rituals.add(new HardPenorRitual()); rituals.add(new HealRitual()); - rituals.add(new HardPenorRitual()); - rituals.add(new SoftPenorRitual()); - rituals.add(new QuicktimeRitual()); + rituals.add(new HerobrineRitual()); + rituals.add(new HitRitual()); + rituals.add(new LavaRitual()); 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 DragonRitual()); - rituals.add(new CrystalizationRtiual()); - rituals.add(new BatSpewRitual()); + rituals.add(new WoolingRitual()); // run ritual setup scripts for (Ritual ritual : rituals) { From e44cc58d8d9dcf10380ec2c39d2c32e2818f9032 Mon Sep 17 00:00:00 2001 From: B1G-FUNGUS Date: Sat, 2 Oct 2021 21:01:18 -0700 Subject: [PATCH 03/12] Removed unecessary imports Wow, I wonder what the yellow warnings mean. though to be fair java is scuffed and I've gotten warnings for ok things --- .../top/penowl/quidproquo/rituals/CrystalizationRtiual.java | 2 -- src/main/java/top/penowl/quidproquo/rituals/DragonRitual.java | 2 -- .../top/penowl/quidproquo/rituals/LightQuicktimeRitual.java | 1 - 3 files changed, 5 deletions(-) diff --git a/src/main/java/top/penowl/quidproquo/rituals/CrystalizationRtiual.java b/src/main/java/top/penowl/quidproquo/rituals/CrystalizationRtiual.java index afbeb08..224d955 100644 --- a/src/main/java/top/penowl/quidproquo/rituals/CrystalizationRtiual.java +++ b/src/main/java/top/penowl/quidproquo/rituals/CrystalizationRtiual.java @@ -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; diff --git a/src/main/java/top/penowl/quidproquo/rituals/DragonRitual.java b/src/main/java/top/penowl/quidproquo/rituals/DragonRitual.java index bef9218..4c9c2f7 100644 --- a/src/main/java/top/penowl/quidproquo/rituals/DragonRitual.java +++ b/src/main/java/top/penowl/quidproquo/rituals/DragonRitual.java @@ -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; diff --git a/src/main/java/top/penowl/quidproquo/rituals/LightQuicktimeRitual.java b/src/main/java/top/penowl/quidproquo/rituals/LightQuicktimeRitual.java index 4b1cef1..3edd6f5 100644 --- a/src/main/java/top/penowl/quidproquo/rituals/LightQuicktimeRitual.java +++ b/src/main/java/top/penowl/quidproquo/rituals/LightQuicktimeRitual.java @@ -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; From 8e51a13dc49bcd7659fa9baab93f9f4fe3856c55 Mon Sep 17 00:00:00 2001 From: B1G-FUNGUS Date: Sun, 3 Oct 2021 12:07:42 -0700 Subject: [PATCH 04/12] Saving my stuff before a surprise push kills me --- .../quidproquo/rituals/BlockShiftRitual.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/main/java/top/penowl/quidproquo/rituals/BlockShiftRitual.java diff --git a/src/main/java/top/penowl/quidproquo/rituals/BlockShiftRitual.java b/src/main/java/top/penowl/quidproquo/rituals/BlockShiftRitual.java new file mode 100644 index 0000000..81fabcc --- /dev/null +++ b/src/main/java/top/penowl/quidproquo/rituals/BlockShiftRitual.java @@ -0,0 +1,28 @@ +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 BlockShiftRitual extends Ritual { + //possible mats + private static final Material[] pMat = { + Material.STONE, Material.GRASS, Material.DIRT, Material.COBBLESTONE, Material.PLANKS, + Material.WATER, Material.LAVA, Material.SAND + }; + @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) { + } + +} From e7ccd9df453ff79be3a65bc7fb081299f6390299 Mon Sep 17 00:00:00 2001 From: B1G-FUNGUS Date: Sun, 3 Oct 2021 12:24:30 -0700 Subject: [PATCH 05/12] imagine pushing broken code could be m --- .../quidproquo/rituals/BlockShiftRitual.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main/java/top/penowl/quidproquo/rituals/BlockShiftRitual.java b/src/main/java/top/penowl/quidproquo/rituals/BlockShiftRitual.java index 81fabcc..b1663ed 100644 --- a/src/main/java/top/penowl/quidproquo/rituals/BlockShiftRitual.java +++ b/src/main/java/top/penowl/quidproquo/rituals/BlockShiftRitual.java @@ -9,8 +9,22 @@ 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.PLANKS, - Material.WATER, Material.LAVA, Material.SAND + 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() { From 3fe7b725abe05859be976b968faaa637efb0fefa Mon Sep 17 00:00:00 2001 From: B1G-FUNGUS Date: Sun, 3 Oct 2021 12:32:00 -0700 Subject: [PATCH 06/12] Adds a block shift ritual --- .../quidproquo/rituals/BlockShiftRitual.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/top/penowl/quidproquo/rituals/BlockShiftRitual.java b/src/main/java/top/penowl/quidproquo/rituals/BlockShiftRitual.java index b1663ed..28199e8 100644 --- a/src/main/java/top/penowl/quidproquo/rituals/BlockShiftRitual.java +++ b/src/main/java/top/penowl/quidproquo/rituals/BlockShiftRitual.java @@ -2,7 +2,9 @@ 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; @@ -37,6 +39,18 @@ public class BlockShiftRitual extends Ritual { @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); + } + } + } } } From 3a4485ce5709aa554fa6d9257ade9c68d0ce2576 Mon Sep 17 00:00:00 2001 From: B1G-FUNGUS Date: Sun, 3 Oct 2021 13:11:22 -0700 Subject: [PATCH 07/12] Added block shift ritual to the register --- src/main/java/top/penowl/quidproquo/QuidProQuo.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/top/penowl/quidproquo/QuidProQuo.java b/src/main/java/top/penowl/quidproquo/QuidProQuo.java index 6472394..8d9ae4e 100644 --- a/src/main/java/top/penowl/quidproquo/QuidProQuo.java +++ b/src/main/java/top/penowl/quidproquo/QuidProQuo.java @@ -33,6 +33,7 @@ public class QuidProQuo extends JavaPlugin { // register all rituals rituals.add(new AnvilRitual()); rituals.add(new BatSpewRitual()); + rituals.add(new BlockShiftRitual()); rituals.add(new ChickenSpewRitual()); rituals.add(new ChugJugRitual()); rituals.add(new CreeperHissRitual()); From 222b0b0732c0f15c10533340ea08d386d34a09d9 Mon Sep 17 00:00:00 2001 From: B1G-FUNGUS Date: Sun, 3 Oct 2021 13:35:48 -0700 Subject: [PATCH 08/12] Added a lightning ritual reveals players locations in the overworld with lightning --- .../top/penowl/quidproquo/QuidProQuo.java | 1 + .../quidproquo/rituals/LightningRitual.java | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 src/main/java/top/penowl/quidproquo/rituals/LightningRitual.java diff --git a/src/main/java/top/penowl/quidproquo/QuidProQuo.java b/src/main/java/top/penowl/quidproquo/QuidProQuo.java index 8d9ae4e..6f36d45 100644 --- a/src/main/java/top/penowl/quidproquo/QuidProQuo.java +++ b/src/main/java/top/penowl/quidproquo/QuidProQuo.java @@ -47,6 +47,7 @@ public class QuidProQuo extends JavaPlugin { 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()); diff --git a/src/main/java/top/penowl/quidproquo/rituals/LightningRitual.java b/src/main/java/top/penowl/quidproquo/rituals/LightningRitual.java new file mode 100644 index 0000000..2a19adc --- /dev/null +++ b/src/main/java/top/penowl/quidproquo/rituals/LightningRitual.java @@ -0,0 +1,32 @@ +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; +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 overworld = Bukkit.getWorld("world"); + List players = overworld.getPlayers(); + for(Player player : players) { + overworld.strikeLightningEffect(player.getLocation().clone().add(0, 1, 0)); + } + } + +} From 7c6e6ce9e55201854716883973473a368160d84d Mon Sep 17 00:00:00 2001 From: B1G-FUNGUS Date: Sun, 3 Oct 2021 14:20:18 -0700 Subject: [PATCH 09/12] Added a fake player ritual --- .../penowl/quidproquo/rituals/FakePlayer.java | 44 +++++++++++++++++++ .../quidproquo/rituals/HardPenorRitual.java | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 src/main/java/top/penowl/quidproquo/rituals/FakePlayer.java diff --git a/src/main/java/top/penowl/quidproquo/rituals/FakePlayer.java b/src/main/java/top/penowl/quidproquo/rituals/FakePlayer.java new file mode 100644 index 0000000..80bf150 --- /dev/null +++ b/src/main/java/top/penowl/quidproquo/rituals/FakePlayer.java @@ -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 FakePlayer 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); + } + +} diff --git a/src/main/java/top/penowl/quidproquo/rituals/HardPenorRitual.java b/src/main/java/top/penowl/quidproquo/rituals/HardPenorRitual.java index 2ec62b5..2ecb63b 100644 --- a/src/main/java/top/penowl/quidproquo/rituals/HardPenorRitual.java +++ b/src/main/java/top/penowl/quidproquo/rituals/HardPenorRitual.java @@ -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 From 80c6752535938483fd41122e6b65211e0fef3240 Mon Sep 17 00:00:00 2001 From: B1G-FUNGUS Date: Sun, 3 Oct 2021 14:21:49 -0700 Subject: [PATCH 10/12] Forgot to add to register + changed name from FakePlayer to FakePlayerRitual --- .../top/penowl/quidproquo/QuidProQuo.java | 1 + .../penowl/quidproquo/rituals/FakePlayer.java | 44 ------------------- 2 files changed, 1 insertion(+), 44 deletions(-) delete mode 100644 src/main/java/top/penowl/quidproquo/rituals/FakePlayer.java diff --git a/src/main/java/top/penowl/quidproquo/QuidProQuo.java b/src/main/java/top/penowl/quidproquo/QuidProQuo.java index 6f36d45..c8c57ca 100644 --- a/src/main/java/top/penowl/quidproquo/QuidProQuo.java +++ b/src/main/java/top/penowl/quidproquo/QuidProQuo.java @@ -39,6 +39,7 @@ public class QuidProQuo extends JavaPlugin { rituals.add(new CreeperHissRitual()); rituals.add(new CrystalizationRtiual()); rituals.add(new DragonRitual()); + rituals.add(new FakePlayerRitual()); rituals.add(new FeedingRitual()); rituals.add(new FillerRitual()); rituals.add(new GetLuckyRitual()); diff --git a/src/main/java/top/penowl/quidproquo/rituals/FakePlayer.java b/src/main/java/top/penowl/quidproquo/rituals/FakePlayer.java deleted file mode 100644 index 80bf150..0000000 --- a/src/main/java/top/penowl/quidproquo/rituals/FakePlayer.java +++ /dev/null @@ -1,44 +0,0 @@ -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 FakePlayer 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); - } - -} From e47fb2bc24056b2d468badecc745cb4683921a40 Mon Sep 17 00:00:00 2001 From: B1G-FUNGUS Date: Sun, 3 Oct 2021 14:22:26 -0700 Subject: [PATCH 11/12] wait no this is the commit that does that --- .../quidproquo/rituals/FakePlayerRitual.java | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/main/java/top/penowl/quidproquo/rituals/FakePlayerRitual.java diff --git a/src/main/java/top/penowl/quidproquo/rituals/FakePlayerRitual.java b/src/main/java/top/penowl/quidproquo/rituals/FakePlayerRitual.java new file mode 100644 index 0000000..6291bb5 --- /dev/null +++ b/src/main/java/top/penowl/quidproquo/rituals/FakePlayerRitual.java @@ -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); + } + +} From 339210e887dea45f6b7e84175a3e3d31d9b341ae Mon Sep 17 00:00:00 2001 From: B1G-FUNGUS Date: Sun, 3 Oct 2021 15:24:20 -0700 Subject: [PATCH 12/12] Some minor tweaks to the code Hope I didn't break anything --- .../java/top/penowl/quidproquo/rituals/AnvilRitual.java | 2 +- .../java/top/penowl/quidproquo/rituals/BatSpewRitual.java | 3 +-- .../top/penowl/quidproquo/rituals/ChickenSpewRitual.java | 2 +- .../top/penowl/quidproquo/rituals/LightningRitual.java | 7 +++---- .../java/top/penowl/quidproquo/rituals/WoolingRitual.java | 1 - 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/main/java/top/penowl/quidproquo/rituals/AnvilRitual.java b/src/main/java/top/penowl/quidproquo/rituals/AnvilRitual.java index 92ac00a..badc2a1 100644 --- a/src/main/java/top/penowl/quidproquo/rituals/AnvilRitual.java +++ b/src/main/java/top/penowl/quidproquo/rituals/AnvilRitual.java @@ -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); } diff --git a/src/main/java/top/penowl/quidproquo/rituals/BatSpewRitual.java b/src/main/java/top/penowl/quidproquo/rituals/BatSpewRitual.java index 18982d2..542d8a2 100644 --- a/src/main/java/top/penowl/quidproquo/rituals/BatSpewRitual.java +++ b/src/main/java/top/penowl/quidproquo/rituals/BatSpewRitual.java @@ -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); } } diff --git a/src/main/java/top/penowl/quidproquo/rituals/ChickenSpewRitual.java b/src/main/java/top/penowl/quidproquo/rituals/ChickenSpewRitual.java index 7625c76..6025a80 100644 --- a/src/main/java/top/penowl/quidproquo/rituals/ChickenSpewRitual.java +++ b/src/main/java/top/penowl/quidproquo/rituals/ChickenSpewRitual.java @@ -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); } } diff --git a/src/main/java/top/penowl/quidproquo/rituals/LightningRitual.java b/src/main/java/top/penowl/quidproquo/rituals/LightningRitual.java index 2a19adc..69ed6f3 100644 --- a/src/main/java/top/penowl/quidproquo/rituals/LightningRitual.java +++ b/src/main/java/top/penowl/quidproquo/rituals/LightningRitual.java @@ -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 players = overworld.getPlayers(); + World world = location.getWorld(); + List 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)); } } diff --git a/src/main/java/top/penowl/quidproquo/rituals/WoolingRitual.java b/src/main/java/top/penowl/quidproquo/rituals/WoolingRitual.java index 6c31022..0712215 100644 --- a/src/main/java/top/penowl/quidproquo/rituals/WoolingRitual.java +++ b/src/main/java/top/penowl/quidproquo/rituals/WoolingRitual.java @@ -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)); } }