Add new permissions and register some existing ones (#1157)

This commit is contained in:
Rhythmic (Illo)
2022-10-14 20:01:55 -07:00
committed by GitHub
parent d2e8d33295
commit b63fc3b872
4 changed files with 29 additions and 15 deletions

View File

@@ -5,16 +5,15 @@ Subject: [PATCH] Totems work in inventory
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 500b702e2d2b6ba4df07d1fb3e85d632feece76c..7d76ccd2a73209565735a2b2efafe7fd60089e52 100644
index 500b702e2d2b6ba4df07d1fb3e85d632feece76c..4eb8920a94304dd12ea94850deda96ff841e024a 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1546,6 +1546,19 @@ public abstract class LivingEntity extends Entity {
@@ -1546,6 +1546,18 @@ public abstract class LivingEntity extends Entity {
}
}
+ // Purpur start
+ if (level.purpurConfig.totemOfUndyingWorksInInventory && this instanceof ServerPlayer && (itemstack == null || itemstack.getItem() != Items.TOTEM_OF_UNDYING)) {
+ ServerPlayer player = (ServerPlayer) this;
+ if (level.purpurConfig.totemOfUndyingWorksInInventory && this instanceof ServerPlayer player && (itemstack == null || itemstack.getItem() != Items.TOTEM_OF_UNDYING) && player.getBukkitEntity().hasPermission("purpur.inventory_totem")) {
+ for (ItemStack item : player.getInventory().items) {
+ if (item.getItem() == Items.TOTEM_OF_UNDYING) {
+ itemstack1 = item;