PaperPR - Projectile load/save limit per chunk

- Dropped "Add option to disable saving projectiles to disk" in favor of the above patch
 - Config migration is automatic. If "gameplay-mechanics.save-projectiles-to-disk" was set to false in purpur.yml, "projectile-load-save-per-chunk-limit" will be set to 0 in paper.yml (resulting in unchanged behaviour)
This commit is contained in:
jmp
2020-11-30 19:38:23 -08:00
parent 61d72c768d
commit 7174d63c4e
83 changed files with 522 additions and 436 deletions

View File

@@ -1,61 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Sun, 25 Aug 2019 00:09:52 -0500
Subject: [PATCH] Dispenser curse of binding protection
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index 84ac5112a..202ccf2a7 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -992,6 +992,13 @@ public abstract class EntityInsentient extends EntityLiving {
}
+ // Purpur start
+ public static EnumItemSlot getSlotForDispenser(ItemStack itemstack) {
+ return EnchantmentManager.getEnchantmentLevel(Enchantments.BINDING_CURSE, itemstack) > 0 ? EnumItemSlot.MAINHAND : getSlotForItemStack(itemstack);
+ }
+ // Purpur end
+
+ public static EnumItemSlot getSlotForItemStack(ItemStack itemstack) { return j(itemstack); } // Purpur - OBFHELPER
public static EnumItemSlot j(ItemStack itemstack) {
Item item = itemstack.getItem();
diff --git a/src/main/java/net/minecraft/server/ItemArmor.java b/src/main/java/net/minecraft/server/ItemArmor.java
index 669a50411..7cd2e871b 100644
--- a/src/main/java/net/minecraft/server/ItemArmor.java
+++ b/src/main/java/net/minecraft/server/ItemArmor.java
@@ -35,7 +35,7 @@ public class ItemArmor extends Item implements ItemWearable {
return false;
} else {
EntityLiving entityliving = (EntityLiving) list.get(0);
- EnumItemSlot enumitemslot = EntityInsentient.j(itemstack);
+ EnumItemSlot enumitemslot = isourceblock.getWorld().purpurConfig.dispenserApplyCursedArmor ? EntityInsentient.getSlotForItemStack(itemstack) : EntityInsentient.getSlotForDispenser(itemstack); // Purpur
ItemStack itemstack1 = itemstack.cloneAndSubtract(1);
// CraftBukkit start
World world = isourceblock.getWorld();
@@ -94,6 +94,7 @@ public class ItemArmor extends Item implements ItemWearable {
this.m = builder.build();
}
+ public EnumItemSlot getEquipmentSlot() { return b(); } // Purpur - OBFHELPER
public EnumItemSlot b() {
return this.b;
}
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 286a2a986..cc78145ae 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -164,6 +164,11 @@ public class PurpurWorldConfig {
});
}
+ public boolean dispenserApplyCursedArmor = true;
+ private void dispenserSettings() {
+ dispenserApplyCursedArmor = getBoolean("blocks.dispenser.apply-cursed-to-armor-slots", dispenserApplyCursedArmor);
+ }
+
public boolean farmlandGetsMoistFromBelow = false;
private void farmlandSettings() {
farmlandGetsMoistFromBelow = getBoolean("blocks.farmland.gets-moist-from-below", farmlandGetsMoistFromBelow);