2022-07-28 03:57:50 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2022-12-11 05:26:17 +00:00
|
|
|
From: Telesphoreo <me@telesphoreo.me>
|
|
|
|
Date: Sat, 10 Dec 2022 23:02:48 -0600
|
2022-07-28 03:57:50 +00:00
|
|
|
Subject: [PATCH] Even more resource location validation
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java b/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
|
2023-06-09 00:58:46 +00:00
|
|
|
index db3cddf8b227453c9b08e481b21101c5d2e0472d..77ae3bc5fd6cf34aae7bd3baa563f3e23e57de26 100644
|
2022-07-28 03:57:50 +00:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
|
2023-03-16 03:57:35 +00:00
|
|
|
@@ -145,7 +145,7 @@ public class AreaEffectCloud extends Entity implements TraceableEntity {
|
2022-07-28 03:57:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void setPotionType(String string) {
|
2022-12-11 05:26:17 +00:00
|
|
|
- this.setPotion(BuiltInRegistries.POTION.get(new ResourceLocation(string)));
|
|
|
|
+ this.setPotion(BuiltInRegistries.POTION.get(ResourceLocation.tryParse(string))); // Scissors - Validate resource locations
|
2022-07-28 03:57:50 +00:00
|
|
|
}
|
|
|
|
// CraftBukkit end
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
|
2023-06-09 00:58:46 +00:00
|
|
|
index 9afc81ccb237c3655d64cdbe8a0db9a4d7791043..ffcb77755b28bcdb3eae981fc735e6dde664bb6e 100644
|
2022-07-28 03:57:50 +00:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
|
2023-03-16 03:57:35 +00:00
|
|
|
@@ -588,7 +588,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
2022-07-28 03:57:50 +00:00
|
|
|
}), (entity) -> {
|
|
|
|
entity.load(nbt);
|
|
|
|
}, () -> {
|
|
|
|
- EntityType.LOGGER.warn("Skipping Entity with id {}", nbt.getString("id"));
|
2022-12-11 05:26:17 +00:00
|
|
|
+ /*EntityType.LOGGER.warn("Skipping Entity with id {}", nbt.getString("id"));*/ // Scissors - Don't log invalid entities
|
2022-07-28 03:57:50 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-03-16 03:57:35 +00:00
|
|
|
@@ -607,7 +607,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
2022-07-28 03:57:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static Optional<EntityType<?>> by(CompoundTag nbt) {
|
2022-12-11 05:26:17 +00:00
|
|
|
- return BuiltInRegistries.ENTITY_TYPE.getOptional(new ResourceLocation(nbt.getString("id")));
|
|
|
|
+ return BuiltInRegistries.ENTITY_TYPE.getOptional(ResourceLocation.tryParse(nbt.getString("id")));
|
2022-07-28 03:57:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Nullable
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
2023-06-09 00:58:46 +00:00
|
|
|
index e2a25c29ec74147b3e66aa0b3deb85a8f6ee53a5..b0c953ad8275740679c847e348b311de93d64965 100644
|
2022-07-28 03:57:50 +00:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
2023-06-09 00:58:46 +00:00
|
|
|
@@ -618,7 +618,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
2022-07-28 03:57:50 +00:00
|
|
|
|
|
|
|
this.setLeftHanded(nbt.getBoolean("LeftHanded"));
|
|
|
|
if (nbt.contains("DeathLootTable", 8)) {
|
|
|
|
- this.lootTable = new ResourceLocation(nbt.getString("DeathLootTable"));
|
2022-12-11 05:26:17 +00:00
|
|
|
+ this.lootTable = ResourceLocation.tryParse(nbt.getString("DeathLootTable"));
|
2022-07-28 03:57:50 +00:00
|
|
|
this.lootTableSeed = nbt.getLong("DeathLootTableSeed");
|
|
|
|
}
|
|
|
|
|