Skip to content

Commit ef691bf

Browse files
authored
Fix hardcoded obsidian check when igniting a portal (#1750)
1 parent 2751aa1 commit ef691bf

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

build-data/purpur.at

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ public net.minecraft.world.entity.monster.Shulker MAX_SCALE
77
public net.minecraft.world.entity.player.Player canGlide()Z
88
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
99
public net.minecraft.world.level.block.entity.FuelValues values
10+
public net.minecraft.world.level.portal.PortalShape FRAME
1011
public-f net.minecraft.world.entity.EntityType dimensions
1112
public-f net.minecraft.world.level.block.state.BlockBehaviour explosionResistance
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/net/minecraft/world/level/block/BaseFireBlock.java
2+
+++ b/net/minecraft/world/level/block/BaseFireBlock.java
3+
@@ -208,7 +_,7 @@
4+
boolean flag = false;
5+
6+
for (Direction direction1 : Direction.values()) {
7+
- if (level.getBlockState(mutableBlockPos.set(pos).move(direction1)).is(Blocks.OBSIDIAN)) {
8+
+ if (PortalShape.FRAME.test(level.getBlockState(mutableBlockPos.set(pos).move(direction1)), level, mutableBlockPos)) { // Purpur - Crying obsidian valid for portal frames
9+
flag = true;
10+
break;
11+
}

purpur-server/minecraft-patches/sources/net/minecraft/world/level/portal/PortalShape.java.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
public static final int MAX_WIDTH = 21;
55
private static final int MIN_HEIGHT = 3;
66
public static final int MAX_HEIGHT = 21;
7-
- private static final BlockBehaviour.StatePredicate FRAME = (state, level, pos) -> state.is(Blocks.OBSIDIAN);
8-
+ 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
7+
- public static final BlockBehaviour.StatePredicate FRAME = (state, level, pos) -> state.is(Blocks.OBSIDIAN);
8+
+ 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
99
private static final float SAFE_TRAVEL_MAX_ENTITY_XY = 4.0F;
1010
private static final double SAFE_TRAVEL_MAX_VERTICAL_DELTA = 1.0;
1111
private final Direction.Axis axis;

0 commit comments

Comments
 (0)