mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-04-20 02:08:15 +02:00
Updated Upstream (Pufferfish)
Upstream has released updates that appear to apply and compile correctly Pufferfish Changes: pufferfish-gg/Pufferfish@f05b0e9 Updated Upstream (Paper) pufferfish-gg/Pufferfish@9a82b86 Updated Upstream (Paper) pufferfish-gg/Pufferfish@c6ec7a0 Updated Upstream (Paper) pufferfish-gg/Pufferfish@c789f72 Updated Upstream (Paper) pufferfish-gg/Pufferfish@9ddaa1a Updated Upstream (Paper) pufferfish-gg/Pufferfish@3554f78 Updated Upstream (Paper) pufferfish-gg/Pufferfish@a9e9d99 Updated Upstream (Paper) pufferfish-gg/Pufferfish@09a2f81 Updated Upstream (Paper) pufferfish-gg/Pufferfish@63ce67d Updated Upstream (Paper) pufferfish-gg/Pufferfish@8abd47b Updated Upstream (Paper) pufferfish-gg/Pufferfish@3415da0 Updated Upstream (Paper) pufferfish-gg/Pufferfish@cfa3c61 Updated Upstream (Paper) pufferfish-gg/Pufferfish@0a8641d 1.21.3 Update pufferfish-gg/Pufferfish@784d72f Updated Upstream (Paper) pufferfish-gg/Pufferfish@40e1ad0 Updated Upstream (Paper) pufferfish-gg/Pufferfish@95ef348 Make iterator counting in IteratorSafeOrderedReferenceSet thread-safe for async mob spawning (#109) pufferfish-gg/Pufferfish@34c0042 Updated Upstream (Paper)
This commit is contained in:
@@ -1,92 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Racci <90304606+DaRacci@users.noreply.github.com>
|
||||
Date: Fri, 4 Feb 2022 16:10:21 +1100
|
||||
Subject: [PATCH] Fire Immunity API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 9d81ae0320426f20d7078a3d1fe8b3ff31ccfebc..c377339088c536255e319ee058e30d68e00c30f5 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -390,6 +390,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
public boolean freezeLocked = false; // Paper - Freeze Tick Lock API
|
||||
public boolean fixedPose = false; // Paper - Expand Pose API
|
||||
private final int despawnTime; // Paper - entity despawn time limit
|
||||
+ public @Nullable Boolean immuneToFire = null; // Purpur - Fire immune API
|
||||
|
||||
public void setOrigin(@javax.annotation.Nonnull Location location) {
|
||||
this.origin = location.toVector();
|
||||
@@ -1957,7 +1958,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
public boolean fireImmune() {
|
||||
- return this.getType().fireImmune();
|
||||
+ return this.immuneToFire != null ? immuneToFire : this.getType().fireImmune(); // Purpur - add fire immune API
|
||||
}
|
||||
|
||||
public boolean causeFallDamage(float fallDistance, float damageMultiplier, DamageSource damageSource) {
|
||||
@@ -2712,6 +2713,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
nbttagcompound.putBoolean("Paper.FreezeLock", true);
|
||||
}
|
||||
// Paper end
|
||||
+ // Purpur start
|
||||
+ if (immuneToFire != null) {
|
||||
+ nbttagcompound.putBoolean("Purpur.FireImmune", immuneToFire);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
return nbttagcompound;
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
|
||||
@@ -2860,6 +2866,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
freezeLocked = nbt.getBoolean("Paper.FreezeLock");
|
||||
}
|
||||
// Paper end
|
||||
+ // Purpur start
|
||||
+ if (nbt.contains("Purpur.FireImmune")) {
|
||||
+ immuneToFire = nbt.getBoolean("Purpur.FireImmune");
|
||||
+ }
|
||||
+ // Purpur end
|
||||
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT");
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index 02b07d43364c7dec37f1d2adffe123a5b595f669..51aee9a468f4ebfa9672fd9ce84883cf080859e3 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -88,6 +88,16 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
}
|
||||
|
||||
// Purpur start - API for any mob to burn daylight
|
||||
+ @Override
|
||||
+ public boolean isImmuneToFire() {
|
||||
+ return getHandle().fireImmune();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setImmuneToFire(Boolean fireImmune) {
|
||||
+ getHandle().immuneToFire = fireImmune;
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
public boolean isInDaylight() {
|
||||
return getHandle().isSunBurnTick();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
|
||||
index 01e4395f1669d21c30465aa1366bd2f1ae17678f..5c1cda88080850314dac196dbe71ff12e48a8aca 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
|
||||
@@ -173,9 +173,14 @@ public class CraftItem extends CraftEntity implements Item {
|
||||
return this.getHandle().immuneToExplosion;
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public void setImmuneToFire(@org.jetbrains.annotations.Nullable Boolean immuneToFire) {
|
||||
+ this.getHandle().immuneToFire = (immuneToFire != null && immuneToFire);
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
public void setImmuneToFire(boolean immuneToFire) {
|
||||
- item.immuneToFire = immuneToFire;
|
||||
+ this.setImmuneToFire((Boolean) immuneToFire);
|
||||
}
|
||||
|
||||
@Override
|
||||
Reference in New Issue
Block a user