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
MC_XiaoHei 90080d238e 1.21.10 (#752)
---------

Co-authored-by: Lumine1909 <133463833+Lumine1909@users.noreply.github.com>
Co-authored-by: violetc <58360096+s-yh-china@users.noreply.github.com>
Co-authored-by: Helvetica Volubi <88063803+Suisuroru@users.noreply.github.com>
2025-11-28 03:15:54 +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 b0f0a70ef6d708917ac8278c7eebd81d1fd7df6a..25c02ce8a613adae374bf85ed282399d44fba2ef 100644
--- a/net/minecraft/world/entity/monster/Phantom.java
+++ b/net/minecraft/world/entity/monster/Phantom.java
@@ -242,6 +242,20 @@ public class Phantom extends Mob 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(431);
+ this.spawnAtLocation(level, item);
+ }
+ }
+ }
+ // Leaves end - renewable elytra
+
static enum AttackPhase {
CIRCLE,
SWOOP;