From c3d50184ebd2617ca067623558feb2baa6f08948 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Tue, 7 Sep 2021 15:10:48 -0700 Subject: [PATCH] Do not create nether portals that delete undestroyable blocks Fixes https://github.com/PaperMC/Paper/issues/5773 --- ...-and-End-Portal-Frames-from-being-des.patch | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/patches/server/0439-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch b/patches/server/0439-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch index 0f114ace6..31d644b1d 100644 --- a/patches/server/0439-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch +++ b/patches/server/0439-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch @@ -170,3 +170,21 @@ index a087eec747bb355afd627c6042d20440c3e43e1b..bea9c7ac0fe08c3ca3309e8311f192cc } public boolean isSolidRender(BlockGetter world, BlockPos pos) { +diff --git a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java +index d5ba2e679ed1858ea18e18feffce50544ae036c2..ca3e143e641933fa6b9499bbaaa1836877d90c52 100644 +--- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java ++++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java +@@ -209,6 +209,13 @@ public class PortalForcer { + for (int j = -1; j < 3; ++j) { + for (int k = -1; k < 4; ++k) { + temp.setWithOffset((Vec3i) pos, portalDirection.getStepX() * j + enumdirection1.getStepX() * distanceOrthogonalToPortal, k, portalDirection.getStepZ() * j + enumdirection1.getStepZ() * distanceOrthogonalToPortal); ++ // Paper start - prevent destroying unbreakable blocks ++ if (!com.destroystokyo.paper.PaperConfig.allowBlockPermanentBreakingExploits) { ++ if (!this.level.getBlockState(temp).isDestroyable()) { ++ return false; ++ } ++ } ++ // Paper end - prevent destroying unbreakable blocks + if (k < 0 && !this.level.getBlockState(temp).getMaterial().isSolid()) { + return false; + }