Files
MiraiMC/patches/server/0044-Don-t-send-fire-packets-if-player-has-Fire-Resistanc.patch
2022-10-14 20:37:03 +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 0565cf824c2d623845239cb07c80f042732ff6be..4aae8f6dc6f06ca9bc30b86a4dac57f38560e395 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -878,7 +878,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;