Skip to content

Commit

Permalink
all patches applied \o/
Browse files Browse the repository at this point in the history
  • Loading branch information
granny committed Apr 28, 2024
1 parent 2ff8e3c commit c96e71f
Show file tree
Hide file tree
Showing 49 changed files with 492 additions and 528 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Skeletons eat wither roses


diff --git a/src/main/java/net/minecraft/world/entity/monster/Skeleton.java b/src/main/java/net/minecraft/world/entity/monster/Skeleton.java
index 2064d6177b3e43810d5962102fe914296e2627ff..30ff77f5f137614b5d0d2df6dc90f47c97e8ab13 100644
index 1aae461eed332fe31c1449c47d0928f655c740da..9eb6ed001bfc578311300977dda6f3f156d07190 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Skeleton.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Skeleton.java
@@ -14,6 +14,16 @@ import net.minecraft.world.item.Items;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Enchantment Table Persists Lapis


diff --git a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
index e6935b6632c7a7e07f4da459c95f564356242f98..1a686780e5aadcbdcfceb770ce8e283b38115209 100644
index 5b3e33807e0e13480e3359c0cf067719e5749237..8a7cb30524c75d155c27571e32da6511e265cbf4 100644
--- a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
@@ -40,6 +40,12 @@ import org.bukkit.event.enchantment.PrepareItemEnchantEvent;
@@ -38,6 +38,12 @@ import org.bukkit.event.enchantment.PrepareItemEnchantEvent;
import org.bukkit.entity.Player;
// CraftBukkit end

Expand All @@ -21,7 +21,7 @@ index e6935b6632c7a7e07f4da459c95f564356242f98..1a686780e5aadcbdcfceb770ce8e283b
public class EnchantmentMenu extends AbstractContainerMenu {

static final ResourceLocation EMPTY_SLOT_LAPIS_LAZULI = new ResourceLocation("item/empty_slot_lapis_lazuli");
@@ -74,6 +80,22 @@ public class EnchantmentMenu extends AbstractContainerMenu {
@@ -72,6 +78,22 @@ public class EnchantmentMenu extends AbstractContainerMenu {
return context.getLocation();
}
// CraftBukkit end
Expand All @@ -44,7 +44,7 @@ index e6935b6632c7a7e07f4da459c95f564356242f98..1a686780e5aadcbdcfceb770ce8e283b
};
this.random = RandomSource.create();
this.enchantmentSeed = DataSlot.standalone();
@@ -99,6 +121,17 @@ public class EnchantmentMenu extends AbstractContainerMenu {
@@ -97,6 +119,17 @@ public class EnchantmentMenu extends AbstractContainerMenu {
}
});

Expand All @@ -62,77 +62,45 @@ index e6935b6632c7a7e07f4da459c95f564356242f98..1a686780e5aadcbdcfceb770ce8e283b
int j;

