mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
More leaf dupe fixes \o/
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
From cb226719b349208513caaaca05399da238d102b9 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 12 Jun 2020 16:15:12 -0500
|
||||
Subject: [PATCH] PaperPR - Fix more exploits (carpet dupe, rail dupe, bedrock
|
||||
destroying, falling block (sand/dragon egg/etc) duping)
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/BlockPiston.java | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockPiston.java b/src/main/java/net/minecraft/server/BlockPiston.java
|
||||
index 9cca30a94f..3bd3a1fe84 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockPiston.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockPiston.java
|
||||
@@ -373,11 +373,13 @@ public class BlockPiston extends BlockDirectional {
|
||||
}
|
||||
|
||||
for (k = list.size() - 1; k >= 0; --k) {
|
||||
- blockposition3 = (BlockPosition) list.get(k);
|
||||
- iblockdata1 = world.getType(blockposition3); map.replace(blockposition3, iblockdata1); // Paper - fix piston physics inconsistency
|
||||
+ BlockPosition oldPos = blockposition3 = (BlockPosition) list.get(k); // Purpur
|
||||
+ iblockdata1 = null; // Purpur - explode if usage changes
|
||||
blockposition3 = blockposition3.shift(enumdirection1);
|
||||
map.remove(blockposition3);
|
||||
world.setTypeAndData(blockposition3, (IBlockData) Blocks.MOVING_PISTON.getBlockData().set(BlockPiston.FACING, enumdirection), 68);
|
||||
+ iblockdata1 = world.getType(oldPos); map.replace(oldPos, iblockdata1); // Purpur - fix piston physics inconsistency - move after the physics update
|
||||
+ world.setTypeAndData(oldPos, Blocks.AIR.getBlockData(), 68); // Purpur - set air to prevent later physics updates from seeing this block
|
||||
world.setTileEntity(blockposition3, BlockPistonMoving.a(iblockdata1, enumdirection, flag, false)); // Paper - fix piston physics inconsistency
|
||||
--j;
|
||||
aiblockdata[j] = iblockdata1;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
From b1eef399a5c08c3c448b6cf0586a722ecc1be265 Mon Sep 17 00:00:00 2001
|
||||
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
||||
Date: Fri, 12 Jun 2020 11:45:41 -0700
|
||||
Subject: [PATCH] PaperPR - fixup! Protect Bedrock and End Portal/Frames from
|
||||
being destroyed
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/Block.java | 3 ++-
|
||||
.../java/net/minecraft/server/BlockPiston.java | 17 +++++++++++++++--
|
||||
2 files changed, 17 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
|
||||
index 8985d0ee9d..97e553b38c 100644
|
||||
--- a/src/main/java/net/minecraft/server/Block.java
|
||||
+++ b/src/main/java/net/minecraft/server/Block.java
|
||||
@@ -37,7 +37,8 @@ public class Block implements IMaterial {
|
||||
this != Blocks.BEDROCK &&
|
||||
this != Blocks.END_PORTAL_FRAME &&
|
||||
this != Blocks.END_PORTAL &&
|
||||
- this != Blocks.END_GATEWAY;
|
||||
+ this != Blocks.END_GATEWAY &&
|
||||
+ this != Blocks.MOVING_PISTON; // try to prevent creation of headless pistons
|
||||
}
|
||||
public co.aikar.timings.Timing timing;
|
||||
public co.aikar.timings.Timing getTiming() {
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockPiston.java b/src/main/java/net/minecraft/server/BlockPiston.java
|
||||
index 3bd3a1fe84..03144ecca9 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockPiston.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockPiston.java
|
||||
@@ -175,6 +175,12 @@ public class BlockPiston extends BlockDirectional {
|
||||
@Override
|
||||
public boolean a(IBlockData iblockdata, World world, BlockPosition blockposition, int i, int j) {
|
||||
EnumDirection enumdirection = (EnumDirection) iblockdata.get(BlockPiston.FACING);
|
||||
+ // Paper start - prevent retracting when we're facing the wrong way (we were replaced before retraction could occurr)
|
||||
+ EnumDirection directionQueuedAs = EnumDirection.fromType1(j & 7); // Paper - copied from below
|
||||
+ if (!com.destroystokyo.paper.PaperConfig.allowBlockPermanentBreakingExploits && enumdirection != directionQueuedAs) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Paper end - prevent retracting when we're facing the wrong way
|
||||
|
||||
if (!world.isClientSide) {
|
||||
boolean flag = this.a(world, blockposition, enumdirection);
|
||||
@@ -204,7 +210,7 @@ public class BlockPiston extends BlockDirectional {
|
||||
}
|
||||
|
||||
world.setTypeAndData(blockposition, (IBlockData) ((IBlockData) Blocks.MOVING_PISTON.getBlockData().set(BlockPistonMoving.a, enumdirection)).set(BlockPistonMoving.b, this.sticky ? BlockPropertyPistonType.STICKY : BlockPropertyPistonType.DEFAULT), 3);
|
||||
- world.setTileEntity(blockposition, BlockPistonMoving.a((IBlockData) this.getBlockData().set(BlockPiston.FACING, EnumDirection.fromType1(j & 7)), enumdirection, false, true));
|
||||
+ world.setTileEntity(blockposition, BlockPistonMoving.a((IBlockData) this.getBlockData().set(BlockPiston.FACING, EnumDirection.fromType1(j & 7)), enumdirection, false, true)); // Paper - diff on change, j is facing direction
|
||||
if (this.sticky) {
|
||||
BlockPosition blockposition1 = blockposition.b(enumdirection.getAdjacentX() * 2, enumdirection.getAdjacentY() * 2, enumdirection.getAdjacentZ() * 2);
|
||||
IBlockData iblockdata1 = world.getType(blockposition1);
|
||||
@@ -232,7 +238,14 @@ public class BlockPiston extends BlockDirectional {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
- world.a(blockposition.shift(enumdirection), false);
|
||||
+ // Paper start - fix headless pistons breaking blocks
|
||||
+ BlockPosition headPos = blockposition.shift(enumdirection);
|
||||
+ if (com.destroystokyo.paper.PaperConfig.allowBlockPermanentBreakingExploits || world.getType(headPos).getBlock() == Blocks.PISTON_HEAD) { // double check to make sure we're not a headless piston.
|
||||
+ world.setAir(headPos, false);
|
||||
+ } else {
|
||||
+ ((WorldServer)world).getChunkProvider().flagDirty(headPos); // ... fix client desync
|
||||
+ }
|
||||
+ // Paper end - fix headless pistons breaking blocks
|
||||
}
|
||||
|
||||
world.playSound((EntityHuman) null, blockposition, SoundEffects.BLOCK_PISTON_CONTRACT, SoundCategory.BLOCKS, 0.5F, world.random.nextFloat() * 0.15F + 0.6F);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
43
patches/server/0126-PaperPR-Fix-sand-duping.patch
Normal file
43
patches/server/0126-PaperPR-Fix-sand-duping.patch
Normal file
@@ -0,0 +1,43 @@
|
||||
From b1189325f8f73cd7f91a349a2b28ccef384c2f87 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] PaperPR - 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.
|
||||
---
|
||||
.../java/net/minecraft/server/EntityFallingBlock.java | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
|
||||
index 6683f7c5f3..243a8c570d 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
|
||||
@@ -64,6 +64,11 @@ public class EntityFallingBlock extends Entity {
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
+ // Paper start - fix sand duping
|
||||
+ if (this.dead) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // Paper end - fix sand duping
|
||||
if (this.block.isAir()) {
|
||||
this.die();
|
||||
} else {
|
||||
@@ -86,6 +91,12 @@ public class EntityFallingBlock extends Entity {
|
||||
|
||||
this.move(EnumMoveType.SELF, this.getMot());
|
||||
|
||||
+ // Paper start - fix sand duping
|
||||
+ if (this.dead) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // Paper end - fix sand duping
|
||||
+
|
||||
// Paper start - Configurable EntityFallingBlock height nerf
|
||||
if (this.world.paperConfig.fallingBlockHeightNerf != 0 && this.locY() > this.world.paperConfig.fallingBlockHeightNerf) {
|
||||
if (this.dropItem && this.world.getGameRules().getBoolean(GameRules.DO_ENTITY_DROPS)) {
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 36f4d435f05b0e58619bcc490bf0911ecfa53357 Mon Sep 17 00:00:00 2001
|
||||
From f07e5a8ff174e674d80ea0ea9d544d62f5925c77 Mon Sep 17 00:00:00 2001
|
||||
From: Spottedleaf <spottedleaf@spottedleaf.dev>
|
||||
Date: Fri, 3 Apr 2020 02:21:13 -0700
|
||||
Subject: [PATCH] Tuinity - Always able to execute tasks on the main server
|
||||
@@ -1,4 +1,4 @@
|
||||
From b5a02a810c1e1d1256e54a945866ae328b2773ba Mon Sep 17 00:00:00 2001
|
||||
From 50f676afc116eca4eb95ccd6cbd08bc2e20ecaad Mon Sep 17 00:00:00 2001
|
||||
From: tr7zw <tr7zw@live.de>
|
||||
Date: Thu, 5 Mar 2020 23:08:01 +0100
|
||||
Subject: [PATCH] YAPFA - Disable mojang profiler
|
||||
Reference in New Issue
Block a user