fix spigot broken changes
This commit is contained in:
1 parent
712fada0fc
commit
b8478678f7
4 files changed
+4
-4
No files matched your search
@@ -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.
|
||||
|
||||
@@ -61,7 +61,7 @@ public class LightningTransformsMobsModule implements PurpurExtrasModule, Listen
|
||||
|
||||
@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)) {
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ public class NoFallDamageWhileHavingJumpBoostModule implements PurpurExtrasModul
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ public class ItemStackUtil {
|
||||
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)) {
|
||||
|
||||
Reference in new issue
Block a user