Skip to content

Commit

Permalink
EliteMobs 8.6.1-SNAPSHOT-3
Browse files Browse the repository at this point in the history
- [Fix] Further fixed default worldguard flags for dungeons for the Oasis release
- [Fix] Fixed particle effect for gold shotgun

Signed-off-by: MagmaGuy <tiagoarnaut@gmail.com>
  • Loading branch information
MagmaGuy committed Sep 11, 2023
1 parent fca3173 commit ee16090
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,21 @@ private GetTierCommand() {
public static void get(Player player, int tierLevel) {

ItemStack helmet = new ItemStack(Material.IRON_HELMET);
addDurability(helmet);
ItemStack chestplate = new ItemStack(Material.IRON_CHESTPLATE);
addDurability(chestplate);
ItemStack leggings = new ItemStack(Material.IRON_LEGGINGS);
addDurability(leggings);
ItemStack boots = new ItemStack(Material.IRON_BOOTS);
addDurability(boots);
ItemStack sword = new ItemStack(Material.IRON_SWORD);
addDurability(sword);
ItemStack axe = new ItemStack(Material.IRON_AXE);
addDurability(axe);
ItemStack bow = new ItemStack(Material.BOW);
addDurability(boots);
ItemStack cheatSword = new ItemStack(Material.NETHERITE_SWORD);
addDurability(cheatSword);

EliteItemManager.setEliteLevel(helmet, tierLevel);
EliteItemManager.setEliteLevel(chestplate, tierLevel);
Expand All @@ -46,4 +54,10 @@ public static void get(Player player, int tierLevel) {

}

private static void addDurability(ItemStack itemStack){
ItemMeta itemMeta = itemStack.getItemMeta();
itemMeta.addEnchant(Enchantment.DURABILITY, 5, false);
itemStack.setItemMeta(itemMeta);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ public OasisAdventure() {
"&8[EM] &6You have arrived at the Oasis!",
"&8[EM] &6You have left the Oasis!",
"oasis");
setWormholeWorldName("em_oasis_wormhole");
}
}
9 changes: 5 additions & 4 deletions src/main/java/com/magmaguy/elitemobs/powers/GoldShotgun.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void onHit(EliteMobDamagedByPlayerEvent event) {
private void doGoldShotgun(EliteEntity eliteEntity, Player player) {

eliteEntity.getLivingEntity().setAI(false);
Vector shotVector = player.getLocation().add(new Vector(0, 1, 0)).toVector().subtract(eliteEntity.getLivingEntity().getLocation().toVector());
Vector shotVector = player.getLocation().add(new Vector(0, 1, 0)).toVector().subtract(eliteEntity.getLivingEntity().getLocation().toVector()).normalize().multiply(.5);

new BukkitRunnable() {
int counter = 0;
Expand All @@ -53,7 +53,8 @@ public void run() {
return;
}

doSmokeEffect(eliteEntity, shotVector);
if (counter % 10 == 0)
doSmokeEffect(eliteEntity, shotVector);
counter++;

if (counter < 20 * 3) return;
Expand Down Expand Up @@ -94,15 +95,15 @@ private List<Item> generateVisualItems(EliteEntity eliteEntity, Vector shotVecto
"visual projectile",
List.of(ThreadLocalRandom.current().nextDouble() + "")));
ProjectileDamage.configureVisualProjectile(visualProjectile);
visualProjectile.setVelocity(getShotVector(shotVector).multiply(0.9));
visualProjectile.setVelocity(getShotVector(shotVector));
visualProjectile.setGravity(false);
nuggetList.add(visualProjectile);
}
return nuggetList;
}

private Vector getShotVector(Vector originalShotVector) {
return originalShotVector.add(new Vector(ThreadLocalRandom.current().nextDouble(-1, 1), ThreadLocalRandom.current().nextDouble(-1, 1), ThreadLocalRandom.current().nextDouble(-1, 1)).normalize().multiply(0.1));
return originalShotVector.clone().add(new Vector(ThreadLocalRandom.current().nextDouble(-.1, .1), ThreadLocalRandom.current().nextDouble(-.1, .1), ThreadLocalRandom.current().nextDouble(-.1, .1)).normalize().multiply(0.1));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ public static void protectMinidungeonArea(ProtectedRegion protectedRegion, EMPac
protectedRegion.setFlag(ELITEMOBS_ANTIEXPLOIT, deny);
protectedRegion.setFlag(ELITEMOBS_EVENTS, deny);
//WG events
protectedRegion.setFlag(Flags.PASSTHROUGH, deny);
protectedRegion.setFlag(Flags.INTERACT, deny);
protectedRegion.setFlag(Flags.CREEPER_EXPLOSION, deny);
protectedRegion.setFlag(Flags.FIRE_SPREAD, deny);
Expand Down Expand Up @@ -275,6 +276,7 @@ public static void protectMinidungeonArea(ProtectedRegion protectedRegion) {
protectedRegion.setFlag(ELITEMOBS_ANTIEXPLOIT, deny);
protectedRegion.setFlag(ELITEMOBS_EVENTS, deny);
//WG events
protectedRegion.setFlag(Flags.PASSTHROUGH, deny);
protectedRegion.setFlag(Flags.INTERACT, deny);
protectedRegion.setFlag(Flags.CREEPER_EXPLOSION, deny);
protectedRegion.setFlag(Flags.FIRE_SPREAD, deny);
Expand Down Expand Up @@ -312,8 +314,6 @@ public static void protectMinidungeonArea(ProtectedRegion protectedRegion) {
protectedRegion.setFlag(Flags.ENDERDRAGON_BLOCK_DAMAGE, deny);
protectedRegion.setFlag(Flags.LIGHTER, deny);
protectedRegion.setFlag(Flags.ENDERPEARL, deny);
protectedRegion.setFlag(Flags.BLOCK_PLACE, deny);
protectedRegion.setFlag(Flags.BLOCK_BREAK, deny);
//Bypass for redstone and doors
protectedRegion.setFlag(Flags.USE, allow);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: EliteMobs
version: 8.6.1-SNAPSHOT-1
version: 8.6.1-SNAPSHOT-2
author: MagmaGuy
main: com.magmaguy.elitemobs.EliteMobs
api-version: 1.14
Expand Down

0 comments on commit ee16090

Please sign in to comment.