Skip to content

Commit

Permalink
first 50 patches done!
Browse files Browse the repository at this point in the history
  • Loading branch information
granny committed Oct 26, 2024
1 parent 66cd75f commit d8c53a3
Show file tree
Hide file tree
Showing 42 changed files with 454 additions and 456 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ 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 fbfcd1bd4f6bbaef2d5eb4b5f4c286b343ffb294..59a61a6160ff84f04541822aef5e99e5136ed34c 100644
index a4454289fb92cf7b97ee77db422c328f008521f1..7ec26117aa6d98140e994567fd0ded33d308e3d4 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1151,6 +1151,27 @@ public abstract class PlayerList {
@@ -1110,6 +1110,27 @@ public abstract class PlayerList {
player.getBukkitEntity().recalculatePermissions(); // CraftBukkit
this.server.getCommands().sendCommands(player);
} // Paper - Add sendOpLevel API
Expand Down Expand Up @@ -37,7 +37,7 @@ index fbfcd1bd4f6bbaef2d5eb4b5f4c286b343ffb294..59a61a6160ff84f04541822aef5e99e5

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 509d81d6d34137fc62c1eda0e550ccde56fb05a4..72e99a9d1058e65af2553ac1f3a62f92595e4c8f 100644
index 21f85ffe12a6ac11a67c808e4878f9a46f01344e..7e9f9b1f9e932116fc12db9cc2c0135144156eda 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 {
Expand All @@ -49,10 +49,10 @@ index 509d81d6d34137fc62c1eda0e550ccde56fb05a4..72e99a9d1058e65af2553ac1f3a62f92
// CraftBukkit start
public boolean fauxSleeping;
diff --git a/src/main/java/net/minecraft/world/inventory/ChestMenu.java b/src/main/java/net/minecraft/world/inventory/ChestMenu.java
index 0dbfd23bbfc6ad203f048142f8c90ef741849fe1..9a80427d2bb470b6b1638e59aba57216676dcbd2 100644
index 48a6b6136ac3414ca735f93a14b1a8d76210603c..27321b07cd04814bc1ff720c65770d7755625bb6 100644
--- a/src/main/java/net/minecraft/world/inventory/ChestMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/ChestMenu.java
@@ -67,10 +67,30 @@ public class ChestMenu extends AbstractContainerMenu {
@@ -66,10 +66,30 @@ public class ChestMenu extends AbstractContainerMenu {
return new ChestMenu(MenuType.GENERIC_9x6, syncId, playerInventory, 6);
}

Expand Down Expand Up @@ -108,19 +108,19 @@ 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 491a59336899179c79820cd61541d49f7337c0f6..492fda30f22c8d09271931229ec02bb6f98f5889 100644
index ebb9baca7a65173f7c9fdf9bf47a8db876719625..d9a1ec9c6ccab71618a42121f049005cf821eb42 100644
--- a/src/main/java/net/minecraft/world/level/block/EnderChestBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/EnderChestBlock.java
@@ -92,7 +92,7 @@ public class EnderChestBlock extends AbstractChestBlock<EnderChestBlockEntity> i
playerEnderChestContainer.setActiveChest(enderChestBlockEntity);
// Paper start - Fix InventoryOpenEvent cancellation
if (player.openMenu(
@@ -88,7 +88,7 @@ public class EnderChestBlock extends AbstractChestBlock<EnderChestBlockEntity> i
} else {
// Paper start - Fix InventoryOpenEvent cancellation - moved up;
if (world instanceof ServerLevel serverLevel && player.openMenu(
- new SimpleMenuProvider((i, inventory, playerx) -> ChestMenu.threeRows(i, inventory, playerEnderChestContainer), CONTAINER_TITLE)
+ new SimpleMenuProvider((i, inventory, playerx) -> org.purpurmc.purpur.PurpurConfig.enderChestSixRows ? getEnderChestSixRows(i, inventory, player, playerEnderChestContainer) : ChestMenu.threeRows(i, inventory, playerEnderChestContainer), CONTAINER_TITLE) // Purpur
).isPresent()) {
player.awardStat(Stats.OPEN_ENDERCHEST);
PiglinAi.angerNearbyPiglins(player, true);
@@ -105,6 +105,35 @@ public class EnderChestBlock extends AbstractChestBlock<EnderChestBlockEntity> i
// Paper end - Fix InventoryOpenEvent cancellation - moved up;
playerEnderChestContainer.setActiveChest(enderChestBlockEntity);
@@ -104,6 +104,35 @@ public class EnderChestBlock extends AbstractChestBlock<EnderChestBlockEntity> i
}
}

Expand Down Expand Up @@ -157,7 +157,7 @@ index 491a59336899179c79820cd61541d49f7337c0f6..492fda30f22c8d09271931229ec02bb6
public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
return new EnderChestBlockEntity(pos, state);
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
index 6186e55014bbb9d5bedaa0e9d196879c55339d42..f4f11292d6d00f4a7c65e3e2a157bba595f70889 100644
index 618552afbdacc919c33b30a6bf4834fb71ab3d5b..7a059d20abdcc0073a314311d78f63ae4bd0365e 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
@@ -68,7 +68,16 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity {
Expand Down Expand Up @@ -215,7 +215,7 @@ index 6186e55014bbb9d5bedaa0e9d196879c55339d42..f4f11292d6d00f4a7c65e3e2a157bba5

@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
index 674e3a827f8fb64e5c0beefb3c1874d6e8aee4e5..3bc9ee0d76021d1eeca194d0c2b6c2e144ce09fe 100644
index 6d3f9d5dab6c9a2860ae31cae24310aa2d62da7c..4f29c579f94efe59a8c78520d75676fc4875e2f0 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
@@ -145,8 +145,19 @@ public class CraftContainer extends AbstractContainerMenu {
Expand Down Expand Up @@ -253,7 +253,7 @@ index af1ae3dacb628da23f7d2988c6e76d3fb2d64103..4ee2d501f882279b48edb4b8bf082458
for (int i = 0; i < this.getSize(); i++) {
if (i >= items.length) {
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index 08f38c2a87feb138b202f0934abb3724ef79c4c1..5f51a9d16912ecbd9d015f5158d50563904a461f 100644
index f34d12ea5681a944ae2c08fb2cb69b8f662fcdf6..db93b3aa3883707c0e16745a9afee532fed9379f 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -179,4 +179,39 @@ public class PurpurConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,42 +25,42 @@ index df695b444fa2a993d381e2f197182c3e91a68502..eb0faf58fa1a408f294fc62120b140de
double d = this.llama.distanceToSqr(this.llama.getCaravanHead());
if (d > 676.0) {
diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java
index 6098251783c7c24fe2510c170d628462023d8ab2..09c400ce06003139de84e22313354ed6199da761 100644
index eab57ab99168b1b9ae8df6c8b2b6dd623b1871fb..7ff446ea2163d3b3b9f7fd826939dda21e07c99f 100644
--- a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java
+++ b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java
@@ -75,6 +75,7 @@ public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.V
@@ -72,6 +72,7 @@ public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.V
private Llama caravanHead;
@Nullable
public Llama caravanTail; // Paper
+ public boolean shouldJoinCaravan = true; // Purpur

public Llama(EntityType<? extends Llama> type, Level world) {
super(type, world);
@@ -168,6 +169,7 @@ public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.V
@@ -166,6 +167,7 @@ public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.V
super.addAdditionalSaveData(nbt);
nbt.putInt("Variant", this.getVariant().id);
nbt.putInt("Strength", this.getStrength());
+ nbt.putBoolean("Purpur.ShouldJoinCaravan", shouldJoinCaravan); // Purpur
}

@Override
@@ -175,6 +177,7 @@ public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.V
@@ -173,6 +175,7 @@ public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.V
this.setStrength(nbt.getInt("Strength"));
super.readAdditionalSaveData(nbt);
this.setVariant(Llama.Variant.byId(nbt.getInt("Variant")));
+ if (nbt.contains("Purpur.ShouldJoinCaravan")) this.shouldJoinCaravan = nbt.getBoolean("Purpur.ShouldJoinCaravan"); // Purpur
}

@Override
@@ -456,6 +459,7 @@ public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.V
@@ -440,6 +443,7 @@ public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.V

public void leaveCaravan() {
if (this.caravanHead != null) {
+ new org.purpurmc.purpur.event.entity.LlamaLeaveCaravanEvent((org.bukkit.entity.Llama) getBukkitEntity()).callEvent(); // Purpur
this.caravanHead.caravanTail = null;
}

@@ -463,6 +467,7 @@ public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.V
@@ -447,6 +451,7 @@ public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.V
}

public void joinCaravan(Llama llama) {
Expand Down
Loading

0 comments on commit d8c53a3

Please sign in to comment.