Allow enabling sand duping (#10191)
Because this exploit has been widely known for years and has not been fixed by Mojang, we decided that it was worth allowing people to toggle it on/off due to how easy it is to make it configurable. It should be noted that this decision does not promise all future exploits will be configurable.
This commit is contained in:
parent
b21eb4d9a4
commit
89d51d5f29
673 changed files with 157 additions and 189 deletions
30
patches/server/0566-Attributes-API-for-item-defaults.patch
Normal file
30
patches/server/0566-Attributes-API-for-item-defaults.patch
Normal file
|
@ -0,0 +1,30 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||
Date: Sat, 8 May 2021 15:01:54 -0700
|
||||
Subject: [PATCH] Attributes API for item defaults
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 6eca86a2ab7145f4c60abb90cd46b4098ad8fb56..b89171cb89e3d38f3260ead8549cccde904db7c4 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -559,6 +559,19 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
return CraftMagicNumbers.getItem(itemToBeRepaired.getType()).isValidRepairItem(CraftItemStack.asNMSCopy(itemToBeRepaired), CraftItemStack.asNMSCopy(repairMaterial));
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public Multimap<Attribute, AttributeModifier> getItemAttributes(Material material, EquipmentSlot equipmentSlot) {
|
||||
+ Item item = CraftMagicNumbers.getItem(material);
|
||||
+ if (item == null) {
|
||||
+ throw new IllegalArgumentException(material + " is not an item and therefore does not have attributes");
|
||||
+ }
|
||||
+ ImmutableMultimap.Builder<Attribute, AttributeModifier> attributeMapBuilder = ImmutableMultimap.builder();
|
||||
+ item.getDefaultAttributeModifiers(CraftEquipmentSlot.getNMS(equipmentSlot)).forEach((attributeBase, attributeModifier) -> {
|
||||
+ attributeMapBuilder.put(CraftAttribute.stringToBukkit(net.minecraft.core.registries.BuiltInRegistries.ATTRIBUTE.getKey(attributeBase).toString()), CraftAttributeInstance.convert(attributeModifier, equipmentSlot));
|
||||
+ });
|
||||
+ return attributeMapBuilder.build();
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
public int getProtocolVersion() {
|
||||
return net.minecraft.SharedConstants.getCurrentVersion().getProtocolVersion();
|
Loading…
Add table
Add a link
Reference in a new issue