Files
Purpur/patches/server/0074-Add-option-to-disable-saving-projectiles-to-disk.patch
BillyGalbreath b8fb7ff5b5 Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly

Paper Changes:
821ce25d9 Significantly improve performance of the end generation
2b2e4fd65 Add Wandering Trader spawn rate config options
7263cbca7 [CI-SKIP] [Auto] Rebuild Patches
1c63aff6d Villager resetOffers API
8d8d74a5f Patch 2 references an invalid variable
e6d7bdca1 [CI-SKIP] fixed sed -i for bsd sed (#4782)
7ae47d4eb [CI-SKIP] Remove Waving banner fix (#4786)
2020-11-19 21:31:10 -06:00

90 lines
4.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Tue, 18 Feb 2020 20:07:08 -0600
Subject: [PATCH] Add option to disable saving projectiles to disk
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index 83761ddf0..2cd99e64c 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -532,6 +532,7 @@ public class ChunkRegionLoader {
while (iterator1.hasNext()) {
Entity entity = (Entity) iterator1.next();
+ if (!entity.canSaveToDisk()) continue; // Purpur
NBTTagCompound nbttagcompound4 = new NBTTagCompound();
// Paper start
if (asyncsavedata == null && !entity.dead && (int) Math.floor(entity.locX()) >> 4 != chunk.getPos().x || (int) Math.floor(entity.locZ()) >> 4 != chunk.getPos().z) {
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 01f4be387..f036ffc8a 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -308,6 +308,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
this.headHeight = this.getHeadHeight(EntityPose.STANDING, this.size);
}
+ // Purpur start
+ public boolean canSaveToDisk() {
+ return true;
+ }
+ // Purpur end
+
public boolean isSpectator() {
return false;
}
diff --git a/src/main/java/net/minecraft/server/EntityEnderSignal.java b/src/main/java/net/minecraft/server/EntityEnderSignal.java
index 132fa358b..18fdb9f8d 100644
--- a/src/main/java/net/minecraft/server/EntityEnderSignal.java
+++ b/src/main/java/net/minecraft/server/EntityEnderSignal.java
@@ -19,6 +19,13 @@ public class EntityEnderSignal extends Entity {
this.setPosition(d0, d1, d2);
}
+ // Purpur start
+ @Override
+ public boolean canSaveToDisk() {
+ return world != null && world.purpurConfig.saveProjectilesToDisk;
+ }
+ // Purpur end
+
public void setItem(ItemStack itemstack) {
if (true || itemstack.getItem() != Items.ENDER_EYE || itemstack.hasTag()) { // CraftBukkit - always allow item changing
this.getDataWatcher().set(EntityEnderSignal.b, SystemUtils.a(itemstack.cloneItemStack(), (itemstack1) -> { // CraftBukkit - decompile error
diff --git a/src/main/java/net/minecraft/server/IProjectile.java b/src/main/java/net/minecraft/server/IProjectile.java
index 9f5ce64a6..0bac6b050 100644
--- a/src/main/java/net/minecraft/server/IProjectile.java
+++ b/src/main/java/net/minecraft/server/IProjectile.java
@@ -18,6 +18,13 @@ public abstract class IProjectile extends Entity {
super(entitytypes, world);
}
+ // Purpur start
+ @Override
+ public boolean canSaveToDisk() {
+ return world != null && world.purpurConfig.saveProjectilesToDisk;
+ }
+ // Purpur end
+
public void setShooter(@Nullable Entity entity) {
if (entity != null) {
this.shooter = entity.getUniqueID();
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index adcd1779c..b5ae7c047 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -115,11 +115,13 @@ public class PurpurWorldConfig {
public boolean disableDropsOnCrammingDeath = false;
public boolean entitiesPickUpLootBypassMobGriefing = false;
public boolean milkCuresBadOmen = true;
+ public boolean saveProjectilesToDisk = true;
public double tridentLoyaltyVoidReturnHeight = 0.0D;
private void miscGameplayMechanicsSettings() {
disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
entitiesPickUpLootBypassMobGriefing = getBoolean("gameplay-mechanics.entities-pick-up-loot-bypass-mob-griefing", entitiesPickUpLootBypassMobGriefing);
milkCuresBadOmen = getBoolean("gameplay-mechanics.milk-cures-bad-omen", milkCuresBadOmen);
+ saveProjectilesToDisk = getBoolean("gameplay-mechanics.save-projectiles-to-disk", saveProjectilesToDisk);
tridentLoyaltyVoidReturnHeight = getDouble("gameplay-mechanics.trident-loyalty-void-return-height", tridentLoyaltyVoidReturnHeight);
}