This repository has been archived by the owner on Apr 21, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upstream has released updates that appear to apply and compile correctly Purpur Changes: PurpurMC/Purpur@c577b11 Milk keeps beneficial effects (#1147)
- Loading branch information
1 parent
09c32ec
commit 228b92e
Showing
9 changed files
with
49 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: AlphaKR93 <[email protected]> | ||
Date: Sat, 8 Oct 2022 23:50:13 +0000 | ||
Date: Sun, 9 Oct 2022 01:25:32 +0000 | ||
Subject: [PATCH] Pufferfish API Changes | ||
|
||
Original by Kevin Raneri <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: AlphaKR93 <[email protected]> | ||
Date: Sat, 8 Oct 2022 23:52:16 +0000 | ||
Date: Sun, 9 Oct 2022 01:27:43 +0000 | ||
Subject: [PATCH] Purpur API Changes | ||
|
||
Original by PurpurMC Team | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: AlphaKR93 <[email protected]> | ||
Date: Sat, 8 Oct 2022 23:50:13 +0000 | ||
Date: Sun, 9 Oct 2022 01:25:32 +0000 | ||
Subject: [PATCH] Pufferfish Server Changes | ||
|
||
Original by Kevin Raneri <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: AlphaKR93 <[email protected]> | ||
Date: Sat, 8 Oct 2022 23:52:16 +0000 | ||
Date: Sun, 9 Oct 2022 01:27:43 +0000 | ||
Subject: [PATCH] Purpur Server Changes | ||
|
||
Original by PurpurMC Team | ||
|
@@ -4461,7 +4461,7 @@ index c1e9b40a4a0f9cdc650caa88b5ea132e06ee2496..5d6cddc221887be20ef75d688817dfe5 | |
|
||
@Override | ||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java | ||
index 26efc49b4530112c8bd3f580ce375ab4203c9609..9dca0d694aa8fa7f8bec0d2504986085e0cc6fe9 100644 | ||
index 26efc49b4530112c8bd3f580ce375ab4203c9609..ad4bd5fa9bcd085a1eb99c4da5fc95ebc126d028 100644 | ||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java | ||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java | ||
@@ -44,6 +44,7 @@ import net.minecraft.network.syncher.EntityDataAccessor; | ||
|
@@ -4634,7 +4634,15 @@ index 26efc49b4530112c8bd3f580ce375ab4203c9609..9dca0d694aa8fa7f8bec0d2504986085 | |
} | ||
|
||
return d0; | ||
@@ -1408,13 +1441,13 @@ public abstract class LivingEntity extends Entity { | ||
@@ -1063,6 +1096,7 @@ public abstract class LivingEntity extends Entity { | ||
for (flag = false; iterator.hasNext(); flag = true) { | ||
// CraftBukkit start | ||
MobEffectInstance effect = (MobEffectInstance) iterator.next(); | ||
+ if (cause == EntityPotionEffectEvent.Cause.MILK && !this.level.purpurConfig.milkClearsBeneficialEffects && effect.getEffect().isBeneficial()) continue; // Purpur | ||
EntityPotionEffectEvent event = CraftEventFactory.callEntityPotionEffectChangeEvent(this, effect, null, cause, EntityPotionEffectEvent.Action.CLEARED); | ||
if (event.isCancelled()) { | ||
continue; | ||
@@ -1408,13 +1442,13 @@ public abstract class LivingEntity extends Entity { | ||
} | ||
|
||
if (entity1 instanceof net.minecraft.world.entity.player.Player) { | ||
|
@@ -4650,7 +4658,7 @@ index 26efc49b4530112c8bd3f580ce375ab4203c9609..9dca0d694aa8fa7f8bec0d2504986085 | |
LivingEntity entityliving = entitywolf.getOwner(); | ||
|
||
if (entityliving != null && entityliving.getType() == EntityType.PLAYER) { | ||
@@ -1539,6 +1572,19 @@ public abstract class LivingEntity extends Entity { | ||
@@ -1539,6 +1573,19 @@ public abstract class LivingEntity extends Entity { | ||
} | ||
} | ||
|
||
|
@@ -4670,7 +4678,7 @@ index 26efc49b4530112c8bd3f580ce375ab4203c9609..9dca0d694aa8fa7f8bec0d2504986085 | |
org.bukkit.inventory.EquipmentSlot handSlot = (hand != null) ? org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand) : null; | ||
EntityResurrectEvent event = new EntityResurrectEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), handSlot); | ||
event.setCancelled(itemstack == null); | ||
@@ -1699,7 +1745,7 @@ public abstract class LivingEntity extends Entity { | ||
@@ -1699,7 +1746,7 @@ public abstract class LivingEntity extends Entity { | ||
boolean flag = false; | ||
|
||
if (this.dead && adversary instanceof WitherBoss) { // Paper | ||
|
@@ -4679,23 +4687,23 @@ index 26efc49b4530112c8bd3f580ce375ab4203c9609..9dca0d694aa8fa7f8bec0d2504986085 | |
BlockPos blockposition = this.blockPosition(); | ||
BlockState iblockdata = Blocks.WITHER_ROSE.defaultBlockState(); | ||
|
||
@@ -1745,6 +1791,7 @@ public abstract class LivingEntity extends Entity { | ||
@@ -1745,6 +1792,7 @@ public abstract class LivingEntity extends Entity { | ||
|
||
this.dropEquipment(); // CraftBukkit - from below | ||
if (this.shouldDropLoot() && this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) { | ||
+ if (!(source == DamageSource.CRAMMING && level.purpurConfig.disableDropsOnCrammingDeath)) { // Purpur | ||
this.dropFromLootTable(source, flag); | ||
// Paper start | ||
final boolean prev = this.clearEquipmentSlots; | ||
@@ -1753,6 +1800,7 @@ public abstract class LivingEntity extends Entity { | ||
@@ -1753,6 +1801,7 @@ public abstract class LivingEntity extends Entity { | ||
// Paper end | ||
this.dropCustomDeathLoot(source, i, flag); | ||
this.clearEquipmentSlots = prev; // Paper | ||
+ } // Purpur | ||
} | ||
// CraftBukkit start - Call death event // Paper start - call advancement triggers with correct entity equipment | ||
org.bukkit.event.entity.EntityDeathEvent deathEvent = CraftEventFactory.callEntityDeathEvent(this, this.drops, () -> { | ||
@@ -1987,7 +2035,7 @@ public abstract class LivingEntity extends Entity { | ||
@@ -1987,7 +2036,7 @@ public abstract class LivingEntity extends Entity { | ||
MobEffectInstance mobeffect = this.getEffect(MobEffects.JUMP); | ||
float f2 = mobeffect == null ? 0.0F : (float) (mobeffect.getAmplifier() + 1); | ||
|
||
|
@@ -4704,7 +4712,7 @@ index 26efc49b4530112c8bd3f580ce375ab4203c9609..9dca0d694aa8fa7f8bec0d2504986085 | |
} | ||
|
||
protected void playBlockFallSound() { | ||
@@ -2204,6 +2252,20 @@ public abstract class LivingEntity extends Entity { | ||
@@ -2204,6 +2253,20 @@ public abstract class LivingEntity extends Entity { | ||
((ServerPlayer) damagesource.getEntity()).awardStat(Stats.DAMAGE_DEALT_ABSORBED, Math.round(f2 * 10.0F)); | ||
} | ||
|
||
|
@@ -4725,7 +4733,7 @@ index 26efc49b4530112c8bd3f580ce375ab4203c9609..9dca0d694aa8fa7f8bec0d2504986085 | |
if (f > 0 || !human) { | ||
if (human) { | ||
// PAIL: Be sure to drag all this code from the EntityHuman subclass each update. | ||
@@ -2484,7 +2546,7 @@ public abstract class LivingEntity extends Entity { | ||
@@ -2484,7 +2547,7 @@ public abstract class LivingEntity extends Entity { | ||
|
||
@Override | ||
protected void outOfWorld() { | ||
|
@@ -4734,7 +4742,7 @@ index 26efc49b4530112c8bd3f580ce375ab4203c9609..9dca0d694aa8fa7f8bec0d2504986085 | |
} | ||
|
||
protected void updateSwingTime() { | ||
@@ -2673,7 +2735,7 @@ public abstract class LivingEntity extends Entity { | ||
@@ -2673,7 +2736,7 @@ public abstract class LivingEntity extends Entity { | ||
} | ||
|
||
protected long lastJumpTime = 0L; // Paper | ||
|
@@ -4743,15 +4751,15 @@ index 26efc49b4530112c8bd3f580ce375ab4203c9609..9dca0d694aa8fa7f8bec0d2504986085 | |
double d0 = (double) this.getJumpPower() + this.getJumpBoostPower(); | ||
Vec3 vec3d = this.getDeltaMovement(); | ||
// Paper start | ||
@@ -2831,6 +2893,7 @@ public abstract class LivingEntity extends Entity { | ||
@@ -2831,6 +2894,7 @@ public abstract class LivingEntity extends Entity { | ||
|
||
if (f3 > 0.0F) { | ||
this.playSound(this.getFallDamageSound((int) f3), 1.0F, 1.0F); | ||
+ if (level.purpurConfig.elytraKineticDamage) // Purpur | ||
this.hurt(DamageSource.FLY_INTO_WALL, f3); | ||
} | ||
} | ||
@@ -3027,10 +3090,10 @@ public abstract class LivingEntity extends Entity { | ||
@@ -3027,10 +3091,10 @@ public abstract class LivingEntity extends Entity { | ||
} | ||
|
||
this.run += (f3 - this.run) * 0.3F; | ||
|
@@ -4765,7 +4773,7 @@ index 26efc49b4530112c8bd3f580ce375ab4203c9609..9dca0d694aa8fa7f8bec0d2504986085 | |
|
||
// Paper start - stop large pitch and yaw changes from crashing the server | ||
this.yRotO += Math.round((this.getYRot() - this.yRotO) / 360.0F) * 360.0F; | ||
@@ -3042,7 +3105,7 @@ public abstract class LivingEntity extends Entity { | ||
@@ -3042,7 +3106,7 @@ public abstract class LivingEntity extends Entity { | ||
this.yHeadRotO += Math.round((this.yHeadRot - this.yHeadRotO) / 360.0F) * 360.0F; | ||
// Paper end | ||
|
||
|
@@ -4774,7 +4782,7 @@ index 26efc49b4530112c8bd3f580ce375ab4203c9609..9dca0d694aa8fa7f8bec0d2504986085 | |
this.animStep += f2; | ||
if (this.isFallFlying()) { | ||
++this.fallFlyTicks; | ||
@@ -3324,19 +3387,19 @@ public abstract class LivingEntity extends Entity { | ||
@@ -3324,19 +3388,19 @@ public abstract class LivingEntity extends Entity { | ||
} | ||
|
||
this.setDeltaMovement(d4, d5, d6); | ||
|
@@ -4799,7 +4807,7 @@ index 26efc49b4530112c8bd3f580ce375ab4203c9609..9dca0d694aa8fa7f8bec0d2504986085 | |
if (this.jumping && this.isAffectedByFluids()) { | ||
double d7; | ||
|
||
@@ -3363,8 +3426,8 @@ public abstract class LivingEntity extends Entity { | ||
@@ -3363,8 +3427,8 @@ public abstract class LivingEntity extends Entity { | ||
this.noJumpDelay = 0; | ||
} | ||
|
||
|
@@ -4810,7 +4818,7 @@ index 26efc49b4530112c8bd3f580ce375ab4203c9609..9dca0d694aa8fa7f8bec0d2504986085 | |
this.xxa *= 0.98F; | ||
this.zza *= 0.98F; | ||
this.updateFallFlying(); | ||
@@ -3373,8 +3436,8 @@ public abstract class LivingEntity extends Entity { | ||
@@ -3373,8 +3437,8 @@ public abstract class LivingEntity extends Entity { | ||
// SpigotTimings.timerEntityAIMove.startTiming(); // Spigot // Paper | ||
this.travel(new Vec3((double) this.xxa, (double) this.yya, (double) this.zza)); | ||
// SpigotTimings.timerEntityAIMove.stopTiming(); // Spigot // Paper | ||
|
@@ -4821,7 +4829,7 @@ index 26efc49b4530112c8bd3f580ce375ab4203c9609..9dca0d694aa8fa7f8bec0d2504986085 | |
boolean flag1 = this.getType().is(EntityTypeTags.FREEZE_HURTS_EXTRA_TYPES); | ||
int i; | ||
|
||
@@ -3394,18 +3457,20 @@ public abstract class LivingEntity extends Entity { | ||
@@ -3394,18 +3458,20 @@ public abstract class LivingEntity extends Entity { | ||
this.hurt(DamageSource.FREEZE, (float) i); | ||
} | ||
|
||
|
@@ -4847,7 +4855,7 @@ index 26efc49b4530112c8bd3f580ce375ab4203c9609..9dca0d694aa8fa7f8bec0d2504986085 | |
Location from = new Location(this.level.getWorld(), this.xo, this.yo, this.zo, this.yRotO, this.xRotO); | ||
Location to = new Location (this.level.getWorld(), this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot()); | ||
io.papermc.paper.event.entity.EntityMoveEvent event = new io.papermc.paper.event.entity.EntityMoveEvent(this.getBukkitLivingEntity(), from, to.clone()); | ||
@@ -3415,12 +3480,48 @@ public abstract class LivingEntity extends Entity { | ||
@@ -3415,12 +3481,48 @@ public abstract class LivingEntity extends Entity { | ||
absMoveTo(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ(), event.getTo().getYaw(), event.getTo().getPitch()); | ||
} | ||
} | ||
|
@@ -4896,7 +4904,7 @@ index 26efc49b4530112c8bd3f580ce375ab4203c9609..9dca0d694aa8fa7f8bec0d2504986085 | |
} | ||
|
||
public boolean isSensitiveToWater() { | ||
@@ -3441,7 +3542,16 @@ public abstract class LivingEntity extends Entity { | ||
@@ -3441,7 +3543,16 @@ public abstract class LivingEntity extends Entity { | ||
int j = i / 10; | ||
|
||
if (j % 2 == 0) { | ||
|
@@ -21698,10 +21706,10 @@ index 0000000000000000000000000000000000000000..3cfbb4300e82cce409a7a0b53ef98987 | |
+} | ||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java | ||
new file mode 100644 | ||
index 0000000000000000000000000000000000000000..a6356d19f0fc664be523f19c2ea1704191a7a73a | ||
index 0000000000000000000000000000000000000000..a70caf9a80c39840ea70539d3eedc767fee64872 | ||
--- /dev/null | ||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java | ||
@@ -0,0 +1,3135 @@ | ||
@@ -0,0 +1,3137 @@ | ||
+package org.purpurmc.purpur; | ||
+ | ||
+import gg.pufferfish.pufferfish.PufferfishConfig; | ||
|
@@ -21835,6 +21843,7 @@ index 0000000000000000000000000000000000000000..a6356d19f0fc664be523f19c2ea17041 | |
+ public boolean fireballsBypassMobGriefing = false; | ||
+ public boolean imposeTeleportRestrictionsOnGateways = false; | ||
+ public boolean milkCuresBadOmen = true; | ||
+ public boolean milkClearsBeneficialEffects = true; | ||
+ public boolean noteBlockIgnoreAbove = false; | ||
+ public boolean persistentDroppableEntityDisplayNames = false; | ||
+ public boolean persistentTileEntityDisplayNames = false; | ||
|
@@ -21861,6 +21870,7 @@ index 0000000000000000000000000000000000000000..a6356d19f0fc664be523f19c2ea17041 | |
+ fireballsBypassMobGriefing = getBoolean("gameplay-mechanics.fireballs-bypass-mob-griefing", fireballsBypassMobGriefing); | ||
+ imposeTeleportRestrictionsOnGateways = getBoolean("gameplay-mechanics.impose-teleport-restrictions-on-gateways", imposeTeleportRestrictionsOnGateways); | ||
+ milkCuresBadOmen = getBoolean("gameplay-mechanics.milk-cures-bad-omen", milkCuresBadOmen); | ||
+ milkClearsBeneficialEffects = getBoolean("gameplay-mechanics.milk-clears-beneficial-effects", milkClearsBeneficialEffects); | ||
+ noteBlockIgnoreAbove = getBoolean("gameplay-mechanics.note-block-ignore-above", noteBlockIgnoreAbove); | ||
+ persistentTileEntityDisplayNames = getBoolean("gameplay-mechanics.persistent-tileentity-display-names-and-lore", persistentTileEntityDisplayNames); | ||
+ persistentDroppableEntityDisplayNames = getBoolean("gameplay-mechanics.persistent-droppable-entity-display-names", persistentDroppableEntityDisplayNames); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
purpur = ae430619b602ce9808386e5e77d2fde038475dca | ||
purpur = c577b117e789145a45f4ab22f74cfdc27f6586a6 | ||
pufferfish = 9d9a0e1a32466455cd3c3eff5b673a9e177491d6 |