mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-21 07:49:35 +00:00
--------- Co-authored-by: MC_XiaoHei <xiaohei.xor7studio@foxmail.com> Co-authored-by: Bluemangoo <chenfy2006@qq.com>
29 lines
1.8 KiB
Diff
29 lines
1.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
|
Date: Fri, 7 Jul 2023 16:53:32 +0800
|
|
Subject: [PATCH] Lava riptide
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/item/TridentItem.java b/src/main/java/net/minecraft/world/item/TridentItem.java
|
|
index 47de500fddb0716d142f8f5876a82a95afaa06fa..b01e85c9665fef476acdde74f08beaba168561db 100644
|
|
--- a/src/main/java/net/minecraft/world/item/TridentItem.java
|
|
+++ b/src/main/java/net/minecraft/world/item/TridentItem.java
|
|
@@ -70,7 +70,7 @@ public class TridentItem extends Item implements ProjectileItem {
|
|
if (j >= 10) {
|
|
int k = EnchantmentHelper.getRiptide(stack);
|
|
|
|
- if (k <= 0 || entityhuman.isInWaterOrRain()) {
|
|
+ if (k <= 0 || entityhuman.isInWaterOrRain() || (org.leavesmc.leaves.LeavesConfig.lavaRiptide && entityhuman.isInLava())) { // Leaves - lava riptide
|
|
if (!world.isClientSide) {
|
|
// itemstack.hurtAndBreak(1, entityhuman, EntityLiving.getSlotForHand(entityliving.getUsedItemHand())); // CraftBukkit - moved down
|
|
if (k == 0) {
|
|
@@ -155,7 +155,7 @@ public class TridentItem extends Item implements ProjectileItem {
|
|
|
|
if (itemstack.getDamageValue() >= itemstack.getMaxDamage() - 1) {
|
|
return InteractionResultHolder.fail(itemstack);
|
|
- } else if (EnchantmentHelper.getRiptide(itemstack) > 0 && !user.isInWaterOrRain()) {
|
|
+ } else if (EnchantmentHelper.getRiptide(itemstack) > 0 && !user.isInWaterOrRain() && !(org.leavesmc.leaves.LeavesConfig.lavaRiptide && user.isInLava())) { // Leaves - lava riptide
|
|
return InteractionResultHolder.fail(itemstack);
|
|
} else {
|
|
user.startUsingItem(hand);
|