mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Do not create nether portals that delete undestroyable blocks
Fixes https://github.com/PaperMC/Paper/issues/5773
This commit is contained in:
parent
92c68e2367
commit
36e77c4c63
1 changed files with 18 additions and 0 deletions
|
@ -170,3 +170,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
}
|
||||
|
||||
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
|
||||
@@ -0,0 +0,0 @@ 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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue