Skip to content

Commit

Permalink
fix spigot broken changes
Browse files Browse the repository at this point in the history
  • Loading branch information
YouHaveTrouble committed Jun 25, 2024
1 parent 712fada commit b847867
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.purpurmc.purpurextras.modules;

import io.papermc.paper.event.entity.EntityMoveEvent;
import org.bukkit.event.entity.EntityMountEvent;
import org.purpurmc.purpurextras.PurpurExtras;
import org.bukkit.entity.*;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.spigotmc.event.entity.EntityMountEvent;

/**
* If enabled, only nametagged mobs can be mounted/steered using purpur's rideable option.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public boolean shouldEnable() {

@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onLightningStrike(EntityDamageByEntityEvent event) {
if (!event.getDamager().getType().equals(EntityType.LIGHTNING)) return;
if (!event.getDamager().getType().equals(EntityType.LIGHTNING_BOLT)) return;
Entity entity = event.getEntity();
if (!(entity instanceof LivingEntity livingEntity)) return;
if (entity.getEntitySpawnReason().equals(CreatureSpawnEvent.SpawnReason.LIGHTNING)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public boolean shouldEnable() {
public void onFallDamage(EntityDamageEvent event){
if (!EntityDamageEvent.DamageCause.FALL.equals(event.getCause())) return;
if (!(event.getEntity() instanceof LivingEntity livingEntity)) return;
if (!livingEntity.hasPotionEffect(PotionEffectType.JUMP)) return;
if (!livingEntity.hasPotionEffect(PotionEffectType.JUMP_BOOST)) return;
event.setCancelled(true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static boolean damage(ItemStack itemStack, int amount, boolean ignoreUnbr
ItemMeta meta = itemStack.getItemMeta();
Damageable damageable = (Damageable) itemStack.getItemMeta();
if (amount > 0) {
int unbreaking = meta.getEnchantLevel(Enchantment.DURABILITY);
int unbreaking = meta.getEnchantLevel(Enchantment.UNBREAKING);
int reduce = 0;
for (int i = 0; unbreaking > 0 && i < amount; ++i) {
if (reduceDamage(itemStack, ThreadLocalRandom.current(), unbreaking)) {
Expand Down

0 comments on commit b847867

Please sign in to comment.