mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 18:37:42 +01:00
Rebuild patches
This commit is contained in:
46
patches/server/0109-Totems-work-in-inventory.patch
Normal file
46
patches/server/0109-Totems-work-in-inventory.patch
Normal file
@@ -0,0 +1,46 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: draycia <lonelyyordle@gmail.com>
|
||||
Date: Wed, 29 Apr 2020 00:45:58 -0700
|
||||
Subject: [PATCH] Totems work in inventory
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 61a74e296..a90d3fa3e 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -1324,6 +1324,19 @@ public abstract class EntityLiving extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ if (world.purpurConfig.totemOfUndyingWorksInInventory && this instanceof EntityPlayer && (itemstack == null || itemstack.getItem() != Items.TOTEM_OF_UNDYING)) {
|
||||
+ EntityPlayer player = (EntityPlayer) this;
|
||||
+ for (ItemStack item : player.inventory.items) {
|
||||
+ if (item.getItem() == Items.TOTEM_OF_UNDYING) {
|
||||
+ itemstack1 = item;
|
||||
+ itemstack = item.cloneItemStack();
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
EntityResurrectEvent event = new EntityResurrectEvent((LivingEntity) this.getBukkitEntity());
|
||||
event.setCancelled(itemstack == null);
|
||||
this.world.getServer().getPluginManager().callEvent(event);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 85d6d3fc3..b2874758a 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -185,6 +185,11 @@ public class PurpurWorldConfig {
|
||||
teleportIfOutsideBorder = getBoolean("gameplay-mechanics.player.teleport-if-outside-border", teleportIfOutsideBorder);
|
||||
}
|
||||
|
||||
+ public boolean totemOfUndyingWorksInInventory = false;
|
||||
+ private void totemOfUndyingWorksInInventory() {
|
||||
+ totemOfUndyingWorksInInventory = getBoolean("gameplay-mechanics.player.totem-of-undying-works-in-inventory", totemOfUndyingWorksInInventory);
|
||||
+ }
|
||||
+
|
||||
public boolean silkTouchEnabled = false;
|
||||
public List<Item> silkTouchTools = new ArrayList<>();
|
||||
private void silkTouchSettings() {
|
||||
Reference in New Issue
Block a user