for (j = 0; j < 3; ++j) {
@@ -351,6 +384,7 @@ public class EnchantmentMenu extends AbstractContainerMenu {
@@ -332,6 +365,7 @@ public class EnchantmentMenu extends AbstractContainerMenu {
public void removed(net.minecraft.world.entity.player.Player player) {
super.removed(player);
this.access.execute((world, blockposition) -> {
+ if (world.purpurConfig.enchantmentTableLapisPersists) this.getSlot(1).set(ItemStack.EMPTY); // Purpur
this.clearContainer(player, this.enchantSlots);
});
}
diff --git a/src/main/java/net/minecraft/world/level/block/EnchantmentTableBlock.java b/src/main/java/net/minecraft/world/level/block/EnchantmentTableBlock.java
index af3a8d5f4d80b22d67092bb0c2af5da31b2e3bce..7d5233a96dfa9fca2255e8e44b02179313087ef6 100644
--- a/src/main/java/net/minecraft/world/level/block/EnchantmentTableBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/EnchantmentTableBlock.java
@@ -30,6 +30,8 @@ import net.minecraft.world.level.pathfinder.PathComputationType;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
+import net.minecraft.world.Containers; // Purpur
+import net.minecraft.world.item.Items; // Purpur

public class EnchantmentTableBlock extends BaseEntityBlock {
public static final MapCodec<EnchantmentTableBlock> CODEC = simpleCodec(EnchantmentTableBlock::new);
@@ -137,4 +139,18 @@ public class EnchantmentTableBlock extends BaseEntityBlock {
public boolean isPathfindable(BlockState state, BlockGetter world, BlockPos pos, PathComputationType type) {
return false;
}
+
+ // Purpur start
+ @Override
+ public void onRemove(BlockState state, Level level, BlockPos pos, BlockState newState, boolean moved) {
+ BlockEntity blockEntity = level.getBlockEntity(pos);
+
+ if (level.purpurConfig.enchantmentTableLapisPersists && blockEntity instanceof EnchantmentTableBlockEntity enchantmentTable) {
+ Containers.dropItemStack(level, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(Items.LAPIS_LAZULI, enchantmentTable.getLapis()));
+ level.updateNeighbourForOutputSignal(pos, this);
+ }
+
+ super.onRemove(state, level, pos, newState, moved);
+ }
+ // Purpur end
}
diff --git a/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java
index a912a1ccd3816a9c398946a8724bd3c882f4e9c3..af936b9a2daff9974c2f6ca3c8f5541db94cb40d 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java
@@ -24,6 +24,7 @@ public class EnchantmentTableBlockEntity extends BlockEntity implements Nameable
public float tRot;
diff --git a/src/main/java/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java
index c3503eaec5c5ece6e27a52fb703d06ec7c767383..ed7b41604fb201c346c362803bb9280831c0d0fb 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java
@@ -28,6 +28,7 @@ public class EnchantingTableBlockEntity extends BlockEntity implements Nameable
private static final RandomSource RANDOM = RandomSource.create();
@Nullable
private Component name;
+ private int lapis = 0; // Purpur

public EnchantmentTableBlockEntity(BlockPos pos, BlockState state) {
public EnchantingTableBlockEntity(BlockPos pos, BlockState state) {
super(BlockEntityType.ENCHANTING_TABLE, pos, state);
@@ -35,6 +36,7 @@ public class EnchantmentTableBlockEntity extends BlockEntity implements Nameable
@@ -39,6 +40,7 @@ public class EnchantingTableBlockEntity extends BlockEntity implements Nameable
if (this.hasCustomName()) {
nbt.putString("CustomName", Component.Serializer.toJson(this.name));
nbt.putString("CustomName", Component.Serializer.toJson(this.name, registryLookup));
}
+ nbt.putInt("Purpur.Lapis", this.lapis); // Purpur
}

@Override
@@ -43,6 +45,7 @@ public class EnchantmentTableBlockEntity extends BlockEntity implements Nameable
@@ -47,6 +49,7 @@ public class EnchantingTableBlockEntity extends BlockEntity implements Nameable
if (nbt.contains("CustomName", 8)) {
this.name = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt); // Paper - Catch ParseException
this.name = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt, registryLookup); // Paper - Catch ParseException
}
+ this.lapis = nbt.getInt("Purpur.Lapis"); // Purpur
}

public static void bookAnimationTick(Level world, BlockPos pos, BlockState state, EnchantmentTableBlockEntity blockEntity) {
@@ -117,4 +120,14 @@ public class EnchantmentTableBlockEntity extends BlockEntity implements Nameable
public Component getCustomName() {
return this.name;
public static void bookAnimationTick(Level world, BlockPos pos, BlockState state, EnchantingTableBlockEntity blockEntity) {
@@ -138,4 +141,14 @@ public class EnchantingTableBlockEntity extends BlockEntity implements Nameable
public void removeComponentsFromTag(CompoundTag nbt) {
nbt.remove("CustomName");
}
+
+ // Purpur start
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Subject: [PATCH] Spark Profiler
Co-authored-by: granny <[email protected]>

diff --git a/src/main/java/io/papermc/paper/plugin/PluginInitializerManager.java b/src/main/java/io/papermc/paper/plugin/PluginInitializerManager.java
index 708e5bb9bbf0476fcc2c4b92c6830b094703b43e..6141f716b15ad47ac2ac4c9ce92a3897b3ad8807 100644
index bb1cfa8ea8b11fc36ea72c8e382b8554bccd0ce5..a1af6a07a5fcd280993ad9dae139f3343200692f 100644
--- a/src/main/java/io/papermc/paper/plugin/PluginInitializerManager.java
+++ b/src/main/java/io/papermc/paper/plugin/PluginInitializerManager.java
@@ -104,6 +104,7 @@ public class PluginInitializerManager {
@@ -109,6 +109,7 @@ public class PluginInitializerManager {
@SuppressWarnings("unchecked")
java.util.List<Path> files = ((java.util.List<File>) optionSet.valuesOf("add-plugin")).stream().map(File::toPath).toList();
io.papermc.paper.plugin.util.EntrypointUtil.registerProvidersFromSource(io.papermc.paper.plugin.provider.source.PluginFlagProviderSource.INSTANCE, files);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Option to disable kick for out of order chat


diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 1cefa3b6bdd62ae7bf30da872012fc150905f5ae..db42bf7c5604f32b9b06accb4bbc004ed264a3c2 100644
index 7c96644ee70ea061a5eb29809c2c5cc1bf55e194..530421935473693681819073e1ce9a52cb275775 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1716,7 +1716,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1696,7 +1696,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

do {
if (!iterator.hasNext()) {
Expand All @@ -18,7 +18,7 @@ index 1cefa3b6bdd62ae7bf30da872012fc150905f5ae..db42bf7c5604f32b9b06accb4bbc004e

voxelshape1 = (VoxelShape) iterator.next();
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index 9bc5cc4944dcd3918b2a90bde9dd8fdd795ae3b2..b55a4366f69a1f259d5d7aed01764aec14a1dbb2 100644
index 07d6455c781b8743a833cbc04576015433686c4b..d038e62a0151e3b5c9dee06f1b2682684d0b496e 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -461,9 +461,11 @@ public class PurpurConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Config for sculk shrieker can_summon state


diff --git a/src/main/java/net/minecraft/world/level/block/SculkShriekerBlock.java b/src/main/java/net/minecraft/world/level/block/SculkShriekerBlock.java
index 09c61eb5ba129e9630a756b452ef6aa61745c533..837c8399b2f490d98ca556e66018bfd471cf05bf 100644
index b6b367492ebe2af3e63381bef935c6077f6ddb27..09f34c30d9a03751ed826b26375ac5aee778cce4 100644
--- a/src/main/java/net/minecraft/world/level/block/SculkShriekerBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/SculkShriekerBlock.java
@@ -137,7 +137,7 @@ public class SculkShriekerBlock extends BaseEntityBlock implements SimpleWaterlo
@@ -134,7 +134,7 @@ public class SculkShriekerBlock extends BaseEntityBlock implements SimpleWaterlo
@Nullable
@Override
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Config to not let coral die


diff --git a/src/main/java/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java b/src/main/java/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java
index ffcb4849d83e0f02adbb106f4543bb4898678267..700108e84cf3836a0542c5e04856a9fe254794e9 100644
index ce9f189bdafec26360bfadd0f36a8bc2726e132b..d5465b48531fd4b4094874c135274abf985ee71a 100644
--- a/src/main/java/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java
@@ -38,6 +38,7 @@ public abstract class BaseCoralPlantTypeBlock extends Block implements SimpleWat
Expand All @@ -17,7 +17,7 @@ index ffcb4849d83e0f02adbb106f4543bb4898678267..700108e84cf3836a0542c5e04856a9fe
return true;
} else {
diff --git a/src/main/java/net/minecraft/world/level/block/CoralBlock.java b/src/main/java/net/minecraft/world/level/block/CoralBlock.java
index 8fd8285e07de4a0457da507501e49a807542f3b1..e580c5a141bebdc45893b5abde01e633c864fc13 100644
index 81fe0dea8e6e23c4a78f07fc2f9c0d68cd683f11..bff97b7d3909f2ec9e58a341b901b3741927543f 100644
--- a/src/main/java/net/minecraft/world/level/block/CoralBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/CoralBlock.java
@@ -59,6 +59,7 @@ public class CoralBlock extends Block {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Add local difficulty api


diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 00357d78182b3ff87e3d9a45705b072af56739c8..06abe25b335606b42ac2a7b5551f0c9e7143a474 100644
index f2b20ed5063a293f0b464548f590d652170cd1d8..b7a02ae4eda06cab8ffd1220259a061558981dec 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -2416,6 +2416,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -2424,6 +2424,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
return (this.getHandle().getDragonFight() == null) ? null : new CraftDragonBattle(this.getHandle().getDragonFight());
}

Expand Down
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 2cac12d2b788b0962b719a83b43dc23177b76ac6..ec6187bc3f445acb86e69161ab1b82248b6e99e0 100644
index 2d1fc8734f440c284710c71abc6789e8185ec909..68e8f9913055219486ce19d95dcf9d7c76e08082 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -597,7 +597,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -597,7 +597,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 2cac12d2b788b0962b719a83b43dc23177b76ac6..ec6187bc3f445acb86e69161ab1b8224
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 fa15e43d19482125e1793e049d1a1380aced906c..38d1eb5680281b2812f2396677ffb959a6e089ce 100644
index b86676ebcd6c301e5dd857d8e84e1db2c1da416b..cb950ba3ee3bdfe0ff7acdb94c7ee233d73ab22e 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Squid.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Squid.java
@@ -44,7 +44,7 @@ public class Squid extends WaterAnimal {
@@ -42,7 +42,7 @@ public class Squid extends WaterAnimal {

public Squid(EntityType<? extends Squid> type, Level world) {
super(type, world);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Send client custom name of BE


diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
index 8e1afae66742fc69d5aab1074ba94a3999cbf9b8..e9701ed4e5b35ace1accd2b46f082191d8ab6497 100644
index 4ea15e17a1393864422edb6d5c57962651abf69a..a78ed43288cfefaeb2592ed0a33fd11565dea2b2 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
@@ -205,10 +205,24 @@ public abstract class BlockEntity {
@@ -256,10 +256,24 @@ public abstract class BlockEntity {

@Nullable
public Packet<ClientGamePacketListener> getUpdatePacket() {
Expand All @@ -22,7 +22,7 @@ index 8e1afae66742fc69d5aab1074ba94a3999cbf9b8..e9701ed4e5b35ace1accd2b46f082191
return null;
}

public CompoundTag getUpdateTag() {
public CompoundTag getUpdateTag(HolderLookup.Provider registryLookup) {
+ // Purpur start
+ if (this instanceof net.minecraft.world.Nameable nameable && nameable.hasCustomName()) {
+ CompoundTag nbt = this.saveWithoutMetadata();
Expand Down
Loading

0 comments on commit c96e71f

Please sign in to comment.