-
-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added getBubbleColumnDirection IBlockExtension hook to reduce BubbleC…
…olumn hardcoding (#931)
- Loading branch information
1 parent
2cabd5b
commit 86876fa
Showing
6 changed files
with
151 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
patches/net/minecraft/world/level/block/BubbleColumnBlock.java.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- a/net/minecraft/world/level/block/BubbleColumnBlock.java | ||
+++ b/net/minecraft/world/level/block/BubbleColumnBlock.java | ||
@@ -121,10 +_,12 @@ | ||
private static BlockState getColumnState(BlockState p_152718_) { | ||
if (p_152718_.is(Blocks.BUBBLE_COLUMN)) { | ||
return p_152718_; | ||
- } else if (p_152718_.is(Blocks.SOUL_SAND)) { | ||
+ } | ||
+ net.neoforged.neoforge.common.enums.BubbleColumnDirection bubbleColumnDirection = p_152718_.getBubbleColumnDirection(); // Neo: PR #931 | ||
+ if (bubbleColumnDirection == net.neoforged.neoforge.common.enums.BubbleColumnDirection.UPWARD) { | ||
return Blocks.BUBBLE_COLUMN.defaultBlockState().setValue(DRAG_DOWN, Boolean.valueOf(false)); | ||
} else { | ||
- return p_152718_.is(Blocks.MAGMA_BLOCK) | ||
+ return bubbleColumnDirection == net.neoforged.neoforge.common.enums.BubbleColumnDirection.DOWNWARD | ||
? Blocks.BUBBLE_COLUMN.defaultBlockState().setValue(DRAG_DOWN, Boolean.valueOf(true)) | ||
: Blocks.WATER.defaultBlockState(); | ||
} | ||
@@ -190,7 +_,7 @@ | ||
@Override | ||
protected boolean canSurvive(BlockState p_50986_, LevelReader p_50987_, BlockPos p_50988_) { | ||
BlockState blockstate = p_50987_.getBlockState(p_50988_.below()); | ||
- return blockstate.is(Blocks.BUBBLE_COLUMN) || blockstate.is(Blocks.MAGMA_BLOCK) || blockstate.is(Blocks.SOUL_SAND); | ||
+ return blockstate.is(Blocks.BUBBLE_COLUMN) || blockstate.getBubbleColumnDirection() != net.neoforged.neoforge.common.enums.BubbleColumnDirection.NONE; // Neo: PR #931 | ||
} | ||
|
||
@Override |
12 changes: 12 additions & 0 deletions
12
src/main/java/net/neoforged/neoforge/common/enums/BubbleColumnDirection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* Copyright (c) NeoForged and contributors | ||
* SPDX-License-Identifier: LGPL-2.1-only | ||
*/ | ||
|
||
package net.neoforged.neoforge.common.enums; | ||
|
||
public enum BubbleColumnDirection { | ||
UPWARD, | ||
DOWNWARD, | ||
NONE | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/net/neoforged/neoforge/common/enums/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* Copyright (c) NeoForged and contributors | ||
* SPDX-License-Identifier: LGPL-2.1-only | ||
*/ | ||
|
||
@FieldsAreNonnullByDefault | ||
@MethodsReturnNonnullByDefault | ||
@ParametersAreNonnullByDefault | ||
package net.neoforged.neoforge.common.enums; | ||
|
||
import javax.annotation.ParametersAreNonnullByDefault; | ||
import net.minecraft.FieldsAreNonnullByDefault; | ||
import net.minecraft.MethodsReturnNonnullByDefault; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters