mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: 1daafe455 Updated Upstream (Bukkit/CraftBukkit) 98828b006 Merge pull request #4132 from Proximyst/progress/1.16.2 b23f27f8d Fix incorrect return for WorldServer#addAllEntitiesSafely (#3) 5085fa30c Fix MC-187716 Use configured height c44add5a0 Initialise a new chunk section if none was found yet updated 74a4d5f8b Remove armour stand double add to world 6d25cc4ec Don't mark null chunk sections for block updates
67 lines
3.3 KiB
Diff
67 lines
3.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
Date: Sat, 22 Feb 2020 15:54:08 -0600
|
|
Subject: [PATCH] Add item entity options
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
|
index b3a28d1b8d..7b3ea5c741 100644
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
|
@@ -1450,6 +1450,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
|
|
|
}
|
|
|
|
+ public boolean isInLiquid(Tag<FluidType> tag) { return a(tag); } // Purpur - OBFHELPER
|
|
public boolean a(Tag<FluidType> tag) {
|
|
return this.O == tag;
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java
|
|
index e1372620fc..d22021cfb8 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityItem.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityItem.java
|
|
@@ -263,7 +263,7 @@ public class EntityItem extends Entity {
|
|
|
|
@Override
|
|
public boolean isFireProof() {
|
|
- return this.getItemStack().getItem().u() || super.isFireProof();
|
|
+ return this.getItemStack().getItem().u() || super.isFireProof() || world.purpurConfig.itemImmuneToFire.contains(getItemStack().getItem());
|
|
}
|
|
|
|
@Override
|
|
@@ -274,6 +274,8 @@ public class EntityItem extends Entity {
|
|
return false;
|
|
} else if (!this.getItemStack().getItem().a(damagesource)) {
|
|
return false;
|
|
+ } else if ((damagesource.isFire() || damagesource == DamageSource.FIRE) && world.purpurConfig.itemImmuneToFire.contains(getItemStack().getItem())) { return false; // Purpur
|
|
+ } else if (damagesource.isExplosion() && world.purpurConfig.itemImmuneToExplosion.contains(getItemStack().getItem())) { return false; // Purpur
|
|
} else {
|
|
// CraftBukkit start
|
|
if (org.bukkit.craftbukkit.event.CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, f)) {
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index d1b0d40307..9de7246862 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -99,6 +99,21 @@ public class PurpurWorldConfig {
|
|
}
|
|
}
|
|
|
|
+ public List<Item> itemImmuneToExplosion = new ArrayList<>();
|
|
+ public List<Item> itemImmuneToFire = new ArrayList<>();
|
|
+ private void itemSettings() {
|
|
+ itemImmuneToExplosion.clear();
|
|
+ getList("gameplay-mechanics.item.immune.explosion", new ArrayList<>()).forEach(key -> {
|
|
+ Item item = IRegistry.ITEM.get(new MinecraftKey(key.toString()));
|
|
+ if (item != Items.AIR) itemImmuneToExplosion.add(item);
|
|
+ });
|
|
+ itemImmuneToFire.clear();
|
|
+ getList("gameplay-mechanics.item.immune.fire", new ArrayList<>()).forEach(key -> {
|
|
+ Item item = IRegistry.ITEM.get(new MinecraftKey(key.toString()));
|
|
+ if (item != Items.AIR) itemImmuneToFire.add(item);
|
|
+ });
|
|
+ }
|
|
+
|
|
public boolean idleTimeoutKick = true;
|
|
public boolean idleTimeoutTickNearbyEntities = true;
|
|
public boolean idleTimeoutCountAsSleeping = false;
|