mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-30 12:29:18 +00:00
42 lines
1.9 KiB
Diff
42 lines
1.9 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 4a132c3eff6978e927bcd4df56b9ce0306af6d19..8f390c7201da00f7e1c5913f0d0642a2b5e943cb 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
|
@@ -36,6 +36,8 @@ import net.minecraft.world.entity.ai.goal.Goal;
|
|
import net.minecraft.world.entity.ai.targeting.TargetingConditions;
|
|
import net.minecraft.world.entity.animal.Cat;
|
|
import net.minecraft.world.entity.player.Player;
|
|
+import net.minecraft.world.item.ItemStack;
|
|
+import net.minecraft.world.item.Items;
|
|
import net.minecraft.world.level.Level;
|
|
import net.minecraft.world.level.ServerLevelAccessor;
|
|
import net.minecraft.world.level.levelgen.Heightmap;
|
|
@@ -250,6 +252,20 @@ public class Phantom extends FlyingMob implements Enemy {
|
|
return (double) this.getEyeHeight();
|
|
}
|
|
|
|
+ // Leaves start - renewable elytra
|
|
+ @Override
|
|
+ protected void dropFromLootTable(DamageSource source, boolean causedByPlayer) {
|
|
+ super.dropFromLootTable(source, causedByPlayer);
|
|
+ if (top.leavesmc.leaves.LeavesConfig.renewableElytra > 0.0D) {
|
|
+ if (source.getEntity() instanceof Shulker && this.random.nextDouble() < top.leavesmc.leaves.LeavesConfig.renewableElytra) {
|
|
+ ItemStack item = new ItemStack(Items.ELYTRA);
|
|
+ item.setDamageValue(432);
|
|
+ this.spawnAtLocation(item);
|
|
+ }
|
|
+ }
|
|
+ }
|
|
+ // Leaves end - renewable elytra
|
|
+
|
|
// Paper start
|
|
java.util.UUID spawningEntity;
|
|
|