mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-19 15:09:25 +00:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@4d854e66 Disable MC-163962 fix by default Purpur Changes: PurpurMC/Purpur@04a9045d Fix phantom high speed by modifying the speed: Part 2 (#1682) PurpurMC/Purpur@175bb181 [ci/skip] micro opt when applying block friction on flying ridable mobs PurpurMC/Purpur@d0b705e4 Updated Upstream (Paper) PurpurMC/Purpur@3658291d Fix llama not moving when ridden, Fixes #1507 (#1684) PurpurMC/Purpur@051566db check for purpur.debug.f3n on new serverbound change gamemode packet, closes #1683 PurpurMC/Purpur@a112b6ac Final 1.21.6 Upstream (Paper)
36 lines
2.7 KiB
Diff
36 lines
2.7 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: adabugra <57899270+adabugra@users.noreply.github.com>
|
|
Date: Thu, 15 May 2025 19:09:04 +0300
|
|
Subject: [PATCH] Add configurable death item drop knockback settings
|
|
|
|
|
|
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
|
index 6d8c500839062ca0cad2ffc58dad0de1626c0eb9..cc015575efcb0c3d56d33510a1f43f40996eab1a 100644
|
|
--- a/net/minecraft/server/level/ServerPlayer.java
|
|
+++ b/net/minecraft/server/level/ServerPlayer.java
|
|
@@ -1133,7 +1133,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
|
if (!keepInventory) {
|
|
for (ItemStack item : this.getInventory().getContents()) {
|
|
if (!item.isEmpty() && !EnchantmentHelper.has(item, net.minecraft.world.item.enchantment.EnchantmentEffectComponents.PREVENT_EQUIPMENT_DROP)) {
|
|
- loot.add(new DefaultDrop(item, stack -> this.drop(stack, true, false, false, null))); // Paper - Restore vanilla drops behavior; drop function taken from Inventory#dropAll (don't fire drop event)
|
|
+ loot.add(new DefaultDrop(item, stack -> this.drop(stack, org.dreeam.leaf.config.modules.gameplay.DeathItemDropKnockback.dropAround, false, false, null))); // Paper - Restore vanilla drops behavior; drop function taken from Inventory#dropAll (don't fire drop event) // Leaf - Add configurable death item drop knockback settings
|
|
}
|
|
}
|
|
}
|
|
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
|
index 1d78cacbf2c63f35fdf0552d50834385ab51aaf0..f1975e5ab19da6dd1d8b94503924471e3efab921 100644
|
|
--- a/net/minecraft/world/entity/LivingEntity.java
|
|
+++ b/net/minecraft/world/entity/LivingEntity.java
|
|
@@ -4154,9 +4154,9 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
|
}
|
|
|
|
if (randomizeMotion) {
|
|
- float f = this.random.nextFloat() * 0.5F;
|
|
+ float f = this.random.nextFloat() * (float) org.dreeam.leaf.config.modules.gameplay.DeathItemDropKnockback.horizontalForce; // Leaf - Add configurable death item drop knockback settings
|
|
float f1 = this.random.nextFloat() * (float) (Math.PI * 2);
|
|
- itemEntity.setDeltaMovement(-Mth.sin(f1) * f, 0.2F, Mth.cos(f1) * f);
|
|
+ itemEntity.setDeltaMovement(-Mth.sin(f1) * f, (float) org.dreeam.leaf.config.modules.gameplay.DeathItemDropKnockback.verticalForce, Mth.cos(f1) * f); // Leaf - Add configurable death item drop knockback settings
|
|
} else {
|
|
float f = 0.3F;
|
|
float f1 = Mth.sin(this.getXRot() * (float) (Math.PI / 180.0));
|