28 lines
1.3 KiB
Diff
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 ecc62a9e5379f7f9f0973f5d7d6e91bc93fb8d4c..d17c483b229df2a08b804521426472f1e7651bc8 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;
|