Files
MiraiMC/patches/server/0048-Don-t-send-fire-packets-if-player-has-Fire-Resistanc.patch
2022-06-27 20:06:51 +02:00

28 lines
1.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tom <cryptite@gmail.com>
Date: Thu, 23 Sep 2021 08:56:42 -0500
Subject: [PATCH] Don't send fire packets if player has Fire Resistance
Original code by Cryptite, licensed under MIT
You can find the original code on https://github.com/Cryptite/Slice
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index fadf8ab93cd9c4a4644e06d3b77dba0aaea1f421..e80ea887fc80b009c1cdced06de21f013689cfa4 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -877,7 +877,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
this.checkOutOfWorld();
if (!this.level.isClientSide) {
- this.setSharedFlagOnFire(this.remainingFireTicks > 0);
+ // Slice start
+ if (this instanceof net.minecraft.world.entity.LivingEntity livingEntity) {
+ this.setSharedFlagOnFire(this.remainingFireTicks > 0 && !livingEntity.hasEffect(net.minecraft.world.effect.MobEffects.FIRE_RESISTANCE));
+ } else {
+ this.setSharedFlagOnFire(this.remainingFireTicks > 0);
+ }
+ // Slice end
}
this.firstTick = false;