From ef691bfb1294d5f1aa23a4c4627cc757a7500f22 Mon Sep 17 00:00:00 2001 From: James Lyne Date: Thu, 8 Jan 2026 18:39:02 +0000 Subject: [PATCH] Fix hardcoded obsidian check when igniting a portal (#1750) --- build-data/purpur.at | 1 + .../world/level/block/BaseFireBlock.java.patch | 11 +++++++++++ .../world/level/portal/PortalShape.java.patch | 4 ++-- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/BaseFireBlock.java.patch diff --git a/build-data/purpur.at b/build-data/purpur.at index bd47c89a1..93e0d4618 100644 --- a/build-data/purpur.at +++ b/build-data/purpur.at @@ -7,5 +7,6 @@ public net.minecraft.world.entity.monster.Shulker MAX_SCALE public net.minecraft.world.entity.player.Player canGlide()Z public net.minecraft.world.level.block.ShulkerBoxBlock canOpen(Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/entity/ShulkerBoxBlockEntity;)Z public net.minecraft.world.level.block.entity.FuelValues values +public net.minecraft.world.level.portal.PortalShape FRAME public-f net.minecraft.world.entity.EntityType dimensions public-f net.minecraft.world.level.block.state.BlockBehaviour explosionResistance diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/BaseFireBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/BaseFireBlock.java.patch new file mode 100644 index 000000000..952b74ba8 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/BaseFireBlock.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/block/BaseFireBlock.java ++++ b/net/minecraft/world/level/block/BaseFireBlock.java +@@ -208,7 +_,7 @@ + boolean flag = false; + + for (Direction direction1 : Direction.values()) { +- if (level.getBlockState(mutableBlockPos.set(pos).move(direction1)).is(Blocks.OBSIDIAN)) { ++ if (PortalShape.FRAME.test(level.getBlockState(mutableBlockPos.set(pos).move(direction1)), level, mutableBlockPos)) { // Purpur - Crying obsidian valid for portal frames + flag = true; + break; + } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/portal/PortalShape.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/portal/PortalShape.java.patch index bb195b4da..3fee8ca9f 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/portal/PortalShape.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/portal/PortalShape.java.patch @@ -4,8 +4,8 @@ public static final int MAX_WIDTH = 21; private static final int MIN_HEIGHT = 3; public static final int MAX_HEIGHT = 21; -- private static final BlockBehaviour.StatePredicate FRAME = (state, level, pos) -> state.is(Blocks.OBSIDIAN); -+ private static final BlockBehaviour.StatePredicate FRAME = (state, level, pos) -> state.is(Blocks.OBSIDIAN) || (org.purpurmc.purpur.PurpurConfig.cryingObsidianValidForPortalFrame && state.is(Blocks.CRYING_OBSIDIAN)); // Purpur - Crying obsidian valid for portal frames +- public static final BlockBehaviour.StatePredicate FRAME = (state, level, pos) -> state.is(Blocks.OBSIDIAN); ++ public static final BlockBehaviour.StatePredicate FRAME = (state, level, pos) -> state.is(Blocks.OBSIDIAN) || (org.purpurmc.purpur.PurpurConfig.cryingObsidianValidForPortalFrame && state.is(Blocks.CRYING_OBSIDIAN)); // Purpur - Crying obsidian valid for portal frames private static final float SAFE_TRAVEL_MAX_ENTITY_XY = 4.0F; private static final double SAFE_TRAVEL_MAX_VERTICAL_DELTA = 1.0; private final Direction.Axis axis;