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

Commit

Permalink
Updated Upstream and Sidestream(s) (Airplane/Purpur)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
Titaniumtown committed Jun 2, 2021
1 parent daedcdd commit 8a33bae
Show file tree
Hide file tree
Showing 12 changed files with 163 additions and 18 deletions.
3 changes: 3 additions & 0 deletions PATCHES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | |
Expand All @@ -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 | |
Expand Down Expand Up @@ -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 | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 @@
Expand Down Expand Up @@ -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<ItemStack> list) {
+ this(list.size());
Expand All @@ -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() {
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Paul Sauve <paul@technove.co>
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);
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -59,7 +59,7 @@ index 077990f1d95ded2c8b89c38978ec25a56df3a984..be46b8fcbfed932ba96a34c94eee0b23

public EntityItem(EntityTypes<? extends EntityItem> 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;
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions patches/Purpur/patches/server/0155-Add-MC-4-fix-back.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
65 changes: 65 additions & 0 deletions patches/Purpur/patches/server/0219-Config-MobEffect-by-world.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: DoctaEnkoda <bierquejason@gmail.com>
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);
+ }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: DoctaEnkoda <bierquejason@gmail.com>
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;
2 changes: 1 addition & 1 deletion patches/server/0014-Item-stuck-sleep-config.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion upstream/Purpur
2 changes: 1 addition & 1 deletion upstreamCommits/Airplane
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3e07ea8cf6f3739eac4710f914222f952fbce43b
8c5012517e30804bf6376f56625c2ef569c8a15a
2 changes: 1 addition & 1 deletion upstreamCommits/Purpur
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d2204a3daca80a3a3da068215e3fa530bb0620b9
5824eb8f2c2d243c19732c22943e71d707a50d21

0 comments on commit 8a33bae

Please sign in to comment.