Checkpoint

The patches apply, this is to see if it will actually build
This commit is contained in:
Telesphoreo 2022-12-10 23:26:17 -06:00
parent 2edf8fa89b
commit 5e3b6a6cf9
12 changed files with 32 additions and 32 deletions

View File

@ -5,12 +5,12 @@ Subject: [PATCH] Even more ResourceLocation validation and log spam fixes
diff --git a/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java b/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
index 7e1885d9cc568a544e934cede32bff05c20b567a..2481c50d8eb58a003e30e2d957b877bce5123a3a 100644
index 11a6f5b9e726453979d4c718c32a44024e1b8a08..c4810371c00eb92dc8574841c74a89203d586c78 100644
--- a/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
+++ b/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
@@ -420,7 +420,7 @@ public class AreaEffectCloud extends Entity {
@@ -422,7 +422,7 @@ public class AreaEffectCloud extends Entity {
try {
this.setParticle(ParticleArgument.readParticle(new StringReader(nbt.getString("Particle"))));
this.setParticle(ParticleArgument.readParticle(new StringReader(nbt.getString("Particle")), (HolderLookup) BuiltInRegistries.PARTICLE_TYPE.asLookup()));
} catch (CommandSyntaxException commandsyntaxexception) {
- AreaEffectCloud.LOGGER.warn("Couldn't load custom particle {}", nbt.getString("Particle"), commandsyntaxexception);
+ // Scissors - Don't log custom particle errors

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Do not log invalid items in HoverEvent and ItemFrame
diff --git a/src/main/java/net/minecraft/network/chat/HoverEvent.java b/src/main/java/net/minecraft/network/chat/HoverEvent.java
index b50cd7a39c077dcbabdfea1b9290bf5b144d4384..d38562b518b28ba4617d39e4587c7fa72859ab11 100644
index c0633f9553fb5aa52e8ffc863159521d09cb3bd5..7449a024265c42f28a6c9a1ed8d8f4b9e3096aac 100644
--- a/src/main/java/net/minecraft/network/chat/HoverEvent.java
+++ b/src/main/java/net/minecraft/network/chat/HoverEvent.java
@@ -314,7 +314,7 @@ public class HoverEvent {
@ -27,10 +27,10 @@ index b50cd7a39c077dcbabdfea1b9290bf5b144d4384..d38562b518b28ba4617d39e4587c7fa7
}
}
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
index b9cb39efe14a877ddedc5a5e4141ee5199ea8daf..1450a3ca71a73dd7c73cb9ba15ce98727b87dc20 100644
index 428523feaa4f30260e32ba03937e88200246c693..21e6053a62409784c175ea6cf1ada6b5557097a8 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
@@ -427,7 +427,7 @@ public class ItemFrame extends HangingEntity {
@@ -428,7 +428,7 @@ public class ItemFrame extends HangingEntity {
ItemStack itemstack = ItemStack.of(nbttagcompound1);
if (itemstack.isEmpty()) {

View File

@ -1,46 +1,46 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Video <videogamesm12@gmail.com>
Date: Fri, 22 Apr 2022 01:19:49 -0500
From: Telesphoreo <me@telesphoreo.me>
Date: Sat, 10 Dec 2022 23:02:48 -0600
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
index 2481c50d8eb58a003e30e2d957b877bce5123a3a..6b284666eae8b7e0ef8f54dfe9311a0979b420fe 100644
index c4810371c00eb92dc8574841c74a89203d586c78..929f05c8692223959282f68bf68c4467e4167a80 100644
--- a/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
+++ b/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
@@ -143,7 +143,7 @@ public class AreaEffectCloud extends Entity {
@@ -145,7 +145,7 @@ public class AreaEffectCloud extends Entity {
}
public void setPotionType(String string) {
- this.setPotion(Registry.POTION.get(new ResourceLocation(string)));
+ this.setPotion(Registry.POTION.get(ResourceLocation.tryParse(string))); // Scissors - Validate resource locations
- this.setPotion(BuiltInRegistries.POTION.get(new ResourceLocation(string)));
+ this.setPotion(BuiltInRegistries.POTION.get(ResourceLocation.tryParse(string))); // Scissors - Validate resource locations
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
index 72516335570d7137a62ec8667a6e8f06f024692f..eee1e676f521d22d1de6e0ba1fb89c6c31483554 100644
index e5cd4b7609243669c9d84ff8a4988c209e6101aa..7c73d523eab9dcc8b641db918353faac08aa5e9b 100644
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
@@ -518,7 +518,7 @@ public class EntityType<T extends Entity> implements EntityTypeTest<Entity, T> {
@@ -573,7 +573,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
}), (entity) -> {
entity.load(nbt);
}, () -> {
- EntityType.LOGGER.warn("Skipping Entity with id {}", nbt.getString("id"));
+ // Scissors - Don't log invalid entities
+ /*EntityType.LOGGER.warn("Skipping Entity with id {}", nbt.getString("id"));*/ // Scissors - Don't log invalid entities
});
}
@@ -537,7 +537,7 @@ public class EntityType<T extends Entity> implements EntityTypeTest<Entity, T> {
@@ -592,7 +592,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
}
public static Optional<EntityType<?>> by(CompoundTag nbt) {
- return Registry.ENTITY_TYPE.getOptional(new ResourceLocation(nbt.getString("id")));
+ return Registry.ENTITY_TYPE.getOptional(ResourceLocation.tryParse(nbt.getString("id"))); // Scissors - Validate resource locations
- return BuiltInRegistries.ENTITY_TYPE.getOptional(new ResourceLocation(nbt.getString("id")));
+ return BuiltInRegistries.ENTITY_TYPE.getOptional(ResourceLocation.tryParse(nbt.getString("id")));
}
@Nullable
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index fffa6ba329b38433a1df51df339df652d3fda828..6eb0794d78ba83fa387749f51283e798161027e4 100644
index 49b983064ea810382b6112f5dc7f93ba4e5710bd..4dd32f38ebf06d868a37c8e4ae667ac14a774b8d 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -585,7 +585,7 @@ public abstract class Mob extends LivingEntity {
@ -48,7 +48,7 @@ index fffa6ba329b38433a1df51df339df652d3fda828..6eb0794d78ba83fa387749f51283e798
this.setLeftHanded(nbt.getBoolean("LeftHanded"));
if (nbt.contains("DeathLootTable", 8)) {
- this.lootTable = new ResourceLocation(nbt.getString("DeathLootTable"));
+ this.lootTable = ResourceLocation.tryParse(nbt.getString("DeathLootTable")); // Scissors - Validate resource locations
+ this.lootTable = ResourceLocation.tryParse(nbt.getString("DeathLootTable"));
this.lootTableSeed = nbt.getLong("DeathLootTableSeed");
}

View File

@ -76,7 +76,7 @@ index bf42969859545a8a520923ef1836ffa4a5cc24a0..31d0624fcaf1998383eebde7fbd3a103
switch (distance) {
case -1:
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index f30621be24c6c3a4f173436fce1ad1c13507c84f..604662cd3ac1e0a9b956d1a3078afa9e16beb473 100644
index e072a5475a64d110f25ebcc871aa7703c2fc1e70..21db4153a9eb5e52ff357b4146ae4302029d5cd5 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -278,7 +278,7 @@ public class Main {

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Prevent attributes with invalid namespaces from being applied
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index d8eb84f28761dce95330afc32e4c011a4ab89b18..d48005ae6a19e05a37172dc5af595492a0ca2ede 100644
index 96edb6aa717df1a6d30a8bf7b0c9c554988381b7..212dcea528ea20c4130388c798e4eeb98488f55c 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -46,6 +46,7 @@ import net.minecraft.nbt.NbtIo;

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Validate String UUIDs during the CompoundTag -> GameProfile
diff --git a/src/main/java/net/minecraft/nbt/NbtUtils.java b/src/main/java/net/minecraft/nbt/NbtUtils.java
index 41d23c244e5e87fdeac75820919adfb5ab6e3d1d..420c6f62d6bd1c3c39023d17ccb3afbb0e5f90d5 100644
index 1ccf1d22ac77b669fffd2a1bd7b1331cf0fa281a..6b31a32f9dac31b587693ed8001bf190786ceae8 100644
--- a/src/main/java/net/minecraft/nbt/NbtUtils.java
+++ b/src/main/java/net/minecraft/nbt/NbtUtils.java
@@ -77,7 +77,12 @@ public final class NbtUtils {
@@ -81,7 +81,12 @@ public final class NbtUtils {
}
// Paper start - support string UUID's
if (nbt.contains("Id", 8)) {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Limit ListTags to 1024 elements
diff --git a/src/main/java/net/minecraft/nbt/ListTag.java b/src/main/java/net/minecraft/nbt/ListTag.java
index 6a5e33d9821221be73f9c16afc17c9130248a231..efcbe34f4307a146ecdfbd0eb96925398251054c 100644
index 749d3e67a877d7d1ed47b5fef511a604ee6589b6..fe7a7fd77c7dd1750144fb57e181c51ccda26329 100644
--- a/src/main/java/net/minecraft/nbt/ListTag.java
+++ b/src/main/java/net/minecraft/nbt/ListTag.java
@@ -31,6 +31,7 @@ public class ListTag extends CollectionTag<Tag> {

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Fixes creative-killing potion effects and certain potion
diff --git a/src/main/java/net/minecraft/world/effect/MobEffect.java b/src/main/java/net/minecraft/world/effect/MobEffect.java
index 17ffab92f4ae2c06fa9f9249a474d4b6c9c55090..b2701b5779d9930e2cf6460b1e258cd80c4465f0 100644
index e708b2c987fac150c22b3367cec2e3e2bcb9914c..06872ee2d0eb9ea847568d328a95f60db7373be8 100644
--- a/src/main/java/net/minecraft/world/effect/MobEffect.java
+++ b/src/main/java/net/minecraft/world/effect/MobEffect.java
@@ -59,6 +59,7 @@ public class MobEffect {

View File

@ -1,19 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Business Goose <arclicious@vivaldi.net>
Date: Fri, 3 Jun 2022 19:30:14 -0500
From: Telesphoreo <me@telesphoreo.me>
Date: Sat, 10 Dec 2022 23:23:52 -0600
Subject: [PATCH] Fix negative death times
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 11d7c42d65b91bf57b7bba7812aa17e60e018c67..4d179230f712fbf2a8a8af9f0b7861fe2f83cbf7 100644
index 9e075de3542bda8ae086c9ca68bcd00b16d565d0..2012c147f60f39ae7dbae74641fd00b3b282a991 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -623,7 +623,7 @@ public abstract class LivingEntity extends Entity {
@@ -622,7 +622,7 @@ public abstract class LivingEntity extends Entity {
protected void tickDeath() {
++this.deathTime;
- if (this.deathTime == 20 && !this.level.isClientSide()) {
+ if ((this.deathTime >= 20 || this.deathTime <= 0) && !this.level.isClientSide()) {
- if (this.deathTime >= 20 && !this.level.isClientSide() && !this.isRemoved()) {
+ if ((this.deathTime >= 20 || this.deathTime <= 0) && !this.level.isClientSide() && !this.isRemoved()) {
this.level.broadcastEntityEvent(this, (byte) 60);
this.remove(Entity.RemovalReason.KILLED);
}