mirror of
https://github.com/LeavesMC/Leaves.git
synced 2026-01-03 22:26:12 +00:00
33 lines
1.6 KiB
Diff
33 lines
1.6 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/src/main/java/net/minecraft/world/entity/monster/Phantom.java b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
|
index 150fd890ac65097b5434fd88e8d2b24a89dca79a..e47de71f7c120cf7f1a7cdb5e49b1d89163e5722 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
|
@@ -233,6 +233,20 @@ public class Phantom extends FlyingMob implements Enemy {
|
|
return predicate.test(world, this, target);
|
|
}
|
|
|
|
+ // 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
|
|
+
|
|
// Paper start
|
|
@Nullable
|
|
java.util.UUID spawningEntity;
|