mirror of
https://github.com/PaperMC/Paper.git
synced 2024-10-31 16:00:18 +01:00
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
@ -482,10 +482,10 @@ index 0000000000000000000000000000000000000000..c01b4393439838976965823298f12e47
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..57e6e857c84234bf0c137058ae35e6fb0e9b124f
|
||||
index 0000000000000000000000000000000000000000..7a53374319d5495253f277199114eaf43097456d
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
@@ -0,0 +1,309 @@
|
||||
@@ -0,0 +1,311 @@
|
||||
+package io.papermc.paper.configuration;
|
||||
+
|
||||
+import co.aikar.timings.MinecraftTimings;
|
||||
@ -635,6 +635,8 @@ index 0000000000000000000000000000000000000000..57e6e857c84234bf0c137058ae35e6fb
|
||||
+ public UnsupportedSettings unsupportedSettings;
|
||||
+
|
||||
+ public class UnsupportedSettings extends ConfigurationPart {
|
||||
+ @Comment("This setting allows for exploits related to end portals, for example sand duping")
|
||||
+ public boolean allowUnsafeEndPortalTeleportation = false;
|
||||
+ @Comment("This setting controls if players should be able to break bedrock, end portals and other intended to be permanent blocks.")
|
||||
+ public boolean allowPermanentBlockBreakExploits = false;
|
||||
+ @Comment("This setting controls if player should be able to use TNT duplication, but this also allows duplicating carpet, rails and potentially other items")
|
||||
|
@ -1,36 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
||||
Date: Fri, 12 Jun 2020 13:33:19 -0700
|
||||
Subject: [PATCH] Fix sand duping
|
||||
|
||||
If the falling block dies during teleportation (entity#move), then we need
|
||||
to detect that by placing a check after the move.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||
index c0477f913867c67809978a4f240303151d81e6ea..33cc2d1a4723ec07c4201eb6e0080d5e0281e1f0 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||
@@ -132,6 +132,11 @@ public class FallingBlockEntity extends Entity {
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
+ // Paper start - fix sand duping
|
||||
+ if (this.isRemoved()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // Paper end - fix sand duping
|
||||
if (this.blockState.isAir()) {
|
||||
this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
|
||||
} else {
|
||||
@@ -143,6 +148,11 @@ public class FallingBlockEntity extends Entity {
|
||||
}
|
||||
|
||||
this.move(MoverType.SELF, this.getDeltaMovement());
|
||||
+ // Paper start - fix sand duping
|
||||
+ if (this.isRemoved()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // Paper end - fix sand duping
|
||||
// Paper start - Configurable falling blocks height nerf
|
||||
if (this.level().paperConfig().fixes.fallingBlockHeightNerf.test(v -> this.getY() > v)) {
|
||||
if (this.dropItem && this.level().getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
|
@ -13,7 +13,7 @@ behaviour, we need to move all of this dangerous logic outside
|
||||
of the move call and into an appropriate place in the tick method.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 874a1998b6aaff9f4c7818481298ad51e1adc525..67470ad0c09ae94e5fab775a28cdefdf1241c5fa 100644
|
||||
index c0907af0169862702a4f28985d141c0acb506f51..2eeeb1f1b07db439a68d70c55192aa9fb54f620c 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1366,6 +1366,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@ -18,7 +18,7 @@ index e8b12b27e5ec74afb940f575e5ce78e5905d55f4..c3eb4b6372eed0b7eb636f495ce494b6
|
||||
return false;
|
||||
} else if (this.player.blockActionRestricted(this.level, pos, this.gameModeForPlayer)) {
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 98826ba4ab062e029359968c221ba320b2d2daeb..e9a3edbb66c79664f35150f052b6ff3534d0904c 100644
|
||||
index 80b6871516c45291f63b1ae521dcdf34199fd9b4..d78d411879275f11f395b4f9c94b7aab88342236 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -778,7 +778,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@ -30,7 +30,7 @@ index d4dba8c733c7560e5108b8d239b52e593f8debec..ea48f1119a940056c37d1d203437bfbf
|
||||
public CraftAttributeMap(AttributeMap handle) {
|
||||
this.handle = handle;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
index 629fa76e6c7c2ede36ab855bb3a7a65dfd601449..a3713c5ab624b8d54ddcd69ae7587346ebbaed69 100644
|
||||
index 7cf1153ae532a9d53ee85b05f77ed74b94cf5fbc..27be5da67801be6fd99c91576064e4be0b3f0d6c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
@@ -485,7 +485,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
@ -57,7 +57,7 @@ index e69043316372d98b122ed3788fda79cdd36849e8..6597e6e9987ddb5906909c22704fdfb6
|
||||
} catch (Exception ex) {
|
||||
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index d6bddec130167af3d72555535045568ee941bb88..6e9fc623f5a56753e2c78c3ff63c6f4de7cbcccb 100644
|
||||
index 5ba0fa6fda6d496f7540185e6dc58439cc1e04f1..16d1338df730fd66c079b66117cbef91786f2146 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -3056,6 +3056,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add playPickupItemAnimation to LivingEntity
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 9a9d119e76fca75a9e531f4bbd204ab8eb9a1263..bf581842476b8f554987b452c291a55a1dfc92c5 100644
|
||||
index c4db692fb5d952e4d185067388fd46ed0e1f1537..e07553c3ee28a2510c46a8188c8ce507f2567c80 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -949,5 +949,10 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Fix SpawnChangeEvent not firing for all use-cases
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index d2da284aa7284c5205e656c48262061980893be6..aa2f23c4f7d25d0f92ff025bb1840aff1b053fa3 100644
|
||||
index 9af1877321356348ad96b92ae8c5f4811bef50ac..2e42e09d3fa19e5a16374ee6ac1677dd2b2004f1 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1726,9 +1726,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@ -6,7 +6,7 @@ Subject: [PATCH] Prevent headless pistons from being created
|
||||
Prevent headless pistons from being created by explosions or tree/mushroom growth.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
index b03b4d366cae39081a7b70524e8615c986d76362..cd939ab6958e8eb632056d32f68e2fcae7735d64 100644
|
||||
index b057a67a416928ae30bd407b3da982b73ae3be03..2d1fe6af7923ad4a0143f2d3fd28abc85e6092c1 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
@@ -205,6 +205,15 @@ public class Explosion {
|
@ -31,7 +31,7 @@ index 789576f8b7b3001c243972b320b7dffbbf3baa5f..3b73565d295c09a5ab0d610338498f01
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index dfea1879b8ab8d12bc7530ccf409f4d24978105d..a3d1f7ccac58cfec8f50dbdb3a620daa4894fffb 100644
|
||||
index 11a9142962637af5e26939a5eb8f35ba5f205793..f839ab6dea7f1efd59f22bcef91d4e279b1c232a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -162,6 +162,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@ -6,7 +6,7 @@ Subject: [PATCH] Extend block drop capture to capture all items added to the
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index aa2f23c4f7d25d0f92ff025bb1840aff1b053fa3..a668e204946943bcc963ad41ea3029111267eef9 100644
|
||||
index 2e42e09d3fa19e5a16374ee6ac1677dd2b2004f1..283f686364691f54d9e9e925b33238526de74219 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1224,6 +1224,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@ -11,7 +11,7 @@ This ensures the crystals/pillars are in expected state when the dragon spawns.
|
||||
See #3522
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
index cad7a1b28c9d7a3e67dbf0865cbf232ebd39a8d9..3953bbfdaf3e93468108d194c215e6242e14f067 100644
|
||||
index 1c716cf65d77e54ba8f90c8cf736e20c64f5df2e..f615b7f43f1444cf1e34b92cb0c05242a5dc26fd 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
@@ -472,6 +472,7 @@ public class EndDragonFight {
|
@ -6,7 +6,7 @@ Subject: [PATCH] Fix for large move vectors crashing server
|
||||
Check movement distance also based on current position.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 4e37b9a495babec58f60b59db0e034d5e033b198..5e605b9bdb76ca0c9529e7351432578855cc7fa2 100644
|
||||
index 3b73565d295c09a5ab0d610338498f01c7b1520d..e08c3e0d09896da60cbec7923882bc2263de1bae 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -472,9 +472,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@ -10,7 +10,7 @@ In general, look at making this logic more robust (i.e properly handling
|
||||
cases where a captured entry is overriden) - but for now this will do.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index caf2c9799aa5ddbd5caf160e2c8f2e8f0cdaa1f8..9879f9fd804f93faae4419add2c4c64fc6902ba1 100644
|
||||
index cb6c6e8c8fe744350a117f38e474ce8f5dd0a43a..1bb7cc9462cab7fbd09b944662711ae5bc5cf950 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -154,7 +154,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Fix Player spawnParticle x/y/z precision loss
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 6e9fc623f5a56753e2c78c3ff63c6f4de7cbcccb..ec4ebbdde676806c4b2348408a8004dd66cbc44b 100644
|
||||
index 16d1338df730fd66c079b66117cbef91786f2146..f9188664f868c0c55c92c0ec7ca43204d267b91e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2619,7 +2619,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add LivingEntity#clearActiveItem
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index bf581842476b8f554987b452c291a55a1dfc92c5..e71f71988790af1a09f65d73dd081490002b821c 100644
|
||||
index e07553c3ee28a2510c46a8188c8ce507f2567c80..aac0fb198fb912dc59dc56f449e586839600fa13 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -916,6 +916,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Climbing should not bypass cramming gamerule
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 2b962ef7f167cc3ee17d26b994b6ecc2916f6242..a0c4f6edc87d653bcbe23621bfcf9fbbd20b013d 100644
|
||||
index f33067ea049793d898def3c83bff5b36490f8232..3b9c691973f11b7d4db8fb77d2b02aa0d07ed7b5 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -1983,6 +1983,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user