mirror of
https://github.com/AtlasMediaGroup/Scissors.git
synced 2024-11-27 07:05:39 +00:00
add another
This commit is contained in:
parent
747552d1a2
commit
c5c9121833
@ -10,3 +10,4 @@
|
|||||||
# minecraft net/minecraft/world/level/entity/LevelEntityGetter.java
|
# minecraft net/minecraft/world/level/entity/LevelEntityGetter.java
|
||||||
|
|
||||||
minecraft net/minecraft/network/chat/HoverEvent
|
minecraft net/minecraft/network/chat/HoverEvent
|
||||||
|
minecraft net/minecraft/world/entity/EntityType
|
@ -1,6 +1,6 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Video <videogamesm12@gmail.com>
|
From: Telesphoreo <me@telesphoreo.me>
|
||||||
Date: Sun, 13 Mar 2022 07:39:26 -0600
|
Date: Sun, 10 Dec 2023 13:40:21 -0600
|
||||||
Subject: [PATCH] ResourceLocation validation
|
Subject: [PATCH] ResourceLocation validation
|
||||||
|
|
||||||
|
|
||||||
@ -44,10 +44,10 @@ index 1f55185814125c691288294d18bf1580461c8066..259d65f8e21f9cf99585d416eafdc967
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
|
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||||
index 73871f456a85bda1e51f54986d0e61fb629822e8..df16049a70061c7c38d72b188d054339f5434e03 100644
|
index 940b8d0b89d7e55c938aefbe80ee71b0db3dacb8..297a214a7833fd67640c94352671483bc4fc8dd5 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
|
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
|
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||||
@@ -589,7 +589,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
@@ -593,7 +593,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||||
}), (entity) -> {
|
}), (entity) -> {
|
||||||
entity.load(nbt);
|
entity.load(nbt);
|
||||||
}, () -> {
|
}, () -> {
|
||||||
@ -56,7 +56,7 @@ index 73871f456a85bda1e51f54986d0e61fb629822e8..df16049a70061c7c38d72b188d054339
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -608,7 +608,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
@@ -612,7 +612,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<EntityType<?>> by(CompoundTag nbt) {
|
public static Optional<EntityType<?>> by(CompoundTag nbt) {
|
||||||
@ -66,10 +66,10 @@ index 73871f456a85bda1e51f54986d0e61fb629822e8..df16049a70061c7c38d72b188d054339
|
|||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
index d28c477171c1b6888a45175075017d960464b5cd..cc46185c05a735d4443b266423215f1f7a0c7741 100644
|
index 5af48151159135b869ec4753bbcf79dd257c1570..6c4425c08ea4a4444bac50fe5cf587870d9576a5 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
@@ -619,7 +619,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
@@ -620,7 +620,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||||
|
|
||||||
this.setLeftHanded(nbt.getBoolean("LeftHanded"));
|
this.setLeftHanded(nbt.getBoolean("LeftHanded"));
|
||||||
if (nbt.contains("DeathLootTable", 8)) {
|
if (nbt.contains("DeathLootTable", 8)) {
|
||||||
@ -97,7 +97,7 @@ index a18aadbf7ae83713e1f2b21553185d8000bc7699..f5ad7ddf13cbb6452c2927aef9b54eae
|
|||||||
|
|
||||||
// Paper start - cook speed API
|
// Paper start - cook speed API
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BrushableBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BrushableBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BrushableBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BrushableBlockEntity.java
|
||||||
index 0425151e688966442340ea1cf892aff34ffe0791..244b04e0020b1bd1e7be34a1b6266a8ac75d29fc 100644
|
index b5b1831631e233a96b6fd55972a8862b0f420da8..a086f12c09a5e38f63c8de118fcb5a6a30e40b52 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BrushableBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/BrushableBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BrushableBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/BrushableBlockEntity.java
|
||||||
@@ -199,7 +199,7 @@ public class BrushableBlockEntity extends BlockEntity {
|
@@ -199,7 +199,7 @@ public class BrushableBlockEntity extends BlockEntity {
|
||||||
@ -110,17 +110,17 @@ index 0425151e688966442340ea1cf892aff34ffe0791..244b04e0020b1bd1e7be34a1b6266a8a
|
|||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
||||||
index 081691f9710ff1115e4308f79ed49fbc38941193..c29dfd15e147d5c4d9c9584ff7803c2a52009f0d 100644
|
index 64875525df244db838560f5fefb7b1b07b0f1f51..fd490db7431404b0324e5ade474ec95d694aa489 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
||||||
@@ -46,7 +46,7 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc
|
@@ -50,7 +50,7 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc
|
||||||
protected boolean tryLoadLootTable(CompoundTag nbt) {
|
// Copied from super with changes, always check the original method
|
||||||
this.lootableData.loadNbt(nbt); // Paper
|
this.lootableData.loadNbt(nbt); // Paper
|
||||||
if (nbt.contains("LootTable", 8)) {
|
if (nbt.contains("LootTable", 8)) {
|
||||||
- this.lootTable = new ResourceLocation(nbt.getString("LootTable"));
|
- this.setLootTable(new ResourceLocation(nbt.getString("LootTable")));
|
||||||
+ this.lootTable = ResourceLocation.tryParse(nbt.getString("LootTable")); // Scissors - Validate loot tables
|
+ this.setLootTable(ResourceLocation.tryParse((nbt.getString("LootTable")))); // Scissors - Validate loot tables
|
||||||
try { org.bukkit.craftbukkit.util.CraftNamespacedKey.fromMinecraft(this.lootTable); } catch (IllegalArgumentException ex) { this.lootTable = null; } // Paper - validate
|
try { org.bukkit.craftbukkit.util.CraftNamespacedKey.fromMinecraft(this.lootTable); } catch (IllegalArgumentException ex) { this.lootTable = null; } // Paper - validate
|
||||||
this.lootTableSeed = nbt.getLong("LootTableSeed");
|
this.setLootTableSeed(nbt.getLong("LootTableSeed"));
|
||||||
return false; // Paper - always load the items, table may still remain
|
return false; // Paper - always load the items, table may still remain
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java b/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java b/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java
|
||||||
index f6942cb3ef1f9ef03708d4bc932ea9aeb1c13894..8b32864bafb3c1948993688be8f639dd6492057e 100644
|
index f6942cb3ef1f9ef03708d4bc932ea9aeb1c13894..8b32864bafb3c1948993688be8f639dd6492057e 100644
|
||||||
@ -144,20 +144,21 @@ index f6942cb3ef1f9ef03708d4bc932ea9aeb1c13894..8b32864bafb3c1948993688be8f639dd
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java
|
||||||
index 313ee5c8737b2e57f9b5db6512c1871766b2ccd4..aa7fa17b9fb8519d8b57e27a5b422249b9b875d8 100644
|
index 313ee5c8737b2e57f9b5db6512c1871766b2ccd4..a115a13ec911884a804800fc13f0347be1a30932 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java
|
||||||
@@ -33,8 +33,14 @@ public abstract class CraftMinecartContainer extends CraftMinecart implements Lo
|
@@ -33,8 +33,15 @@ public abstract class CraftMinecartContainer extends CraftMinecart implements Lo
|
||||||
return null; // return empty loot table?
|
return null; // return empty loot table?
|
||||||
}
|
}
|
||||||
|
|
||||||
- NamespacedKey key = CraftNamespacedKey.fromMinecraft(nmsTable);
|
- NamespacedKey key = CraftNamespacedKey.fromMinecraft(nmsTable);
|
||||||
- return Bukkit.getLootTable(key);
|
- return Bukkit.getLootTable(key);
|
||||||
+ // Scissors start - Return a null loot table if the specified loot table is not valid
|
+ // Scissors start - Return a null loot table if the specified loot table is not valid
|
||||||
+ try {
|
+ try
|
||||||
|
+ {
|
||||||
+ NamespacedKey key = CraftNamespacedKey.fromMinecraft(nmsTable);
|
+ NamespacedKey key = CraftNamespacedKey.fromMinecraft(nmsTable);
|
||||||
+ return Bukkit.getLootTable(key);
|
+ return Bukkit.getLootTable(key);
|
||||||
+ } catch (Exception ex) {
|
+ } catch (Exception exception) {
|
||||||
+ return null;
|
+ return null;
|
||||||
+ }
|
+ }
|
||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
@ -165,17 +166,18 @@ index 313ee5c8737b2e57f9b5db6512c1871766b2ccd4..aa7fa17b9fb8519d8b57e27a5b422249
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||||
index b4e45d8e9851552f30c9c29d3d9671e1e9094c38..4e8e1a6b718d9ec8720efb648ab023e9e39f67e3 100644
|
index 5f6a1fb323782816f706ccf7df922cb203238302..21b4594379a5e904ad60f9c9512ace94e7ed5f68 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||||
@@ -80,8 +80,14 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
|
@@ -80,8 +80,15 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LootTable getLootTable() {
|
public LootTable getLootTable() {
|
||||||
- NamespacedKey key = CraftNamespacedKey.fromMinecraft(this.getHandle().getLootTable());
|
- NamespacedKey key = CraftNamespacedKey.fromMinecraft(this.getHandle().getLootTable());
|
||||||
- return Bukkit.getLootTable(key);
|
- return Bukkit.getLootTable(key);
|
||||||
+ // Scissors start - Return a null loot table if the specified loot table is not valid
|
+ // Scissors start - Return a null loot table if the specified loot table is not valid
|
||||||
+ try {
|
+ try
|
||||||
|
+ {
|
||||||
+ NamespacedKey key = CraftNamespacedKey.fromMinecraft(this.getHandle().getLootTable());
|
+ NamespacedKey key = CraftNamespacedKey.fromMinecraft(this.getHandle().getLootTable());
|
||||||
+ return Bukkit.getLootTable(key);
|
+ return Bukkit.getLootTable(key);
|
||||||
+ } catch (Exception ex) {
|
+ } catch (Exception ex) {
|
Loading…
Reference in New Issue
Block a user