diff --git a/build-data/dev-imports.txt b/build-data/dev-imports.txt index 72a2c5f..9268942 100644 --- a/build-data/dev-imports.txt +++ b/build-data/dev-imports.txt @@ -10,4 +10,5 @@ # minecraft net/minecraft/world/level/entity/LevelEntityGetter.java minecraft net/minecraft/network/chat/HoverEvent -minecraft net/minecraft/world/entity/EntityType \ No newline at end of file +minecraft net/minecraft/world/entity/EntityType +minecraft net/minecraft/network/protocol/game/ServerboundSetCommandMinecartPacket \ No newline at end of file diff --git a/patches/unapplied/server/0043-Implement-command-block-events.patch b/patches/server/0041-Implement-command-block-events.patch similarity index 83% rename from patches/unapplied/server/0043-Implement-command-block-events.patch rename to patches/server/0041-Implement-command-block-events.patch index dc34029..920ddd6 100644 --- a/patches/unapplied/server/0043-Implement-command-block-events.patch +++ b/patches/server/0041-Implement-command-block-events.patch @@ -1,6 +1,6 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Allink -Date: Fri, 2 Jun 2023 20:55:18 +0100 +From: Telesphoreo +Date: Mon, 11 Dec 2023 12:27:44 -0600 Subject: [PATCH] Implement command block events @@ -18,36 +18,36 @@ index c99fc118013cb3d4043638e2001a8297e79ddf9c..cdaa81e1f2167b29ec01cc25e51a8400 private final boolean trackOutput; diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 94cc122aad0e48687ea9f25cd810f07dc893acc6..bcb195b1e40f562d0cd5ecca236ebba87150d236 100644 +index e2f434d509be8b523de916d15eb625fe85a58749..bfc3ddcdffb0db44da5e23e3986402d66d5a3d70 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1,6 +1,8 @@ package net.minecraft.server.network; - import me.totalfreedom.scissors.ScissorsConfig; // Scissors -+import me.totalfreedom.scissors.event.block.CommandBlockPlayerEditEvent; // Scissors -+import me.totalfreedom.scissors.event.block.CommandMinecartPlayerEditEvent; // Scissors + import me.totalfreedom.scissors.ScissorsConfig; ++import me.totalfreedom.scissors.event.block.CommandBlockPlayerEditEvent; ++import me.totalfreedom.scissors.event.block.CommandMinecartPlayerEditEvent; import me.totalfreedom.scissors.event.player.SpectatorTeleportEvent; // Scissors import com.google.common.collect.Lists; import com.google.common.primitives.Floats; -@@ -154,6 +156,7 @@ import net.minecraft.world.entity.player.Inventory; +@@ -155,6 +157,7 @@ import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.ProfilePublicKey; import net.minecraft.world.entity.projectile.AbstractArrow; import net.minecraft.world.entity.vehicle.Boat; -+import net.minecraft.world.entity.vehicle.MinecartCommandBlock; // Scissors - import net.minecraft.world.item.BlockItem; - import net.minecraft.world.item.BucketItem; - import net.minecraft.world.item.Item; -@@ -181,6 +184,8 @@ import net.minecraft.world.phys.Vec3; ++import net.minecraft.world.entity.vehicle.MinecartCommandBlock; + import net.minecraft.world.inventory.AbstractContainerMenu; + import net.minecraft.world.inventory.AnvilMenu; + import net.minecraft.world.inventory.BeaconMenu; +@@ -189,6 +192,8 @@ import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.shapes.BooleanOp; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -+import org.bukkit.craftbukkit.block.CraftCommandBlock; // Scissors -+import org.bukkit.craftbukkit.entity.CraftMinecartCommand; // Scissors ++import org.bukkit.craftbukkit.block.CraftCommandBlock; ++import org.bukkit.craftbukkit.entity.CraftMinecartCommand; import org.slf4j.Logger; // CraftBukkit start -@@ -893,6 +898,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -896,6 +901,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.player.level().getChunkAt(blockposition).setBlockEntity(tileentity); } @@ -64,7 +64,7 @@ index 94cc122aad0e48687ea9f25cd810f07dc893acc6..bcb195b1e40f562d0cd5ecca236ebba8 commandblocklistenerabstract.setCommand(s); commandblocklistenerabstract.setTrackOutput(flag); if (!flag) { -@@ -924,7 +939,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -927,7 +942,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl BaseCommandBlock commandblocklistenerabstract = packet.getCommandBlock(this.player.level()); if (commandblocklistenerabstract != null) { diff --git a/patches/unapplied/server/0044-Add-depth-limit-to-SNBT.patch b/patches/server/0042-Add-depth-limit-to-SNBT.patch similarity index 97% rename from patches/unapplied/server/0044-Add-depth-limit-to-SNBT.patch rename to patches/server/0042-Add-depth-limit-to-SNBT.patch index dd5f315..a64de27 100644 --- a/patches/unapplied/server/0044-Add-depth-limit-to-SNBT.patch +++ b/patches/server/0042-Add-depth-limit-to-SNBT.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add depth limit to SNBT diff --git a/src/main/java/net/minecraft/nbt/TagParser.java b/src/main/java/net/minecraft/nbt/TagParser.java -index ee012f1ef1ff7f2adf76d1690dbd5611af7deb4d..d79723047317c24c53fb85c423de8dd9f84891ac 100644 +index 5bec54239a2b185284c10d58854e5a13e33daae5..f112d82b0a9e5513395fa7c1b05d1fe9e28c64ca 100644 --- a/src/main/java/net/minecraft/nbt/TagParser.java +++ b/src/main/java/net/minecraft/nbt/TagParser.java @@ -179,9 +179,56 @@ public class TagParser { diff --git a/patches/unapplied/server/0045-Limit-beacon-effectRange.patch b/patches/server/0043-Limit-beacon-effectRange.patch similarity index 100% rename from patches/unapplied/server/0045-Limit-beacon-effectRange.patch rename to patches/server/0043-Limit-beacon-effectRange.patch diff --git a/patches/unapplied/server/0046-Improve-validation-of-ResourceLocations.patch b/patches/server/0044-Improve-validation-of-ResourceLocations.patch similarity index 100% rename from patches/unapplied/server/0046-Improve-validation-of-ResourceLocations.patch rename to patches/server/0044-Improve-validation-of-ResourceLocations.patch diff --git a/patches/unapplied/server/0047-Don-t-log-on-too-many-chained-updates.patch b/patches/server/0045-Don-t-log-on-too-many-chained-updates.patch similarity index 100% rename from patches/unapplied/server/0047-Don-t-log-on-too-many-chained-updates.patch rename to patches/server/0045-Don-t-log-on-too-many-chained-updates.patch diff --git a/patches/unapplied/server/0048-Fix-packet-related-lag-exploits.patch b/patches/server/0046-Fix-packet-related-lag-exploits.patch similarity index 89% rename from patches/unapplied/server/0048-Fix-packet-related-lag-exploits.patch rename to patches/server/0046-Fix-packet-related-lag-exploits.patch index b3b06b6..5cbb473 100644 --- a/patches/unapplied/server/0048-Fix-packet-related-lag-exploits.patch +++ b/patches/server/0046-Fix-packet-related-lag-exploits.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix packet-related lag exploits diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index bcb195b1e40f562d0cd5ecca236ebba87150d236..fee0a88c6ccecd71ebf63651655dec2d5097f894 100644 +index bfc3ddcdffb0db44da5e23e3986402d66d5a3d70..38ab3f9fe6bcad429d6431b59bc3ffb3c3cc5eb6 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -858,7 +858,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -861,7 +861,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.player.sendSystemMessage(Component.translatable("advMode.notEnabled")); } else if (!this.player.canUseGameMasterBlocks() && (!this.player.isCreative() || !this.player.getBukkitEntity().hasPermission("minecraft.commandblock"))) { // Paper - command block permission this.player.sendSystemMessage(Component.translatable("advMode.notAllowed")); @@ -17,7 +17,7 @@ index bcb195b1e40f562d0cd5ecca236ebba87150d236..fee0a88c6ccecd71ebf63651655dec2d BaseCommandBlock commandblocklistenerabstract = null; CommandBlockEntity tileentitycommand = null; BlockPos blockposition = packet.getPos(); -@@ -1025,7 +1025,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1028,7 +1028,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleSetStructureBlock(ServerboundSetStructureBlockPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); @@ -26,7 +26,7 @@ index bcb195b1e40f562d0cd5ecca236ebba87150d236..fee0a88c6ccecd71ebf63651655dec2d BlockPos blockposition = packet.getPos(); BlockState iblockdata = this.player.level().getBlockState(blockposition); BlockEntity tileentity = this.player.level().getBlockEntity(blockposition); -@@ -1083,7 +1083,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1086,7 +1086,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleSetJigsawBlock(ServerboundSetJigsawBlockPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); @@ -35,7 +35,7 @@ index bcb195b1e40f562d0cd5ecca236ebba87150d236..fee0a88c6ccecd71ebf63651655dec2d BlockPos blockposition = packet.getPos(); BlockState iblockdata = this.player.level().getBlockState(blockposition); BlockEntity tileentity = this.player.level().getBlockEntity(blockposition); -@@ -1106,7 +1106,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1111,7 +1111,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleJigsawGenerate(ServerboundJigsawGeneratePacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); diff --git a/patches/unapplied/server/0049-Limit-save-data-for-Bees-and-Vexes.patch b/patches/server/0047-Limit-save-data-for-Bees-and-Vexes.patch similarity index 89% rename from patches/unapplied/server/0049-Limit-save-data-for-Bees-and-Vexes.patch rename to patches/server/0047-Limit-save-data-for-Bees-and-Vexes.patch index a3d10c6..5ab64da 100644 --- a/patches/unapplied/server/0049-Limit-save-data-for-Bees-and-Vexes.patch +++ b/patches/server/0047-Limit-save-data-for-Bees-and-Vexes.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Limit save data for Bees and Vexes 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 9a7956befc346e1b58f064213800fd099a052fc6..2ebedd806bafc6ff7c4bf5a962ead50ce2ad1a8a 100644 +index a87a34b0c4c8e5d0cf079025c230b1434c919b54..7cbcbbed6ec45a32bbfe8118bf186c6580f065ca 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Bee.java +++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java -@@ -227,8 +227,12 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -234,8 +234,12 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { @Override public void readAdditionalSaveData(CompoundTag nbt) { this.hivePos = null; @@ -24,7 +24,7 @@ index 9a7956befc346e1b58f064213800fd099a052fc6..2ebedd806bafc6ff7c4bf5a962ead50c this.savedFlowerPos = null; diff --git a/src/main/java/net/minecraft/world/entity/monster/Vex.java b/src/main/java/net/minecraft/world/entity/monster/Vex.java -index 90e577b1a89b02c38daff2845a63dafe5ed929e1..1a2b6ee032ab6952634c9f596820db3e7374fb50 100644 +index 30ea3f64234fd1fda8dada3c7fb12be0730322a8..b621b9a50047c5283b259d67019989ec823576e0 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Vex.java +++ b/src/main/java/net/minecraft/world/entity/monster/Vex.java @@ -118,8 +118,12 @@ public class Vex extends Monster implements TraceableEntity { diff --git a/patches/unapplied/server/0050-Mute-invalid-attributes.patch b/patches/server/0048-Mute-invalid-attributes.patch similarity index 92% rename from patches/unapplied/server/0050-Mute-invalid-attributes.patch rename to patches/server/0048-Mute-invalid-attributes.patch index 0da0a1c..783a33c 100644 --- a/patches/unapplied/server/0050-Mute-invalid-attributes.patch +++ b/patches/server/0048-Mute-invalid-attributes.patch @@ -18,10 +18,10 @@ index 7204b973c3ad9239e82355513f6d538107102e48..2463444778f19f937b18173798c04d9d } diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeModifier.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeModifier.java -index a7380ce6dcbf64ad8a51dd047d178ae887518041..cb015941e5ea4618bd0964f4aa66a9f0fceb27a1 100644 +index 1b0db545f93b51368c2d384dd1ba45b93d9eff87..5c3633aa6a256a197502c8139cbf61c2f493bda7 100644 --- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeModifier.java +++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeModifier.java -@@ -92,7 +92,7 @@ public class AttributeModifier { +@@ -86,7 +86,7 @@ public class AttributeModifier { AttributeModifier.Operation operation = AttributeModifier.Operation.fromValue(nbt.getInt("Operation")); return new AttributeModifier(uUID, nbt.getString("Name"), nbt.getDouble("Amount"), operation); } catch (Exception var3) { diff --git a/patches/unapplied/server/0051-Mute-invalid-Enderdragon-phases.patch b/patches/server/0049-Mute-invalid-Enderdragon-phases.patch similarity index 100% rename from patches/unapplied/server/0051-Mute-invalid-Enderdragon-phases.patch rename to patches/server/0049-Mute-invalid-Enderdragon-phases.patch diff --git a/patches/unapplied/server/0053-Add-length-limit-to-note-block-sound.patch b/patches/server/0050-Add-length-limit-to-note-block-sound.patch similarity index 84% rename from patches/unapplied/server/0053-Add-length-limit-to-note-block-sound.patch rename to patches/server/0050-Add-length-limit-to-note-block-sound.patch index 161c66c..f09f44f 100644 --- a/patches/unapplied/server/0053-Add-length-limit-to-note-block-sound.patch +++ b/patches/server/0050-Add-length-limit-to-note-block-sound.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add length limit to note block sound diff --git a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java -index 238b6cd88cb24ca63770db607f2241fcd7210574..ec02597810a4022112ddf31928eb6976e6ac5371 100644 +index 4430520d32024d897c93c1d9f8652ccb2c202c01..ceef1a7fd41751f553f21784217f95a210bd24d9 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java -@@ -92,7 +92,7 @@ public class SkullBlockEntity extends BlockEntity { +@@ -113,7 +113,7 @@ public class SkullBlockEntity extends BlockEntity { } if (nbt.contains("note_block_sound", 8)) { diff --git a/patches/unapplied/server/0052-Don-t-return-null-Components-in-the-Component-codec.patch b/patches/unapplied/server/0052-Don-t-return-null-Components-in-the-Component-codec.patch deleted file mode 100644 index 52f7bb2..0000000 --- a/patches/unapplied/server/0052-Don-t-return-null-Components-in-the-Component-codec.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Luna -Date: Fri, 28 Jul 2023 19:33:23 -0300 -Subject: [PATCH] Don't return null Components in the Component codec - -Found by Sk8kman - -diff --git a/src/main/java/net/minecraft/util/ExtraCodecs.java b/src/main/java/net/minecraft/util/ExtraCodecs.java -index 607f32b856c6c1fb81d3f1604f3bf3fb240d713f..5afdc9d93e696568cc8a263ab0142fbac258e874 100644 ---- a/src/main/java/net/minecraft/util/ExtraCodecs.java -+++ b/src/main/java/net/minecraft/util/ExtraCodecs.java -@@ -70,7 +70,10 @@ public class ExtraCodecs { - public static final Codec COMPONENT = adaptJsonSerializer(Component.Serializer::fromJson, Component.Serializer::toJsonTree); - public static final Codec FLAT_COMPONENT = Codec.STRING.flatXmap((json) -> { - try { -- return DataResult.success(Component.Serializer.fromJson(json)); -+ // Scissors start -+ final Component component = Component.Serializer.fromJson(json); -+ return DataResult.success(component != null ? component : Component.empty()); -+ // Scissors end - } catch (JsonParseException var2) { - return DataResult.error(var2::getMessage); - } -@@ -233,7 +236,10 @@ public class ExtraCodecs { - public static Codec adaptJsonSerializer(Function deserializer, Function serializer) { - return JSON.flatXmap((json) -> { - try { -- return DataResult.success(deserializer.apply(json)); -+ // Scissors start -+ final T value = deserializer.apply(json); -+ return DataResult.success(value != null ? value : (T)Component.empty()); -+ // Scissors end - } catch (JsonParseException var3) { - return DataResult.error(var3::getMessage); - } -@@ -260,7 +266,7 @@ public class ExtraCodecs { - }, (pair) -> { - return ImmutableList.of(leftFunction.apply(pair), rightFunction.apply(pair)); - }); -- Codec codec3 = RecordCodecBuilder.create((instance) -> { -+ Codec codec3 = RecordCodecBuilder.>create((instance) -> { // Scissors - Decompile error - return instance.group(codec.fieldOf(leftFieldName).forGetter(Pair::getFirst), codec.fieldOf(rightFieldName).forGetter(Pair::getSecond)).apply(instance, Pair::of); - }).comapFlatMap((pair) -> { - return combineFunction.apply((P)pair.getFirst(), (P)pair.getSecond()); -@@ -286,7 +292,7 @@ public class ExtraCodecs { - Optional> optional = dataResult.resultOrPartial(mutableObject::setValue); - return optional.isPresent() ? dataResult : DataResult.error(() -> { - return "(" + (String)mutableObject.getValue() + " -> using default)"; -- }, Pair.of(object, object)); -+ }, (Pair) Pair.of(object, object)); // Scissors - Decompile error - } - - public DataResult coApply(DynamicOps dynamicOps, A objectx, DataResult dataResult) {