9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-19 14:59:32 +00:00
Files
LeavesMC/leaves-server/minecraft-patches/features/0032-Renewable-Elytra.patch
Lumine1909 f09fbb247d 1.21.5 (#470)
---------

Co-authored-by: violetc <58360096+s-yh-china@users.noreply.github.com>
Co-authored-by: Fortern <blueten.ki@gmail.com>
Co-authored-by: MC_XiaoHei <xor7xiaohei@gmail.com>
Co-authored-by: Helvetica Volubi <88063803+Suisuroru@users.noreply.github.com>
Co-authored-by: MC_XiaoHei <xiaohei.xor7@outlook.com>
2025-06-05 18:41:51 +08:00

33 lines
1.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Mon, 12 Dec 2022 16:41:52 +0800
Subject: [PATCH] Renewable Elytra
This patch is Powered by Carpet-TIS-Addition(https://github.com/plusls/Carpet-TIS-Addition)
diff --git a/net/minecraft/world/entity/monster/Phantom.java b/net/minecraft/world/entity/monster/Phantom.java
index 483b0499f1f70b3aa8862e6cd8e512748492bee0..896c6fe4ee76708f09022934056cd9de74c5e851 100644
--- a/net/minecraft/world/entity/monster/Phantom.java
+++ b/net/minecraft/world/entity/monster/Phantom.java
@@ -231,6 +231,20 @@ public class Phantom extends FlyingMob implements Enemy {
return targetingConditions.test(level, this, entity);
}
+ // Leaves start - renewable elytra
+ @Override
+ protected void dropFromLootTable(ServerLevel level, DamageSource source, boolean causedByPlayer) {
+ super.dropFromLootTable(level, source, causedByPlayer);
+ if (org.leavesmc.leaves.LeavesConfig.modify.renewableElytra > 0.0D) {
+ if (source.getEntity() instanceof Shulker && this.random.nextDouble() < org.leavesmc.leaves.LeavesConfig.modify.renewableElytra) {
+ net.minecraft.world.item.ItemStack item = new net.minecraft.world.item.ItemStack(net.minecraft.world.item.Items.ELYTRA);
+ item.setDamageValue(432);
+ this.spawnAtLocation(level, item);
+ }
+ }
+ }
+ // Leaves end - renewable elytra
+
static enum AttackPhase {
CIRCLE,
SWOOP;