diff --git a/PATCHES.md b/PATCHES.md index 2a3f8a831..f42ada11c 100644 --- a/PATCHES.md +++ b/PATCHES.md @@ -101,6 +101,7 @@ This is an overview of all the patches that are currently used. | server | Avoid double I/O operation on load player file | ㄗㄠˋ ㄑㄧˊ | | | server | Barrels and enderchests 6 rows | William Blake Galbreath | | | server | Be aware of entity teleports when chunk checking entities | Spottedleaf | | +| server | Beacon Activation Range Configurable | DoctaEnkoda | | | server | Bee can work when raining or at night | DoctaEnkoda | | | server | Better checking for useless move packets | Paul Sauve | | | server | Brand changes | Spottedleaf | | @@ -120,6 +121,7 @@ This is an overview of all the patches that are currently used. | server | Charged creeper naturally spawn | William Blake Galbreath | | | api | ChatColor conveniences | William Blake Galbreath | | | server | Chickens can retaliate | William Blake Galbreath | | +| server | Config MobEffect by world | DoctaEnkoda | | | server | Config for Enderman to aggro spawned Endermites | Encode42 | | | server | Config for changing the blocks that turn into paths | 12emin34 | | | server | Config for health to impact Creeper explosion radius | Encode42 | | @@ -343,6 +345,7 @@ This is an overview of all the patches that are currently used. | server | Origami - Fix ProtocolLib issues on Java 15 | Phoenix616 | | | server | Origami Server Config | Phoenix616 | | | server | PaperPR - Config option for Piglins guarding chests | jmp | | +| server | Patch Paper to use fast item merge raytracing | Paul Sauve | | | server | Per World Spawn Limits | Chase Whipple | | | server | Per entity (type) collision settings | MrIvanPlays | tr7zw | | api | Per player viewdistances | Spottedleaf | | diff --git a/patches/Airplane/patches/server/0033-Improve-container-checking-with-a-bitset.patch b/patches/Airplane/patches/server/0033-Improve-container-checking-with-a-bitset.patch index cfba5bce6..19d3fc79d 100644 --- a/patches/Airplane/patches/server/0033-Improve-container-checking-with-a-bitset.patch +++ b/patches/Airplane/patches/server/0033-Improve-container-checking-with-a-bitset.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Improve container checking with a bitset diff --git a/src/main/java/gg/airplane/structs/ItemListWithBitset.java b/src/main/java/gg/airplane/structs/ItemListWithBitset.java new file mode 100644 -index 0000000000000000000000000000000000000000..bd3b58cb1a48da2f5259b0c64290b2be2ff1fdf7 +index 0000000000000000000000000000000000000000..7103aa120d3a27d5579d54bd6f4018dc20cca95c --- /dev/null +++ b/src/main/java/gg/airplane/structs/ItemListWithBitset.java @@ -0,0 +1,105 @@ @@ -35,8 +35,8 @@ index 0000000000000000000000000000000000000000..bd3b58cb1a48da2f5259b0c64290b2be + + private final ItemStack[] items; + -+ private int bitSet = 0; -+ private final int allBits; ++ private long bitSet = 0; ++ private final long allBits; + + private ItemListWithBitset(NonNullList list) { + this(list.size()); @@ -49,10 +49,10 @@ index 0000000000000000000000000000000000000000..bd3b58cb1a48da2f5259b0c64290b2be + public ItemListWithBitset(int size) { + super(null, ItemStack.NULL_ITEM); + -+ Validate.isTrue(size < Integer.BYTES * 8, "size is too large"); ++ Validate.isTrue(size < Long.BYTES * 8, "size is too large"); + + this.items = createArray(size); -+ this.allBits = ((1 << size) - 1); ++ this.allBits = ((1L << size) - 1); + } + + public boolean isCompletelyEmpty() { @@ -70,9 +70,9 @@ index 0000000000000000000000000000000000000000..bd3b58cb1a48da2f5259b0c64290b2be + this.items[index] = itemStack; + + if (itemStack == ItemStack.NULL_ITEM) { -+ this.bitSet &= ~(1 << index); ++ this.bitSet &= ~(1L << index); + } else { -+ this.bitSet |= 1 << index; ++ this.bitSet |= 1L << index; + } + + return existing; diff --git a/patches/Airplane/patches/server/0036-Patch-Paper-to-use-fast-item-merge-raytracing.patch b/patches/Airplane/patches/server/0036-Patch-Paper-to-use-fast-item-merge-raytracing.patch new file mode 100644 index 000000000..5735e7a2a --- /dev/null +++ b/patches/Airplane/patches/server/0036-Patch-Paper-to-use-fast-item-merge-raytracing.patch @@ -0,0 +1,27 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Paul Sauve +Date: Tue, 1 Jun 2021 18:06:29 -0500 +Subject: [PATCH] Patch Paper to use fast item merge raytracing + + +diff --git a/src/main/java/net/minecraft/world/entity/item/EntityItem.java b/src/main/java/net/minecraft/world/entity/item/EntityItem.java +index 077990f1d95ded2c8b89c38978ec25a56df3a984..e1581f0616748da885f457c7fa0f1515490c53f4 100644 +--- a/src/main/java/net/minecraft/world/entity/item/EntityItem.java ++++ b/src/main/java/net/minecraft/world/entity/item/EntityItem.java +@@ -230,10 +230,16 @@ public class EntityItem extends Entity { + if (entityitem.z()) { + // Paper Start - Fix items merging through walls + if (this.world.paperConfig.fixItemsMergingThroughWalls) { ++ // Airplane start - fast merging! ++ /* + net.minecraft.world.level.RayTrace rayTrace = new net.minecraft.world.level.RayTrace(this.getPositionVector(), entityitem.getPositionVector(), + net.minecraft.world.level.RayTrace.BlockCollisionOption.COLLIDER, net.minecraft.world.level.RayTrace.FluidCollisionOption.NONE, this); + net.minecraft.world.phys.MovingObjectPositionBlock rayTraceResult = world.rayTrace(rayTrace); + if (rayTraceResult.getType() == net.minecraft.world.phys.MovingObjectPosition.EnumMovingObjectType.BLOCK) continue; ++ */ ++ if (world.rayTraceDirect(this.getPositionVector(), entityitem.getPositionVector(), net.minecraft.world.phys.shapes.VoxelShapeCollision.a(this)) == ++ net.minecraft.world.phys.MovingObjectPosition.EnumMovingObjectType.BLOCK) continue; ++ // Airplane end + } + // Paper End + this.a(entityitem); diff --git a/patches/Purpur/patches/server/0074-Item-entity-immunities.patch b/patches/Purpur/patches/server/0074-Item-entity-immunities.patch index cd6ca6049..683486345 100644 --- a/patches/Purpur/patches/server/0074-Item-entity-immunities.patch +++ b/patches/Purpur/patches/server/0074-Item-entity-immunities.patch @@ -43,7 +43,7 @@ index e412175edae9aa7b5f4e7e2b550d29a647f4c7f9..5d43cc1cb42e14db50407ba62d89df32 return this.O == tag; } diff --git a/src/main/java/net/minecraft/world/entity/item/EntityItem.java b/src/main/java/net/minecraft/world/entity/item/EntityItem.java -index 077990f1d95ded2c8b89c38978ec25a56df3a984..be46b8fcbfed932ba96a34c94eee0b237c783bd4 100644 +index e1581f0616748da885f457c7fa0f1515490c53f4..bb3ea44a641cc830416e9e000357199150135047 100644 --- a/src/main/java/net/minecraft/world/entity/item/EntityItem.java +++ b/src/main/java/net/minecraft/world/entity/item/EntityItem.java @@ -50,6 +50,12 @@ public class EntityItem extends Entity { @@ -59,7 +59,7 @@ index 077990f1d95ded2c8b89c38978ec25a56df3a984..be46b8fcbfed932ba96a34c94eee0b23 public EntityItem(EntityTypes entitytypes, World world) { super(entitytypes, world); -@@ -309,6 +315,16 @@ public class EntityItem extends Entity { +@@ -315,6 +321,16 @@ public class EntityItem extends Entity { return false; } else if (!this.getItemStack().getItem().a(damagesource)) { return false; @@ -76,7 +76,7 @@ index 077990f1d95ded2c8b89c38978ec25a56df3a984..be46b8fcbfed932ba96a34c94eee0b23 } else { // CraftBukkit start if (org.bukkit.craftbukkit.event.CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, f)) { -@@ -489,6 +505,12 @@ public class EntityItem extends Entity { +@@ -495,6 +511,12 @@ public class EntityItem extends Entity { com.google.common.base.Preconditions.checkArgument(!itemstack.isEmpty(), "Cannot drop air"); // CraftBukkit this.getDataWatcher().set(EntityItem.ITEM, itemstack); this.getDataWatcher().markDirty(EntityItem.ITEM); // CraftBukkit - SPIGOT-4591, must mark dirty @@ -89,7 +89,7 @@ index 077990f1d95ded2c8b89c38978ec25a56df3a984..be46b8fcbfed932ba96a34c94eee0b23 } @Override -@@ -570,4 +592,15 @@ public class EntityItem extends Entity { +@@ -576,4 +598,15 @@ public class EntityItem extends Entity { super.setPositionRaw(x, y, z); } // Paper end - fix MC-4 diff --git a/patches/Purpur/patches/server/0155-Add-MC-4-fix-back.patch b/patches/Purpur/patches/server/0155-Add-MC-4-fix-back.patch index 1c54d4616..8841b3aa8 100644 --- a/patches/Purpur/patches/server/0155-Add-MC-4-fix-back.patch +++ b/patches/Purpur/patches/server/0155-Add-MC-4-fix-back.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add MC-4 fix back diff --git a/src/main/java/net/minecraft/world/entity/item/EntityItem.java b/src/main/java/net/minecraft/world/entity/item/EntityItem.java -index be46b8fcbfed932ba96a34c94eee0b237c783bd4..dd4997e7ffac4773e01add88efec7c0dcd7b4df0 100644 +index bb3ea44a641cc830416e9e000357199150135047..d05d874d54fdf821429814b7b20a3676d426303c 100644 --- a/src/main/java/net/minecraft/world/entity/item/EntityItem.java +++ b/src/main/java/net/minecraft/world/entity/item/EntityItem.java -@@ -583,7 +583,7 @@ public class EntityItem extends Entity { +@@ -589,7 +589,7 @@ public class EntityItem extends Entity { // Paper start - fix MC-4 public void setPositionRaw(double x, double y, double z) { diff --git a/patches/Purpur/patches/server/0219-Config-MobEffect-by-world.patch b/patches/Purpur/patches/server/0219-Config-MobEffect-by-world.patch new file mode 100644 index 000000000..b9fd0ce53 --- /dev/null +++ b/patches/Purpur/patches/server/0219-Config-MobEffect-by-world.patch @@ -0,0 +1,65 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: DoctaEnkoda +Date: Mon, 31 May 2021 11:06:54 +0200 +Subject: [PATCH] Config MobEffect by world + + +diff --git a/src/main/java/net/minecraft/world/effect/MobEffectList.java b/src/main/java/net/minecraft/world/effect/MobEffectList.java +index 6dbd54c44ac88025464f78e72069c538d9f43dc3..f0348960e17056ea9dad0f08fe010a7c69123094 100644 +--- a/src/main/java/net/minecraft/world/effect/MobEffectList.java ++++ b/src/main/java/net/minecraft/world/effect/MobEffectList.java +@@ -51,16 +51,16 @@ public class MobEffectList { + public void tick(EntityLiving entityliving, int i) { + if (this == MobEffects.REGENERATION) { + if (entityliving.getHealth() < entityliving.getMaxHealth()) { +- entityliving.heal(1.0F, RegainReason.MAGIC_REGEN); // CraftBukkit ++ entityliving.heal(entityliving.getWorld().purpurConfig.entityHealthRegenAmount, RegainReason.MAGIC_REGEN); // CraftBukkit // Purpur + } + } else if (this == MobEffects.POISON) { +- if (entityliving.getHealth() > 1.0F) { +- entityliving.damageEntity(CraftEventFactory.POISON, 1.0F); // CraftBukkit - DamageSource.MAGIC -> CraftEventFactory.POISON ++ if (entityliving.getHealth() > entityliving.getWorld().purpurConfig.entityMinimalHealthPoison) { // Purpur ++ entityliving.damageEntity(CraftEventFactory.POISON, entityliving.getWorld().purpurConfig.entityPoisonDegenerationAmount); // CraftBukkit - DamageSource.MAGIC -> CraftEventFactory.POISON // Purpur + } + } else if (this == MobEffects.WITHER) { +- entityliving.damageEntity(DamageSource.WITHER, 1.0F); ++ entityliving.damageEntity(DamageSource.WITHER, entityliving.getWorld().purpurConfig.entityWitherDegenerationAmount); + } else if (this == MobEffects.HUNGER && entityliving instanceof EntityHuman) { +- ((EntityHuman) entityliving).applyExhaustion(0.005F * (float) (i + 1), org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason.HUNGER_EFFECT); // CraftBukkit - EntityExhaustionEvent ++ ((EntityHuman) entityliving).applyExhaustion(entityliving.getWorld().purpurConfig.humanHungerExhaustionAmount * (float) (i + 1), org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason.HUNGER_EFFECT); // CraftBukkit - EntityExhaustionEvent // Purpur + } else if (this == MobEffects.SATURATION && entityliving instanceof EntityHuman) { + if (!entityliving.world.isClientSide) { + // CraftBukkit start +@@ -70,7 +70,7 @@ public class MobEffectList { + org.bukkit.event.entity.FoodLevelChangeEvent event = CraftEventFactory.callFoodLevelChangeEvent(entityhuman, i + 1 + oldFoodLevel); + + if (!event.isCancelled()) { +- entityhuman.getFoodData().eat(event.getFoodLevel() - oldFoodLevel, 1.0F); ++ entityhuman.getFoodData().eat(event.getFoodLevel() - oldFoodLevel, entityliving.getWorld().purpurConfig.humanSaturationRegenAmount); // Purpur + } + + ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutUpdateHealth(((EntityPlayer) entityhuman).getBukkitEntity().getScaledHealth(), entityhuman.getFoodData().foodLevel, entityhuman.getFoodData().saturationLevel)); +diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +index bd72ed2da22c1d1121ea7ca04e163979baa05b27..f27c55d8d6dabe7d2cbaf6ab01e1a484e1d96f53 100644 +--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java ++++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +@@ -2189,4 +2189,19 @@ public class PurpurWorldConfig { + private void pistonSettings() { + pistonBlockPushLimit = getInt("blocks.piston.block-push-limit", pistonBlockPushLimit); + } ++ ++ public float entityHealthRegenAmount = 1.0F; ++ public float entityMinimalHealthPoison = 1.0F; ++ public float entityPoisonDegenerationAmount = 1.0F; ++ public float entityWitherDegenerationAmount = 1.0F; ++ public float humanHungerExhaustionAmount = 0.005F; ++ public float humanSaturationRegenAmount = 1.0F; ++ private void mobEffectSettings() { ++ entityHealthRegenAmount = (float) getDouble("gameplay-mechanics.mob-effects.health-regen-amount", entityHealthRegenAmount); ++ entityMinimalHealthPoison = (float) getDouble("gameplay-mechanics.mob-effects.minimal-health-poison-amount", entityMinimalHealthPoison); ++ entityPoisonDegenerationAmount = (float) getDouble("gameplay-mechanics.mob-effects.poison-degeneration-amount", entityPoisonDegenerationAmount); ++ entityWitherDegenerationAmount = (float) getDouble("gameplay-mechanics.mob-effects.wither-degeneration-amount", entityWitherDegenerationAmount); ++ humanHungerExhaustionAmount = (float) getDouble("gameplay-mechanics.mob-effects.hunger-exhaustion-amount", humanHungerExhaustionAmount); ++ humanSaturationRegenAmount = (float) getDouble("gameplay-mechanics.mob-effects.saturation-regen-amount", humanSaturationRegenAmount); ++ } + } diff --git a/patches/Purpur/patches/server/0220-Beacon-Activation-Range-Configurable.patch b/patches/Purpur/patches/server/0220-Beacon-Activation-Range-Configurable.patch new file mode 100644 index 000000000..2ab4a4a8b --- /dev/null +++ b/patches/Purpur/patches/server/0220-Beacon-Activation-Range-Configurable.patch @@ -0,0 +1,50 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: DoctaEnkoda +Date: Wed, 2 Jun 2021 02:45:47 +0200 +Subject: [PATCH] Beacon Activation Range Configurable + + +diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeacon.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeacon.java +index f7b210e6d60533d9faf60183a80a562b25f945d0..926e1344a8db4b18caebae77096c2600e0a4958f 100644 +--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeacon.java ++++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeacon.java +@@ -79,6 +79,16 @@ public class TileEntityBeacon extends TileEntity implements ITileInventory, ITic + + public double getEffectRange() { + if (this.effectRange < 0) { ++ // Purpur Start ++ if (this.world != null) { ++ switch (this.levels) { ++ case 1: return this.world.purpurConfig.beaconLevelOne; ++ case 2: return this.world.purpurConfig.beaconLevelTwo; ++ case 3: return this.world.purpurConfig.beaconLevelThree; ++ case 4: return this.world.purpurConfig.beaconLevelFour; ++ } ++ } ++ // Purpur End + return this.levels * 10 + 10; + } else { + return effectRange; +diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +index f27c55d8d6dabe7d2cbaf6ab01e1a484e1d96f53..e72bc4d81e528885dfb129b4718123afa5c16421 100644 +--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java ++++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +@@ -511,6 +511,18 @@ public class PurpurWorldConfig { + anvilAllowColors = getBoolean("blocks.anvil.allow-colors", anvilAllowColors); + } + ++ public int beaconLevelOne = 20; ++ public int beaconLevelTwo = 30; ++ public int beaconLevelThree = 40; ++ public int beaconLevelFour = 50; ++ private void beaconSettings() { ++ beaconLevelOne = getInt("blocks.beacon.effect-range.level-1", beaconLevelOne); ++ beaconLevelTwo = getInt("blocks.beacon.effect-range.level-2", beaconLevelTwo); ++ beaconLevelThree = getInt("blocks.beacon.effect-range.level-3", beaconLevelThree); ++ beaconLevelThree = getInt("blocks.beacon.effect-range.level-3", beaconLevelThree); ++ beaconLevelFour = getInt("blocks.beacon.effect-range.level-4", beaconLevelFour); ++ } ++ + public boolean bedExplode = true; + public double bedExplosionPower = 5.0D; + public boolean bedExplosionFire = true; diff --git a/patches/server/0014-Item-stuck-sleep-config.patch b/patches/server/0014-Item-stuck-sleep-config.patch index 473b8a0d4..dc1bb81ec 100644 --- a/patches/server/0014-Item-stuck-sleep-config.patch +++ b/patches/server/0014-Item-stuck-sleep-config.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Item stuck sleep config diff --git a/src/main/java/net/minecraft/world/entity/item/EntityItem.java b/src/main/java/net/minecraft/world/entity/item/EntityItem.java -index dd4997e7ffac4773e01add88efec7c0dcd7b4df0..2cdb72093c9668d7e5ff4d6d0a91ffbf5889470d 100644 +index d05d874d54fdf821429814b7b20a3676d426303c..a26f1e490d52e56935858798bfb645cea9f034e4 100644 --- a/src/main/java/net/minecraft/world/entity/item/EntityItem.java +++ b/src/main/java/net/minecraft/world/entity/item/EntityItem.java @@ -115,7 +115,7 @@ public class EntityItem extends Entity { diff --git a/upstream/Airplane b/upstream/Airplane index 3e07ea8cf..8c5012517 160000 --- a/upstream/Airplane +++ b/upstream/Airplane @@ -1 +1 @@ -Subproject commit 3e07ea8cf6f3739eac4710f914222f952fbce43b +Subproject commit 8c5012517e30804bf6376f56625c2ef569c8a15a diff --git a/upstream/Purpur b/upstream/Purpur index d2204a3da..5824eb8f2 160000 --- a/upstream/Purpur +++ b/upstream/Purpur @@ -1 +1 @@ -Subproject commit d2204a3daca80a3a3da068215e3fa530bb0620b9 +Subproject commit 5824eb8f2c2d243c19732c22943e71d707a50d21 diff --git a/upstreamCommits/Airplane b/upstreamCommits/Airplane index 32815018e..bc7116010 100644 --- a/upstreamCommits/Airplane +++ b/upstreamCommits/Airplane @@ -1 +1 @@ -3e07ea8cf6f3739eac4710f914222f952fbce43b \ No newline at end of file +8c5012517e30804bf6376f56625c2ef569c8a15a \ No newline at end of file diff --git a/upstreamCommits/Purpur b/upstreamCommits/Purpur index d936002b9..777e88c70 100644 --- a/upstreamCommits/Purpur +++ b/upstreamCommits/Purpur @@ -1 +1 @@ -d2204a3daca80a3a3da068215e3fa530bb0620b9 \ No newline at end of file +5824eb8f2c2d243c19732c22943e71d707a50d21 \ No newline at end of file