Validate ResourceLocation in NBT reading
This commit is contained in:
@@ -216,6 +216,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -665,7 +710,7 @@
|
||||
this.setCritArrow(nbt.getBoolean("crit"));
|
||||
this.setPierceLevel(nbt.getByte("PierceLevel"));
|
||||
if (nbt.contains("SoundEvent", 8)) {
|
||||
- this.soundEvent = (SoundEvent) BuiltInRegistries.SOUND_EVENT.getOptional(ResourceLocation.parse(nbt.getString("SoundEvent"))).orElse(this.getDefaultHitGroundSoundEvent());
|
||||
+ this.soundEvent = (SoundEvent) BuiltInRegistries.SOUND_EVENT.getOptional(ResourceLocation.tryParse(nbt.getString("SoundEvent"))).orElse(this.getDefaultHitGroundSoundEvent()); // Paper - Validate resource location
|
||||
}
|
||||
|
||||
if (nbt.contains("item", 10)) {
|
||||
@@ -675,7 +720,7 @@
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user