mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 02:47:43 +01:00
Option to disable turtle egg trampling with feather falling
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -192,9 +_,25 @@
|
||||
@@ -192,9 +_,31 @@
|
||||
}
|
||||
|
||||
private boolean canDestroyEgg(ServerLevel level, Entity entity) {
|
||||
@@ -33,6 +33,12 @@
|
||||
+ if (!(entity instanceof LivingEntity)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Purpur start - Option to disable turtle egg trampling with feather falling
|
||||
+ if (level.purpurConfig.turtleEggsTramplingFeatherFalling) {
|
||||
+ java.util.Iterator<ItemStack> armor = ((LivingEntity) entity).getArmorSlots().iterator();
|
||||
+ return !armor.hasNext() || net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.FEATHER_FALLING, armor.next()) < (int) entity.fallDistance;
|
||||
+ }
|
||||
+ // Purpur end - Option to disable turtle egg trampling with feather falling
|
||||
+ if (entity instanceof Player) return true;
|
||||
+
|
||||
+ return level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING);
|
||||
|
||||
Reference in New Issue
Block a user