Skip to content

Commit

Permalink
apply patches that i can
Browse files Browse the repository at this point in the history
  • Loading branch information
Telesphoreo committed Apr 16, 2024
1 parent 43afa1c commit b495eaa
Show file tree
Hide file tree
Showing 47 changed files with 101 additions and 895 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ group=me.totalfreedom.scissors
version=1.20.4-R0.1-SNAPSHOT

mcVersion=1.20.4
paperRef=5436d44bf2509ff89129f8790ee4643f09c72871
paperRef=4445d23544e0801fb6f658de98815ce0d8c04f58

org.gradle.caching=true
org.gradle.parallel=true
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0002-UUID-validation.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] UUID validation


diff --git a/src/main/java/net/minecraft/network/chat/HoverEvent.java b/src/main/java/net/minecraft/network/chat/HoverEvent.java
index 7fd85ae2ebd7225f06d874aa7e37fbdb89e3ea92..b2cc15da40aa7bbcfc234b4e147ed0e53f359efa 100644
index 9067bab8ec695417d479393f07d9bc6432427d73..433e586bed53a8c17adec74b3088899c748d4be3 100644
--- a/src/main/java/net/minecraft/network/chat/HoverEvent.java
+++ b/src/main/java/net/minecraft/network/chat/HoverEvent.java
@@ -20,6 +20,7 @@ import net.minecraft.nbt.CompoundTag;
Expand All @@ -16,7 +16,7 @@ index 7fd85ae2ebd7225f06d874aa7e37fbdb89e3ea92..b2cc15da40aa7bbcfc234b4e147ed0e5
import net.minecraft.util.StringRepresentable;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.item.Item;
@@ -161,7 +162,14 @@ public class HoverEvent {
@@ -148,7 +149,14 @@ public class HoverEvent {
CompoundTag compoundTag = TagParser.parseTag(text.getString());
Component component = Component.Serializer.fromJson(compoundTag.getString("name"));
EntityType<?> entityType = BuiltInRegistries.ENTITY_TYPE.get(new ResourceLocation(compoundTag.getString("type")));
Expand All @@ -31,4 +31,4 @@ index 7fd85ae2ebd7225f06d874aa7e37fbdb89e3ea92..b2cc15da40aa7bbcfc234b4e147ed0e5
+ // Scissors end
return DataResult.success(new HoverEvent.EntityTooltipInfo(entityType, uUID, component));
} catch (Exception var5) {
return DataResult.error(() -> {
return DataResult.error(() -> "Failed to parse tooltip: " + var5.getMessage());
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ Subject: [PATCH] Fixes Knowledge Books causing log spam when invalid data is


diff --git a/src/main/java/net/minecraft/world/item/KnowledgeBookItem.java b/src/main/java/net/minecraft/world/item/KnowledgeBookItem.java
index 37f37be56bab171df442b980ff46ff325daae283..deade19d16a7d6870171b9a60806a8cadb437db4 100644
index 5ebc309aed545a4c22970e617519fe916a29fa3c..14a35465e41c9ecb51bea5b084e2637ebd21d295 100644
--- a/src/main/java/net/minecraft/world/item/KnowledgeBookItem.java
+++ b/src/main/java/net/minecraft/world/item/KnowledgeBookItem.java
@@ -40,9 +40,9 @@ public class KnowledgeBookItem extends Item {

for(int i = 0; i < listTag.size(); ++i) {
for (int i = 0; i < listTag.size(); i++) {
String string = listTag.getString(i);
- Optional<RecipeHolder<?>> optional = recipeManager.byKey(new ResourceLocation(string));
+ Optional<RecipeHolder<?>> optional = recipeManager.byKey(ResourceLocation.tryParse(string)); // Scissors - Validate resource locations
if (!optional.isPresent()) {
- LOGGER.error("Invalid recipe: {}", (Object)string);
- LOGGER.error("Invalid recipe: {}", string);
+ // Scissors - Don't log errors caused by invalid recipes being provided
return InteractionResultHolder.fail(itemStack);
}
Expand All @@ -25,7 +25,7 @@ index 37f37be56bab171df442b980ff46ff325daae283..deade19d16a7d6870171b9a60806a8ca

return InteractionResultHolder.sidedSuccess(itemStack, world.isClientSide());
} else {
- LOGGER.error("Tag not valid: {}", (Object)compoundTag);
- LOGGER.error("Tag not valid: {}", compoundTag);
+ // Scissors - Don't throw errors into the logs if an NBT compound isn't present or is missing the Recipes tag.
return InteractionResultHolder.fail(itemStack);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Validate BlockState and SoundEvent values


diff --git a/src/main/java/net/minecraft/nbt/NbtUtils.java b/src/main/java/net/minecraft/nbt/NbtUtils.java
index e3a3f19a6e63fd42e29c418e5a7439972484d492..39866c58f9dbca9b4f0018922eac076c64ffbdae 100644
index fe4bea6af0d8734f3a5b972dce5f1e3914d6690e..0ee64be4288f59240beec26c470b78cc1aeac424 100644
--- a/src/main/java/net/minecraft/nbt/NbtUtils.java
+++ b/src/main/java/net/minecraft/nbt/NbtUtils.java
@@ -231,7 +231,7 @@ public final class NbtUtils {
@@ -223,7 +223,7 @@ public final class NbtUtils {
return Blocks.AIR.defaultBlockState();
} else {
// Paper start - Validate resource location
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Reject oversized components from updating


diff --git a/src/main/java/net/minecraft/network/chat/ComponentUtils.java b/src/main/java/net/minecraft/network/chat/ComponentUtils.java
index 57206594f305961a33542e1f8079c75bfa7c535f..ea4504be0eb115e563a4abd9dcbcedd57f9edcc2 100644
index 3365aed2b67ae0e4dd0410f5190ba474f146139b..43b62a07b040b1d7d76dc8f940f35b51d1d5f868 100644
--- a/src/main/java/net/minecraft/network/chat/ComponentUtils.java
+++ b/src/main/java/net/minecraft/network/chat/ComponentUtils.java
@@ -38,8 +38,9 @@ public class ComponentUtils {
Expand Down
150 changes: 0 additions & 150 deletions patches/server/0010-Better-handling-of-invalid-JSON-components.patch

This file was deleted.

Loading

0 comments on commit b495eaa

Please sign in to comment.