mirror of
https://github.com/AtlasMediaGroup/Scissors.git
synced 2025-01-04 21:37:37 +00:00
rest of the patches
This commit is contained in:
parent
d0c2d7d2ac
commit
f35902f754
@ -10,4 +10,5 @@
|
||||
# minecraft net/minecraft/world/level/entity/LevelEntityGetter.java
|
||||
|
||||
minecraft net/minecraft/network/chat/HoverEvent
|
||||
minecraft net/minecraft/world/entity/EntityType
|
||||
minecraft net/minecraft/world/entity/EntityType
|
||||
minecraft net/minecraft/network/protocol/game/ServerboundSetCommandMinecartPacket
|
@ -1,6 +1,6 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Allink <arclicious@vivaldi.net>
|
||||
Date: Fri, 2 Jun 2023 20:55:18 +0100
|
||||
From: Telesphoreo <me@telesphoreo.me>
|
||||
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) {
|
@ -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 {
|
@ -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());
|
@ -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 {
|
@ -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) {
|
@ -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)) {
|
@ -1,53 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Luna <lunahatesgogle@gmail.com>
|
||||
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> COMPONENT = adaptJsonSerializer(Component.Serializer::fromJson, Component.Serializer::toJsonTree);
|
||||
public static final Codec<Component> 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 <T> Codec<T> adaptJsonSerializer(Function<JsonElement, T> deserializer, Function<T, JsonElement> 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<I> codec3 = RecordCodecBuilder.<Pair>create((instance) -> {
|
||||
+ Codec<I> codec3 = RecordCodecBuilder.<Pair<P,P>>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<Pair<A, T>> optional = dataResult.resultOrPartial(mutableObject::setValue);
|
||||
return optional.isPresent() ? dataResult : DataResult.error(() -> {
|
||||
return "(" + (String)mutableObject.getValue() + " -> using default)";
|
||||
- }, Pair.of(object, object));
|
||||
+ }, (Pair<A, T>) Pair.of(object, object)); // Scissors - Decompile error
|
||||
}
|
||||
|
||||
public <T> DataResult<T> coApply(DynamicOps<T> dynamicOps, A objectx, DataResult<T> dataResult) {
|
Loading…
Reference in New Issue
Block a user