Skip to content
This repository was archived by the owner on Jun 19, 2021. It is now read-only.

Commit 8a33bae

Browse files
author
Simon Gardling
committed
Updated Upstream and Sidestream(s) (Airplane/Purpur)
Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Airplane Changes: 8c50125 Switch bitset to long storage 617dfe2 Patch Paper to use fast item merge raytracing 16104e8 Updated Upstream (Tuinity) Purpur Changes: 5824eb8f Beacon Activation Range Configurable (#372) baa20a6b Config MobEffect by world (#369) ff09f9e6 Updated Upstream (Tuinity & Airplane)
1 parent daedcdd commit 8a33bae

12 files changed

+163
-18
lines changed

PATCHES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ This is an overview of all the patches that are currently used.
101101
| server | Avoid double I/O operation on load player file | ㄗㄠˋ ㄑㄧˊ | |
102102
| server | Barrels and enderchests 6 rows | William Blake Galbreath | |
103103
| server | Be aware of entity teleports when chunk checking entities | Spottedleaf | |
104+
| server | Beacon Activation Range Configurable | DoctaEnkoda | |
104105
| server | Bee can work when raining or at night | DoctaEnkoda | |
105106
| server | Better checking for useless move packets | Paul Sauve | |
106107
| server | Brand changes | Spottedleaf | |
@@ -120,6 +121,7 @@ This is an overview of all the patches that are currently used.
120121
| server | Charged creeper naturally spawn | William Blake Galbreath | |
121122
| api | ChatColor conveniences | William Blake Galbreath | |
122123
| server | Chickens can retaliate | William Blake Galbreath | |
124+
| server | Config MobEffect by world | DoctaEnkoda | |
123125
| server | Config for Enderman to aggro spawned Endermites | Encode42 | |
124126
| server | Config for changing the blocks that turn into paths | 12emin34 | |
125127
| 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.
343345
| server | Origami - Fix ProtocolLib issues on Java 15 | Phoenix616 | |
344346
| server | Origami Server Config | Phoenix616 | |
345347
| server | PaperPR - Config option for Piglins guarding chests | jmp | |
348+
| server | Patch Paper to use fast item merge raytracing | Paul Sauve | |
346349
| server | Per World Spawn Limits | Chase Whipple | |
347350
| server | Per entity (type) collision settings | MrIvanPlays | tr7zw |
348351
| api | Per player viewdistances | Spottedleaf | |

patches/Airplane/patches/server/0033-Improve-container-checking-with-a-bitset.patch

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Subject: [PATCH] Improve container checking with a bitset
66

77
diff --git a/src/main/java/gg/airplane/structs/ItemListWithBitset.java b/src/main/java/gg/airplane/structs/ItemListWithBitset.java
88
new file mode 100644
9-
index 0000000000000000000000000000000000000000..bd3b58cb1a48da2f5259b0c64290b2be2ff1fdf7
9+
index 0000000000000000000000000000000000000000..7103aa120d3a27d5579d54bd6f4018dc20cca95c
1010
--- /dev/null
1111
+++ b/src/main/java/gg/airplane/structs/ItemListWithBitset.java
1212
@@ -0,0 +1,105 @@
@@ -35,8 +35,8 @@ index 0000000000000000000000000000000000000000..bd3b58cb1a48da2f5259b0c64290b2be
3535
+
3636
+ private final ItemStack[] items;
3737
+
38-
+ private int bitSet = 0;
39-
+ private final int allBits;
38+
+ private long bitSet = 0;
39+
+ private final long allBits;
4040
+
4141
+ private ItemListWithBitset(NonNullList<ItemStack> list) {
4242
+ this(list.size());
@@ -49,10 +49,10 @@ index 0000000000000000000000000000000000000000..bd3b58cb1a48da2f5259b0c64290b2be
4949
+ public ItemListWithBitset(int size) {
5050
+ super(null, ItemStack.NULL_ITEM);
5151
+
52-
+ Validate.isTrue(size < Integer.BYTES * 8, "size is too large");
52+
+ Validate.isTrue(size < Long.BYTES * 8, "size is too large");
5353
+
5454
+ this.items = createArray(size);
55-
+ this.allBits = ((1 << size) - 1);
55+
+ this.allBits = ((1L << size) - 1);
5656
+ }
5757
+
5858
+ public boolean isCompletelyEmpty() {
@@ -70,9 +70,9 @@ index 0000000000000000000000000000000000000000..bd3b58cb1a48da2f5259b0c64290b2be
7070
+ this.items[index] = itemStack;
7171
+
7272
+ if (itemStack == ItemStack.NULL_ITEM) {
73-
+ this.bitSet &= ~(1 << index);
73+
+ this.bitSet &= ~(1L << index);
7474
+ } else {
75-
+ this.bitSet |= 1 << index;
75+
+ this.bitSet |= 1L << index;
7676
+ }
7777
+
7878
+ return existing;
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Paul Sauve <[email protected]>
3+
Date: Tue, 1 Jun 2021 18:06:29 -0500
4+
Subject: [PATCH] Patch Paper to use fast item merge raytracing
5+
6+
7+
diff --git a/src/main/java/net/minecraft/world/entity/item/EntityItem.java b/src/main/java/net/minecraft/world/entity/item/EntityItem.java
8+
index 077990f1d95ded2c8b89c38978ec25a56df3a984..e1581f0616748da885f457c7fa0f1515490c53f4 100644
9+
--- a/src/main/java/net/minecraft/world/entity/item/EntityItem.java
10+
+++ b/src/main/java/net/minecraft/world/entity/item/EntityItem.java
11+
@@ -230,10 +230,16 @@ public class EntityItem extends Entity {
12+
if (entityitem.z()) {
13+
// Paper Start - Fix items merging through walls
14+
if (this.world.paperConfig.fixItemsMergingThroughWalls) {
15+
+ // Airplane start - fast merging!
16+
+ /*
17+
net.minecraft.world.level.RayTrace rayTrace = new net.minecraft.world.level.RayTrace(this.getPositionVector(), entityitem.getPositionVector(),
18+
net.minecraft.world.level.RayTrace.BlockCollisionOption.COLLIDER, net.minecraft.world.level.RayTrace.FluidCollisionOption.NONE, this);
19+
net.minecraft.world.phys.MovingObjectPositionBlock rayTraceResult = world.rayTrace(rayTrace);
20+
if (rayTraceResult.getType() == net.minecraft.world.phys.MovingObjectPosition.EnumMovingObjectType.BLOCK) continue;
21+
+ */
22+
+ if (world.rayTraceDirect(this.getPositionVector(), entityitem.getPositionVector(), net.minecraft.world.phys.shapes.VoxelShapeCollision.a(this)) ==
23+
+ net.minecraft.world.phys.MovingObjectPosition.EnumMovingObjectType.BLOCK) continue;
24+
+ // Airplane end
25+
}
26+
// Paper End
27+
this.a(entityitem);

patches/Purpur/patches/server/0074-Item-entity-immunities.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ index e412175edae9aa7b5f4e7e2b550d29a647f4c7f9..5d43cc1cb42e14db50407ba62d89df32
4343
return this.O == tag;
4444
}
4545
diff --git a/src/main/java/net/minecraft/world/entity/item/EntityItem.java b/src/main/java/net/minecraft/world/entity/item/EntityItem.java
46-
index 077990f1d95ded2c8b89c38978ec25a56df3a984..be46b8fcbfed932ba96a34c94eee0b237c783bd4 100644
46+
index e1581f0616748da885f457c7fa0f1515490c53f4..bb3ea44a641cc830416e9e000357199150135047 100644
4747
--- a/src/main/java/net/minecraft/world/entity/item/EntityItem.java
4848
+++ b/src/main/java/net/minecraft/world/entity/item/EntityItem.java
4949
@@ -50,6 +50,12 @@ public class EntityItem extends Entity {
@@ -59,7 +59,7 @@ index 077990f1d95ded2c8b89c38978ec25a56df3a984..be46b8fcbfed932ba96a34c94eee0b23
5959

6060
public EntityItem(EntityTypes<? extends EntityItem> entitytypes, World world) {
6161
super(entitytypes, world);
62-
@@ -309,6 +315,16 @@ public class EntityItem extends Entity {
62+
@@ -315,6 +321,16 @@ public class EntityItem extends Entity {
6363
return false;
6464
} else if (!this.getItemStack().getItem().a(damagesource)) {
6565
return false;
@@ -76,7 +76,7 @@ index 077990f1d95ded2c8b89c38978ec25a56df3a984..be46b8fcbfed932ba96a34c94eee0b23
7676
} else {
7777
// CraftBukkit start
7878
if (org.bukkit.craftbukkit.event.CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, f)) {
79-
@@ -489,6 +505,12 @@ public class EntityItem extends Entity {
79+
@@ -495,6 +511,12 @@ public class EntityItem extends Entity {
8080
com.google.common.base.Preconditions.checkArgument(!itemstack.isEmpty(), "Cannot drop air"); // CraftBukkit
8181
this.getDataWatcher().set(EntityItem.ITEM, itemstack);
8282
this.getDataWatcher().markDirty(EntityItem.ITEM); // CraftBukkit - SPIGOT-4591, must mark dirty
@@ -89,7 +89,7 @@ index 077990f1d95ded2c8b89c38978ec25a56df3a984..be46b8fcbfed932ba96a34c94eee0b23
8989
}
9090

9191
@Override
92-
@@ -570,4 +592,15 @@ public class EntityItem extends Entity {
92+
@@ -576,4 +598,15 @@ public class EntityItem extends Entity {
9393
super.setPositionRaw(x, y, z);
9494
}
9595
// Paper end - fix MC-4

patches/Purpur/patches/server/0155-Add-MC-4-fix-back.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ Subject: [PATCH] Add MC-4 fix back
55

66

77
diff --git a/src/main/java/net/minecraft/world/entity/item/EntityItem.java b/src/main/java/net/minecraft/world/entity/item/EntityItem.java
8-
index be46b8fcbfed932ba96a34c94eee0b237c783bd4..dd4997e7ffac4773e01add88efec7c0dcd7b4df0 100644
8+
index bb3ea44a641cc830416e9e000357199150135047..d05d874d54fdf821429814b7b20a3676d426303c 100644
99
--- a/src/main/java/net/minecraft/world/entity/item/EntityItem.java
1010
+++ b/src/main/java/net/minecraft/world/entity/item/EntityItem.java
11-
@@ -583,7 +583,7 @@ public class EntityItem extends Entity {
11+
@@ -589,7 +589,7 @@ public class EntityItem extends Entity {
1212

1313
// Paper start - fix MC-4
1414
public void setPositionRaw(double x, double y, double z) {
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: DoctaEnkoda <[email protected]>
3+
Date: Mon, 31 May 2021 11:06:54 +0200
4+
Subject: [PATCH] Config MobEffect by world
5+
6+
7+
diff --git a/src/main/java/net/minecraft/world/effect/MobEffectList.java b/src/main/java/net/minecraft/world/effect/MobEffectList.java
8+
index 6dbd54c44ac88025464f78e72069c538d9f43dc3..f0348960e17056ea9dad0f08fe010a7c69123094 100644
9+
--- a/src/main/java/net/minecraft/world/effect/MobEffectList.java
10+
+++ b/src/main/java/net/minecraft/world/effect/MobEffectList.java
11+
@@ -51,16 +51,16 @@ public class MobEffectList {
12+
public void tick(EntityLiving entityliving, int i) {
13+
if (this == MobEffects.REGENERATION) {
14+
if (entityliving.getHealth() < entityliving.getMaxHealth()) {
15+
- entityliving.heal(1.0F, RegainReason.MAGIC_REGEN); // CraftBukkit
16+
+ entityliving.heal(entityliving.getWorld().purpurConfig.entityHealthRegenAmount, RegainReason.MAGIC_REGEN); // CraftBukkit // Purpur
17+
}
18+
} else if (this == MobEffects.POISON) {
19+
- if (entityliving.getHealth() > 1.0F) {
20+
- entityliving.damageEntity(CraftEventFactory.POISON, 1.0F); // CraftBukkit - DamageSource.MAGIC -> CraftEventFactory.POISON
21+
+ if (entityliving.getHealth() > entityliving.getWorld().purpurConfig.entityMinimalHealthPoison) { // Purpur
22+
+ entityliving.damageEntity(CraftEventFactory.POISON, entityliving.getWorld().purpurConfig.entityPoisonDegenerationAmount); // CraftBukkit - DamageSource.MAGIC -> CraftEventFactory.POISON // Purpur
23+
}
24+
} else if (this == MobEffects.WITHER) {
25+
- entityliving.damageEntity(DamageSource.WITHER, 1.0F);
26+
+ entityliving.damageEntity(DamageSource.WITHER, entityliving.getWorld().purpurConfig.entityWitherDegenerationAmount);
27+
} else if (this == MobEffects.HUNGER && entityliving instanceof EntityHuman) {
28+
- ((EntityHuman) entityliving).applyExhaustion(0.005F * (float) (i + 1), org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason.HUNGER_EFFECT); // CraftBukkit - EntityExhaustionEvent
29+
+ ((EntityHuman) entityliving).applyExhaustion(entityliving.getWorld().purpurConfig.humanHungerExhaustionAmount * (float) (i + 1), org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason.HUNGER_EFFECT); // CraftBukkit - EntityExhaustionEvent // Purpur
30+
} else if (this == MobEffects.SATURATION && entityliving instanceof EntityHuman) {
31+
if (!entityliving.world.isClientSide) {
32+
// CraftBukkit start
33+
@@ -70,7 +70,7 @@ public class MobEffectList {
34+
org.bukkit.event.entity.FoodLevelChangeEvent event = CraftEventFactory.callFoodLevelChangeEvent(entityhuman, i + 1 + oldFoodLevel);
35+
36+
if (!event.isCancelled()) {
37+
- entityhuman.getFoodData().eat(event.getFoodLevel() - oldFoodLevel, 1.0F);
38+
+ entityhuman.getFoodData().eat(event.getFoodLevel() - oldFoodLevel, entityliving.getWorld().purpurConfig.humanSaturationRegenAmount); // Purpur
39+
}
40+
41+
((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutUpdateHealth(((EntityPlayer) entityhuman).getBukkitEntity().getScaledHealth(), entityhuman.getFoodData().foodLevel, entityhuman.getFoodData().saturationLevel));
42+
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
43+
index bd72ed2da22c1d1121ea7ca04e163979baa05b27..f27c55d8d6dabe7d2cbaf6ab01e1a484e1d96f53 100644
44+
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
45+
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
46+
@@ -2189,4 +2189,19 @@ public class PurpurWorldConfig {
47+
private void pistonSettings() {
48+
pistonBlockPushLimit = getInt("blocks.piston.block-push-limit", pistonBlockPushLimit);
49+
}
50+
+
51+
+ public float entityHealthRegenAmount = 1.0F;
52+
+ public float entityMinimalHealthPoison = 1.0F;
53+
+ public float entityPoisonDegenerationAmount = 1.0F;
54+
+ public float entityWitherDegenerationAmount = 1.0F;
55+
+ public float humanHungerExhaustionAmount = 0.005F;
56+
+ public float humanSaturationRegenAmount = 1.0F;
57+
+ private void mobEffectSettings() {
58+
+ entityHealthRegenAmount = (float) getDouble("gameplay-mechanics.mob-effects.health-regen-amount", entityHealthRegenAmount);
59+
+ entityMinimalHealthPoison = (float) getDouble("gameplay-mechanics.mob-effects.minimal-health-poison-amount", entityMinimalHealthPoison);
60+
+ entityPoisonDegenerationAmount = (float) getDouble("gameplay-mechanics.mob-effects.poison-degeneration-amount", entityPoisonDegenerationAmount);
61+
+ entityWitherDegenerationAmount = (float) getDouble("gameplay-mechanics.mob-effects.wither-degeneration-amount", entityWitherDegenerationAmount);
62+
+ humanHungerExhaustionAmount = (float) getDouble("gameplay-mechanics.mob-effects.hunger-exhaustion-amount", humanHungerExhaustionAmount);
63+
+ humanSaturationRegenAmount = (float) getDouble("gameplay-mechanics.mob-effects.saturation-regen-amount", humanSaturationRegenAmount);
64+
+ }
65+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: DoctaEnkoda <[email protected]>
3+
Date: Wed, 2 Jun 2021 02:45:47 +0200
4+
Subject: [PATCH] Beacon Activation Range Configurable
5+
6+
7+
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
8+
index f7b210e6d60533d9faf60183a80a562b25f945d0..926e1344a8db4b18caebae77096c2600e0a4958f 100644
9+
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeacon.java
10+
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeacon.java
11+
@@ -79,6 +79,16 @@ public class TileEntityBeacon extends TileEntity implements ITileInventory, ITic
12+
13+
public double getEffectRange() {
14+
if (this.effectRange < 0) {
15+
+ // Purpur Start
16+
+ if (this.world != null) {
17+
+ switch (this.levels) {
18+
+ case 1: return this.world.purpurConfig.beaconLevelOne;
19+
+ case 2: return this.world.purpurConfig.beaconLevelTwo;
20+
+ case 3: return this.world.purpurConfig.beaconLevelThree;
21+
+ case 4: return this.world.purpurConfig.beaconLevelFour;
22+
+ }
23+
+ }
24+
+ // Purpur End
25+
return this.levels * 10 + 10;
26+
} else {
27+
return effectRange;
28+
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
29+
index f27c55d8d6dabe7d2cbaf6ab01e1a484e1d96f53..e72bc4d81e528885dfb129b4718123afa5c16421 100644
30+
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
31+
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
32+
@@ -511,6 +511,18 @@ public class PurpurWorldConfig {
33+
anvilAllowColors = getBoolean("blocks.anvil.allow-colors", anvilAllowColors);
34+
}
35+
36+
+ public int beaconLevelOne = 20;
37+
+ public int beaconLevelTwo = 30;
38+
+ public int beaconLevelThree = 40;
39+
+ public int beaconLevelFour = 50;
40+
+ private void beaconSettings() {
41+
+ beaconLevelOne = getInt("blocks.beacon.effect-range.level-1", beaconLevelOne);
42+
+ beaconLevelTwo = getInt("blocks.beacon.effect-range.level-2", beaconLevelTwo);
43+
+ beaconLevelThree = getInt("blocks.beacon.effect-range.level-3", beaconLevelThree);
44+
+ beaconLevelThree = getInt("blocks.beacon.effect-range.level-3", beaconLevelThree);
45+
+ beaconLevelFour = getInt("blocks.beacon.effect-range.level-4", beaconLevelFour);
46+
+ }
47+
+
48+
public boolean bedExplode = true;
49+
public double bedExplosionPower = 5.0D;
50+
public boolean bedExplosionFire = true;

patches/server/0014-Item-stuck-sleep-config.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Subject: [PATCH] Item stuck sleep config
55

66

77
diff --git a/src/main/java/net/minecraft/world/entity/item/EntityItem.java b/src/main/java/net/minecraft/world/entity/item/EntityItem.java
8-
index dd4997e7ffac4773e01add88efec7c0dcd7b4df0..2cdb72093c9668d7e5ff4d6d0a91ffbf5889470d 100644
8+
index d05d874d54fdf821429814b7b20a3676d426303c..a26f1e490d52e56935858798bfb645cea9f034e4 100644
99
--- a/src/main/java/net/minecraft/world/entity/item/EntityItem.java
1010
+++ b/src/main/java/net/minecraft/world/entity/item/EntityItem.java
1111
@@ -115,7 +115,7 @@ public class EntityItem extends Entity {

upstream/Purpur

0 commit comments

Comments
 (0)