Skip to content

Commit

Permalink
50 patches done
Browse files Browse the repository at this point in the history
  • Loading branch information
granny committed Dec 4, 2024
1 parent 626d853 commit ceacfdd
Show file tree
Hide file tree
Showing 41 changed files with 117 additions and 118 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Barrels and enderchests 6 rows


diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index cf8b7f93a1ba027c00d7f45809fa51f1ab55a5de..595302e0177824c1e3ad54e9a088337eeb2d872b 100644
index b973a07d199bc856643b23c090eb56bd1aeb0104..88678fb527f170c81d5e2d4a28f65e398dab8939 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1116,6 +1116,27 @@ public abstract class PlayerList {
Expand Down Expand Up @@ -37,10 +37,10 @@ index cf8b7f93a1ba027c00d7f45809fa51f1ab55a5de..595302e0177824c1e3ad54e9a088337e

public boolean isWhiteListed(GameProfile profile) {
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 21f85ffe12a6ac11a67c808e4878f9a46f01344e..7e9f9b1f9e932116fc12db9cc2c0135144156eda 100644
index e4d8fadd6ef32823f8581dab68567c5da9270566..e5c11504f85abdf49cea4ebd2aaaccdaff35a75c 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -197,6 +197,7 @@ public abstract class Player extends LivingEntity {
@@ -200,6 +200,7 @@ public abstract class Player extends LivingEntity {
private int currentImpulseContextResetGraceTime;
public boolean affectsSpawning = true; // Paper - Affects Spawning API
public net.kyori.adventure.util.TriState flyingFallDamage = net.kyori.adventure.util.TriState.NOT_SET; // Paper - flying fall damage
Expand Down Expand Up @@ -108,10 +108,10 @@ index a15d5ff872dbd77f3c3145e0328f3d02e431ff8c..1dcf36d502990d32fc4cd3ea69c3ea33
this.activeChest = blockEntity;
}
diff --git a/src/main/java/net/minecraft/world/level/block/EnderChestBlock.java b/src/main/java/net/minecraft/world/level/block/EnderChestBlock.java
index 2a207fb2e1c26b562de42240e11c856bd2a23458..6ad4aa371607ab92616626285a7e71757c76a3db 100644
index 9b6ab617ab7f503cf0b2d4e29333c706ffe95f46..bfe79431dc5707677671df5c0787817c6e14a676 100644
--- a/src/main/java/net/minecraft/world/level/block/EnderChestBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/EnderChestBlock.java
@@ -89,7 +89,7 @@ public class EnderChestBlock extends AbstractChestBlock<EnderChestBlockEntity> i
@@ -84,7 +84,7 @@ public class EnderChestBlock extends AbstractChestBlock<EnderChestBlockEntity> i
// Paper start - Fix InventoryOpenEvent cancellation - moved up;
playerEnderChestContainer.setActiveChest(enderChestBlockEntity); // Needs to happen before ChestMenu.threeRows as it is required for opening animations
if (world instanceof ServerLevel serverLevel && player.openMenu(
Expand All @@ -120,7 +120,7 @@ index 2a207fb2e1c26b562de42240e11c856bd2a23458..6ad4aa371607ab92616626285a7e7175
).isPresent()) {
// Paper end - Fix InventoryOpenEvent cancellation - moved up;
// Paper - Fix InventoryOpenEvent cancellation - moved up;
@@ -104,6 +104,35 @@ public class EnderChestBlock extends AbstractChestBlock<EnderChestBlockEntity> i
@@ -99,6 +99,35 @@ public class EnderChestBlock extends AbstractChestBlock<EnderChestBlockEntity> i
}
}

Expand Down Expand Up @@ -240,7 +240,7 @@ index 6d3f9d5dab6c9a2860ae31cae24310aa2d62da7c..4f29c579f94efe59a8c78520d75676fc
case DISPENSER:
case DROPPER:
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
index af1ae3dacb628da23f7d2988c6e76d3fb2d64103..4ee2d501f882279b48edb4b8bf0824587c276bf6 100644
index c6159c70f7a37b9bffe268b91905ce848d1d2927..d02adaaa6fbdc1c0eff44cb4a1f1642f9575a821 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
@@ -84,7 +84,7 @@ public class CraftInventory implements Inventory {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] AFK API


diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 749145ac5ee84b5ebbf4b1eba2df680c1c51bd88..d4ed1dd4e4c56cf40632b0857af82a944579da65 100644
index cff9e1877d3abcf92417ff56f4db2d14ad188f97..ae4733c402662630a3892aecd01646d2e7613eed 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -2641,8 +2641,68 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
@@ -2621,8 +2621,68 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple

public void resetLastActionTime() {
this.lastActionTime = Util.getMillis();
Expand Down Expand Up @@ -78,10 +78,10 @@ index 749145ac5ee84b5ebbf4b1eba2df680c1c51bd88..d4ed1dd4e4c56cf40632b0857af82a94
return this.stats;
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index d2145df4e9b0dd16e7d394b8983c36fd073d3e31..f48b13b9b57e3a25e8afeb37f54e883fd1cadf4d 100644
index e6c4b62daece71edae995a3c3fd21e18b5616bb1..236402e35eb04a2c12ed7ef28ce7c78d7be125cf 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -342,6 +342,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -344,6 +344,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
private boolean justTeleported = false;
// CraftBukkit end

Expand All @@ -102,7 +102,7 @@ index d2145df4e9b0dd16e7d394b8983c36fd073d3e31..f48b13b9b57e3a25e8afeb37f54e883f
@Override
public void tick() {
if (this.ackBlockChangesUpTo > -1) {
@@ -398,6 +412,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -400,6 +414,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.recipeSpamPackets.tick(); // Paper - auto recipe limit
this.dropSpamThrottler.tick();
if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) this.server.getPlayerIdleTimeout() * 1000L * 60L && !this.player.wonGame) { // Paper - Prevent AFK kick while watching end credits
Expand All @@ -115,7 +115,7 @@ index d2145df4e9b0dd16e7d394b8983c36fd073d3e31..f48b13b9b57e3a25e8afeb37f54e883f
this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854
this.disconnect((Component) Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause
}
@@ -663,6 +683,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -656,6 +676,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.lastYaw = to.getYaw();
this.lastPitch = to.getPitch();

Expand All @@ -124,7 +124,7 @@ index d2145df4e9b0dd16e7d394b8983c36fd073d3e31..f48b13b9b57e3a25e8afeb37f54e883f
Location oldTo = to.clone();
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
this.cserver.getPluginManager().callEvent(event);
@@ -1501,7 +1523,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1554,7 +1576,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
movedWrongly = true;
if (event.getLogWarning())
// Paper end
Expand All @@ -133,7 +133,7 @@ index d2145df4e9b0dd16e7d394b8983c36fd073d3e31..f48b13b9b57e3a25e8afeb37f54e883f
} // Paper
}

@@ -1569,6 +1591,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1622,6 +1644,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.lastYaw = to.getYaw();
this.lastPitch = to.getPitch();

Expand Down Expand Up @@ -192,10 +192,10 @@ index 52982c1e6a4da36392569c791853279f5f9ac31a..b3d4c61b1769b6fcc98b7af854f774d2
if (tester == null) {
if (this.isCombat && (!target.canBeSeenAsEnemy() || world.getDifficulty() == Difficulty.PEACEFUL)) {
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 7e9f9b1f9e932116fc12db9cc2c0135144156eda..d1b6e7cf8d110d9106ea99431cf9719ea3b102d5 100644
index e5c11504f85abdf49cea4ebd2aaaccdaff35a75c..47d2f1af81d64054e30b353b66c0a6ad68583298 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -203,6 +203,13 @@ public abstract class Player extends LivingEntity {
@@ -206,6 +206,13 @@ public abstract class Player extends LivingEntity {
public boolean fauxSleeping;
public int oldLevel = -1;

Expand Down Expand Up @@ -223,7 +223,7 @@ index 5d7a6e4b73f032db356e7ec369b150013e940ee6..6b2cda6d578a0983b2401ea206292754
if (range < 0.0 || d < range * range) {
return true;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 3d2322233aff511bcc5c85b24230c2e08dc0bcd0..358f42585c865efbd814787879f919f70234e5c4 100644
index d86bf4f995e8156f594fa90ebbab4165e52c0e09..350165d6616a1dfe931d0a35de0dbbd9222da216 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -583,10 +583,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
Expand All @@ -243,7 +243,7 @@ index 3d2322233aff511bcc5c85b24230c2e08dc0bcd0..358f42585c865efbd814787879f919f7
if (this.getHandle().connection == null) return; // Paper - Updates are possible before the player has fully joined
for (ServerPlayer player : (List<ServerPlayer>) this.server.getHandle().players) {
if (player.getBukkitEntity().canSee(this)) {
@@ -3586,5 +3591,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -3571,5 +3576,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public boolean usesPurpurClient() {
return getHandle().purpurClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable server mod name


diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index ff4d04092aa6322788d55d3c0253cb7f6f3cd493..85e04c38cfda8c546f241a71deeb31efde22dc91 100644
index 48e40ef7fba63d9354152a02440656ceb3a9b7a6..5a85471d26130c893ad619dbfc9b61c0ee1b938b 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2019,7 +2019,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2020,7 +2020,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa

@DontObfuscate
public String getServerModName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Lagging threshold


diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 85e04c38cfda8c546f241a71deeb31efde22dc91..85f5f8a30053cae087b223f0d80432c5318e67d6 100644
index 5a85471d26130c893ad619dbfc9b61c0ee1b938b..93aa1dce5c9bfdfff9372b0a84bfa2d5bf5c1169 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -328,6 +328,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Expand All @@ -16,7 +16,7 @@ index 85e04c38cfda8c546f241a71deeb31efde22dc91..85f5f8a30053cae087b223f0d80432c5

public volatile Thread shutdownThread; // Paper
public volatile boolean abnormalExit = false; // Paper
@@ -1304,6 +1305,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1305,6 +1306,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.recentTps[0] = tps1.getAverage();
this.recentTps[1] = tps5.getAverage();
this.recentTps[2] = tps15.getAverage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] PlayerSetSpawnerTypeWithEggEvent


diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
index 7e7603680310976312050aaff5bdaa805901617f..23b921a79bd563fd0a1bf7afd55a8e52ff1da521 100644
index 8c1dad4b7f6461aca5ac37a25c880c550b0dcf5f..fa15b22e464f1dfe83f3d07ff7a28b6740df79b4 100644
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
@@ -405,6 +405,16 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
Expand All @@ -25,7 +25,7 @@ index 7e7603680310976312050aaff5bdaa805901617f..23b921a79bd563fd0a1bf7afd55a8e52
public static ResourceLocation getKey(EntityType<?> type) {
return BuiltInRegistries.ENTITY_TYPE.getKey(type);
}
@@ -605,6 +615,16 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
@@ -615,6 +625,16 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
return this.category;
}

Expand All @@ -43,14 +43,13 @@ index 7e7603680310976312050aaff5bdaa805901617f..23b921a79bd563fd0a1bf7afd55a8e52
return this.descriptionId;
}
diff --git a/src/main/java/net/minecraft/world/item/SpawnEggItem.java b/src/main/java/net/minecraft/world/item/SpawnEggItem.java
index 9956ed42df55daa6d97fd6e3ab5368dad91cfaf0..e0e746d6c78421b40777125ba49f0a04809f5415 100644
index cc7e9b87e919b4ef8cf77cd780c890fd9a9cfa50..a185d098175e504b7bb93d2cff03ca99eabc11eb 100644
--- a/src/main/java/net/minecraft/world/item/SpawnEggItem.java
+++ b/src/main/java/net/minecraft/world/item/SpawnEggItem.java
@@ -73,6 +73,24 @@ public class SpawnEggItem extends Item {
@@ -68,6 +68,23 @@ public class SpawnEggItem extends Item {
Spawner spawner = (Spawner) tileentity;

entitytypes = this.getType(itemstack);
+
entitytypes = this.getType(world.registryAccess(), itemstack);
+ // Purpur start
+ if (spawner instanceof net.minecraft.world.level.block.entity.SpawnerBlockEntity) {
+ org.bukkit.block.Block bukkitBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Enchantment convenience methods


diff --git a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java
index f99b87cf70df7eaac13d46f4e0234b1e6483d342..d8fc10f9cd0ab2c26e64613006569a86ce201550 100644
index 4dd074d04c9a535f6cf24420058fd68594c59edc..64c315372277300e58ce413210f47eed5b6e1d6c 100644
--- a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java
+++ b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java
@@ -578,4 +578,14 @@ public class EnchantmentHelper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ Subject: [PATCH] Silk touch spawners


diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
index c816c935ecc74a811ffdffbe6ded73c06e92324a..b5b7f1db21a22f16f06ced775c8173f90e36a91c 100644
index 4377fa2400c4320e0023ece230090a2a3b4b2ab6..ac5dc472337cd9613db5fc03f64763245129dfd9 100644
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
+++ b/src/main/java/net/minecraft/world/item/BlockItem.java
@@ -213,6 +213,7 @@ public class BlockItem extends Item {
@@ -223,6 +223,7 @@ public class BlockItem extends Item {
}

if (tileentity != null) {
if (!world.isClientSide && tileentity.onlyOpCanSetNbt() && (player == null || !(player.canUseGameMasterBlocks() || (player.getAbilities().instabuild && player.getBukkitEntity().hasPermission("minecraft.nbt.place"))))) { // Spigot - add permission
+ if (!(!world.isClientSide && world.purpurConfig.silkTouchEnabled && tileentity instanceof net.minecraft.world.level.block.entity.SpawnerBlockEntity && player.getBukkitEntity().hasPermission("purpur.drop.spawners")))
if (tileentitytypes1.onlyOpCanSetNbt() && (player == null || !(player.canUseGameMasterBlocks() || (player.getAbilities().instabuild && player.getBukkitEntity().hasPermission("minecraft.nbt.place"))))) { // Spigot - add permission
+ if (!(world.purpurConfig.silkTouchEnabled && tileentity instanceof net.minecraft.world.level.block.entity.SpawnerBlockEntity && player.getBukkitEntity().hasPermission("purpur.drop.spawners")))
return false;
}

diff --git a/src/main/java/net/minecraft/world/item/Items.java b/src/main/java/net/minecraft/world/item/Items.java
index 5a70111cd39af50981cfd440c021340da1de5eab..bf7d12594375d5b252db540a6d669a6e6aca7de8 100644
index 6d16b4433e79eca0ff8008941f0b9b807b1db9db..41fbe61268c0a16078b5f846ab12bde172872ff7 100644
--- a/src/main/java/net/minecraft/world/item/Items.java
+++ b/src/main/java/net/minecraft/world/item/Items.java
@@ -363,7 +363,7 @@ public class Items {
@@ -367,7 +367,7 @@ public class Items {
public static final Item PURPUR_BLOCK = registerBlock(Blocks.PURPUR_BLOCK);
public static final Item PURPUR_PILLAR = registerBlock(Blocks.PURPUR_PILLAR);
public static final Item PURPUR_STAIRS = registerBlock(Blocks.PURPUR_STAIRS);
Expand All @@ -30,7 +30,7 @@ index 5a70111cd39af50981cfd440c021340da1de5eab..bf7d12594375d5b252db540a6d669a6e
public static final Item CHEST = registerBlock(Blocks.CHEST, settings -> settings.component(DataComponents.CONTAINER, ItemContainerContents.EMPTY));
public static final Item CRAFTING_TABLE = registerBlock(Blocks.CRAFTING_TABLE);
diff --git a/src/main/java/net/minecraft/world/level/block/SpawnerBlock.java b/src/main/java/net/minecraft/world/level/block/SpawnerBlock.java
index 4f190a40b8474aa06a92c8afcc06d0044120ff7b..80ee7a6f010cc838625674007a3ea908f2f9dadd 100644
index d751b280a8bf2066d458f8eb548d7aa123fa69c9..fb88b5c1d9e764bf1211d601527133ea8e8268b3 100644
--- a/src/main/java/net/minecraft/world/level/block/SpawnerBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/SpawnerBlock.java
@@ -42,6 +42,57 @@ public class SpawnerBlock extends BaseEntityBlock {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Disable outdated build check


diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 9ad9239ae0804cc7a4a9ea4a05401b303ae9b372..5bce26e9671aab15ac4bac9a0d00b5184bef74ea 100644
index ae274a56f7cb6200b3c556ed61254bb28146c771..628f7f784c830189c5718a20ce43a9352e400c33 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -267,7 +267,7 @@ public class Main {
Expand Down
Loading

0 comments on commit ceacfdd

Please sign in to comment.