Skip to content

Commit

Permalink
all patches have been applied \o/
Browse files Browse the repository at this point in the history
  • Loading branch information
granny committed Oct 26, 2024
1 parent b7daf30 commit abdb5b6
Show file tree
Hide file tree
Showing 46 changed files with 1,250 additions and 1,235 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Paper patches RNG maniplulation by using a shared (and locked) random source.
This comes with a performance gain, but technical players may prefer the ability to manipulate RNG.

diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 338c2afa277178b3d4d667142799f015c7b97cd0..7e7d13424ea1328ca37b1201a74ac0d4f933a8c3 100644
index d2f2301cff71b8ce64b803dadcb09610e8a2a289..aa0771c7ab8302c03d7a54c6c1282e21defc4de7 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -582,7 +582,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -640,7 +640,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.bb = Entity.INITIAL_AABB;
this.stuckSpeedMultiplier = Vec3.ZERO;
this.nextStep = 1.0F;
Expand All @@ -20,10 +20,10 @@ index 338c2afa277178b3d4d667142799f015c7b97cd0..7e7d13424ea1328ca37b1201a74ac0d4
this.fluidHeight = new Object2DoubleArrayMap(2);
this.fluidOnEyes = new HashSet();
diff --git a/src/main/java/net/minecraft/world/entity/animal/Squid.java b/src/main/java/net/minecraft/world/entity/animal/Squid.java
index ea474ba1d37a594177ada2fd93302f874ed5dc73..3ca9a7f289d8c3f0b0df8f1cd4a5ca1254653c50 100644
index dd807cd532fbdbcc20bd29659e2b578714302d25..01cd55eaac78e35dc57f4f07628ad97bc535da5a 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Squid.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Squid.java
@@ -41,7 +41,7 @@ public class Squid extends WaterAnimal {
@@ -46,7 +46,7 @@ public class Squid extends AgeableWaterCreature {

public Squid(EntityType<? extends Squid> type, Level world) {
super(type, world);
Expand All @@ -33,10 +33,10 @@ index ea474ba1d37a594177ada2fd93302f874ed5dc73..3ca9a7f289d8c3f0b0df8f1cd4a5ca12
}

diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index e90f8c2ca467d9567366ae5c04175e3b5bc7cfc4..72b51d2db04c6cc8a3c4f9bf350e40873ef51d8c 100644
index 3853e9e894c19da5a0e74c30a5e248c3e8790160..a647855f277d79d4ebbf370cff0d15991acbb308 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -211,9 +211,11 @@ public class PurpurWorldConfig {
@@ -209,9 +209,11 @@ public class PurpurWorldConfig {

public int entityLifeSpan = 0;
public float entityLeftHandedChance = 0.05f;
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ Subject: [PATCH] Add more logger output for invalid movement kicks


diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index cdb5062d4d6325ada90dec3d4de6c0fd7546e8ab..682f353c0e409fcc7375efc62d9f64b4952ff230 100644
index 8da850ab34e576caf89681171124f617f57d00a7..06050ed59dde5c8a5291160cc890621083425963 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -755,6 +755,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -727,6 +727,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
if (packet.getId() == this.awaitingTeleport) {
if (this.awaitingPositionFromClient == null) {
+ ServerGamePacketListenerImpl.LOGGER.warn("Disconnected on accept teleport packet. Was not expecting position data from client at this time"); // Purpur
this.disconnect((Component) Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause
return;
}
@@ -1360,7 +1361,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1337,7 +1338,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override
public void handleMovePlayer(ServerboundMovePlayerPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@ Subject: [PATCH] Add Bee API


diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java
index 46d55f60cb91fc32b505582c8eecb393959b5d3f..9a6ec5e465684be7f0d54b1f7e66bdf52603e442 100644
index 4b32a783cabf05f5bae0dba22eea8ac7ba2cd285..dc8df0912c1d18176e18a8f4dc43c4f60f81b659 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
@@ -809,6 +809,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
@@ -954,6 +954,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
if (optional.isPresent()) {
Bee.this.savedFlowerPos = (BlockPos) optional.get();
Bee.this.navigation.moveTo((double) Bee.this.savedFlowerPos.getX() + 0.5D, (double) Bee.this.savedFlowerPos.getY() + 0.5D, (double) Bee.this.savedFlowerPos.getZ() + 0.5D, 1.2000000476837158D);
+ new org.purpurmc.purpur.event.entity.BeeFoundFlowerEvent((org.bukkit.entity.Bee) Bee.this.getBukkitEntity(), io.papermc.paper.util.MCUtil.toLocation(Bee.this.level(), Bee.this.savedFlowerPos)).callEvent(); // Purpur
return true;
} else {
Bee.this.remainingCooldownBeforeLocatingNewFlower = Mth.nextInt(Bee.this.random, 20, 60);
@@ -865,6 +866,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
@@ -997,6 +998,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
this.pollinating = false;
Bee.this.navigation.stop();
Bee.this.remainingCooldownBeforeLocatingNewFlower = 200;
+ new org.purpurmc.purpur.event.entity.BeeStopPollinatingEvent((org.bukkit.entity.Bee) Bee.this.getBukkitEntity(), Bee.this.savedFlowerPos == null ? null : io.papermc.paper.util.MCUtil.toLocation(Bee.this.level(), Bee.this.savedFlowerPos), Bee.this.hasNectar()).callEvent(); // Purpur
}

@Override
@@ -911,6 +913,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
this.setWantedPos();
}
@@ -1046,6 +1048,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
this.setWantedPos();
}

+ if (this.successfulPollinatingTicks == 0) new org.purpurmc.purpur.event.entity.BeeStartedPollinatingEvent((org.bukkit.entity.Bee) Bee.this.getBukkitEntity(), io.papermc.paper.util.MCUtil.toLocation(Bee.this.level(), Bee.this.savedFlowerPos)).callEvent(); // Purpur
++this.successfulPollinatingTicks;
if (Bee.this.random.nextFloat() < 0.05F && this.successfulPollinatingTicks > this.lastSoundPlayedTick + 60) {
this.lastSoundPlayedTick = this.successfulPollinatingTicks;
++this.successfulPollinatingTicks;
if (Bee.this.random.nextFloat() < 0.05F && this.successfulPollinatingTicks > this.lastSoundPlayedTick + 60) {
this.lastSoundPlayedTick = this.successfulPollinatingTicks;
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Debug Marker API


diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 8fc42922d2f5ab3de6050fe9e5f1d7a0b4ed19de..647c86b529d7da3fb96126a0a7b0fa37a52453f4 100644
index 4eb332ed95fd0ca196f3712037deb7637bfa4d8b..da3c89bc037c42268987c5923ca58c93adace80d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1624,6 +1624,42 @@ public final class CraftServer implements Server {
@@ -1601,6 +1601,42 @@ public final class CraftServer implements Server {
public void removeFuel(org.bukkit.Material material) {
net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity.removeFuel(net.minecraft.world.item.ItemStack.fromBukkitCopy(new ItemStack(material)));
}
Expand Down Expand Up @@ -52,10 +52,10 @@ index 8fc42922d2f5ab3de6050fe9e5f1d7a0b4ed19de..647c86b529d7da3fb96126a0a7b0fa37

@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 9ad02908bbcbaec7b6ce2abd4091a8146ee1616b..0921894dbc0d81b943827ecda6e6befdbfd715f5 100644
index 3be5c25f8ce15e2f035c92e5fe90693e0236967d..ea1b4f0073f775fdd18eb080886d60c71a08ab2c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -2390,6 +2390,42 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -2403,6 +2403,42 @@ public class CraftWorld extends CraftRegionAccessor implements World {
public float getLocalDifficultyAt(Location location) {
return getHandle().getCurrentDifficultyAt(io.papermc.paper.util.MCUtil.toBlockPosition(location)).getEffectiveDifficulty();
}
Expand Down Expand Up @@ -99,10 +99,10 @@ index 9ad02908bbcbaec7b6ce2abd4091a8146ee1616b..0921894dbc0d81b943827ecda6e6befd

@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index b6db9d9326f30deb02d5530e014bd3abbaf9c54e..531632ed0a1adaf87acf9bdd651001e9157b1200 100644
index 0d7e460cc73d7e236883e71ab77d51c7ef5e72ce..c4935709b031a98f58c7de3b40e18dc558f76741 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3617,5 +3617,43 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -3647,5 +3647,43 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void resetIdleTimer() {
getHandle().resetLastActionTime();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] mob spawning option to ignore creative players


diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
index 4dc060bc677984d91a30a88155c576d5e187aa1b..061706ee732f9809d6b73305c14871257af8305e 100644
index 4bdfba6dbe88dbc7ce901b235a524ba28027f203..3741c0bb2e7c67cd2b0600f1e8ada38eda8698f8 100644
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
@@ -253,7 +253,7 @@ public final class NaturalSpawner {
@@ -230,7 +230,7 @@ public final class NaturalSpawner {
blockposition_mutableblockposition.set(l, i, i1);
double d0 = (double) l + 0.5D;
double d1 = (double) i1 + 0.5D;
Expand All @@ -18,18 +18,18 @@ index 4dc060bc677984d91a30a88155c576d5e187aa1b..061706ee732f9809d6b73305c1487125
if (entityhuman != null) {
double d2 = entityhuman.distanceToSqr(d0, (double) i, d1);
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 72b51d2db04c6cc8a3c4f9bf350e40873ef51d8c..a4e97284add91c54508759e7d38d9c992fdff89a 100644
index a647855f277d79d4ebbf370cff0d15991acbb308..6afa859dd0d18d57ba438e34a73b512a137d7cb0 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -378,6 +378,7 @@ public class PurpurWorldConfig {
@@ -376,6 +376,7 @@ public class PurpurWorldConfig {
public boolean phantomSpawning;
public boolean villagerTraderSpawning;
public boolean villageSiegeSpawning;
+ public boolean mobSpawningIgnoreCreativePlayers = false;
private void mobSpawnerSettings() {
// values of "default" or null will default to true only if the world environment is normal (aka overworld)
Predicate<Boolean> predicate = (bool) -> (bool != null && bool) || (bool == null && environment == World.Environment.NORMAL);
@@ -386,6 +387,7 @@ public class PurpurWorldConfig {
@@ -384,6 +385,7 @@ public class PurpurWorldConfig {
phantomSpawning = getBoolean("gameplay-mechanics.mob-spawning.phantoms", predicate);
villagerTraderSpawning = getBoolean("gameplay-mechanics.mob-spawning.wandering-traders", predicate);
villageSiegeSpawning = getBoolean("gameplay-mechanics.mob-spawning.village-sieges", predicate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ Subject: [PATCH] Add skeleton bow accuracy option


diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
index 4aeb23de31e826d5cf27f8c91bd60c911f769a17..f9532a45419699585d1f20d27d5857a3e953ec55 100644
index 2cadbc0d56908ca978e1735eff07f5e634548606..39d02cf0e31832e30c4f034b0b5385e3e0057e60 100644
--- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
+++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
@@ -185,7 +185,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
double d2 = target.getZ() - this.getZ();
double d3 = Math.sqrt(d0 * d0 + d2 * d2);
@@ -197,7 +197,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
}

- entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.level().getDifficulty().getId() * 4));
+ entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, this.level().purpurConfig.skeletonBowAccuracyMap.getOrDefault(this.level().getDifficulty().getId(), (float) (14 - this.level().getDifficulty().getId() * 4))); // Purpur
// CraftBukkit start
org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.getMainHandItem(), entityarrow.getPickupItem(), entityarrow, net.minecraft.world.InteractionHand.MAIN_HAND, 0.8F, true); // Paper
if (event.isCancelled()) {
if (event.getProjectile() == entityarrow.getBukkitEntity()) {
- Projectile.spawnProjectileUsingShoot(entityarrow, worldserver, itemstack1, d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - worldserver.getDifficulty().getId() * 4));
+ Projectile.spawnProjectileUsingShoot(entityarrow, worldserver, itemstack1, d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, this.level().purpurConfig.skeletonBowAccuracyMap.getOrDefault(this.level().getDifficulty().getId(), (float) (14 - this.level().getDifficulty().getId() * 4))); // Purpur
}
// CraftBukkit end
}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index a4e97284add91c54508759e7d38d9c992fdff89a..cb2ef867f74711c9e7f111c833b2aefb9c32a672 100644
index 6afa859dd0d18d57ba438e34a73b512a137d7cb0..c5028b16ee9ae1ad042bb99f5398163e28c48d12 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -2589,6 +2589,8 @@ public class PurpurWorldConfig {
@@ -2585,6 +2585,8 @@ public class PurpurWorldConfig {
public boolean skeletonAlwaysDropExp = false;
public double skeletonHeadVisibilityPercent = 0.5D;
public int skeletonFeedWitherRoses = 0;
Expand All @@ -30,7 +30,7 @@ index a4e97284add91c54508759e7d38d9c992fdff89a..cb2ef867f74711c9e7f111c833b2aefb
private void skeletonSettings() {
skeletonRidable = getBoolean("mobs.skeleton.ridable", skeletonRidable);
skeletonRidableInWater = getBoolean("mobs.skeleton.ridable-in-water", skeletonRidableInWater);
@@ -2604,6 +2606,18 @@ public class PurpurWorldConfig {
@@ -2600,6 +2602,18 @@ public class PurpurWorldConfig {
skeletonAlwaysDropExp = getBoolean("mobs.skeleton.always-drop-exp", skeletonAlwaysDropExp);
skeletonHeadVisibilityPercent = getDouble("mobs.skeleton.head-visibility-percent", skeletonHeadVisibilityPercent);
skeletonFeedWitherRoses = getInt("mobs.skeleton.feed-wither-roses", skeletonFeedWitherRoses);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Add death screen API


diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 531632ed0a1adaf87acf9bdd651001e9157b1200..1dd883ac37389b67a380680b868e665daef3938e 100644
index c4935709b031a98f58c7de3b40e18dc558f76741..820ddd8114af64d72fcf0b8757f2058c909956c8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3655,5 +3655,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -3685,5 +3685,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (this.getHandle().connection == null) return;
this.getHandle().connection.send(new net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket(new net.minecraft.network.protocol.common.custom.GameTestClearMarkersDebugPayload()));
}
Expand Down
Loading

0 comments on commit abdb5b6

Please sign in to comment.